home *** CD-ROM | disk | FTP | other *** search
/ High Voltage Shareware / high1.zip / high1 / DIR3 / EXTPROB.ZIP / EXTPROB.BAS next >
BASIC Source File  |  1994-01-21  |  22KB  |  501 lines

  1.       '
  2.       ' mi-crin ...
  3.       '
  4.  
  5. '     declare function btrv%(integer, string, integer,  flex,  flex, integer)
  6. '     public BtrieveInstalled%
  7.  
  8.       defint a-z
  9.  
  10.       gosub Initialization
  11.       gosub MainLogic
  12.       gosub Termination
  13.       system
  14.  
  15. MainLogic:
  16.       color 7, 0: cls
  17.       color 0, 7: locate 1,1: print " Create the Insurance file from existing insurance codes."; tab( 80 ); " ";
  18.       color 7, 0:
  19.  
  20.       WkStartTime$ = time$
  21.       locate  3,1: print "   Start time: "; WkStartTime$
  22.       locate  6,1: print "     FileSpec: ";
  23.       locate  7,1: print "Total records: ";
  24.       locate  8,1: print "         Read: ";
  25.       locate  9,1: print "    Ins Codes: ";
  26.       locate 10,1: print "     FileSpec: ";
  27.       locate 11,1: print "Total records: ";
  28.       locate 12,1: print "      Written: ";
  29.  
  30.  
  31.       WkPMNOR&    = 0
  32.       WkINNOR&    = 0
  33.       WkPMCount&  = 0
  34.       WkINCount&  = 0
  35.  
  36.       WkIns$      = ""
  37.       WkSpace3$   = space$( 3 )
  38.  
  39.       gosub BtOpenPMFile
  40.       gosub BtErrorChecking
  41.       gosub BtOpenInFile
  42.       gosub BtErrorChecking
  43.  
  44.       locate  6, 17: print BtPMFileSpec$
  45.       locate  7, 17: print using "##,###"; WkPMNOR&
  46.       locate 10, 17: print BtINFileSpec$
  47.       locate 11, 17: print using "##,###"; WkINNOR&
  48.  
  49.       BtPMOpr = BtStepFirst
  50.  
  51. MainGetNext:
  52.       if inkey$ = chr$( 27 ) then
  53.          goto QuitMainLogic
  54.       end if
  55.  
  56.       gosub BtPMFile
  57.  
  58.       if BtSts = BtEndOfFile then
  59.          goto QuitMainLogic
  60.       end if
  61.       gosub BtErrorChecking
  62.  
  63.       BtPMOpr = BtStepNext
  64.       incr WkPMCount&
  65.  
  66.       if BtPMInsCode1$$ <> WkSpace3$ then
  67.          if instr( WkIns$, BtPMInsCode1$$ ) = 0 then
  68.             WkIns$ = WkIns$ + BtPMInsCode1$$ + "#"
  69.             incr WkINCount&
  70.          end if
  71.       end if
  72.  
  73.       if BtPMInsCode2$$ <> WkSpace3$ then
  74.          if instr( WkIns$, BtPMInsCode2$$ ) = 0 then
  75.             WkIns$ = WkIns$ + BtPMInsCode2$$ + "#"
  76.             incr WkINCount&
  77.          end if
  78.       end if
  79.  
  80.       if BtPMInsCode3$$ <> WkSpace3$ then
  81.          if instr( WkIns$, BtPMInsCode3$$ ) = 0 then
  82.             WkIns$ = WkIns$ + BtPMInsCode3$$ + "#"
  83.             incr WkINCount&
  84.          end if
  85.       end if
  86.  
  87.       locate  8, 17: print using "##,###"; WkPMCount&
  88.       locate  9, 17: print using "##,###"; WkINCount&
  89.  
  90.       goto MainGetNext
  91.  
  92. QuitMainLogic:
  93.       WkStopTime$ = time$
  94.       locate 4,1: print "Stop  time: "; WkStopTime$
  95.  
  96.       WkINCount& = 0
  97.       locate 18,1
  98.  
  99.       beep
  100.       while inkey$ = "": wend
  101.  
  102.       for WkPx = 1 to len( WkIns$ ) step 4
  103.           WkInsNum$ = mid$( WkIns$, WkPx, 3 )
  104.           array scan WkInsCode$( 1 ), = WkInsNum$, to WkIx
  105.           BtINDataBuf$$       = " "
  106.           BtINStatus$$        = "A"
  107.           WkTemp$             = date$
  108.           BtINCrDateYY$$      = right$( WkTemp$, 2 )
  109.           BtINCrDateMM$$      =  left$( WkTemp$, 2 )
  110.           BtINCrDateDD$$      =   mid$( WkTemp$, 4, 2 )
  111.           WkTemp$             = time$
  112.           BtINCrTimeHH$$      =  left$( WkTemp$, 2 )
  113.           BtINCrTimeMM$$      =   mid$( WkTemp$, 4, 2 )
  114.           BtINCrTimeSS$$      = right$( WkTemp$, 2 )
  115.           BtINCrUserID$$      = "SAO"
  116.           BtINCrWorkStation$$ = "U1"
  117.           BtINCrProgram$$     = "MI-CRIN"
  118.           BtINChLastAction$$  = "A"
  119.           BtINChInfo$$        = BtINCrInfo$$
  120.           BtINMiLastAction$$  = "A"
  121.           BtINMiInfo$$        = BtINCrInfo$$
  122.           BtINNumber$$        = WkInsNum$
  123.           if WkIx = 0 then
  124.              BtINDescription$$ = "No description for " + WkInsNum$ + "."
  125.           else
  126.              BtINDescription$$ = WkInsDesc$( WkIx )
  127.           end if
  128.           BtINComm$$        = "N"
  129.           BtINOpr           = BtInsert
  130.           BtINKey           = 0
  131.           gosub BtINFile
  132.           if BtSts <> 5 then
  133.              gosub BtErrorChecking
  134.           else
  135.              incr WkDup
  136.              locate 22,1: print "Dup count ="; WkDup
  137.           end if
  138.           print using "### ###"; WkPx; BtSts
  139.           incr WkINCount&
  140.           locate 12, 17: print using "##,###"; WkINCount&
  141.       next
  142. XMainLogic:
  143.       return
  144.  
  145. BtINFile:
  146.       WkBTID$ = "IN"
  147. '     BtRetVal = btrv( BtINOpr, BtINKeyBuf$, BtINKey, BtINDataBuf$$, BtINPos$$, BtSts )
  148. XBtINFile:
  149.       return
  150.  
  151. BtOpenInFile:
  152.       BtINRecLen        = 254: map BtINPos$$ * 128
  153.       map BtINDataBuf$$ * BtINRecLen,_
  154.                         from    1 to   4 as BtINRecordPosition$$,_
  155.                         from    7 to  10 as BtINNOR$$,_
  156.                         from    1 to   1 as BtINStatus$$,_
  157.                         from    2 to  26 as BtINCrInfo$$,_
  158.                         from    2 to   7 as   BtINCrDateYYMMDD$$,_
  159.                         from    2 to   3 as     BtINCrDateYY$$,_
  160.                         from    4 to   5 as     BtINCrDateMM$$,_
  161.                         from    6 to   7 as     BtINCrDateDD$$,_
  162.                         from    8 to  13 as   BtINCrTimeHHMMSS$$,_
  163.                         from    8 to   9 as     BtINCrTimeHH$$,_
  164.                         from   10 to  11 as     BtINCrTimeMM$$,_
  165.                         from   12 to  13 as     BtINCrTimeSS$$,_
  166.                         from   14 to  16 as   BtINCrUserID$$,_
  167.                         from   17 to  18 as   BtINCrWorkStation$$,_
  168.                         from   19 to  26 as   BtINCrProgram$$,_
  169.                         from   27 to  27 as BtINChLastAction$$,_
  170.                         from   28 to  52 as BtINChInfo$$,_
  171.                         from   28 to  33 as   BtINChDateYYMMDD$$,_
  172.                         from   28 to  29 as     BtINChDateYY$$,_
  173.                         from   30 to  31 as     BtINChDateMM$$,_
  174.                         from   32 to  33 as     BtINChDateDD$$,_
  175.                         from   34 to  39 as   BtINChTimeHHMMSS$$,_
  176.                         from   34 to  35 as     BtINChTimeHH$$,_
  177.                         from   36 to  37 as     BtINChTimeMM$$,_
  178.                         from   38 to  39 as     BtINChTimeSS$$,_
  179.                         from   40 to  42 as   BtINChUserID$$,_
  180.                         from   43 to  44 as   BtINChWorkStation$$,_
  181.                         from   45 to  52 as   BtINChProgram$$,_
  182.                         from   53 to  53 as BtINMiLastAction$$,_
  183.                         from   54 to  78 as BtINMiInfo$$,_
  184.                         from   54 to  59 as   BtINMiDateYYMMDD$$,_
  185.                         from   54 to  55 as     BtINMiDateYY$$,_
  186.                         from   56 to  57 as     BtINMiDateMM$$,_
  187.                         from   58 to  59 as     BtINMiDateDD$$,_
  188.                         from   60 to  65 as   BtINMiTimeHHMMSS$$,_
  189.                         from   60 to  61 as     BtINMiTimeHH$$,_
  190.                         from   62 to  63 as     BtINMiTimeMM$$,_
  191.                         from   64 to  65 as     BtINMiTimeSS$$,_
  192.                         from   66 to  68 as   BtINMiUserID$$,_
  193.                         from   69 to  70 as   BtINMiWorkStation$$,_
  194.                         from   71 to  78 as   BtINMiProgram$$,_
  195.                         from   79 to 100 as BtINAuditReserved$$,_
  196.                         from  101 to 103 as BtINNumber$$,_
  197.                         from  104 to 138 as BtINDescription$$,_
  198.                         from  139 to 173 as BtINCommentLine1$$,_
  199.                         from  174 to 208 as BtINCommentLine2$$,_
  200.                         from  209 to 209 as BtINComm$$,_
  201.                         from  254 to 254 as BtINReserved$$
  202.  
  203.       BtINFileSpec$ = "mi-tins.btr"
  204.  
  205.       BtINKey       = 0
  206.       BtINOpr       = BtOpen
  207.       BtINPos$$     = string$( 128, 0)
  208.       BtINDataBuf$$ = string$( BtINRecLen, 0)
  209.       BtINKeyBuf$   = BtINFileSpec$ + chr$( 0 )
  210.       gosub BtINFile
  211.       gosub BtErrorChecking
  212.       BtINKeyBuf$   = string$( 3, " " )
  213.  
  214.       WkInNOR&      = BtNOR&( BtINPos$$ )
  215. XBtOpenInFile:
  216.       return
  217.  
  218.  
  219. BtPMFile:
  220.       WkBTID$ = "PM"
  221. '     BtRetVal = btrv( BtPMOpr, BtPMKeyBuf$, BtPMKey, BtPMDataBuf$$, BtPMPos$$, BtSts )
  222. XBtPMFile:
  223.       return
  224.  
  225. BtOpenPMFile:
  226.       BtPMRecLen        = 996: map BtPMPos$$ * 128
  227.       map BtPMDataBuf$$ * BtPMRecLen,_
  228.                         from    1 to   4 as BtPMRecordPosition$$,_
  229.                         from    7 to  10 as BtPMNOR$$,_
  230.                         from    1 to   1 as BtPMStatus$$,_
  231.                          from  34 to  35 as   BtPMCrWorkStation$$,_
  232.                          from  36 to  47 as   BtPMCrProgram$$,_
  233.                         from   48 to  48 as BtPMLastAction$$,_
  234.                         from   49 to  94 as BtPMChInfo$$,_
  235.                         from   49 to  54 as   BtPMChDateYYMMDD$$,_
  236.                          from  49 to  50 as     BtPMChDateYY$$,_
  237.                          from  51 to  52 as     BtPMChDateMM$$,_
  238.                          from  53 to  54 as     BtPMChDateDD$$,_
  239.                          from  55 to  60 as   BtPMChTimeHHMMSS$$,_
  240.                          from  55 to  56 as     BtPMChTimeHH$$,_
  241.                          from  57 to  58 as     BtPMChTimeMM$$,_
  242.                          from  59 to  60 as     BtPMChTimeSS$$,_
  243.                          from  61 to  80 as   BtPMChUserName$$,_
  244.                          from  81 to  82 as   BtPMChWorkStation$$,_
  245.                          from  83 to  94 as   BtPMChProgram$$,_
  246.                         from   95 to 100 as BtPMReserved2$$,_
  247.                         from  101 to 109 as BtPMKey0$$,_
  248.                         from  101 to 109 as BtPMAccountNumber$$,_
  249.                         from  101 to 103 as   BtPMDoctorNumber$$,_
  250.                         from  104 to 108 as   BtPMChartNumber$$,_
  251.                         from  109 to 109 as   BtPMCheckDigit$$,_
  252.                         from  110 to 235 as BtPMPatInfo$$,_
  253.                         from  110 to 141 as   BtPMKey1$$,_
  254.                         from  110 to 129 as   BtPMPatLastName$$,_
  255.                         from  130 to 141 as   BtPMPatFirstName$$,_
  256.                         from  142 to 174 as   BtPMPatAddressLine1$$,_
  257.                         from  175 to 207 as   BtPMPatAddressLine2$$,_
  258.                         from  208 to 224 as   BtPMPatCity$$,_
  259.                         from  225 to 226 as   BtPMPatState$$,_
  260.                         from  227 to 231 as     BtPMPatZipCode$$,_
  261.                         from  232 to 235 as     BtPMPatZipCodeExtended$$,_
  262.                         from  236 to 245 as BtPMPatHomePhone$$,_
  263.                         from  236 to 238 as   BtPmPatHomeAreaCode$$,_
  264.                         from  239 to 241 as   BtPmPatHomeExchange$$,_
  265.                         from  242 to 245 as   BtPmPatHomeNumber$$,_
  266.                         from  246 to 248 as BtPMPatHomeExtension$$,_
  267.                         from  249 to 258 as BtPMPatWorkPhone$$,_
  268.                         from  249 to 251 as   BtPMPatWorkAreaCode$$,_
  269.                         from  252 to 254 as   BtPMPatWorkExchange$$,_
  270.                         from  255 to 258 as   BtPMPatWorkNumber$$,_
  271.                         from  259 to 261 as BtPMPatWorkExtension$$,_
  272.                         from  262 to 270 as BtPMPatSS$$,_
  273.                         from  262 to 264 as   BtPMPatSS1$$,_
  274.                         from  265 to 266 as   BtPMPatSS2$$,_
  275.                         from  267 to 270 as   BtPMPatSS3$$,_
  276.                         from  271 to 271 as BtPMSexCode$$,_
  277.                         from  272 to 277 as BtPMBirthDate$$,_
  278.                         from  272 to 273 as   BtPMBirthYY$$,_
  279.                         from  274 to 277 as   BtPMBirthMMDD$$,_
  280.                         from  274 to 275 as     BtPMBirthMM$$,_
  281.                         from  276 to 277 as     BtPMBirthDD$$,_
  282.                         from  278 to 283 as BtPMFirstConsultDate$$,_
  283.                         from  278 to 279 as   BtPMFirstConsultYY$$,_
  284.                         from  280 to 281 as   BtPMFirstConsultMM$$,_
  285.                         from  282 to 283 as   BtPMFirstConsultDD$$,_
  286.                         from  284 to 285 as BtPMBillingCode$$,_
  287.                         from  286 to 287 as BtPMNoticeCode$$,_
  288.                         from  288 to 288 as BtPMRelationshipCode$$,_
  289.                         from  289 to 414 as BtPMRspInfo$$,_
  290.                         from  289 to 320 as   BtPMKey2$$,_
  291.                         from  289 to 308 as   BtPMRspLastName$$,_
  292.                         from  309 to 320 as   BtPMRspFirstName$$,_
  293.                         from  321 to 353 as   BtPMRspAddressLine1$$,_
  294.                         from  354 to 386 as   BtPMRspAddressLine2$$,_
  295.                         from  387 to 403 as   BtPMRspCity$$,_
  296.                         from  387 to 400 as     BtPMRspCity14$$,_
  297.                         from  404 to 405 as   BtPMRspState$$,_
  298.                         from  406 to 410 as     BtPMRspZipCode$$,_
  299.                         from  411 to 414 as     BtPMRspZipCodeExtended$$,_
  300.                         from  415 to 424 as BtPMRspHomePhone$$,_
  301.                         from  415 to 417 as   BtPMRspHomeAreaCode$$,_
  302.                         from  418 to 420 as   BtPMRspHomeExchange$$,_
  303.                         from  421 to 424 as   BtPMRspHomeNumber$$,_
  304.                         from  425 to 427 as BtPMRspHomeExtension$$,_
  305.                         from  428 to 437 as BtPMRspWorkPhone$$,_
  306.                         from  428 to 430 as   BtPMRspWorkAreaCode$$,_
  307.                         from  431 to 433 as   BtPMRspWorkExchange$$,_
  308.                         from  434 to 437 as   BtPMRspWorkNumber$$,_
  309.                         from  438 to 440 as BtPMRspWorkExtension$$,_
  310.                         from  441 to 449 as BtPMRspSS$$,_
  311.                         from  441 to 443 as   BtPMRspSS1$$,_
  312.                         from  444 to 445 as   BtPMRspSS2$$,_
  313.                         from  446 to 449 as   BtPMRspSS3$$,_
  314.                         from  450 to 452 as BtPMInsCode1$$,_
  315.                         from  453 to 487 as BtPMInsDesc1$$,_
  316.                         from  488 to 490 as BtPMInsCode2$$,_
  317.                         from  491 to 525 as BtPMInsDesc2$$,_
  318.                         from  526 to 528 as BtPMInsCode3$$,_
  319.                         from  529 to 563 as BtPMInsDesc3$$,_
  320.                         from  564 to 596 as BtPMRefDoctorAddressLine1$$,_
  321.                         from  597 to 629 as BtPMRefDoctorAddressLine2$$,_
  322.                         from  630 to 662 as BtPMRefDoctorAddressLine3$$,_
  323.                         from  838 to 906 as BtPMComment1$$,_
  324.                         from  907 to 975 as BtPMComment2$$,_
  325.                         from  976 to 983 as BtPMRefDoctorAlphaNumeric$$,_
  326.                         from  976 to 977 as   BtPMRefDoctorAlpha$$,_
  327.                         from  978 to 983 as   BtPMRefDoctorNumeric$$,_
  328.                         from  984 to 993 as BtPMRefDoctorWorkPhone$$,_
  329.                         from  984 to 986 as   BtPMRefDoctorWorkAreaCode$$,_
  330.                         from  987 to 989 as   BtPMRefDoctorWorkExchange$$,_
  331.                         from  990 to 993 as   BtPMRefDoctorWorkNumber$$,_
  332.                         from  994 to 996 as BtPMReserved3$$
  333.  
  334.       BtPMFileSpec$ = "f:\mb-prod.dir\mb-mpat.btr"
  335.  
  336.       BtPMKey       = -2                       'Read only
  337.       BtPMOpr       = BtOpen
  338.       BtPMPos$$     = string$( 128, 0)
  339.       BtPMDataBuf$$ = string$( BtPMRecLen, 0)
  340.       BtPMKeyBuf$   = BtPMFileSpec$ + chr$( 0 )
  341.       gosub BtPMFile
  342.       gosub BtErrorChecking
  343.       BtPMKeyBuf$   = string$( 32, " " )
  344.  
  345.       WkPMNOR&      = BtNOR&( BtPMPos$$ )
  346. XBtOpenPMFile:
  347.       return
  348.  
  349. BtErrorChecking:
  350.       if BtSts = BtOperationOK then
  351.          goto XBtErrorChecking
  352.       end if
  353.  
  354.       locate 20, 1
  355.       color 0, 7
  356.       print " Btrieve error!  Sts = "; BtSts; "  File ID = "; WkBtID$; tab( 80 ); " ";
  357.  
  358.       beep
  359.       while inkey$ <> chr$( 27 ): wend
  360.       locate 3,1
  361.       system
  362. XBtErrorChecking:
  363.       return
  364.  
  365. BtInitVariables:
  366.       BtOpen                   = 0
  367.       BtClose                  = 1
  368.       BtInsert                 = 2
  369.       BtUpdate                 = 3
  370.       BtDelete                 = 4
  371.       BtGetEqual               = 5
  372.       BtGetNext                = 6
  373.       BtGetPrev                = 7
  374.       BtGetGreaterThan         = 8
  375.       BtGetGreaterThanOrEqual  = 9
  376.       BtGetLessThan            = 10
  377.       BtGetLessThanOrEqual     = 11
  378.       BtGetFirst               = 12
  379.       BtGetLast                = 13
  380.       BtCreate                 = 14
  381.       BtStat                   = 15
  382.       BtExtend                 = 16
  383.       BtSetDirectory           = 17
  384.       BtGetDirectory           = 18
  385.       BtBeginTransaction       = 19
  386.       BtEndTransaction         = 20
  387.       BtAbortTransaction       = 21
  388.       BtGetPosition            = 22
  389.       BtGetDirect              = 23
  390.       BtStepNext               = 24
  391.       BtStop                   = 25
  392.       BtGetVersion             = 26
  393.       BtUnlock                 = 27
  394.       BtReset                  = 28
  395.       BtSetOwner               = 29
  396.       BtClearOwner             = 30
  397.       BtStepFirst              = 33
  398.       BtStepLast               = 34
  399.       BtStepPrevious           = 35
  400.  
  401.       BtOperationOK            = 0
  402.       BtDuplicate              = 5
  403.       BtRecordNotFound         = 4
  404.       BtEndOfFile              = 9
  405.  
  406.       BtSts                    = 0
  407.  
  408. XBtInitVariables:
  409.       return
  410.  
  411. BtResetAll:
  412.       BtUtKeyBuf$ = ""
  413.       BtUtDataBuf$$ = ""
  414.       BtUtPos$$ = string$( 128, 0 ): map BtUtPos$$ * 128
  415. '     BtRetVal = Btrv( BtReset, BtUtKeyBuf$, 0, BtUtDataBuf$$, BtUtPos$$, BtSts )
  416.       gosub BtErrorChecking
  417. XBtResetAll:
  418.       return
  419.  
  420. InitIns:
  421.       dim WkInsCode$( 0:32 ), WkInsDesc$( 0:32 )
  422.       WkInsCode$(  0 ) = "???": WkInsDesc$(  0 ) = "Need a description for             "
  423.       WkInsCode$(  1 ) = "100": WkInsDesc$(  1 ) = "No insurance                       "
  424.       WkInsCode$(  2 ) = "112": WkInsDesc$(  2 ) = "Other insurance                    "
  425.       WkInsCode$(  3 ) = "196": WkInsDesc$(  3 ) = "3rd Party                          "
  426.       WkInsCode$(  4 ) = "197": WkInsDesc$(  4 ) = "NO Fault                           "
  427.       WkInsCode$(  5 ) = "198": WkInsDesc$(  5 ) = "W/C                                "
  428.       WkInsCode$(  6 ) = "300": WkInsDesc$(  6 ) = "Aetna                              "
  429.       WkInsCode$(  7 ) = "310": WkInsDesc$(  7 ) = "EDS ( Electronic Data Systems )    "
  430.       WkInsCode$(  8 ) = "315": WkInsDesc$(  8 ) = "American Community                 "
  431.       WkInsCode$(  9 ) = "345": WkInsDesc$(  9 ) = "GM Underwriters                    "
  432.       WkInsCode$( 10 ) = "380": WkInsDesc$( 10 ) = "MESSA                              "
  433.       WkInsCode$( 11 ) = "385": WkInsDesc$( 11 ) = "Great West Life                    "
  434.       WkInsCode$( 12 ) = "700": WkInsDesc$( 12 ) = "Health Central                     "
  435.       WkInsCode$( 13 ) = "701": WkInsDesc$( 13 ) = "Health Central plus Medicare       "
  436.       WkInsCode$( 14 ) = "702": WkInsDesc$( 14 ) = "Physicians Health Plan             "
  437.       WkInsCode$( 15 ) = "703": WkInsDesc$( 15 ) = "Physicians Health Plan plus Medicare  "
  438.       WkInsCode$( 16 ) = "704": WkInsDesc$( 16 ) = "Michigan Medical Network           "
  439.       WkInsCode$( 17 ) = "710": WkInsDesc$( 17 ) = "PPOM                               "
  440.       WkInsCode$( 18 ) = "720": WkInsDesc$( 18 ) = "Care Choices                       "
  441.       WkInsCode$( 19 ) = "730": WkInsDesc$( 19 ) = "Partners                           "
  442.       WkInsCode$( 20 ) = "740": WkInsDesc$( 20 ) = "Health Plus/IPA                    "
  443.       WkInsCode$( 21 ) = "800": WkInsDesc$( 21 ) = "Wayne Oakland Medical Center       "
  444.       WkInsCode$( 22 ) = "200": WkInsDesc$( 22 ) = "Blue Shield ( Mich )               "
  445.       WkInsCode$( 23 ) = "201": WkInsDesc$( 23 ) = "Blue Shield ( Fed )                "
  446.       WkInsCode$( 24 ) = "202": WkInsDesc$( 24 ) = "Blue Shield ( Nat )                "
  447.       WkInsCode$( 25 ) = "203": WkInsDesc$( 25 ) = "Blue Shield ( Other States )       "
  448.       WkInsCode$( 26 ) = "205": WkInsDesc$( 26 ) = "Champus                            "
  449.       WkInsCode$( 27 ) = "280": WkInsDesc$( 27 ) = "Blue Cross - MESSA                 "
  450.       WkInsCode$( 28 ) = "290": WkInsDesc$( 28 ) = "Blue Cross - Aetna                 "
  451.       WkInsCode$( 29 ) = "600": WkInsDesc$( 29 ) = "Medicare                           "
  452.       WkInsCode$( 30 ) = "601": WkInsDesc$( 30 ) = "Medicare/Travelers Railroad        "
  453.       WkInsCode$( 31 ) = "666": WkInsDesc$( 31 ) = "Medicaid                           "
  454.       WkInsCode$( 32 ) = "667": WkInsDesc$( 32 ) = "Crippled Childrens                 "
  455. XInitIns:
  456.       return
  457.  
  458. function BtNOR&( WkPos$$ ) public shared
  459.       BtUtKeyBuf$ = space$( 64 )
  460.       BtUtRecLen  = 512
  461.       map BtUtDataBuf$$ * BtUtRecLen,_
  462.                         from    1 to   2 as BtUtRecLen$$,_
  463.                         from    3 to   4 as BtUtPageSize$$,_
  464.                         from    5 to   6 as BtUtMaxKeys$$,_
  465.                         from    7 to  10 as BtUtTotalRecords$$,_
  466.                         from    7 to   7 as   BtUtTR1$$,_
  467.                         from    8 to   8 as   BtUtTR2$$,_
  468.                         from    9 to   9 as   BtUtTR3$$,_
  469.                         from   10 to  10 as   BtUtTR4$$
  470.  
  471. '     BtRetVal = Btrv( BtStat, BtUtKeyBuf$, 0, BtUtDataBuf$$, WkPos$$, BtSts )
  472.       gosub BtErrorChecking
  473.  
  474.       BtNOR& = asc( BtUtTR1$$ )          +_
  475.                asc( BtUtTR2$$ ) *   256# +_
  476.                asc( BtUtTR3$$ ) * 65536#
  477.  
  478. end function
  479.  
  480. function FmtAccountNumber$( WkString$$ ) local
  481.       FmtAccountNumber$ = left$( WkString$$, 3 ) + "-" + mid$( WkString$$, 4, 5 ) + "-" + right$( WkString$$, 1 )
  482. end function
  483.  
  484. Initialization:
  485.       WkTrue = ( 1 = 1 ): WkFalse = not WkTrue
  486.       gosub BtInitVariables
  487.       gosub InitIns
  488. XInitialization:
  489.       return
  490.  
  491. Termination:
  492.       close
  493.       color 7,0
  494.       cls
  495.       gosub BtResetAll
  496. XTermination:
  497.       return
  498.  
  499. '     $alias DATA as "DSEG"
  500. '     $link    "pbbtrv.obj"
  501.