source: WorldVistAEHR/trunk/r/REGISTRATION-DGQE-DG-DPT-GRPX-VAD-VAF-VAS-VAT-VAU--VA-VIC--DGBT--DGJ--DGYA--VALM/DGPTX11.m@ 1234

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

initial load of WorldVistAEHR

File size: 8.2 KB
Line 
1DGPTX11 ; ;12/27/07
2 D DE G BEGIN
3DE S DIE="^DPT(",DIC=DIE,DP=2,DL=2,DIEL=0,DU="" K DG,DE,DB Q:$O(^DPT(DA,""))=""
4 I $D(^(0)) S %Z=^(0) S %=$P(%Z,U,5) S:%]"" DE(3)=%
5 I $D(^(.321)) S %Z=^(.321) S %=$P(%Z,U,1) S:%]"" DE(10)=% S %=$P(%Z,U,2) S:%]"" DE(11)=% S %=$P(%Z,U,3) S:%]"" DE(14)=% S %=$P(%Z,U,12) S:%]"" DE(16)=% S %=$P(%Z,U,13) S:%]"" DE(13)=%
6 I $D(^(57)) S %Z=^(57) S %=$P(%Z,U,4) S:%]"" DE(6)=%
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="DGPTX11",DQ=1
541 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=1 D X1 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
55X1 S:+DGJUMP'=2 Y="@991"
56 Q
572 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
58X2 S DGJUMP=$P(DGJUMP,"2,",2)
59 Q
603 S DW="0;5",DV="RP11'a",DU="",DLB="MARITAL STATUS",DIFLD=.05
61 S DE(DW)="C3^DGPTX11"
62 S DU="DIC(11,"
63 G RE
64C3 G C3S:$D(DE(3))[0 K DB
65 S X=DE(3),DIC=DIE
66 I ($T(AVAFC^VAFCDD01)'="") S VAFCF=".05;" D AVAFC^VAFCDD01(DA)
67 S X=DE(3),DIC=DIE
68 D:($T(ADGRU^DGRUDD01)'="") ADGRU^DGRUDD01(DA)
69 S X=DE(3),DIC=DIE
70 D EVENT^IVMPLOG(DA)
71 S X=DE(3),DIIX=2_U_DIFLD D AUDIT^DIET
72C3S S X="" G:DG(DQ)=X C3F1 K DB
73 S X=DG(DQ),DIC=DIE
74 I ($T(AVAFC^VAFCDD01)'="") S VAFCF=".05;" D AVAFC^VAFCDD01(DA)
75 S X=DG(DQ),DIC=DIE
76 D:($T(ADGRU^DGRUDD01)'="") ADGRU^DGRUDD01(DA)
77 S X=DG(DQ),DIC=DIE
78 D EVENT^IVMPLOG(DA)
79 I $D(DE(3))'[0!(^DD(DP,DIFLD,"AUDIT")'="e") S X=DG(DQ),DIIX=3_U_DIFLD D AUDIT^DIET
80C3F1 Q
81X3 Q
824 D:$D(DG)>9 F^DIE17,DE S DQ=4,D=0 K DE(1) ;6
83 S DIFLD=6,DGO="^DGPTX13",DC="2^2.06PA^.06^",DV="2.06*P10.2'X",DW="0;1",DOW="ETHNICITY",DLB="Select "_DOW S:D DC=DC_D
84 S DU="DIC(10.2,"
85 I $D(DSC(2.06))#2,$P(DSC(2.06),"I $D(^UTILITY(",1)="" X DSC(2.06) S D=$O(^(0)) S:D="" D=-1 G M4
86 S D=$S($D(^DPT(DA,.06,0)):$P(^(0),U,3,4),$O(^(0))'="":$O(^(0)),1:-1)
87M4 I D>0 S DC=DC_D I $D(^DPT(DA,.06,+D,0)) S DE(4)=$P(^(0),U,1)
88 G RE
89R4 D DE
90 G A
91 ;
925 S D=0 K DE(1) ;2
93 S DIFLD=2,DGO="^DGPTX14",DC="2^2.02P^.02^",DV="2.02M*P10'X",DW="0;1",DOW="RACE",DLB="Select "_DOW S:D DC=DC_D
94 S DU="DIC(10,"
95 G RE:D I $D(DSC(2.02))#2,$P(DSC(2.02),"I $D(^UTILITY(",1)="" X DSC(2.02) S D=$O(^(0)) S:D="" D=-1 G M5
96 S D=$S($D(^DPT(DA,.02,0)):$P(^(0),U,3,4),$O(^(0))'="":$O(^(0)),1:-1)
97M5 I D>0 S DC=DC_D I $D(^DPT(DA,.02,+D,0)) S DE(5)=$P(^(0),U,1)
98 G RE
99R5 D DE
100 S D=$S($D(^DPT(DA,.02,0)):$P(^(0),U,3,4),1:1) G 5+1
101 ;
1026 S DW="57;4",DV="S",DU="",DLB="SPINAL CORD INJURY",DIFLD=57.4
103 S DU="1:PARAPLEGIA-TRAUMATIC;2:QUADRIPLEGIA-TRAUMATIC;3:PARAPLEGIA-NONTRAUMATIC;4:QUADRIPLEGIA-NONTRAUMATIC;X:NOT APPLICABLE;"
104 G RE
105X6 Q
1067 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
107X7 S:+DGJUMP'=3 Y="@991"
108 Q
1098 S DQ=9 ;@31
1109 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=9 D X9 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
111X9 S DGJUMP=$P(DGJUMP,"3,",2)
112 Q
11310 S DW=".321;1",DV="RSX",DU="",DLB="VIETNAM SERVICE INDICATED?",DIFLD=.32101
114 S DE(DW)="C10^DGPTX11"
115 S DU="Y:YES;N:NO;U:UNKNOWN;"
116 G RE
117C10 G C10S:$D(DE(10))[0 K DB
118 S X=DE(10),DIC=DIE
119 ;
120 S X=DE(10),DIC=DIE
121 ;
122 S X=DE(10),DIC=DIE
123 D EVENT^IVMPLOG(DA)
124C10S S X="" G:DG(DQ)=X C10F1 K DB
125 S X=DG(DQ),DIC=DIE
126 X ^DD(2,.32101,1,1,1.3) I X S X=DIV S Y(1)=$S($D(^DPT(D0,.321)):^(.321),1:"") S X=$P(Y(1),U,4) S DIU=X K Y S X=DIV S X="" X ^DD(2,.32101,1,1,1.4)
127 S X=DG(DQ),DIC=DIE
128 X ^DD(2,.32101,1,2,1.3) I X S X=DIV S Y(1)=$S($D(^DPT(D0,.321)):^(.321),1:"") S X=$P(Y(1),U,5) S DIU=X K Y S X=DIV S X="" X ^DD(2,.32101,1,2,1.4)
129 S X=DG(DQ),DIC=DIE
130 D EVENT^IVMPLOG(DA)
131C10F1 Q
132X10 S DFN=DA D SV^DGLOCK
133 Q
134 ;
13511 D:$D(DG)>9 F^DIE17,DE S DQ=11,DW=".321;2",DV="RSX",DU="",DLB="AGENT ORANGE EXPOS. INDICATED?",DIFLD=.32102
136 S DE(DW)="C11^DGPTX11"
137 S DU="Y:YES;N:NO;U:UNKNOWN;"
138 G RE
139C11 G C11S:$D(DE(11))[0 K DB
140 S X=DE(11),DIC=DIE
141 ;
142 S X=DE(11),DIC=DIE
143 ;
144 S X=DE(11),DIC=DIE
145 ;
146 S X=DE(11),DIC=DIE
147 D AUTOUPD^DGENA2(DA)
148 S X=DE(11),DIC=DIE
149 ;
150C11S S X="" G:DG(DQ)=X C11F1 K DB
151 S X=DG(DQ),DIC=DIE
152 X ^DD(2,.32102,1,1,1.3) I X S X=DIV S Y(1)=$S($D(^DPT(D0,.321)):^(.321),1:"") S X=$P(Y(1),U,7) S DIU=X K Y S X=DIV S X="" X ^DD(2,.32102,1,1,1.4)
153 S X=DG(DQ),DIC=DIE
154 X ^DD(2,.32102,1,2,1.3) I X S X=DIV S Y(1)=$S($D(^DPT(D0,.321)):^(.321),1:"") S X=$P(Y(1),U,9) S DIU=X K Y S X=DIV S X="" X ^DD(2,.32102,1,2,1.4)
155 S X=DG(DQ),DIC=DIE
156 X ^DD(2,.32102,1,3,1.3) I X S X=DIV S Y(1)=$S($D(^DPT(D0,.321)):^(.321),1:"") S X=$P(Y(1),U,10) S DIU=X K Y S X=DIV S X="" X ^DD(2,.32102,1,3,1.4)
157 S X=DG(DQ),DIC=DIE
158 D AUTOUPD^DGENA2(DA)
159 S X=DG(DQ),DIC=DIE
160 X ^DD(2,.32102,1,5,1.3) I X S X=DIV S Y(1)=$S($D(^DPT(D0,.321)):^(.321),1:"") S X=$P(Y(1),U,13),X=X S DIU=X K Y S X="" S DIH=$G(^DPT(DIV(0),.321)),DIV=X S $P(^(.321),U,13)=DIV,DIH=2,DIG=.3213 D ^DICR
161C11F1 Q
162X11 S DFN=DA D SV^DGLOCK
163 Q
164 ;
16512 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
166X12 S:X'="Y" Y=.32103
167 Q
16813 D:$D(DG)>9 F^DIE17,DE S DQ=13,DW=".321;13",DV="RSX",DU="",DLB="AGENT ORANGE EXPOSURE LOCATION",DIFLD=.3213
169 S DE(DW)="C13^DGPTX11"
170 S DU="K:KOREAN DMZ;V:VIETNAM;"
171 G RE
172C13 G C13S:$D(DE(13))[0 K DB
173 S X=DE(13),DIC=DIE
174 D EVENT^IVMPLOG(DA)
175C13S S X="" G:DG(DQ)=X C13F1 K DB
176 S X=DG(DQ),DIC=DIE
177 D EVENT^IVMPLOG(DA)
178C13F1 Q
179X13 S DFN=DA D AO^DGLOCK
180 Q
181 ;
18214 D:$D(DG)>9 F^DIE17,DE S DQ=14,DW=".321;3",DV="RSX",DU="",DLB="RADIATION EXPOSURE INDICATED?",DIFLD=.32103
183 S DE(DW)="C14^DGPTX11"
184 S DU="Y:YES;N:NO;U:UNKNOWN;"
185 G RE
186C14 G C14S:$D(DE(14))[0 K DB
187 D ^DGPTX15
188C14S S X="" G:DG(DQ)=X C14F1 K DB
189 D ^DGPTX16
190C14F1 Q
191X14 S DFN=DA D SV^DGLOCK
192 Q
193 ;
19415 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=15 D X15 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
195X15 S:X'="Y" Y=.525
196 Q
19716 D:$D(DG)>9 F^DIE17,DE S DQ=16,DW=".321;12",DV="SX",DU="",DLB="RADIATION EXPOSURE METHOD",DIFLD=.3212
198 S DE(DW)="C16^DGPTX11"
199 S DU="2:HIROSHIMA/NAGASAKI;3:ATMOSPHERIC NUCLEAR TESTING;4:H/N AND ATMOSPHERIC TESTING;5:UNDERGROUND NUCLEAR TESTING;6:EXPOSURE AT NUCLEAR FACILITY;7:OTHER;"
200 G RE
201C16 G C16S:$D(DE(16))[0 K DB
202 D ^DGPTX17
203C16S S X="" G:DG(DQ)=X C16F1 K DB
204 D ^DGPTX18
205C16F1 Q
206X16 S DFN=DA D IR^DGLOCK Q
207 Q
208 ;
20917 D:$D(DG)>9 F^DIE17 G ^DGPTX19
Note: See TracBrowser for help on using the repository browser.