home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
UpTime Volume 1 #3
/
utv1n3s1.d64
/
medtax
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-08-28
|
13KB
|
429 lines
1 rem medtax.03
2 rem 11/14/86
3 rem by michael reich
4 rem with instruction loader
8 rem 04/05/87
9 poke53280,6:poke53281,1
10 if a=0 then a=1:gosub 10030:rem print screen
11 if b=0 then b=1:ld$="seq reader.exe":goto 7500
12 if b=1 then b=2:ld$="lptr rtn":goto 7500
13 gosub 210
15 rem **********
16 rem * init. *
17 rem **********
20 t$="[205]edical-[212]ax [198]ile":rv$=chr$(18):ro$=chr$(146):ts$="medtax.dat":sc$=chr$(147)
25 def fnr(z)=int(z*100+.5)/100
30 cl$=" ":dn$=""
40 lo$=dn$+cl$+dn$:c1$=chr$(154):c2$=chr$(152):pc=.85:rem copay
50 m=100:nf=6:pe=5:ty=5:dim en$(m),a$(nf),sl(nf),le(nf),pe$(9)
55 fori=1tope:readpe$(i):next:rem family names
60 data mike,nancy,sara,amanda,jake
65 fori=1toty:readty$(i):next:rem expense types
70 data "[205][196]","[196][196][211]","[200]osp","[210][216]","[207]ther"
75 en$(0)="..................................":rem len=34
80 fori=1tonf:readfi$(i),sl(i),le(i):next:fi$(0)="[210]ecord #"
82 data"[196]ate ",1,8,"[212]ype ",9,1,"[197]xpense ",10,7,"[210]eimburse.",17,7
84 data"[208]rovider ",24,10,"[208]atient ",34,1
85 no=9:dim mo$(no):fori=1tono:readmo$(i):next
87 data"[205]odify [210]ecord","[208]rint [198]ile","[193]dd [210]ecord"
88 data"[204]oad [198]ile","[211]ave [198]ile","[195]alculate [207]utstanding [195]laims"
89 data"[197]dit [198]amily [205]embers' [206]ames","[201]nstructions","[197]xit"
95 goto500
100 rem **********
102 rem * screen *
104 rem **********
110 printsc$;mo;mo$(mo):ifmo=2thenifz<=pethenprinttab(25)"[145]"rv$pe$(z)
115 print"[192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192]":return
120 gosub100:printleft$(dn$,6);
130 fori=1tonf:printi;rv$;fi$(i)
140 next: return
200 rem **********
202 rem * delay *
204 rem **********
210 fort=1to500:next
220 fort=1to500:next:return
255 rem **********
256 rem *keypress*
257 rem **********
260 getc$:ifc$=""then260
270 return
280 ifmo=1thenprintlo$tab(16)"[145] [201][146]ndex,"
282 printlo$" [195][146]ontinue or [197][146]xit";
285 gosub 260: rem get kbd input
286 if (c$="c") or (c$="e") or (c$="i") then 290
287 if (c$<>"[195]") and (c$<>"[197]") and (c$<>"[201]") then 285
290 return
300 rem **********
302 rem *disasemb*
304 rem **********
310 fori=1tonf:a$(i)=mid$(en$(0),sl(i),le(i)):next:return
320 fori=1tonf:a$(i)=mid$(en$(cr),sl(i),le(i)):next:return
340 rem **********
342 rem *print a$*
344 rem **********
350 printleft$(dn$,5)fi$(0)cr:fori=1tonf :printtab(15)a$(i)
360 ifmo=1thenx$(i)=a$(i)
370 next: return
400 rem **********
402 rem * select *
404 rem **********
410 printlo$"[145][145][145][145]"
420 print"[215]hich [208]erson:"
425 printc2$0;c1$"[193]ll",;
430 forp=1tope:print"[152]"p"[154]"pe$(p),;:next
450 gosub260:c=val(c$):if c>pe then450
460 printlo$"[145][145][145]"cl$cl$cl$" ":return
500 rem **********
502 rem * menu *
504 rem **********
510 mo=0:gosub10000
512 printleft$(dn$,24)spc(9)"";lr;"[157] [146]"c2$" [210]ecords in [205]emory"c1$:print
515 fori=1tono:print:printtab(5)i;mo$(i):next:print
520 printtab(12)"[211]election? [163][145][157][157] ";
530 gosub260:mo$=c$
540 mo=val(mo$):ifmo<1ormo>no then510
550 printc2$mo$c1$:if mo=no then sys (8*4096)+4
560 ifmo=4 or mo=8or mo=7 or lr>0then580
570 printlo$rv$spc(9)"[150] [206]o [198]ile in [205]emory "
575 printspc(12)"[154][206]ew [198]ile? <y/n>";:gosub 260: ne$=c$: ifne$="y"thengoto580
576 goto590
580 onmogosub1000,42000,3000,5000,6000,9000,43000,30000
590 goto510
1000 rem **********
1002 rem * modify *
1004 rem **********
1020 gosub100:gosub280
1030 ifc$<>"c"andc$<>"i"andc$<>"e"then1020
1050 ifc$="e"then1999
1060 ifc$="i"thengosub1800:goto1000
1100 printlo$"[145]"cl$lo$"[197]nter [210]ecord [206]umber to [205]odify -> ";:bs$="[157] [157]":max=3
1110 gosub 30200:cr=val(te$)
1120 ifcr<1orcr>lrthenprintlo$" [201]nvalid [210]ecord [206]umber"c1$:gosub200:goto1000
1130 gosub120:gosub320:gosub350
1170 printlo$"[205]odify [215]hich [198]ield (1-"nf"or 0=exit) ";:gosub260:printc$;
1174 i=val(c$):ifi=0then1000
1175 ifi<>4 then 1180
1176 printlo$"[193]utomatic calc. <[217]> ";:de$="[157] [157]"
1177 gosub 30200:if te$="y" or te$="[217]" or te$="" then 1240
1180 ifi>nfthenprintlo$"[201]nvalid [198]ield [206]umber"c1$:gosub200:goto1000
1190 gosub3600:gosub3740:ify$<>"y"then1170
1230 a$(i)=x$:en$(cr)="":forx=1tonf:en$(cr)=en$(cr)+a$(x):next:goto1170
1235 :
1240 ifi=4thenz=.85*val(a$(3)):z=fnr(z):z$=left$(str$(z)+en$(0),le(i))
1250 a$(i)=mid$(z$,2)+".":en$(cr)="":forx=1tonf:en$(cr)=en$(cr)+a$(x):next
1260 goto1130
1800 :
1802 rem index
1804 :
1810 gosub1890:forcr=1tolr:x1$=mid$(en$(cr),1,8):x2$=mid$(en$(cr),34,1)
1820 x2=val(x2$):x3$=mid$(en$(cr),9,1):x3=val(x3$)
1830 printcr;tab(5)x1$tab(15)pe$(x2)tab(30)ty$(x3):ln=ln+1
1840 ifln>19thengosub1870
1850 next:gosub2850:return
1870 gosub2850
1890 printsc$tab(16)rv$" [201]ndex ":printa$(0)
1900 print"[210]ec"tab(5)"[196]ate"tab(15)"[208]erson"tab(30)"[212]ype":printa$(0):ln=3
1999 return
2000 rem **********
2002 rem * view *
2004 rem **********
2010 printlo$" [214]iew "rv$"[193]"ro$"ll or "rv$"[210]"ro$"ange or ";
2015 printrv$"[197]"ro$"xit"
2020 gosub260:ifc$<>"a"andc$<>"r"andc$<>"e"then2020
2030 ifc$="e"thenreturn
2040 ur=0:ifc$="a"thenf=1:l=lr:goto2100
2050 printlo$"[145]"cl$" [197]nter [198]irst [210]ecord: ";:bs$="[157] [157]":max=3:gosub 30200
2055 f=val(te$):if f<1 or f>lr then 2010
2060 printlo$"[197]nter [204]ast [210]ecord: ";:gosub 30200:l=val(te$):ifl<fthen2010
2070 ifl>lrthenl=lr
2100 z=0:gosub 110:gosub400:z=c:ifmo=6thenreturn
2120 gosub2900:forcr=ftol
2140 gosub320:ifz=0then2160
2150 ifval(a$(6))<>zthen2310
2160 printa$(1)spc(4)a$(3)spc(4);: ifleft$(a$(5),1)="."thenprint
2170 ifleft$(a$(5),1)<>"."thenprinta$(5)
2180 print" "ty$(val(a$(2)))tab(12)a$(4)spc(4);:ifleft$(a$(6),1)="."thenprint
2190 ifleft$(a$(6),1)<>"."thenprintpe$(val(a$(6)))
2200 u1=val(a$(3))-val(a$(4))
2220 ur=ur+u1:ur$=str$(ur):u1$=str$(u1): ifu1<1thenu1$=left$(u1$,4)
2230 printc2$"^[210]ec."cr"[157] [213]nreim:"u1$" [212]otal :"ur$c1$
2300 ln=ln+3:ifln>18thengosub2850
2310 next
2320 gosub2850:return
2850 printlo$" [208]ress <[211]pace> to [195]ontinue"
2860 gosub260:ifc$<>" "then2860
2870 ifcr>=l thenreturn
2900 gosub100
2920 fori=1tonfstep2:printrv$"[152]"fi$(i)ro$" ";:next:print
2930 fori=2to nfstep2:printrv$fi$(i)ro$" ";:next:print"[154]":ln=4:return
3000 rem **********
3002 rem * add *
3004 rem **********
3010 fl=1:bs$="[157][154].[157]":gosub100:gosub280:ifc$="e"thenreturn
3100 gosub120:cr=lr+1
3110 ifcr>mthenprint"[198]ile [212]oo [204]arge -[154] [211]ave [196]ata":gosub210:gosub210:return
3130 gosub300:gosub350
3150 fori=1tonf:x$(i)=a$(i):gosub3600: a$(i)=x$:next
3170 gosub3740:ify$<>"y"then3000
3190 lr=cr:fori=1tonf:en$(lr)=en$(lr)+a$(i):next:goto3000
3600 :
3602 rem input for current record
3604 :
3610 po$=left$(dn$,5+i):printlo$
3620 printpo$tab(15)x$(i):x$="": max=6
3625 if i=1 then max=8:printlo$spc(16)"[205][205]/[196][196]/[217][217]"
3630 if i=2 then max=1: printlo$;:for p=1 to ty: print""p"[154]"ty$(p);: next
3640 ifi=4thenprintlo$" [197]nter amount reimbursed by insurance"
3650 if i=5 then max=10: printlo$" enter md/dds/hosp name [optional]"
3670 if i=6 then max=1: printlo$"[145]";: for p=1 to pe:print""p"[154]"pe$(p),;:next
3680 print po$ tab(15)"";: if (i=3) or (i=4) then print"[157]$";
3685 gosub 30200:x$=te$+left$(en$(0),le(i)-len(te$))
3686 print po$ tab(13)" "
3687 if i<>1 or len(te$)=8 then 3690
3688 if mid$(x$,2,1)="/" then x$=left$("0"+x$,8)
3689 if len(te$)<8 thenif mid$(x$,5,1)="/" then x$=left$(x$,3)+"0"+right$(te$,4)
3690 if i=6 then if (x$<"1") or (x$>mid$(str$(pe),2,1)) then 3610
3720 print lo$:x$(i)=x$: return
3730 :
3740 printlo$"[145]"cl$" [193]ccept <[217]>";:de$="y":gosub 41000
3750 printlo$:return
4000 rem **********
4002 rem * print *
4004 rem **********
4005 rem printer variables
4010 lf$=chr$(10):es$=chr$(27):ff$=chr$(12):ri$=es$+chr$(98):pa=0
4020 ts$=es$+chr$(68)+chr$(5)+chr$(10)+chr$(19)+chr$(30)+chr$(40)