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

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

revised back to 6/30/08 version

File size: 8.0 KB
Line 
1DGRPTX16 ; ;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(^(.32)) S %Z=^(.32) S %=$P(%Z,U,5) S:%]"" DE(4)=% S %=$P(%Z,U,8) S:%]"" DE(5)=%
5 I $D(^(.33)) S %Z=^(.33) S %=$P(%Z,U,9) S:%]"" DE(1)=% S %=$P(%Z,U,11) S:%]"" DE(2)=%
6 I $D(^(.52)) S %Z=^(.52) S %=$P(%Z,U,5) S:%]"" DE(6)=%
7 I $D(^(.53)) S %Z=^(.53) S %=$P(%Z,U,1) S:%]"" DE(8)=% S %=$P(%Z,U,2) S:%]"" DE(13)=% S %=$P(%Z,U,3) S:%]"" DE(17)=% S %=$P(%Z,U,4) S:%]"" DE(14)=%
8 K %Z Q
9 ;
10W W !?DL+DL-2,DLB_": "
11 Q
12O D W W Y W:$X>45 !?9
13 I $L(Y)>19,'DV,DV'["I",(DV["F"!(DV["K")) G RW^DIR2
14 W:Y]"" "// " I 'DV,DV["I",$D(DE(DQ))#2 S X="" W " (No Editing)" Q
15TR R X:DTIME E S (DTOUT,X)=U W $C(7)
16 Q
17A K DQ(DQ) S DQ=DQ+1
18B G @DQ
19RE G PR:$D(DE(DQ)) D W,TR
20N I X="" G NKEY:$D(^DD("KEY","F",DP,DIFLD)),A:DV'["R",X:'DV,X:D'>0,A
21RD G QS:X?."?" I X["^" D D G ^DIE17
22 I X="@" D D G Z^DIE2
23 I X=" ",DV["d",DV'["P",$D(^DISV(DUZ,"DIE",DLB)) S X=^(DLB) I DV'["D",DV'["S" W " "_X
24T 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
25 K DDER G X
26P 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
27 G V:DV'["N" D D I $L($P(X,"."))>24 K X G Z
28 I $P(DQ(DQ),U,5)'["$",X?.1"-".N.1".".N,$P(DQ(DQ),U,5,99)["+X'=X" S X=+X
29V D @("X"_DQ) K YS
30Z 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
31X W:'$D(ZTQUEUED) $C(7),"??" I $D(DB(DQ)) G Z^DIE17
32 S X="?BAD"
33QS S DZ=X D D,QQ^DIEQ G B
34D S D=DIFLD,DQ(DQ)=DLB_U_DV_U_DU_U_DW_U_$P($T(@("X"_DQ))," ",2,99) Q
35Y I '$D(DE(DQ)) D O G RD:"@"'[X,A:DV'["R"&(X="@"),X:X="@" S X=Y G N
36PR S DG=DV,Y=DE(DQ),X=DU I $D(DQ(DQ,2)) X DQ(DQ,2) G RP
37R 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
38 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
39 X:DG["D" ^DD("DD") I DG["S" S %=$P($P(";"_X,";"_Y_":",2),";") S:%]"" Y=%
40RP D O I X="" S X=DE(DQ) G A:'DV,A:DC<2,N^DIE17
41I I DV'["I",DV'["#" G RD
42 D E^DIE0 G RD:$D(X),PR
43 Q
44SET N DIR S DIR(0)="SV"_$E("o",$D(DB(DQ)))_U_DU,DIR("V")=1
45 I $D(DB(DQ)),'$D(DIQUIET) N DIQUIET S DIQUIET=1
46 D ^DIR I 'DDER S %=Y(0),X=Y
47 Q
48SAVEVALS S @DIEZTMP@("V",DP,DIIENS,DIFLD,"O")=$G(DE(DQ)) S:$D(^("F"))[0 ^("F")=$G(DE(DQ))
49 I $D(DE(DW,"4/")) S @DIEZTMP@("V",DP,DIIENS,DIFLD,"4/")=""
50 E K @DIEZTMP@("V",DP,DIIENS,DIFLD,"4/")
51 Q
52NKEY W:'$D(ZTQUEUED) "?? Required key field" S X="?BAD" G QS
53KEYCHK() Q:$G(DE(DW,"KEY"))="" 1 Q @DE(DW,"KEY")
54BEGIN S DNM="DGRPTX16",DQ=1
551 D:$D(DG)>9 F^DIE17,DE S DQ=1,DW=".33;9",DV="FX",DU="",DLB="E-PHONE NUMBER",DIFLD=.339
56 G RE
57X1 K:$L(X)>20!($L(X)<3) X I $D(X) S DFN=DA D E1^DGLOCK2
58 I $D(X),X'?.ANP K X
59 Q
60 ;
612 S DW=".33;11",DV="F",DU="",DLB="E-WORK PHONE NUMBER",DIFLD=.33011
62 G RE
63X2 K:$L(X)>20!($L(X)<4) X
64 I $D(X),X'?.ANP K X
65 Q
66 ;
673 S DQ=4 ;@40
684 S DW=".32;5",DV="P23'X",DU="",DLB="SERVICE BRANCH [LAST]",DIFLD=.325
69 S DE(DW)="C4^DGRPTX16",DE(DW,"INDEX")=1
70 S DU="DIC(23,"
71 G RE
72C4 G C4S:$D(DE(4))[0 K DB
73 S X=DE(4),DIC=DIE
74 S A1B2TAG="PAT" D ^A1B2XFR
75 S X=DE(4),DIC=DIE
76 I $P($G(^DPT(DA,.321)),U,14)]"" D FVP^DGRPMS
77 S X=DE(4),DIC=DIE
78 D EVENT^IVMPLOG(DA)
79C4S S X="" G:DG(DQ)=X C4F1 K DB
80 S X=DG(DQ),DIC=DIE
81 S A1B2TAG="PAT" D ^A1B2XFR
82 S X=DG(DQ),DIC=DIE
83 ;
84 S X=DG(DQ),DIC=DIE
85 D EVENT^IVMPLOG(DA)
86C4F1 N X,X1,X2 S DIXR=408 D C4X1(U) K X2 M X2=X D C4X1("O") K X1 M X1=X
87 D
88 . N DIEXARR M DIEXARR=X S DIEZCOND=1
89 . S X=X2(1)=""
90 . S DIEZCOND=$G(X) K X M X=DIEXARR Q:'DIEZCOND
91 . D DELMSE^DGRPMS(DFN,1)
92 G C4F2
93C4X1(DION) K X
94 S X(1)=$G(@DIEZTMP@("V",2,DIIENS,.325,DION),$P($G(^DPT(DA,.32)),U,5))
95 S X=$G(X(1))
96 Q
97C4F2 Q
98X4 S DFN=DA K:X=$O(^DIC(23,"B","B.E.C.","")) X I $D(X) D SV^DGLOCK S DGCOMBR=$G(Y) Q
99 Q
100 ;
1015 D:$D(DG)>9 F^DIE17,DE S DQ=5,DW=".32;8",DV="FX",DU="",DLB="SERVICE NUMBER [LAST]",DIFLD=.328
102 S DE(DW)="C5^DGRPTX16"
103 G RE
104C5 G C5S:$D(DE(5))[0 K DB
105 S X=DE(5),DIC=DIE
106 D EVENT^IVMPLOG(DA)
107C5S S X="" G:DG(DQ)=X C5F1 K DB
108 S X=DG(DQ),DIC=DIE
109 D EVENT^IVMPLOG(DA)
110C5F1 Q
111X5 S DFN=DA D SV^DGLOCK I $D(X) S:X?1"SS".E L=$S($D(^DPT(DA,0)):$P(^(0),U,9),1:X) W:X?1"SS".E " ",L S:X?1"SS".E X=L K:$L(X)>15!($L(X)<1)!'(X?.N) X
112 I $D(X),X'?.ANP K X
113 Q
114 ;
1156 D:$D(DG)>9 F^DIE17,DE S DQ=6,DW=".52;5",DV="RSX",DU="",DLB="POW STATUS INDICATED?",DIFLD=.525
116 S DE(DW)="C6^DGRPTX16",DE(DW,"INDEX")=1
117 S DU="Y:YES;N:NO;U:UNKNOWN;"
118 G RE
119C6 G C6S:$D(DE(6))[0 K DB
120 S X=DE(6),DIC=DIE
121 ;
122 S X=DE(6),DIC=DIE
123 ;
124 S X=DE(6),DIC=DIE
125 ;
126 S X=DE(6),DIC=DIE
127 D AUTOUPD^DGENA2(DA)
128 S X=DE(6),DIC=DIE
129 X "S DFN=DA D EN^DGMTR K DGREQF"
130 S X=DE(6),DIC=DIE
131 D EVENT^IVMPLOG(DA)
132C6S S X="" G:DG(DQ)=X C6F1 K DB
133 S X=DG(DQ),DIC=DIE
134 X ^DD(2,.525,1,1,1.3) I X S X=DIV S Y(1)=$S($D(^DPT(D0,.52)):^(.52),1:"") S X=$S('$D(^DIC(22,+$P(Y(1),U,6),0)):"",1:$P(^(0),U,1)) S DIU=X K Y S X=DIV S X="" X ^DD(2,.525,1,1,1.4)
135 S X=DG(DQ),DIC=DIE
136 X ^DD(2,.525,1,2,1.3) I X S X=DIV S Y(1)=$S($D(^DPT(D0,.52)):^(.52),1:"") S X=$P(Y(1),U,7) S DIU=X K Y S X=DIV S X="" X ^DD(2,.525,1,2,1.4)
137 S X=DG(DQ),DIC=DIE
138 X ^DD(2,.525,1,3,1.3) I X S X=DIV S Y(1)=$S($D(^DPT(D0,.52)):^(.52),1:"") S X=$P(Y(1),U,8) S DIU=X K Y S X=DIV S X="" X ^DD(2,.525,1,3,1.4)
139 S X=DG(DQ),DIC=DIE
140 D AUTOUPD^DGENA2(DA)
141 S X=DG(DQ),DIC=DIE
142 X "S DFN=DA D EN^DGMTR K DGREQF"
143 S X=DG(DQ),DIC=DIE
144 D EVENT^IVMPLOG(DA)
145C6F1 N X,X1,X2 S DIXR=646 D C6X1(U) K X2 M X2=X D C6X1("O") K X1 M X1=X
146 D
147 . D FC^DGFCPROT(.DA,2,.525,"KILL",$H,$G(DUZ),.X,.X1,.X2,$G(XQY0)) Q
148 K X M X=X2 D
149 . D FC^DGFCPROT(.DA,2,.525,"SET",$H,$G(DUZ),.X,.X1,.X2,$G(XQY0)) Q
150 G C6F2
151C6X1(DION) K X
152 S X(1)=$G(@DIEZTMP@("V",2,DIIENS,.525,DION),$P($G(^DPT(DA,.52)),U,5))
153 S X=$G(X(1))
154 Q
155C6F2 Q
156X6 S DFN=DA D SV^DGLOCK
157 Q
158 ;
1597 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
160X7 I $P($G(^DPT(DFN,.53)),U)]"" S Y="@53"
161 Q
1628 D:$D(DG)>9 F^DIE17,DE S DQ=8,DW=".53;1",DV="SX",DU="",DLB="CURRENT PH INDICATOR",DIFLD=.531
163 S DE(DW)="C8^DGRPTX16"
164 S DU="Y:YES;N:NO;"
165 G RE
166C8 G C8S:$D(DE(8))[0 K DB
167 S X=DE(8),DIC=DIE
168 K ^DPT("D",$E(X,1,30),DA)
169 S X=DE(8),DIC=DIE
170 D AUTOUPD^DGENA2(DA)
171C8S S X="" G:DG(DQ)=X C8F1 K DB
172 S X=DG(DQ),DIC=DIE
173 S ^DPT("D",$E(X,1,30),DA)=""
174 S X=DG(DQ),DIC=DIE
175 D AUTOUPD^DGENA2(DA)
176C8F1 Q
177X8 S DFN=DA D VET^DGLOCK
178 Q
179 ;
1809 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
181X9 I X="Y" S Y="@532",DGPHMULT=1
182 Q
18310 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
184X10 I X="N" S Y="@533",DGPHMULT=1
185 Q
18611 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=11 D X11 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
187X11 S:X="" Y="@53"
188 Q
18912 S DQ=13 ;@532
19013 D:$D(DG)>9 F^DIE17,DE S DQ=13,DW=".53;2",DV="S",DU="",DLB="CURRENT PURPLE HEART STATUS",DIFLD=.532
191 S DE(DW)="C13^DGRPTX16"
192 S DU="1:PENDING;2:IN PROCESS;3:CONFIRMED;"
193 S X="PENDING"
194 S Y=X
195 S X=Y,DB(DQ)=1 G:X="" N^DIE17:DV,A I $D(DE(DQ)),DV["I"!(DV["#") D E^DIE0 G A:'$D(X)
196 G RD
197C13 G C13S:$D(DE(13))[0 K DB
198 S X=DE(13),DIC=DIE
199 K ^DPT("C",$E(X,1,30),DA)
200C13S S X="" G:DG(DQ)=X C13F1 K DB
201 S X=DG(DQ),DIC=DIE
202 S ^DPT("C",$E(X,1,30),DA)=""
203C13F1 Q
204X13 Q
20514 D:$D(DG)>9 F^DIE17,DE S DQ=14,DW=".53;4",DV="P4'",DU="",DLB="PH DIVISION",DIFLD=.535
206 S DU="DIC(4,"
207 S X=$$DIV^DGRPLE()
208 S Y=X
209 S X=Y,DB(DQ)=1 G:X="" N^DIE17:DV,A I $D(DE(DQ)),DV["I"!(DV["#") D E^DIE0 G A:'$D(X)
210 G RD
211X14 Q
21215 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
213X15 S Y="@53"
214 Q
21516 S DQ=17 ;@533
21617 S DW=".53;3",DV="S",DU="",DLB="CURRENT PURPLE HEART REMARKS",DIFLD=.533
217 S DU="1:UNACCEPTABLE DOCUMENTATION;2:NO DOCUMENTATION REC'D;3:ENTERED IN ERROR;4:UNSUPPORTED PURPLE HEART;5:VAMC;6:UNDELIVERABLE MAIL;"
218 S X="VAMC"
219 S Y=X
220 S X=Y,DB(DQ)=1 G:X="" N^DIE17:DV,A I $D(DE(DQ)),DV["I"!(DV["#") D E^DIE0 G A:'$D(X)
221 G RD
222X17 Q
22318 D:$D(DG)>9 F^DIE17 G ^DGRPTX17
Note: See TracBrowser for help on using the repository browser.