1 | DGRPTX10 ; ;04/21/06
|
---|
2 | D DE G BEGIN
|
---|
3 | DE S DIE="^DPT(",DIC=DIE,DP=2,DL=1,DIEL=0,DU="" K DG,DE,DB Q:$O(^DPT(DA,""))=""
|
---|
4 | I $D(^(.21)) S %Z=^(.21) S %=$P(%Z,U,2) S:%]"" DE(1)=% S %=$P(%Z,U,3) S:%]"" DE(5)=% S %=$P(%Z,U,4) S:%]"" DE(7)=% S %=$P(%Z,U,5) S:%]"" DE(9)=% S %=$P(%Z,U,6) S:%]"" DE(10)=% S %=$P(%Z,U,7) S:%]"" DE(11)=% S %=$P(%Z,U,9) S:%]"" DE(13)=%
|
---|
5 | I S %=$P(%Z,U,10) S:%]"" DE(3)=% S %=$P(%Z,U,11) S:%]"" DE(14)=%
|
---|
6 | I $D(^(.22)) S %Z=^(.22) S %=$P(%Z,U,7) S:%]"" DE(12)=%
|
---|
7 | K %Z Q
|
---|
8 | ;
|
---|
9 | W W !?DL+DL-2,DLB_": "
|
---|
10 | Q
|
---|
11 | O D W W Y W:$X>45 !?9
|
---|
12 | I $L(Y)>19,'DV,DV'["I",(DV["F"!(DV["K")) G RW^DIR2
|
---|
13 | W:Y]"" "// " I 'DV,DV["I",$D(DE(DQ))#2 S X="" W " (No Editing)" Q
|
---|
14 | TR R X:DTIME E S (DTOUT,X)=U W $C(7)
|
---|
15 | Q
|
---|
16 | A K DQ(DQ) S DQ=DQ+1
|
---|
17 | B G @DQ
|
---|
18 | RE G PR:$D(DE(DQ)) D W,TR
|
---|
19 | N I X="" G NKEY:$D(^DD("KEY","F",DP,DIFLD)),A:DV'["R",X:'DV,X:D'>0,A
|
---|
20 | RD G QS:X?."?" I X["^" D D G ^DIE17
|
---|
21 | I X="@" D D G Z^DIE2
|
---|
22 | I X=" ",DV["d",DV'["P",$D(^DISV(DUZ,"DIE",DLB)) S X=^(DLB) I DV'["D",DV'["S" W " "_X
|
---|
23 | T G M^DIE17:DV,^DIE3:DV["V",P:DV'["S" X:$D(^DD(DP,DIFLD,12.1)) ^(12.1) I X?.ANP D SET I 'DDER X:$D(DIC("S")) DIC("S") I W:'$D(DB(DQ)) " "_% G V
|
---|
24 | K DDER G X
|
---|
25 | P I DV["P" S DIC=U_DU,DIC(0)=$E("EN",$D(DB(DQ))+1)_"M"_$E("L",DV'["'") S:DIC(0)["L" DLAYGO=+$P(DV,"P",2) G:DV["*" AST^DIED D NOSCR^DIED S X=+Y,DIC=DIE G X:X<0
|
---|
26 | G V:DV'["N" D D I $L($P(X,"."))>24 K X G Z
|
---|
27 | I $P(DQ(DQ),U,5)'["$",X?.1"-".N.1".".N,$P(DQ(DQ),U,5,99)["+X'=X" S X=+X
|
---|
28 | V D @("X"_DQ) K YS
|
---|
29 | Z K DIC("S"),DLAYGO I $D(X),X'=U D:$G(DE(DW,"INDEX")) SAVEVALS G:'$$KEYCHK UNIQFERR^DIE17 S DG(DW)=X S:DV["d" ^DISV(DUZ,"DIE",DLB)=X G A
|
---|
30 | X W:'$D(ZTQUEUED) $C(7),"??" I $D(DB(DQ)) G Z^DIE17
|
---|
31 | S X="?BAD"
|
---|
32 | QS S DZ=X D D,QQ^DIEQ G B
|
---|
33 | D S D=DIFLD,DQ(DQ)=DLB_U_DV_U_DU_U_DW_U_$P($T(@("X"_DQ))," ",2,99) Q
|
---|
34 | Y I '$D(DE(DQ)) D O G RD:"@"'[X,A:DV'["R"&(X="@"),X:X="@" S X=Y G N
|
---|
35 | PR S DG=DV,Y=DE(DQ),X=DU I $D(DQ(DQ,2)) X DQ(DQ,2) G RP
|
---|
36 | R I DG["P",@("$D(^"_X_"0))") S X=+$P(^(0),U,2) G RP:'$D(^(Y,0)) S Y=$P(^(0),U),X=$P(^DD(X,.01,0),U,3),DG=$P(^(0),U,2) G R
|
---|
37 | I DG["V",+Y,$P(Y,";",2)["(",$D(@(U_$P(Y,";",2)_"0)")) S X=+$P(^(0),U,2) G RP:'$D(^(+Y,0)) S Y=$P(^(0),U) I $D(^DD(+X,.01,0)) S DG=$P(^(0),U,2),X=$P(^(0),U,3) G R
|
---|
38 | X:DG["D" ^DD("DD") I DG["S" S %=$P($P(";"_X,";"_Y_":",2),";") S:%]"" Y=%
|
---|
39 | RP D O I X="" S X=DE(DQ) G A:'DV,A:DC<2,N^DIE17
|
---|
40 | I I DV'["I",DV'["#" G RD
|
---|
41 | D E^DIE0 G RD:$D(X),PR
|
---|
42 | Q
|
---|
43 | SET N DIR S DIR(0)="SV"_$E("o",$D(DB(DQ)))_U_DU,DIR("V")=1
|
---|
44 | I $D(DB(DQ)),'$D(DIQUIET) N DIQUIET S DIQUIET=1
|
---|
45 | D ^DIR I 'DDER S %=Y(0),X=Y
|
---|
46 | Q
|
---|
47 | SAVEVALS S @DIEZTMP@("V",DP,DIIENS,DIFLD,"O")=$G(DE(DQ)) S:$D(^("F"))[0 ^("F")=$G(DE(DQ))
|
---|
48 | I $D(DE(DW,"4/")) S @DIEZTMP@("V",DP,DIIENS,DIFLD,"4/")=""
|
---|
49 | E K @DIEZTMP@("V",DP,DIIENS,DIFLD,"4/")
|
---|
50 | Q
|
---|
51 | NKEY W:'$D(ZTQUEUED) "?? Required key field" S X="?BAD" G QS
|
---|
52 | KEYCHK() Q:$G(DE(DW,"KEY"))="" 1 Q @DE(DW,"KEY")
|
---|
53 | BEGIN S DNM="DGRPTX10",DQ=1
|
---|
54 | 1 D:$D(DG)>9 F^DIE17,DE S DQ=1,DW=".21;2",DV="FX",DU="",DLB="K-RELATIONSHIP TO PATIENT",DIFLD=.212
|
---|
55 | S DE(DW)="C1^DGRPTX10",DE(DW,"INDEX")=1
|
---|
56 | G RE
|
---|
57 | C1 G C1S:$D(DE(1))[0 K DB
|
---|
58 | S X=DE(1),DIC=DIE
|
---|
59 | D:($T(ADGRU^DGRUDD01)'="") ADGRU^DGRUDD01(DA)
|
---|
60 | C1S S X="" G:DG(DQ)=X C1F1 K DB
|
---|
61 | S X=DG(DQ),DIC=DIE
|
---|
62 | D:($T(ADGRU^DGRUDD01)'="") ADGRU^DGRUDD01(DA)
|
---|
63 | C1F1 S DIEZRXR(2,DIIENS)=$$OREF^DILF($NA(@$$CREF^DILF(DIE)))
|
---|
64 | F DIXR=602 S DIEZRXR(2,DIXR)=""
|
---|
65 | Q
|
---|
66 | X1 K:$L(X)>30!($L(X)<1) X I $D(X) S DFN=DA D K1^DGLOCK2
|
---|
67 | I $D(X),X'?.ANP K X
|
---|
68 | Q
|
---|
69 | ;
|
---|
70 | 2 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=2 G A
|
---|
71 | 3 D:$D(DG)>9 F^DIE17,DE S DQ=3,DW=".21;10",DV="RSX",DU="",DLB="K-ADDRESS SAME AS PATIENT'S?",DIFLD=.2125
|
---|
72 | S DE(DW)="C3^DGRPTX10",DE(DW,"INDEX")=1
|
---|
73 | S DU="Y:YES;N:NO;"
|
---|
74 | S Y="NO"
|
---|
75 | G Y
|
---|
76 | C3 G C3S:$D(DE(3))[0 K DB
|
---|
77 | C3S S X="" G:DG(DQ)=X C3F1 K DB
|
---|
78 | C3F1 S DIEZRXR(2,DIIENS)=$$OREF^DILF($NA(@$$CREF^DILF(DIE)))
|
---|
79 | F DIXR=602 S DIEZRXR(2,DIXR)=""
|
---|
80 | Q
|
---|
81 | X3 I $D(X),X="Y" S DFN=DA D K1^DGLOCK2
|
---|
82 | Q
|
---|
83 | ;
|
---|
84 | 4 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=4 D X4 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
|
---|
85 | X4 I X="Y" S DGADD=".21" D AD^DGRPE S Y=.21011
|
---|
86 | Q
|
---|
87 | 5 D:$D(DG)>9 F^DIE17,DE S DQ=5,DW=".21;3",DV="FX",DU="",DLB="K-STREET ADDRESS [LINE 1]",DIFLD=.213
|
---|
88 | S DE(DW)="C5^DGRPTX10",DE(DW,"INDEX")=1
|
---|
89 | G RE
|
---|
90 | C5 G C5S:$D(DE(5))[0 K DB
|
---|
91 | S X=DE(5),DIC=DIE
|
---|
92 | X "S DGXRF=.213 D ^DGDDC Q"
|
---|
93 | S X=DE(5),DIC=DIE
|
---|
94 | D:($T(ADGRU^DGRUDD01)'="") ADGRU^DGRUDD01(DA)
|
---|
95 | C5S S X="" G:DG(DQ)=X C5F1 K DB
|
---|
96 | S X=DG(DQ),DIC=DIE
|
---|
97 | ;
|
---|
98 | S X=DG(DQ),DIC=DIE
|
---|
99 | D:($T(ADGRU^DGRUDD01)'="") ADGRU^DGRUDD01(DA)
|
---|
100 | C5F1 S DIEZRXR(2,DIIENS)=$$OREF^DILF($NA(@$$CREF^DILF(DIE)))
|
---|
101 | F DIXR=602 S DIEZRXR(2,DIXR)=""
|
---|
102 | Q
|
---|
103 | X5 K:X[""""!($A(X)=45) X I $D(X) K:$L(X)>30!($L(X)<3) X I $D(X) S DFN=DA D K1^DGLOCK2
|
---|
104 | I $D(X),X'?.ANP K X
|
---|
105 | Q
|
---|
106 | ;
|
---|
107 | 6 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=6 D X6 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
|
---|
108 | X6 S:X="" Y=.216
|
---|
109 | Q
|
---|
110 | 7 D:$D(DG)>9 F^DIE17,DE S DQ=7,DW=".21;4",DV="FX",DU="",DLB="K-STREET ADDRESS [LINE 2]",DIFLD=.214
|
---|
111 | S DE(DW)="C7^DGRPTX10",DE(DW,"INDEX")=1
|
---|
112 | G RE
|
---|
113 | C7 G C7S:$D(DE(7))[0 K DB
|
---|
114 | S X=DE(7),DIC=DIE
|
---|
115 | X "S DGXRF=.214 D ^DGDDC Q"
|
---|
116 | S X=DE(7),DIC=DIE
|
---|
117 | D:($T(ADGRU^DGRUDD01)'="") ADGRU^DGRUDD01(DA)
|
---|
118 | C7S S X="" G:DG(DQ)=X C7F1 K DB
|
---|
119 | S X=DG(DQ),DIC=DIE
|
---|
120 | ;
|
---|
121 | S X=DG(DQ),DIC=DIE
|
---|
122 | D:($T(ADGRU^DGRUDD01)'="") ADGRU^DGRUDD01(DA)
|
---|
123 | C7F1 S DIEZRXR(2,DIIENS)=$$OREF^DILF($NA(@$$CREF^DILF(DIE)))
|
---|
124 | F DIXR=602 S DIEZRXR(2,DIXR)=""
|
---|
125 | Q
|
---|
126 | X7 K:X[""""!($A(X)=45) X I $D(X) K:$L(X)>30!($L(X)<3) X I $D(X) S DFN=DA D K1^DGLOCK2
|
---|
127 | I $D(X),X'?.ANP K X
|
---|
128 | Q
|
---|
129 | ;
|
---|
130 | 8 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=8 D X8 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
|
---|
131 | X8 S:X="" Y=.216
|
---|
132 | Q
|
---|
133 | 9 D:$D(DG)>9 F^DIE17,DE S DQ=9,DW=".21;5",DV="FX",DU="",DLB="K-STREET ADDRESS [LINE 3]",DIFLD=.215
|
---|
134 | S DE(DW)="C9^DGRPTX10",DE(DW,"INDEX")=1
|
---|
135 | G RE
|
---|
136 | C9 G C9S:$D(DE(9))[0 K DB
|
---|
137 | C9S S X="" G:DG(DQ)=X C9F1 K DB
|
---|
138 | C9F1 S DIEZRXR(2,DIIENS)=$$OREF^DILF($NA(@$$CREF^DILF(DIE)))
|
---|
139 | F DIXR=602 S DIEZRXR(2,DIXR)=""
|
---|
140 | Q
|
---|
141 | X9 K:$L(X)>30!($L(X)<3) X I $D(X) S DFN=DA D K1^DGLOCK2
|
---|
142 | I $D(X),X'?.ANP K X
|
---|
143 | Q
|
---|
144 | ;
|
---|
145 | 10 D:$D(DG)>9 F^DIE17,DE S DQ=10,DW=".21;6",DV="FX",DU="",DLB="K-CITY",DIFLD=.216
|
---|
146 | S DE(DW)="C10^DGRPTX10",DE(DW,"INDEX")=1
|
---|
147 | G RE
|
---|
148 | C10 G C10S:$D(DE(10))[0 K DB
|
---|
149 | S X=DE(10),DIC=DIE
|
---|
150 | D:($T(ADGRU^DGRUDD01)'="") ADGRU^DGRUDD01(DA)
|
---|
151 | C10S S X="" G:DG(DQ)=X C10F1 K DB
|
---|
152 | S X=DG(DQ),DIC=DIE
|
---|
153 | D:($T(ADGRU^DGRUDD01)'="") ADGRU^DGRUDD01(DA)
|
---|
154 | C10F1 S DIEZRXR(2,DIIENS)=$$OREF^DILF($NA(@$$CREF^DILF(DIE)))
|
---|
155 | F DIXR=602 S DIEZRXR(2,DIXR)=""
|
---|
156 | Q
|
---|
157 | X10 K:$L(X)>30!($L(X)<3) X I $D(X) S DFN=DA D K1^DGLOCK2
|
---|
158 | I $D(X),X'?.ANP K X
|
---|
159 | Q
|
---|
160 | ;
|
---|
161 | 11 D:$D(DG)>9 F^DIE17,DE S DQ=11,DW=".21;7",DV="P5'X",DU="",DLB="K-STATE",DIFLD=.217
|
---|
162 | S DE(DW)="C11^DGRPTX10",DE(DW,"INDEX")=1
|
---|
163 | S DU="DIC(5,"
|
---|
164 | G RE
|
---|
165 | C11 G C11S:$D(DE(11))[0 K DB
|
---|
166 | S X=DE(11),DIC=DIE
|
---|
167 | D:($T(ADGRU^DGRUDD01)'="") ADGRU^DGRUDD01(DA)
|
---|
168 | C11S S X="" G:DG(DQ)=X C11F1 K DB
|
---|
169 | S X=DG(DQ),DIC=DIE
|
---|
170 | D:($T(ADGRU^DGRUDD01)'="") ADGRU^DGRUDD01(DA)
|
---|
171 | C11F1 S DIEZRXR(2,DIIENS)=$$OREF^DILF($NA(@$$CREF^DILF(DIE)))
|
---|
172 | F DIXR=602 S DIEZRXR(2,DIXR)=""
|
---|
173 | Q
|
---|
174 | X11 I $D(X) S DFN=DA D K1^DGLOCK2
|
---|
175 | Q
|
---|
176 | ;
|
---|
177 | 12 D:$D(DG)>9 F^DIE17,DE S DQ=12,DW=".22;7",DV="FOX",DU="",DLB="K-ZIP+4",DIFLD=.2207
|
---|
178 | S DQ(12,2)="S Y(0)=Y D ZIPOUT^VAFADDR"
|
---|
179 | S DE(DW)="C12^DGRPTX10",DE(DW,"INDEX")=1
|
---|
180 | G RE
|
---|
181 | C12 G C12S:$D(DE(12))[0 K DB
|
---|
182 | S X=DE(12),DIC=DIE
|
---|
183 | D KILL^DGREGDD1(DA,.218,.21,8,$E(X,1,5))
|
---|
184 | C12S S X="" G:DG(DQ)=X C12F1 K DB
|
---|
185 | S X=DG(DQ),DIC=DIE
|
---|
186 | D SET^DGREGDD1(DA,.218,.21,8,$E(X,1,5))
|
---|
187 | C12F1 S DIEZRXR(2,DIIENS)=$$OREF^DILF($NA(@$$CREF^DILF(DIE)))
|
---|
188 | F DIXR=602 S DIEZRXR(2,DIXR)=""
|
---|
189 | Q
|
---|
190 | X12 K:X[""""!($A(X)=45) X I $D(X) S DFN=DA D K1^DGLOCK2 I $D(X) K:$L(X)>15!($L(X)<5) X I $D(X) D ZIPIN^VAFADDR
|
---|
191 | I $D(X),X'?.ANP K X
|
---|
192 | Q
|
---|
193 | ;
|
---|
194 | 13 D:$D(DG)>9 F^DIE17,DE S DQ=13,DW=".21;9",DV="FXa",DU="",DLB="K-PHONE NUMBER",DIFLD=.219
|
---|
195 | S DE(DW)="C13^DGRPTX10"
|
---|
196 | G RE
|
---|
197 | C13 G C13S:$D(DE(13))[0 K DB
|
---|
198 | D ^DGRPTX11
|
---|
199 | C13S S X="" G:DG(DQ)=X C13F1 K DB
|
---|
200 | D ^DGRPTX12
|
---|
201 | C13F1 Q
|
---|
202 | X13 K:$L(X)>20!($L(X)<4) X I $D(X) S DFN=DA D K1^DGLOCK2
|
---|
203 | I $D(X),X'?.ANP K X
|
---|
204 | Q
|
---|
205 | ;
|
---|
206 | 14 D:$D(DG)>9 F^DIE17,DE S DQ=14,DW=".21;11",DV="F",DU="",DLB="K-WORK PHONE NUMBER",DIFLD=.21011
|
---|
207 | G RE
|
---|
208 | X14 K:$L(X)>20!($L(X)<4) X
|
---|
209 | I $D(X),X'?.ANP K X
|
---|
210 | Q
|
---|
211 | ;
|
---|
212 | 15 S DQ=16 ;@30
|
---|
213 | 16 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=16 D X16 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
|
---|
214 | X16 I $S('$D(^DPT(DFN,.21)):1,$P(^(.21),U,1)="":1,1:0) S Y=.331
|
---|
215 | Q
|
---|
216 | 17 D:$D(DG)>9 F^DIE17 G ^DGRPTX13
|
---|