source: WorldVistAEHR/trunk/r/PAID-PRS/PRSACED6.m@ 1714

Last change on this file since 1714 was 623, checked in by George Lilly, 15 years ago

revised back to 6/30/08 version

File size: 1.7 KB
Line 
1PRSACED6 ; HISC/FPT-T&A Cross-Edits ;11/27/95 10:01
2 ;;4.0;PAID;**6,45**;Sep 21, 1995
3CODES ; Set variables T0 and T1 with 8B code list
4 ; 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59
5 ;
6 S T0="AN SK WD NO AU RT CE CU UN NA NB SP DA SA SB SC OA OB OC OK DB OM RA RB RC HA HB HC HD PT PA ON VC EA EB AL SL WP NP AB RL FA FB FC FD AD AF FE",N1=60
7 S T1="CT CO US NR NS DC TF SE SF SG OE OF OG OS TA OU RE RF RG HL HM HN HO PH PB CL VS EC ED NL DW IN TL LU LN LD TO LA ML CA PC TC CY RR SQ FF DE DF YA DG TG YD YE TB DT YH TD NT NH",N2=59
8 Q
9STUB ; parse out 'stub' variables from 8b record
10 S RECORD=^PRST(458,PPI,"E",DFN,5)
11 S STA=$E(RECORD,2,4)
12 S SSN=$E(RECORD,5,13)
13 S NCODE=$E(RECORD,14,16)
14 S DAYNO=$E(RECORD,17,19)
15 S TL=$E(RECORD,22,24)
16 S LVG=$E(RECORD,25)
17 S NOR=$E(RECORD,26,27)
18 S PAY=$E(RECORD,28)
19 S DUT=$E(RECORD,29)
20 S RECORD=$E(RECORD,33,$L(RECORD))
21 S (C0,C1)="",EOR=0
22 Q:RECORD=""
23TYPE ; parse out type of time from 8b record
24 I EOR=1 K EOR,LOOP,MATCH,RECORD,TYPE,VALUE Q
25 S TYPE=$E(RECORD,1,2)
26 I TYPE="CD" S VALUE=$E(RECORD,3,$L(RECORD)) D CD S EOR=1 G TYPE
27 F LOOP=3:1:$L(RECORD) Q:$E(RECORD,LOOP)?1U
28 S:LOOP=$L(RECORD) EOR=1
29 S VALUE=$S(EOR=1:$E(RECORD,3,LOOP),1:$E(RECORD,3,LOOP-1))
30 S:EOR=0 RECORD=$E(RECORD,LOOP,$L(RECORD))
31 S MATCH=0
32 S Z=$F(T0,TYPE)
33 I Z>2 S $P(C0,"^",(Z/3)+12)=VALUE,MATCH=1
34 G:MATCH=1 TYPE
35 S Z=$F(T1,TYPE)
36 I Z>2 S $P(C1,"^",Z/3)=VALUE
37 G TYPE
38CD ; calculate/compare cd value
39 S END=$L(C0,"^"),CD=0
40 F LOOP=13:1:END S CD=CD+$P(C0,"^",LOOP)
41 S END=$L(C1,"^")
42 F LOOP=1:1:END S CD=CD+$P(C1,"^",LOOP)
43 I CD'=+VALUE W !,"THE CD VALUE DID NOT ADD UP CORRECTLY FOR ",$P($G(^PRSPC(DFN,0)),"^",1)
44 K CD,END Q
Note: See TracBrowser for help on using the repository browser.