; M2(A&B).WAS - Logon to Noridian-M2 BBS ;************************************************************************************************* ;* M2(A&B).WAS Script for Institutional or Professional Providers to dial Noridian-M2 BBS. * ;* Developed for Procomm Plus 4.8 or higher. (080202) * ;************************************************************************************************* #define SERVICE "NoridianM2.bbs" #define NET_PASS "" string szTypeofClaim ;variable to determine if claim file is UB92 or HCFA-1500 string szClaimFile ;variable to store claim file name string szFilePath ;variable to store path of file to transmit string szFileTransmit ;variable telling BBS which file to transmit. Format = "U [path/file]^M" string szInstFile ;variable identifying Institutional claim file name string szProfFile ;variable identifying Professional claim file name integer CancelDial ;variable to cancel out of the script process following any prompt proc main string szLoginID ;login variable string szPassword ;password variable integer Choice = 0 szLoginID = "" ;NOTE: if a Login ID is entered within the quotes, the user will not be prompted to enter a Login Name prior to each BBS connection szInstFile = "BCTRANS.DAT" ;Institutional claim file szProfFile = "BSTRANS.DAT" ;Professional claim file szFilePath = "C:\WINPCACE" ;path of claim file while $TXCOUNT endwhile if $SCRIPTMODE != 5 set terminal type "ANSI-BBS" set port parity none set port databits 8 set port stopbits 1 set dialentry access DATA SERVICE CancelDial = 0 if success if nullstr szLoginID sdlginput "Login ID Entry" "Enter your Login ID:" szLoginID ;prompt for user BBS Login ID if success sdlginput "Password Entry" "Enter your password:" szPassword masked ;prompt for user BBS password if success Call InstorProf ;prompt user to determine type of claim being submitted which will detemine if BCTRANS.DAT or BSTRANS.DAT file is transmitted else CancelDial = 1 endif else CancelDial = 1 endif endif if CancelDial < 1 if nullstr szPassword sdlginput "Password Entry" "Enter your password:" szPassword masked ;prompt for user BBS password if success Call InstorProf ;prompt user to determine type of claim being submitted which will detemine if BCTRANS.DAT or BSTRANS.DAT file is transmitted else CancelDial = 1 endif endif endif if CancelDial < 1 Call FileExists ;error trap for existence of input path and BCTRANS.DAT or BSTRANS.DAT if CancelDial < 1 ;continue if user hasn't cancelled out of prompt dial DATA SERVICE ;dial BBS endif endif else errormsg "A dialing directory entry for %s was not found. Create an\ entry for %s." SERVICE SERVICE endif endif if CancelDial < 1 ;continue if user hasn't cancelled out of prompt while $DIALING endwhile pause 1 if $CARRIER waitfor "Logon:" 15 ;wait for BBS screen to prompt for user ID transmit szLoginID ;tranmsit users BBS Login ID transmit "^M" waitfor "Password:" ;wait for BBS screen to prompt for user password transmit szPassword ;transmit users BBS password transmit "^M" waitfor "LO) Logoff" ;wait for BBS to display menu options transmit "1^M" ;transmit '1' to send file waitfor "rz waiting to receive." szFileTransmit = "U " strcat szFileTransmit szFilePath strcat szFileTransmit "^M" transmit szFileTransmit ;tell host that we're sending file sendfile ZMODEM szFilePath ;upload using ZMODEM protocol while $XFERSTATUS ;pause script while transferring yield ;yield processing endwhile waitfor "Press enter to continue" 1 ;wait for confirmation of receipt transmit "^M" waitfor "LO) Logoff" ;wait for BBS to display menu options transmit "LO^M" ;transmit 'LO' to logoff call Cleanup while $CARRIER ;loop while connected yield ;yield processing time endwhile sdlgmsgbox "Process Complete" "Process Complete - Connection Terminated" information OK Choice else errormsg "Sorry, connection not established." endif else errormsg "You have cancelled your attempt to establish a connection." endif endproc proc InstorProf integer IorPTest ;variable to test for appropriate user response. 0=Not defined, 1=Defined, 2=User cancelled. IorPTest = 0 while (IorPTest) < 1 sdlginput "Institutional/Professional file" "Are you transmitting UB92 (I) or HCFA-1500 (P) claims? (Enter 'I' or 'P'):" szTypeofClaim ;prompt user to determine if claims are UB92 or HCFA-1500 if success if strcmp szTypeofClaim "I" IorPTest = 1 szClaimFile = szInstFile strcat szFilePath "\" strcat szFilePath szInstFile elseif strcmp szTypeofClaim "i" IorPTest = 1 szClaimFile = szInstFile strcat szFilePath "\" strcat szFilePath szInstFile elseif strcmp szTypeofClaim "P" IorPTest = 1 szClaimFile = szProfFile strcat szFilePath "\" strcat szFilePath szProfFile elseif strcmp szTypeofClaim "p" IorPTest = 1 szClaimFile = szProfFile strcat szFilePath "\" strcat szFilePath szProfFile else errormsg "Please enter either 'I' or 'P'." endif else CancelDial = 1 IorPTest = 2 endif yield endwhile ;repeat prompt until user enters I, i, P or p endproc proc FileExists integer FileExistsTest ;variable to test for file existence string szusermsg FileExistsTest = 0 if isfile szFilePath ;check the default location (C:\WINPCACE) for the file to transmit FileExistsTest = 1 else while FileExistsTest < 1 ;if transmit file is not in default location, prompt user until a valid path and filename are provided if strcmp szClaimFile szInstFile szusermsg = "Enter " strcat szusermsg szClaimFile strcat szusermsg " path (i.e. 'C:\WINPCACE'):" sdlginput "Location of file to transmit" szusermsg szFilePath ;prompt user for location of claim file else szusermsg = "Enter " strcat szusermsg szClaimFile strcat szusermsg " path (i.e. 'C:\WINPCACE'):" sdlginput "Location of file to transmit" szusermsg szFilePath ;prompt user for location of claim file endif if SUCCESS ;user entered 'OK' at prompt strcat szFilePath "\" strcat szFilePath szClaimFile if isfile szFilePath ;verify path and filename exist FileExistsTest = 1 else errormsg "Path and/or file does not exist." endif else FileExistsTest = 2 ;user entered 'Cancel' at prompt CancelDial = 1 endif yield endwhile endif endproc proc Cleanup hangup ;hang up the phone line pause 2 ;pause to avoid hangup "noise" clear ;clear screen after hangup endproc