source: WorldVistAEHR/trunk/r/INTEGRATED_PATIENT_FUNDS-PRPF-PFXIP/PRPFDR5.m@ 1464

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

initial load of WorldVistAEHR

File size: 7.5 KB
Line 
1PRPFDR5 ;BAYPINES/MJE VPFS DATA MIGRATION ROUTINE 5 ;05/15/03
2 ;;3.0;PATIENT FUNDS DIAG V5.9;**15**;JUNE 1, 1989
3 ;BAD ENTRY POINT
4 Q
5NODE0 S PFNODE0=^PRPF(470,PRPFHLD1,0)
6 S PFNAMEX=""
7 S PFNAMEX=PFNAME
8 I PFNAME=""!($E(PFNAME,1,12)="NAME-MISSING") D
9 .S ^TMP("PRPF_DIAGX",$J,PFSTAID,1,PFNAME_"_"_PRPFHLD1)="NAME^Name is blank^"_PFNAME
10 .S CNTERR(1)=CNTERR(1)+1
11 .S CNTERR(100)=CNTERR(100)+1
12 ELSE I $$FORMAT^XLFNAME7(PFNAMEX,3,30)'=PFNAMEX D
13 .S ^TMP("PRPF_DIAGX",$J,PFSTAID,2,PFNAME_"_"_PRPFHLD1)="NAME^Patient Name contains invalid data^"_PFNAME
14 .S CNTERR(2)=CNTERR(2)+1
15 .S CNTERR(100)=CNTERR(100)+1
16 I PFSSN="" D
17 .S ^TMP("PRPF_DIAGX",$J,PFSTAID,3,PFNAME_"_"_PRPFHLD1)="SSN^SSN is blank^"_PFSSN
18 .S CNTERR(3)=CNTERR(3)+1
19 .S CNTERR(100)=CNTERR(100)+1
20 I PFSSN'="" D
21 .I $L(PFSSN)<9!($L(PFSSN)>10) D
22 ..S ^TMP("PRPF_DIAGX",$J,PFSTAID,4,PFNAME_"_"_PRPFHLD1)="SSN^SSN that is not 9 digits or has non-numeric values^"_PFSSN
23 ..S CNTERR(4)=CNTERR(4)+1
24 ..S CNTERR(100)=CNTERR(100)+1
25 .I $L(PFSSN)=9 D
26 ..I '(PFSSN?.9N) D
27 ...S ^TMP("PRPF_DIAGX",$J,PFSTAID,4.1,PFNAME_"_"_PRPFHLD1)="SSN^SSN that is not 9 digits or has non-numeric values^"_PFSSN
28 ...S CNTERR(4)=CNTERR(4)+1
29 ...S CNTERR(100)=CNTERR(100)+1
30 .I $L(PFSSN)=10 D
31 ..I ($E(PFSSN,1,9)?.9N)&($E(PFSSN,10,10)="P") D
32 ...S ^TMP("PRPF_DIAGX",$J,PFSTAID,6,PFNAME_"_"_PRPFHLD1)="SSN^PSEUDO SSN value^"_PFSSN
33 ...S CNTRPSU=CNTRPSU+1
34 ..I '($E(PFSSN,1,9)?.9N)!($E(PFSSN,10,10)'="P") D
35 ...S ^TMP("PRPF_DIAGX",$J,PFSTAID,4.2,PFNAME_"_"_PRPFHLD1)="SSN^SSN that is not 9 digits or has non-numeric values^"_PFSSN
36 ...S CNTERR(4)=CNTERR(4)+1
37 ...S CNTERR(100)=CNTERR(100)+1
38 I PFSSN'="" D
39 .I $D(^TMP("PRPF_DIAGX",$J,"PFSSN",PFSSN)) D
40 ..S ^TMP("PRPF_DIAGX",$J,PFSTAID,5,PFNAME_"_"_PRPFHLD1)="SSN^SSN duplicate value^"_PFSSN
41 ..S CNTERR(5)=CNTERR(5)+1
42 ..S CNTERR(100)=CNTERR(100)+1
43 .S ^TMP("PRPF_DIAGX",$J,"PFSSN",PFSSN)=PFSSN
44 I PFDOB="" D
45 .S ^TMP("PRPF_DIAGX",$J,PFSTAID,7,PFNAME_"_"_PRPFHLD1)="DOB^DOB blank^"_PFDOB
46 .S CNTERR(7)=CNTERR(7)+1
47 .S CNTERR(100)=CNTERR(100)+1
48 ELSE D
49 .K PRPFBADD
50 .D DT^DILF("X",PFDOB,.PRPFBADD)
51 .I $L(+PFDOB)'=7!(PRPFBADD=-1) D
52 ..S ^TMP("PRPF_DIAGX",$J,PFSTAID,8,PFNAME_"_"_PRPFHLD1)="DOB^DOB contains invalid date^"_PFDOB
53 ..S CNTERR(8)=CNTERR(8)+1
54 ..S CNTERR(100)=CNTERR(100)+1
55 I PFWARD'="" I $L(PFWARD)>30!($L(PFWARD)<2) D
56 .S ^TMP("PRPF_DIAGX",$J,PFSTAID,9,PFNAME_"_"_PRPFHLD1)="WARD^Ward loc invalid length not 2 TO 30^"_PFWARD
57 .S CNTERR(9)=CNTERR(9)+1
58 .S CNTERR(100)=CNTERR(100)+1
59 I PFCLAIM=""!(PFCLAIM="SS") D
60 .;S ^TMP("PRPF_DIAGX",$J,PFSTAID,8,PFNAME_"_"_PRPFHLD1)="CLAIM#^Claim # blank^"_PFCLAIM
61 .;S CNTERR(8)=CNTERR(8)+1
62 .;S CNTERR(100)=CNTERR(100)+1
63 ELSE I $L(PFCLAIM)<7!($L(PFCLAIM)>9)!'(PFCLAIM?.N) D
64 .S ^TMP("PRPF_DIAGX",$J,PFSTAID,10,PFNAME_"_"_PRPFHLD1)="CLAIM#^Claim # < 7 or > 9 digits or non-numeric^"_PFCLAIM
65 .S CNTERR(10)=CNTERR(10)+1
66 .S CNTERR(100)=CNTERR(100)+1
67 I PFSTATE="" D
68 .;S ^TMP("PRPF_DIAGX",$J,PFSTAID,10,PFNAME_"_"_PRPFHLD1)="STATE^STATE field is blank^"_PFSTATE
69 .;S CNTERR(10)=CNTERR(10)+1
70 .;S CNTERR(100)=CNTERR(100)+1
71 I PFZIP="" D
72 .;S ^TMP("PRPF_DIAGX",$J,PFSTAID,11,PFNAME_"_"_PRPFHLD1)="ZIPCODE#^ZIPCODE blank^"_PFZIP
73 .;S CNTERR(11)=CNTERR(11)+1
74 .;S CNTERR(100)=CNTERR(100)+1
75 ELSE I $L(PFZIP)>5!($L(PFZIP)<5)!'(PFZIP?5N) D
76 .S ^TMP("PRPF_DIAGX",$J,PFSTAID,11,PFNAME_"_"_PRPFHLD1)="ZIPCODE#^ZIPCODE < or > 5 digits or non-numeric^"_PFZIP
77 .S CNTERR(11)=CNTERR(11)+1
78 .S CNTERR(100)=CNTERR(100)+1
79 S PFRGNID=""
80 S PFICNFLG=$$GETICN^MPIF001(PRPFHLD1)
81 I +PFICNFLG'=-1 D
82 .I $D(^TMP("PRPF_DIAGX",$J,"PFICN",+PFICNFLG)) D
83 ..S ^TMP("PRPF_DIAGX",$J,PFSTAID,13,PFNAME_"_"_PRPFHLD1)="ICN^ICN Duplicate^"_PFICNFLG
84 ..S CNTERR(13)=CNTERR(13)+1
85 ..S CNTERR(100)=CNTERR(100)+1
86 .S ^TMP("PRPF_DIAGX",$J,"PFICN",+PFICNFLG)=PFICNFLG
87 I +PFICNFLG=-1 D
88 .S ^TMP("PRPF_DIAGX",$J,PFSTAID,14,PFNAME_"_"_PRPFHLD1)="ICN^ICN Unassigned or invalid^"_$P(PFICNFLG,"^",2)
89 .S CNTERR(14)=CNTERR(14)+1
90 .S CNTERR(100)=CNTERR(100)+1
91 .;S PRPFBJOB=$$MPIQQ^MPIFAPI(PRPFHLD1)
92 S (PFAUTHRS,PFNAMEX)=""
93 I PFAUTH'="" D
94 .S (PFAUTHRS,PFNAMEX)=$P($G(^VA(200,PFAUTH,0)),"^",1)
95 .I $$FORMAT^XLFNAME7(PFNAMEX,3,30)'=PFNAMEX!('$D(^VA(200,PFAUTH,0))) D
96 ..S ^TMP("PRPF_DIAGX",$J,PFSTAID,15,PFNAME_"_"_PRPFHLD1)="PFAUTHRS^Provider name contains invalid data^"_PFAUTHRS
97 ..S CNTERR(15)=CNTERR(15)+1
98 ..S CNTERR(100)=CNTERR(100)+1
99 S PFAUTHDT=$P(^PRPF(470,PRPFHLD1,0),"^",12)
100 I PFAUTHDT'="" D
101 .K PRPFBADD
102 .D DT^DILF("X",PFAUTHDT,.PRPFBADD)
103 .I $L(+PFAUTHDT)'=7!(PRPFBADD=-1) D
104 ..S ^TMP("PRPF_DIAGX",$J,PFSTAID,16,PFNAME_"_"_PRPFHLD1)="PROVAUTHDT^Date of current restriction contains invalid date^"_PFAUTHDT
105 ..S CNTERR(16)=CNTERR(16)+1
106 ..S CNTERR(100)=CNTERR(100)+1
107 S PFSTAT=$P(PFNODE0,"^",2)
108 I PFSTAT="" D
109 .S PRPFBC18=PRPFBC18+1
110 I PFSTAT'["A"&(PFSTAT'["I")&(PFSTAT'="") D
111 .S ^TMP("PRPF_DIAGX",$J,PFSTAID,18,PFNAME_"_"_PRPFHLD1)="ACCOUNT STATUS^Account status containing values other than A or I^"_PFSTAT
112 .S CNTERR(18)=CNTERR(18)+1
113 .S CNTERR(100)=CNTERR(100)+1
114 S PFTYPE=$P(PFNODE0,"^",3)
115 I PFTYPE="" D
116 .S PRPFBC19=PRPFBC19+1
117 I PFTYPE'["L"&(PFTYPE'["R")&(PFTYPE'["U")&(PFTYPE'["X")&(PFTYPE'="") D
118 .S ^TMP("PRPF_DIAGX",$J,PFSTAID,19,PFNAME_"_"_PRPFHLD1)="PATIENT TYPE^Patient type values other than L, R, U, X^"_PFTYPE
119 .S CNTERR(19)=CNTERR(19)+1
120 .S CNTERR(100)=CNTERR(100)+1
121 I (PFAUTH=""&(PFTYPE="L"))!(PFAUTH=""&(PFTYPE="R")) D
122 .S ^TMP("PRPF_DIAGX",$J,PFSTAID,20,PFNAME_"_"_PRPFHLD1)="PATIENT TYPE/PHY^No Physician name for L or R^"_PFTYPE
123 .S CNTERR(20)=CNTERR(20)+1
124 .S CNTERR(100)=CNTERR(100)+1
125 S PFPSTAT=$P(PFNODE0,"^",4)
126 I PFPSTAT="" D
127 .S PRPFBC21=PRPFBC21+1
128 I PFPSTAT'["A"&(PFPSTAT'["R")&(PFPSTAT'["C")&(PFPSTAT'["N")&(PFPSTAT'["X")&(PFPSTAT'="") D
129 .S ^TMP("PRPF_DIAGX",$J,PFSTAID,21,PFNAME_"_"_PRPFHLD1)="PATIENT STATUS^Patient status values other than A, R, C, N, X^"_PFPSTAT
130 .S CNTERR(21)=CNTERR(21)+1
131 .S CNTERR(100)=CNTERR(100)+1
132 S PFINDIG=$P(PFNODE0,"^",5)
133 I PFINDIG="" D
134 .S PRPFBC22=PRPFBC22+1
135 I PFINDIG'["Y"&(PFINDIG'["N")&(PFINDIG'="") D
136 .S ^TMP("PRPF_DIAGX",$J,PFSTAID,22,PFNAME_"_"_PRPFHLD1)="INDIGENT^Indigent indicator values other than Y, N^"_PFINDIG
137 .S CNTERR(22)=CNTERR(22)+1
138 .S CNTERR(100)=CNTERR(100)+1
139 S PFAPPOR=$P(PFNODE0,"^",6)
140 I PFAPPOR'="" I PFAPPOR<0!(PFAPPOR>99999)!((PFAPPOR'=+PFAPPOR)&(PFAPPOR'?.N1".".N)) D
141 .S ^TMP("PRPF_DIAGX",$J,PFSTAID,23,PFNAME_"_"_PRPFHLD1)="APPORTIONEE $^Apportionee amount invalid or out of range either < 0 or > $99,999.00^"_PFAPPOR
142 .S CNTERR(23)=CNTERR(23)+1
143 .S CNTERR(100)=CNTERR(100)+1
144 S PFGUARD=$P(PFNODE0,"^",7)
145 I PFGUARD'="" I PFGUARD<0!(PFGUARD>99999)!((PFGUARD'=+PFGUARD)&(PFGUARD'?.N1".".N)) D
146 .S ^TMP("PRPF_DIAGX",$J,PFSTAID,24,PFNAME_"_"_PRPFHLD1)="GUARDIAN $^Guardian amount invalid or out of range either < 0 or > $99,999.00^"_PFGUARD
147 .S CNTERR(24)=CNTERR(24)+1
148 .S CNTERR(100)=CNTERR(100)+1
149 S PFINSAWD=$P(PFNODE0,"^",8)
150 I PFINSAWD'="" I PFINSAWD<0!(PFINSAWD>99999)!((PFINSAWD'=+PFINSAWD)&(PFINSAWD'?.N1".".N)) D
151 .S ^TMP("PRPF_DIAGX",$J,PFSTAID,25,PFNAME_"_"_PRPFHLD1)="INSTITUTIONAL AWARD^Institutional award invalid or out of range either < 0 or > $99,999.00^"_PFINSAWD
152 .S CNTERR(25)=CNTERR(25)+1
153 .S CNTERR(100)=CNTERR(100)+1
154 S PFOTRAST=$P(PFNODE0,"^",10)
155 I PFOTRAST'="" I PFOTRAST<0!(PFOTRAST>99999)!((PFOTRAST'=+PFOTRAST)&(PFOTRAST'?.N1".".N)) D
156 .S ^TMP("PRPF_DIAGX",$J,PFSTAID,26,PFNAME_"_"_PRPFHLD1)="OTHER ASSETS^Other assets invalid or out of range either < 0 or > $99,999.00^"_PFOTRAST
157 .S CNTERR(26)=CNTERR(26)+1
158 .S CNTERR(100)=CNTERR(100)+1
159 Q
160NODE0X S ^TMP("PRPF_DIAGX",$J,PFSTAID,17,PFNAME_"_"_PRPFHLD1)="NO DEMO RECORD^No demographic record for account^"_PFNAME
161 S CNTERR(17)=CNTERR(17)+1
162 S CNTERR(100)=CNTERR(100)+1
163 Q
Note: See TracBrowser for help on using the repository browser.