Changeset 623 for WorldVistAEHR/trunk/r/HINQ-DVB--DVBA--DVBE--DVBC
- Timestamp:
- Dec 4, 2009, 12:11:15 AM (15 years ago)
- Location:
- WorldVistAEHR/trunk/r/HINQ-DVB--DVBA--DVBE--DVBC
- Files:
-
- 31 edited
Legend:
- Unmodified
- Added
- Removed
-
WorldVistAEHR/trunk/r/HINQ-DVB--DVBA--DVBE--DVBC/DVBHCE.m
r613 r623 1 DVBHCE ; GENERATED FROM 'DVBHINQ UPDATE' INPUT TEMPLATE(#960), FILE 2;12/ 13/081 DVBHCE ; GENERATED FROM 'DVBHINQ UPDATE' INPUT TEMPLATE(#960), FILE 2;12/27/07 2 2 D DE G BEGIN 3 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(^(.32)) S %Z=^(.32) S %=$P(%Z,U,4) S:%]"" DE(23)=% S %=$P(%Z,U,5) S:%]"" DE(21)=% S %=$P(%Z,U,6) S:%]"" DE(19)=% S %=$P(%Z,U,7) S:%]"" DE(20)=% S %=$P(%Z,U,8) S:%]"" DE(24)=% S %=$P(%Z,U,11) S:%]"" DE(32)=% S %=$P(%Z,U,19) S:%]"" DE(30)=%4 I $D(^(.32)) S %Z=^(.32) S %=$P(%Z,U,4) S:%]"" DE(23)=% S %=$P(%Z,U,5) S:%]"" DE(21)=% S %=$P(%Z,U,6) S:%]"" DE(19)=% S %=$P(%Z,U,7) S:%]"" DE(20)=% S %=$P(%Z,U,8) S:%]"" DE(24)=% 5 5 K %Z Q 6 6 ; … … 191 191 G RE 192 192 C24 G C24S:$D(DE(24))[0 K DB 193 S X=DE(24),DIC=DIE 194 D EVENT^IVMPLOG(DA) 193 D ^DVBHCE1 195 194 C24S S X="" G:DG(DQ)=X C24F1 K DB 196 S X=DG(DQ),DIC=DIE 197 D EVENT^IVMPLOG(DA) 195 D ^DVBHCE2 198 196 C24F1 Q 199 197 X24 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 … … 214 212 X29 S DVBSCR=1 D ^DVBHS4 W !,?34,DVBON,"[NTLAST]",DVBOFF X DVBLIT1 215 213 Q 216 30 D:$D(DG)>9 F^DIE17,DE S DQ=30,DW=".32;19",DV="RSX",DU="",DLB="Service NTL Episode",DIFLD=.3285 217 S DE(DW)="C30^DVBHCE" 218 S DU="Y:YES;N:NO;" 219 G RE 220 C30 G C30S:$D(DE(30))[0 K DB 221 S X=DE(30),DIC=DIE 222 ; 223 S X=DE(30),DIC=DIE 224 ; 225 S X=DE(30),DIC=DIE 226 X ^DD(2,.3285,1,3,2.3) I X S X=DIV S Y(1)=$S($D(^DPT(D0,.32)):^(.32),1:"") S X=$P(Y(1),U,10),X=X S DIU=X K Y S X="" S DIH=$G(^DPT(DIV(0),.32)),DIV=X S $P(^(.32),U,10)=DIV,DIH=2,DIG=.3291 D ^DICR 227 C30S S X="" G:DG(DQ)=X C30F1 K DB 228 D ^DVBHCE1 229 C30F1 Q 230 X30 S DFN=DA D SV^DGLOCK 231 Q 232 ; 233 31 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=31 D X31 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 234 X31 I $P(^DPT(D0,.32),U,19)'="Y" S Y="@31" 235 Q 236 32 D:$D(DG)>9 F^DIE17,DE S DQ=32,DW=".32;11",DV="RDX",DU="",DLB="NTL-EOD",DIFLD=.3292 237 S DE(DW)="C32^DVBHCE",DE(DW,"INDEX")=1 238 G RE 239 C32 G C32S:$D(DE(32))[0 K DB 240 D ^DVBHCE2 241 C32S S X="" G:DG(DQ)=X C32F1 K DB 242 D ^DVBHCE3 243 C32F1 S DIEZRXR(2,DIIENS)=$$OREF^DILF($NA(@$$CREF^DILF(DIE))) 244 F DIXR=649 S DIEZRXR(2,DIXR)="" 245 Q 246 X32 S %DT="E",%DT(0)=-DT D ^%DT K %DT S X=Y K:Y<1 X I $D(X) S DFN=DA D SER1^DGLOCK I $D(X) K:'$$VALMSE^DGRPMS(DFN,X,0,"MSNTL") X I $D(X) S DGFRDT=X I $D(^DG(43,1)) S SD1=2 D POS^DGINP 247 Q 248 ; 249 33 D:$D(DG)>9 F^DIE17 G ^DVBHCE4 214 30 D:$D(DG)>9 F^DIE17 G ^DVBHCE3 -
WorldVistAEHR/trunk/r/HINQ-DVB--DVBA--DVBE--DVBC/DVBHCE1.m
r613 r623 1 DVBHCE1 ; ;12/13/08 2 S X=DG(DQ),DIC=DIE 3 X "I X'=""Y"" S DGXRF=.3285 D ^DGDDC Q" 4 S X=DG(DQ),DIC=DIE 5 X ^DD(2,.3285,1,2,1.3) I X S X=DIV S Y(1)=$S($D(^DPT(D0,.32)):^(.32),1:"") S X=$P(Y(1),U,20),X=X S DIU=X K Y S X=DIV S X="N" X ^DD(2,.3285,1,2,1.4) 6 S X=DG(DQ),DIC=DIE 7 K DIV S DIV=X,D0=DA,DIV(0)=D0 S Y(0)=X S Y(1)=$C(59)_$P($G(^DD(2,.3285,0)),U,3) S X=$P($P(Y(1),$C(59)_Y(0)_":",2),$C(59))'="YES" I X S X=DIV S Y(1)=$S($D(^DPT(D0,.32)):^(.32),1:"") S X=$P(Y(1),U,10),X=X S DIU=X K Y S X="" X ^DD(2,.3285,1,3,1.4) 1 DVBHCE1 ; ;12/27/07 2 S X=DE(24),DIC=DIE 3 D EVENT^IVMPLOG(DA) -
WorldVistAEHR/trunk/r/HINQ-DVB--DVBA--DVBE--DVBC/DVBHCE10.m
r613 r623 1 DVBHCE10 ; ;12/ 13/081 DVBHCE10 ; ;12/27/07 2 2 S X=DG(DQ),DIC=DIE 3 S DFN=DA D EN^DGMTCOR K DGMTCOR3 X ^DD(2,.301,1,1,1.3) I X S X=DIV S Y(1)=$S($D(^DPT(D0,.3)):^(.3),1:"") S X=$P(Y(1),U,2),X=X S DIU=X K Y S X="" X ^DD(2,.301,1,1,1.4) 4 4 S X=DG(DQ),DIC=DIE 5 S DFN=DA D EN^DGRP7CC 6 S X=DG(DQ),DIC=DIE 7 X ^DD(2,1901,1,3,1.3) I X S X=DIV S Y(1)=$S($D(^DPT(D0,.3)):^(.3),1:"") S X=$P(Y(1),U,1),X=X S DIU=X K Y S X=DIV S X="N" X ^DD(2,1901,1,3,1.4) 5 X ^DD(2,.301,1,2,1.3) I X S X=DIV S Y(1)=$S($D(^DPT(D0,.3)):^(.3),1:"") S X=$P(Y(1),U,12),X=X S DIU=X K Y S X="" X ^DD(2,.301,1,2,1.4) 8 6 S X=DG(DQ),DIC=DIE 9 7 D AUTOUPD^DGENA2(DA) 10 8 S X=DG(DQ),DIC=DIE 11 I ($T(AVAFC^VAFCDD01)'="") S VAFCF=" 1901;" D AVAFC^VAFCDD01(DA)9 I ($T(AVAFC^VAFCDD01)'="") S VAFCF=".301;" D AVAFC^VAFCDD01(DA) 12 10 S X=DG(DQ),DIC=DIE 13 11 D:($T(ADGRU^DGRUDD01)'="") ADGRU^DGRUDD01(DA) 14 I $D(DE( 21))'[0!(^DD(DP,DIFLD,"AUDIT")'="e") S X=DG(DQ),DIIX=3_U_DIFLD D AUDIT^DIET12 I $D(DE(13))'[0!(^DD(DP,DIFLD,"AUDIT")'="e") S X=DG(DQ),DIIX=3_U_DIFLD D AUDIT^DIET -
WorldVistAEHR/trunk/r/HINQ-DVB--DVBA--DVBE--DVBC/DVBHCE11.m
r613 r623 1 DVBHCE11 ; ;12/13/08 2 S X=DG(DQ),DIC=DIE 3 X ^DD(2,.301,1,1,1.3) I X S X=DIV S Y(1)=$S($D(^DPT(D0,.3)):^(.3),1:"") S X=$P(Y(1),U,2),X=X S DIU=X K Y S X="" X ^DD(2,.301,1,1,1.4) 4 S X=DG(DQ),DIC=DIE 5 X ^DD(2,.301,1,2,1.3) I X S X=DIV S Y(1)=$S($D(^DPT(D0,.3)):^(.3),1:"") S X=$P(Y(1),U,12),X=X S DIU=X K Y S X="" X ^DD(2,.301,1,2,1.4) 6 S X=DG(DQ),DIC=DIE 1 DVBHCE11 ; ;12/27/07 2 S X=DE(16),DIC=DIE 3 ; 4 S X=DE(16),DIC=DIE 5 K DIV S DIV=X,D0=DA,DIV(0)=D0 X ^DD(2,.361,1,2,2.2) I DIV(1)>0 S DIK(0)=DA,DIK="^DPT(DIV(0),""E"",",DA(1)=DIV(0),DA=DIV(1) D ^DIK S DA=DIK(0) K DIK 6 S X=DE(16),DIC=DIE 7 X "I $S('$D(^DIC(8,+X,0)):0,$P(^(0),""^"",1)[""DOM"":0,'$D(^DPT(DA,.36)):1,'$D(^DIC(8,+^(.36),0)):1,$P(^(0),""^"",1)'[""DOM"":1,1:0) S DGXRF=.361 D ^DGDDC Q" 8 S X=DE(16),DIC=DIE 9 K ^DPT("AEL",DA,+X) 10 S X=DE(16),DIC=DIE 7 11 D AUTOUPD^DGENA2(DA) 8 S X=DG(DQ),DIC=DIE 9 I ($T(AVAFC^VAFCDD01)'="") S VAFCF=".301;" D AVAFC^VAFCDD01(DA) 10 S X=DG(DQ),DIC=DIE 11 D:($T(ADGRU^DGRUDD01)'="") ADGRU^DGRUDD01(DA) 12 I $D(DE(22))'[0!(^DD(DP,DIFLD,"AUDIT")'="e") S X=DG(DQ),DIIX=3_U_DIFLD D AUDIT^DIET 12 S X=DE(16),DIIX=2_U_DIFLD D AUDIT^DIET -
WorldVistAEHR/trunk/r/HINQ-DVB--DVBA--DVBE--DVBC/DVBHCE12.m
r613 r623 1 DVBHCE12 ; ;12/13/08 2 S X=DE(25),DIC=DIE 1 DVBHCE12 ; ;12/27/07 2 S X=DG(DQ),DIC=DIE 3 X "S DFN=DA D EN^DGMTR K DGREQF" 4 S X=DG(DQ),DIC=DIE 5 K DIV S DIV=X,D0=DA,DIV(0)=D0 X ^DD(2,.361,1,2,89.4) S Y(102)=$S($D(^DPT(D0,"E",D1,0)):^(0),1:"") S X=$S('$D(^DIC(8,+$P(Y(102),U,1),0)):"",1:$P(^(0),U,1)) S D0=I(0,0) S D1=I(1,0) S DIU=X K Y S X=DIV S X=DIV,X=X X ^DD(2,.361,1,2,1.4) 6 S X=DG(DQ),DIC=DIE 3 7 ; 4 S X=DE(25),DIC=DIE 5 K DIV S DIV=X,D0=DA,DIV(0)=D0 X ^DD(2,.361,1,2,2.2) I DIV(1)>0 S DIK(0)=DA,DIK="^DPT(DIV(0),""E"",",DA(1)=DIV(0),DA=DIV(1) D ^DIK S DA=DIK(0) K DIK 6 S X=DE(25),DIC=DIE 7 X "I $S('$D(^DIC(8,+X,0)):0,$P(^(0),""^"",1)[""DOM"":0,'$D(^DPT(DA,.36)):1,'$D(^DIC(8,+^(.36),0)):1,$P(^(0),""^"",1)'[""DOM"":1,1:0) S DGXRF=.361 D ^DGDDC Q" 8 S X=DE(25),DIC=DIE 9 K ^DPT("AEL",DA,+X) 10 S X=DE(25),DIC=DIE 8 S X=DG(DQ),DIC=DIE 9 S ^DPT("AEL",DA,+X)="" 10 S X=DG(DQ),DIC=DIE 11 11 D AUTOUPD^DGENA2(DA) 12 S X=DE(25),DIIX=2_U_DIFLD D AUDIT^DIET12 I $D(DE(16))'[0!(^DD(DP,DIFLD,"AUDIT")'="e") S X=DG(DQ),DIIX=3_U_DIFLD D AUDIT^DIET -
WorldVistAEHR/trunk/r/HINQ-DVB--DVBA--DVBE--DVBC/DVBHCE13.m
r613 r623 1 DVBHCE13 ; ;12/13/08 1 DVBHCE13 ; ;12/27/07 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(^(.3)) S %Z=^(.3) S %=$P(%Z,U,11) S:%]"" DE(4)=% 5 I $D(^(.362)) S %Z=^(.362) S %=$P(%Z,U,12) S:%]"" DE(1)=% S %=$P(%Z,U,13) S:%]"" DE(2)=% S %=$P(%Z,U,14) S:%]"" DE(3)=% S %=$P(%Z,U,20) S:%]"" DE(5)=% 6 K %Z Q 7 ; 8 W W !?DL+DL-2,DLB_": " 9 Q 10 O D W W Y W:$X>45 !?9 11 I $L(Y)>19,'DV,DV'["I",(DV["F"!(DV["K")) G RW^DIR2 12 W:Y]"" "// " I 'DV,DV["I",$D(DE(DQ))#2 S X="" W " (No Editing)" Q 13 TR R X:DTIME E S (DTOUT,X)=U W $C(7) 14 Q 15 A K DQ(DQ) S DQ=DQ+1 16 B G @DQ 17 RE G PR:$D(DE(DQ)) D W,TR 18 N I X="" G NKEY:$D(^DD("KEY","F",DP,DIFLD)),A:DV'["R",X:'DV,X:D'>0,A 19 RD G QS:X?."?" I X["^" D D G ^DIE17 20 I X="@" D D G Z^DIE2 21 I X=" ",DV["d",DV'["P",$D(^DISV(DUZ,"DIE",DLB)) S X=^(DLB) I DV'["D",DV'["S" W " "_X 22 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 23 K DDER G X 24 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 25 G V:DV'["N" D D I $L($P(X,"."))>24 K X G Z 26 I $P(DQ(DQ),U,5)'["$",X?.1"-".N.1".".N,$P(DQ(DQ),U,5,99)["+X'=X" S X=+X 27 V D @("X"_DQ) K YS 28 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 29 X W:'$D(ZTQUEUED) $C(7),"??" I $D(DB(DQ)) G Z^DIE17 30 S X="?BAD" 31 QS S DZ=X D D,QQ^DIEQ G B 32 D S D=DIFLD,DQ(DQ)=DLB_U_DV_U_DU_U_DW_U_$P($T(@("X"_DQ))," ",2,99) Q 33 Y I '$D(DE(DQ)) D O G RD:"@"'[X,A:DV'["R"&(X="@"),X:X="@" S X=Y G N 34 PR S DG=DV,Y=DE(DQ),X=DU I $D(DQ(DQ,2)) X DQ(DQ,2) G RP 35 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 36 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 37 X:DG["D" ^DD("DD") I DG["S" S %=$P($P(";"_X,";"_Y_":",2),";") S:%]"" Y=% 38 RP D O I X="" S X=DE(DQ) G A:'DV,A:DC<2,N^DIE17 39 I I DV'["I",DV'["#" G RD 40 D E^DIE0 G RD:$D(X),PR 41 Q 42 SET N DIR S DIR(0)="SV"_$E("o",$D(DB(DQ)))_U_DU,DIR("V")=1 43 I $D(DB(DQ)),'$D(DIQUIET) N DIQUIET S DIQUIET=1 44 D ^DIR I 'DDER S %=Y(0),X=Y 45 Q 46 SAVEVALS S @DIEZTMP@("V",DP,DIIENS,DIFLD,"O")=$G(DE(DQ)) S:$D(^("F"))[0 ^("F")=$G(DE(DQ)) 47 I $D(DE(DW,"4/")) S @DIEZTMP@("V",DP,DIIENS,DIFLD,"4/")="" 48 E K @DIEZTMP@("V",DP,DIIENS,DIFLD,"4/") 49 Q 50 NKEY W:'$D(ZTQUEUED) "?? Required key field" S X="?BAD" G QS 51 KEYCHK() Q:$G(DE(DW,"KEY"))="" 1 Q @DE(DW,"KEY") 52 BEGIN S DNM="DVBHCE13",DQ=1 53 1 D:$D(DG)>9 F^DIE17,DE S DQ=1,DW=".362;12",DV="SX",DU="",DLB="RECEIVING A&A BENEFITS?",DIFLD=.36205 54 S DE(DW)="C1^DVBHCE13" 55 S DU="Y:YES;N:NO;U:UNKNOWN;" 56 G RE 57 C1 G C1S:$D(DE(1))[0 K DB 58 S X=DE(1),DIC=DIE 59 X ^DD(2,.36205,1,1,2.3) I X S X=DIV S Y(1)=$S($D(^DPT(D0,.362)):^(.362),1:"") S X=$P(Y(1),U,1),X=X S DIU=X K Y S X="" X ^DD(2,.36205,1,1,2.4) 60 S X=DE(1),DIC=DIE 61 S DFN=DA D EN^DGMTCOR K DGMTCOR 62 S X=DE(1),DIC=DIE 63 K DIV S DIV=X,D0=DA,DIV(0)=D0 S Y(0)=X S X='$$TOTCHK^DGLOCK2(DA) I X S X=DIV S Y(1)=$S($D(^DPT(D0,.362)):^(.362),1:"") S X=$P(Y(1),U,20),X=X S DIU=X K Y S X="" X ^DD(2,.36205,1,3,2.4) 64 S X=DE(1),DIC=DIE 65 D AUTOUPD^DGENA2(DA) 66 C1S S X="" G:DG(DQ)=X C1F1 K DB 67 S X=DG(DQ),DIC=DIE 68 X ^DD(2,.36205,1,1,1.3) I X S X=DIV S Y(1)=$S($D(^DPT(D0,.362)):^(.362),1:"") S X=$P(Y(1),U,1),X=X S DIU=X K Y S X="" X ^DD(2,.36205,1,1,1.4) 69 S X=DG(DQ),DIC=DIE 70 S DFN=DA D EN^DGMTCOR K DGMTCOR 71 S X=DG(DQ),DIC=DIE 72 K DIV S DIV=X,D0=DA,DIV(0)=D0 S Y(0)=X S X='$$TOTCHK^DGLOCK2(DA) I X S X=DIV S Y(1)=$S($D(^DPT(D0,.362)):^(.362),1:"") S X=$P(Y(1),U,20),X=X S DIU=X K Y S X="" X ^DD(2,.36205,1,3,1.4) 73 S X=DG(DQ),DIC=DIE 74 D AUTOUPD^DGENA2(DA) 75 C1F1 Q 76 X1 S DFN=DA D MV^DGLOCK I $D(X) S DFN=DA D EV^DGLOCK 77 Q 78 ; 79 2 D:$D(DG)>9 F^DIE17,DE S DQ=2,DW=".362;13",DV="SX",DU="",DLB="RECEIVING HOUSEBOUND BENEFITS?",DIFLD=.36215 80 S DE(DW)="C2^DVBHCE13" 81 S DU="Y:YES;N:NO;U:UNKNOWN;" 82 G RE 83 C2 G C2S:$D(DE(2))[0 K DB 84 S X=DE(2),DIC=DIE 85 X ^DD(2,.36215,1,1,2.3) I X S X=DIV S Y(1)=$S($D(^DPT(D0,.362)):^(.362),1:"") S X=$P(Y(1),U,2),X=X S DIU=X K Y S X="" X ^DD(2,.36215,1,1,2.4) 86 S X=DE(2),DIC=DIE 87 S DFN=DA D EN^DGMTCOR K DGMTCOR 88 S X=DE(2),DIC=DIE 89 K DIV S DIV=X,D0=DA,DIV(0)=D0 S Y(0)=X S X='$$TOTCHK^DGLOCK2(DA) I X S X=DIV S Y(1)=$S($D(^DPT(D0,.362)):^(.362),1:"") S X=$P(Y(1),U,20),X=X S DIU=X K Y S X="" X ^DD(2,.36215,1,3,2.4) 90 S X=DE(2),DIC=DIE 91 D AUTOUPD^DGENA2(DA) 92 C2S S X="" G:DG(DQ)=X C2F1 K DB 93 S X=DG(DQ),DIC=DIE 94 X ^DD(2,.36215,1,1,1.3) I X S X=DIV S Y(1)=$S($D(^DPT(D0,.362)):^(.362),1:"") S X=$P(Y(1),U,2),X=X S DIU=X K Y S X="" X ^DD(2,.36215,1,1,1.4) 95 S X=DG(DQ),DIC=DIE 96 S DFN=DA D EN^DGMTCOR K DGMTCOR 97 S X=DG(DQ),DIC=DIE 98 K DIV S DIV=X,D0=DA,DIV(0)=D0 S Y(0)=X S X='$$TOTCHK^DGLOCK2(DA) I X S X=DIV S Y(1)=$S($D(^DPT(D0,.362)):^(.362),1:"") S X=$P(Y(1),U,20),X=X S DIU=X K Y S X="" X ^DD(2,.36215,1,3,1.4) 99 S X=DG(DQ),DIC=DIE 100 D AUTOUPD^DGENA2(DA) 101 C2F1 Q 102 X2 S DFN=DA D MV^DGLOCK I $D(X) S DFN=DA D EV^DGLOCK 103 Q 104 ; 105 3 D:$D(DG)>9 F^DIE17,DE S DQ=3,DW=".362;14",DV="SX",DU="",DLB="RECEIVING A VA PENSION?",DIFLD=.36235 106 S DE(DW)="C3^DVBHCE13" 107 S DU="Y:YES;N:NO;U:UNKNOWN;" 108 G RE 109 C3 G C3S:$D(DE(3))[0 K DB 110 S X=DE(3),DIC=DIE 111 X ^DD(2,.36235,1,1,2.3) I X S X=DIV S Y(1)=$S($D(^DPT(D0,.362)):^(.362),1:"") S X=$P(Y(1),U,4),X=X S DIU=X K Y S X="" X ^DD(2,.36235,1,1,2.4) 112 S X=DE(3),DIC=DIE 113 S DFN=DA D EN^DGMTCOR K DGMTCOR 114 S X=DE(3),DIC=DIE 115 K DIV S DIV=X,D0=DA,DIV(0)=D0 S Y(0)=X S X='$$TOTCHK^DGLOCK2(DA) I X S X=DIV S Y(1)=$S($D(^DPT(D0,.362)):^(.362),1:"") S X=$P(Y(1),U,20),X=X S DIU=X K Y S X="" X ^DD(2,.36235,1,3,2.4) 116 S X=DE(3),DIC=DIE 117 D AUTOUPD^DGENA2(DA) 118 C3S S X="" G:DG(DQ)=X C3F1 K DB 119 S X=DG(DQ),DIC=DIE 120 X ^DD(2,.36235,1,1,1.3) I X S X=DIV S Y(1)=$S($D(^DPT(D0,.362)):^(.362),1:"") S X=$P(Y(1),U,4),X=X S DIU=X K Y S X="" X ^DD(2,.36235,1,1,1.4) 121 S X=DG(DQ),DIC=DIE 122 S DFN=DA D EN^DGMTCOR K DGMTCOR 123 S X=DG(DQ),DIC=DIE 124 K DIV S DIV=X,D0=DA,DIV(0)=D0 S Y(0)=X S X='$$TOTCHK^DGLOCK2(DA) I X S X=DIV S Y(1)=$S($D(^DPT(D0,.362)):^(.362),1:"") S X=$P(Y(1),U,20),X=X S DIU=X K Y S X="" X ^DD(2,.36235,1,3,1.4) 125 S X=DG(DQ),DIC=DIE 126 D AUTOUPD^DGENA2(DA) 127 C3F1 Q 128 X3 S DFN=DA D MV^DGLOCK 129 Q 130 ; 131 4 D:$D(DG)>9 F^DIE17,DE S DQ=4,DW=".3;11",DV="SX",DU="",DLB="RECEIVING VA DISABILITY?",DIFLD=.3025 132 S DE(DW)="C4^DVBHCE13" 133 S DU="Y:YES;N:NO;U:UNKNOWN;" 134 G RE 135 C4 G C4S:$D(DE(4))[0 K DB 136 S X=DE(4),DIC=DIE 137 X ^DD(2,.3025,1,1,2.3) I X S X=DIV S Y(1)=$S($D(^DPT(D0,.3)):^(.3),1:"") S X=$P(Y(1),U,3),X=X S DIU=X K Y S X="" X ^DD(2,.3025,1,1,2.4) 138 S X=DE(4),DIC=DIE 139 K DIV S DIV=X,D0=DA,DIV(0)=D0 S Y(0)=X S X='$$TOTCHK^DGLOCK2(DA) I X S X=DIV S Y(1)=$S($D(^DPT(D0,.362)):^(.362),1:"") S X=$P(Y(1),U,20),X=X S DIU=X K Y S X="" X ^DD(2,.3025,1,2,2.4) 140 S X=DE(4),DIC=DIE 141 D EVENT^IVMPLOG(DA) 142 C4S S X="" G:DG(DQ)=X C4F1 K DB 143 S X=DG(DQ),DIC=DIE 144 X ^DD(2,.3025,1,1,1.3) I X S X=DIV S Y(1)=$S($D(^DPT(D0,.3)):^(.3),1:"") S X=$P(Y(1),U,3),X=X S DIU=X K Y S X="" X ^DD(2,.3025,1,1,1.4) 145 S X=DG(DQ),DIC=DIE 146 K DIV S DIV=X,D0=DA,DIV(0)=D0 S Y(0)=X S X='$$TOTCHK^DGLOCK2(DA) I X S X=DIV S Y(1)=$S($D(^DPT(D0,.362)):^(.362),1:"") S X=$P(Y(1),U,20),X=X S DIU=X K Y S X="" X ^DD(2,.3025,1,2,1.4) 147 S X=DG(DQ),DIC=DIE 148 D EVENT^IVMPLOG(DA) 149 C4F1 Q 150 X4 S DFN=DA D MV^DGLOCK I $D(X),X="Y" D EC^DGLOCK1 151 Q 152 ; 153 5 D:$D(DG)>9 F^DIE17,DE S DQ=5,DW=".362;20",DV="NJ8,2X",DU="",DLB="TOTAL ANNUAL VA CHECK AMOUNT",DIFLD=.36295 154 S DE(DW)="C5^DVBHCE13" 155 G RE 156 C5 G C5S:$D(DE(5))[0 K DB 157 S X=DE(5),DIC=DIE 158 X "S DFN=DA D EN^DGMTR K DGREQF" 159 S X=DE(5),DIC=DIE 160 D AUTOUPD^DGENA2(DA) 161 C5S S X="" G:DG(DQ)=X C5F1 K DB 2 162 S X=DG(DQ),DIC=DIE 3 163 X "S DFN=DA D EN^DGMTR K DGREQF" 4 164 S X=DG(DQ),DIC=DIE 5 K DIV S DIV=X,D0=DA,DIV(0)=D0 X ^DD(2,.361,1,2,89.4) S Y(102)=$S($D(^DPT(D0,"E",D1,0)):^(0),1:"") S X=$S('$D(^DIC(8,+$P(Y(102),U,1),0)):"",1:$P(^(0),U,1)) S D0=I(0,0) S D1=I(1,0) S DIU=X K Y S X=DIV S X=DIV,X=X X ^DD(2,.361,1,2,1.4) 6 S X=DG(DQ),DIC=DIE 165 D AUTOUPD^DGENA2(DA) 166 C5F1 Q 167 X5 D DOL^DGLOCK2 K:+X'=X&(X'?.N1"."2N)!(X>99999)!(X<0) X I $D(X) S DFN=DA D MV^DGLOCK I $D(X),('$$TOTCHK^DGLOCK2(DFN)) D TOTCKMSG^DGLOCK2 K X 168 Q 7 169 ; 8 S X=DG(DQ),DIC=DIE 9 S ^DPT("AEL",DA,+X)="" 10 S X=DG(DQ),DIC=DIE 11 D AUTOUPD^DGENA2(DA) 12 I $D(DE(25))'[0!(^DD(DP,DIFLD,"AUDIT")'="e") S X=DG(DQ),DIIX=3_U_DIFLD D AUDIT^DIET 170 6 S DQ=7 ;@2062 171 7 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 172 X7 S Y="@104" 173 Q 174 8 S DQ=9 ;@11 175 9 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 176 X9 S DVBJ2=1 177 Q 178 10 D:$D(DG)>9 F^DIE17 G ^DVBHCE14 -
WorldVistAEHR/trunk/r/HINQ-DVB--DVBA--DVBE--DVBC/DVBHCE14.m
r613 r623 1 DVBHCE14 ; ;12/ 13/081 DVBHCE14 ; ;12/27/07 2 2 D DE G BEGIN 3 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(^(.11)) S %Z=^(.11) S %=$P(%Z,U,1) S:%]"" DE(10)=% S %=$P(%Z,U,2) S:%]"" DE(11)=% 5 I $D(^(.3)) S %Z=^(.3) S %=$P(%Z,U,11) S:%]"" DE(4)=% 6 I $D(^(.362)) S %Z=^(.362) S %=$P(%Z,U,12) S:%]"" DE(1)=% S %=$P(%Z,U,13) S:%]"" DE(2)=% S %=$P(%Z,U,14) S:%]"" DE(3)=% S %=$P(%Z,U,20) S:%]"" DE(5)=% 4 I $D(^(.11)) S %Z=^(.11) S %=$P(%Z,U,1) S:%]"" DE(1)=% S %=$P(%Z,U,2) S:%]"" DE(2)=% S %=$P(%Z,U,3) S:%]"" DE(3)=% S %=$P(%Z,U,4) S:%]"" DE(4)=% 7 5 K %Z Q 8 6 ; … … 52 50 KEYCHK() Q:$G(DE(DW,"KEY"))="" 1 Q @DE(DW,"KEY") 53 51 BEGIN S DNM="DVBHCE14",DQ=1 54 1 D:$D(DG)>9 F^DIE17,DE S DQ=1,DW=".362;12",DV="SX",DU="",DLB="RECEIVING A&A BENEFITS?",DIFLD=.36205 55 S DE(DW)="C1^DVBHCE14" 56 S DU="Y:YES;N:NO;U:UNKNOWN;" 52 1 D:$D(DG)>9 F^DIE17,DE S DQ=1,DW=".11;1",DV="Fa",DU="",DLB="STREET ADDRESS [LINE 1]",DIFLD=.111 53 S DE(DW)="C1^DVBHCE14",DE(DW,"INDEX")=1 57 54 G RE 58 55 C1 G C1S:$D(DE(1))[0 K DB 59 56 S X=DE(1),DIC=DIE 60 X ^DD(2,.36205,1,1,2.3) I X S X=DIV S Y(1)=$S($D(^DPT(D0,.362)):^(.362),1:"") S X=$P(Y(1),U,1),X=X S DIU=X K Y S X="" X ^DD(2,.36205,1,1,2.4) 61 S X=DE(1),DIC=DIE 62 S DFN=DA D EN^DGMTCOR K DGMTCOR 63 S X=DE(1),DIC=DIE 64 K DIV S DIV=X,D0=DA,DIV(0)=D0 S Y(0)=X S X='$$TOTCHK^DGLOCK2(DA) I X S X=DIV S Y(1)=$S($D(^DPT(D0,.362)):^(.362),1:"") S X=$P(Y(1),U,20),X=X S DIU=X K Y S X="" X ^DD(2,.36205,1,3,2.4) 65 S X=DE(1),DIC=DIE 66 D AUTOUPD^DGENA2(DA) 57 X "S DGXRF=.111 D ^DGDDC Q" 58 S X=DE(1),DIC=DIE 59 S A1B2TAG="PAT" D ^A1B2XFR 60 S X=DE(1),DIC=DIE 61 D EVENT^IVMPLOG(DA) 62 S X=DE(1),DIC=DIE 63 K DIV S DIV=X,D0=DA,DIV(0)=D0 S Y(1)=$S($D(^DPT(D0,.11)):^(.11),1:"") S X=$P(Y(1),U,13),X=X S DIU=X K Y S X=DIV S X=$$NOW^XLFDT() S DIH=$G(^DPT(DIV(0),.11)),DIV=X S $P(^(.11),U,13)=DIV,DIH=2,DIG=.118 D ^DICR 64 S X=DE(1),DIC=DIE 65 S IVMX=X,X="IVMPXFR" X ^%ZOSF("TEST") D:$T DPT^IVMPXFR S X=IVMX K IVMX 66 S X=DE(1),DIC=DIE 67 I ($T(AVAFC^VAFCDD01)'="") S VAFCF=".111;" D AVAFC^VAFCDD01(DA) 68 S X=DE(1),DIC=DIE 69 D:($T(ADGRU^DGRUDD01)'="") ADGRU^DGRUDD01(DA) 70 S X=DE(1),DIIX=2_U_DIFLD D AUDIT^DIET 67 71 C1S S X="" G:DG(DQ)=X C1F1 K DB 68 72 S X=DG(DQ),DIC=DIE 69 X ^DD(2,.36205,1,1,1.3) I X S X=DIV S Y(1)=$S($D(^DPT(D0,.362)):^(.362),1:"") S X=$P(Y(1),U,1),X=X S DIU=X K Y S X="" X ^DD(2,.36205,1,1,1.4) 70 S X=DG(DQ),DIC=DIE 71 S DFN=DA D EN^DGMTCOR K DGMTCOR 72 S X=DG(DQ),DIC=DIE 73 K DIV S DIV=X,D0=DA,DIV(0)=D0 S Y(0)=X S X='$$TOTCHK^DGLOCK2(DA) I X S X=DIV S Y(1)=$S($D(^DPT(D0,.362)):^(.362),1:"") S X=$P(Y(1),U,20),X=X S DIU=X K Y S X="" X ^DD(2,.36205,1,3,1.4) 74 S X=DG(DQ),DIC=DIE 75 D AUTOUPD^DGENA2(DA) 76 C1F1 Q 77 X1 S DFN=DA D MV^DGLOCK I $D(X) S DFN=DA D EV^DGLOCK 78 Q 79 ; 80 2 D:$D(DG)>9 F^DIE17,DE S DQ=2,DW=".362;13",DV="SX",DU="",DLB="RECEIVING HOUSEBOUND BENEFITS?",DIFLD=.36215 81 S DE(DW)="C2^DVBHCE14" 82 S DU="Y:YES;N:NO;U:UNKNOWN;" 73 ; 74 S X=DG(DQ),DIC=DIE 75 S A1B2TAG="PAT" D ^A1B2XFR 76 S X=DG(DQ),DIC=DIE 77 D EVENT^IVMPLOG(DA) 78 S X=DG(DQ),DIC=DIE 79 K DIV S DIV=X,D0=DA,DIV(0)=D0 S Y(1)=$S($D(^DPT(D0,.11)):^(.11),1:"") S X=$P(Y(1),U,13),X=X S DIU=X K Y S X=DIV S X=$$NOW^XLFDT() S DIH=$G(^DPT(DIV(0),.11)),DIV=X S $P(^(.11),U,13)=DIV,DIH=2,DIG=.118 D ^DICR 80 S X=DG(DQ),DIC=DIE 81 S IVMX=X,X="IVMPXFR" X ^%ZOSF("TEST") D:$T DPT^IVMPXFR S X=IVMX K IVMX 82 S X=DG(DQ),DIC=DIE 83 I ($T(AVAFC^VAFCDD01)'="") S VAFCF=".111;" D AVAFC^VAFCDD01(DA) 84 S X=DG(DQ),DIC=DIE 85 D:($T(ADGRU^DGRUDD01)'="") ADGRU^DGRUDD01(DA) 86 I $D(DE(1))'[0!(^DD(DP,DIFLD,"AUDIT")'="e") S X=DG(DQ),DIIX=3_U_DIFLD D AUDIT^DIET 87 C1F1 N X,X1,X2 S DIXR=230 D C1X1(U) K X2 M X2=X D C1X1("O") K X1 M X1=X 88 D 89 . D FC^DGFCPROT(.DA,2,.111,"KILL",$H,$G(DUZ),.X,.X1,.X2,$G(XQY0)) Q 90 K X M X=X2 D 91 . D FC^DGFCPROT(.DA,2,.111,"SET",$H,$G(DUZ),.X,.X1,.X2,$G(XQY0)) Q 92 G C1F2 93 C1X1(DION) K X 94 S X(1)=$G(@DIEZTMP@("V",2,DIIENS,.111,DION),$P($G(^DPT(DA,.11)),U,1)) 95 S X=$G(X(1)) 96 Q 97 C1F2 Q 98 X1 K:X[""""!($A(X)=45) X I $D(X) K:$L(X)>35!($L(X)<3) X 99 I $D(X),X'?.ANP K X 100 Q 101 ; 102 2 D:$D(DG)>9 F^DIE17,DE S DQ=2,DW=".11;2",DV="Fa",DU="",DLB="STREET ADDRESS [LINE 2]",DIFLD=.112 103 S DE(DW)="C2^DVBHCE14",DE(DW,"INDEX")=1 83 104 G RE 84 105 C2 G C2S:$D(DE(2))[0 K DB 85 106 S X=DE(2),DIC=DIE 86 X ^DD(2,.36215,1,1,2.3) I X S X=DIV S Y(1)=$S($D(^DPT(D0,.362)):^(.362),1:"") S X=$P(Y(1),U,2),X=X S DIU=X K Y S X="" X ^DD(2,.36215,1,1,2.4) 87 S X=DE(2),DIC=DIE 88 S DFN=DA D EN^DGMTCOR K DGMTCOR 89 S X=DE(2),DIC=DIE 90 K DIV S DIV=X,D0=DA,DIV(0)=D0 S Y(0)=X S X='$$TOTCHK^DGLOCK2(DA) I X S X=DIV S Y(1)=$S($D(^DPT(D0,.362)):^(.362),1:"") S X=$P(Y(1),U,20),X=X S DIU=X K Y S X="" X ^DD(2,.36215,1,3,2.4) 91 S X=DE(2),DIC=DIE 92 D AUTOUPD^DGENA2(DA) 107 X "S DGXRF=.112 D ^DGDDC Q" 108 S X=DE(2),DIC=DIE 109 S A1B2TAG="PAT" D ^A1B2XFR 110 S X=DE(2),DIC=DIE 111 D EVENT^IVMPLOG(DA) 112 S X=DE(2),DIC=DIE 113 K DIV S DIV=X,D0=DA,DIV(0)=D0 S Y(1)=$S($D(^DPT(D0,.11)):^(.11),1:"") S X=$P(Y(1),U,13),X=X S DIU=X K Y S X=DIV S X=$$NOW^XLFDT() S DIH=$G(^DPT(DIV(0),.11)),DIV=X S $P(^(.11),U,13)=DIV,DIH=2,DIG=.118 D ^DICR 114 S X=DE(2),DIC=DIE 115 S IVMX=X,X="IVMPXFR" X ^%ZOSF("TEST") D:$T DPT^IVMPXFR S X=IVMX K IVMX 116 S X=DE(2),DIC=DIE 117 I ($T(AVAFC^VAFCDD01)'="") S VAFCF=".112;" D AVAFC^VAFCDD01(DA) 118 S X=DE(2),DIC=DIE 119 D:($T(ADGRU^DGRUDD01)'="") ADGRU^DGRUDD01(DA) 120 S X=DE(2),DIIX=2_U_DIFLD D AUDIT^DIET 93 121 C2S S X="" G:DG(DQ)=X C2F1 K DB 94 122 S X=DG(DQ),DIC=DIE 95 X ^DD(2,.36215,1,1,1.3) I X S X=DIV S Y(1)=$S($D(^DPT(D0,.362)):^(.362),1:"") S X=$P(Y(1),U,2),X=X S DIU=X K Y S X="" X ^DD(2,.36215,1,1,1.4) 96 S X=DG(DQ),DIC=DIE 97 S DFN=DA D EN^DGMTCOR K DGMTCOR 98 S X=DG(DQ),DIC=DIE 99 K DIV S DIV=X,D0=DA,DIV(0)=D0 S Y(0)=X S X='$$TOTCHK^DGLOCK2(DA) I X S X=DIV S Y(1)=$S($D(^DPT(D0,.362)):^(.362),1:"") S X=$P(Y(1),U,20),X=X S DIU=X K Y S X="" X ^DD(2,.36215,1,3,1.4) 100 S X=DG(DQ),DIC=DIE 101 D AUTOUPD^DGENA2(DA) 102 C2F1 Q 103 X2 S DFN=DA D MV^DGLOCK I $D(X) S DFN=DA D EV^DGLOCK 104 Q 105 ; 106 3 D:$D(DG)>9 F^DIE17,DE S DQ=3,DW=".362;14",DV="SX",DU="",DLB="RECEIVING A VA PENSION?",DIFLD=.36235 107 S DE(DW)="C3^DVBHCE14" 108 S DU="Y:YES;N:NO;U:UNKNOWN;" 123 ; 124 S X=DG(DQ),DIC=DIE 125 S A1B2TAG="PAT" D ^A1B2XFR 126 S X=DG(DQ),DIC=DIE 127 D EVENT^IVMPLOG(DA) 128 S X=DG(DQ),DIC=DIE 129 K DIV S DIV=X,D0=DA,DIV(0)=D0 S Y(1)=$S($D(^DPT(D0,.11)):^(.11),1:"") S X=$P(Y(1),U,13),X=X S DIU=X K Y S X=DIV S X=$$NOW^XLFDT() S DIH=$G(^DPT(DIV(0),.11)),DIV=X S $P(^(.11),U,13)=DIV,DIH=2,DIG=.118 D ^DICR 130 S X=DG(DQ),DIC=DIE 131 S IVMX=X,X="IVMPXFR" X ^%ZOSF("TEST") D:$T DPT^IVMPXFR S X=IVMX K IVMX 132 S X=DG(DQ),DIC=DIE 133 I ($T(AVAFC^VAFCDD01)'="") S VAFCF=".112;" D AVAFC^VAFCDD01(DA) 134 S X=DG(DQ),DIC=DIE 135 D:($T(ADGRU^DGRUDD01)'="") ADGRU^DGRUDD01(DA) 136 I $D(DE(2))'[0!(^DD(DP,DIFLD,"AUDIT")'="e") S X=DG(DQ),DIIX=3_U_DIFLD D AUDIT^DIET 137 C2F1 N X,X1,X2 S DIXR=232 D C2X1(U) K X2 M X2=X D C2X1("O") K X1 M X1=X 138 D 139 . D FC^DGFCPROT(.DA,2,.112,"KILL",$H,$G(DUZ),.X,.X1,.X2,$G(XQY0)) Q 140 K X M X=X2 D 141 . D FC^DGFCPROT(.DA,2,.112,"SET",$H,$G(DUZ),.X,.X1,.X2,$G(XQY0)) Q 142 G C2F2 143 C2X1(DION) K X 144 S X(1)=$G(@DIEZTMP@("V",2,DIIENS,.112,DION),$P($G(^DPT(DA,.11)),U,2)) 145 S X=$G(X(1)) 146 Q 147 C2F2 Q 148 X2 K:X[""""!($A(X)=45) X I $D(X) K:$L(X)>30!($L(X)<3) X D:$D(X) UP^DGHELP 149 I $D(X),X'?.ANP K X 150 Q 151 ; 152 3 D:$D(DG)>9 F^DIE17,DE S DQ=3,DW=".11;3",DV="Fa",DU="",DLB="STREET ADDRESS [LINE 3]",DIFLD=.113 153 S DE(DW)="C3^DVBHCE14",DE(DW,"INDEX")=1 109 154 G RE 110 155 C3 G C3S:$D(DE(3))[0 K DB 111 156 S X=DE(3),DIC=DIE 112 X ^DD(2,.36235,1,1,2.3) I X S X=DIV S Y(1)=$S($D(^DPT(D0,.362)):^(.362),1:"") S X=$P(Y(1),U,4),X=X S DIU=X K Y S X="" X ^DD(2,.36235,1,1,2.4) 113 S X=DE(3),DIC=DIE 114 S DFN=DA D EN^DGMTCOR K DGMTCOR 115 S X=DE(3),DIC=DIE 116 K DIV S DIV=X,D0=DA,DIV(0)=D0 S Y(0)=X S X='$$TOTCHK^DGLOCK2(DA) I X S X=DIV S Y(1)=$S($D(^DPT(D0,.362)):^(.362),1:"") S X=$P(Y(1),U,20),X=X S DIU=X K Y S X="" X ^DD(2,.36235,1,3,2.4) 117 S X=DE(3),DIC=DIE 118 D AUTOUPD^DGENA2(DA) 157 S A1B2TAG="PAT" D ^A1B2XFR 158 S X=DE(3),DIC=DIE 159 D EVENT^IVMPLOG(DA) 160 S X=DE(3),DIC=DIE 161 K DIV S DIV=X,D0=DA,DIV(0)=D0 S Y(1)=$S($D(^DPT(D0,.11)):^(.11),1:"") S X=$P(Y(1),U,13),X=X S DIU=X K Y S X=DIV S X=$$NOW^XLFDT() S DIH=$G(^DPT(DIV(0),.11)),DIV=X S $P(^(.11),U,13)=DIV,DIH=2,DIG=.118 D ^DICR 162 S X=DE(3),DIC=DIE 163 S IVMX=X,X="IVMPXFR" X ^%ZOSF("TEST") D:$T DPT^IVMPXFR S X=IVMX K IVMX 164 S X=DE(3),DIC=DIE 165 I ($T(AVAFC^VAFCDD01)'="") S VAFCF=".113;" D AVAFC^VAFCDD01(DA) 166 S X=DE(3),DIC=DIE 167 D:($T(ADGRU^DGRUDD01)'="") ADGRU^DGRUDD01(DA) 168 S X=DE(3),DIIX=2_U_DIFLD D AUDIT^DIET 119 169 C3S S X="" G:DG(DQ)=X C3F1 K DB 120 S X=DG(DQ),DIC=DIE 121 X ^DD(2,.36235,1,1,1.3) I X S X=DIV S Y(1)=$S($D(^DPT(D0,.362)):^(.362),1:"") S X=$P(Y(1),U,4),X=X S DIU=X K Y S X="" X ^DD(2,.36235,1,1,1.4) 122 S X=DG(DQ),DIC=DIE 123 S DFN=DA D EN^DGMTCOR K DGMTCOR 124 S X=DG(DQ),DIC=DIE 125 K DIV S DIV=X,D0=DA,DIV(0)=D0 S Y(0)=X S X='$$TOTCHK^DGLOCK2(DA) I X S X=DIV S Y(1)=$S($D(^DPT(D0,.362)):^(.362),1:"") S X=$P(Y(1),U,20),X=X S DIU=X K Y S X="" X ^DD(2,.36235,1,3,1.4) 126 S X=DG(DQ),DIC=DIE 127 D AUTOUPD^DGENA2(DA) 128 C3F1 Q 129 X3 S DFN=DA D MV^DGLOCK 130 Q 131 ; 132 4 D:$D(DG)>9 F^DIE17,DE S DQ=4,DW=".3;11",DV="SX",DU="",DLB="RECEIVING VA DISABILITY?",DIFLD=.3025 133 S DE(DW)="C4^DVBHCE14" 134 S DU="Y:YES;N:NO;U:UNKNOWN;" 170 D ^DVBHCE15 171 C3F1 N X,X1,X2 S DIXR=233 D C3X1(U) K X2 M X2=X D C3X1("O") K X1 M X1=X 172 D 173 . D FC^DGFCPROT(.DA,2,.113,"KILL",$H,$G(DUZ),.X,.X1,.X2,$G(XQY0)) Q 174 K X M X=X2 D 175 . D FC^DGFCPROT(.DA,2,.113,"SET",$H,$G(DUZ),.X,.X1,.X2,$G(XQY0)) Q 176 G C3F2 177 C3X1(DION) K X 178 S X(1)=$G(@DIEZTMP@("V",2,DIIENS,.113,DION),$P($G(^DPT(DA,.11)),U,3)) 179 S X=$G(X(1)) 180 Q 181 C3F2 Q 182 X3 K:X[""""!($A(X)=45) X I $D(X) K:$L(X)>30!($L(X)<3) X 183 I $D(X),X'?.ANP K X 184 Q 185 ; 186 4 D:$D(DG)>9 F^DIE17,DE S DQ=4,DW=".11;4",DV="Fa",DU="",DLB="CITY",DIFLD=.114 187 S DE(DW)="C4^DVBHCE14",DE(DW,"INDEX")=1 135 188 G RE 136 189 C4 G C4S:$D(DE(4))[0 K DB 137 S X=DE(4),DIC=DIE 138 X ^DD(2,.3025,1,1,2.3) I X S X=DIV S Y(1)=$S($D(^DPT(D0,.3)):^(.3),1:"") S X=$P(Y(1),U,3),X=X S DIU=X K Y S X="" X ^DD(2,.3025,1,1,2.4) 139 S X=DE(4),DIC=DIE 140 K DIV S DIV=X,D0=DA,DIV(0)=D0 S Y(0)=X S X='$$TOTCHK^DGLOCK2(DA) I X S X=DIV S Y(1)=$S($D(^DPT(D0,.362)):^(.362),1:"") S X=$P(Y(1),U,20),X=X S DIU=X K Y S X="" X ^DD(2,.3025,1,2,2.4) 141 S X=DE(4),DIC=DIE 142 D EVENT^IVMPLOG(DA) 190 D ^DVBHCE16 143 191 C4S S X="" G:DG(DQ)=X C4F1 K DB 144 S X=DG(DQ),DIC=DIE145 X ^DD(2,.3025,1,1,1.3) I X S X=DIV S Y(1)=$S($D(^DPT(D0,.3)):^(.3),1:"") S X=$P(Y(1),U,3),X=X S DIU=X K Y S X="" X ^DD(2,.3025,1,1,1.4)146 S X=DG(DQ),DIC=DIE147 K DIV S DIV=X,D0=DA,DIV(0)=D0 S Y(0)=X S X='$$TOTCHK^DGLOCK2(DA) I X S X=DIV S Y(1)=$S($D(^DPT(D0,.362)):^(.362),1:"") S X=$P(Y(1),U,20),X=X S DIU=X K Y S X="" X ^DD(2,.3025,1,2,1.4)148 S X=DG(DQ),DIC=DIE149 D EVENT^IVMPLOG(DA)150 C4F1 Q151 X4 S DFN=DA D MV^DGLOCK I $D(X),X="Y" D EC^DGLOCK1152 Q153 ;154 5 D:$D(DG)>9 F^DIE17,DE S DQ=5,DW=".362;20",DV="NJ8,2X",DU="",DLB="TOTAL ANNUAL VA CHECK AMOUNT",DIFLD=.36295155 S DE(DW)="C5^DVBHCE14"156 G RE157 C5 G C5S:$D(DE(5))[0 K DB158 S X=DE(5),DIC=DIE159 X "S DFN=DA D EN^DGMTR K DGREQF"160 S X=DE(5),DIC=DIE161 D AUTOUPD^DGENA2(DA)162 C5S S X="" G:DG(DQ)=X C5F1 K DB163 S X=DG(DQ),DIC=DIE164 X "S DFN=DA D EN^DGMTR K DGREQF"165 S X=DG(DQ),DIC=DIE166 D AUTOUPD^DGENA2(DA)167 C5F1 Q168 X5 D DOL^DGLOCK2 K:+X'=X&(X'?.N1"."2N)!(X>99999)!(X<0) X I $D(X) S DFN=DA D MV^DGLOCK I $D(X),('$$TOTCHK^DGLOCK2(DFN)) D TOTCKMSG^DGLOCK2 K X169 Q170 ;171 6 S DQ=7 ;@2062172 7 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^DIE17173 X7 S Y="@104"174 Q175 8 S DQ=9 ;@11176 9 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^DIE17177 X9 S DVBJ2=1178 Q179 10 D:$D(DG)>9 F^DIE17,DE S DQ=10,DW=".11;1",DV="Fa",DU="",DLB="STREET ADDRESS [LINE 1]",DIFLD=.111180 S DE(DW)="C10^DVBHCE14",DE(DW,"INDEX")=1181 G RE182 C10 G C10S:$D(DE(10))[0 K DB183 S X=DE(10),DIC=DIE184 X "S DGXRF=.111 D ^DGDDC Q"185 S X=DE(10),DIC=DIE186 S A1B2TAG="PAT" D ^A1B2XFR187 S X=DE(10),DIC=DIE188 D EVENT^IVMPLOG(DA)189 S X=DE(10),DIC=DIE190 K DIV S DIV=X,D0=DA,DIV(0)=D0 S Y(1)=$S($D(^DPT(D0,.11)):^(.11),1:"") S X=$P(Y(1),U,13),X=X S DIU=X K Y S X=DIV S X=$$NOW^XLFDT() S DIH=$G(^DPT(DIV(0),.11)),DIV=X S $P(^(.11),U,13)=DIV,DIH=2,DIG=.118 D ^DICR191 S X=DE(10),DIC=DIE192 S IVMX=X,X="IVMPXFR" X ^%ZOSF("TEST") D:$T DPT^IVMPXFR S X=IVMX K IVMX193 S X=DE(10),DIC=DIE194 I ($T(AVAFC^VAFCDD01)'="") S VAFCF=".111;" D AVAFC^VAFCDD01(DA)195 S X=DE(10),DIC=DIE196 D:($T(ADGRU^DGRUDD01)'="") ADGRU^DGRUDD01(DA)197 S X=DE(10),DIIX=2_U_DIFLD D AUDIT^DIET198 C10S S X="" G:DG(DQ)=X C10F1 K DB199 D ^DVBHCE15200 C10F1 N X,X1,X2 S DIXR=230 D C10X1(U) K X2 M X2=X D C10X1("O") K X1 M X1=X201 D202 . D FC^DGFCPROT(.DA,2,.111,"KILL",$H,$G(DUZ),.X,.X1,.X2,$G(XQY0)) Q203 K X M X=X2 D204 . D FC^DGFCPROT(.DA,2,.111,"SET",$H,$G(DUZ),.X,.X1,.X2,$G(XQY0)) Q205 G C10F2206 C10X1(DION) K X207 S X(1)=$G(@DIEZTMP@("V",2,DIIENS,.111,DION),$P($G(^DPT(DA,.11)),U,1))208 S X=$G(X(1))209 Q210 C10F2 Q211 X10 K:X[""""!($A(X)=45) X I $D(X) K:$L(X)>35!($L(X)<3) X212 I $D(X),X'?.ANP K X213 Q214 ;215 11 D:$D(DG)>9 F^DIE17,DE S DQ=11,DW=".11;2",DV="Fa",DU="",DLB="STREET ADDRESS [LINE 2]",DIFLD=.112216 S DE(DW)="C11^DVBHCE14",DE(DW,"INDEX")=1217 G RE218 C11 G C11S:$D(DE(11))[0 K DB219 D ^DVBHCE16220 C11S S X="" G:DG(DQ)=X C11F1 K DB221 192 D ^DVBHCE17 222 C 11F1 N X,X1,X2 S DIXR=232 D C11X1(U) K X2 M X2=X D C11X1("O") K X1 M X1=X223 D 224 . D FC^DGFCPROT(.DA,2,.11 2,"KILL",$H,$G(DUZ),.X,.X1,.X2,$G(XQY0)) Q225 K X M X=X2 D 226 . D FC^DGFCPROT(.DA,2,.11 2,"SET",$H,$G(DUZ),.X,.X1,.X2,$G(XQY0)) Q227 G C 11F2228 C 11X1(DION) K X229 S X(1)=$G(@DIEZTMP@("V",2,DIIENS,.11 2,DION),$P($G(^DPT(DA,.11)),U,2))230 S X=$G(X(1)) 231 Q 232 C 11F2 Q233 X 11 K:X[""""!($A(X)=45) X I $D(X) K:$L(X)>30!($L(X)<3) X D:$D(X) UP^DGHELP234 I $D(X),X'?.ANP K X 235 Q 236 ; 237 12D:$D(DG)>9 F^DIE17 G ^DVBHCE18193 C4F1 N X,X1,X2 S DIXR=234 D C4X1(U) K X2 M X2=X D C4X1("O") K X1 M X1=X 194 D 195 . D FC^DGFCPROT(.DA,2,.114,"KILL",$H,$G(DUZ),.X,.X1,.X2,$G(XQY0)) Q 196 K X M X=X2 D 197 . D FC^DGFCPROT(.DA,2,.114,"SET",$H,$G(DUZ),.X,.X1,.X2,$G(XQY0)) Q 198 G C4F2 199 C4X1(DION) K X 200 S X(1)=$G(@DIEZTMP@("V",2,DIIENS,.114,DION),$P($G(^DPT(DA,.11)),U,4)) 201 S X=$G(X(1)) 202 Q 203 C4F2 Q 204 X4 K:$L(X)>15!($L(X)<2) X 205 I $D(X),X'?.ANP K X 206 Q 207 ; 208 5 D:$D(DG)>9 F^DIE17 G ^DVBHCE18 -
WorldVistAEHR/trunk/r/HINQ-DVB--DVBA--DVBE--DVBC/DVBHCE15.m
r613 r623 1 DVBHCE15 ; ;12/13/08 2 S X=DG(DQ),DIC=DIE 3 ; 1 DVBHCE15 ; ;12/27/07 4 2 S X=DG(DQ),DIC=DIE 5 3 S A1B2TAG="PAT" D ^A1B2XFR … … 11 9 S IVMX=X,X="IVMPXFR" X ^%ZOSF("TEST") D:$T DPT^IVMPXFR S X=IVMX K IVMX 12 10 S X=DG(DQ),DIC=DIE 13 I ($T(AVAFC^VAFCDD01)'="") S VAFCF=".11 1;" D AVAFC^VAFCDD01(DA)11 I ($T(AVAFC^VAFCDD01)'="") S VAFCF=".113;" D AVAFC^VAFCDD01(DA) 14 12 S X=DG(DQ),DIC=DIE 15 13 D:($T(ADGRU^DGRUDD01)'="") ADGRU^DGRUDD01(DA) 16 I $D(DE( 10))'[0!(^DD(DP,DIFLD,"AUDIT")'="e") S X=DG(DQ),DIIX=3_U_DIFLD D AUDIT^DIET14 I $D(DE(3))'[0!(^DD(DP,DIFLD,"AUDIT")'="e") S X=DG(DQ),DIIX=3_U_DIFLD D AUDIT^DIET -
WorldVistAEHR/trunk/r/HINQ-DVB--DVBA--DVBE--DVBC/DVBHCE16.m
r613 r623 1 DVBHCE16 ; ;12/13/08 2 S X=DE(11),DIC=DIE 3 X "S DGXRF=.112 D ^DGDDC Q" 4 S X=DE(11),DIC=DIE 1 DVBHCE16 ; ;12/27/07 2 S X=DE(4),DIC=DIE 5 3 S A1B2TAG="PAT" D ^A1B2XFR 6 S X=DE( 11),DIC=DIE4 S X=DE(4),DIC=DIE 7 5 D EVENT^IVMPLOG(DA) 8 S X=DE( 11),DIC=DIE6 S X=DE(4),DIC=DIE 9 7 K DIV S DIV=X,D0=DA,DIV(0)=D0 S Y(1)=$S($D(^DPT(D0,.11)):^(.11),1:"") S X=$P(Y(1),U,13),X=X S DIU=X K Y S X=DIV S X=$$NOW^XLFDT() S DIH=$G(^DPT(DIV(0),.11)),DIV=X S $P(^(.11),U,13)=DIV,DIH=2,DIG=.118 D ^DICR 10 S X=DE( 11),DIC=DIE8 S X=DE(4),DIC=DIE 11 9 S IVMX=X,X="IVMPXFR" X ^%ZOSF("TEST") D:$T DPT^IVMPXFR S X=IVMX K IVMX 12 S X=DE( 11),DIC=DIE13 I ($T(AVAFC^VAFCDD01)'="") S VAFCF=".11 2;" D AVAFC^VAFCDD01(DA)14 S X=DE( 11),DIC=DIE10 S X=DE(4),DIC=DIE 11 I ($T(AVAFC^VAFCDD01)'="") S VAFCF=".114;" D AVAFC^VAFCDD01(DA) 12 S X=DE(4),DIC=DIE 15 13 D:($T(ADGRU^DGRUDD01)'="") ADGRU^DGRUDD01(DA) 16 S X=DE( 11),DIIX=2_U_DIFLD D AUDIT^DIET14 S X=DE(4),DIIX=2_U_DIFLD D AUDIT^DIET -
WorldVistAEHR/trunk/r/HINQ-DVB--DVBA--DVBE--DVBC/DVBHCE17.m
r613 r623 1 DVBHCE17 ; ;12/13/08 2 S X=DG(DQ),DIC=DIE 3 ; 1 DVBHCE17 ; ;12/27/07 4 2 S X=DG(DQ),DIC=DIE 5 3 S A1B2TAG="PAT" D ^A1B2XFR … … 11 9 S IVMX=X,X="IVMPXFR" X ^%ZOSF("TEST") D:$T DPT^IVMPXFR S X=IVMX K IVMX 12 10 S X=DG(DQ),DIC=DIE 13 I ($T(AVAFC^VAFCDD01)'="") S VAFCF=".11 2;" D AVAFC^VAFCDD01(DA)11 I ($T(AVAFC^VAFCDD01)'="") S VAFCF=".114;" D AVAFC^VAFCDD01(DA) 14 12 S X=DG(DQ),DIC=DIE 15 13 D:($T(ADGRU^DGRUDD01)'="") ADGRU^DGRUDD01(DA) 16 I $D(DE( 11))'[0!(^DD(DP,DIFLD,"AUDIT")'="e") S X=DG(DQ),DIIX=3_U_DIFLD D AUDIT^DIET14 I $D(DE(4))'[0!(^DD(DP,DIFLD,"AUDIT")'="e") S X=DG(DQ),DIIX=3_U_DIFLD D AUDIT^DIET -
WorldVistAEHR/trunk/r/HINQ-DVB--DVBA--DVBE--DVBC/DVBHCE18.m
r613 r623 1 DVBHCE18 ; ;12/ 13/081 DVBHCE18 ; ;12/27/07 2 2 D DE G BEGIN 3 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(^(.11)) S %Z=^(.11) S %=$P(%Z,U, 3) S:%]"" DE(1)=% S %=$P(%Z,U,4) S:%]"" DE(2)=% S %=$P(%Z,U,5) S:%]"" DE(3)=% S %=$P(%Z,U,7) S:%]"" DE(5)=% S %=$P(%Z,U,12) S:%]"" DE(4)=%4 I $D(^(.11)) S %Z=^(.11) S %=$P(%Z,U,5) S:%]"" DE(1)=% S %=$P(%Z,U,7) S:%]"" DE(3)=% S %=$P(%Z,U,12) S:%]"" DE(2)=% 5 5 K %Z Q 6 6 ; … … 50 50 KEYCHK() Q:$G(DE(DW,"KEY"))="" 1 Q @DE(DW,"KEY") 51 51 BEGIN S DNM="DVBHCE18",DQ=1 52 1 D:$D(DG)>9 F^DIE17,DE S DQ=1,DW=".11; 3",DV="Fa",DU="",DLB="STREET ADDRESS [LINE 3]",DIFLD=.11352 1 D:$D(DG)>9 F^DIE17,DE S DQ=1,DW=".11;5",DV="P5'a",DU="",DLB="STATE",DIFLD=.115 53 53 S DE(DW)="C1^DVBHCE18",DE(DW,"INDEX")=1 54 S DU="DIC(5," 54 55 G RE 55 56 C1 G C1S:$D(DE(1))[0 K DB 56 57 S X=DE(1),DIC=DIE 58 K DIV S DIV=X,D0=DA,DIV(0)=D0 S Y(1)=$S($D(^DPT(D0,.11)):^(.11),1:""),Y=$P(Y(1),U,7) X:$D(^DD(2,.117,2)) ^(2) S X=Y S DIU=X K Y S X=DIV S X="" X ^DD(2,.115,1,1,2.4) 59 S X=DE(1),DIC=DIE 57 60 S A1B2TAG="PAT" D ^A1B2XFR 58 61 S X=DE(1),DIC=DIE 59 62 D EVENT^IVMPLOG(DA) 60 63 S X=DE(1),DIC=DIE 61 K DIV S DIV=X,D0=DA,DIV(0)=D0 S Y(1)=$S($D(^DPT(D0,.11)):^(.11),1:"") S X=$P(Y(1),U,13),X=X S DIU=X K Y S X=DIV S X=$$NOW^XLFDT ()S DIH=$G(^DPT(DIV(0),.11)),DIV=X S $P(^(.11),U,13)=DIV,DIH=2,DIG=.118 D ^DICR62 S X=DE(1),DIC=DIE 63 S IVMX=X,X="IVMPXFR" X ^%ZOSF("TEST") D:$T DPT^IVMPXFR S X=IVMX K IVMX 64 S X=DE(1),DIC=DIE 65 I ($T(AVAFC^VAFCDD01)'="") S VAFCF=".11 3;" D AVAFC^VAFCDD01(DA)64 K DIV S DIV=X,D0=DA,DIV(0)=D0 S Y(1)=$S($D(^DPT(D0,.11)):^(.11),1:"") S X=$P(Y(1),U,13),X=X S DIU=X K Y S X=DIV S X=$$NOW^XLFDT S DIH=$G(^DPT(DIV(0),.11)),DIV=X S $P(^(.11),U,13)=DIV,DIH=2,DIG=.118 D ^DICR 65 S X=DE(1),DIC=DIE 66 S IVMX=X,X="IVMPXFR" X ^%ZOSF("TEST") D:$T DPT^IVMPXFR S X=IVMX K IVMX 67 S X=DE(1),DIC=DIE 68 I ($T(AVAFC^VAFCDD01)'="") S VAFCF=".115;" D AVAFC^VAFCDD01(DA) 66 69 S X=DE(1),DIC=DIE 67 70 D:($T(ADGRU^DGRUDD01)'="") ADGRU^DGRUDD01(DA) … … 69 72 C1S S X="" G:DG(DQ)=X C1F1 K DB 70 73 S X=DG(DQ),DIC=DIE 74 ; 75 S X=DG(DQ),DIC=DIE 71 76 S A1B2TAG="PAT" D ^A1B2XFR 72 77 S X=DG(DQ),DIC=DIE … … 77 82 S IVMX=X,X="IVMPXFR" X ^%ZOSF("TEST") D:$T DPT^IVMPXFR S X=IVMX K IVMX 78 83 S X=DG(DQ),DIC=DIE 79 I ($T(AVAFC^VAFCDD01)'="") S VAFCF=".11 3;" D AVAFC^VAFCDD01(DA)84 I ($T(AVAFC^VAFCDD01)'="") S VAFCF=".115;" D AVAFC^VAFCDD01(DA) 80 85 S X=DG(DQ),DIC=DIE 81 86 D:($T(ADGRU^DGRUDD01)'="") ADGRU^DGRUDD01(DA) 82 87 I $D(DE(1))'[0!(^DD(DP,DIFLD,"AUDIT")'="e") S X=DG(DQ),DIIX=3_U_DIFLD D AUDIT^DIET 83 C1F1 N X,X1,X2 S DIXR=233 D C1X1(U) K X2 M X2=X D C1X1("O") K X1 M X1=X 84 D 85 . D FC^DGFCPROT(.DA,2,.113,"KILL",$H,$G(DUZ),.X,.X1,.X2,$G(XQY0)) Q 86 K X M X=X2 D 87 . D FC^DGFCPROT(.DA,2,.113,"SET",$H,$G(DUZ),.X,.X1,.X2,$G(XQY0)) Q 88 G C1F2 89 C1X1(DION) K X 90 S X(1)=$G(@DIEZTMP@("V",2,DIIENS,.113,DION),$P($G(^DPT(DA,.11)),U,3)) 91 S X=$G(X(1)) 92 Q 93 C1F2 Q 94 X1 K:X[""""!($A(X)=45) X I $D(X) K:$L(X)>30!($L(X)<3) X 95 I $D(X),X'?.ANP K X 96 Q 97 ; 98 2 D:$D(DG)>9 F^DIE17,DE S DQ=2,DW=".11;4",DV="Fa",DU="",DLB="CITY",DIFLD=.114 99 S DE(DW)="C2^DVBHCE18",DE(DW,"INDEX")=1 100 G RE 101 C2 G C2S:$D(DE(2))[0 K DB 102 S X=DE(2),DIC=DIE 103 S A1B2TAG="PAT" D ^A1B2XFR 104 S X=DE(2),DIC=DIE 105 D EVENT^IVMPLOG(DA) 106 S X=DE(2),DIC=DIE 107 K DIV S DIV=X,D0=DA,DIV(0)=D0 S Y(1)=$S($D(^DPT(D0,.11)):^(.11),1:"") S X=$P(Y(1),U,13),X=X S DIU=X K Y S X=DIV S X=$$NOW^XLFDT() S DIH=$G(^DPT(DIV(0),.11)),DIV=X S $P(^(.11),U,13)=DIV,DIH=2,DIG=.118 D ^DICR 108 S X=DE(2),DIC=DIE 109 S IVMX=X,X="IVMPXFR" X ^%ZOSF("TEST") D:$T DPT^IVMPXFR S X=IVMX K IVMX 110 S X=DE(2),DIC=DIE 111 I ($T(AVAFC^VAFCDD01)'="") S VAFCF=".114;" D AVAFC^VAFCDD01(DA) 112 S X=DE(2),DIC=DIE 113 D:($T(ADGRU^DGRUDD01)'="") ADGRU^DGRUDD01(DA) 114 S X=DE(2),DIIX=2_U_DIFLD D AUDIT^DIET 115 C2S S X="" G:DG(DQ)=X C2F1 K DB 116 S X=DG(DQ),DIC=DIE 117 S A1B2TAG="PAT" D ^A1B2XFR 118 S X=DG(DQ),DIC=DIE 119 D EVENT^IVMPLOG(DA) 120 S X=DG(DQ),DIC=DIE 121 K DIV S DIV=X,D0=DA,DIV(0)=D0 S Y(1)=$S($D(^DPT(D0,.11)):^(.11),1:"") S X=$P(Y(1),U,13),X=X S DIU=X K Y S X=DIV S X=$$NOW^XLFDT() S DIH=$G(^DPT(DIV(0),.11)),DIV=X S $P(^(.11),U,13)=DIV,DIH=2,DIG=.118 D ^DICR 122 S X=DG(DQ),DIC=DIE 123 S IVMX=X,X="IVMPXFR" X ^%ZOSF("TEST") D:$T DPT^IVMPXFR S X=IVMX K IVMX 124 S X=DG(DQ),DIC=DIE 125 I ($T(AVAFC^VAFCDD01)'="") S VAFCF=".114;" D AVAFC^VAFCDD01(DA) 126 S X=DG(DQ),DIC=DIE 127 D:($T(ADGRU^DGRUDD01)'="") ADGRU^DGRUDD01(DA) 128 I $D(DE(2))'[0!(^DD(DP,DIFLD,"AUDIT")'="e") S X=DG(DQ),DIIX=3_U_DIFLD D AUDIT^DIET 129 C2F1 N X,X1,X2 S DIXR=234 D C2X1(U) K X2 M X2=X D C2X1("O") K X1 M X1=X 130 D 131 . D FC^DGFCPROT(.DA,2,.114,"KILL",$H,$G(DUZ),.X,.X1,.X2,$G(XQY0)) Q 132 K X M X=X2 D 133 . D FC^DGFCPROT(.DA,2,.114,"SET",$H,$G(DUZ),.X,.X1,.X2,$G(XQY0)) Q 134 G C2F2 135 C2X1(DION) K X 136 S X(1)=$G(@DIEZTMP@("V",2,DIIENS,.114,DION),$P($G(^DPT(DA,.11)),U,4)) 137 S X=$G(X(1)) 138 Q 139 C2F2 Q 140 X2 K:$L(X)>15!($L(X)<2) X 141 I $D(X),X'?.ANP K X 142 Q 143 ; 144 3 D:$D(DG)>9 F^DIE17,DE S DQ=3,DW=".11;5",DV="P5'a",DU="",DLB="STATE",DIFLD=.115 145 S DE(DW)="C3^DVBHCE18",DE(DW,"INDEX")=1 146 S DU="DIC(5," 147 G RE 148 C3 G C3S:$D(DE(3))[0 K DB 149 S X=DE(3),DIC=DIE 150 K DIV S DIV=X,D0=DA,DIV(0)=D0 S Y(1)=$S($D(^DPT(D0,.11)):^(.11),1:""),Y=$P(Y(1),U,7) X:$D(^DD(2,.117,2)) ^(2) S X=Y S DIU=X K Y S X=DIV S X="" X ^DD(2,.115,1,1,2.4) 151 S X=DE(3),DIC=DIE 152 S A1B2TAG="PAT" D ^A1B2XFR 153 S X=DE(3),DIC=DIE 154 D EVENT^IVMPLOG(DA) 155 S X=DE(3),DIC=DIE 156 K DIV S DIV=X,D0=DA,DIV(0)=D0 S Y(1)=$S($D(^DPT(D0,.11)):^(.11),1:"") S X=$P(Y(1),U,13),X=X S DIU=X K Y S X=DIV S X=$$NOW^XLFDT S DIH=$G(^DPT(DIV(0),.11)),DIV=X S $P(^(.11),U,13)=DIV,DIH=2,DIG=.118 D ^DICR 157 S X=DE(3),DIC=DIE 158 S IVMX=X,X="IVMPXFR" X ^%ZOSF("TEST") D:$T DPT^IVMPXFR S X=IVMX K IVMX 159 S X=DE(3),DIC=DIE 160 I ($T(AVAFC^VAFCDD01)'="") S VAFCF=".115;" D AVAFC^VAFCDD01(DA) 161 S X=DE(3),DIC=DIE 162 D:($T(ADGRU^DGRUDD01)'="") ADGRU^DGRUDD01(DA) 163 S X=DE(3),DIIX=2_U_DIFLD D AUDIT^DIET 164 C3S S X="" G:DG(DQ)=X C3F1 K DB 165 S X=DG(DQ),DIC=DIE 166 ; 167 S X=DG(DQ),DIC=DIE 168 S A1B2TAG="PAT" D ^A1B2XFR 169 S X=DG(DQ),DIC=DIE 170 D EVENT^IVMPLOG(DA) 171 S X=DG(DQ),DIC=DIE 172 K DIV S DIV=X,D0=DA,DIV(0)=D0 S Y(1)=$S($D(^DPT(D0,.11)):^(.11),1:"") S X=$P(Y(1),U,13),X=X S DIU=X K Y S X=DIV S X=$$NOW^XLFDT() S DIH=$G(^DPT(DIV(0),.11)),DIV=X S $P(^(.11),U,13)=DIV,DIH=2,DIG=.118 D ^DICR 173 S X=DG(DQ),DIC=DIE 174 S IVMX=X,X="IVMPXFR" X ^%ZOSF("TEST") D:$T DPT^IVMPXFR S X=IVMX K IVMX 175 S X=DG(DQ),DIC=DIE 176 I ($T(AVAFC^VAFCDD01)'="") S VAFCF=".115;" D AVAFC^VAFCDD01(DA) 177 S X=DG(DQ),DIC=DIE 178 D:($T(ADGRU^DGRUDD01)'="") ADGRU^DGRUDD01(DA) 179 I $D(DE(3))'[0!(^DD(DP,DIFLD,"AUDIT")'="e") S X=DG(DQ),DIIX=3_U_DIFLD D AUDIT^DIET 180 C3F1 N X,X1,X2 S DIXR=235 D C3X1(U) K X2 M X2=X D C3X1("O") K X1 M X1=X 88 C1F1 N X,X1,X2 S DIXR=235 D C1X1(U) K X2 M X2=X D C1X1("O") K X1 M X1=X 181 89 D 182 90 . D FC^DGFCPROT(.DA,2,.115,"KILL",$H,$G(DUZ),.X,.X1,.X2,$G(XQY0)) Q 183 91 K X M X=X2 D 184 92 . D FC^DGFCPROT(.DA,2,.115,"SET",$H,$G(DUZ),.X,.X1,.X2,$G(XQY0)) Q 185 G C 3F2186 C 3X1(DION) K X93 G C1F2 94 C1X1(DION) K X 187 95 S X(1)=$G(@DIEZTMP@("V",2,DIIENS,.115,DION),$P($G(^DPT(DA,.11)),U,5)) 188 96 S X=$G(X(1)) 189 97 Q 190 C 3F2 Q191 X 3Q192 4 D:$D(DG)>9 F^DIE17,DE S DQ=4,DW=".11;12",DV="FXOa",DU="",DLB="ZIP+4",DIFLD=.1112193 S DQ( 4,2)="S Y(0)=Y D ZIPOUT^VAFADDR"194 S DE(DW)="C 4^DVBHCE18",DE(DW,"INDEX")=198 C1F2 Q 99 X1 Q 100 2 D:$D(DG)>9 F^DIE17,DE S DQ=2,DW=".11;12",DV="FXOa",DU="",DLB="ZIP+4",DIFLD=.1112 101 S DQ(2,2)="S Y(0)=Y D ZIPOUT^VAFADDR" 102 S DE(DW)="C2^DVBHCE18",DE(DW,"INDEX")=1 195 103 G RE 196 C 4 G C4S:$D(DE(4))[0 K DB197 S X=DE( 4),DIC=DIE104 C2 G C2S:$D(DE(2))[0 K DB 105 S X=DE(2),DIC=DIE 198 106 D KILL^DGREGDD1(DA,.116,.11,6,$E(X,1,5)) 199 S X=DE( 4),DIC=DIE200 D EVENT^IVMPLOG(DA) 201 S X=DE( 4),DIC=DIE107 S X=DE(2),DIC=DIE 108 D EVENT^IVMPLOG(DA) 109 S X=DE(2),DIC=DIE 202 110 K DIV S DIV=X,D0=DA,DIV(0)=D0 S Y(1)=$S($D(^DPT(D0,.11)):^(.11),1:"") S X=$P(Y(1),U,13),X=X S DIU=X K Y S X=DIV S X=$$NOW^XLFDT() S DIH=$G(^DPT(DIV(0),.11)),DIV=X S $P(^(.11),U,13)=DIV,DIH=2,DIG=.118 D ^DICR 203 S X=DE( 4),DIC=DIE204 S IVMX=X,X="IVMPXFR" X ^%ZOSF("TEST") D:$T DPT^IVMPXFR S X=IVMX K IVMX 205 S X=DE( 4),DIC=DIE111 S X=DE(2),DIC=DIE 112 S IVMX=X,X="IVMPXFR" X ^%ZOSF("TEST") D:$T DPT^IVMPXFR S X=IVMX K IVMX 113 S X=DE(2),DIC=DIE 206 114 I ($T(AVAFC^VAFCDD01)'="") S VAFCF=".1112;" D AVAFC^VAFCDD01(DA) 207 S X=DE(4),DIC=DIE 208 D:($T(ADGRU^DGRUDD01)'="") ADGRU^DGRUDD01(DA) 209 S X=DE(4),DIIX=2_U_DIFLD D AUDIT^DIET 210 C4S S X="" G:DG(DQ)=X C4F1 K DB 211 D ^DVBHCE19 212 C4F1 N X,X1,X2 S DIXR=185 D C4X1(U) K X2 M X2=X D C4X1("O") K X1 M X1=X 115 S X=DE(2),DIC=DIE 116 D:($T(ADGRU^DGRUDD01)'="") ADGRU^DGRUDD01(DA) 117 S X=DE(2),DIIX=2_U_DIFLD D AUDIT^DIET 118 C2S S X="" G:DG(DQ)=X C2F1 K DB 119 S X=DG(DQ),DIC=DIE 120 D SET^DGREGDD1(DA,.116,.11,6,$E(X,1,5)) 121 S X=DG(DQ),DIC=DIE 122 D EVENT^IVMPLOG(DA) 123 S X=DG(DQ),DIC=DIE 124 K DIV S DIV=X,D0=DA,DIV(0)=D0 S Y(1)=$S($D(^DPT(D0,.11)):^(.11),1:"") S X=$P(Y(1),U,13),X=X S DIU=X K Y S X=DIV S X=$$NOW^XLFDT() S DIH=$G(^DPT(DIV(0),.11)),DIV=X S $P(^(.11),U,13)=DIV,DIH=2,DIG=.118 D ^DICR 125 S X=DG(DQ),DIC=DIE 126 S IVMX=X,X="IVMPXFR" X ^%ZOSF("TEST") D:$T DPT^IVMPXFR S X=IVMX K IVMX 127 S X=DG(DQ),DIC=DIE 128 I ($T(AVAFC^VAFCDD01)'="") S VAFCF=".1112;" D AVAFC^VAFCDD01(DA) 129 S X=DG(DQ),DIC=DIE 130 D:($T(ADGRU^DGRUDD01)'="") ADGRU^DGRUDD01(DA) 131 I $D(DE(2))'[0!(^DD(DP,DIFLD,"AUDIT")'="e") S X=DG(DQ),DIIX=3_U_DIFLD D AUDIT^DIET 132 C2F1 N X,X1,X2 S DIXR=185 D C2X1(U) K X2 M X2=X D C2X1("O") K X1 M X1=X 213 133 D 214 134 . N DIEXARR M DIEXARR=X S DIEZCOND=1 … … 216 136 . S DIEZCOND=$G(X) K X M X=DIEXARR Q:'DIEZCOND 217 137 . K EASDO2 218 G C 4F2219 C 4X1(DION) K X138 G C2F2 139 C2X1(DION) K X 220 140 S X(1)=$G(@DIEZTMP@("V",2,DIIENS,.1112,DION),$P($G(^DPT(DA,.11)),U,12)) 221 141 S:('$G(EASDO2)&($D(EASZIPLK))) X=$$ZIP^DGREGDD1(DA,X(1)) … … 223 143 S X=$G(X(1)) 224 144 Q 225 C 4F2 S DIXR=231 D C4X2(U) K X2 M X2=X D C4X2("O") K X1 M X1=X145 C2F2 S DIXR=231 D C2X2(U) K X2 M X2=X D C2X2("O") K X1 M X1=X 226 146 D 227 147 . D FC^DGFCPROT(.DA,2,.1112,"KILL",$H,$G(DUZ),.X,.X1,.X2,$G(XQY0)) Q 228 148 K X M X=X2 D 229 149 . D FC^DGFCPROT(.DA,2,.1112,"SET",$H,$G(DUZ),.X,.X1,.X2,$G(XQY0)) Q 230 G C 4F3231 C 4X2(DION) K X150 G C2F3 151 C2X2(DION) K X 232 152 S X(1)=$G(@DIEZTMP@("V",2,DIIENS,.1112,DION),$P($G(^DPT(DA,.11)),U,12)) 233 153 S X=$G(X(1)) 234 154 Q 235 C 4F3 Q236 X 4K:X[""""!($A(X)=45) X I $D(X) K:$L(X)>20!($L(X)<5) X I $D(X) D ZIPIN^VAFADDR155 C2F3 Q 156 X2 K:X[""""!($A(X)=45) X I $D(X) K:$L(X)>20!($L(X)<5) X I $D(X) D ZIPIN^VAFADDR 237 157 I $D(X),X'?.ANP K X 238 158 Q 239 159 ; 240 5 D:$D(DG)>9 F^DIE17,DE S DQ=5,DW=".11;7",DV="NJ3,0XOa",DU="",DLB="COUNTY",DIFLD=.117241 S DQ( 5,2)="S Y(0)=Y Q:Y']"""" S Z0=$S($D(^DPT(D0,.11)):+$P(^(.11),""^"",5),1:"""") Q:'Z0 S Y=$P($S($D(^DIC(5,Z0,1,Y,0)):^(0),1:""""),""^"",3)"242 S DE(DW)="C 5^DVBHCE18"160 3 D:$D(DG)>9 F^DIE17,DE S DQ=3,DW=".11;7",DV="NJ3,0XOa",DU="",DLB="COUNTY",DIFLD=.117 161 S DQ(3,2)="S Y(0)=Y Q:Y']"""" S Z0=$S($D(^DPT(D0,.11)):+$P(^(.11),""^"",5),1:"""") Q:'Z0 S Y=$P($S($D(^DIC(5,Z0,1,Y,0)):^(0),1:""""),""^"",3)" 162 S DE(DW)="C3^DVBHCE18" 243 163 G RE 244 C5 G C5S:$D(DE(5))[0 K DB 245 D ^DVBHCE20 246 C5S S X="" G:DG(DQ)=X C5F1 K DB 247 D ^DVBHCE21 248 C5F1 Q 249 X5 S Z0=$S($D(^DPT(D0,.11)):+$P(^(.11),"^",5),1:0) K:'Z0 X Q:'Z0!'$D(^DIC(5,Z0,1,0)) S DIC="^DIC(5,Z0,1,",DIC(0)="QEM" D ^DIC S X=+Y K:Y'>0 X K Z0,DIC 250 Q 251 ; 164 C3 G C3S:$D(DE(3))[0 K DB 165 S X=DE(3),DIC=DIE 166 S A1B2TAG="PAT" D ^A1B2XFR 167 S X=DE(3),DIC=DIE 168 D EVENT^IVMPLOG(DA) 169 S X=DE(3),DIC=DIE 170 S IVMX=X,X="IVMPXFR" X ^%ZOSF("TEST") D:$T DPT^IVMPXFR S X=IVMX K IVMX 171 S X=DE(3),DIC=DIE 172 I ($T(AVAFC^VAFCDD01)'="") S VAFCF=".117;" D AVAFC^VAFCDD01(DA) 173 S X=DE(3),DIIX=2_U_DIFLD D AUDIT^DIET 174 C3S S X="" G:DG(DQ)=X C3F1 K DB 175 D ^DVBHCE19 176 C3F1 Q 177 X3 S Z0=$S($D(^DPT(D0,.11)):+$P(^(.11),"^",5),1:0) K:'Z0 X Q:'Z0!'$D(^DIC(5,Z0,1,0)) S DIC="^DIC(5,Z0,1,",DIC(0)="QEM" D ^DIC S X=+Y K:Y'>0 X K Z0,DIC 178 Q 179 ; 180 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 181 X4 S Y="@1001" 182 Q 183 5 S DQ=6 ;@5 252 184 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 253 X6 S Y="@1001"254 Q 255 7 S DQ=8 ;@ 5185 X6 D SCRQ^DVBHUTIL 186 Q 187 7 S DQ=8 ;@6 256 188 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 257 X8 D SCRQ^DVBHUTIL258 Q 259 9 S DQ=10 ;@ 6189 X8 D B^DVBHQEDT R AA:DTIME K AA S Y=$S(DVBJS=11:"@1001",DVBJS=28:"@1",DVBJS=35:"@2",DVBJS=44:"@3",DVBJS=53:"@104",1:"@10") 190 Q 191 9 S DQ=10 ;@8 260 192 10 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 261 X10 D B^DVBHQEDT R AA:DTIME K AA S Y=$S(DVBJS=11:"@1001",DVBJS=28:"@1",DVBJS=35:"@2",DVBJS=44:"@3",DVBJS=53:"@104",1:"@10")262 Q 263 11 S DQ=12 ;@8264 12 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 265 X12 S Y=$S(ANS="^0":"@101",ANS="^1":"@1001",ANS="^2":"@1",ANS="^3":"@2",ANS="^4":"@3",ANS="^5":"@104",1:Y) I Y["@" W @$S('$D(IOF):"#",IOF="":"#",1:IOF) 266 Q 193 X10 S Y=$S(ANS="^0":"@101",ANS="^1":"@1001",ANS="^2":"@1",ANS="^3":"@2",ANS="^4":"@3",ANS="^5":"@104",1:Y) I Y["@" W @$S('$D(IOF):"#",IOF="":"#",1:IOF) 194 Q 195 11 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 196 X11 D A^DVBHQEDT S Z2=Z I ERROR K ERROR S Y=$S(DVBJS=11:"@1001",DVBJS=28:"@1",DVBJS=35:"@2",DVBJS=44:"@3",DVBJS=53:"@104",1:"@10") 197 Q 198 12 S DQ=13 ;@20 267 199 13 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=13 D X13 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 268 X13 D A^DVBHQEDT S Z2=Z I ERROR K ERROR S Y=$S(DVBJS=11:"@1001",DVBJS=28:"@1",DVBJS=35:"@2",DVBJS=44:"@3",DVBJS=53:"@104",1:"@10")269 Q 270 14 S DQ=15 ;@2 0200 X13 S JP=1,Y=$S(DVBJS=11:"@11",DVBJS=35:"@40",DVBJS=44:"@30",DVBJS=53:"@204",1:Y) 201 Q 202 14 S DQ=15 ;@21 271 203 15 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 272 X15 S JP=1,Y=$S(DVBJS=11:"@11",DVBJS=35:"@40",DVBJS=44:"@30",DVBJS=53:"@204",1:Y) 273 Q 274 16 S DQ=17 ;@21 204 X15 I $P(Z2,U,JP)'=1 S Y="@22" 205 Q 206 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 207 X16 I '$D(DVBCN) S Y="@22",JP=JP+1 208 Q 275 209 17 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=17 D X17 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 276 X17 I $P(Z2,U,JP)'=1 S Y="@22"210 X17 I 'DVBCN S Y="@22",JP=JP+1 277 211 Q 278 212 18 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=18 D X18 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 279 X18 I '$D(DVBCN) S Y="@22",JP=JP+1213 X18 S DVBCN=$TR(DVBCN," ") 280 214 Q 281 215 19 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=19 D X19 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 282 X19 I 'DVBCN S Y="@22",JP=JP+1 283 Q 284 20 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=20 D X20 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 285 X20 S DVBCN=$TR(DVBCN," ") 286 Q 287 21 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=21 D X21 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 288 X21 I $L(DVBCN)=9,(DVBCN?9N),(DVBCN'=$P(^DPT(D0,0),U,9)) W !!,*7,"HINQ claim # is a SSN, does not match patient file SSN NO UPDATING claim #" R !,?25,"<RET to continue>",DVBQ:DTIME K DVBQ S Y="@22",JP=JP+1 289 Q 290 22 D:$D(DG)>9 F^DIE17 G ^DVBHCE22 216 X19 I $L(DVBCN)=9,(DVBCN?9N),(DVBCN'=$P(^DPT(D0,0),U,9)) W !!,*7,"HINQ claim # is a SSN, does not match patient file SSN NO UPDATING claim #" R !,?25,"<RET to continue>",DVBQ:DTIME K DVBQ S Y="@22",JP=JP+1 217 Q 218 20 D:$D(DG)>9 F^DIE17 G ^DVBHCE20 -
WorldVistAEHR/trunk/r/HINQ-DVB--DVBA--DVBE--DVBC/DVBHCE19.m
r613 r623 1 DVBHCE19 ; ;12/ 13/081 DVBHCE19 ; ;12/27/07 2 2 S X=DG(DQ),DIC=DIE 3 D SET^DGREGDD1(DA,.116,.11,6,$E(X,1,5))3 S A1B2TAG="PAT" D ^A1B2XFR 4 4 S X=DG(DQ),DIC=DIE 5 5 D EVENT^IVMPLOG(DA) 6 6 S X=DG(DQ),DIC=DIE 7 K DIV S DIV=X,D0=DA,DIV(0)=D0 S Y(1)=$S($D(^DPT(D0,.11)):^(.11),1:"") S X=$P(Y(1),U,13),X=X S DIU=X K Y S X=DIV S X=$$NOW^XLFDT() S DIH=$G(^DPT(DIV(0),.11)),DIV=X S $P(^(.11),U,13)=DIV,DIH=2,DIG=.118 D ^DICR8 S X=DG(DQ),DIC=DIE9 7 S IVMX=X,X="IVMPXFR" X ^%ZOSF("TEST") D:$T DPT^IVMPXFR S X=IVMX K IVMX 10 8 S X=DG(DQ),DIC=DIE 11 I ($T(AVAFC^VAFCDD01)'="") S VAFCF=".1112;" D AVAFC^VAFCDD01(DA) 12 S X=DG(DQ),DIC=DIE 13 D:($T(ADGRU^DGRUDD01)'="") ADGRU^DGRUDD01(DA) 14 I $D(DE(4))'[0!(^DD(DP,DIFLD,"AUDIT")'="e") S X=DG(DQ),DIIX=3_U_DIFLD D AUDIT^DIET 9 I ($T(AVAFC^VAFCDD01)'="") S VAFCF=".117;" D AVAFC^VAFCDD01(DA) 10 I $D(DE(3))'[0!(^DD(DP,DIFLD,"AUDIT")'="e") S X=DG(DQ),DIIX=3_U_DIFLD D AUDIT^DIET -
WorldVistAEHR/trunk/r/HINQ-DVB--DVBA--DVBE--DVBC/DVBHCE2.m
r613 r623 1 DVBHCE2 ; ;12/13/08 2 S X=DE(32),DIC=DIE 3 ; 4 S X=DE(32),DIC=DIE 1 DVBHCE2 ; ;12/27/07 2 S X=DG(DQ),DIC=DIE 5 3 D EVENT^IVMPLOG(DA) -
WorldVistAEHR/trunk/r/HINQ-DVB--DVBA--DVBE--DVBC/DVBHCE20.m
r613 r623 1 DVBHCE20 ; ;12/13/08 2 S X=DE(5),DIC=DIE 3 S A1B2TAG="PAT" D ^A1B2XFR 4 S X=DE(5),DIC=DIE 1 DVBHCE20 ; ;12/27/07 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(^(.31)) S %Z=^(.31) S %=$P(%Z,U,3) S:%]"" DE(1)=% 5 I $D(^(.35)) S %Z=^(.35) S %=$P(%Z,U,1) S:%]"" DE(20)=% 6 K %Z Q 7 ; 8 W W !?DL+DL-2,DLB_": " 9 Q 10 O D W W Y W:$X>45 !?9 11 I $L(Y)>19,'DV,DV'["I",(DV["F"!(DV["K")) G RW^DIR2 12 W:Y]"" "// " I 'DV,DV["I",$D(DE(DQ))#2 S X="" W " (No Editing)" Q 13 TR R X:DTIME E S (DTOUT,X)=U W $C(7) 14 Q 15 A K DQ(DQ) S DQ=DQ+1 16 B G @DQ 17 RE G PR:$D(DE(DQ)) D W,TR 18 N I X="" G NKEY:$D(^DD("KEY","F",DP,DIFLD)),A:DV'["R",X:'DV,X:D'>0,A 19 RD G QS:X?."?" I X["^" D D G ^DIE17 20 I X="@" D D G Z^DIE2 21 I X=" ",DV["d",DV'["P",$D(^DISV(DUZ,"DIE",DLB)) S X=^(DLB) I DV'["D",DV'["S" W " "_X 22 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 23 K DDER G X 24 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 25 G V:DV'["N" D D I $L($P(X,"."))>24 K X G Z 26 I $P(DQ(DQ),U,5)'["$",X?.1"-".N.1".".N,$P(DQ(DQ),U,5,99)["+X'=X" S X=+X 27 V D @("X"_DQ) K YS 28 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 29 X W:'$D(ZTQUEUED) $C(7),"??" I $D(DB(DQ)) G Z^DIE17 30 S X="?BAD" 31 QS S DZ=X D D,QQ^DIEQ G B 32 D S D=DIFLD,DQ(DQ)=DLB_U_DV_U_DU_U_DW_U_$P($T(@("X"_DQ))," ",2,99) Q 33 Y I '$D(DE(DQ)) D O G RD:"@"'[X,A:DV'["R"&(X="@"),X:X="@" S X=Y G N 34 PR S DG=DV,Y=DE(DQ),X=DU I $D(DQ(DQ,2)) X DQ(DQ,2) G RP 35 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 36 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 37 X:DG["D" ^DD("DD") I DG["S" S %=$P($P(";"_X,";"_Y_":",2),";") S:%]"" Y=% 38 RP D O I X="" S X=DE(DQ) G A:'DV,A:DC<2,N^DIE17 39 I I DV'["I",DV'["#" G RD 40 D E^DIE0 G RD:$D(X),PR 41 Q 42 SET N DIR S DIR(0)="SV"_$E("o",$D(DB(DQ)))_U_DU,DIR("V")=1 43 I $D(DB(DQ)),'$D(DIQUIET) N DIQUIET S DIQUIET=1 44 D ^DIR I 'DDER S %=Y(0),X=Y 45 Q 46 SAVEVALS S @DIEZTMP@("V",DP,DIIENS,DIFLD,"O")=$G(DE(DQ)) S:$D(^("F"))[0 ^("F")=$G(DE(DQ)) 47 I $D(DE(DW,"4/")) S @DIEZTMP@("V",DP,DIIENS,DIFLD,"4/")="" 48 E K @DIEZTMP@("V",DP,DIIENS,DIFLD,"4/") 49 Q 50 NKEY W:'$D(ZTQUEUED) "?? Required key field" S X="?BAD" G QS 51 KEYCHK() Q:$G(DE(DW,"KEY"))="" 1 Q @DE(DW,"KEY") 52 BEGIN S DNM="DVBHCE20",DQ=1 53 1 D:$D(DG)>9 F^DIE17,DE S DQ=1,DW=".31;3",DV="FXOa",DU="",DLB="CLAIM NUMBER",DIFLD=.313 54 S DQ(1,2)="S Y(0)=Y S Y=$E(Y,1,10)" 55 S DE(DW)="C1^DVBHCE20" 56 S X=DVBCN 57 S Y=X 58 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) 59 G RD 60 C1 G C1S:$D(DE(1))[0 K DB 61 S X=DE(1),DIC=DIE 62 I ($T(AVAFC^VAFCDD01)'="") S VAFCF=".313;" D AVAFC^VAFCDD01(DA) 63 S X=DE(1),DIC=DIE 5 64 D EVENT^IVMPLOG(DA) 6 S X=DE(5),DIC=DIE 7 S IVMX=X,X="IVMPXFR" X ^%ZOSF("TEST") D:$T DPT^IVMPXFR S X=IVMX K IVMX 8 S X=DE(5),DIC=DIE 9 I ($T(AVAFC^VAFCDD01)'="") S VAFCF=".117;" D AVAFC^VAFCDD01(DA) 10 S X=DE(5),DIIX=2_U_DIFLD D AUDIT^DIET 65 S X=DE(1),DIIX=2_U_DIFLD D AUDIT^DIET 66 C1S S X="" G:DG(DQ)=X C1F1 K DB 67 S X=DG(DQ),DIC=DIE 68 I ($T(AVAFC^VAFCDD01)'="") S VAFCF=".313;" D AVAFC^VAFCDD01(DA) 69 S X=DG(DQ),DIC=DIE 70 D EVENT^IVMPLOG(DA) 71 I $D(DE(1))'[0!(^DD(DP,DIFLD,"AUDIT")'="e") S X=DG(DQ),DIIX=3_U_DIFLD D AUDIT^DIET 72 C1F1 Q 73 X1 S DFN=DA D EV^DGLOCK I $D(X) S 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)>9 X Q:'$D(X) I X'=L K:$L(X)>8!($L(X)<7)!'(X?.N) X 74 I $D(X),X'?.ANP K X 75 Q 76 ; 77 2 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 78 X2 W "." S JP=JP+1,DVBJ2=1 79 Q 80 3 S DQ=4 ;@22 81 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 82 X4 I $P(Z2,U,JP)'=2 S Y="@225" 83 Q 84 5 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 85 X5 W !,"Date of Birth cannot be edited with this option." 86 Q 87 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 88 X6 H 1 89 Q 90 7 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 91 X7 W "." S JP=JP+1,DVBJ2=1 92 Q 93 8 S DQ=9 ;@225 94 9 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 95 X9 I $P(Z2,U,JP)'=3 S Y="@23" 96 Q 97 10 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 98 X10 W !,"Sex cannot be edited with this option." 99 Q 100 11 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 101 X11 H 1 102 Q 103 12 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 104 X12 W "." S JP=JP+1,DVBJ2=1 105 Q 106 13 S DQ=14 ;@23 107 14 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=14 D X14 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 X14 I $P(Z2,U,JP)'=4 S Y="@24" 109 Q 110 15 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 111 X15 K Z1 I $D(DVBP(6)),+$P(DVBP(6),U) S Z1=$P(DVBP(6),U),Z1=$E(Z1,1,2)_" "_$E(Z1,3,4)_" "_$E(Z1,5,8) 112 Q 113 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 114 X16 I $D(DVBVET),$P(DVBVET,U,1)="B",+$P(DVBVET,U,12) S Z1=$P(DVBVET,U,12),Z1=$E(Z1,5,6)_" "_$E(Z1,7,8)_" "_$E(Z1,1,4) 115 Q 116 17 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=17 D X17 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 117 X17 I '$D(Z1) S Y="@24",JP=JP+1 118 Q 119 18 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=18 D X18 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 120 X18 I 'Z1 S Y="@24",JP=JP+1 121 Q 122 19 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=19 D X19 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 123 X19 I $D(^DPT(D0,.105)) W !!,"Patient is currently in-house." W !,"Discharge patient with a discharge type of DEATH." R !,?25,"<RET to continue>",DVBQ:DTIME K DVBQ S Y="@24",JP=JP+1 124 Q 125 20 D:$D(DG)>9 F^DIE17,DE S DQ=20,DW=".35;1",DV="DXa",DU="",DLB="DATE OF DEATH",DIFLD=.351 126 S DE(DW)="C20^DVBHCE20",DE(DW,"INDEX")=1 127 S X=Z1 128 S Y=X 129 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) 130 G RD 131 C20 G C20S:$D(DE(20))[0 K DB 132 D ^DVBHCE21 133 C20S S X="" G:DG(DQ)=X C20F1 K DB 134 D ^DVBHCE22 135 C20F1 N X,X1,X2 S DIXR=180 D C20X1(U) K X2 M X2=X D C20X1("O") K X1 M X1=X 136 D 137 . D FC^DGFCPROT(.DA,2,.351,"KILL",$H,$G(DUZ),.X,.X1,.X2,$G(XQY0)) Q 138 K X M X=X2 D 139 . D FC^DGFCPROT(.DA,2,.351,"SET",$H,$G(DUZ),.X,.X1,.X2,$G(XQY0)) Q 140 G C20F2 141 C20X1(DION) K X 142 S X(1)=$G(@DIEZTMP@("V",2,DIIENS,.351,DION),$P($G(^DPT(DA,.35)),U,1)) 143 S X=$G(X(1)) 144 Q 145 C20F2 S DIXR=685 D C20X2(U) K X2 M X2=X D C20X2("O") K X1 M X1=X 146 D 147 . D FC^DGFCPROT(.DA,2,.351,"KILL",$H,$G(DUZ),.X,.X1,.X2,$G(XQY0)) Q 148 K X M X=X2 D 149 . D FC^DGFCPROT(.DA,2,.351,"SET",$H,$G(DUZ),.X,.X1,.X2,$G(XQY0)) Q 150 G C20F3 151 C20X2(DION) K X 152 S X(1)=$G(@DIEZTMP@("V",2,DIIENS,.351,DION),$P($G(^DPT(DA,.35)),U,1)) 153 S X=$G(X(1)) 154 Q 155 C20F3 Q 156 X20 S %DT="PT" D ^%DT S X=Y K:Y<1 X I $D(X) D H^DGUTL K:X>DGTIME X K DGTIME,DGDATE I $D(X),X<$P(^DPT(DA,0),"^",3) K X 157 Q 158 ; 159 21 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=21 D X21 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 160 X21 W "." S JP=JP+1,DVBJ2=1 161 Q 162 22 S DQ=23 ;@24 163 23 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=23 D X23 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 164 X23 I $P(Z2,U,JP)'=5 S Y="@25" 165 Q 166 24 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=24 D X24 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 167 X24 K DVBSICK I $D(DVBP(6)) S DVBSICK=$P(DVBP(6),U,7) 168 Q 169 25 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=25 D X25 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 170 X25 I $D(DVBCI) S DVBSICK=DVBCI 171 Q 172 26 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=26 D X26 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 173 X26 I '$D(DVBSICK) S Y="@25",JP=JP+1 174 Q 175 27 D:$D(DG)>9 F^DIE17 G ^DVBHCE23 -
WorldVistAEHR/trunk/r/HINQ-DVB--DVBA--DVBE--DVBC/DVBHCE21.m
r613 r623 1 DVBHCE21 ; ;12/13/08 2 S X=DG(DQ),DIC=DIE 3 S A1B2TAG="PAT" D ^A1B2XFR 4 S X=DG(DQ),DIC=DIE 5 D EVENT^IVMPLOG(DA) 6 S X=DG(DQ),DIC=DIE 1 DVBHCE21 ; ;12/27/07 2 S X=DE(20),DIC=DIE 3 K DIV S DIV=X,D0=DA,DIV(0)=D0 S Y(1)=$S($D(^DPT(D0,0)):^(0),1:"") S X=$P(Y(1),U,10),X=X S DIU=X K Y X ^DD(2,.351,1,1,2.1) X ^DD(2,.351,1,1,2.4) 4 S X=DE(20),DIC=DIE 5 ; 6 S X=DE(20),DIC=DIE 7 D DKBULL^DGDEATH 8 S X=DE(20),DIC=DIE 9 K ^DPT("AEXP1",$E(X,1,30),DA) 10 S X=DE(20),DIC=DIE 11 ; 12 S X=DE(20),DIC=DIE 13 ; 14 S X=DE(20),DIC=DIE 15 S RCX=X,X="RCAMDTH" X ^%ZOSF("TEST") S X=RCX K RCX I D ERR^RCAMDTH 16 S X=DE(20),DIC=DIE 17 D KILL^DGDEPINA 18 S X=DE(20),DIC=DIE 19 D AUTOUPD^DGENA2(DA) 20 S X=DE(20),DIC=DIE 21 ; 22 S X=DE(20),DIC=DIE 23 I $$VERSION^XPDUTL("PSO")>6 D APSOD^PSOAUTOC(DA) 24 S X=DE(20),DIC=DIE 7 25 S IVMX=X,X="IVMPXFR" X ^%ZOSF("TEST") D:$T DPT^IVMPXFR S X=IVMX K IVMX 8 S X=DG(DQ),DIC=DIE 9 I ($T(AVAFC^VAFCDD01)'="") S VAFCF=".117;" D AVAFC^VAFCDD01(DA) 10 I $D(DE(5))'[0!(^DD(DP,DIFLD,"AUDIT")'="e") S X=DG(DQ),DIIX=3_U_DIFLD D AUDIT^DIET 26 S X=DE(20),DIC=DIE 27 I ($T(AVAFC^VAFCDD01)'="") S VAFCF=".351;" D AVAFC^VAFCDD01(DA) 28 S X=DE(20),DIC=DIE 29 D:($T(ADGRU^DGRUDD01)'="") ADGRU^DGRUDD01(DA) 30 S X=DE(20),DIIX=2_U_DIFLD D AUDIT^DIET -
WorldVistAEHR/trunk/r/HINQ-DVB--DVBA--DVBE--DVBC/DVBHCE22.m
r613 r623 1 DVBHCE22 ; ;12/13/08 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(^(.29)) S %Z=^(.29) S %=$P(%Z,U,12) S:%]"" DE(27)=% 5 I $D(^(.31)) S %Z=^(.31) S %=$P(%Z,U,3) S:%]"" DE(1)=% 6 I $D(^(.35)) S %Z=^(.35) S %=$P(%Z,U,1) S:%]"" DE(20)=% 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="DVBHCE22",DQ=1 54 1 D:$D(DG)>9 F^DIE17,DE S DQ=1,DW=".31;3",DV="FXOa",DU="",DLB="CLAIM NUMBER",DIFLD=.313 55 S DQ(1,2)="S Y(0)=Y S Y=$E(Y,1,10)" 56 S DE(DW)="C1^DVBHCE22" 57 S X=DVBCN 58 S Y=X 59 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) 60 G RD 61 C1 G C1S:$D(DE(1))[0 K DB 62 S X=DE(1),DIC=DIE 63 I ($T(AVAFC^VAFCDD01)'="") S VAFCF=".313;" D AVAFC^VAFCDD01(DA) 64 S X=DE(1),DIC=DIE 65 D EVENT^IVMPLOG(DA) 66 S X=DE(1),DIIX=2_U_DIFLD D AUDIT^DIET 67 C1S S X="" G:DG(DQ)=X C1F1 K DB 1 DVBHCE22 ; ;12/27/07 68 2 S X=DG(DQ),DIC=DIE 69 I ($T(AVAFC^VAFCDD01)'="") S VAFCF=".313;" D AVAFC^VAFCDD01(DA)3 K DIV S DIV=X,D0=DA,DIV(0)=D0 S Y(1)=$S($D(^DPT(D0,0)):^(0),1:"") S X=$P(Y(1),U,10),X=X S DIU=X K Y X ^DD(2,.351,1,1,1.1) X ^DD(2,.351,1,1,1.4) 70 4 S X=DG(DQ),DIC=DIE 71 D EVENT^IVMPLOG(DA) 72 I $D(DE(1))'[0!(^DD(DP,DIFLD,"AUDIT")'="e") S X=DG(DQ),DIIX=3_U_DIFLD D AUDIT^DIET 73 C1F1 Q 74 X1 S DFN=DA D EV^DGLOCK I $D(X) S 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)>9 X Q:'$D(X) I X'=L K:$L(X)>8!($L(X)<7)!'(X?.N) X 75 I $D(X),X'?.ANP K X 76 Q 77 ; 78 2 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 79 X2 W "." S JP=JP+1,DVBJ2=1 80 Q 81 3 S DQ=4 ;@22 82 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 83 X4 I $P(Z2,U,JP)'=2 S Y="@225" 84 Q 85 5 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 86 X5 W !,"Date of Birth cannot be edited with this option." 87 Q 88 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 89 X6 H 1 90 Q 91 7 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 92 X7 W "." S JP=JP+1,DVBJ2=1 93 Q 94 8 S DQ=9 ;@225 95 9 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 96 X9 I $P(Z2,U,JP)'=3 S Y="@23" 97 Q 98 10 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 99 X10 W !,"Sex cannot be edited with this option." 100 Q 101 11 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 102 X11 H 1 103 Q 104 12 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 105 X12 W "." S JP=JP+1,DVBJ2=1 106 Q 107 13 S DQ=14 ;@23 108 14 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=14 D X14 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 109 X14 I $P(Z2,U,JP)'=4 S Y="@24" 110 Q 111 15 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 112 X15 K Z1 I $D(DVBP(6)),+$P(DVBP(6),U) S Z1=$P(DVBP(6),U),Z1=$E(Z1,1,2)_" "_$E(Z1,3,4)_" "_$E(Z1,5,8) 113 Q 114 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 115 X16 I $D(DVBVET),$P(DVBVET,U,1)="B",+$P(DVBVET,U,12) S Z1=$P(DVBVET,U,12),Z1=$E(Z1,5,6)_" "_$E(Z1,7,8)_" "_$E(Z1,1,4) 116 Q 117 17 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=17 D X17 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 118 X17 I '$D(Z1) S Y="@24",JP=JP+1 119 Q 120 18 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=18 D X18 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 121 X18 I 'Z1 S Y="@24",JP=JP+1 122 Q 123 19 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=19 D X19 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 124 X19 I $D(^DPT(D0,.105)) W !!,"Patient is currently in-house." W !,"Discharge patient with a discharge type of DEATH." R !,?25,"<RET to continue>",DVBQ:DTIME K DVBQ S Y="@24",JP=JP+1 125 Q 126 20 D:$D(DG)>9 F^DIE17,DE S DQ=20,DW=".35;1",DV="DXa",DU="",DLB="DATE OF DEATH",DIFLD=.351 127 S DE(DW)="C20^DVBHCE22",DE(DW,"INDEX")=1 128 S X=Z1 129 S Y=X 130 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) 131 G RD 132 C20 G C20S:$D(DE(20))[0 K DB 133 S X=DE(20),DIC=DIE 134 K DIV S DIV=X,D0=DA,DIV(0)=D0 S Y(1)=$S($D(^DPT(D0,0)):^(0),1:"") S X=$P(Y(1),U,10),X=X S DIU=X K Y X ^DD(2,.351,1,1,2.1) X ^DD(2,.351,1,1,2.4) 135 S X=DE(20),DIC=DIE 136 ; 137 S X=DE(20),DIC=DIE 138 D DKBULL^DGDEATH 139 S X=DE(20),DIC=DIE 140 K ^DPT("AEXP1",$E(X,1,30),DA) 141 S X=DE(20),DIC=DIE 142 ; 143 S X=DE(20),DIC=DIE 144 ; 145 S X=DE(20),DIC=DIE 146 S RCX=X,X="RCAMDTH" X ^%ZOSF("TEST") S X=RCX K RCX I D ERR^RCAMDTH 147 S X=DE(20),DIC=DIE 148 D KILL^DGDEPINA 149 S X=DE(20),DIC=DIE 5 K DIV S DIV=X,D0=DA,DIV(0)=D0 S Y(1)=$S($D(^DPT(D0,.35)):^(.35),1:"") S X=$P(Y(1),U,2),X=X S DIU=X K Y X ^DD(2,.351,1,2,1.1) X ^DD(2,.351,1,2,1.4) 6 S X=DG(DQ),DIC=DIE 7 D DSBULL^DGDEATH 8 S X=DG(DQ),DIC=DIE 9 S ^DPT("AEXP1",$E(X,1,30),DA)="" 10 S X=DG(DQ),DIC=DIE 11 D DEATH^DGOERNOT 12 S X=DG(DQ),DIC=DIE 13 S XX=X,X="PSJADT" X ^%ZOSF("TEST") S X=XX K XX I D END^PSJADT 14 S X=DG(DQ),DIC=DIE 15 S RCX=X,X="RCAMDTH" X ^%ZOSF("TEST") S X=RCX K RCX I D SET^RCAMDTH 16 S X=DG(DQ),DIC=DIE 17 D SET^DGDEPINA 18 S X=DG(DQ),DIC=DIE 150 19 D AUTOUPD^DGENA2(DA) 151 S X=D E(20),DIC=DIE152 ;153 S X=D E(20),DIC=DIE154 I $$VERSION^XPDUTL("PSO")>6 D APSOD^PSO AUTOC(DA)155 S X=D E(20),DIC=DIE20 S X=DG(DQ),DIC=DIE 21 D START^DGMTDELS(DA) 22 S X=DG(DQ),DIC=DIE 23 I $$VERSION^XPDUTL("PSO")>6 D APSOD^PSOCAN3(DA) 24 S X=DG(DQ),DIC=DIE 156 25 S IVMX=X,X="IVMPXFR" X ^%ZOSF("TEST") D:$T DPT^IVMPXFR S X=IVMX K IVMX 157 S X=D E(20),DIC=DIE26 S X=DG(DQ),DIC=DIE 158 27 I ($T(AVAFC^VAFCDD01)'="") S VAFCF=".351;" D AVAFC^VAFCDD01(DA) 159 S X=D E(20),DIC=DIE28 S X=DG(DQ),DIC=DIE 160 29 D:($T(ADGRU^DGRUDD01)'="") ADGRU^DGRUDD01(DA) 161 S X=DE(20),DIIX=2_U_DIFLD D AUDIT^DIET 162 C20S S X="" G:DG(DQ)=X C20F1 K DB 163 D ^DVBHCE23 164 C20F1 N X,X1,X2 S DIXR=180 D C20X1(U) K X2 M X2=X D C20X1("O") K X1 M X1=X 165 D 166 . D FC^DGFCPROT(.DA,2,.351,"KILL",$H,$G(DUZ),.X,.X1,.X2,$G(XQY0)) Q 167 K X M X=X2 D 168 . D FC^DGFCPROT(.DA,2,.351,"SET",$H,$G(DUZ),.X,.X1,.X2,$G(XQY0)) Q 169 G C20F2 170 C20X1(DION) K X 171 S X(1)=$G(@DIEZTMP@("V",2,DIIENS,.351,DION),$P($G(^DPT(DA,.35)),U,1)) 172 S X=$G(X(1)) 173 Q 174 C20F2 S DIXR=685 D C20X2(U) K X2 M X2=X D C20X2("O") K X1 M X1=X 175 D 176 . D FC^DGFCPROT(.DA,2,.351,"KILL",$H,$G(DUZ),.X,.X1,.X2,$G(XQY0)) Q 177 K X M X=X2 D 178 . D FC^DGFCPROT(.DA,2,.351,"SET",$H,$G(DUZ),.X,.X1,.X2,$G(XQY0)) Q 179 G C20F3 180 C20X2(DION) K X 181 S X(1)=$G(@DIEZTMP@("V",2,DIIENS,.351,DION),$P($G(^DPT(DA,.35)),U,1)) 182 S X=$G(X(1)) 183 Q 184 C20F3 Q 185 X20 S %DT="PT" D ^%DT S X=Y K:Y<1 X I $D(X) D H^DGUTL K:X>DGTIME X K DGTIME,DGDATE I $D(X),X<$P(^DPT(DA,0),"^",3) K X 186 Q 187 ; 188 21 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=21 D X21 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 189 X21 W "." S JP=JP+1,DVBJ2=1 190 Q 191 22 S DQ=23 ;@24 192 23 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=23 D X23 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 193 X23 I $P(Z2,U,JP)'=5 S Y="@25" 194 Q 195 24 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=24 D X24 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 196 X24 K DVBSICK I $D(DVBP(6)) S DVBSICK=$P(DVBP(6),U,7) 197 Q 198 25 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=25 D X25 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 199 X25 I $D(DVBCI) S DVBSICK=DVBCI 200 Q 201 26 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=26 D X26 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 202 X26 I '$D(DVBSICK) S Y="@25",JP=JP+1 203 Q 204 27 D:$D(DG)>9 F^DIE17,DE S DQ=27,DW=".29;12",DV="S",DU="",DLB="RATED INCOMPETENT?",DIFLD=.293 205 S DE(DW)="C27^DVBHCE22" 206 S DU="0:NO;1:YES;" 207 S X=$S((DVBSICK="I")!(DVBSICK="Y"):1,1:0) 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 211 C27 G C27S:$D(DE(27))[0 K DB 212 S X=DE(27),DIC=DIE 213 D EVENT^IVMPLOG(DA) 214 C27S S X="" G:DG(DQ)=X C27F1 K DB 215 D ^DVBHCE24 216 C27F1 Q 217 X27 Q 218 28 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=28 D X28 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 219 X28 W "." S JP=JP+1,DVBJ2=1 K DVBSICK 220 Q 221 29 S DQ=30 ;@25 222 30 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=30 D X30 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 223 X30 I $P(Z2,U,JP)'=6 S Y="@26" 224 Q 225 31 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=31 D X31 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 226 X31 I '$D(DVBPOW),'$D(DVBPOWD) S Y="@26",JP=JP+1 227 Q 228 32 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=32 D X32 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 229 X32 I '$D(DVBPOW),$D(DVBPOWD),+DVBPOWD W !!,*7,?17,DVBON,"POW Indicator Discrepancy! <RET>",DVBOFF X DVBLIT1 R DVBZ:DTIME K DVBZ S JP=JP+1,Y="@26" 230 Q 231 33 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=33 D X33 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 232 X33 I '$D(DVBPOW),'+DVBPOWD S Y="@26",JP=JP+1 233 Q 234 34 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=34 D X34 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 235 X34 I '$D(DVBPOWD),$D(DVBPOW),DVBPOW>0 W !!,*7,?17,DVBON,"POW Indicator Discrepancy! <RET>",DVBOFF X DVBLIT1 R DVBZ:DTIME K DVBZ S JP=JP+1,Y="@26" 236 Q 237 35 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=35 D X35 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 238 X35 I $D(DVBPOWD),$D(DVBPOW),DVBPOWD=0,DVBPOW>0 W !!,*7,?17,DVBON,"POW Indicator Discrepancy! <RET>",DVBOFF X DVBLIT1 R DVBZ:DTIME K DVBZ S JP=JP+1,Y="@26" 239 Q 240 36 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=36 D X36 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 241 X36 I $D(DVBPOWD),$D(DVBPOW),+DVBPOW<1,+DVBPOWD W !!,*7,?17,DVBON,"POW Indicator Discrepancy! <RET>",DVBOFF X DVBLIT1 R DVBZ:DTIME K DVBZ S JP=JP+1,Y="@26" 242 Q 243 37 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=37 D X37 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 244 X37 D POW^DVBHUTIL 245 Q 246 38 D:$D(DG)>9 F^DIE17 G ^DVBHCE25 30 I $D(DE(20))'[0!(^DD(DP,DIFLD,"AUDIT")'="e") S X=DG(DQ),DIIX=3_U_DIFLD D AUDIT^DIET -
WorldVistAEHR/trunk/r/HINQ-DVB--DVBA--DVBE--DVBC/DVBHCE23.m
r613 r623 1 DVBHCE23 ; ;12/13/08 1 DVBHCE23 ; ;12/27/07 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(^(.29)) S %Z=^(.29) S %=$P(%Z,U,12) S:%]"" DE(1)=% 5 I $D(^(.31)) S %Z=^(.31) S %=$P(%Z,U,4) S:%]"" DE(19)=% 6 I $D(^(.52)) S %Z=^(.52) S %=$P(%Z,U,5) 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="DVBHCE23",DQ=1 54 1 D:$D(DG)>9 F^DIE17,DE S DQ=1,DW=".29;12",DV="S",DU="",DLB="RATED INCOMPETENT?",DIFLD=.293 55 S DE(DW)="C1^DVBHCE23" 56 S DU="0:NO;1:YES;" 57 S X=$S((DVBSICK="I")!(DVBSICK="Y"):1,1:0) 58 S Y=X 59 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) 60 G RD 61 C1 G C1S:$D(DE(1))[0 K DB 62 S X=DE(1),DIC=DIE 63 D EVENT^IVMPLOG(DA) 64 C1S S X="" G:DG(DQ)=X C1F1 K DB 2 65 S X=DG(DQ),DIC=DIE 3 K DIV S DIV=X,D0=DA,DIV(0)=D0 S Y(1)=$S($D(^DPT(D0,0)):^(0),1:"") S X=$P(Y(1),U,10),X=X S DIU=X K Y X ^DD(2,.351,1,1,1.1) X ^DD(2,.351,1,1,1.4) 66 D EVENT^IVMPLOG(DA) 67 C1F1 Q 68 X1 Q 69 2 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 70 X2 W "." S JP=JP+1,DVBJ2=1 K DVBSICK 71 Q 72 3 S DQ=4 ;@25 73 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 74 X4 I $P(Z2,U,JP)'=6 S Y="@26" 75 Q 76 5 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 77 X5 I '$D(DVBPOW),'$D(DVBPOWD) S Y="@26",JP=JP+1 78 Q 79 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 80 X6 I '$D(DVBPOW),$D(DVBPOWD),+DVBPOWD W !!,*7,?17,DVBON,"POW Indicator Discrepancy! <RET>",DVBOFF X DVBLIT1 R DVBZ:DTIME K DVBZ S JP=JP+1,Y="@26" 81 Q 82 7 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 83 X7 I '$D(DVBPOW),'+DVBPOWD S Y="@26",JP=JP+1 84 Q 85 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 86 X8 I '$D(DVBPOWD),$D(DVBPOW),DVBPOW>0 W !!,*7,?17,DVBON,"POW Indicator Discrepancy! <RET>",DVBOFF X DVBLIT1 R DVBZ:DTIME K DVBZ S JP=JP+1,Y="@26" 87 Q 88 9 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 89 X9 I $D(DVBPOWD),$D(DVBPOW),DVBPOWD=0,DVBPOW>0 W !!,*7,?17,DVBON,"POW Indicator Discrepancy! <RET>",DVBOFF X DVBLIT1 R DVBZ:DTIME K DVBZ S JP=JP+1,Y="@26" 90 Q 91 10 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 92 X10 I $D(DVBPOWD),$D(DVBPOW),+DVBPOW<1,+DVBPOWD W !!,*7,?17,DVBON,"POW Indicator Discrepancy! <RET>",DVBOFF X DVBLIT1 R DVBZ:DTIME K DVBZ S JP=JP+1,Y="@26" 93 Q 94 11 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 95 X11 D POW^DVBHUTIL 96 Q 97 12 D:$D(DG)>9 F^DIE17,DE S DQ=12,DW=".52;5",DV="RSX",DU="",DLB="POW STATUS INDICATED?",DIFLD=.525 98 S DE(DW)="C12^DVBHCE23",DE(DW,"INDEX")=1 99 S DU="Y:YES;N:NO;U:UNKNOWN;" 100 S X=DVBPOW1 101 S Y=X 102 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) 103 G RD 104 C12 G C12S:$D(DE(12))[0 K DB 105 S X=DE(12),DIC=DIE 106 ; 107 S X=DE(12),DIC=DIE 108 ; 109 S X=DE(12),DIC=DIE 110 ; 111 S X=DE(12),DIC=DIE 112 D AUTOUPD^DGENA2(DA) 113 S X=DE(12),DIC=DIE 114 X "S DFN=DA D EN^DGMTR K DGREQF" 115 S X=DE(12),DIC=DIE 116 D EVENT^IVMPLOG(DA) 117 C12S S X="" G:DG(DQ)=X C12F1 K DB 4 118 S X=DG(DQ),DIC=DIE 5 K DIV S DIV=X,D0=DA,DIV(0)=D0 S Y(1)=$S($D(^DPT(D0,.35)):^(.35),1:"") S X=$P(Y(1),U,2),X=X S DIU=X K Y X ^DD(2,.351,1,2,1.1) X ^DD(2,.351,1,2,1.4)119 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) 6 120 S X=DG(DQ),DIC=DIE 7 D DSBULL^DGDEATH121 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) 8 122 S X=DG(DQ),DIC=DIE 9 S ^DPT("AEXP1",$E(X,1,30),DA)="" 10 S X=DG(DQ),DIC=DIE 11 D DEATH^DGOERNOT 12 S X=DG(DQ),DIC=DIE 13 S XX=X,X="PSJADT" X ^%ZOSF("TEST") S X=XX K XX I D END^PSJADT 14 S X=DG(DQ),DIC=DIE 15 S RCX=X,X="RCAMDTH" X ^%ZOSF("TEST") S X=RCX K RCX I D SET^RCAMDTH 16 S X=DG(DQ),DIC=DIE 17 D SET^DGDEPINA 123 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) 18 124 S X=DG(DQ),DIC=DIE 19 125 D AUTOUPD^DGENA2(DA) 20 126 S X=DG(DQ),DIC=DIE 21 D START^DGMTDELS(DA)127 X "S DFN=DA D EN^DGMTR K DGREQF" 22 128 S X=DG(DQ),DIC=DIE 23 I $$VERSION^XPDUTL("PSO")>6 D APSOD^PSOCAN3(DA) 24 S X=DG(DQ),DIC=DIE 25 S IVMX=X,X="IVMPXFR" X ^%ZOSF("TEST") D:$T DPT^IVMPXFR S X=IVMX K IVMX 26 S X=DG(DQ),DIC=DIE 27 I ($T(AVAFC^VAFCDD01)'="") S VAFCF=".351;" D AVAFC^VAFCDD01(DA) 28 S X=DG(DQ),DIC=DIE 29 D:($T(ADGRU^DGRUDD01)'="") ADGRU^DGRUDD01(DA) 30 I $D(DE(20))'[0!(^DD(DP,DIFLD,"AUDIT")'="e") S X=DG(DQ),DIIX=3_U_DIFLD D AUDIT^DIET 129 D EVENT^IVMPLOG(DA) 130 C12F1 N X,X1,X2 S DIXR=646 D C12X1(U) K X2 M X2=X D C12X1("O") K X1 M X1=X 131 D 132 . D FC^DGFCPROT(.DA,2,.525,"KILL",$H,$G(DUZ),.X,.X1,.X2,$G(XQY0)) Q 133 K X M X=X2 D 134 . D FC^DGFCPROT(.DA,2,.525,"SET",$H,$G(DUZ),.X,.X1,.X2,$G(XQY0)) Q 135 G C12F2 136 C12X1(DION) K X 137 S X(1)=$G(@DIEZTMP@("V",2,DIIENS,.525,DION),$P($G(^DPT(DA,.52)),U,5)) 138 S X=$G(X(1)) 139 Q 140 C12F2 Q 141 X12 S DFN=DA D SV^DGLOCK 142 Q 143 ; 144 13 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=13 D X13 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 145 X13 K DVBPOW1 W "." S JP=JP+1,DVBJ2=1 146 Q 147 14 S DQ=15 ;@26 148 15 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 149 X15 I $P(Z2,U,JP)'=7 S Y="@27" 150 Q 151 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 152 X16 I '$D(DVBFL) S Y="@27",JP=JP+1 153 Q 154 17 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=17 D X17 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 155 X17 I DVBFL']"" S Y="@27",JP=JP+1 156 Q 157 18 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=18 D X18 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 158 X18 I DVBFL'?3N1" - "1U.E S Y="@27",JP=JP+1 159 Q 160 19 D:$D(DG)>9 F^DIE17,DE S DQ=19,DW=".31;4",DV="*P4'X",DU="",DLB="CLAIM FOLDER LOCATION",DIFLD=.314 161 S DE(DW)="C19^DVBHCE23" 162 S DU="DIC(4," 163 S X=+DVBFL 164 S Y=X 165 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) 166 G RD 167 C19 G C19S:$D(DE(19))[0 K DB 168 D ^DVBHCE24 169 C19S S X="" G:DG(DQ)=X C19F1 K DB 170 D ^DVBHCE25 171 C19F1 Q 172 X19 S DIC("S")="I $$CFLTF^DGREGDD(Y)" D ^DIC K DIC S DIC=DIE,X=+Y K:Y<0 X 173 Q 174 ; 175 20 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=20 D X20 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 176 X20 W "." S JP=JP+1,DVBJ2=1 177 Q 178 21 S DQ=22 ;@27 179 22 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=22 D X22 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 180 X22 I $P(Z2,U,JP)'=8 S Y="@50" 181 Q 182 23 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=23 D X23 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 183 X23 I '$D(DVBEI) S Y="@50",JP=JP+1 184 Q 185 24 D:$D(DG)>9 F^DIE17 G ^DVBHCE26 -
WorldVistAEHR/trunk/r/HINQ-DVB--DVBA--DVBE--DVBC/DVBHCE24.m
r613 r623 1 DVBHCE24 ; ;12/ 13/082 S X=D G(DQ),DIC=DIE3 D EVENT^IVMPLOG(DA)1 DVBHCE24 ; ;12/27/07 2 S X=DE(19),DIC=DIE 3 D KILL^DGREGDD(DA) -
WorldVistAEHR/trunk/r/HINQ-DVB--DVBA--DVBE--DVBC/DVBHCE25.m
r613 r623 1 DVBHCE25 ; ;12/13/08 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(^(.3)) S %Z=^(.3) S %=$P(%Z,U,5) S:%]"" DE(13)=% 5 I $D(^(.31)) S %Z=^(.31) S %=$P(%Z,U,4) S:%]"" DE(8)=% 6 I $D(^(.32)) S %Z=^(.32) S %=$P(%Z,U,2) S:%]"" DE(20)=% 7 I $D(^(.321)) S %Z=^(.321) S %=$P(%Z,U,1) S:%]"" DE(26)=% 8 I $D(^(.52)) S %Z=^(.52) S %=$P(%Z,U,5) S:%]"" DE(1)=% 9 K %Z Q 10 ; 11 W W !?DL+DL-2,DLB_": " 12 Q 13 O D W W Y W:$X>45 !?9 14 I $L(Y)>19,'DV,DV'["I",(DV["F"!(DV["K")) G RW^DIR2 15 W:Y]"" "// " I 'DV,DV["I",$D(DE(DQ))#2 S X="" W " (No Editing)" Q 16 TR R X:DTIME E S (DTOUT,X)=U W $C(7) 17 Q 18 A K DQ(DQ) S DQ=DQ+1 19 B G @DQ 20 RE G PR:$D(DE(DQ)) D W,TR 21 N I X="" G NKEY:$D(^DD("KEY","F",DP,DIFLD)),A:DV'["R",X:'DV,X:D'>0,A 22 RD G QS:X?."?" I X["^" D D G ^DIE17 23 I X="@" D D G Z^DIE2 24 I X=" ",DV["d",DV'["P",$D(^DISV(DUZ,"DIE",DLB)) S X=^(DLB) I DV'["D",DV'["S" W " "_X 25 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 26 K DDER G X 27 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 28 G V:DV'["N" D D I $L($P(X,"."))>24 K X G Z 29 I $P(DQ(DQ),U,5)'["$",X?.1"-".N.1".".N,$P(DQ(DQ),U,5,99)["+X'=X" S X=+X 30 V D @("X"_DQ) K YS 31 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 32 X W:'$D(ZTQUEUED) $C(7),"??" I $D(DB(DQ)) G Z^DIE17 33 S X="?BAD" 34 QS S DZ=X D D,QQ^DIEQ G B 35 D S D=DIFLD,DQ(DQ)=DLB_U_DV_U_DU_U_DW_U_$P($T(@("X"_DQ))," ",2,99) Q 36 Y I '$D(DE(DQ)) D O G RD:"@"'[X,A:DV'["R"&(X="@"),X:X="@" S X=Y G N 37 PR S DG=DV,Y=DE(DQ),X=DU I $D(DQ(DQ,2)) X DQ(DQ,2) G RP 38 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 39 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 40 X:DG["D" ^DD("DD") I DG["S" S %=$P($P(";"_X,";"_Y_":",2),";") S:%]"" Y=% 41 RP D O I X="" S X=DE(DQ) G A:'DV,A:DC<2,N^DIE17 42 I I DV'["I",DV'["#" G RD 43 D E^DIE0 G RD:$D(X),PR 44 Q 45 SET N DIR S DIR(0)="SV"_$E("o",$D(DB(DQ)))_U_DU,DIR("V")=1 46 I $D(DB(DQ)),'$D(DIQUIET) N DIQUIET S DIQUIET=1 47 D ^DIR I 'DDER S %=Y(0),X=Y 48 Q 49 SAVEVALS S @DIEZTMP@("V",DP,DIIENS,DIFLD,"O")=$G(DE(DQ)) S:$D(^("F"))[0 ^("F")=$G(DE(DQ)) 50 I $D(DE(DW,"4/")) S @DIEZTMP@("V",DP,DIIENS,DIFLD,"4/")="" 51 E K @DIEZTMP@("V",DP,DIIENS,DIFLD,"4/") 52 Q 53 NKEY W:'$D(ZTQUEUED) "?? Required key field" S X="?BAD" G QS 54 KEYCHK() Q:$G(DE(DW,"KEY"))="" 1 Q @DE(DW,"KEY") 55 BEGIN S DNM="DVBHCE25",DQ=1 56 1 D:$D(DG)>9 F^DIE17,DE S DQ=1,DW=".52;5",DV="RSX",DU="",DLB="POW STATUS INDICATED?",DIFLD=.525 57 S DE(DW)="C1^DVBHCE25",DE(DW,"INDEX")=1 58 S DU="Y:YES;N:NO;U:UNKNOWN;" 59 S X=DVBPOW1 60 S Y=X 61 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) 62 G RD 63 C1 G C1S:$D(DE(1))[0 K DB 64 S X=DE(1),DIC=DIE 65 ; 66 S X=DE(1),DIC=DIE 67 ; 68 S X=DE(1),DIC=DIE 69 ; 70 S X=DE(1),DIC=DIE 71 D AUTOUPD^DGENA2(DA) 72 S X=DE(1),DIC=DIE 73 X "S DFN=DA D EN^DGMTR K DGREQF" 74 S X=DE(1),DIC=DIE 75 D EVENT^IVMPLOG(DA) 76 C1S S X="" G:DG(DQ)=X C1F1 K DB 77 S X=DG(DQ),DIC=DIE 78 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) 79 S X=DG(DQ),DIC=DIE 80 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) 81 S X=DG(DQ),DIC=DIE 82 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) 83 S X=DG(DQ),DIC=DIE 84 D AUTOUPD^DGENA2(DA) 85 S X=DG(DQ),DIC=DIE 86 X "S DFN=DA D EN^DGMTR K DGREQF" 87 S X=DG(DQ),DIC=DIE 88 D EVENT^IVMPLOG(DA) 89 C1F1 N X,X1,X2 S DIXR=646 D C1X1(U) K X2 M X2=X D C1X1("O") K X1 M X1=X 90 D 91 . D FC^DGFCPROT(.DA,2,.525,"KILL",$H,$G(DUZ),.X,.X1,.X2,$G(XQY0)) Q 92 K X M X=X2 D 93 . D FC^DGFCPROT(.DA,2,.525,"SET",$H,$G(DUZ),.X,.X1,.X2,$G(XQY0)) Q 94 G C1F2 95 C1X1(DION) K X 96 S X(1)=$G(@DIEZTMP@("V",2,DIIENS,.525,DION),$P($G(^DPT(DA,.52)),U,5)) 97 S X=$G(X(1)) 98 Q 99 C1F2 Q 100 X1 S DFN=DA D SV^DGLOCK 101 Q 102 ; 103 2 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 104 X2 K DVBPOW1 W "." S JP=JP+1,DVBJ2=1 105 Q 106 3 S DQ=4 ;@26 107 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 108 X4 I $P(Z2,U,JP)'=7 S Y="@27" 109 Q 110 5 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 111 X5 I '$D(DVBFL) S Y="@27",JP=JP+1 112 Q 113 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 114 X6 I DVBFL']"" S Y="@27",JP=JP+1 115 Q 116 7 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 117 X7 I DVBFL'?3N1" - "1U.E S Y="@27",JP=JP+1 118 Q 119 8 D:$D(DG)>9 F^DIE17,DE S DQ=8,DW=".31;4",DV="*P4'X",DU="",DLB="CLAIM FOLDER LOCATION",DIFLD=.314 120 S DE(DW)="C8^DVBHCE25" 121 S DU="DIC(4," 122 S X=+DVBFL 123 S Y=X 124 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) 125 G RD 126 C8 G C8S:$D(DE(8))[0 K DB 127 S X=DE(8),DIC=DIE 128 D KILL^DGREGDD(DA) 129 C8S S X="" G:DG(DQ)=X C8F1 K DB 1 DVBHCE25 ; ;12/27/07 130 2 S X=DG(DQ),DIC=DIE 131 3 D SET^DGREGDD(DA,X) 132 C8F1 Q133 X8 S DIC("S")="I $$CFLTF^DGREGDD(Y)" D ^DIC K DIC S DIC=DIE,X=+Y K:Y<0 X134 Q135 ;136 9 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^DIE17137 X9 W "." S JP=JP+1,DVBJ2=1138 Q139 10 S DQ=11 ;@27140 11 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^DIE17141 X11 I $P(Z2,U,JP)'=8 S Y="@50"142 Q143 12 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^DIE17144 X12 I '$D(DVBEI) S Y="@50",JP=JP+1145 Q146 13 D:$D(DG)>9 F^DIE17,DE S DQ=13,DW=".3;5",DV="S",DU="",DLB="UNEMPLOYABLE",DIFLD=.305147 S DE(DW)="C13^DVBHCE25"148 S DU="Y:YES;N:NO;"149 S X=$S(DVBEI="Y":"Y",1:"N")150 S Y=X151 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)152 G RD153 C13 G C13S:$D(DE(13))[0 K DB154 S X=DE(13),DIC=DIE155 D AUTOUPD^DGENA2(DA)156 S X=DE(13),DIC=DIE157 S DFN=DA D EN^DGMTCOR K DGMTCOR158 C13S S X="" G:DG(DQ)=X C13F1 K DB159 S X=DG(DQ),DIC=DIE160 D AUTOUPD^DGENA2(DA)161 S X=DG(DQ),DIC=DIE162 S DFN=DA D EN^DGMTCOR K DGMTCOR163 C13F1 Q164 X13 Q165 14 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=14 D X14 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17166 X14 W "." S JP=JP+1,DVBJ2=1167 Q168 15 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^DIE17169 X15 S Y="@50"170 Q171 16 S DQ=17 ;@40172 17 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=17 D X17 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17173 X17 I $P(Z2,U,JP)'=1 S Y="@42"174 Q175 18 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=18 D X18 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17176 X18 I '$D(DVBP(6)) S Y="@42",JP=JP+1177 Q178 19 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=19 D X19 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17179 X19 I $S($P(DVBP(6),U,8)'="Y":1,'$D(^DPT(DFN,.32)):1,+$P(^(0),U,2):1,1:0) S Y="@42",JP=JP+1180 Q181 20 D:$D(DG)>9 F^DIE17,DE S DQ=20,DW=".32;2",DV="DX",DU="",DLB="SERVICE VERIFICATION DATE",DIFLD=.322182 S X="T"183 S Y=X184 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)185 G RD186 X20 S %DT="",%DT(0)=-DT D ^%DT K %DT S X=Y K:Y<1 X I $D(X) D EK^DGLOCK187 Q188 ;189 21 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=21 D X21 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17190 X21 W "." S JP=JP+1,DVBJ2=1191 Q192 22 S DQ=23 ;@42193 23 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=23 D X23 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17194 X23 I $P(Z2,U,JP)'=2 S Y="@45"195 Q196 24 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=24 D X24 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17197 X24 I '$D(DVBP(6)) S Y="@45",JP=JP+1198 Q199 25 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=25 D X25 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17200 X25 I $P(DVBP(6),U,4)[" " S Y="@45",JP=JP+1201 Q202 26 S DW=".321;1",DV="RSX",DU="",DLB="VIETNAM SERVICE INDICATED?",DIFLD=.32101203 S DE(DW)="C26^DVBHCE25"204 S DU="Y:YES;N:NO;U:UNKNOWN;"205 S X=$P(DVBP(6),U,4)206 S Y=X207 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)208 G RD209 C26 G C26S:$D(DE(26))[0 K DB210 S X=DE(26),DIC=DIE211 ;212 S X=DE(26),DIC=DIE213 ;214 S X=DE(26),DIC=DIE215 D EVENT^IVMPLOG(DA)216 C26S S X="" G:DG(DQ)=X C26F1 K DB217 D ^DVBHCE26218 C26F1 Q219 X26 S DFN=DA D SV^DGLOCK220 Q221 ;222 27 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=27 D X27 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17223 X27 W "." S JP=JP+1,DVBJ2=1224 Q225 28 S DQ=29 ;@45226 29 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=29 D X29 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17227 X29 I $P(Z2,U,JP)'=3!('$D(DVBDX(1))) S Y="@50"228 Q229 30 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=30 D X30 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17230 X30 S:'$D(DVBFL) DVBFL="UNKNOWN"231 Q232 31 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=31 D X31 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17233 X31 I $D(DVBCAP),DVBCAP["No C&P",$P(DVBBIR,U,5)'="Y" D CHK^DVBHUTIL234 Q235 32 S DQ=33 ;@47236 33 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=33 D X33 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17237 X33 S DVB4=$S($D(^DPT(DFN,.3))>0:$P(^(.3),U),1:0),DVB5=$S($D(^DPT(DFN,.36))>0:$P(^(.36),U),1:0),DVB6=$S($D(^DPT(DFN,"VET"))>0:^("VET"),1:0),DVB7=$S($D(^DPT(DFN,"TYPE"))>0:^("TYPE"),1:0)238 Q239 34 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=34 D X34 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17240 X34 S DVB8=$O(^DIC(8,"B","SERVICE CONNECTED 50% to 100%",0)),DVB9=$O(^DIC(8,"B","SC LESS THAN 50%",0))241 Q242 35 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=35 D X35 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17243 X35 I DVBDXNO I ((DVB8'=DVB5&(DVB9'=DVB5))!(DVB4'="Y")!(DVB6'="Y")!(DVB7'=1)) S Y="@70"244 Q245 36 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=36 D X36 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17246 X36 W ! K ^DPT(DFN,.372),JP4,JP6 S ^DPT(DFN,.372,0)="^2.04P^^0",JP=0247 Q248 37 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=37 D X37 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17249 X37 S $P(^DPT(DFN,.3),U,2)="",$P(^DPT(DFN,.3),U,14)=""250 Q251 38 D:$D(DG)>9 F^DIE17 G ^DVBHCE27 -
WorldVistAEHR/trunk/r/HINQ-DVB--DVBA--DVBE--DVBC/DVBHCE26.m
r613 r623 1 DVBHCE26 ; ;12/13/08 1 DVBHCE26 ; ;12/27/07 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(^(.3)) S %Z=^(.3) S %=$P(%Z,U,2) S:%]"" DE(26)=% S %=$P(%Z,U,5) S:%]"" DE(1)=% 5 I $D(^(.32)) S %Z=^(.32) S %=$P(%Z,U,2) S:%]"" DE(8)=% 6 I $D(^(.321)) S %Z=^(.321) S %=$P(%Z,U,1) S:%]"" DE(14)=% 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="DVBHCE26",DQ=1 54 1 D:$D(DG)>9 F^DIE17,DE S DQ=1,DW=".3;5",DV="S",DU="",DLB="UNEMPLOYABLE",DIFLD=.305 55 S DE(DW)="C1^DVBHCE26" 56 S DU="Y:YES;N:NO;" 57 S X=$S(DVBEI="Y":"Y",1:"N") 58 S Y=X 59 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) 60 G RD 61 C1 G C1S:$D(DE(1))[0 K DB 62 S X=DE(1),DIC=DIE 63 D AUTOUPD^DGENA2(DA) 64 S X=DE(1),DIC=DIE 65 S DFN=DA D EN^DGMTCOR K DGMTCOR 66 C1S S X="" G:DG(DQ)=X C1F1 K DB 67 S X=DG(DQ),DIC=DIE 68 D AUTOUPD^DGENA2(DA) 69 S X=DG(DQ),DIC=DIE 70 S DFN=DA D EN^DGMTCOR K DGMTCOR 71 C1F1 Q 72 X1 Q 73 2 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 74 X2 W "." S JP=JP+1,DVBJ2=1 75 Q 76 3 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 77 X3 S Y="@50" 78 Q 79 4 S DQ=5 ;@40 80 5 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 81 X5 I $P(Z2,U,JP)'=1 S Y="@42" 82 Q 83 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 84 X6 I '$D(DVBP(6)) S Y="@42",JP=JP+1 85 Q 86 7 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 87 X7 I $S($P(DVBP(6),U,8)'="Y":1,'$D(^DPT(DFN,.32)):1,+$P(^(0),U,2):1,1:0) S Y="@42",JP=JP+1 88 Q 89 8 D:$D(DG)>9 F^DIE17,DE S DQ=8,DW=".32;2",DV="DX",DU="",DLB="SERVICE VERIFICATION DATE",DIFLD=.322 90 S X="T" 91 S Y=X 92 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) 93 G RD 94 X8 S %DT="",%DT(0)=-DT D ^%DT K %DT S X=Y K:Y<1 X I $D(X) D EK^DGLOCK 95 Q 96 ; 97 9 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 98 X9 W "." S JP=JP+1,DVBJ2=1 99 Q 100 10 S DQ=11 ;@42 101 11 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 102 X11 I $P(Z2,U,JP)'=2 S Y="@45" 103 Q 104 12 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 105 X12 I '$D(DVBP(6)) S Y="@45",JP=JP+1 106 Q 107 13 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=13 D X13 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 X13 I $P(DVBP(6),U,4)[" " S Y="@45",JP=JP+1 109 Q 110 14 S DW=".321;1",DV="RSX",DU="",DLB="VIETNAM SERVICE INDICATED?",DIFLD=.32101 111 S DE(DW)="C14^DVBHCE26" 112 S DU="Y:YES;N:NO;U:UNKNOWN;" 113 S X=$P(DVBP(6),U,4) 114 S Y=X 115 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) 116 G RD 117 C14 G C14S:$D(DE(14))[0 K DB 118 S X=DE(14),DIC=DIE 119 ; 120 S X=DE(14),DIC=DIE 121 ; 122 S X=DE(14),DIC=DIE 123 D EVENT^IVMPLOG(DA) 124 C14S S X="" G:DG(DQ)=X C14F1 K DB 2 125 S X=DG(DQ),DIC=DIE 3 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) … … 6 129 S X=DG(DQ),DIC=DIE 7 130 D EVENT^IVMPLOG(DA) 131 C14F1 Q 132 X14 S DFN=DA D SV^DGLOCK 133 Q 134 ; 135 15 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 136 X15 W "." S JP=JP+1,DVBJ2=1 137 Q 138 16 S DQ=17 ;@45 139 17 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=17 D X17 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 140 X17 I $P(Z2,U,JP)'=3!('$D(DVBDX(1))) S Y="@50" 141 Q 142 18 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=18 D X18 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 143 X18 S:'$D(DVBFL) DVBFL="UNKNOWN" 144 Q 145 19 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=19 D X19 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 146 X19 I $D(DVBCAP),DVBCAP["No C&P",$P(DVBBIR,U,5)'="Y" D CHK^DVBHUTIL 147 Q 148 20 S DQ=21 ;@47 149 21 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=21 D X21 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 150 X21 S DVB4=$S($D(^DPT(DFN,.3))>0:$P(^(.3),U),1:0),DVB5=$S($D(^DPT(DFN,.36))>0:$P(^(.36),U),1:0),DVB6=$S($D(^DPT(DFN,"VET"))>0:^("VET"),1:0),DVB7=$S($D(^DPT(DFN,"TYPE"))>0:^("TYPE"),1:0) 151 Q 152 22 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=22 D X22 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 153 X22 S DVB8=$O(^DIC(8,"B","SERVICE CONNECTED 50% to 100%",0)),DVB9=$O(^DIC(8,"B","SC LESS THAN 50%",0)) 154 Q 155 23 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=23 D X23 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 156 X23 I DVBDXNO I ((DVB8'=DVB5&(DVB9'=DVB5))!(DVB4'="Y")!(DVB6'="Y")!(DVB7'=1)) S Y="@70" 157 Q 158 24 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=24 D X24 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 159 X24 W ! K ^DPT(DFN,.372),JP4,JP6 S ^DPT(DFN,.372,0)="^2.04P^^0",JP=0 160 Q 161 25 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=25 D X25 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 162 X25 S $P(^DPT(DFN,.3),U,2)="",$P(^DPT(DFN,.3),U,14)="" 163 Q 164 26 D:$D(DG)>9 F^DIE17,DE S DQ=26,DW=".3;2",DV="NJ3,0Xa",DU="",DLB="SERVICE CONNECTED PERCENTAGE",DIFLD=.302 165 S DE(DW)="C26^DVBHCE26" 166 S X=+$G(DVBDXPCT) 167 S Y=X 168 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) 169 G RD 170 C26 G C26S:$D(DE(26))[0 K DB 171 D ^DVBHCE27 172 C26S S X="" G:DG(DQ)=X C26F1 K DB 173 D ^DVBHCE28 174 C26F1 Q 175 X26 S DFN=DA D EV^DGLOCK Q:'$D(X) K:+X'=X!(X>100)!(X<0)!(X?.E1"."1N.N) X I $D(X),$D(^DPT(DA,.3)),$P(^(.3),U,1)'="Y" W !?4,*7,"Only applies to service-connected applicants." K X 176 Q 177 ; 178 27 D:$D(DG)>9 F^DIE17 G ^DVBHCE29 -
WorldVistAEHR/trunk/r/HINQ-DVB--DVBA--DVBE--DVBC/DVBHCE27.m
r613 r623 1 DVBHCE27 ; ;12/13/08 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(^(.3)) S %Z=^(.3) S %=$P(%Z,U,2) S:%]"" DE(1)=% S %=$P(%Z,U,14) S:%]"" DE(2)=% 5 I $D(^(.362)) S %Z=^(.362) S %=$P(%Z,U,8) S:%]"" DE(28)=% S %=$P(%Z,U,9) S:%]"" DE(34)=% S %=$P(%Z,U,15) S:%]"" DE(16)=% S %=$P(%Z,U,18) S:%]"" DE(22)=% 6 K %Z Q 1 DVBHCE27 ; ;12/27/07 2 S X=DE(26),DIC=DIE 7 3 ; 8 W W !?DL+DL-2,DLB_": " 9 Q 10 O D W W Y W:$X>45 !?9 11 I $L(Y)>19,'DV,DV'["I",(DV["F"!(DV["K")) G RW^DIR2 12 W:Y]"" "// " I 'DV,DV["I",$D(DE(DQ))#2 S X="" W " (No Editing)" Q 13 TR R X:DTIME E S (DTOUT,X)=U W $C(7) 14 Q 15 A K DQ(DQ) S DQ=DQ+1 16 B G @DQ 17 RE G PR:$D(DE(DQ)) D W,TR 18 N I X="" G NKEY:$D(^DD("KEY","F",DP,DIFLD)),A:DV'["R",X:'DV,X:D'>0,A 19 RD G QS:X?."?" I X["^" D D G ^DIE17 20 I X="@" D D G Z^DIE2 21 I X=" ",DV["d",DV'["P",$D(^DISV(DUZ,"DIE",DLB)) S X=^(DLB) I DV'["D",DV'["S" W " "_X 22 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 23 K DDER G X 24 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 25 G V:DV'["N" D D I $L($P(X,"."))>24 K X G Z 26 I $P(DQ(DQ),U,5)'["$",X?.1"-".N.1".".N,$P(DQ(DQ),U,5,99)["+X'=X" S X=+X 27 V D @("X"_DQ) K YS 28 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 29 X W:'$D(ZTQUEUED) $C(7),"??" I $D(DB(DQ)) G Z^DIE17 30 S X="?BAD" 31 QS S DZ=X D D,QQ^DIEQ G B 32 D S D=DIFLD,DQ(DQ)=DLB_U_DV_U_DU_U_DW_U_$P($T(@("X"_DQ))," ",2,99) Q 33 Y I '$D(DE(DQ)) D O G RD:"@"'[X,A:DV'["R"&(X="@"),X:X="@" S X=Y G N 34 PR S DG=DV,Y=DE(DQ),X=DU I $D(DQ(DQ,2)) X DQ(DQ,2) G RP 35 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 36 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 37 X:DG["D" ^DD("DD") I DG["S" S %=$P($P(";"_X,";"_Y_":",2),";") S:%]"" Y=% 38 RP D O I X="" S X=DE(DQ) G A:'DV,A:DC<2,N^DIE17 39 I I DV'["I",DV'["#" G RD 40 D E^DIE0 G RD:$D(X),PR 41 Q 42 SET N DIR S DIR(0)="SV"_$E("o",$D(DB(DQ)))_U_DU,DIR("V")=1 43 I $D(DB(DQ)),'$D(DIQUIET) N DIQUIET S DIQUIET=1 44 D ^DIR I 'DDER S %=Y(0),X=Y 45 Q 46 SAVEVALS S @DIEZTMP@("V",DP,DIIENS,DIFLD,"O")=$G(DE(DQ)) S:$D(^("F"))[0 ^("F")=$G(DE(DQ)) 47 I $D(DE(DW,"4/")) S @DIEZTMP@("V",DP,DIIENS,DIFLD,"4/")="" 48 E K @DIEZTMP@("V",DP,DIIENS,DIFLD,"4/") 49 Q 50 NKEY W:'$D(ZTQUEUED) "?? Required key field" S X="?BAD" G QS 51 KEYCHK() Q:$G(DE(DW,"KEY"))="" 1 Q @DE(DW,"KEY") 52 BEGIN S DNM="DVBHCE27",DQ=1 53 1 D:$D(DG)>9 F^DIE17,DE S DQ=1,DW=".3;2",DV="NJ3,0Xa",DU="",DLB="SERVICE CONNECTED PERCENTAGE",DIFLD=.302 54 S DE(DW)="C1^DVBHCE27" 55 S X=+$G(DVBDXPCT) 56 S Y=X 57 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) 58 G RD 59 C1 G C1S:$D(DE(1))[0 K DB 60 S X=DE(1),DIC=DIE 4 S X=DE(26),DIC=DIE 5 D AUTOUPD^DGENA2(DA) 6 S X=DE(26),DIC=DIE 61 7 ; 62 S X=DE(1),DIC=DIE 63 D AUTOUPD^DGENA2(DA) 64 S X=DE(1),DIC=DIE 65 ; 66 S X=DE(1),DIC=DIE 8 S X=DE(26),DIC=DIE 67 9 I ($T(AVAFC^VAFCDD01)'="") S VAFCF=".302;" D AVAFC^VAFCDD01(DA) 68 S X=DE( 1),DIC=DIE10 S X=DE(26),DIC=DIE 69 11 D:($T(ADGRU^DGRUDD01)'="") ADGRU^DGRUDD01(DA) 70 S X=DE(1),DIIX=2_U_DIFLD D AUDIT^DIET 71 C1S S X="" G:DG(DQ)=X C1F1 K DB 72 S X=DG(DQ),DIC=DIE 73 ; 74 S X=DG(DQ),DIC=DIE 75 D AUTOUPD^DGENA2(DA) 76 S X=DG(DQ),DIC=DIE 77 X "S DFN=DA D EN^DGMTR K DGREQF" 78 S X=DG(DQ),DIC=DIE 79 I ($T(AVAFC^VAFCDD01)'="") S VAFCF=".302;" D AVAFC^VAFCDD01(DA) 80 S X=DG(DQ),DIC=DIE 81 D:($T(ADGRU^DGRUDD01)'="") ADGRU^DGRUDD01(DA) 82 I $D(DE(1))'[0!(^DD(DP,DIFLD,"AUDIT")'="e") S X=DG(DQ),DIIX=3_U_DIFLD D AUDIT^DIET 83 C1F1 Q 84 X1 S DFN=DA D EV^DGLOCK Q:'$D(X) K:+X'=X!(X>100)!(X<0)!(X?.E1"."1N.N) X I $D(X),$D(^DPT(DA,.3)),$P(^(.3),U,1)'="Y" W !?4,*7,"Only applies to service-connected applicants." K X 85 Q 86 ; 87 2 D:$D(DG)>9 F^DIE17,DE S DQ=2,DW=".3;14",DV="DX",DU="",DLB="EFF. DATE COMBINED SC% EVAL.",DIFLD=.3014 88 S X=$G(DVBEFF) 89 S Y=X 90 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) 91 G RD 92 X2 S %DT="P" D ^%DT S X=Y K:Y<1!(Y>DT) X 93 Q 94 ; 95 3 S DQ=4 ;@46 96 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 97 X4 S JP=$O(DVBDX(JP)) I 'JP S Y="@50" 98 Q 99 5 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 100 X5 S JPP=+$P(DVBDX(JP),U,2) I JPP'>0 S Y="@46" 101 Q 102 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 103 X6 I '$D(^DIC(31,JPP)) D CHKDIS^DVBHS3 S Y="@46" 104 Q 105 7 S D=0 K DE(1) ;.3721 106 S DIFLD=.3721,DGO="^DVBHCE28",DC="6^2.04P^.372^",DV="2.04MP31'X",DW="0;1",DOW="RATED DISABILITIES (VA)",DLB="Select "_DOW S:D DC=DC_D 107 S DU="DIC(31," 108 G RE:D I $D(DSC(2.04))#2,$P(DSC(2.04),"I $D(^UTILITY(",1)="" X DSC(2.04) S D=$O(^(0)) S:D="" D=-1 G M7 109 S D=$S($D(^DPT(DA,.372,0)):$P(^(0),U,3,4),$O(^(0))'="":$O(^(0)),1:-1) 110 M7 I D>0 S DC=DC_D I $D(^DPT(DA,.372,+D,0)) S DE(7)=$P(^(0),U,1) 111 S X="""`"_$P(DVBDX(JP),U,2)_"""" 112 S Y=X 113 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) 114 G RD 115 R7 D DE 116 G A 117 ; 118 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 119 X8 W "." S DVBJ2=1 120 Q 121 9 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 122 X9 S Y="@46" 123 Q 124 10 S DQ=11 ;@61 125 11 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 126 X11 S Y="@4" 127 Q 128 12 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 129 X12 I Z2'[1 S Y="@62" 130 Q 131 13 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=13 D X13 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 132 X13 I '$D(DVBSSA) S Y="@62",JP=JP+1 133 Q 134 14 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=14 D X14 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 135 X14 I DVBSSA S DVBYN="Y",DVBXYN=DVBSSA 136 Q 137 15 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 138 X15 I 'DVBSSA S DVBYN="N",DVBXYN="" 139 Q 140 16 S DW=".362;15",DV="SX",DU="",DLB="RECEIVING SOCIAL SECURITY?",DIFLD=.36225 141 S DE(DW)="C16^DVBHCE27" 142 S DU="Y:YES;N:NO;U:UNKNOWN;" 143 S X=DVBYN 144 S Y=X 145 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) 146 G RD 147 C16 G C16S:$D(DE(16))[0 K DB 148 S X=DE(16),DIC=DIE 149 X ^DD(2,.36225,1,1,2.3) I X S X=DIV S Y(1)=$S($D(^DPT(D0,.362)):^(.362),1:"") S X=$P(Y(1),U,3),X=X S DIU=X K Y S X="" X ^DD(2,.36225,1,1,2.4) 150 C16S S X="" G:DG(DQ)=X C16F1 K DB 151 S X=DG(DQ),DIC=DIE 152 X ^DD(2,.36225,1,1,1.3) I X S X=DIV S Y(1)=$S($D(^DPT(D0,.362)):^(.362),1:"") S X=$P(Y(1),U,3),X=X S DIU=X K Y S X="" X ^DD(2,.36225,1,1,1.4) 153 C16F1 Q 154 X16 S DFN=DA D MV^DGLOCK Q 155 Q 156 ; 157 17 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=17 D X17 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 158 X17 W "." S JP=JP+1,DVBJ2=1 K DVBYN,DVBXYN 159 Q 160 18 S DQ=19 ;@62 161 19 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=19 D X19 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 162 X19 I Z2'[2 S Y="@63" 163 Q 164 20 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=20 D X20 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 165 X20 I '$D(DVBRETT) S Y="@63",JP=JP+1 166 Q 167 21 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=21 D X21 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 168 X21 I DVBRETT=""!("BMCROX"'[DVBRETT) S Y="@63",JP=JP+1 169 Q 170 22 D:$D(DG)>9 F^DIE17,DE S DQ=22,DW=".362;18",DV="SX",DU="",DLB="TYPE OF OTHER RETIREMENT",DIFLD=.36285 171 S DU="B:BLACK LUNG;M:MILITARY;C:CIVIL;R:RAILROAD;O:OTHER;X:COMBINATIONS OF TYPES;" 172 S X=DVBRETT 173 S Y=X 174 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) 175 G RD 176 X22 S DFN=DA D MV^DGLOCK Q 177 Q 178 ; 179 23 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=23 D X23 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 180 X23 W "." S JP=JP+1,DVBJ2=1 181 Q 182 24 S DQ=25 ;@63 183 25 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=25 D X25 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 184 X25 I Z2'[3 S Y="@64" 185 Q 186 26 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=26 D X26 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 187 X26 I '$D(DVBRETO) S Y="@64",JP=JP+1 188 Q 189 27 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=27 D X27 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 190 X27 S X=DVBRETO I X=""!(X=0) S X="@" 191 Q 192 28 S DW=".362;8",DV="NJ8,2X",DU="",DLB="AMOUNT OF OTHER RETIREMENT",DIFLD=.3628 193 S X=X 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 197 X28 D DOL^DGLOCK2 K:+X'=X&(X'?.N1"."2N)!(X>99999)!(X<1) X I $D(X) S DFN=DA D MV^DGLOCK 198 Q 199 ; 200 29 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=29 D X29 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 201 X29 W "." S JP=JP+1,DVBJ2=1 202 Q 203 30 S DQ=31 ;@64 204 31 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=31 D X31 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 205 X31 I Z2'[4 S Y="@1006" 206 Q 207 32 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=32 D X32 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 208 X32 I '$D(DVBOINC) S Y="@1006",JP=JP+1 209 Q 210 33 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=33 D X33 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 211 X33 S X=DVBOINC I X=""!(X=0) S X="@" 212 Q 213 34 S DW=".362;9",DV="NJ8,2X",DU="",DLB="AMOUNT OF OTHER INCOME",DIFLD=.3629 214 S X=X 215 S Y=X 216 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) 217 G RD 218 X34 D DOL^DGLOCK2 K:+X'=X&(X'?.N1"."2N)!(X>999999)!(X<1) X 219 Q 220 ; 221 35 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=35 D X35 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 222 X35 W "." S JP=JP+1,DVBJ2=1,Y="@1006" 223 Q 224 36 S DQ=37 ;@4 225 37 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=37 D X37 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 226 X37 S Y=$S(DVBJS=11:"@1",DVBJS=28:"@2",DVBJS=35:"@3",DVBJS=44:"@104",1:"@10") 227 Q 228 38 S DQ=39 ;@70 229 39 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=39 D X39 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 230 X39 W !!,*7,"HINQ contains SC disabilities, Patient is NSC no updating allowed. Check patient's SERVICE CONNECTION, ELIGIBILITY CODE, VET STATUS, or PATIENT TYPE. Screen 5 contains this." 231 Q 232 40 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=40 D X40 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 233 X40 R !!,?25,"<RET> to continue.",ZZ:DTIME K ZZ,JP3,JP4 234 Q 235 41 S DQ=42 ;@50 236 42 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=42 D X42 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 237 X42 K DVBJX,JP,JPP S Y=$S(DVBJS=28:"@1",DVBJS=35:"@2",1:"@10") 238 Q 239 43 S DQ=44 ;@10 240 44 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=44 D X44 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 241 X44 I $G(DVBRADL)]"" D DX^DVBHQEDT(DVBRADL) 242 Q 243 45 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=45 D X45 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 244 X45 K DVBRADL 245 Q 246 46 G 0^DIE17 12 S X=DE(26),DIIX=2_U_DIFLD D AUDIT^DIET -
WorldVistAEHR/trunk/r/HINQ-DVB--DVBA--DVBE--DVBC/DVBHCE28.m
r613 r623 1 DVBHCE28 ; ;12/13/08 2 D DE G BEGIN 3 DE S DIE="^DPT(D0,.372,",DIC=DIE,DP=2.04,DL=2,DIEL=1,DU="" K DG,DE,DB Q:$O(^DPT(D0,.372,DA,""))="" 4 I $D(^(0)) S %Z=^(0) S %=$P(%Z,U,2) S:%]"" DE(1)=% S %=$P(%Z,U,3) S:%]"" DE(2)=% S %=$P(%Z,U,4) S:%]"" DE(3)=% S %=$P(%Z,U,5) S:%]"" DE(4)=% S %=$P(%Z,U,6) S:%]"" DE(5)=% 5 K %Z Q 1 DVBHCE28 ; ;12/27/07 2 S X=DG(DQ),DIC=DIE 6 3 ; 7 W W !?DL+DL-2,DLB_": "8 Q9 O D W W Y W:$X>45 !?910 I $L(Y)>19,'DV,DV'["I",(DV["F"!(DV["K")) G RW^DIR211 W:Y]"" "// " I 'DV,DV["I",$D(DE(DQ))#2 S X="" W " (No Editing)" Q12 TR R X:DTIME E S (DTOUT,X)=U W $C(7)13 Q14 A K DQ(DQ) S DQ=DQ+115 B G @DQ16 RE G PR:$D(DE(DQ)) D W,TR17 N I X="" G NKEY:$D(^DD("KEY","F",DP,DIFLD)),A:DV'["R",X:'DV,X:D'>0,A18 RD G QS:X?."?" I X["^" D D G ^DIE1719 I X="@" D D G Z^DIE220 I X=" ",DV["d",DV'["P",$D(^DISV(DUZ,"DIE",DLB)) S X=^(DLB) I DV'["D",DV'["S" W " "_X21 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 V22 K DDER G X23 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<024 G V:DV'["N" D D I $L($P(X,"."))>24 K X G Z25 I $P(DQ(DQ),U,5)'["$",X?.1"-".N.1".".N,$P(DQ(DQ),U,5,99)["+X'=X" S X=+X26 V D @("X"_DQ) K YS27 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 A28 X W:'$D(ZTQUEUED) $C(7),"??" I $D(DB(DQ)) G Z^DIE1729 S X="?BAD"30 QS S DZ=X D D,QQ^DIEQ G B31 D S D=DIFLD,DQ(DQ)=DLB_U_DV_U_DU_U_DW_U_$P($T(@("X"_DQ))," ",2,99) Q32 Y I '$D(DE(DQ)) D O G RD:"@"'[X,A:DV'["R"&(X="@"),X:X="@" S X=Y G N33 PR S DG=DV,Y=DE(DQ),X=DU I $D(DQ(DQ,2)) X DQ(DQ,2) G RP34 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 R35 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 R36 X:DG["D" ^DD("DD") I DG["S" S %=$P($P(";"_X,";"_Y_":",2),";") S:%]"" Y=%37 RP D O I X="" S X=DE(DQ) G A:'DV,A:DC<2,N^DIE1738 I I DV'["I",DV'["#" G RD39 D E^DIE0 G RD:$D(X),PR40 Q41 SET N DIR S DIR(0)="SV"_$E("o",$D(DB(DQ)))_U_DU,DIR("V")=142 I $D(DB(DQ)),'$D(DIQUIET) N DIQUIET S DIQUIET=143 D ^DIR I 'DDER S %=Y(0),X=Y44 Q45 SAVEVALS S @DIEZTMP@("V",DP,DIIENS,DIFLD,"O")=$G(DE(DQ)) S:$D(^("F"))[0 ^("F")=$G(DE(DQ))46 I $D(DE(DW,"4/")) S @DIEZTMP@("V",DP,DIIENS,DIFLD,"4/")=""47 E K @DIEZTMP@("V",DP,DIIENS,DIFLD,"4/")48 Q49 NKEY W:'$D(ZTQUEUED) "?? Required key field" S X="?BAD" G QS50 KEYCHK() Q:$G(DE(DW,"KEY"))="" 1 Q @DE(DW,"KEY")51 BEGIN S DNM="DVBHCE28",DQ=152 1 S DW="0;2",DV="RNJ3,0X",DU="",DLB="DISABILITY %",DIFLD=253 S DE(DW)="C1^DVBHCE28",DE(DW,"INDEX")=154 S X=$S($P(DVBDX(JP),U,3)="X0":100,1:+$P(DVBDX(JP),U,3))55 S Y=X56 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)57 G RD58 C1 G C1S:$D(DE(1))[0 K DB59 S X=DE(1),DIC=DIE60 D EVENT^IVMPLOG($G(DA(1)))61 C1S S X="" G:DG(DQ)=X C1F1 K DB62 4 S X=DG(DQ),DIC=DIE 63 D EVENT^IVMPLOG($G(DA(1))) 64 C1F1 N X,X1,X2 S DIXR=411 D C1X1(U) K X2 M X2=X D C1X1("O") K X1 M X1=X 65 D 66 . N DIEXARR M DIEXARR=X S DIEZCOND=1 67 . I (X1(1)'=X2(1))!(X1(2)'=X2(2))!(X1(3)'=X2(3)) 68 . S DIEZCOND=$G(X) K X M X=DIEXARR Q:'DIEZCOND 69 . S DGRDCHG=1 70 K X M X=X2 D 71 . N DIEXARR M DIEXARR=X S DIEZCOND=1 72 . I (X1(1)'=X2(1))!(X1(2)'=X2(2))!(X1(3)'=X2(3)) 73 . S DIEZCOND=$G(X) K X M X=DIEXARR Q:'DIEZCOND 74 . S DGRDCHG=1 75 G C1F2 76 C1X1(DION) K X 77 S X(1)=$G(@DIEZTMP@("V",2.04,DIIENS,.01,DION),$P($G(^DPT(DA(1),.372,DA,0)),U,1)) 78 S X(2)=$G(@DIEZTMP@("V",2.04,DIIENS,2,DION),$P($G(^DPT(DA(1),.372,DA,0)),U,2)) 79 S X(3)=$G(@DIEZTMP@("V",2.04,DIIENS,3,DION),$P($G(^DPT(DA(1),.372,DA,0)),U,3)) 80 S X=$G(X(1)) 81 Q 82 C1F2 Q 83 X1 K:+X'=X!(X>100)!(X<0)!(X?.E1"."1N.N) X I $D(X) D EK^DGLOCK 84 Q 85 ; 86 2 D:$D(DG)>9 F^DIE17,DE S DQ=2,DW="0;3",DV="SX",DU="",DLB="SERVICE CONNECTED",DIFLD=3 87 S DE(DW)="C2^DVBHCE28",DE(DW,"INDEX")=1 88 S DU="0:NO;1:YES;" 89 S X=1 90 S Y=X 91 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) 92 G RD 93 C2 G C2S:$D(DE(2))[0 K DB 94 S X=DE(2),DIC=DIE 95 D EVENT^IVMPLOG($G(DA(1))) 96 C2S S X="" G:DG(DQ)=X C2F1 K DB 5 D AUTOUPD^DGENA2(DA) 97 6 S X=DG(DQ),DIC=DIE 98 D EVENT^IVMPLOG($G(DA(1))) 99 C2F1 N X,X1,X2 S DIXR=411 D C2X1(U) K X2 M X2=X D C2X1("O") K X1 M X1=X 100 D 101 . N DIEXARR M DIEXARR=X S DIEZCOND=1 102 . I (X1(1)'=X2(1))!(X1(2)'=X2(2))!(X1(3)'=X2(3)) 103 . S DIEZCOND=$G(X) K X M X=DIEXARR Q:'DIEZCOND 104 . S DGRDCHG=1 105 K X M X=X2 D 106 . N DIEXARR M DIEXARR=X S DIEZCOND=1 107 . I (X1(1)'=X2(1))!(X1(2)'=X2(2))!(X1(3)'=X2(3)) 108 . S DIEZCOND=$G(X) K X M X=DIEXARR Q:'DIEZCOND 109 . S DGRDCHG=1 110 G C2F2 111 C2X1(DION) K X 112 S X(1)=$G(@DIEZTMP@("V",2.04,DIIENS,.01,DION),$P($G(^DPT(DA(1),.372,DA,0)),U,1)) 113 S X(2)=$G(@DIEZTMP@("V",2.04,DIIENS,2,DION),$P($G(^DPT(DA(1),.372,DA,0)),U,2)) 114 S X(3)=$G(@DIEZTMP@("V",2.04,DIIENS,3,DION),$P($G(^DPT(DA(1),.372,DA,0)),U,3)) 115 S X=$G(X(1)) 116 Q 117 C2F2 Q 118 X2 S DFN=DA(1) D:X SC^DGLOCK1 I $D(X) D EK^DGLOCK 119 Q 120 ; 121 3 D:$D(DG)>9 F^DIE17,DE S DQ=3,DW="0;4",DV="S",DU="",DLB="EXTREMITY AFFECTED",DIFLD=4 122 S DU="BL:BOTH LOWER;BU:BOTH UPPER;RL:RIGHT LOWER;RU:RIGHT UPPER;LL:LEFT LOWER;LU:LEFT UPPER;" 123 S X=$P($G(DVBDX(JP)),U,4) 124 S Y=X 125 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) 126 G RD 127 X3 Q 128 4 S DW="0;5",DV="DX",DU="",DLB="ORIGINAL EFFECTIVE DATE",DIFLD=5 129 S X=$P($G(DVBDX(JP)),U,5) 130 S Y=X 131 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) 132 G RD 133 X4 S %DT="" D ^%DT S X=Y K:Y<1!(Y>DT) X 134 Q 135 ; 136 5 S DW="0;6",DV="DX",DU="",DLB="CURRENT EFFECTIVE DATE",DIFLD=6 137 S X=$P($G(DVBDX(JP)),U,6) 138 S Y=X 139 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) 140 G RD 141 X5 S %DT="" D ^%DT S X=Y K:Y<1!(Y>DT) X 142 Q 143 ; 144 6 G 1^DIE17 7 X "S DFN=DA D EN^DGMTR K DGREQF" 8 S X=DG(DQ),DIC=DIE 9 I ($T(AVAFC^VAFCDD01)'="") S VAFCF=".302;" D AVAFC^VAFCDD01(DA) 10 S X=DG(DQ),DIC=DIE 11 D:($T(ADGRU^DGRUDD01)'="") ADGRU^DGRUDD01(DA) 12 I $D(DE(26))'[0!(^DD(DP,DIFLD,"AUDIT")'="e") S X=DG(DQ),DIIX=3_U_DIFLD D AUDIT^DIET -
WorldVistAEHR/trunk/r/HINQ-DVB--DVBA--DVBE--DVBC/DVBHCE29.m
r613 r623 1 DVBHCE29 ; ;12/ 13/082 ;;3 1 N X,X1,X2 S DIXR=303 D X1(U) K X2 M X2=X D X1("F") K X1 M X1=X 4 K X M X=X2 D5 . N DIEZCOND,DIEXARR M DIEXARR=X S DIEZCOND=16 . I '$P($G(^DPT(DA,.52)),"^",15) S X=$$CVELIG^DGCV(DA)7 . S DIEZCOND=$G(X) K X M X=DIEXARR Q:'DIEZCOND8 . D SETCV^DGCV(DA,X2(1)) 1 DVBHCE29 ; ;12/27/07 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(^(.3)) S %Z=^(.3) S %=$P(%Z,U,14) S:%]"" DE(1)=% 5 I $D(^(.362)) S %Z=^(.362) S %=$P(%Z,U,8) S:%]"" DE(27)=% S %=$P(%Z,U,15) S:%]"" DE(15)=% S %=$P(%Z,U,18) S:%]"" DE(21)=% 6 K %Z Q 7 ; 8 W W !?DL+DL-2,DLB_": " 9 9 Q 10 X1(DION) K X 11 S X(1)=$G(@DIEZTMP@("V",2,DIIENS,.327,DION),$P($G(^DPT(DA,.32)),U,7)) 12 S X(2)=$G(@DIEZTMP@("V",2,DIIENS,.5294,DION),$P($G(^DPT(DA,.52)),U,14)) 13 S X(3)=$G(@DIEZTMP@("V",2,DIIENS,.322021,DION),$P($G(^DPT(DA,.322)),U,21)) 14 S X(4)=$G(@DIEZTMP@("V",2,DIIENS,.322018,DION),$P($G(^DPT(DA,.322)),U,18)) 15 S X(5)=$G(@DIEZTMP@("V",2,DIIENS,.322012,DION),$P($G(^DPT(DA,.322)),U,12)) 16 S X(6)=$G(@DIEZTMP@("V",2,DIIENS,.5291,DION),$P($G(^DPT(DA,.52)),U,11)) 17 S X(7)=$G(@DIEZTMP@("V",2,DIIENS,.322019,DION),$P($G(^DPT(DA,.322)),U,19)) 18 S X(8)=$G(@DIEZTMP@("V",2,DIIENS,.322016,DION),$P($G(^DPT(DA,.322)),U,16)) 19 S X(9)=$G(@DIEZTMP@("V",2,DIIENS,.32201,DION),$P($G(^DPT(DA,.322)),U,10)) 20 S X=$G(X(1)) 10 O D W W Y W:$X>45 !?9 11 I $L(Y)>19,'DV,DV'["I",(DV["F"!(DV["K")) G RW^DIR2 12 W:Y]"" "// " I 'DV,DV["I",$D(DE(DQ))#2 S X="" W " (No Editing)" Q 13 TR R X:DTIME E S (DTOUT,X)=U W $C(7) 21 14 Q 22 2 N X,X1,X2 S DIXR=648 D X2(U) K X2 M X2=X D X2("F") K X1 M X1=X 23 D 24 . D KSERV^DGSRVICE(.X,.DA,"LAST") 25 K X M X=X2 D 26 . D SSERV^DGSRVICE(.X,.DA,"LAST") 15 A K DQ(DQ) S DQ=DQ+1 16 B G @DQ 17 RE G PR:$D(DE(DQ)) D W,TR 18 N I X="" G NKEY:$D(^DD("KEY","F",DP,DIFLD)),A:DV'["R",X:'DV,X:D'>0,A 19 RD G QS:X?."?" I X["^" D D G ^DIE17 20 I X="@" D D G Z^DIE2 21 I X=" ",DV["d",DV'["P",$D(^DISV(DUZ,"DIE",DLB)) S X=^(DLB) I DV'["D",DV'["S" W " "_X 22 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 23 K DDER G X 24 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 25 G V:DV'["N" D D I $L($P(X,"."))>24 K X G Z 26 I $P(DQ(DQ),U,5)'["$",X?.1"-".N.1".".N,$P(DQ(DQ),U,5,99)["+X'=X" S X=+X 27 V D @("X"_DQ) K YS 28 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 29 X W:'$D(ZTQUEUED) $C(7),"??" I $D(DB(DQ)) G Z^DIE17 30 S X="?BAD" 31 QS S DZ=X D D,QQ^DIEQ G B 32 D S D=DIFLD,DQ(DQ)=DLB_U_DV_U_DU_U_DW_U_$P($T(@("X"_DQ))," ",2,99) Q 33 Y I '$D(DE(DQ)) D O G RD:"@"'[X,A:DV'["R"&(X="@"),X:X="@" S X=Y G N 34 PR S DG=DV,Y=DE(DQ),X=DU I $D(DQ(DQ,2)) X DQ(DQ,2) G RP 35 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 36 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 37 X:DG["D" ^DD("DD") I DG["S" S %=$P($P(";"_X,";"_Y_":",2),";") S:%]"" Y=% 38 RP D O I X="" S X=DE(DQ) G A:'DV,A:DC<2,N^DIE17 39 I I DV'["I",DV'["#" G RD 40 D E^DIE0 G RD:$D(X),PR 27 41 Q 28 X2(DION) K X 29 S X(1)=$G(@DIEZTMP@("V",2,DIIENS,.326,DION),$P($G(^DPT(DA,.32)),U,6)) 30 S X(2)=$G(@DIEZTMP@("V",2,DIIENS,.327,DION),$P($G(^DPT(DA,.32)),U,7)) 31 S X=$G(X(1)) 42 SET N DIR S DIR(0)="SV"_$E("o",$D(DB(DQ)))_U_DU,DIR("V")=1 43 I $D(DB(DQ)),'$D(DIQUIET) N DIQUIET S DIQUIET=1 44 D ^DIR I 'DDER S %=Y(0),X=Y 32 45 Q 33 3 N X,X1,X2 S DIXR=649 D X3(U) K X2 M X2=X D X3("F") K X1 M X1=X 34 D 35 . D KSERV^DGSRVICE(.X,.DA,"NTL") 36 K X M X=X2 D 37 . D SSERV^DGSRVICE(.X,.DA,"NTL") 46 SAVEVALS S @DIEZTMP@("V",DP,DIIENS,DIFLD,"O")=$G(DE(DQ)) S:$D(^("F"))[0 ^("F")=$G(DE(DQ)) 47 I $D(DE(DW,"4/")) S @DIEZTMP@("V",DP,DIIENS,DIFLD,"4/")="" 48 E K @DIEZTMP@("V",DP,DIIENS,DIFLD,"4/") 38 49 Q 39 X3(DION) K X 40 S X(1)=$G(@DIEZTMP@("V",2,DIIENS,.3292,DION),$P($G(^DPT(DA,.32)),U,11)) 41 S X(2)=$G(@DIEZTMP@("V",2,DIIENS,.3293,DION),$P($G(^DPT(DA,.32)),U,12)) 42 S X=$G(X(1)) 50 NKEY W:'$D(ZTQUEUED) "?? Required key field" S X="?BAD" G QS 51 KEYCHK() Q:$G(DE(DW,"KEY"))="" 1 Q @DE(DW,"KEY") 52 BEGIN S DNM="DVBHCE29",DQ=1 53 1 D:$D(DG)>9 F^DIE17,DE S DQ=1,DW=".3;14",DV="DX",DU="",DLB="EFF. DATE COMBINED SC% EVAL.",DIFLD=.3014 54 S X=$G(DVBEFF) 55 S Y=X 56 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) 57 G RD 58 X1 S %DT="P" D ^%DT S X=Y K:Y<1!(Y>DT) X 43 59 Q 44 4 N X,X1,X2 S DIXR=663 D X4(U) K X2 M X2=X D X4("F") K X1 M X1=X 45 D 46 . D KSERV^DGSRVICE(.X,.DA,"NNTL") 47 K X M X=X2 D 48 . D SSERV^DGSRVICE(.X,.DA,"NNTL") 60 ; 61 2 S DQ=3 ;@46 62 3 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 63 X3 S JP=$O(DVBDX(JP)) I 'JP S Y="@50" 49 64 Q 50 X4(DION) K X 51 S X(1)=$G(@DIEZTMP@("V",2,DIIENS,.3297,DION),$P($G(^DPT(DA,.32)),U,16)) 52 S X(2)=$G(@DIEZTMP@("V",2,DIIENS,.3298,DION),$P($G(^DPT(DA,.32)),U,17)) 53 S X=$G(X(1)) 65 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 66 X4 S JPP=+$P(DVBDX(JP),U,2) I JPP'>0 S Y="@46" 54 67 Q 68 5 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 69 X5 I '$D(^DIC(31,JPP)) D CHKDIS^DVBHS3 S Y="@46" 70 Q 71 6 S D=0 K DE(1) ;.3721 72 S DIFLD=.3721,DGO="^DVBHCE30",DC="6^2.04P^.372^",DV="2.04MP31'X",DW="0;1",DOW="RATED DISABILITIES (VA)",DLB="Select "_DOW S:D DC=DC_D 73 S DU="DIC(31," 74 G RE:D I $D(DSC(2.04))#2,$P(DSC(2.04),"I $D(^UTILITY(",1)="" X DSC(2.04) S D=$O(^(0)) S:D="" D=-1 G M6 75 S D=$S($D(^DPT(DA,.372,0)):$P(^(0),U,3,4),$O(^(0))'="":$O(^(0)),1:-1) 76 M6 I D>0 S DC=DC_D I $D(^DPT(DA,.372,+D,0)) S DE(6)=$P(^(0),U,1) 77 S X="""`"_$P(DVBDX(JP),U,2)_"""" 78 S Y=X 79 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) 80 G RD 81 R6 D DE 82 G A 83 ; 84 7 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 85 X7 W "." S DVBJ2=1 86 Q 87 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 88 X8 S Y="@46" 89 Q 90 9 S DQ=10 ;@61 91 10 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 92 X10 S Y="@4" 93 Q 94 11 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 95 X11 I Z2'[1 S Y="@62" 96 Q 97 12 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 98 X12 I '$D(DVBSSA) S Y="@62",JP=JP+1 99 Q 100 13 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=13 D X13 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 101 X13 I DVBSSA S DVBYN="Y",DVBXYN=DVBSSA 102 Q 103 14 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=14 D X14 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 104 X14 I 'DVBSSA S DVBYN="N",DVBXYN="" 105 Q 106 15 S DW=".362;15",DV="SX",DU="",DLB="RECEIVING SOCIAL SECURITY?",DIFLD=.36225 107 S DE(DW)="C15^DVBHCE29" 108 S DU="Y:YES;N:NO;U:UNKNOWN;" 109 S X=DVBYN 110 S Y=X 111 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) 112 G RD 113 C15 G C15S:$D(DE(15))[0 K DB 114 S X=DE(15),DIC=DIE 115 X ^DD(2,.36225,1,1,2.3) I X S X=DIV S Y(1)=$S($D(^DPT(D0,.362)):^(.362),1:"") S X=$P(Y(1),U,3),X=X S DIU=X K Y S X="" X ^DD(2,.36225,1,1,2.4) 116 C15S S X="" G:DG(DQ)=X C15F1 K DB 117 S X=DG(DQ),DIC=DIE 118 X ^DD(2,.36225,1,1,1.3) I X S X=DIV S Y(1)=$S($D(^DPT(D0,.362)):^(.362),1:"") S X=$P(Y(1),U,3),X=X S DIU=X K Y S X="" X ^DD(2,.36225,1,1,1.4) 119 C15F1 Q 120 X15 S DFN=DA D MV^DGLOCK Q 121 Q 122 ; 123 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 124 X16 W "." S JP=JP+1,DVBJ2=1 K DVBYN,DVBXYN 125 Q 126 17 S DQ=18 ;@62 127 18 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=18 D X18 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 128 X18 I Z2'[2 S Y="@63" 129 Q 130 19 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=19 D X19 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 X19 I '$D(DVBRETT) S Y="@63",JP=JP+1 132 Q 133 20 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=20 D X20 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 134 X20 I DVBRETT=""!("BMCROX"'[DVBRETT) S Y="@63",JP=JP+1 135 Q 136 21 D:$D(DG)>9 F^DIE17,DE S DQ=21,DW=".362;18",DV="SX",DU="",DLB="TYPE OF OTHER RETIREMENT",DIFLD=.36285 137 S DU="B:BLACK LUNG;M:MILITARY;C:CIVIL;R:RAILROAD;O:OTHER;X:COMBINATIONS OF TYPES;" 138 S X=DVBRETT 139 S Y=X 140 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) 141 G RD 142 X21 S DFN=DA D MV^DGLOCK Q 143 Q 144 ; 145 22 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=22 D X22 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 146 X22 W "." S JP=JP+1,DVBJ2=1 147 Q 148 23 S DQ=24 ;@63 149 24 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=24 D X24 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 150 X24 I Z2'[3 S Y="@64" 151 Q 152 25 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=25 D X25 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 153 X25 I '$D(DVBRETO) S Y="@64",JP=JP+1 154 Q 155 26 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=26 D X26 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 156 X26 S X=DVBRETO I X=""!(X=0) S X="@" 157 Q 158 27 S DW=".362;8",DV="NJ8,2X",DU="",DLB="AMOUNT OF OTHER RETIREMENT",DIFLD=.3628 159 S X=X 160 S Y=X 161 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) 162 G RD 163 X27 D DOL^DGLOCK2 K:+X'=X&(X'?.N1"."2N)!(X>99999)!(X<1) X I $D(X) S DFN=DA D MV^DGLOCK 164 Q 165 ; 166 28 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=28 D X28 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 167 X28 W "." S JP=JP+1,DVBJ2=1 168 Q 169 29 S DQ=30 ;@64 170 30 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=30 D X30 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 171 X30 I Z2'[4 S Y="@1006" 172 Q 173 31 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=31 D X31 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 174 X31 I '$D(DVBOINC) S Y="@1006",JP=JP+1 175 Q 176 32 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=32 D X32 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 177 X32 S X=DVBOINC I X=""!(X=0) S X="@" 178 Q 179 33 D:$D(DG)>9 F^DIE17 G ^DVBHCE31 -
WorldVistAEHR/trunk/r/HINQ-DVB--DVBA--DVBE--DVBC/DVBHCE3.m
r613 r623 1 DVBHCE3 ; ;12/13/08 2 S X=DG(DQ),DIC=DIE 3 ; 4 S X=DG(DQ),DIC=DIE 5 D EVENT^IVMPLOG(DA) 1 DVBHCE3 ; ;12/27/07 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(^(.32)) S %Z=^(.32) S %=$P(%Z,U,9) S:%]"" DE(6)=% S %=$P(%Z,U,10) S:%]"" DE(5)=% S %=$P(%Z,U,11) S:%]"" DE(3)=% S %=$P(%Z,U,12) S:%]"" DE(4)=% S %=$P(%Z,U,13) S:%]"" DE(7)=% S %=$P(%Z,U,19) S:%]"" DE(1)=% S %=$P(%Z,U,20) S:%]"" DE(13)=% 5 K %Z Q 6 ; 7 W W !?DL+DL-2,DLB_": " 8 Q 9 O D W W Y W:$X>45 !?9 10 I $L(Y)>19,'DV,DV'["I",(DV["F"!(DV["K")) G RW^DIR2 11 W:Y]"" "// " I 'DV,DV["I",$D(DE(DQ))#2 S X="" W " (No Editing)" Q 12 TR R X:DTIME E S (DTOUT,X)=U W $C(7) 13 Q 14 A K DQ(DQ) S DQ=DQ+1 15 B G @DQ 16 RE G PR:$D(DE(DQ)) D W,TR 17 N I X="" G NKEY:$D(^DD("KEY","F",DP,DIFLD)),A:DV'["R",X:'DV,X:D'>0,A 18 RD G QS:X?."?" I X["^" D D G ^DIE17 19 I X="@" D D G Z^DIE2 20 I X=" ",DV["d",DV'["P",$D(^DISV(DUZ,"DIE",DLB)) S X=^(DLB) I DV'["D",DV'["S" W " "_X 21 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 22 K DDER G X 23 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 24 G V:DV'["N" D D I $L($P(X,"."))>24 K X G Z 25 I $P(DQ(DQ),U,5)'["$",X?.1"-".N.1".".N,$P(DQ(DQ),U,5,99)["+X'=X" S X=+X 26 V D @("X"_DQ) K YS 27 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 28 X W:'$D(ZTQUEUED) $C(7),"??" I $D(DB(DQ)) G Z^DIE17 29 S X="?BAD" 30 QS S DZ=X D D,QQ^DIEQ G B 31 D S D=DIFLD,DQ(DQ)=DLB_U_DV_U_DU_U_DW_U_$P($T(@("X"_DQ))," ",2,99) Q 32 Y I '$D(DE(DQ)) D O G RD:"@"'[X,A:DV'["R"&(X="@"),X:X="@" S X=Y G N 33 PR S DG=DV,Y=DE(DQ),X=DU I $D(DQ(DQ,2)) X DQ(DQ,2) G RP 34 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 35 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 36 X:DG["D" ^DD("DD") I DG["S" S %=$P($P(";"_X,";"_Y_":",2),";") S:%]"" Y=% 37 RP D O I X="" S X=DE(DQ) G A:'DV,A:DC<2,N^DIE17 38 I I DV'["I",DV'["#" G RD 39 D E^DIE0 G RD:$D(X),PR 40 Q 41 SET N DIR S DIR(0)="SV"_$E("o",$D(DB(DQ)))_U_DU,DIR("V")=1 42 I $D(DB(DQ)),'$D(DIQUIET) N DIQUIET S DIQUIET=1 43 D ^DIR I 'DDER S %=Y(0),X=Y 44 Q 45 SAVEVALS S @DIEZTMP@("V",DP,DIIENS,DIFLD,"O")=$G(DE(DQ)) S:$D(^("F"))[0 ^("F")=$G(DE(DQ)) 46 I $D(DE(DW,"4/")) S @DIEZTMP@("V",DP,DIIENS,DIFLD,"4/")="" 47 E K @DIEZTMP@("V",DP,DIIENS,DIFLD,"4/") 48 Q 49 NKEY W:'$D(ZTQUEUED) "?? Required key field" S X="?BAD" G QS 50 KEYCHK() Q:$G(DE(DW,"KEY"))="" 1 Q @DE(DW,"KEY") 51 BEGIN S DNM="DVBHCE3",DQ=1 52 1 D:$D(DG)>9 F^DIE17,DE S DQ=1,DW=".32;19",DV="RSX",DU="",DLB="Service NTL Episode",DIFLD=.3285 53 S DE(DW)="C1^DVBHCE3" 54 S DU="Y:YES;N:NO;" 55 G RE 56 C1 G C1S:$D(DE(1))[0 K DB 57 S X=DE(1),DIC=DIE 58 ; 59 S X=DE(1),DIC=DIE 60 ; 61 S X=DE(1),DIC=DIE 62 X ^DD(2,.3285,1,3,2.3) I X S X=DIV S Y(1)=$S($D(^DPT(D0,.32)):^(.32),1:"") S X=$P(Y(1),U,10),X=X S DIU=X K Y S X="" S DIH=$G(^DPT(DIV(0),.32)),DIV=X S $P(^(.32),U,10)=DIV,DIH=2,DIG=.3291 D ^DICR 63 C1S S X="" G:DG(DQ)=X C1F1 K DB 64 S X=DG(DQ),DIC=DIE 65 X "I X'=""Y"" S DGXRF=.3285 D ^DGDDC Q" 66 S X=DG(DQ),DIC=DIE 67 X ^DD(2,.3285,1,2,1.3) I X S X=DIV S Y(1)=$S($D(^DPT(D0,.32)):^(.32),1:"") S X=$P(Y(1),U,20),X=X S DIU=X K Y S X=DIV S X="N" X ^DD(2,.3285,1,2,1.4) 68 S X=DG(DQ),DIC=DIE 69 K DIV S DIV=X,D0=DA,DIV(0)=D0 S Y(0)=X S Y(1)=$C(59)_$P($G(^DD(2,.3285,0)),U,3) S X=$P($P(Y(1),$C(59)_Y(0)_":",2),$C(59))'="YES" I X S X=DIV S Y(1)=$S($D(^DPT(D0,.32)):^(.32),1:"") S X=$P(Y(1),U,10),X=X S DIU=X K Y S X="" X ^DD(2,.3285,1,3,1.4) 70 C1F1 Q 71 X1 S DFN=DA D SV^DGLOCK 72 Q 73 ; 74 2 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 75 X2 I $P(^DPT(D0,.32),U,19)'="Y" S Y="@31" 76 Q 77 3 D:$D(DG)>9 F^DIE17,DE S DQ=3,DW=".32;11",DV="RDX",DU="",DLB="NTL-EOD",DIFLD=.3292 78 S DE(DW)="C3^DVBHCE3",DE(DW,"INDEX")=1 79 G RE 80 C3 G C3S:$D(DE(3))[0 K DB 81 S X=DE(3),DIC=DIE 82 ; 83 S X=DE(3),DIC=DIE 84 D EVENT^IVMPLOG(DA) 85 C3S S X="" G:DG(DQ)=X C3F1 K DB 86 S X=DG(DQ),DIC=DIE 87 ; 88 S X=DG(DQ),DIC=DIE 89 D EVENT^IVMPLOG(DA) 90 C3F1 S DIEZRXR(2,DIIENS)=$$OREF^DILF($NA(@$$CREF^DILF(DIE))) 91 F DIXR=649 S DIEZRXR(2,DIXR)="" 92 Q 93 X3 S %DT="E",%DT(0)=-DT D ^%DT K %DT S X=Y K:Y<1 X I $D(X) S DFN=DA D SER1^DGLOCK I $D(X) K:'$$VALMSE^DGRPMS(DFN,X,0,"MSNTL") X I $D(X) S DGFRDT=X I $D(^DG(43,1)) S SD1=2 D POS^DGINP 94 Q 95 ; 96 4 D:$D(DG)>9 F^DIE17,DE S DQ=4,DW=".32;12",DV="RDX",DU="",DLB="NTL-RAD",DIFLD=.3293 97 S DE(DW)="C4^DVBHCE3",DE(DW,"INDEX")=1 98 G RE 99 C4 G C4S:$D(DE(4))[0 K DB 100 S X=DE(4),DIC=DIE 101 D EVENT^IVMPLOG(DA) 102 C4S S X="" G:DG(DQ)=X C4F1 K DB 103 S X=DG(DQ),DIC=DIE 104 D EVENT^IVMPLOG(DA) 105 C4F1 S DIEZRXR(2,DIIENS)=$$OREF^DILF($NA(@$$CREF^DILF(DIE))) 106 F DIXR=649 S DIEZRXR(2,DIXR)="" 107 Q 108 X4 S %DT="E",%DT(0)=-DT D ^%DT K %DT S X=Y K:Y<1 X I $D(X) S DFN=DA D SER1^DGLOCK I $D(X) K:'$$VALMSE^DGRPMS(DFN,X,1,"MSNTL") X I $D(X),$D(^DG(43,1)) S SD1=2 D PS^DGINP 109 Q 110 ; 111 5 D:$D(DG)>9 F^DIE17,DE S DQ=5,DW=".32;10",DV="P23'X",DU="",DLB="NTL-Bran. Ser.",DIFLD=.3291 112 S DE(DW)="C5^DVBHCE3",DE(DW,"INDEX")=1 113 S DU="DIC(23," 114 G RE 115 C5 G C5S:$D(DE(5))[0 K DB 116 S X=DE(5),DIC=DIE 117 I $P($G(^DPT(DA,.321)),U,14)]"" D FVP^DGRPMS 118 S X=DE(5),DIC=DIE 119 D EVENT^IVMPLOG(DA) 120 S X=DE(5),DIC=DIE 121 X "S DGXRF=.3291 D ^DGDDC Q" 122 C5S S X="" G:DG(DQ)=X C5F1 K DB 123 S X=DG(DQ),DIC=DIE 124 ; 125 S X=DG(DQ),DIC=DIE 126 D EVENT^IVMPLOG(DA) 127 S X=DG(DQ),DIC=DIE 128 ; 129 C5F1 N X,X1,X2 S DIXR=409 D C5X1(U) K X2 M X2=X D C5X1("O") K X1 M X1=X 130 D 131 . N DIEXARR M DIEXARR=X S DIEZCOND=1 132 . S X=X2(1)="" 133 . S DIEZCOND=$G(X) K X M X=DIEXARR Q:'DIEZCOND 134 . D DELMSE^DGRPMS(DA,2) 135 G C5F2 136 C5X1(DION) K X 137 S X(1)=$G(@DIEZTMP@("V",2,DIIENS,.3291,DION),$P($G(^DPT(DA,.32)),U,10)) 138 S X=$G(X(1)) 139 Q 140 C5F2 Q 141 X5 S DFN=DA K:X=$O(^DIC(23,"B","B.E.C.","")) X I $D(X) D SER1^DGLOCK S DGCOMBR=$G(Y) Q 142 Q 143 ; 144 6 D:$D(DG)>9 F^DIE17,DE S DQ=6,DW=".32;9",DV="RP25'X",DU="",DLB="NTL-Char. Ser.",DIFLD=.329 145 S DE(DW)="C6^DVBHCE3" 146 S DU="DIC(25," 147 G RE 148 C6 G C6S:$D(DE(6))[0 K DB 149 S X=DE(6),DIC=DIE 150 D EVENT^IVMPLOG(DA) 151 C6S S X="" G:DG(DQ)=X C6F1 K DB 152 S X=DG(DQ),DIC=DIE 153 D EVENT^IVMPLOG(DA) 154 C6F1 Q 155 X6 S DFN=DA D SER1^DGLOCK 156 Q 157 ; 158 7 D:$D(DG)>9 F^DIE17,DE S DQ=7,DW=".32;13",DV="FX",DU="",DLB="NTL-Ser. Num.",DIFLD=.3294 159 S DE(DW)="C7^DVBHCE3" 160 G RE 161 C7 G C7S:$D(DE(7))[0 K DB 162 S X=DE(7),DIC=DIE 163 D EVENT^IVMPLOG(DA) 164 C7S S X="" G:DG(DQ)=X C7F1 K DB 165 S X=DG(DQ),DIC=DIE 166 D EVENT^IVMPLOG(DA) 167 C7F1 Q 168 X7 S DFN=DA D SER1^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 169 I $D(X),X'?.ANP K X 170 Q 171 ; 172 8 S DQ=9 ;@31 173 9 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 174 X9 I Z2'[3 S Y="@33" 175 Q 176 10 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 177 X10 I '$D(^DPT(D0,.32)) W !!,*7,?17,DVBON,"No NTLast episode can't edit NNTLast <RET>",DVBOFF X DVBLIT1 R DVBZ:DTIME K DVBZ S Y="@33" 178 Q 179 11 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 180 X11 I $P(^DPT(D0,.32),U,19)'="Y" W !!,*7,?17,DVBON,"No NTLast episode can't edit NNTLast <RET>.",DVBOFF X DVBLIT1 R DVBZ:DTIME K DVBZ S Y="@33" 181 Q 182 12 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 183 X12 S DVBSCR=1 D ^DVBHS4 W !,?34,DVBON,"[NNTLAST]",DVBOFF X DVBLIT1 184 Q 185 13 D:$D(DG)>9 F^DIE17,DE S DQ=13,DW=".32;20",DV="RSX",DU="",DLB="Service NNTL Episode",DIFLD=.32945 186 S DE(DW)="C13^DVBHCE3" 187 S DU="Y:YES;N:NO;" 188 G RE 189 C13 G C13S:$D(DE(13))[0 K DB 190 D ^DVBHCE4 191 C13S S X="" G:DG(DQ)=X C13F1 K DB 192 D ^DVBHCE5 193 C13F1 Q 194 X13 S DFN=DA D SV^DGLOCK I "N"'[$G(X),$D(^DPT(DFN,.32)),$P(^(.32),U,19)'="Y" W !?4,*7,"Other Periods of service are not indicated...NO EDITING!" K X 195 Q 196 ; 197 14 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=14 D X14 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 198 X14 I $P(^DPT(D0,.32),U,20)'="Y" S Y="@33" 199 Q 200 15 D:$D(DG)>9 F^DIE17 G ^DVBHCE6 -
WorldVistAEHR/trunk/r/HINQ-DVB--DVBA--DVBE--DVBC/DVBHCE4.m
r613 r623 1 DVBHCE4 ; ;12/13/08 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(^(.32)) S %Z=^(.32) S %=$P(%Z,U,9) S:%]"" DE(3)=% S %=$P(%Z,U,10) S:%]"" DE(2)=% S %=$P(%Z,U,12) S:%]"" DE(1)=% S %=$P(%Z,U,13) S:%]"" DE(4)=% S %=$P(%Z,U,14) S:%]"" DE(15)=% S %=$P(%Z,U,15) S:%]"" DE(14)=% S %=$P(%Z,U,16) S:%]"" DE(12)=% 5 I S %=$P(%Z,U,17) S:%]"" DE(13)=% S %=$P(%Z,U,18) S:%]"" DE(16)=% S %=$P(%Z,U,20) S:%]"" DE(10)=% 6 K %Z Q 1 DVBHCE4 ; ;12/27/07 2 S X=DE(13),DIC=DIE 7 3 ; 8 W W !?DL+DL-2,DLB_": " 9 Q 10 O D W W Y W:$X>45 !?9 11 I $L(Y)>19,'DV,DV'["I",(DV["F"!(DV["K")) G RW^DIR2 12 W:Y]"" "// " I 'DV,DV["I",$D(DE(DQ))#2 S X="" W " (No Editing)" Q 13 TR R X:DTIME E S (DTOUT,X)=U W $C(7) 14 Q 15 A K DQ(DQ) S DQ=DQ+1 16 B G @DQ 17 RE G PR:$D(DE(DQ)) D W,TR 18 N I X="" G NKEY:$D(^DD("KEY","F",DP,DIFLD)),A:DV'["R",X:'DV,X:D'>0,A 19 RD G QS:X?."?" I X["^" D D G ^DIE17 20 I X="@" D D G Z^DIE2 21 I X=" ",DV["d",DV'["P",$D(^DISV(DUZ,"DIE",DLB)) S X=^(DLB) I DV'["D",DV'["S" W " "_X 22 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 23 K DDER G X 24 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 25 G V:DV'["N" D D I $L($P(X,"."))>24 K X G Z 26 I $P(DQ(DQ),U,5)'["$",X?.1"-".N.1".".N,$P(DQ(DQ),U,5,99)["+X'=X" S X=+X 27 V D @("X"_DQ) K YS 28 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 29 X W:'$D(ZTQUEUED) $C(7),"??" I $D(DB(DQ)) G Z^DIE17 30 S X="?BAD" 31 QS S DZ=X D D,QQ^DIEQ G B 32 D S D=DIFLD,DQ(DQ)=DLB_U_DV_U_DU_U_DW_U_$P($T(@("X"_DQ))," ",2,99) Q 33 Y I '$D(DE(DQ)) D O G RD:"@"'[X,A:DV'["R"&(X="@"),X:X="@" S X=Y G N 34 PR S DG=DV,Y=DE(DQ),X=DU I $D(DQ(DQ,2)) X DQ(DQ,2) G RP 35 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 36 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 37 X:DG["D" ^DD("DD") I DG["S" S %=$P($P(";"_X,";"_Y_":",2),";") S:%]"" Y=% 38 RP D O I X="" S X=DE(DQ) G A:'DV,A:DC<2,N^DIE17 39 I I DV'["I",DV'["#" G RD 40 D E^DIE0 G RD:$D(X),PR 41 Q 42 SET N DIR S DIR(0)="SV"_$E("o",$D(DB(DQ)))_U_DU,DIR("V")=1 43 I $D(DB(DQ)),'$D(DIQUIET) N DIQUIET S DIQUIET=1 44 D ^DIR I 'DDER S %=Y(0),X=Y 45 Q 46 SAVEVALS S @DIEZTMP@("V",DP,DIIENS,DIFLD,"O")=$G(DE(DQ)) S:$D(^("F"))[0 ^("F")=$G(DE(DQ)) 47 I $D(DE(DW,"4/")) S @DIEZTMP@("V",DP,DIIENS,DIFLD,"4/")="" 48 E K @DIEZTMP@("V",DP,DIIENS,DIFLD,"4/") 49 Q 50 NKEY W:'$D(ZTQUEUED) "?? Required key field" S X="?BAD" G QS 51 KEYCHK() Q:$G(DE(DW,"KEY"))="" 1 Q @DE(DW,"KEY") 52 BEGIN S DNM="DVBHCE4",DQ=1 53 1 D:$D(DG)>9 F^DIE17,DE S DQ=1,DW=".32;12",DV="RDX",DU="",DLB="NTL-RAD",DIFLD=.3293 54 S DE(DW)="C1^DVBHCE4",DE(DW,"INDEX")=1 55 G RE 56 C1 G C1S:$D(DE(1))[0 K DB 57 S X=DE(1),DIC=DIE 58 D EVENT^IVMPLOG(DA) 59 C1S S X="" G:DG(DQ)=X C1F1 K DB 60 S X=DG(DQ),DIC=DIE 61 D EVENT^IVMPLOG(DA) 62 C1F1 S DIEZRXR(2,DIIENS)=$$OREF^DILF($NA(@$$CREF^DILF(DIE))) 63 F DIXR=649 S DIEZRXR(2,DIXR)="" 64 Q 65 X1 S %DT="E",%DT(0)=-DT D ^%DT K %DT S X=Y K:Y<1 X I $D(X) S DFN=DA D SER1^DGLOCK I $D(X) K:'$$VALMSE^DGRPMS(DFN,X,1,"MSNTL") X I $D(X),$D(^DG(43,1)) S SD1=2 D PS^DGINP 66 Q 67 ; 68 2 D:$D(DG)>9 F^DIE17,DE S DQ=2,DW=".32;10",DV="P23'X",DU="",DLB="NTL-Bran. Ser.",DIFLD=.3291 69 S DE(DW)="C2^DVBHCE4",DE(DW,"INDEX")=1 70 S DU="DIC(23," 71 G RE 72 C2 G C2S:$D(DE(2))[0 K DB 73 S X=DE(2),DIC=DIE 74 I $P($G(^DPT(DA,.321)),U,14)]"" D FVP^DGRPMS 75 S X=DE(2),DIC=DIE 76 D EVENT^IVMPLOG(DA) 77 S X=DE(2),DIC=DIE 78 X "S DGXRF=.3291 D ^DGDDC Q" 79 C2S S X="" G:DG(DQ)=X C2F1 K DB 80 S X=DG(DQ),DIC=DIE 81 ; 82 S X=DG(DQ),DIC=DIE 83 D EVENT^IVMPLOG(DA) 84 S X=DG(DQ),DIC=DIE 85 ; 86 C2F1 N X,X1,X2 S DIXR=409 D C2X1(U) K X2 M X2=X D C2X1("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(DA,2) 92 G C2F2 93 C2X1(DION) K X 94 S X(1)=$G(@DIEZTMP@("V",2,DIIENS,.3291,DION),$P($G(^DPT(DA,.32)),U,10)) 95 S X=$G(X(1)) 96 Q 97 C2F2 Q 98 X2 S DFN=DA K:X=$O(^DIC(23,"B","B.E.C.","")) X I $D(X) D SER1^DGLOCK S DGCOMBR=$G(Y) Q 99 Q 100 ; 101 3 D:$D(DG)>9 F^DIE17,DE S DQ=3,DW=".32;9",DV="RP25'X",DU="",DLB="NTL-Char. Ser.",DIFLD=.329 102 S DE(DW)="C3^DVBHCE4" 103 S DU="DIC(25," 104 G RE 105 C3 G C3S:$D(DE(3))[0 K DB 106 S X=DE(3),DIC=DIE 107 D EVENT^IVMPLOG(DA) 108 C3S S X="" G:DG(DQ)=X C3F1 K DB 109 S X=DG(DQ),DIC=DIE 110 D EVENT^IVMPLOG(DA) 111 C3F1 Q 112 X3 S DFN=DA D SER1^DGLOCK 113 Q 114 ; 115 4 D:$D(DG)>9 F^DIE17,DE S DQ=4,DW=".32;13",DV="FX",DU="",DLB="NTL-Ser. Num.",DIFLD=.3294 116 S DE(DW)="C4^DVBHCE4" 117 G RE 118 C4 G C4S:$D(DE(4))[0 K DB 119 S X=DE(4),DIC=DIE 120 D EVENT^IVMPLOG(DA) 121 C4S S X="" G:DG(DQ)=X C4F1 K DB 122 S X=DG(DQ),DIC=DIE 123 D EVENT^IVMPLOG(DA) 124 C4F1 Q 125 X4 S DFN=DA D SER1^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 126 I $D(X),X'?.ANP K X 127 Q 128 ; 129 5 S DQ=6 ;@31 130 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 131 X6 I Z2'[3 S Y="@33" 132 Q 133 7 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 134 X7 I '$D(^DPT(D0,.32)) W !!,*7,?17,DVBON,"No NTLast episode can't edit NNTLast <RET>",DVBOFF X DVBLIT1 R DVBZ:DTIME K DVBZ S Y="@33" 135 Q 136 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 137 X8 I $P(^DPT(D0,.32),U,19)'="Y" W !!,*7,?17,DVBON,"No NTLast episode can't edit NNTLast <RET>.",DVBOFF X DVBLIT1 R DVBZ:DTIME K DVBZ S Y="@33" 138 Q 139 9 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 140 X9 S DVBSCR=1 D ^DVBHS4 W !,?34,DVBON,"[NNTLAST]",DVBOFF X DVBLIT1 141 Q 142 10 D:$D(DG)>9 F^DIE17,DE S DQ=10,DW=".32;20",DV="RSX",DU="",DLB="Service NNTL Episode",DIFLD=.32945 143 S DE(DW)="C10^DVBHCE4" 144 S DU="Y:YES;N:NO;" 145 G RE 146 C10 G C10S:$D(DE(10))[0 K DB 147 S X=DE(10),DIC=DIE 148 ; 149 S X=DE(10),DIC=DIE 4 S X=DE(13),DIC=DIE 150 5 X ^DD(2,.32945,1,2,2.3) I X S X=DIV S Y(1)=$S($D(^DPT(D0,.32)):^(.32),1:"") S X=$P(Y(1),U,15),X=X S DIU=X K Y S X="" S DIH=$G(^DPT(DIV(0),.32)),DIV=X S $P(^(.32),U,15)=DIV,DIH=2,DIG=.3296 D ^DICR 151 C10S S X="" G:DG(DQ)=X C10F1 K DB152 S X=DG(DQ),DIC=DIE153 X "I X'=""Y"" S DGXRF=.32945 D ^DGDDC Q"154 S X=DG(DQ),DIC=DIE155 X ^DD(2,.32945,1,2,1.3) I X S X=DIV S Y(1)=$S($D(^DPT(D0,.32)):^(.32),1:"") S X=$P(Y(1),U,15),X=X S DIU=X K Y S X="" S DIH=$G(^DPT(DIV(0),.32)),DIV=X S $P(^(.32),U,15)=DIV,DIH=2,DIG=.3296 D ^DICR156 C10F1 Q157 X10 S DFN=DA D SV^DGLOCK I "N"'[$G(X),$D(^DPT(DFN,.32)),$P(^(.32),U,19)'="Y" W !?4,*7,"Other Periods of service are not indicated...NO EDITING!" K X158 Q159 ;160 11 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^DIE17161 X11 I $P(^DPT(D0,.32),U,20)'="Y" S Y="@33"162 Q163 12 D:$D(DG)>9 F^DIE17,DE S DQ=12,DW=".32;16",DV="RDX",DU="",DLB="NNTL-EOD",DIFLD=.3297164 S DE(DW)="C12^DVBHCE4",DE(DW,"INDEX")=1165 G RE166 C12 G C12S:$D(DE(12))[0 K DB167 S X=DE(12),DIC=DIE168 D EVENT^IVMPLOG(DA)169 C12S S X="" G:DG(DQ)=X C12F1 K DB170 S X=DG(DQ),DIC=DIE171 D EVENT^IVMPLOG(DA)172 C12F1 S DIEZRXR(2,DIIENS)=$$OREF^DILF($NA(@$$CREF^DILF(DIE)))173 F DIXR=663 S DIEZRXR(2,DIXR)=""174 Q175 X12 S %DT="E",%DT(0)=-DT D ^%DT K %DT S X=Y K:Y<1 X I $D(X) S DFN=DA D SER2^DGLOCK I $D(X) K:'$$VALMSE^DGRPMS(DFN,X,0,"MSNNTL") X I $D(X) S DGFRDT=X I $D(^DG(43,1)) S SD1=3 D POS^DGINP176 Q177 ;178 13 D:$D(DG)>9 F^DIE17,DE S DQ=13,DW=".32;17",DV="RDX",DU="",DLB="NNTL-RAD",DIFLD=.3298179 S DE(DW)="C13^DVBHCE4",DE(DW,"INDEX")=1180 G RE181 C13 G C13S:$D(DE(13))[0 K DB182 S X=DE(13),DIC=DIE183 D EVENT^IVMPLOG(DA)184 C13S S X="" G:DG(DQ)=X C13F1 K DB185 S X=DG(DQ),DIC=DIE186 D EVENT^IVMPLOG(DA)187 C13F1 S DIEZRXR(2,DIIENS)=$$OREF^DILF($NA(@$$CREF^DILF(DIE)))188 F DIXR=663 S DIEZRXR(2,DIXR)=""189 Q190 X13 S %DT="E",%DT(0)=-DT D ^%DT K %DT S X=Y K:Y<1 X I $D(X) S DFN=DA D SER2^DGLOCK I $D(X) K:'$$VALMSE^DGRPMS(DFN,X,1,"MSNNTL") X I $D(X),$D(^DG(43,1)) S SD1=3 D PS^DGINP191 Q192 ;193 14 D:$D(DG)>9 F^DIE17,DE S DQ=14,DW=".32;15",DV="P23'X",DU="",DLB="NNTL-Bran. Ser.",DIFLD=.3296194 S DE(DW)="C14^DVBHCE4",DE(DW,"INDEX")=1195 S DU="DIC(23,"196 G RE197 C14 G C14S:$D(DE(14))[0 K DB198 S X=DE(14),DIC=DIE199 I $P($G(^DPT(DA,.321)),U,14)]"" D FVP^DGRPMS200 S X=DE(14),DIC=DIE201 D EVENT^IVMPLOG(DA)202 S X=DE(14),DIC=DIE203 K DIV S DIV=X,D0=DA,DIV(0)=D0 S Y(1)=$S($D(^DPT(D0,.3291)):^(.3291),1:"") S X=$P(Y(1),U,3),X=X S DIU=X K Y S X="" S DIH=$G(^DPT(DIV(0),.3291)),DIV=X S $P(^(.3291),U,3)=DIV,DIH=2,DIG=.32913 D ^DICR204 S X=DE(14),DIC=DIE205 X "S DGXRF=.3296 D ^DGDDC Q"206 C14S S X="" G:DG(DQ)=X C14F1 K DB207 S X=DG(DQ),DIC=DIE208 ;209 S X=DG(DQ),DIC=DIE210 D EVENT^IVMPLOG(DA)211 S X=DG(DQ),DIC=DIE212 K DIV S DIV=X,D0=DA,DIV(0)=D0 S Y(1)=$S($D(^DPT(D0,.3291)):^(.3291),1:"") S X=$P(Y(1),U,3),X=X S DIU=X K Y S X="" S DIH=$G(^DPT(DIV(0),.3291)),DIV=X S $P(^(.3291),U,3)=DIV,DIH=2,DIG=.32913 D ^DICR213 S X=DG(DQ),DIC=DIE214 ;215 C14F1 N X,X1,X2 S DIXR=410 D C14X1(U) K X2 M X2=X D C14X1("O") K X1 M X1=X216 D217 . N DIEXARR M DIEXARR=X S DIEZCOND=1218 . S X=X2(1)=""219 . S DIEZCOND=$G(X) K X M X=DIEXARR Q:'DIEZCOND220 . D DELMSE^DGRPMS(DA,3)221 G C14F2222 C14X1(DION) K X223 S X(1)=$G(@DIEZTMP@("V",2,DIIENS,.3296,DION),$P($G(^DPT(DA,.32)),U,15))224 S X=$G(X(1))225 Q226 C14F2 Q227 X14 S DFN=DA K:X=$O(^DIC(23,"B","B.E.C.","")) X I $D(X) D SER2^DGLOCK S DGCOMBR=$G(Y) Q228 Q229 ;230 15 D:$D(DG)>9 F^DIE17,DE S DQ=15,DW=".32;14",DV="RP25'X",DU="",DLB="NNTL-Char. Ser.",DIFLD=.3295231 S DE(DW)="C15^DVBHCE4"232 S DU="DIC(25,"233 G RE234 C15 G C15S:$D(DE(15))[0 K DB235 S X=DE(15),DIC=DIE236 D EVENT^IVMPLOG(DA)237 C15S S X="" G:DG(DQ)=X C15F1 K DB238 D ^DVBHCE5239 C15F1 Q240 X15 S DFN=DA D SER2^DGLOCK241 Q242 ;243 16 D:$D(DG)>9 F^DIE17,DE S DQ=16,DW=".32;18",DV="FX",DU="",DLB="NNTL-Ser. Num.",DIFLD=.3299244 S DE(DW)="C16^DVBHCE4"245 G RE246 C16 G C16S:$D(DE(16))[0 K DB247 D ^DVBHCE6248 C16S S X="" G:DG(DQ)=X C16F1 K DB249 D ^DVBHCE7250 C16F1 Q251 X16 S DFN=DA D SER2^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) X252 I $D(X),X'?.ANP K X253 Q254 ;255 17 S DQ=18 ;@33256 18 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=18 D X18 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17257 X18 I Z2'[4 S Y="@3"258 Q259 19 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=19 D X19 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17260 X19 S DVBSCR=1 D ^DVBHS4261 Q262 20 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=20 D X20 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17263 X20 S DVBJC2=$S($D(^DPT(D0,.32)):$P(^(.32),U,3),1:"")264 Q265 21 D:$D(DG)>9 F^DIE17 G ^DVBHCE8 -
WorldVistAEHR/trunk/r/HINQ-DVB--DVBA--DVBE--DVBC/DVBHCE5.m
r613 r623 1 DVBHCE5 ; ;12/ 13/081 DVBHCE5 ; ;12/27/07 2 2 S X=DG(DQ),DIC=DIE 3 D EVENT^IVMPLOG(DA) 3 X "I X'=""Y"" S DGXRF=.32945 D ^DGDDC Q" 4 S X=DG(DQ),DIC=DIE 5 X ^DD(2,.32945,1,2,1.3) I X S X=DIV S Y(1)=$S($D(^DPT(D0,.32)):^(.32),1:"") S X=$P(Y(1),U,15),X=X S DIU=X K Y S X="" S DIH=$G(^DPT(DIV(0),.32)),DIV=X S $P(^(.32),U,15)=DIV,DIH=2,DIG=.3296 D ^DICR -
WorldVistAEHR/trunk/r/HINQ-DVB--DVBA--DVBE--DVBC/DVBHCE6.m
r613 r623 1 DVBHCE6 ; ;12/13/08 2 S X=DE(16),DIC=DIE 3 D EVENT^IVMPLOG(DA) 1 DVBHCE6 ; ;12/27/07 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(^(.32)) S %Z=^(.32) S %=$P(%Z,U,3) S:%]"" DE(10)=% S %=$P(%Z,U,14) S:%]"" DE(4)=% S %=$P(%Z,U,15) S:%]"" DE(3)=% S %=$P(%Z,U,16) S:%]"" DE(1)=% S %=$P(%Z,U,17) S:%]"" DE(2)=% S %=$P(%Z,U,18) S:%]"" DE(5)=% 5 K %Z Q 6 ; 7 W W !?DL+DL-2,DLB_": " 8 Q 9 O D W W Y W:$X>45 !?9 10 I $L(Y)>19,'DV,DV'["I",(DV["F"!(DV["K")) G RW^DIR2 11 W:Y]"" "// " I 'DV,DV["I",$D(DE(DQ))#2 S X="" W " (No Editing)" Q 12 TR R X:DTIME E S (DTOUT,X)=U W $C(7) 13 Q 14 A K DQ(DQ) S DQ=DQ+1 15 B G @DQ 16 RE G PR:$D(DE(DQ)) D W,TR 17 N I X="" G NKEY:$D(^DD("KEY","F",DP,DIFLD)),A:DV'["R",X:'DV,X:D'>0,A 18 RD G QS:X?."?" I X["^" D D G ^DIE17 19 I X="@" D D G Z^DIE2 20 I X=" ",DV["d",DV'["P",$D(^DISV(DUZ,"DIE",DLB)) S X=^(DLB) I DV'["D",DV'["S" W " "_X 21 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 22 K DDER G X 23 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 24 G V:DV'["N" D D I $L($P(X,"."))>24 K X G Z 25 I $P(DQ(DQ),U,5)'["$",X?.1"-".N.1".".N,$P(DQ(DQ),U,5,99)["+X'=X" S X=+X 26 V D @("X"_DQ) K YS 27 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 28 X W:'$D(ZTQUEUED) $C(7),"??" I $D(DB(DQ)) G Z^DIE17 29 S X="?BAD" 30 QS S DZ=X D D,QQ^DIEQ G B 31 D S D=DIFLD,DQ(DQ)=DLB_U_DV_U_DU_U_DW_U_$P($T(@("X"_DQ))," ",2,99) Q 32 Y I '$D(DE(DQ)) D O G RD:"@"'[X,A:DV'["R"&(X="@"),X:X="@" S X=Y G N 33 PR S DG=DV,Y=DE(DQ),X=DU I $D(DQ(DQ,2)) X DQ(DQ,2) G RP 34 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 35 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 36 X:DG["D" ^DD("DD") I DG["S" S %=$P($P(";"_X,";"_Y_":",2),";") S:%]"" Y=% 37 RP D O I X="" S X=DE(DQ) G A:'DV,A:DC<2,N^DIE17 38 I I DV'["I",DV'["#" G RD 39 D E^DIE0 G RD:$D(X),PR 40 Q 41 SET N DIR S DIR(0)="SV"_$E("o",$D(DB(DQ)))_U_DU,DIR("V")=1 42 I $D(DB(DQ)),'$D(DIQUIET) N DIQUIET S DIQUIET=1 43 D ^DIR I 'DDER S %=Y(0),X=Y 44 Q 45 SAVEVALS S @DIEZTMP@("V",DP,DIIENS,DIFLD,"O")=$G(DE(DQ)) S:$D(^("F"))[0 ^("F")=$G(DE(DQ)) 46 I $D(DE(DW,"4/")) S @DIEZTMP@("V",DP,DIIENS,DIFLD,"4/")="" 47 E K @DIEZTMP@("V",DP,DIIENS,DIFLD,"4/") 48 Q 49 NKEY W:'$D(ZTQUEUED) "?? Required key field" S X="?BAD" G QS 50 KEYCHK() Q:$G(DE(DW,"KEY"))="" 1 Q @DE(DW,"KEY") 51 BEGIN S DNM="DVBHCE6",DQ=1 52 1 D:$D(DG)>9 F^DIE17,DE S DQ=1,DW=".32;16",DV="RDX",DU="",DLB="NNTL-EOD",DIFLD=.3297 53 S DE(DW)="C1^DVBHCE6",DE(DW,"INDEX")=1 54 G RE 55 C1 G C1S:$D(DE(1))[0 K DB 56 S X=DE(1),DIC=DIE 57 D EVENT^IVMPLOG(DA) 58 C1S S X="" G:DG(DQ)=X C1F1 K DB 59 S X=DG(DQ),DIC=DIE 60 D EVENT^IVMPLOG(DA) 61 C1F1 S DIEZRXR(2,DIIENS)=$$OREF^DILF($NA(@$$CREF^DILF(DIE))) 62 F DIXR=663 S DIEZRXR(2,DIXR)="" 63 Q 64 X1 S %DT="E",%DT(0)=-DT D ^%DT K %DT S X=Y K:Y<1 X I $D(X) S DFN=DA D SER2^DGLOCK I $D(X) K:'$$VALMSE^DGRPMS(DFN,X,0,"MSNNTL") X I $D(X) S DGFRDT=X I $D(^DG(43,1)) S SD1=3 D POS^DGINP 65 Q 66 ; 67 2 D:$D(DG)>9 F^DIE17,DE S DQ=2,DW=".32;17",DV="RDX",DU="",DLB="NNTL-RAD",DIFLD=.3298 68 S DE(DW)="C2^DVBHCE6",DE(DW,"INDEX")=1 69 G RE 70 C2 G C2S:$D(DE(2))[0 K DB 71 S X=DE(2),DIC=DIE 72 D EVENT^IVMPLOG(DA) 73 C2S S X="" G:DG(DQ)=X C2F1 K DB 74 S X=DG(DQ),DIC=DIE 75 D EVENT^IVMPLOG(DA) 76 C2F1 S DIEZRXR(2,DIIENS)=$$OREF^DILF($NA(@$$CREF^DILF(DIE))) 77 F DIXR=663 S DIEZRXR(2,DIXR)="" 78 Q 79 X2 S %DT="E",%DT(0)=-DT D ^%DT K %DT S X=Y K:Y<1 X I $D(X) S DFN=DA D SER2^DGLOCK I $D(X) K:'$$VALMSE^DGRPMS(DFN,X,1,"MSNNTL") X I $D(X),$D(^DG(43,1)) S SD1=3 D PS^DGINP 80 Q 81 ; 82 3 D:$D(DG)>9 F^DIE17,DE S DQ=3,DW=".32;15",DV="P23'X",DU="",DLB="NNTL-Bran. Ser.",DIFLD=.3296 83 S DE(DW)="C3^DVBHCE6",DE(DW,"INDEX")=1 84 S DU="DIC(23," 85 G RE 86 C3 G C3S:$D(DE(3))[0 K DB 87 S X=DE(3),DIC=DIE 88 I $P($G(^DPT(DA,.321)),U,14)]"" D FVP^DGRPMS 89 S X=DE(3),DIC=DIE 90 D EVENT^IVMPLOG(DA) 91 S X=DE(3),DIC=DIE 92 K DIV S DIV=X,D0=DA,DIV(0)=D0 S Y(1)=$S($D(^DPT(D0,.3291)):^(.3291),1:"") S X=$P(Y(1),U,3),X=X S DIU=X K Y S X="" S DIH=$G(^DPT(DIV(0),.3291)),DIV=X S $P(^(.3291),U,3)=DIV,DIH=2,DIG=.32913 D ^DICR 93 S X=DE(3),DIC=DIE 94 X "S DGXRF=.3296 D ^DGDDC Q" 95 C3S S X="" G:DG(DQ)=X C3F1 K DB 96 S X=DG(DQ),DIC=DIE 97 ; 98 S X=DG(DQ),DIC=DIE 99 D EVENT^IVMPLOG(DA) 100 S X=DG(DQ),DIC=DIE 101 K DIV S DIV=X,D0=DA,DIV(0)=D0 S Y(1)=$S($D(^DPT(D0,.3291)):^(.3291),1:"") S X=$P(Y(1),U,3),X=X S DIU=X K Y S X="" S DIH=$G(^DPT(DIV(0),.3291)),DIV=X S $P(^(.3291),U,3)=DIV,DIH=2,DIG=.32913 D ^DICR 102 S X=DG(DQ),DIC=DIE 103 ; 104 C3F1 N X,X1,X2 S DIXR=410 D C3X1(U) K X2 M X2=X D C3X1("O") K X1 M X1=X 105 D 106 . N DIEXARR M DIEXARR=X S DIEZCOND=1 107 . S X=X2(1)="" 108 . S DIEZCOND=$G(X) K X M X=DIEXARR Q:'DIEZCOND 109 . D DELMSE^DGRPMS(DA,3) 110 G C3F2 111 C3X1(DION) K X 112 S X(1)=$G(@DIEZTMP@("V",2,DIIENS,.3296,DION),$P($G(^DPT(DA,.32)),U,15)) 113 S X=$G(X(1)) 114 Q 115 C3F2 Q 116 X3 S DFN=DA K:X=$O(^DIC(23,"B","B.E.C.","")) X I $D(X) D SER2^DGLOCK S DGCOMBR=$G(Y) Q 117 Q 118 ; 119 4 D:$D(DG)>9 F^DIE17,DE S DQ=4,DW=".32;14",DV="RP25'X",DU="",DLB="NNTL-Char. Ser.",DIFLD=.3295 120 S DE(DW)="C4^DVBHCE6" 121 S DU="DIC(25," 122 G RE 123 C4 G C4S:$D(DE(4))[0 K DB 124 S X=DE(4),DIC=DIE 125 D EVENT^IVMPLOG(DA) 126 C4S S X="" G:DG(DQ)=X C4F1 K DB 127 S X=DG(DQ),DIC=DIE 128 D EVENT^IVMPLOG(DA) 129 C4F1 Q 130 X4 S DFN=DA D SER2^DGLOCK 131 Q 132 ; 133 5 D:$D(DG)>9 F^DIE17,DE S DQ=5,DW=".32;18",DV="FX",DU="",DLB="NNTL-Ser. Num.",DIFLD=.3299 134 S DE(DW)="C5^DVBHCE6" 135 G RE 136 C5 G C5S:$D(DE(5))[0 K DB 137 S X=DE(5),DIC=DIE 138 D EVENT^IVMPLOG(DA) 139 C5S S X="" G:DG(DQ)=X C5F1 K DB 140 S X=DG(DQ),DIC=DIE 141 D EVENT^IVMPLOG(DA) 142 C5F1 Q 143 X5 S DFN=DA D SER2^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 144 I $D(X),X'?.ANP K X 145 Q 146 ; 147 6 S DQ=7 ;@33 148 7 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 149 X7 I Z2'[4 S Y="@3" 150 Q 151 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 152 X8 S DVBSCR=1 D ^DVBHS4 153 Q 154 9 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 155 X9 S DVBJC2=$S($D(^DPT(D0,.32)):$P(^(.32),U,3),1:"") 156 Q 157 10 D:$D(DG)>9 F^DIE17,DE S DQ=10,DW=".32;3",DV="*P21'Xa",DU="",DLB="PERIOD OF SERVICE",DIFLD=.323 158 S DE(DW)="C10^DVBHCE6" 159 S DU="DIC(21," 160 G RE 161 C10 G C10S:$D(DE(10))[0 K DB 162 S X=DE(10),DIC=DIE 163 K ^DPT("APOS",$E(X,1,30),DA) 164 S X=DE(10),DIC=DIE 165 ; 166 S X=DE(10),DIC=DIE 167 I ($T(AVAFC^VAFCDD01)'="") S VAFCF=".323;" D AVAFC^VAFCDD01(DA) 168 S X=DE(10),DIC=DIE 169 D EVENT^IVMPLOG(DA) 170 S X=DE(10),DIIX=2_U_DIFLD D AUDIT^DIET 171 C10S S X="" G:DG(DQ)=X C10F1 K DB 172 S X=DG(DQ),DIC=DIE 173 S ^DPT("APOS",$E(X,1,30),DA)="" 174 S X=DG(DQ),DIC=DIE 175 X ^DD(2,.323,1,2,1.3) I X S X=DIV S Y(1)=$S($D(^DPT(D0,"ODS")):^("ODS"),1:"") S X=$P(Y(1),U,1),X=X S DIU=X K Y X ^DD(2,.323,1,2,1.1) X ^DD(2,.323,1,2,1.4) 176 S X=DG(DQ),DIC=DIE 177 I ($T(AVAFC^VAFCDD01)'="") S VAFCF=".323;" D AVAFC^VAFCDD01(DA) 178 S X=DG(DQ),DIC=DIE 179 D EVENT^IVMPLOG(DA) 180 I $D(DE(10))'[0!(^DD(DP,DIFLD,"AUDIT")'="e") S X=DG(DQ),DIIX=3_U_DIFLD D AUDIT^DIET 181 C10F1 Q 182 X10 S DFN=DA D POS^DGLOCK1 183 Q 184 ; 185 11 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 186 X11 I X'=DVBJC2 S DVBJ2=1 187 Q 188 12 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 189 X12 K DVBJC2 190 Q 191 13 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=13 D X13 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 192 X13 S Y="@3" 193 Q 194 14 S DQ=15 ;@104 195 15 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 196 X15 D ^DVBHS5 S Y="@5" K DXS 197 Q 198 16 S DQ=17 ;@204 199 17 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=17 D X17 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 200 X17 I Z2'[1 S Y="@205" 201 Q 202 18 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=18 D X18 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 203 X18 S DVBSCR=1 D ^DVBHS5 S DVBJ2=1 204 Q 205 19 D:$D(DG)>9 F^DIE17 G ^DVBHCE7 -
WorldVistAEHR/trunk/r/HINQ-DVB--DVBA--DVBE--DVBC/DVBHCE7.m
r613 r623 1 DVBHCE7 ; ;12/13/08 2 S X=DG(DQ),DIC=DIE 3 D EVENT^IVMPLOG(DA) 1 DVBHCE7 ; ;12/27/07 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(^(.3)) S %Z=^(.3) S %=$P(%Z,U,1) S:%]"" DE(13)=% S %=$P(%Z,U,6) S:%]"" DE(6)=% 5 I $D(^(.36)) S %Z=^(.36) S %=$P(%Z,U,1) S:%]"" DE(16)=% 6 I $D(^(.361)) S %Z=^(.361) S %=$P(%Z,U,1) S:%]"" DE(1)=% S %=$P(%Z,U,2) S:%]"" DE(3)=% S %=$P(%Z,U,5) S:%]"" DE(4)=% 7 I $D(^("TYPE")) S %Z=^("TYPE") S %=$P(%Z,U,1) S:%]"" DE(11)=% 8 I $D(^("VET")) S %Z=^("VET") S %=$P(%Z,U,1) S:%]"" DE(12)=% 9 K %Z Q 10 ; 11 W W !?DL+DL-2,DLB_": " 12 Q 13 O D W W Y W:$X>45 !?9 14 I $L(Y)>19,'DV,DV'["I",(DV["F"!(DV["K")) G RW^DIR2 15 W:Y]"" "// " I 'DV,DV["I",$D(DE(DQ))#2 S X="" W " (No Editing)" Q 16 TR R X:DTIME E S (DTOUT,X)=U W $C(7) 17 Q 18 A K DQ(DQ) S DQ=DQ+1 19 B G @DQ 20 RE G PR:$D(DE(DQ)) D W,TR 21 N I X="" G NKEY:$D(^DD("KEY","F",DP,DIFLD)),A:DV'["R",X:'DV,X:D'>0,A 22 RD G QS:X?."?" I X["^" D D G ^DIE17 23 I X="@" D D G Z^DIE2 24 I X=" ",DV["d",DV'["P",$D(^DISV(DUZ,"DIE",DLB)) S X=^(DLB) I DV'["D",DV'["S" W " "_X 25 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 26 K DDER G X 27 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 28 G V:DV'["N" D D I $L($P(X,"."))>24 K X G Z 29 I $P(DQ(DQ),U,5)'["$",X?.1"-".N.1".".N,$P(DQ(DQ),U,5,99)["+X'=X" S X=+X 30 V D @("X"_DQ) K YS 31 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 32 X W:'$D(ZTQUEUED) $C(7),"??" I $D(DB(DQ)) G Z^DIE17 33 S X="?BAD" 34 QS S DZ=X D D,QQ^DIEQ G B 35 D S D=DIFLD,DQ(DQ)=DLB_U_DV_U_DU_U_DW_U_$P($T(@("X"_DQ))," ",2,99) Q 36 Y I '$D(DE(DQ)) D O G RD:"@"'[X,A:DV'["R"&(X="@"),X:X="@" S X=Y G N 37 PR S DG=DV,Y=DE(DQ),X=DU I $D(DQ(DQ,2)) X DQ(DQ,2) G RP 38 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 39 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 40 X:DG["D" ^DD("DD") I DG["S" S %=$P($P(";"_X,";"_Y_":",2),";") S:%]"" Y=% 41 RP D O I X="" S X=DE(DQ) G A:'DV,A:DC<2,N^DIE17 42 I I DV'["I",DV'["#" G RD 43 D E^DIE0 G RD:$D(X),PR 44 Q 45 SET N DIR S DIR(0)="SV"_$E("o",$D(DB(DQ)))_U_DU,DIR("V")=1 46 I $D(DB(DQ)),'$D(DIQUIET) N DIQUIET S DIQUIET=1 47 D ^DIR I 'DDER S %=Y(0),X=Y 48 Q 49 SAVEVALS S @DIEZTMP@("V",DP,DIIENS,DIFLD,"O")=$G(DE(DQ)) S:$D(^("F"))[0 ^("F")=$G(DE(DQ)) 50 I $D(DE(DW,"4/")) S @DIEZTMP@("V",DP,DIIENS,DIFLD,"4/")="" 51 E K @DIEZTMP@("V",DP,DIIENS,DIFLD,"4/") 52 Q 53 NKEY W:'$D(ZTQUEUED) "?? Required key field" S X="?BAD" G QS 54 KEYCHK() Q:$G(DE(DW,"KEY"))="" 1 Q @DE(DW,"KEY") 55 BEGIN S DNM="DVBHCE7",DQ=1 56 1 D:$D(DG)>9 F^DIE17,DE S DQ=1,DW=".361;1",DV="SX",DU="",DLB="ELIGIBILITY STATUS",DIFLD=.3611 57 S DE(DW)="C1^DVBHCE7" 58 S DU="P:PENDING VERIFICATION;R:PENDING RE-VERIFICATION;V:VERIFIED;" 59 G RE 60 C1 G C1S:$D(DE(1))[0 K DB 61 S X=DE(1),DIC=DIE 62 ; 63 S X=DE(1),DIC=DIE 64 ; 65 S X=DE(1),DIC=DIE 66 D EVENT^IVMPLOG(DA) 67 C1S S X="" G:DG(DQ)=X C1F1 K DB 68 S X=DG(DQ),DIC=DIE 69 K DIV S DIV=X,D0=DA,DIV(0)=D0 S Y(1)=$S($D(^DPT(D0,.361)):^(.361),1:"") S X=$P(Y(1),U,6),X=X S DIU=X K Y X ^DD(2,.3611,1,1,1.1) X ^DD(2,.3611,1,1,1.4) 70 S X=DG(DQ),DIC=DIE 71 K DIV S DIV=X,D0=DA,DIV(0)=D0 S Y(1)=$S($D(^DPT(D0,.361)):^(.361),1:"") S X=$P(Y(1),U,2),X=X S DIU=X K Y S X=DIV S X=DT X ^DD(2,.3611,1,2,1.4) 72 S X=DG(DQ),DIC=DIE 73 D EVENT^IVMPLOG(DA) 74 C1F1 Q 75 X1 D EK^DGLOCK Q:'$D(X) 76 Q 77 ; 78 2 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=2 G A 79 3 D:$D(DG)>9 F^DIE17,DE S DQ=3,DW=".361;2",DV="DX",DU="",DLB="ELIGIBILITY STATUS DATE",DIFLD=.3612 80 S DE(DW)="C3^DVBHCE7" 81 S X="TODAY" 82 S Y=X 83 G Y 84 C3 G C3S:$D(DE(3))[0 K DB 85 S X=DE(3),DIC=DIE 86 ; 87 S X=DE(3),DIC=DIE 88 D EVENT^IVMPLOG(DA) 89 C3S S X="" G:DG(DQ)=X C3F1 K DB 90 S X=DG(DQ),DIC=DIE 91 K DIV S DIV=X,D0=DA,DIV(0)=D0 S Y(1)=$S($D(^DPT(D0,.361)):^(.361),1:"") S X=$P(Y(1),U,6),X=X S DIU=X K Y S X=DIV S X=$S(($D(DUZ)#2):DUZ,1:"") X ^DD(2,.3612,1,1,1.4) 92 S X=DG(DQ),DIC=DIE 93 D EVENT^IVMPLOG(DA) 94 C3F1 Q 95 X3 S %DT="E",%DT(0)=-DT D ^%DT K %DT S X=Y K:Y<1 X I $D(X) D EK^DGLOCK 96 Q 97 ; 98 4 D:$D(DG)>9 F^DIE17,DE S DQ=4,DW=".361;5",DV="FX",DU="",DLB="ELIGIBILITY VERIF. METHOD",DIFLD=.3615 99 S DE(DW)="C4^DVBHCE7" 100 S X="HINQ" 101 S Y=X 102 G Y 103 C4 G C4S:$D(DE(4))[0 K DB 104 S X=DE(4),DIC=DIE 105 D EVENT^IVMPLOG(DA) 106 C4S S X="" G:DG(DQ)=X C4F1 K DB 107 S X=DG(DQ),DIC=DIE 108 D EVENT^IVMPLOG(DA) 109 C4F1 Q 110 X4 K:$L(X)>50!($L(X)<2) X I $D(X) D EK^DGLOCK 111 I $D(X),X'?.ANP K X 112 Q 113 ; 114 5 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=5 G A 115 6 D:$D(DG)>9 F^DIE17,DE S DQ=6,DW=".3;6",DV="DX",DU="",DLB="MONETARY BEN. VERIFY DATE",DIFLD=.306 116 S X="TODAY" 117 S Y=X 118 G Y 119 X6 S %DT="E",%DT(0)=-DT D ^%DT K %DT S X=Y K:Y<1 X I $D(X) D EK^DGLOCK 120 Q 121 ; 122 7 S D=0 K DE(1) ;361 123 S DIFLD=361,DGO="^DVBHCE8",DC="3^2.0361IP^E^",DV="2.0361M*P8'X",DW="0;1",DOW="ELIGIBILITY",DLB="Select "_DOW S:D DC=DC_D 124 S DU="DIC(8," 125 G RE:D I $D(DSC(2.0361))#2,$P(DSC(2.0361),"I $D(^UTILITY(",1)="" X DSC(2.0361) S D=$O(^(0)) S:D="" D=-1 G M7 126 S D=$S($D(^DPT(DA,"E",0)):$P(^(0),U,3,4),$O(^(0))'="":$O(^(0)),1:-1) 127 M7 I D>0 S DC=DC_D I $D(^DPT(DA,"E",+D,0)) S DE(7)=$P(^(0),U,1) 128 G RE 129 R7 D DE 130 S D=$S($D(^DPT(DA,"E",0)):$P(^(0),U,3,4),1:1) G 7+1 131 ; 132 8 S DQ=9 ;@205 133 9 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 134 X9 I Z2'[2 S Y="@206" 135 Q 136 10 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 137 X10 S DVBSCR=1 D ^DVBHS5 S DVBJ2=1 138 Q 139 11 S DW="TYPE;1",DV="RP391'a",DU="",DLB="TYPE",DIFLD=391 140 S DE(DW)="C11^DVBHCE7",DE(DW,"INDEX")=1 141 S DU="DG(391," 142 G RE 143 C11 G C11S:$D(DE(11))[0 K DB 144 S X=DE(11),DIC=DIE 145 I ($T(AVAFC^VAFCDD01)'="") S VAFCF="391;" D AVAFC^VAFCDD01(DA) 146 S X=DE(11),DIIX=2_U_DIFLD D AUDIT^DIET 147 C11S S X="" G:DG(DQ)=X C11F1 K DB 148 S X=DG(DQ),DIC=DIE 149 I ($T(AVAFC^VAFCDD01)'="") S VAFCF="391;" D AVAFC^VAFCDD01(DA) 150 I $D(DE(11))'[0!(^DD(DP,DIFLD,"AUDIT")'="e") S X=DG(DQ),DIIX=3_U_DIFLD D AUDIT^DIET 151 C11F1 N X,X1,X2 S DIXR=664 D C11X1(U) K X2 M X2=X D C11X1("O") K X1 M X1=X 152 I $G(X(1))]"" D 153 . K ^DPT("APTYPE",X,DA) 154 K X M X=X2 I $G(X(1))]"" D 155 . S ^DPT("APTYPE",X,DA)="" 156 G C11F2 157 C11X1(DION) K X 158 S X(1)=$G(@DIEZTMP@("V",2,DIIENS,391,DION),$P($G(^DPT(DA,"TYPE")),U,1)) 159 S X=$G(X(1)) 160 Q 161 C11F2 Q 162 X11 Q 163 12 D:$D(DG)>9 F^DIE17,DE S DQ=12,DW="VET;1",DV="RSXa",DU="",DLB="VETERAN (Y/N)?",DIFLD=1901 164 S DE(DW)="C12^DVBHCE7" 165 S DU="Y:YES;N:NO;" 166 G RE 167 C12 G C12S:$D(DE(12))[0 K DB 168 S X=DE(12),DIC=DIE 169 S DFN=DA D EN^DGMTCOR K DGMTCOR 170 S X=DE(12),DIC=DIE 171 S DFN=DA D EN^DGRP7CC 172 S X=DE(12),DIC=DIE 173 ; 174 S X=DE(12),DIC=DIE 175 D AUTOUPD^DGENA2(DA) 176 S X=DE(12),DIC=DIE 177 I ($T(AVAFC^VAFCDD01)'="") S VAFCF="1901;" D AVAFC^VAFCDD01(DA) 178 S X=DE(12),DIC=DIE 179 D:($T(ADGRU^DGRUDD01)'="") ADGRU^DGRUDD01(DA) 180 S X=DE(12),DIIX=2_U_DIFLD D AUDIT^DIET 181 C12S S X="" G:DG(DQ)=X C12F1 K DB 182 D ^DVBHCE9 183 C12F1 Q 184 X12 I $D(X) S:'$D(DPTX) DFN=DA D:'$D(^XUSEC("DG ELIGIBILITY",DUZ)) VAGE^DGLOCK:X="Y" I $D(X) D:$D(DFN) EV^DGLOCK 185 Q 186 ; 187 13 D:$D(DG)>9 F^DIE17,DE S DQ=13,DW=".3;1",DV="RSXa",DU="",DLB="SERVICE CONNECTED?",DIFLD=.301 188 S DE(DW)="C13^DVBHCE7" 189 S DU="Y:YES;N:NO;" 190 G RE 191 C13 G C13S:$D(DE(13))[0 K DB 192 S X=DE(13),DIC=DIE 193 ; 194 S X=DE(13),DIC=DIE 195 ; 196 S X=DE(13),DIC=DIE 197 D AUTOUPD^DGENA2(DA) 198 S X=DE(13),DIC=DIE 199 I ($T(AVAFC^VAFCDD01)'="") S VAFCF=".301;" D AVAFC^VAFCDD01(DA) 200 S X=DE(13),DIC=DIE 201 D:($T(ADGRU^DGRUDD01)'="") ADGRU^DGRUDD01(DA) 202 S X=DE(13),DIIX=2_U_DIFLD D AUDIT^DIET 203 C13S S X="" G:DG(DQ)=X C13F1 K DB 204 D ^DVBHCE10 205 C13F1 Q 206 X13 S DFN=DA D EV^DGLOCK I $D(X),X="Y" D VET^DGLOCK 207 Q 208 ; 209 14 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=14 D X14 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 210 X14 I X="N" S Y="@2063" 211 Q 212 15 S DQ=16 ;@2063 213 16 D:$D(DG)>9 F^DIE17,DE S DQ=16,DW=".36;1",DV="*P8'Xa",DU="",DLB="PRIMARY ELIGIBILITY CODE",DIFLD=.361 214 S DE(DW)="C16^DVBHCE7" 215 S DU="DIC(8," 216 G RE 217 C16 G C16S:$D(DE(16))[0 K DB 218 D ^DVBHCE11 219 C16S S X="" G:DG(DQ)=X C16F1 K DB 220 D ^DVBHCE12 221 C16F1 Q 222 X16 S DFN=DA D EV^DGLOCK I $D(X) D ECD^DGLOCK1 223 Q 224 ; 225 17 S DQ=18 ;@206 226 18 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=18 D X18 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 227 X18 I Z2'[3 S Y="@104" 228 Q 229 19 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=19 D X19 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 230 X19 S DVBSCR=1 D ^DVBHS5 S DVBJ2=1 231 Q 232 20 D:$D(DG)>9 F^DIE17 G ^DVBHCE13 -
WorldVistAEHR/trunk/r/HINQ-DVB--DVBA--DVBE--DVBC/DVBHCE8.m
r613 r623 1 DVBHCE8 ; ;12/ 13/081 DVBHCE8 ; ;12/27/07 2 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(^(.3)) S %Z=^(.3) S %=$P(%Z,U,1) S:%]"" DE(22)=% S %=$P(%Z,U,6) S:%]"" DE(15)=% 5 I $D(^(.32)) S %Z=^(.32) S %=$P(%Z,U,3) S:%]"" DE(1)=% 6 I $D(^(.36)) S %Z=^(.36) S %=$P(%Z,U,1) S:%]"" DE(25)=% 7 I $D(^(.361)) S %Z=^(.361) S %=$P(%Z,U,1) S:%]"" DE(10)=% S %=$P(%Z,U,2) S:%]"" DE(12)=% S %=$P(%Z,U,5) S:%]"" DE(13)=% 8 I $D(^("TYPE")) S %Z=^("TYPE") S %=$P(%Z,U,1) S:%]"" DE(20)=% 9 I $D(^("VET")) S %Z=^("VET") S %=$P(%Z,U,1) S:%]"" DE(21)=% 3 DE S DIE="^DPT(D0,""E"",",DIC=DIE,DP=2.0361,DL=2,DIEL=1,DU="" K DG,DE,DB Q:$O(^DPT(D0,"E",DA,""))="" 4 I $D(^(0)) S %Z=^(0) S %=$P(%Z,U,1) S:%]"" DE(1)=% 10 5 K %Z Q 11 6 ; … … 54 49 NKEY W:'$D(ZTQUEUED) "?? Required key field" S X="?BAD" G QS 55 50 KEYCHK() Q:$G(DE(DW,"KEY"))="" 1 Q @DE(DW,"KEY") 56 BEGIN S DNM="DVBHCE8",DQ=1 57 1 D:$D(DG)>9 F^DIE17,DE S DQ=1,DW=".32;3",DV="*P21'Xa",DU="",DLB="PERIOD OF SERVICE",DIFLD=.32351 BEGIN S DNM="DVBHCE8",DQ=1+D G B 52 1 S DW="0;1",DV="M*P8'X#",DU="",DLB="ELIGIBILITY",DIFLD=.01 58 53 S DE(DW)="C1^DVBHCE8" 59 S DU="DIC( 21,"60 G RE 54 S DU="DIC(8," 55 G RE:'D S DQ=2 G 2 61 56 C1 G C1S:$D(DE(1))[0 K DB 62 57 S X=DE(1),DIC=DIE 63 K ^DPT( "APOS",$E(X,1,30),DA)58 K ^DPT(DA(1),"E","B",$E(X,1,30),DA) 64 59 S X=DE(1),DIC=DIE 65 ;60 K ^DPT("AEL",DA(1),+X) 66 61 S X=DE(1),DIC=DIE 67 I ($T(AVAFC^VAFCDD01)'="") S VAFCF=".323;" D AVAFC^VAFCDD01(DA)62 D E32^VADPT62 68 63 S X=DE(1),DIC=DIE 69 D EVENT^IVMPLOG(DA) 70 S X=DE(1),DIIX=2_U_DIFLD D AUDIT^DIET 64 X "S DFN=DA(1) D EN^DGMTR K DGREQF" 65 S X=DE(1),DIC=DIE 66 D AUTOUPD^DGENA2(DA(1)) 71 67 C1S S X="" G:DG(DQ)=X C1F1 K DB 72 68 S X=DG(DQ),DIC=DIE 73 S ^DPT( "APOS",$E(X,1,30),DA)=""69 S ^DPT(DA(1),"E","B",$E(X,1,30),DA)="" 74 70 S X=DG(DQ),DIC=DIE 75 X ^DD(2,.323,1,2,1.3) I X S X=DIV S Y(1)=$S($D(^DPT(D0,"ODS")):^("ODS"),1:"") S X=$P(Y(1),U,1),X=X S DIU=X K Y X ^DD(2,.323,1,2,1.1) X ^DD(2,.323,1,2,1.4)71 S ^DPT("AEL",DA(1),+X)="" 76 72 S X=DG(DQ),DIC=DIE 77 I ($T(AVAFC^VAFCDD01)'="") S VAFCF=".323;" D AVAFC^VAFCDD01(DA)73 D E31^VADPT62 78 74 S X=DG(DQ),DIC=DIE 79 D EVENT^IVMPLOG(DA) 80 I $D(DE(1))'[0!(^DD(DP,DIFLD,"AUDIT")'="e") S X=DG(DQ),DIIX=3_U_DIFLD D AUDIT^DIET 75 X "S DFN=DA(1) D EN^DGMTR K DGREQF" 76 S X=DG(DQ),DIC=DIE 77 D AUTOUPD^DGENA2(DA(1)) 81 78 C1F1 Q 82 X1 S D FN=DA D POS^DGLOCK179 X1 S DIC("S")="I '$P(^(0),U,7),$S($P(^(0),U,8):1,'$D(^DPT(D0,.36)):0,1:Y=+^(.36)),$$ELGCHK^DGRPTU(D0)" D ^DIC K DIC S DIC=DIE,X=+Y K:Y<0 X I $D(X) S DINUM=X 83 80 Q 84 81 ; 85 2 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 86 X2 I X'=DVBJC2 S DVBJ2=1 87 Q 88 3 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 89 X3 K DVBJC2 90 Q 91 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 92 X4 S Y="@3" 93 Q 94 5 S DQ=6 ;@104 95 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 96 X6 D ^DVBHS5 S Y="@5" K DXS 97 Q 98 7 S DQ=8 ;@204 99 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 100 X8 I Z2'[1 S Y="@205" 101 Q 102 9 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 103 X9 S DVBSCR=1 D ^DVBHS5 S DVBJ2=1 104 Q 105 10 D:$D(DG)>9 F^DIE17,DE S DQ=10,DW=".361;1",DV="SX",DU="",DLB="ELIGIBILITY STATUS",DIFLD=.3611 106 S DE(DW)="C10^DVBHCE8" 107 S DU="P:PENDING VERIFICATION;R:PENDING RE-VERIFICATION;V:VERIFIED;" 108 G RE 109 C10 G C10S:$D(DE(10))[0 K DB 110 S X=DE(10),DIC=DIE 111 ; 112 S X=DE(10),DIC=DIE 113 ; 114 S X=DE(10),DIC=DIE 115 D EVENT^IVMPLOG(DA) 116 C10S S X="" G:DG(DQ)=X C10F1 K DB 117 S X=DG(DQ),DIC=DIE 118 K DIV S DIV=X,D0=DA,DIV(0)=D0 S Y(1)=$S($D(^DPT(D0,.361)):^(.361),1:"") S X=$P(Y(1),U,6),X=X S DIU=X K Y X ^DD(2,.3611,1,1,1.1) X ^DD(2,.3611,1,1,1.4) 119 S X=DG(DQ),DIC=DIE 120 K DIV S DIV=X,D0=DA,DIV(0)=D0 S Y(1)=$S($D(^DPT(D0,.361)):^(.361),1:"") S X=$P(Y(1),U,2),X=X S DIU=X K Y S X=DIV S X=DT X ^DD(2,.3611,1,2,1.4) 121 S X=DG(DQ),DIC=DIE 122 D EVENT^IVMPLOG(DA) 123 C10F1 Q 124 X10 D EK^DGLOCK Q:'$D(X) 125 Q 126 ; 127 11 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=11 G A 128 12 D:$D(DG)>9 F^DIE17,DE S DQ=12,DW=".361;2",DV="DX",DU="",DLB="ELIGIBILITY STATUS DATE",DIFLD=.3612 129 S DE(DW)="C12^DVBHCE8" 130 S X="TODAY" 131 S Y=X 132 G Y 133 C12 G C12S:$D(DE(12))[0 K DB 134 S X=DE(12),DIC=DIE 135 ; 136 S X=DE(12),DIC=DIE 137 D EVENT^IVMPLOG(DA) 138 C12S S X="" G:DG(DQ)=X C12F1 K DB 139 S X=DG(DQ),DIC=DIE 140 K DIV S DIV=X,D0=DA,DIV(0)=D0 S Y(1)=$S($D(^DPT(D0,.361)):^(.361),1:"") S X=$P(Y(1),U,6),X=X S DIU=X K Y S X=DIV S X=$S(($D(DUZ)#2):DUZ,1:"") X ^DD(2,.3612,1,1,1.4) 141 S X=DG(DQ),DIC=DIE 142 D EVENT^IVMPLOG(DA) 143 C12F1 Q 144 X12 S %DT="E",%DT(0)=-DT D ^%DT K %DT S X=Y K:Y<1 X I $D(X) D EK^DGLOCK 145 Q 146 ; 147 13 D:$D(DG)>9 F^DIE17,DE S DQ=13,DW=".361;5",DV="FX",DU="",DLB="ELIGIBILITY VERIF. METHOD",DIFLD=.3615 148 S DE(DW)="C13^DVBHCE8" 149 S X="HINQ" 150 S Y=X 151 G Y 152 C13 G C13S:$D(DE(13))[0 K DB 153 S X=DE(13),DIC=DIE 154 D EVENT^IVMPLOG(DA) 155 C13S S X="" G:DG(DQ)=X C13F1 K DB 156 S X=DG(DQ),DIC=DIE 157 D EVENT^IVMPLOG(DA) 158 C13F1 Q 159 X13 K:$L(X)>50!($L(X)<2) X I $D(X) D EK^DGLOCK 160 I $D(X),X'?.ANP K X 161 Q 162 ; 163 14 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=14 G A 164 15 D:$D(DG)>9 F^DIE17,DE S DQ=15,DW=".3;6",DV="DX",DU="",DLB="MONETARY BEN. VERIFY DATE",DIFLD=.306 165 S X="TODAY" 166 S Y=X 167 G Y 168 X15 S %DT="E",%DT(0)=-DT D ^%DT K %DT S X=Y K:Y<1 X I $D(X) D EK^DGLOCK 169 Q 170 ; 171 16 S D=0 K DE(1) ;361 172 S DIFLD=361,DGO="^DVBHCE9",DC="3^2.0361IP^E^",DV="2.0361M*P8'X",DW="0;1",DOW="ELIGIBILITY",DLB="Select "_DOW S:D DC=DC_D 173 S DU="DIC(8," 174 G RE:D I $D(DSC(2.0361))#2,$P(DSC(2.0361),"I $D(^UTILITY(",1)="" X DSC(2.0361) S D=$O(^(0)) S:D="" D=-1 G M16 175 S D=$S($D(^DPT(DA,"E",0)):$P(^(0),U,3,4),$O(^(0))'="":$O(^(0)),1:-1) 176 M16 I D>0 S DC=DC_D I $D(^DPT(DA,"E",+D,0)) S DE(16)=$P(^(0),U,1) 177 G RE 178 R16 D DE 179 S D=$S($D(^DPT(DA,"E",0)):$P(^(0),U,3,4),1:1) G 16+1 180 ; 181 17 S DQ=18 ;@205 182 18 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=18 D X18 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 183 X18 I Z2'[2 S Y="@206" 184 Q 185 19 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=19 D X19 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 186 X19 S DVBSCR=1 D ^DVBHS5 S DVBJ2=1 187 Q 188 20 S DW="TYPE;1",DV="P391'a",DU="",DLB="TYPE",DIFLD=391 189 S DE(DW)="C20^DVBHCE8",DE(DW,"INDEX")=1 190 S DU="DG(391," 191 G RE 192 C20 G C20S:$D(DE(20))[0 K DB 193 S X=DE(20),DIC=DIE 194 I ($T(AVAFC^VAFCDD01)'="") S VAFCF="391;" D AVAFC^VAFCDD01(DA) 195 S X=DE(20),DIIX=2_U_DIFLD D AUDIT^DIET 196 C20S S X="" G:DG(DQ)=X C20F1 K DB 197 S X=DG(DQ),DIC=DIE 198 I ($T(AVAFC^VAFCDD01)'="") S VAFCF="391;" D AVAFC^VAFCDD01(DA) 199 I $D(DE(20))'[0!(^DD(DP,DIFLD,"AUDIT")'="e") S X=DG(DQ),DIIX=3_U_DIFLD D AUDIT^DIET 200 C20F1 N X,X1,X2 S DIXR=664 D C20X1(U) K X2 M X2=X D C20X1("O") K X1 M X1=X 201 I $G(X(1))]"" D 202 . K ^DPT("APTYPE",X,DA) 203 K X M X=X2 I $G(X(1))]"" D 204 . S ^DPT("APTYPE",X,DA)="" 205 G C20F2 206 C20X1(DION) K X 207 S X(1)=$G(@DIEZTMP@("V",2,DIIENS,391,DION),$P($G(^DPT(DA,"TYPE")),U,1)) 208 S X=$G(X(1)) 209 Q 210 C20F2 Q 211 X20 Q 212 21 D:$D(DG)>9 F^DIE17,DE S DQ=21,DW="VET;1",DV="SXa",DU="",DLB="VETERAN (Y/N)?",DIFLD=1901 213 S DE(DW)="C21^DVBHCE8" 214 S DU="Y:YES;N:NO;" 215 G RE 216 C21 G C21S:$D(DE(21))[0 K DB 217 S X=DE(21),DIC=DIE 218 S DFN=DA D EN^DGMTCOR K DGMTCOR 219 S X=DE(21),DIC=DIE 220 S DFN=DA D EN^DGRP7CC 221 S X=DE(21),DIC=DIE 222 ; 223 S X=DE(21),DIC=DIE 224 D AUTOUPD^DGENA2(DA) 225 S X=DE(21),DIC=DIE 226 I ($T(AVAFC^VAFCDD01)'="") S VAFCF="1901;" D AVAFC^VAFCDD01(DA) 227 S X=DE(21),DIC=DIE 228 D:($T(ADGRU^DGRUDD01)'="") ADGRU^DGRUDD01(DA) 229 S X=DE(21),DIIX=2_U_DIFLD D AUDIT^DIET 230 C21S S X="" G:DG(DQ)=X C21F1 K DB 231 D ^DVBHCE10 232 C21F1 Q 233 X21 I $D(X) S:'$D(DPTX) DFN=DA D:'$D(^XUSEC("DG ELIGIBILITY",DUZ)) VAGE^DGLOCK:X="Y" I $D(X) D:$D(DFN) EV^DGLOCK 234 Q 235 ; 236 22 D:$D(DG)>9 F^DIE17,DE S DQ=22,DW=".3;1",DV="SXa",DU="",DLB="SERVICE CONNECTED?",DIFLD=.301 237 S DE(DW)="C22^DVBHCE8" 238 S DU="Y:YES;N:NO;" 239 G RE 240 C22 G C22S:$D(DE(22))[0 K DB 241 S X=DE(22),DIC=DIE 242 ; 243 S X=DE(22),DIC=DIE 244 ; 245 S X=DE(22),DIC=DIE 246 D AUTOUPD^DGENA2(DA) 247 S X=DE(22),DIC=DIE 248 I ($T(AVAFC^VAFCDD01)'="") S VAFCF=".301;" D AVAFC^VAFCDD01(DA) 249 S X=DE(22),DIC=DIE 250 D:($T(ADGRU^DGRUDD01)'="") ADGRU^DGRUDD01(DA) 251 S X=DE(22),DIIX=2_U_DIFLD D AUDIT^DIET 252 C22S S X="" G:DG(DQ)=X C22F1 K DB 253 D ^DVBHCE11 254 C22F1 Q 255 X22 S DFN=DA D EV^DGLOCK I $D(X),X="Y" D VET^DGLOCK 256 Q 257 ; 258 23 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=23 D X23 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 259 X23 I X="N" S Y="@2063" 260 Q 261 24 S DQ=25 ;@2063 262 25 D:$D(DG)>9 F^DIE17,DE S DQ=25,DW=".36;1",DV="*P8'Xa",DU="",DLB="PRIMARY ELIGIBILITY CODE",DIFLD=.361 263 S DE(DW)="C25^DVBHCE8" 264 S DU="DIC(8," 265 G RE 266 C25 G C25S:$D(DE(25))[0 K DB 267 D ^DVBHCE12 268 C25S S X="" G:DG(DQ)=X C25F1 K DB 269 D ^DVBHCE13 270 C25F1 Q 271 X25 S DFN=DA D EV^DGLOCK I $D(X) D ECD^DGLOCK1 272 Q 273 ; 274 26 S DQ=27 ;@206 275 27 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=27 D X27 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 276 X27 I Z2'[3 S Y="@104" 277 Q 278 28 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=28 D X28 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 279 X28 S DVBSCR=1 D ^DVBHS5 S DVBJ2=1 280 Q 281 29 D:$D(DG)>9 F^DIE17 G ^DVBHCE14 82 2 G 1^DIE17 -
WorldVistAEHR/trunk/r/HINQ-DVB--DVBA--DVBE--DVBC/DVBHCE9.m
r613 r623 1 DVBHCE9 ; ;12/13/08 2 D DE G BEGIN 3 DE S DIE="^DPT(D0,""E"",",DIC=DIE,DP=2.0361,DL=2,DIEL=1,DU="" K DG,DE,DB Q:$O(^DPT(D0,"E",DA,""))="" 4 I $D(^(0)) S %Z=^(0) S %=$P(%Z,U,1) S:%]"" DE(1)=% 5 K %Z Q 6 ; 7 W W !?DL+DL-2,DLB_": " 8 Q 9 O D W W Y W:$X>45 !?9 10 I $L(Y)>19,'DV,DV'["I",(DV["F"!(DV["K")) G RW^DIR2 11 W:Y]"" "// " I 'DV,DV["I",$D(DE(DQ))#2 S X="" W " (No Editing)" Q 12 TR R X:DTIME E S (DTOUT,X)=U W $C(7) 13 Q 14 A K DQ(DQ) S DQ=DQ+1 15 B G @DQ 16 RE G PR:$D(DE(DQ)) D W,TR 17 N I X="" G NKEY:$D(^DD("KEY","F",DP,DIFLD)),A:DV'["R",X:'DV,X:D'>0,A 18 RD G QS:X?."?" I X["^" D D G ^DIE17 19 I X="@" D D G Z^DIE2 20 I X=" ",DV["d",DV'["P",$D(^DISV(DUZ,"DIE",DLB)) S X=^(DLB) I DV'["D",DV'["S" W " "_X 21 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 22 K DDER G X 23 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 24 G V:DV'["N" D D I $L($P(X,"."))>24 K X G Z 25 I $P(DQ(DQ),U,5)'["$",X?.1"-".N.1".".N,$P(DQ(DQ),U,5,99)["+X'=X" S X=+X 26 V D @("X"_DQ) K YS 27 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 28 X W:'$D(ZTQUEUED) $C(7),"??" I $D(DB(DQ)) G Z^DIE17 29 S X="?BAD" 30 QS S DZ=X D D,QQ^DIEQ G B 31 D S D=DIFLD,DQ(DQ)=DLB_U_DV_U_DU_U_DW_U_$P($T(@("X"_DQ))," ",2,99) Q 32 Y I '$D(DE(DQ)) D O G RD:"@"'[X,A:DV'["R"&(X="@"),X:X="@" S X=Y G N 33 PR S DG=DV,Y=DE(DQ),X=DU I $D(DQ(DQ,2)) X DQ(DQ,2) G RP 34 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 35 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 36 X:DG["D" ^DD("DD") I DG["S" S %=$P($P(";"_X,";"_Y_":",2),";") S:%]"" Y=% 37 RP D O I X="" S X=DE(DQ) G A:'DV,A:DC<2,N^DIE17 38 I I DV'["I",DV'["#" G RD 39 D E^DIE0 G RD:$D(X),PR 40 Q 41 SET N DIR S DIR(0)="SV"_$E("o",$D(DB(DQ)))_U_DU,DIR("V")=1 42 I $D(DB(DQ)),'$D(DIQUIET) N DIQUIET S DIQUIET=1 43 D ^DIR I 'DDER S %=Y(0),X=Y 44 Q 45 SAVEVALS S @DIEZTMP@("V",DP,DIIENS,DIFLD,"O")=$G(DE(DQ)) S:$D(^("F"))[0 ^("F")=$G(DE(DQ)) 46 I $D(DE(DW,"4/")) S @DIEZTMP@("V",DP,DIIENS,DIFLD,"4/")="" 47 E K @DIEZTMP@("V",DP,DIIENS,DIFLD,"4/") 48 Q 49 NKEY W:'$D(ZTQUEUED) "?? Required key field" S X="?BAD" G QS 50 KEYCHK() Q:$G(DE(DW,"KEY"))="" 1 Q @DE(DW,"KEY") 51 BEGIN S DNM="DVBHCE9",DQ=1+D G B 52 1 S DW="0;1",DV="M*P8'X#",DU="",DLB="ELIGIBILITY",DIFLD=.01 53 S DE(DW)="C1^DVBHCE9" 54 S DU="DIC(8," 55 G RE:'D S DQ=2 G 2 56 C1 G C1S:$D(DE(1))[0 K DB 57 S X=DE(1),DIC=DIE 58 K ^DPT(DA(1),"E","B",$E(X,1,30),DA) 59 S X=DE(1),DIC=DIE 60 K ^DPT("AEL",DA(1),+X) 61 S X=DE(1),DIC=DIE 62 D E32^VADPT62 63 S X=DE(1),DIC=DIE 64 X "S DFN=DA(1) D EN^DGMTR K DGREQF" 65 S X=DE(1),DIC=DIE 66 D AUTOUPD^DGENA2(DA(1)) 67 C1S S X="" G:DG(DQ)=X C1F1 K DB 1 DVBHCE9 ; ;12/27/07 68 2 S X=DG(DQ),DIC=DIE 69 S ^DPT(DA(1),"E","B",$E(X,1,30),DA)=""3 S DFN=DA D EN^DGMTCOR K DGMTCOR 70 4 S X=DG(DQ),DIC=DIE 71 S ^DPT("AEL",DA(1),+X)=""5 S DFN=DA D EN^DGRP7CC 72 6 S X=DG(DQ),DIC=DIE 73 D E31^VADPT627 X ^DD(2,1901,1,3,1.3) I X S X=DIV S Y(1)=$S($D(^DPT(D0,.3)):^(.3),1:"") S X=$P(Y(1),U,1),X=X S DIU=X K Y S X=DIV S X="N" X ^DD(2,1901,1,3,1.4) 74 8 S X=DG(DQ),DIC=DIE 75 X "S DFN=DA(1) D EN^DGMTR K DGREQF"9 D AUTOUPD^DGENA2(DA) 76 10 S X=DG(DQ),DIC=DIE 77 D AUTOUPD^DGENA2(DA(1)) 78 C1F1 Q 79 X1 S DIC("S")="I '$P(^(0),U,7),$S($P(^(0),U,8):1,'$D(^DPT(D0,.36)):0,1:Y=+^(.36)),$$ELGCHK^DGRPTU(D0)" D ^DIC K DIC S DIC=DIE,X=+Y K:Y<0 X I $D(X) S DINUM=X 80 Q 81 ; 82 2 G 1^DIE17 11 I ($T(AVAFC^VAFCDD01)'="") S VAFCF="1901;" D AVAFC^VAFCDD01(DA) 12 S X=DG(DQ),DIC=DIE 13 D:($T(ADGRU^DGRUDD01)'="") ADGRU^DGRUDD01(DA) 14 I $D(DE(12))'[0!(^DD(DP,DIFLD,"AUDIT")'="e") S X=DG(DQ),DIIX=3_U_DIFLD D AUDIT^DIET -
WorldVistAEHR/trunk/r/HINQ-DVB--DVBA--DVBE--DVBC/DVBHCG.m
r613 r623 1 DVBHCG ; GENERATED FROM 'DVBHINQ PAT-HINQ COMP' PRINT TEMPLATE (#513) ; 12/13/08; (FILE 2, MARGIN=80)1 DVBHCG ; GENERATED FROM 'DVBHINQ PAT-HINQ COMP' PRINT TEMPLATE (#513) ; 04/03/06 ; (FILE 2, MARGIN=80) 2 2 G BEGIN 3 3 N W !
Note:
See TracChangeset
for help on using the changeset viewer.