source: FOIAVistA/tag/r/REGISTRATION-DGQE-DG-DPT-GRPX-VAD-VAF-VAS-VAT-VAU--VA-VIC--DGBT--DGJ--DGYA--VALM/DGRPTX13.m@ 812

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

WorldVistAEHR overlayed on FOIAVistA

File size: 8.0 KB
Line 
1DGRPTX13 ; ;04/21/06
2 D DE G BEGIN
3DE S DIE="^DPT(",DIC=DIE,DP=2,DL=1,DIEL=0,DU="" K DG,DE,DB Q:$O(^DPT(DA,""))=""
4 I $D(^(.22)) S %Z=^(.22) S %=$P(%Z,U,1) S:%]"" DE(16)=%
5 I $D(^(.33)) S %Z=^(.33) S %=$P(%Z,U,1) S:%]"" DE(6)=% S %=$P(%Z,U,2) S:%]"" DE(8)=% S %=$P(%Z,U,3) S:%]"" DE(9)=% S %=$P(%Z,U,4) S:%]"" DE(11)=% S %=$P(%Z,U,5) S:%]"" DE(13)=% S %=$P(%Z,U,6) S:%]"" DE(14)=% S %=$P(%Z,U,7) S:%]"" DE(15)=%
6 I S %=$P(%Z,U,10) S:%]"" DE(1)=%
7 K %Z Q
8 ;
9W W !?DL+DL-2,DLB_": "
10 Q
11O 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
14TR R X:DTIME E S (DTOUT,X)=U W $C(7)
15 Q
16A K DQ(DQ) S DQ=DQ+1
17B G @DQ
18RE G PR:$D(DE(DQ)) D W,TR
19N I X="" G NKEY:$D(^DD("KEY","F",DP,DIFLD)),A:DV'["R",X:'DV,X:D'>0,A
20RD 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
23T 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
25P 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
28V D @("X"_DQ) K YS
29Z 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
30X W:'$D(ZTQUEUED) $C(7),"??" I $D(DB(DQ)) G Z^DIE17
31 S X="?BAD"
32QS S DZ=X D D,QQ^DIEQ G B
33D S D=DIFLD,DQ(DQ)=DLB_U_DV_U_DU_U_DW_U_$P($T(@("X"_DQ))," ",2,99) Q
34Y I '$D(DE(DQ)) D O G RD:"@"'[X,A:DV'["R"&(X="@"),X:X="@" S X=Y G N
35PR S DG=DV,Y=DE(DQ),X=DU I $D(DQ(DQ,2)) X DQ(DQ,2) G RP
36R 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=%
39RP D O I X="" S X=DE(DQ) G A:'DV,A:DC<2,N^DIE17
40I I DV'["I",DV'["#" G RD
41 D E^DIE0 G RD:$D(X),PR
42 Q
43SET 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
47SAVEVALS 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
51NKEY W:'$D(ZTQUEUED) "?? Required key field" S X="?BAD" G QS
52KEYCHK() Q:$G(DE(DW,"KEY"))="" 1 Q @DE(DW,"KEY")
53BEGIN S DNM="DGRPTX13",DQ=1
541 S DW=".33;10",DV="RSX",DU="",DLB="E-EMER. CONTACT SAME AS NOK?",DIFLD=.3305
55 S DE(DW)="C1^DGRPTX13",DE(DW,"INDEX")=1
56 S DU="Y:YES;N:NO;"
57 S Y="NO"
58 G Y
59C1 G C1S:$D(DE(1))[0 K DB
60C1S S X="" G:DG(DQ)=X C1F1 K DB
61C1F1 S DIEZRXR(2,DIIENS)=$$OREF^DILF($NA(@$$CREF^DILF(DIE)))
62 F DIXR=604 S DIEZRXR(2,DIXR)=""
63 Q
64X1 I $D(X),X="Y" D K1^DGLOCK2
65 Q
66 ;
672 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=2 D X2 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
68X2 I X'="Y" S Y=.331
69 Q
703 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=3 D X3 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
71X3 S X=$S($D(^DPT(DA,.21)):^(.21),1:"") S:X'="" ^(.33)=$P(X_"^^^^^^^^^^^",U,1,9)_U_$P(^(.33),U,10)_U_$P(X,U,11)
72 Q
734 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
74X4 S:$D(^DPT(DFN,.22)) $P(^(.22),U,1)=$P(^(.22),U,7)
75 Q
765 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=5 D X5 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
77X5 S Y=.33011
78 Q
796 D:$D(DG)>9 F^DIE17,DE S DQ=6,DW=".33;1",DV="F",DU="",DLB="E-NAME",DIFLD=.331
80 S DE(DW)="C6^DGRPTX13",DE(DW,"INDEX")=1
81 G RE
82C6 G C6S:$D(DE(6))[0 K DB
83 S X=DE(6),DIC=DIE
84 X "S DGXRF=.331 D ^DGDDC Q"
85C6S S X="" G:DG(DQ)=X C6F1 K DB
86 S X=DG(DQ),DIC=DIE
87 ;
88C6F1 N X,X1,X2 S DIXR=595 D C6X1(U) K X2 M X2=X D C6X1("O") K X1 M X1=X
89 I $G(X(1))]"" D
90 . I '$G(XUNOTRIG) N XUNOTRIG S XUNOTRIG=1 D DELCOMP^XLFNAME2(2,.DA,.331,1.07) Q
91 K X M X=X2 I $G(X(1))]"" D
92 . I '$G(XUNOTRIG) N XUNOTRIG S XUNOTRIG=1,DG20NAME=X D NARY^XLFNAME7(.DG20NAME),UPDCOMP^XLFNAME2(2,.DA,.331,.DG20NAME,1.07,+$P($G(^DPT(DA,"NAME")),U,7),"CL35") K DG20NAME Q
93 G C6F2
94C6X1(DION) K X
95 S X(1)=$G(@DIEZTMP@("V",2,DIIENS,.331,DION),$P($G(^DPT(DA,.33)),U,1))
96 S X=$G(X(1))
97 Q
98C6F2 S DIEZRXR(2,DIIENS)=$$OREF^DILF($NA(@$$CREF^DILF(DIE)))
99 F DIXR=604 S DIEZRXR(2,DIXR)=""
100 Q
101X6 K:$L(X)>35!($L(X)<3) X I $D(X) S DG20NAME=X,(X,DG20NAME)=$$FORMAT^XLFNAME7(.DG20NAME,3,35) K:'$L(X) X,DG20NAME
102 I $D(X),X'?.ANP K X
103 Q
104 ;
1057 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=7 D X7 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
106X7 S:X="" Y="@40"
107 Q
1088 D:$D(DG)>9 F^DIE17,DE S DQ=8,DW=".33;2",DV="FX",DU="",DLB="E-RELATIONSHIP TO PATIENT",DIFLD=.332
109 S DE(DW)="C8^DGRPTX13",DE(DW,"INDEX")=1
110 G RE
111C8 G C8S:$D(DE(8))[0 K DB
112C8S S X="" G:DG(DQ)=X C8F1 K DB
113C8F1 S DIEZRXR(2,DIIENS)=$$OREF^DILF($NA(@$$CREF^DILF(DIE)))
114 F DIXR=604 S DIEZRXR(2,DIXR)=""
115 Q
116X8 K:$L(X)>30!($L(X)<2) X I $D(X) S DFN=DA D E1^DGLOCK2
117 I $D(X),X'?.ANP K X
118 Q
119 ;
1209 D:$D(DG)>9 F^DIE17,DE S DQ=9,DW=".33;3",DV="FX",DU="",DLB="E-STREET ADDRESS [LINE 1]",DIFLD=.333
121 S DE(DW)="C9^DGRPTX13",DE(DW,"INDEX")=1
122 G RE
123C9 G C9S:$D(DE(9))[0 K DB
124 S X=DE(9),DIC=DIE
125 X "S DGXRF=.333 D ^DGDDC Q"
126C9S S X="" G:DG(DQ)=X C9F1 K DB
127 S X=DG(DQ),DIC=DIE
128 ;
129C9F1 S DIEZRXR(2,DIIENS)=$$OREF^DILF($NA(@$$CREF^DILF(DIE)))
130 F DIXR=604 S DIEZRXR(2,DIXR)=""
131 Q
132X9 K:X[""""!($A(X)=45) X I $D(X) K:$L(X)>30!($L(X)<3) X I $D(X) S DFN=DA D E1^DGLOCK2
133 I $D(X),X'?.ANP K X
134 Q
135 ;
13610 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=10 D X10 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
137X10 S:X="" Y=.336
138 Q
13911 D:$D(DG)>9 F^DIE17,DE S DQ=11,DW=".33;4",DV="FX",DU="",DLB="E-STREET ADDRESS [LINE 2]",DIFLD=.334
140 S DE(DW)="C11^DGRPTX13",DE(DW,"INDEX")=1
141 G RE
142C11 G C11S:$D(DE(11))[0 K DB
143 S X=DE(11),DIC=DIE
144 X "S DGXRF=.334 D ^DGDDC Q"
145C11S S X="" G:DG(DQ)=X C11F1 K DB
146 S X=DG(DQ),DIC=DIE
147 ;
148C11F1 S DIEZRXR(2,DIIENS)=$$OREF^DILF($NA(@$$CREF^DILF(DIE)))
149 F DIXR=604 S DIEZRXR(2,DIXR)=""
150 Q
151X11 K:X[""""!($A(X)=45) X I $D(X) K:$L(X)>30!($L(X)<3) X I $D(X) S DFN=DA D E1^DGLOCK2
152 I $D(X),X'?.ANP K X
153 Q
154 ;
15512 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=12 D X12 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
156X12 S:X="" Y=.336
157 Q
15813 D:$D(DG)>9 F^DIE17,DE S DQ=13,DW=".33;5",DV="FX",DU="",DLB="E-STREET ADDRESS [LINE 3]",DIFLD=.335
159 S DE(DW)="C13^DGRPTX13",DE(DW,"INDEX")=1
160 G RE
161C13 G C13S:$D(DE(13))[0 K DB
162C13S S X="" G:DG(DQ)=X C13F1 K DB
163C13F1 S DIEZRXR(2,DIIENS)=$$OREF^DILF($NA(@$$CREF^DILF(DIE)))
164 F DIXR=604 S DIEZRXR(2,DIXR)=""
165 Q
166X13 K:$L(X)>30!($L(X)<3) X I $D(X) S DFN=DA D E1^DGLOCK2
167 I $D(X),X'?.ANP K X
168 Q
169 ;
17014 D:$D(DG)>9 F^DIE17,DE S DQ=14,DW=".33;6",DV="FX",DU="",DLB="E-CITY",DIFLD=.336
171 S DE(DW)="C14^DGRPTX13",DE(DW,"INDEX")=1
172 G RE
173C14 G C14S:$D(DE(14))[0 K DB
174C14S S X="" G:DG(DQ)=X C14F1 K DB
175C14F1 S DIEZRXR(2,DIIENS)=$$OREF^DILF($NA(@$$CREF^DILF(DIE)))
176 F DIXR=604 S DIEZRXR(2,DIXR)=""
177 Q
178X14 K:$L(X)>30!($L(X)<3) X I $D(X) S DFN=DA D E1^DGLOCK2
179 I $D(X),X'?.ANP K X
180 Q
181 ;
18215 D:$D(DG)>9 F^DIE17,DE S DQ=15,DW=".33;7",DV="P5'X",DU="",DLB="E-STATE",DIFLD=.337
183 S DE(DW)="C15^DGRPTX13",DE(DW,"INDEX")=1
184 S DU="DIC(5,"
185 G RE
186C15 G C15S:$D(DE(15))[0 K DB
187C15S S X="" G:DG(DQ)=X C15F1 K DB
188C15F1 S DIEZRXR(2,DIIENS)=$$OREF^DILF($NA(@$$CREF^DILF(DIE)))
189 F DIXR=604 S DIEZRXR(2,DIXR)=""
190 Q
191X15 I $D(X) S DFN=DA D E1^DGLOCK2
192 Q
193 ;
19416 D:$D(DG)>9 F^DIE17,DE S DQ=16,DW=".22;1",DV="FOX",DU="",DLB="E-ZIP+4",DIFLD=.2201
195 S DQ(16,2)="S Y(0)=Y D ZIPOUT^VAFADDR"
196 S DE(DW)="C16^DGRPTX13",DE(DW,"INDEX")=1
197 G RE
198C16 G C16S:$D(DE(16))[0 K DB
199 D ^DGRPTX14
200C16S S X="" G:DG(DQ)=X C16F1 K DB
201 D ^DGRPTX15
202C16F1 S DIEZRXR(2,DIIENS)=$$OREF^DILF($NA(@$$CREF^DILF(DIE)))
203 F DIXR=604 S DIEZRXR(2,DIXR)=""
204 Q
205X16 K:X[""""!($A(X)=45) X I $D(X) S DFN=DA D E1^DGLOCK2 I $D(X) K:$L(X)>15!($L(X)<5) X I $D(X) D ZIPIN^VAFADDR
206 I $D(X),X'?.ANP K X
207 Q
208 ;
20917 D:$D(DG)>9 F^DIE17 G ^DGRPTX16
Note: See TracBrowser for help on using the repository browser.