Ignore:
Timestamp:
Dec 4, 2009, 12:11:15 AM (15 years ago)
Author:
George Lilly
Message:

revised back to 6/30/08 version

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/08
     1DVBHCE ; GENERATED FROM 'DVBHINQ UPDATE' INPUT TEMPLATE(#960), FILE 2;12/27/07
    22 D DE G BEGIN
    33DE 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)=%
    55 K %Z Q
    66 ;
     
    191191 G RE
    192192C24 G C24S:$D(DE(24))[0 K DB
    193  S X=DE(24),DIC=DIE
    194  D EVENT^IVMPLOG(DA)
     193 D ^DVBHCE1
    195194C24S S X="" G:DG(DQ)=X C24F1 K DB
    196  S X=DG(DQ),DIC=DIE
    197  D EVENT^IVMPLOG(DA)
     195 D ^DVBHCE2
    198196C24F1 Q
    199197X24 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
     
    214212X29 S DVBSCR=1 D ^DVBHS4 W !,?34,DVBON,"[NTLAST]",DVBOFF X DVBLIT1
    215213 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
     21430 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)
     1DVBHCE1 ; ;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/08
     1DVBHCE10 ; ;12/27/07
    22 S X=DG(DQ),DIC=DIE
    3  S DFN=DA D EN^DGMTCOR K DGMTCOR
     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)
    44 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)
    86 S X=DG(DQ),DIC=DIE
    97 D AUTOUPD^DGENA2(DA)
    108 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)
    1210 S X=DG(DQ),DIC=DIE
    1311 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^DIET
     12 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
     1DVBHCE11 ; ;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
    711 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
     1DVBHCE12 ; ;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
    37 ;
    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
    1111 D AUTOUPD^DGENA2(DA)
    12  S X=DE(25),DIIX=2_U_DIFLD D AUDIT^DIET
     12 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
     1DVBHCE13 ; ;12/27/07
     2 D DE G BEGIN
     3DE S DIE="^DPT(",DIC=DIE,DP=2,DL=1,DIEL=0,DU="" K DG,DE,DB Q:$O(^DPT(DA,""))=""
     4 I $D(^(.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 ;
     8W W !?DL+DL-2,DLB_": "
     9 Q
     10O 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
     13TR R X:DTIME E  S (DTOUT,X)=U W $C(7)
     14 Q
     15A K DQ(DQ) S DQ=DQ+1
     16B G @DQ
     17RE G PR:$D(DE(DQ)) D W,TR
     18N I X="" G NKEY:$D(^DD("KEY","F",DP,DIFLD)),A:DV'["R",X:'DV,X:D'>0,A
     19RD 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
     22T 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
     24P 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
     27V D @("X"_DQ) K YS
     28Z 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
     29X W:'$D(ZTQUEUED) $C(7),"??" I $D(DB(DQ)) G Z^DIE17
     30 S X="?BAD"
     31QS S DZ=X D D,QQ^DIEQ G B
     32D S D=DIFLD,DQ(DQ)=DLB_U_DV_U_DU_U_DW_U_$P($T(@("X"_DQ))," ",2,99) Q
     33Y I '$D(DE(DQ)) D O G RD:"@"'[X,A:DV'["R"&(X="@"),X:X="@" S X=Y G N
     34PR S DG=DV,Y=DE(DQ),X=DU I $D(DQ(DQ,2)) X DQ(DQ,2) G RP
     35R 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=%
     38RP D O I X="" S X=DE(DQ) G A:'DV,A:DC<2,N^DIE17
     39I I DV'["I",DV'["#" G RD
     40 D E^DIE0 G RD:$D(X),PR
     41 Q
     42SET 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
     46SAVEVALS 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
     50NKEY W:'$D(ZTQUEUED) "??  Required key field" S X="?BAD" G QS
     51KEYCHK() Q:$G(DE(DW,"KEY"))="" 1 Q @DE(DW,"KEY")
     52BEGIN S DNM="DVBHCE13",DQ=1
     531 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
     57C1 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)
     66C1S 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)
     75C1F1 Q
     76X1 S DFN=DA D MV^DGLOCK I $D(X) S DFN=DA D EV^DGLOCK
     77 Q
     78 ;
     792 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
     83C2 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)
     92C2S 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)
     101C2F1 Q
     102X2 S DFN=DA D MV^DGLOCK I $D(X) S DFN=DA D EV^DGLOCK
     103 Q
     104 ;
     1053 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
     109C3 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)
     118C3S 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)
     127C3F1 Q
     128X3 S DFN=DA D MV^DGLOCK
     129 Q
     130 ;
     1314 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
     135C4 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)
     142C4S 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)
     149C4F1 Q
     150X4 S DFN=DA D MV^DGLOCK I $D(X),X="Y" D EC^DGLOCK1
     151 Q
     152 ;
     1535 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
     156C5 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)
     161C5S S X="" G:DG(DQ)=X C5F1 K DB
    2162 S X=DG(DQ),DIC=DIE
    3163 X "S DFN=DA D EN^DGMTR K DGREQF"
    4164 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)
     166C5F1 Q
     167X5 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
    7169 ;
    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
     1706 S DQ=7 ;@2062
     1717 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
     172X7 S Y="@104"
     173 Q
     1748 S DQ=9 ;@11
     1759 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
     176X9 S DVBJ2=1
     177 Q
     17810 D:$D(DG)>9 F^DIE17 G ^DVBHCE14
  • WorldVistAEHR/trunk/r/HINQ-DVB--DVBA--DVBE--DVBC/DVBHCE14.m

    r613 r623  
    1 DVBHCE14 ; ;12/13/08
     1DVBHCE14 ; ;12/27/07
    22 D DE G BEGIN
    33DE 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)=%
    75 K %Z Q
    86 ;
     
    5250KEYCHK() Q:$G(DE(DW,"KEY"))="" 1 Q @DE(DW,"KEY")
    5351BEGIN 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;"
     521 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
    5754 G RE
    5855C1 G C1S:$D(DE(1))[0 K DB
    5956 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
    6771C1S S X="" G:DG(DQ)=X C1F1 K DB
    6872 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
     87C1F1 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
     93C1X1(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
     97C1F2 Q
     98X1 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 ;
     1022 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
    83104 G RE
    84105C2 G C2S:$D(DE(2))[0 K DB
    85106 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
    93121C2S S X="" G:DG(DQ)=X C2F1 K DB
    94122 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
     137C2F1 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
     143C2X1(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
     147C2F2 Q
     148X2 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 ;
     1523 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
    109154 G RE
    110155C3 G C3S:$D(DE(3))[0 K DB
    111156 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
    119169C3S 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
     171C3F1 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
     177C3X1(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
     181C3F2 Q
     182X3 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 ;
     1864 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
    135188 G RE
    136189C4 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
    143191C4S S X="" G:DG(DQ)=X C4F1 K DB
    144  S X=DG(DQ),DIC=DIE
    145  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=DIE
    147  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=DIE
    149  D EVENT^IVMPLOG(DA)
    150 C4F1 Q
    151 X4 S DFN=DA D MV^DGLOCK I $D(X),X="Y" D EC^DGLOCK1
    152  Q
    153  ;
    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=.36295
    155  S DE(DW)="C5^DVBHCE14"
    156  G RE
    157 C5 G C5S:$D(DE(5))[0 K DB
    158  S X=DE(5),DIC=DIE
    159  X "S DFN=DA D EN^DGMTR K DGREQF"
    160  S X=DE(5),DIC=DIE
    161  D AUTOUPD^DGENA2(DA)
    162 C5S S X="" G:DG(DQ)=X C5F1 K DB
    163  S X=DG(DQ),DIC=DIE
    164  X "S DFN=DA D EN^DGMTR K DGREQF"
    165  S X=DG(DQ),DIC=DIE
    166  D AUTOUPD^DGENA2(DA)
    167 C5F1 Q
    168 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
    169  Q
    170  ;
    171 6 S DQ=7 ;@2062
    172 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
    173 X7 S Y="@104"
    174  Q
    175 8 S DQ=9 ;@11
    176 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
    177 X9 S DVBJ2=1
    178  Q
    179 10 D:$D(DG)>9 F^DIE17,DE S DQ=10,DW=".11;1",DV="Fa",DU="",DLB="STREET ADDRESS [LINE 1]",DIFLD=.111
    180  S DE(DW)="C10^DVBHCE14",DE(DW,"INDEX")=1
    181  G RE
    182 C10 G C10S:$D(DE(10))[0 K DB
    183  S X=DE(10),DIC=DIE
    184  X "S DGXRF=.111 D ^DGDDC Q"
    185  S X=DE(10),DIC=DIE
    186  S A1B2TAG="PAT" D ^A1B2XFR
    187  S X=DE(10),DIC=DIE
    188  D EVENT^IVMPLOG(DA)
    189  S X=DE(10),DIC=DIE
    190  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
    191  S X=DE(10),DIC=DIE
    192  S IVMX=X,X="IVMPXFR" X ^%ZOSF("TEST") D:$T DPT^IVMPXFR S X=IVMX K IVMX
    193  S X=DE(10),DIC=DIE
    194  I ($T(AVAFC^VAFCDD01)'="") S VAFCF=".111;" D AVAFC^VAFCDD01(DA)
    195  S X=DE(10),DIC=DIE
    196  D:($T(ADGRU^DGRUDD01)'="") ADGRU^DGRUDD01(DA)
    197  S X=DE(10),DIIX=2_U_DIFLD D AUDIT^DIET
    198 C10S S X="" G:DG(DQ)=X C10F1 K DB
    199  D ^DVBHCE15
    200 C10F1 N X,X1,X2 S DIXR=230 D C10X1(U) K X2 M X2=X D C10X1("O") K X1 M X1=X
    201  D
    202  . D FC^DGFCPROT(.DA,2,.111,"KILL",$H,$G(DUZ),.X,.X1,.X2,$G(XQY0)) Q
    203  K X M X=X2 D
    204  . D FC^DGFCPROT(.DA,2,.111,"SET",$H,$G(DUZ),.X,.X1,.X2,$G(XQY0)) Q
    205  G C10F2
    206 C10X1(DION) K X
    207  S X(1)=$G(@DIEZTMP@("V",2,DIIENS,.111,DION),$P($G(^DPT(DA,.11)),U,1))
    208  S X=$G(X(1))
    209  Q
    210 C10F2 Q
    211 X10 K:X[""""!($A(X)=45) X I $D(X) K:$L(X)>35!($L(X)<3) X
    212  I $D(X),X'?.ANP K X
    213  Q
    214  ;
    215 11 D:$D(DG)>9 F^DIE17,DE S DQ=11,DW=".11;2",DV="Fa",DU="",DLB="STREET ADDRESS [LINE 2]",DIFLD=.112
    216  S DE(DW)="C11^DVBHCE14",DE(DW,"INDEX")=1
    217  G RE
    218 C11 G C11S:$D(DE(11))[0 K DB
    219  D ^DVBHCE16
    220 C11S S X="" G:DG(DQ)=X C11F1 K DB
    221192 D ^DVBHCE17
    222 C11F1 N X,X1,X2 S DIXR=232 D C11X1(U) K X2 M X2=X D C11X1("O") K X1 M X1=X
    223  D
    224  . D FC^DGFCPROT(.DA,2,.112,"KILL",$H,$G(DUZ),.X,.X1,.X2,$G(XQY0)) Q
    225  K X M X=X2 D
    226  . D FC^DGFCPROT(.DA,2,.112,"SET",$H,$G(DUZ),.X,.X1,.X2,$G(XQY0)) Q
    227  G C11F2
    228 C11X1(DION) K X
    229  S X(1)=$G(@DIEZTMP@("V",2,DIIENS,.112,DION),$P($G(^DPT(DA,.11)),U,2))
    230  S X=$G(X(1))
    231  Q
    232 C11F2 Q
    233 X11 K:X[""""!($A(X)=45) X I $D(X) K:$L(X)>30!($L(X)<3) X D:$D(X) UP^DGHELP
    234  I $D(X),X'?.ANP K X
    235  Q
    236  ;
    237 12 D:$D(DG)>9 F^DIE17 G ^DVBHCE18
     193C4F1 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
     199C4X1(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
     203C4F2 Q
     204X4 K:$L(X)>15!($L(X)<2) X
     205 I $D(X),X'?.ANP K X
     206 Q
     207 ;
     2085 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  ;
     1DVBHCE15 ; ;12/27/07
    42 S X=DG(DQ),DIC=DIE
    53 S A1B2TAG="PAT" D ^A1B2XFR
     
    119 S IVMX=X,X="IVMPXFR" X ^%ZOSF("TEST") D:$T DPT^IVMPXFR S X=IVMX K IVMX
    1210 S X=DG(DQ),DIC=DIE
    13  I ($T(AVAFC^VAFCDD01)'="") S VAFCF=".111;" D AVAFC^VAFCDD01(DA)
     11 I ($T(AVAFC^VAFCDD01)'="") S VAFCF=".113;" D AVAFC^VAFCDD01(DA)
    1412 S X=DG(DQ),DIC=DIE
    1513 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^DIET
     14 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
     1DVBHCE16 ; ;12/27/07
     2 S X=DE(4),DIC=DIE
    53 S A1B2TAG="PAT" D ^A1B2XFR
    6  S X=DE(11),DIC=DIE
     4 S X=DE(4),DIC=DIE
    75 D EVENT^IVMPLOG(DA)
    8  S X=DE(11),DIC=DIE
     6 S X=DE(4),DIC=DIE
    97 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=DIE
     8 S X=DE(4),DIC=DIE
    119 S IVMX=X,X="IVMPXFR" X ^%ZOSF("TEST") D:$T DPT^IVMPXFR S X=IVMX K IVMX
    12  S X=DE(11),DIC=DIE
    13  I ($T(AVAFC^VAFCDD01)'="") S VAFCF=".112;" D AVAFC^VAFCDD01(DA)
    14  S X=DE(11),DIC=DIE
     10 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
    1513 D:($T(ADGRU^DGRUDD01)'="") ADGRU^DGRUDD01(DA)
    16  S X=DE(11),DIIX=2_U_DIFLD D AUDIT^DIET
     14 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  ;
     1DVBHCE17 ; ;12/27/07
    42 S X=DG(DQ),DIC=DIE
    53 S A1B2TAG="PAT" D ^A1B2XFR
     
    119 S IVMX=X,X="IVMPXFR" X ^%ZOSF("TEST") D:$T DPT^IVMPXFR S X=IVMX K IVMX
    1210 S X=DG(DQ),DIC=DIE
    13  I ($T(AVAFC^VAFCDD01)'="") S VAFCF=".112;" D AVAFC^VAFCDD01(DA)
     11 I ($T(AVAFC^VAFCDD01)'="") S VAFCF=".114;" D AVAFC^VAFCDD01(DA)
    1412 S X=DG(DQ),DIC=DIE
    1513 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^DIET
     14 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/08
     1DVBHCE18 ; ;12/27/07
    22 D DE G BEGIN
    33DE 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)=%
    55 K %Z Q
    66 ;
     
    5050KEYCHK() Q:$G(DE(DW,"KEY"))="" 1 Q @DE(DW,"KEY")
    5151BEGIN 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=.113
     521 D:$D(DG)>9 F^DIE17,DE S DQ=1,DW=".11;5",DV="P5'a",DU="",DLB="STATE",DIFLD=.115
    5353 S DE(DW)="C1^DVBHCE18",DE(DW,"INDEX")=1
     54 S DU="DIC(5,"
    5455 G RE
    5556C1 G C1S:$D(DE(1))[0 K DB
    5657 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
    5760 S A1B2TAG="PAT" D ^A1B2XFR
    5861 S X=DE(1),DIC=DIE
    5962 D EVENT^IVMPLOG(DA)
    6063 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 ^DICR
    62  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=".113;" 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)
    6669 S X=DE(1),DIC=DIE
    6770 D:($T(ADGRU^DGRUDD01)'="") ADGRU^DGRUDD01(DA)
     
    6972C1S S X="" G:DG(DQ)=X C1F1 K DB
    7073 S X=DG(DQ),DIC=DIE
     74 ;
     75 S X=DG(DQ),DIC=DIE
    7176 S A1B2TAG="PAT" D ^A1B2XFR
    7277 S X=DG(DQ),DIC=DIE
     
    7782 S IVMX=X,X="IVMPXFR" X ^%ZOSF("TEST") D:$T DPT^IVMPXFR S X=IVMX K IVMX
    7883 S X=DG(DQ),DIC=DIE
    79  I ($T(AVAFC^VAFCDD01)'="") S VAFCF=".113;" D AVAFC^VAFCDD01(DA)
     84 I ($T(AVAFC^VAFCDD01)'="") S VAFCF=".115;" D AVAFC^VAFCDD01(DA)
    8085 S X=DG(DQ),DIC=DIE
    8186 D:($T(ADGRU^DGRUDD01)'="") ADGRU^DGRUDD01(DA)
    8287 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
     88C1F1 N X,X1,X2 S DIXR=235 D C1X1(U) K X2 M X2=X D C1X1("O") K X1 M X1=X
    18189 D
    18290 . D FC^DGFCPROT(.DA,2,.115,"KILL",$H,$G(DUZ),.X,.X1,.X2,$G(XQY0)) Q
    18391 K X M X=X2 D
    18492 . D FC^DGFCPROT(.DA,2,.115,"SET",$H,$G(DUZ),.X,.X1,.X2,$G(XQY0)) Q
    185  G C3F2
    186 C3X1(DION) K X
     93 G C1F2
     94C1X1(DION) K X
    18795 S X(1)=$G(@DIEZTMP@("V",2,DIIENS,.115,DION),$P($G(^DPT(DA,.11)),U,5))
    18896 S X=$G(X(1))
    18997 Q
    190 C3F2 Q
    191 X3 Q
    192 4 D:$D(DG)>9 F^DIE17,DE S DQ=4,DW=".11;12",DV="FXOa",DU="",DLB="ZIP+4",DIFLD=.1112
    193  S DQ(4,2)="S Y(0)=Y D ZIPOUT^VAFADDR"
    194  S DE(DW)="C4^DVBHCE18",DE(DW,"INDEX")=1
     98C1F2 Q
     99X1 Q
     1002 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
    195103 G RE
    196 C4 G C4S:$D(DE(4))[0 K DB
    197  S X=DE(4),DIC=DIE
     104C2 G C2S:$D(DE(2))[0 K DB
     105 S X=DE(2),DIC=DIE
    198106 D KILL^DGREGDD1(DA,.116,.11,6,$E(X,1,5))
    199  S X=DE(4),DIC=DIE
    200  D EVENT^IVMPLOG(DA)
    201  S X=DE(4),DIC=DIE
     107 S X=DE(2),DIC=DIE
     108 D EVENT^IVMPLOG(DA)
     109 S X=DE(2),DIC=DIE
    202110 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=DIE
    204  S IVMX=X,X="IVMPXFR" X ^%ZOSF("TEST") D:$T DPT^IVMPXFR S X=IVMX K IVMX
    205  S X=DE(4),DIC=DIE
     111 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
    206114 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
     118C2S 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
     132C2F1 N X,X1,X2 S DIXR=185 D C2X1(U) K X2 M X2=X D C2X1("O") K X1 M X1=X
    213133 D
    214134 . N DIEXARR M DIEXARR=X S DIEZCOND=1
     
    216136 . S DIEZCOND=$G(X) K X M X=DIEXARR Q:'DIEZCOND
    217137 . K EASDO2
    218  G C4F2
    219 C4X1(DION) K X
     138 G C2F2
     139C2X1(DION) K X
    220140 S X(1)=$G(@DIEZTMP@("V",2,DIIENS,.1112,DION),$P($G(^DPT(DA,.11)),U,12))
    221141 S:('$G(EASDO2)&($D(EASZIPLK))) X=$$ZIP^DGREGDD1(DA,X(1))
     
    223143 S X=$G(X(1))
    224144 Q
    225 C4F2 S DIXR=231 D C4X2(U) K X2 M X2=X D C4X2("O") K X1 M X1=X
     145C2F2 S DIXR=231 D C2X2(U) K X2 M X2=X D C2X2("O") K X1 M X1=X
    226146 D
    227147 . D FC^DGFCPROT(.DA,2,.1112,"KILL",$H,$G(DUZ),.X,.X1,.X2,$G(XQY0)) Q
    228148 K X M X=X2 D
    229149 . D FC^DGFCPROT(.DA,2,.1112,"SET",$H,$G(DUZ),.X,.X1,.X2,$G(XQY0)) Q
    230  G C4F3
    231 C4X2(DION) K X
     150 G C2F3
     151C2X2(DION) K X
    232152 S X(1)=$G(@DIEZTMP@("V",2,DIIENS,.1112,DION),$P($G(^DPT(DA,.11)),U,12))
    233153 S X=$G(X(1))
    234154 Q
    235 C4F3 Q
    236 X4 K:X[""""!($A(X)=45) X I $D(X) K:$L(X)>20!($L(X)<5) X I $D(X) D ZIPIN^VAFADDR
     155C2F3 Q
     156X2 K:X[""""!($A(X)=45) X I $D(X) K:$L(X)>20!($L(X)<5) X I $D(X) D ZIPIN^VAFADDR
    237157 I $D(X),X'?.ANP K X
    238158 Q
    239159 ;
    240 5 D:$D(DG)>9 F^DIE17,DE S DQ=5,DW=".11;7",DV="NJ3,0XOa",DU="",DLB="COUNTY",DIFLD=.117
    241  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)="C5^DVBHCE18"
     1603 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"
    243163 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  ;
     164C3 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
     174C3S S X="" G:DG(DQ)=X C3F1 K DB
     175 D ^DVBHCE19
     176C3F1 Q
     177X3 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 ;
     1804 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
     181X4 S Y="@1001"
     182 Q
     1835 S DQ=6 ;@5
    2521846 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 ;@5
     185X6 D SCRQ^DVBHUTIL
     186 Q
     1877 S DQ=8 ;@6
    2561888 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^DVBHUTIL
    258  Q
    259 9 S DQ=10 ;@6
     189X8 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
     1919 S DQ=10 ;@8
    26019210 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 ;@8
    264 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
     193X10 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
     19511 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
     196X11 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
     19812 S DQ=13 ;@20
    26719913 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 ;@20
     200X13 S JP=1,Y=$S(DVBJS=11:"@11",DVBJS=35:"@40",DVBJS=44:"@30",DVBJS=53:"@204",1:Y)
     201 Q
     20214 S DQ=15 ;@21
    27120315 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
     204X15 I $P(Z2,U,JP)'=1 S Y="@22"
     205 Q
     20616 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
     207X16 I '$D(DVBCN) S Y="@22",JP=JP+1
     208 Q
    27520917 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"
     210X17 I 'DVBCN S Y="@22",JP=JP+1
    277211 Q
    27821218 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+1
     213X18 S DVBCN=$TR(DVBCN," ")
    280214 Q
    28121519 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
     216X19 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
     21820 D:$D(DG)>9 F^DIE17 G ^DVBHCE20
  • WorldVistAEHR/trunk/r/HINQ-DVB--DVBA--DVBE--DVBC/DVBHCE19.m

    r613 r623  
    1 DVBHCE19 ; ;12/13/08
     1DVBHCE19 ; ;12/27/07
    22 S X=DG(DQ),DIC=DIE
    3  D SET^DGREGDD1(DA,.116,.11,6,$E(X,1,5))
     3 S A1B2TAG="PAT" D ^A1B2XFR
    44 S X=DG(DQ),DIC=DIE
    55 D EVENT^IVMPLOG(DA)
    66 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 ^DICR
    8  S X=DG(DQ),DIC=DIE
    97 S IVMX=X,X="IVMPXFR" X ^%ZOSF("TEST") D:$T DPT^IVMPXFR S X=IVMX K IVMX
    108 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
     1DVBHCE2 ; ;12/27/07
     2 S X=DG(DQ),DIC=DIE
    53 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
     1DVBHCE20 ; ;12/27/07
     2 D DE G BEGIN
     3DE S DIE="^DPT(",DIC=DIE,DP=2,DL=1,DIEL=0,DU="" K DG,DE,DB Q:$O(^DPT(DA,""))=""
     4 I $D(^(.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 ;
     8W W !?DL+DL-2,DLB_": "
     9 Q
     10O 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
     13TR R X:DTIME E  S (DTOUT,X)=U W $C(7)
     14 Q
     15A K DQ(DQ) S DQ=DQ+1
     16B G @DQ
     17RE G PR:$D(DE(DQ)) D W,TR
     18N I X="" G NKEY:$D(^DD("KEY","F",DP,DIFLD)),A:DV'["R",X:'DV,X:D'>0,A
     19RD 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
     22T 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
     24P 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
     27V D @("X"_DQ) K YS
     28Z 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
     29X W:'$D(ZTQUEUED) $C(7),"??" I $D(DB(DQ)) G Z^DIE17
     30 S X="?BAD"
     31QS S DZ=X D D,QQ^DIEQ G B
     32D S D=DIFLD,DQ(DQ)=DLB_U_DV_U_DU_U_DW_U_$P($T(@("X"_DQ))," ",2,99) Q
     33Y I '$D(DE(DQ)) D O G RD:"@"'[X,A:DV'["R"&(X="@"),X:X="@" S X=Y G N
     34PR S DG=DV,Y=DE(DQ),X=DU I $D(DQ(DQ,2)) X DQ(DQ,2) G RP
     35R 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=%
     38RP D O I X="" S X=DE(DQ) G A:'DV,A:DC<2,N^DIE17
     39I I DV'["I",DV'["#" G RD
     40 D E^DIE0 G RD:$D(X),PR
     41 Q
     42SET 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
     46SAVEVALS 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
     50NKEY W:'$D(ZTQUEUED) "??  Required key field" S X="?BAD" G QS
     51KEYCHK() Q:$G(DE(DW,"KEY"))="" 1 Q @DE(DW,"KEY")
     52BEGIN S DNM="DVBHCE20",DQ=1
     531 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
     60C1 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
    564 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
     66C1S 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
     72C1F1 Q
     73X1 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 ;
     772 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
     78X2 W "." S JP=JP+1,DVBJ2=1
     79 Q
     803 S DQ=4 ;@22
     814 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
     82X4 I $P(Z2,U,JP)'=2 S Y="@225"
     83 Q
     845 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
     85X5 W !,"Date of Birth cannot be edited with this option."
     86 Q
     876 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
     88X6 H 1
     89 Q
     907 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
     91X7 W "." S JP=JP+1,DVBJ2=1
     92 Q
     938 S DQ=9 ;@225
     949 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
     95X9 I $P(Z2,U,JP)'=3 S Y="@23"
     96 Q
     9710 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
     98X10 W !,"Sex cannot be edited with this option."
     99 Q
     10011 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
     101X11 H 1
     102 Q
     10312 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
     104X12 W "." S JP=JP+1,DVBJ2=1
     105 Q
     10613 S DQ=14 ;@23
     10714 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
     108X14 I $P(Z2,U,JP)'=4 S Y="@24"
     109 Q
     11015 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
     111X15 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
     11316 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
     114X16 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
     11617 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
     117X17 I '$D(Z1) S Y="@24",JP=JP+1
     118 Q
     11918 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
     120X18 I 'Z1 S Y="@24",JP=JP+1
     121 Q
     12219 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
     123X19 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
     12520 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
     131C20 G C20S:$D(DE(20))[0 K DB
     132 D ^DVBHCE21
     133C20S S X="" G:DG(DQ)=X C20F1 K DB
     134 D ^DVBHCE22
     135C20F1 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
     141C20X1(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
     145C20F2 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
     151C20X2(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
     155C20F3 Q
     156X20 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 ;
     15921 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
     160X21 W "." S JP=JP+1,DVBJ2=1
     161 Q
     16222 S DQ=23 ;@24
     16323 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
     164X23 I $P(Z2,U,JP)'=5 S Y="@25"
     165 Q
     16624 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
     167X24 K DVBSICK I $D(DVBP(6)) S DVBSICK=$P(DVBP(6),U,7)
     168 Q
     16925 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
     170X25 I $D(DVBCI) S DVBSICK=DVBCI
     171 Q
     17226 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
     173X26 I '$D(DVBSICK) S Y="@25",JP=JP+1
     174 Q
     17527 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
     1DVBHCE21 ; ;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
    725 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
     1DVBHCE22 ; ;12/27/07
    682 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)
    704 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
    15019 D AUTOUPD^DGENA2(DA)
    151  S X=DE(20),DIC=DIE
    152  ;
    153  S X=DE(20),DIC=DIE
    154  I $$VERSION^XPDUTL("PSO")>6 D APSOD^PSOAUTOC(DA)
    155  S X=DE(20),DIC=DIE
     20 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
    15625 S IVMX=X,X="IVMPXFR" X ^%ZOSF("TEST") D:$T DPT^IVMPXFR S X=IVMX K IVMX
    157  S X=DE(20),DIC=DIE
     26 S X=DG(DQ),DIC=DIE
    15827 I ($T(AVAFC^VAFCDD01)'="") S VAFCF=".351;" D AVAFC^VAFCDD01(DA)
    159  S X=DE(20),DIC=DIE
     28 S X=DG(DQ),DIC=DIE
    16029 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
     1DVBHCE23 ; ;12/27/07
     2 D DE G BEGIN
     3DE S DIE="^DPT(",DIC=DIE,DP=2,DL=1,DIEL=0,DU="" K DG,DE,DB Q:$O(^DPT(DA,""))=""
     4 I $D(^(.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 ;
     9W W !?DL+DL-2,DLB_": "
     10 Q
     11O D W W Y W:$X>45 !?9
     12 I $L(Y)>19,'DV,DV'["I",(DV["F"!(DV["K")) G RW^DIR2
     13 W:Y]"" "// " I 'DV,DV["I",$D(DE(DQ))#2 S X="" W "  (No Editing)" Q
     14TR R X:DTIME E  S (DTOUT,X)=U W $C(7)
     15 Q
     16A K DQ(DQ) S DQ=DQ+1
     17B G @DQ
     18RE G PR:$D(DE(DQ)) D W,TR
     19N I X="" G NKEY:$D(^DD("KEY","F",DP,DIFLD)),A:DV'["R",X:'DV,X:D'>0,A
     20RD G QS:X?."?" I X["^" D D G ^DIE17
     21 I X="@" D D G Z^DIE2
     22 I X=" ",DV["d",DV'["P",$D(^DISV(DUZ,"DIE",DLB)) S X=^(DLB) I DV'["D",DV'["S" W "  "_X
     23T G M^DIE17:DV,^DIE3:DV["V",P:DV'["S" X:$D(^DD(DP,DIFLD,12.1)) ^(12.1) I X?.ANP D SET I 'DDER X:$D(DIC("S")) DIC("S") I  W:'$D(DB(DQ)) "  "_% G V
     24 K DDER G X
     25P I DV["P" S DIC=U_DU,DIC(0)=$E("EN",$D(DB(DQ))+1)_"M"_$E("L",DV'["'") S:DIC(0)["L" DLAYGO=+$P(DV,"P",2) G:DV["*" AST^DIED D NOSCR^DIED S X=+Y,DIC=DIE G X:X<0
     26 G V:DV'["N" D D I $L($P(X,"."))>24 K X G Z
     27 I $P(DQ(DQ),U,5)'["$",X?.1"-".N.1".".N,$P(DQ(DQ),U,5,99)["+X'=X" S X=+X
     28V D @("X"_DQ) K YS
     29Z K DIC("S"),DLAYGO I $D(X),X'=U D:$G(DE(DW,"INDEX")) SAVEVALS G:'$$KEYCHK UNIQFERR^DIE17 S DG(DW)=X S:DV["d" ^DISV(DUZ,"DIE",DLB)=X G A
     30X W:'$D(ZTQUEUED) $C(7),"??" I $D(DB(DQ)) G Z^DIE17
     31 S X="?BAD"
     32QS S DZ=X D D,QQ^DIEQ G B
     33D S D=DIFLD,DQ(DQ)=DLB_U_DV_U_DU_U_DW_U_$P($T(@("X"_DQ))," ",2,99) Q
     34Y I '$D(DE(DQ)) D O G RD:"@"'[X,A:DV'["R"&(X="@"),X:X="@" S X=Y G N
     35PR S DG=DV,Y=DE(DQ),X=DU I $D(DQ(DQ,2)) X DQ(DQ,2) G RP
     36R I DG["P",@("$D(^"_X_"0))") S X=+$P(^(0),U,2) G RP:'$D(^(Y,0)) S Y=$P(^(0),U),X=$P(^DD(X,.01,0),U,3),DG=$P(^(0),U,2) G R
     37 I DG["V",+Y,$P(Y,";",2)["(",$D(@(U_$P(Y,";",2)_"0)")) S X=+$P(^(0),U,2) G RP:'$D(^(+Y,0)) S Y=$P(^(0),U) I $D(^DD(+X,.01,0)) S DG=$P(^(0),U,2),X=$P(^(0),U,3) G R
     38 X:DG["D" ^DD("DD") I DG["S" S %=$P($P(";"_X,";"_Y_":",2),";") S:%]"" Y=%
     39RP D O I X="" S X=DE(DQ) G A:'DV,A:DC<2,N^DIE17
     40I I DV'["I",DV'["#" G RD
     41 D E^DIE0 G RD:$D(X),PR
     42 Q
     43SET N DIR S DIR(0)="SV"_$E("o",$D(DB(DQ)))_U_DU,DIR("V")=1
     44 I $D(DB(DQ)),'$D(DIQUIET) N DIQUIET S DIQUIET=1
     45 D ^DIR I 'DDER S %=Y(0),X=Y
     46 Q
     47SAVEVALS S @DIEZTMP@("V",DP,DIIENS,DIFLD,"O")=$G(DE(DQ)) S:$D(^("F"))[0 ^("F")=$G(DE(DQ))
     48 I $D(DE(DW,"4/")) S @DIEZTMP@("V",DP,DIIENS,DIFLD,"4/")=""
     49 E  K @DIEZTMP@("V",DP,DIIENS,DIFLD,"4/")
     50 Q
     51NKEY W:'$D(ZTQUEUED) "??  Required key field" S X="?BAD" G QS
     52KEYCHK() Q:$G(DE(DW,"KEY"))="" 1 Q @DE(DW,"KEY")
     53BEGIN S DNM="DVBHCE23",DQ=1
     541 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
     61C1 G C1S:$D(DE(1))[0 K DB
     62 S X=DE(1),DIC=DIE
     63 D EVENT^IVMPLOG(DA)
     64C1S S X="" G:DG(DQ)=X C1F1 K DB
    265 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)
     67C1F1 Q
     68X1 Q
     692 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
     70X2 W "." S JP=JP+1,DVBJ2=1 K DVBSICK
     71 Q
     723 S DQ=4 ;@25
     734 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=4 D X4 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
     74X4 I $P(Z2,U,JP)'=6 S Y="@26"
     75 Q
     765 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=5 D X5 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
     77X5 I '$D(DVBPOW),'$D(DVBPOWD) S Y="@26",JP=JP+1
     78 Q
     796 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
     80X6 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
     827 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
     83X7 I '$D(DVBPOW),'+DVBPOWD S Y="@26",JP=JP+1
     84 Q
     858 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
     86X8 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
     889 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
     89X9 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
     9110 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
     92X10 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
     9411 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
     95X11 D POW^DVBHUTIL
     96 Q
     9712 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
     104C12 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)
     117C12S S X="" G:DG(DQ)=X C12F1 K DB
    4118 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)
    6120 S X=DG(DQ),DIC=DIE
    7  D DSBULL^DGDEATH
     121 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)
    8122 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)
    18124 S X=DG(DQ),DIC=DIE
    19125 D AUTOUPD^DGENA2(DA)
    20126 S X=DG(DQ),DIC=DIE
    21  D START^DGMTDELS(DA)
     127 X "S DFN=DA D EN^DGMTR K DGREQF"
    22128 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)
     130C12F1 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
     136C12X1(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
     140C12F2 Q
     141X12 S DFN=DA D SV^DGLOCK
     142 Q
     143 ;
     14413 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
     145X13 K DVBPOW1 W "." S JP=JP+1,DVBJ2=1
     146 Q
     14714 S DQ=15 ;@26
     14815 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
     149X15 I $P(Z2,U,JP)'=7 S Y="@27"
     150 Q
     15116 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
     152X16 I '$D(DVBFL) S Y="@27",JP=JP+1
     153 Q
     15417 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
     155X17 I DVBFL']"" S Y="@27",JP=JP+1
     156 Q
     15718 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
     158X18 I DVBFL'?3N1" - "1U.E S Y="@27",JP=JP+1
     159 Q
     16019 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
     167C19 G C19S:$D(DE(19))[0 K DB
     168 D ^DVBHCE24
     169C19S S X="" G:DG(DQ)=X C19F1 K DB
     170 D ^DVBHCE25
     171C19F1 Q
     172X19 S DIC("S")="I $$CFLTF^DGREGDD(Y)" D ^DIC K DIC S DIC=DIE,X=+Y K:Y<0 X
     173 Q
     174 ;
     17520 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
     176X20 W "." S JP=JP+1,DVBJ2=1
     177 Q
     17821 S DQ=22 ;@27
     17922 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
     180X22 I $P(Z2,U,JP)'=8 S Y="@50"
     181 Q
     18223 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
     183X23 I '$D(DVBEI) S Y="@50",JP=JP+1
     184 Q
     18524 D:$D(DG)>9 F^DIE17 G ^DVBHCE26
  • WorldVistAEHR/trunk/r/HINQ-DVB--DVBA--DVBE--DVBC/DVBHCE24.m

    r613 r623  
    1 DVBHCE24 ; ;12/13/08
    2  S X=DG(DQ),DIC=DIE
    3  D EVENT^IVMPLOG(DA)
     1DVBHCE24 ; ;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
     1DVBHCE25 ; ;12/27/07
    1302 S X=DG(DQ),DIC=DIE
    1313 D SET^DGREGDD(DA,X)
    132 C8F1 Q
    133 X8 S DIC("S")="I $$CFLTF^DGREGDD(Y)" D ^DIC K DIC S DIC=DIE,X=+Y K:Y<0 X
    134  Q
    135  ;
    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^DIE17
    137 X9 W "." S JP=JP+1,DVBJ2=1
    138  Q
    139 10 S DQ=11 ;@27
    140 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
    141 X11 I $P(Z2,U,JP)'=8 S Y="@50"
    142  Q
    143 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
    144 X12 I '$D(DVBEI) S Y="@50",JP=JP+1
    145  Q
    146 13 D:$D(DG)>9 F^DIE17,DE S DQ=13,DW=".3;5",DV="S",DU="",DLB="UNEMPLOYABLE",DIFLD=.305
    147  S DE(DW)="C13^DVBHCE25"
    148  S DU="Y:YES;N:NO;"
    149  S X=$S(DVBEI="Y":"Y",1:"N")
    150  S Y=X
    151  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 RD
    153 C13 G C13S:$D(DE(13))[0 K DB
    154  S X=DE(13),DIC=DIE
    155  D AUTOUPD^DGENA2(DA)
    156  S X=DE(13),DIC=DIE
    157  S DFN=DA D EN^DGMTCOR K DGMTCOR
    158 C13S S X="" G:DG(DQ)=X C13F1 K DB
    159  S X=DG(DQ),DIC=DIE
    160  D AUTOUPD^DGENA2(DA)
    161  S X=DG(DQ),DIC=DIE
    162  S DFN=DA D EN^DGMTCOR K DGMTCOR
    163 C13F1 Q
    164 X13 Q
    165 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
    166 X14 W "." S JP=JP+1,DVBJ2=1
    167  Q
    168 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
    169 X15 S Y="@50"
    170  Q
    171 16 S DQ=17 ;@40
    172 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
    173 X17 I $P(Z2,U,JP)'=1 S Y="@42"
    174  Q
    175 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
    176 X18 I '$D(DVBP(6)) S Y="@42",JP=JP+1
    177  Q
    178 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
    179 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+1
    180  Q
    181 20 D:$D(DG)>9 F^DIE17,DE S DQ=20,DW=".32;2",DV="DX",DU="",DLB="SERVICE VERIFICATION DATE",DIFLD=.322
    182  S X="T"
    183  S Y=X
    184  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 RD
    186 X20 S %DT="",%DT(0)=-DT D ^%DT K %DT S X=Y K:Y<1 X I $D(X) D EK^DGLOCK
    187  Q
    188  ;
    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^DIE17
    190 X21 W "." S JP=JP+1,DVBJ2=1
    191  Q
    192 22 S DQ=23 ;@42
    193 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
    194 X23 I $P(Z2,U,JP)'=2 S Y="@45"
    195  Q
    196 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
    197 X24 I '$D(DVBP(6)) S Y="@45",JP=JP+1
    198  Q
    199 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
    200 X25 I $P(DVBP(6),U,4)[" " S Y="@45",JP=JP+1
    201  Q
    202 26 S DW=".321;1",DV="RSX",DU="",DLB="VIETNAM SERVICE INDICATED?",DIFLD=.32101
    203  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=X
    207  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 RD
    209 C26 G C26S:$D(DE(26))[0 K DB
    210  S X=DE(26),DIC=DIE
    211  ;
    212  S X=DE(26),DIC=DIE
    213  ;
    214  S X=DE(26),DIC=DIE
    215  D EVENT^IVMPLOG(DA)
    216 C26S S X="" G:DG(DQ)=X C26F1 K DB
    217  D ^DVBHCE26
    218 C26F1 Q
    219 X26 S DFN=DA D SV^DGLOCK
    220  Q
    221  ;
    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^DIE17
    223 X27 W "." S JP=JP+1,DVBJ2=1
    224  Q
    225 28 S DQ=29 ;@45
    226 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
    227 X29 I $P(Z2,U,JP)'=3!('$D(DVBDX(1))) S Y="@50"
    228  Q
    229 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
    230 X30 S:'$D(DVBFL) DVBFL="UNKNOWN"
    231  Q
    232 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
    233 X31 I $D(DVBCAP),DVBCAP["No C&P",$P(DVBBIR,U,5)'="Y" D CHK^DVBHUTIL
    234  Q
    235 32 S DQ=33 ;@47
    236 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
    237 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  Q
    239 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
    240 X34 S DVB8=$O(^DIC(8,"B","SERVICE CONNECTED 50% to 100%",0)),DVB9=$O(^DIC(8,"B","SC LESS THAN 50%",0))
    241  Q
    242 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
    243 X35 I DVBDXNO I ((DVB8'=DVB5&(DVB9'=DVB5))!(DVB4'="Y")!(DVB6'="Y")!(DVB7'=1)) S Y="@70"
    244  Q
    245 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
    246 X36 W ! K ^DPT(DFN,.372),JP4,JP6 S ^DPT(DFN,.372,0)="^2.04P^^0",JP=0
    247  Q
    248 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
    249 X37 S $P(^DPT(DFN,.3),U,2)="",$P(^DPT(DFN,.3),U,14)=""
    250  Q
    251 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
     1DVBHCE26 ; ;12/27/07
     2 D DE G BEGIN
     3DE S DIE="^DPT(",DIC=DIE,DP=2,DL=1,DIEL=0,DU="" K DG,DE,DB Q:$O(^DPT(DA,""))=""
     4 I $D(^(.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 ;
     9W W !?DL+DL-2,DLB_": "
     10 Q
     11O D W W Y W:$X>45 !?9
     12 I $L(Y)>19,'DV,DV'["I",(DV["F"!(DV["K")) G RW^DIR2
     13 W:Y]"" "// " I 'DV,DV["I",$D(DE(DQ))#2 S X="" W "  (No Editing)" Q
     14TR R X:DTIME E  S (DTOUT,X)=U W $C(7)
     15 Q
     16A K DQ(DQ) S DQ=DQ+1
     17B G @DQ
     18RE G PR:$D(DE(DQ)) D W,TR
     19N I X="" G NKEY:$D(^DD("KEY","F",DP,DIFLD)),A:DV'["R",X:'DV,X:D'>0,A
     20RD G QS:X?."?" I X["^" D D G ^DIE17
     21 I X="@" D D G Z^DIE2
     22 I X=" ",DV["d",DV'["P",$D(^DISV(DUZ,"DIE",DLB)) S X=^(DLB) I DV'["D",DV'["S" W "  "_X
     23T G M^DIE17:DV,^DIE3:DV["V",P:DV'["S" X:$D(^DD(DP,DIFLD,12.1)) ^(12.1) I X?.ANP D SET I 'DDER X:$D(DIC("S")) DIC("S") I  W:'$D(DB(DQ)) "  "_% G V
     24 K DDER G X
     25P I DV["P" S DIC=U_DU,DIC(0)=$E("EN",$D(DB(DQ))+1)_"M"_$E("L",DV'["'") S:DIC(0)["L" DLAYGO=+$P(DV,"P",2) G:DV["*" AST^DIED D NOSCR^DIED S X=+Y,DIC=DIE G X:X<0
     26 G V:DV'["N" D D I $L($P(X,"."))>24 K X G Z
     27 I $P(DQ(DQ),U,5)'["$",X?.1"-".N.1".".N,$P(DQ(DQ),U,5,99)["+X'=X" S X=+X
     28V D @("X"_DQ) K YS
     29Z K DIC("S"),DLAYGO I $D(X),X'=U D:$G(DE(DW,"INDEX")) SAVEVALS G:'$$KEYCHK UNIQFERR^DIE17 S DG(DW)=X S:DV["d" ^DISV(DUZ,"DIE",DLB)=X G A
     30X W:'$D(ZTQUEUED) $C(7),"??" I $D(DB(DQ)) G Z^DIE17
     31 S X="?BAD"
     32QS S DZ=X D D,QQ^DIEQ G B
     33D S D=DIFLD,DQ(DQ)=DLB_U_DV_U_DU_U_DW_U_$P($T(@("X"_DQ))," ",2,99) Q
     34Y I '$D(DE(DQ)) D O G RD:"@"'[X,A:DV'["R"&(X="@"),X:X="@" S X=Y G N
     35PR S DG=DV,Y=DE(DQ),X=DU I $D(DQ(DQ,2)) X DQ(DQ,2) G RP
     36R I DG["P",@("$D(^"_X_"0))") S X=+$P(^(0),U,2) G RP:'$D(^(Y,0)) S Y=$P(^(0),U),X=$P(^DD(X,.01,0),U,3),DG=$P(^(0),U,2) G R
     37 I DG["V",+Y,$P(Y,";",2)["(",$D(@(U_$P(Y,";",2)_"0)")) S X=+$P(^(0),U,2) G RP:'$D(^(+Y,0)) S Y=$P(^(0),U) I $D(^DD(+X,.01,0)) S DG=$P(^(0),U,2),X=$P(^(0),U,3) G R
     38 X:DG["D" ^DD("DD") I DG["S" S %=$P($P(";"_X,";"_Y_":",2),";") S:%]"" Y=%
     39RP D O I X="" S X=DE(DQ) G A:'DV,A:DC<2,N^DIE17
     40I I DV'["I",DV'["#" G RD
     41 D E^DIE0 G RD:$D(X),PR
     42 Q
     43SET N DIR S DIR(0)="SV"_$E("o",$D(DB(DQ)))_U_DU,DIR("V")=1
     44 I $D(DB(DQ)),'$D(DIQUIET) N DIQUIET S DIQUIET=1
     45 D ^DIR I 'DDER S %=Y(0),X=Y
     46 Q
     47SAVEVALS S @DIEZTMP@("V",DP,DIIENS,DIFLD,"O")=$G(DE(DQ)) S:$D(^("F"))[0 ^("F")=$G(DE(DQ))
     48 I $D(DE(DW,"4/")) S @DIEZTMP@("V",DP,DIIENS,DIFLD,"4/")=""
     49 E  K @DIEZTMP@("V",DP,DIIENS,DIFLD,"4/")
     50 Q
     51NKEY W:'$D(ZTQUEUED) "??  Required key field" S X="?BAD" G QS
     52KEYCHK() Q:$G(DE(DW,"KEY"))="" 1 Q @DE(DW,"KEY")
     53BEGIN S DNM="DVBHCE26",DQ=1
     541 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
     61C1 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
     66C1S 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
     71C1F1 Q
     72X1 Q
     732 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
     74X2 W "." S JP=JP+1,DVBJ2=1
     75 Q
     763 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
     77X3 S Y="@50"
     78 Q
     794 S DQ=5 ;@40
     805 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
     81X5 I $P(Z2,U,JP)'=1 S Y="@42"
     82 Q
     836 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
     84X6 I '$D(DVBP(6)) S Y="@42",JP=JP+1
     85 Q
     867 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
     87X7 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
     898 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
     94X8 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 ;
     979 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
     98X9 W "." S JP=JP+1,DVBJ2=1
     99 Q
     10010 S DQ=11 ;@42
     10111 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
     102X11 I $P(Z2,U,JP)'=2 S Y="@45"
     103 Q
     10412 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
     105X12 I '$D(DVBP(6)) S Y="@45",JP=JP+1
     106 Q
     10713 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
     108X13 I $P(DVBP(6),U,4)[" " S Y="@45",JP=JP+1
     109 Q
     11014 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
     117C14 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)
     124C14S S X="" G:DG(DQ)=X C14F1 K DB
    2125 S X=DG(DQ),DIC=DIE
    3126 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)
     
    6129 S X=DG(DQ),DIC=DIE
    7130 D EVENT^IVMPLOG(DA)
     131C14F1 Q
     132X14 S DFN=DA D SV^DGLOCK
     133 Q
     134 ;
     13515 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
     136X15 W "." S JP=JP+1,DVBJ2=1
     137 Q
     13816 S DQ=17 ;@45
     13917 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
     140X17 I $P(Z2,U,JP)'=3!('$D(DVBDX(1))) S Y="@50"
     141 Q
     14218 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
     143X18 S:'$D(DVBFL) DVBFL="UNKNOWN"
     144 Q
     14519 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
     146X19 I $D(DVBCAP),DVBCAP["No C&P",$P(DVBBIR,U,5)'="Y" D CHK^DVBHUTIL
     147 Q
     14820 S DQ=21 ;@47
     14921 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
     150X21 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
     15222 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
     153X22 S DVB8=$O(^DIC(8,"B","SERVICE CONNECTED 50% to 100%",0)),DVB9=$O(^DIC(8,"B","SC LESS THAN 50%",0))
     154 Q
     15523 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
     156X23 I DVBDXNO I ((DVB8'=DVB5&(DVB9'=DVB5))!(DVB4'="Y")!(DVB6'="Y")!(DVB7'=1)) S Y="@70"
     157 Q
     15824 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
     159X24 W ! K ^DPT(DFN,.372),JP4,JP6 S ^DPT(DFN,.372,0)="^2.04P^^0",JP=0
     160 Q
     16125 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
     162X25 S $P(^DPT(DFN,.3),U,2)="",$P(^DPT(DFN,.3),U,14)=""
     163 Q
     16426 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
     170C26 G C26S:$D(DE(26))[0 K DB
     171 D ^DVBHCE27
     172C26S S X="" G:DG(DQ)=X C26F1 K DB
     173 D ^DVBHCE28
     174C26F1 Q
     175X26 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 ;
     17827 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
     1DVBHCE27 ; ;12/27/07
     2 S X=DE(26),DIC=DIE
    73 ;
    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
    617 ;
    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
    679 I ($T(AVAFC^VAFCDD01)'="") S VAFCF=".302;" D AVAFC^VAFCDD01(DA)
    68  S X=DE(1),DIC=DIE
     10 S X=DE(26),DIC=DIE
    6911 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
     1DVBHCE28 ; ;12/27/07
     2 S X=DG(DQ),DIC=DIE
    63 ;
    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="DVBHCE28",DQ=1
    52 1 S DW="0;2",DV="RNJ3,0X",DU="",DLB="DISABILITY %",DIFLD=2
    53  S DE(DW)="C1^DVBHCE28",DE(DW,"INDEX")=1
    54  S X=$S($P(DVBDX(JP),U,3)="X0":100,1:+$P(DVBDX(JP),U,3))
    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 C1 G C1S:$D(DE(1))[0 K DB
    59  S X=DE(1),DIC=DIE
    60  D EVENT^IVMPLOG($G(DA(1)))
    61 C1S S X="" G:DG(DQ)=X C1F1 K DB
    624 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)
    976 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/08
    2  ;;
    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 D
    5  . N DIEZCOND,DIEXARR M DIEXARR=X S DIEZCOND=1
    6  . I '$P($G(^DPT(DA,.52)),"^",15) S X=$$CVELIG^DGCV(DA)
    7  . S DIEZCOND=$G(X) K X M X=DIEXARR Q:'DIEZCOND
    8  . D SETCV^DGCV(DA,X2(1))
     1DVBHCE29 ; ;12/27/07
     2 D DE G BEGIN
     3DE S DIE="^DPT(",DIC=DIE,DP=2,DL=1,DIEL=0,DU="" K DG,DE,DB Q:$O(^DPT(DA,""))=""
     4 I $D(^(.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 ;
     8W W !?DL+DL-2,DLB_": "
    99 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))
     10O 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
     13TR R X:DTIME E  S (DTOUT,X)=U W $C(7)
    2114 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")
     15A K DQ(DQ) S DQ=DQ+1
     16B G @DQ
     17RE G PR:$D(DE(DQ)) D W,TR
     18N I X="" G NKEY:$D(^DD("KEY","F",DP,DIFLD)),A:DV'["R",X:'DV,X:D'>0,A
     19RD 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
     22T 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
     24P 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
     27V D @("X"_DQ) K YS
     28Z 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
     29X W:'$D(ZTQUEUED) $C(7),"??" I $D(DB(DQ)) G Z^DIE17
     30 S X="?BAD"
     31QS S DZ=X D D,QQ^DIEQ G B
     32D S D=DIFLD,DQ(DQ)=DLB_U_DV_U_DU_U_DW_U_$P($T(@("X"_DQ))," ",2,99) Q
     33Y I '$D(DE(DQ)) D O G RD:"@"'[X,A:DV'["R"&(X="@"),X:X="@" S X=Y G N
     34PR S DG=DV,Y=DE(DQ),X=DU I $D(DQ(DQ,2)) X DQ(DQ,2) G RP
     35R 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=%
     38RP D O I X="" S X=DE(DQ) G A:'DV,A:DC<2,N^DIE17
     39I I DV'["I",DV'["#" G RD
     40 D E^DIE0 G RD:$D(X),PR
    2741 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))
     42SET 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
    3245 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")
     46SAVEVALS 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/")
    3849 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))
     50NKEY W:'$D(ZTQUEUED) "??  Required key field" S X="?BAD" G QS
     51KEYCHK() Q:$G(DE(DW,"KEY"))="" 1 Q @DE(DW,"KEY")
     52BEGIN S DNM="DVBHCE29",DQ=1
     531 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
     58X1 S %DT="P" D ^%DT S X=Y K:Y<1!(Y>DT) X
    4359 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 ;
     612 S DQ=3 ;@46
     623 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
     63X3 S JP=$O(DVBDX(JP)) I 'JP S Y="@50"
    4964 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))
     654 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
     66X4 S JPP=+$P(DVBDX(JP),U,2) I JPP'>0 S Y="@46"
    5467 Q
     685 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
     69X5 I '$D(^DIC(31,JPP)) D CHKDIS^DVBHS3 S Y="@46"
     70 Q
     716 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)
     76M6 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
     81R6 D DE
     82 G A
     83 ;
     847 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
     85X7 W "." S DVBJ2=1
     86 Q
     878 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
     88X8 S Y="@46"
     89 Q
     909 S DQ=10 ;@61
     9110 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
     92X10 S Y="@4"
     93 Q
     9411 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
     95X11 I Z2'[1 S Y="@62"
     96 Q
     9712 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
     98X12 I '$D(DVBSSA) S Y="@62",JP=JP+1
     99 Q
     10013 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
     101X13 I DVBSSA S DVBYN="Y",DVBXYN=DVBSSA
     102 Q
     10314 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
     104X14 I 'DVBSSA S DVBYN="N",DVBXYN=""
     105 Q
     10615 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
     113C15 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)
     116C15S 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)
     119C15F1 Q
     120X15 S DFN=DA D MV^DGLOCK Q
     121 Q
     122 ;
     12316 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
     124X16 W "." S JP=JP+1,DVBJ2=1 K DVBYN,DVBXYN
     125 Q
     12617 S DQ=18 ;@62
     12718 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
     128X18 I Z2'[2 S Y="@63"
     129 Q
     13019 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
     131X19 I '$D(DVBRETT) S Y="@63",JP=JP+1
     132 Q
     13320 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
     134X20 I DVBRETT=""!("BMCROX"'[DVBRETT) S Y="@63",JP=JP+1
     135 Q
     13621 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
     142X21 S DFN=DA D MV^DGLOCK Q
     143 Q
     144 ;
     14522 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
     146X22 W "." S JP=JP+1,DVBJ2=1
     147 Q
     14823 S DQ=24 ;@63
     14924 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
     150X24 I Z2'[3 S Y="@64"
     151 Q
     15225 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
     153X25 I '$D(DVBRETO) S Y="@64",JP=JP+1
     154 Q
     15526 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
     156X26 S X=DVBRETO I X=""!(X=0) S X="@"
     157 Q
     15827 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
     163X27 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 ;
     16628 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
     167X28 W "." S JP=JP+1,DVBJ2=1
     168 Q
     16929 S DQ=30 ;@64
     17030 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
     171X30 I Z2'[4 S Y="@1006"
     172 Q
     17331 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
     174X31 I '$D(DVBOINC) S Y="@1006",JP=JP+1
     175 Q
     17632 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
     177X32 S X=DVBOINC I X=""!(X=0) S X="@"
     178 Q
     17933 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)
     1DVBHCE3 ; ;12/27/07
     2 D DE G BEGIN
     3DE S DIE="^DPT(",DIC=DIE,DP=2,DL=1,DIEL=0,DU="" K DG,DE,DB Q:$O(^DPT(DA,""))=""
     4 I $D(^(.32)) S %Z=^(.32) S %=$P(%Z,U,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 ;
     7W W !?DL+DL-2,DLB_": "
     8 Q
     9O 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
     12TR R X:DTIME E  S (DTOUT,X)=U W $C(7)
     13 Q
     14A K DQ(DQ) S DQ=DQ+1
     15B G @DQ
     16RE G PR:$D(DE(DQ)) D W,TR
     17N I X="" G NKEY:$D(^DD("KEY","F",DP,DIFLD)),A:DV'["R",X:'DV,X:D'>0,A
     18RD 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
     21T 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
     23P 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
     26V D @("X"_DQ) K YS
     27Z 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
     28X W:'$D(ZTQUEUED) $C(7),"??" I $D(DB(DQ)) G Z^DIE17
     29 S X="?BAD"
     30QS S DZ=X D D,QQ^DIEQ G B
     31D S D=DIFLD,DQ(DQ)=DLB_U_DV_U_DU_U_DW_U_$P($T(@("X"_DQ))," ",2,99) Q
     32Y I '$D(DE(DQ)) D O G RD:"@"'[X,A:DV'["R"&(X="@"),X:X="@" S X=Y G N
     33PR S DG=DV,Y=DE(DQ),X=DU I $D(DQ(DQ,2)) X DQ(DQ,2) G RP
     34R 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=%
     37RP D O I X="" S X=DE(DQ) G A:'DV,A:DC<2,N^DIE17
     38I I DV'["I",DV'["#" G RD
     39 D E^DIE0 G RD:$D(X),PR
     40 Q
     41SET 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
     45SAVEVALS 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
     49NKEY W:'$D(ZTQUEUED) "??  Required key field" S X="?BAD" G QS
     50KEYCHK() Q:$G(DE(DW,"KEY"))="" 1 Q @DE(DW,"KEY")
     51BEGIN S DNM="DVBHCE3",DQ=1
     521 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
     56C1 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
     63C1S 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)
     70C1F1 Q
     71X1 S DFN=DA D SV^DGLOCK
     72 Q
     73 ;
     742 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
     75X2 I $P(^DPT(D0,.32),U,19)'="Y" S Y="@31"
     76 Q
     773 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
     80C3 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)
     85C3S 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)
     90C3F1 S DIEZRXR(2,DIIENS)=$$OREF^DILF($NA(@$$CREF^DILF(DIE)))
     91 F DIXR=649 S DIEZRXR(2,DIXR)=""
     92 Q
     93X3 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 ;
     964 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
     99C4 G C4S:$D(DE(4))[0 K DB
     100 S X=DE(4),DIC=DIE
     101 D EVENT^IVMPLOG(DA)
     102C4S S X="" G:DG(DQ)=X C4F1 K DB
     103 S X=DG(DQ),DIC=DIE
     104 D EVENT^IVMPLOG(DA)
     105C4F1 S DIEZRXR(2,DIIENS)=$$OREF^DILF($NA(@$$CREF^DILF(DIE)))
     106 F DIXR=649 S DIEZRXR(2,DIXR)=""
     107 Q
     108X4 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 ;
     1115 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
     115C5 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"
     122C5S 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 ;
     129C5F1 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
     136C5X1(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
     140C5F2 Q
     141X5 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 ;
     1446 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
     148C6 G C6S:$D(DE(6))[0 K DB
     149 S X=DE(6),DIC=DIE
     150 D EVENT^IVMPLOG(DA)
     151C6S S X="" G:DG(DQ)=X C6F1 K DB
     152 S X=DG(DQ),DIC=DIE
     153 D EVENT^IVMPLOG(DA)
     154C6F1 Q
     155X6 S DFN=DA D SER1^DGLOCK
     156 Q
     157 ;
     1587 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
     161C7 G C7S:$D(DE(7))[0 K DB
     162 S X=DE(7),DIC=DIE
     163 D EVENT^IVMPLOG(DA)
     164C7S S X="" G:DG(DQ)=X C7F1 K DB
     165 S X=DG(DQ),DIC=DIE
     166 D EVENT^IVMPLOG(DA)
     167C7F1 Q
     168X7 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 ;
     1728 S DQ=9 ;@31
     1739 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
     174X9 I Z2'[3 S Y="@33"
     175 Q
     17610 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
     177X10 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
     17911 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
     180X11 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
     18212 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
     183X12 S DVBSCR=1 D ^DVBHS4 W !,?34,DVBON,"[NNTLAST]",DVBOFF X DVBLIT1
     184 Q
     18513 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
     189C13 G C13S:$D(DE(13))[0 K DB
     190 D ^DVBHCE4
     191C13S S X="" G:DG(DQ)=X C13F1 K DB
     192 D ^DVBHCE5
     193C13F1 Q
     194X13 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 ;
     19714 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
     198X14 I $P(^DPT(D0,.32),U,20)'="Y" S Y="@33"
     199 Q
     20015 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
     1DVBHCE4 ; ;12/27/07
     2 S X=DE(13),DIC=DIE
    73 ;
    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
    1505 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 DB
    152  S X=DG(DQ),DIC=DIE
    153  X "I X'=""Y"" S DGXRF=.32945 D ^DGDDC Q"
    154  S X=DG(DQ),DIC=DIE
    155  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
    156 C10F1 Q
    157 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 X
    158  Q
    159  ;
    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^DIE17
    161 X11 I $P(^DPT(D0,.32),U,20)'="Y" S Y="@33"
    162  Q
    163 12 D:$D(DG)>9 F^DIE17,DE S DQ=12,DW=".32;16",DV="RDX",DU="",DLB="NNTL-EOD",DIFLD=.3297
    164  S DE(DW)="C12^DVBHCE4",DE(DW,"INDEX")=1
    165  G RE
    166 C12 G C12S:$D(DE(12))[0 K DB
    167  S X=DE(12),DIC=DIE
    168  D EVENT^IVMPLOG(DA)
    169 C12S S X="" G:DG(DQ)=X C12F1 K DB
    170  S X=DG(DQ),DIC=DIE
    171  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  Q
    175 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^DGINP
    176  Q
    177  ;
    178 13 D:$D(DG)>9 F^DIE17,DE S DQ=13,DW=".32;17",DV="RDX",DU="",DLB="NNTL-RAD",DIFLD=.3298
    179  S DE(DW)="C13^DVBHCE4",DE(DW,"INDEX")=1
    180  G RE
    181 C13 G C13S:$D(DE(13))[0 K DB
    182  S X=DE(13),DIC=DIE
    183  D EVENT^IVMPLOG(DA)
    184 C13S S X="" G:DG(DQ)=X C13F1 K DB
    185  S X=DG(DQ),DIC=DIE
    186  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  Q
    190 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^DGINP
    191  Q
    192  ;
    193 14 D:$D(DG)>9 F^DIE17,DE S DQ=14,DW=".32;15",DV="P23'X",DU="",DLB="NNTL-Bran. Ser.",DIFLD=.3296
    194  S DE(DW)="C14^DVBHCE4",DE(DW,"INDEX")=1
    195  S DU="DIC(23,"
    196  G RE
    197 C14 G C14S:$D(DE(14))[0 K DB
    198  S X=DE(14),DIC=DIE
    199  I $P($G(^DPT(DA,.321)),U,14)]"" D FVP^DGRPMS
    200  S X=DE(14),DIC=DIE
    201  D EVENT^IVMPLOG(DA)
    202  S X=DE(14),DIC=DIE
    203  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
    204  S X=DE(14),DIC=DIE
    205  X "S DGXRF=.3296 D ^DGDDC Q"
    206 C14S S X="" G:DG(DQ)=X C14F1 K DB
    207  S X=DG(DQ),DIC=DIE
    208  ;
    209  S X=DG(DQ),DIC=DIE
    210  D EVENT^IVMPLOG(DA)
    211  S X=DG(DQ),DIC=DIE
    212  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
    213  S X=DG(DQ),DIC=DIE
    214  ;
    215 C14F1 N X,X1,X2 S DIXR=410 D C14X1(U) K X2 M X2=X D C14X1("O") K X1 M X1=X
    216  D
    217  . N DIEXARR M DIEXARR=X S DIEZCOND=1
    218  . S X=X2(1)=""
    219  . S DIEZCOND=$G(X) K X M X=DIEXARR Q:'DIEZCOND
    220  . D DELMSE^DGRPMS(DA,3)
    221  G C14F2
    222 C14X1(DION) K X
    223  S X(1)=$G(@DIEZTMP@("V",2,DIIENS,.3296,DION),$P($G(^DPT(DA,.32)),U,15))
    224  S X=$G(X(1))
    225  Q
    226 C14F2 Q
    227 X14 S DFN=DA K:X=$O(^DIC(23,"B","B.E.C.","")) X I $D(X) D SER2^DGLOCK S DGCOMBR=$G(Y) Q
    228  Q
    229  ;
    230 15 D:$D(DG)>9 F^DIE17,DE S DQ=15,DW=".32;14",DV="RP25'X",DU="",DLB="NNTL-Char. Ser.",DIFLD=.3295
    231  S DE(DW)="C15^DVBHCE4"
    232  S DU="DIC(25,"
    233  G RE
    234 C15 G C15S:$D(DE(15))[0 K DB
    235  S X=DE(15),DIC=DIE
    236  D EVENT^IVMPLOG(DA)
    237 C15S S X="" G:DG(DQ)=X C15F1 K DB
    238  D ^DVBHCE5
    239 C15F1 Q
    240 X15 S DFN=DA D SER2^DGLOCK
    241  Q
    242  ;
    243 16 D:$D(DG)>9 F^DIE17,DE S DQ=16,DW=".32;18",DV="FX",DU="",DLB="NNTL-Ser. Num.",DIFLD=.3299
    244  S DE(DW)="C16^DVBHCE4"
    245  G RE
    246 C16 G C16S:$D(DE(16))[0 K DB
    247  D ^DVBHCE6
    248 C16S S X="" G:DG(DQ)=X C16F1 K DB
    249  D ^DVBHCE7
    250 C16F1 Q
    251 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) X
    252  I $D(X),X'?.ANP K X
    253  Q
    254  ;
    255 17 S DQ=18 ;@33
    256 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
    257 X18 I Z2'[4 S Y="@3"
    258  Q
    259 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
    260 X19 S DVBSCR=1 D ^DVBHS4
    261  Q
    262 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
    263 X20 S DVBJC2=$S($D(^DPT(D0,.32)):$P(^(.32),U,3),1:"")
    264  Q
    265 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/08
     1DVBHCE5 ; ;12/27/07
    22 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)
     1DVBHCE6 ; ;12/27/07
     2 D DE G BEGIN
     3DE S DIE="^DPT(",DIC=DIE,DP=2,DL=1,DIEL=0,DU="" K DG,DE,DB Q:$O(^DPT(DA,""))=""
     4 I $D(^(.32)) S %Z=^(.32) S %=$P(%Z,U,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 ;
     7W W !?DL+DL-2,DLB_": "
     8 Q
     9O 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
     12TR R X:DTIME E  S (DTOUT,X)=U W $C(7)
     13 Q
     14A K DQ(DQ) S DQ=DQ+1
     15B G @DQ
     16RE G PR:$D(DE(DQ)) D W,TR
     17N I X="" G NKEY:$D(^DD("KEY","F",DP,DIFLD)),A:DV'["R",X:'DV,X:D'>0,A
     18RD 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
     21T 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
     23P 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
     26V D @("X"_DQ) K YS
     27Z 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
     28X W:'$D(ZTQUEUED) $C(7),"??" I $D(DB(DQ)) G Z^DIE17
     29 S X="?BAD"
     30QS S DZ=X D D,QQ^DIEQ G B
     31D S D=DIFLD,DQ(DQ)=DLB_U_DV_U_DU_U_DW_U_$P($T(@("X"_DQ))," ",2,99) Q
     32Y I '$D(DE(DQ)) D O G RD:"@"'[X,A:DV'["R"&(X="@"),X:X="@" S X=Y G N
     33PR S DG=DV,Y=DE(DQ),X=DU I $D(DQ(DQ,2)) X DQ(DQ,2) G RP
     34R 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=%
     37RP D O I X="" S X=DE(DQ) G A:'DV,A:DC<2,N^DIE17
     38I I DV'["I",DV'["#" G RD
     39 D E^DIE0 G RD:$D(X),PR
     40 Q
     41SET 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
     45SAVEVALS 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
     49NKEY W:'$D(ZTQUEUED) "??  Required key field" S X="?BAD" G QS
     50KEYCHK() Q:$G(DE(DW,"KEY"))="" 1 Q @DE(DW,"KEY")
     51BEGIN S DNM="DVBHCE6",DQ=1
     521 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
     55C1 G C1S:$D(DE(1))[0 K DB
     56 S X=DE(1),DIC=DIE
     57 D EVENT^IVMPLOG(DA)
     58C1S S X="" G:DG(DQ)=X C1F1 K DB
     59 S X=DG(DQ),DIC=DIE
     60 D EVENT^IVMPLOG(DA)
     61C1F1 S DIEZRXR(2,DIIENS)=$$OREF^DILF($NA(@$$CREF^DILF(DIE)))
     62 F DIXR=663 S DIEZRXR(2,DIXR)=""
     63 Q
     64X1 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 ;
     672 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
     70C2 G C2S:$D(DE(2))[0 K DB
     71 S X=DE(2),DIC=DIE
     72 D EVENT^IVMPLOG(DA)
     73C2S S X="" G:DG(DQ)=X C2F1 K DB
     74 S X=DG(DQ),DIC=DIE
     75 D EVENT^IVMPLOG(DA)
     76C2F1 S DIEZRXR(2,DIIENS)=$$OREF^DILF($NA(@$$CREF^DILF(DIE)))
     77 F DIXR=663 S DIEZRXR(2,DIXR)=""
     78 Q
     79X2 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 ;
     823 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
     86C3 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"
     95C3S 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 ;
     104C3F1 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
     111C3X1(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
     115C3F2 Q
     116X3 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 ;
     1194 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
     123C4 G C4S:$D(DE(4))[0 K DB
     124 S X=DE(4),DIC=DIE
     125 D EVENT^IVMPLOG(DA)
     126C4S S X="" G:DG(DQ)=X C4F1 K DB
     127 S X=DG(DQ),DIC=DIE
     128 D EVENT^IVMPLOG(DA)
     129C4F1 Q
     130X4 S DFN=DA D SER2^DGLOCK
     131 Q
     132 ;
     1335 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
     136C5 G C5S:$D(DE(5))[0 K DB
     137 S X=DE(5),DIC=DIE
     138 D EVENT^IVMPLOG(DA)
     139C5S S X="" G:DG(DQ)=X C5F1 K DB
     140 S X=DG(DQ),DIC=DIE
     141 D EVENT^IVMPLOG(DA)
     142C5F1 Q
     143X5 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 ;
     1476 S DQ=7 ;@33
     1487 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
     149X7 I Z2'[4 S Y="@3"
     150 Q
     1518 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
     152X8 S DVBSCR=1 D ^DVBHS4
     153 Q
     1549 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
     155X9 S DVBJC2=$S($D(^DPT(D0,.32)):$P(^(.32),U,3),1:"")
     156 Q
     15710 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
     161C10 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
     171C10S 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
     181C10F1 Q
     182X10 S DFN=DA D POS^DGLOCK1
     183 Q
     184 ;
     18511 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
     186X11 I X'=DVBJC2 S DVBJ2=1
     187 Q
     18812 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
     189X12 K DVBJC2
     190 Q
     19113 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
     192X13 S Y="@3"
     193 Q
     19414 S DQ=15 ;@104
     19515 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
     196X15 D ^DVBHS5 S Y="@5" K DXS
     197 Q
     19816 S DQ=17 ;@204
     19917 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
     200X17 I Z2'[1 S Y="@205"
     201 Q
     20218 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
     203X18 S DVBSCR=1 D ^DVBHS5 S DVBJ2=1
     204 Q
     20519 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)
     1DVBHCE7 ; ;12/27/07
     2 D DE G BEGIN
     3DE S DIE="^DPT(",DIC=DIE,DP=2,DL=1,DIEL=0,DU="" K DG,DE,DB Q:$O(^DPT(DA,""))=""
     4 I $D(^(.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 ;
     11W W !?DL+DL-2,DLB_": "
     12 Q
     13O 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
     16TR R X:DTIME E  S (DTOUT,X)=U W $C(7)
     17 Q
     18A K DQ(DQ) S DQ=DQ+1
     19B G @DQ
     20RE G PR:$D(DE(DQ)) D W,TR
     21N I X="" G NKEY:$D(^DD("KEY","F",DP,DIFLD)),A:DV'["R",X:'DV,X:D'>0,A
     22RD 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
     25T 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
     27P 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
     30V D @("X"_DQ) K YS
     31Z 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
     32X W:'$D(ZTQUEUED) $C(7),"??" I $D(DB(DQ)) G Z^DIE17
     33 S X="?BAD"
     34QS S DZ=X D D,QQ^DIEQ G B
     35D S D=DIFLD,DQ(DQ)=DLB_U_DV_U_DU_U_DW_U_$P($T(@("X"_DQ))," ",2,99) Q
     36Y I '$D(DE(DQ)) D O G RD:"@"'[X,A:DV'["R"&(X="@"),X:X="@" S X=Y G N
     37PR S DG=DV,Y=DE(DQ),X=DU I $D(DQ(DQ,2)) X DQ(DQ,2) G RP
     38R 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=%
     41RP D O I X="" S X=DE(DQ) G A:'DV,A:DC<2,N^DIE17
     42I I DV'["I",DV'["#" G RD
     43 D E^DIE0 G RD:$D(X),PR
     44 Q
     45SET 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
     49SAVEVALS 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
     53NKEY W:'$D(ZTQUEUED) "??  Required key field" S X="?BAD" G QS
     54KEYCHK() Q:$G(DE(DW,"KEY"))="" 1 Q @DE(DW,"KEY")
     55BEGIN S DNM="DVBHCE7",DQ=1
     561 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
     60C1 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)
     67C1S 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)
     74C1F1 Q
     75X1 D EK^DGLOCK Q:'$D(X)
     76 Q
     77 ;
     782 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=2 G A
     793 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
     84C3 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)
     89C3S 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)
     94C3F1 Q
     95X3 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 ;
     984 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
     103C4 G C4S:$D(DE(4))[0 K DB
     104 S X=DE(4),DIC=DIE
     105 D EVENT^IVMPLOG(DA)
     106C4S S X="" G:DG(DQ)=X C4F1 K DB
     107 S X=DG(DQ),DIC=DIE
     108 D EVENT^IVMPLOG(DA)
     109C4F1 Q
     110X4 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 ;
     1145 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=5 G A
     1156 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
     119X6 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 ;
     1227 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)
     127M7 I D>0 S DC=DC_D I $D(^DPT(DA,"E",+D,0)) S DE(7)=$P(^(0),U,1)
     128 G RE
     129R7 D DE
     130 S D=$S($D(^DPT(DA,"E",0)):$P(^(0),U,3,4),1:1) G 7+1
     131 ;
     1328 S DQ=9 ;@205
     1339 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
     134X9 I Z2'[2 S Y="@206"
     135 Q
     13610 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=10 D X10 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
     137X10 S DVBSCR=1 D ^DVBHS5 S DVBJ2=1
     138 Q
     13911 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
     143C11 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
     147C11S 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
     151C11F1 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
     157C11X1(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
     161C11F2 Q
     162X11 Q
     16312 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
     167C12 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
     181C12S S X="" G:DG(DQ)=X C12F1 K DB
     182 D ^DVBHCE9
     183C12F1 Q
     184X12 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 ;
     18713 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
     191C13 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
     203C13S S X="" G:DG(DQ)=X C13F1 K DB
     204 D ^DVBHCE10
     205C13F1 Q
     206X13 S DFN=DA D EV^DGLOCK I $D(X),X="Y" D VET^DGLOCK
     207 Q
     208 ;
     20914 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
     210X14 I X="N" S Y="@2063"
     211 Q
     21215 S DQ=16 ;@2063
     21316 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
     217C16 G C16S:$D(DE(16))[0 K DB
     218 D ^DVBHCE11
     219C16S S X="" G:DG(DQ)=X C16F1 K DB
     220 D ^DVBHCE12
     221C16F1 Q
     222X16 S DFN=DA D EV^DGLOCK I $D(X) D ECD^DGLOCK1
     223 Q
     224 ;
     22517 S DQ=18 ;@206
     22618 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
     227X18 I Z2'[3 S Y="@104"
     228 Q
     22919 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
     230X19 S DVBSCR=1 D ^DVBHS5 S DVBJ2=1
     231 Q
     23220 D:$D(DG)>9 F^DIE17 G ^DVBHCE13
  • WorldVistAEHR/trunk/r/HINQ-DVB--DVBA--DVBE--DVBC/DVBHCE8.m

    r613 r623  
    1 DVBHCE8 ; ;12/13/08
     1DVBHCE8 ; ;12/27/07
    22 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)=%
     3DE 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)=%
    105 K %Z Q
    116 ;
     
    5449NKEY W:'$D(ZTQUEUED) "??  Required key field" S X="?BAD" G QS
    5550KEYCHK() 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=.323
     51BEGIN S DNM="DVBHCE8",DQ=1+D G B
     521 S DW="0;1",DV="M*P8'X#",DU="",DLB="ELIGIBILITY",DIFLD=.01
    5853 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
    6156C1 G C1S:$D(DE(1))[0 K DB
    6257 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)
    6459 S X=DE(1),DIC=DIE
    65  ;
     60 K ^DPT("AEL",DA(1),+X)
    6661 S X=DE(1),DIC=DIE
    67  I ($T(AVAFC^VAFCDD01)'="") S VAFCF=".323;" D AVAFC^VAFCDD01(DA)
     62 D E32^VADPT62
    6863 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))
    7167C1S S X="" G:DG(DQ)=X C1F1 K DB
    7268 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)=""
    7470 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)=""
    7672 S X=DG(DQ),DIC=DIE
    77  I ($T(AVAFC^VAFCDD01)'="") S VAFCF=".323;" D AVAFC^VAFCDD01(DA)
     73 D E31^VADPT62
    7874 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))
    8178C1F1 Q
    82 X1 S DFN=DA D POS^DGLOCK1
     79X1 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
    8380 Q
    8481 ;
    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
     822 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
     1DVBHCE9 ; ;12/27/07
    682 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
    704 S X=DG(DQ),DIC=DIE
    71  S ^DPT("AEL",DA(1),+X)=""
     5 S DFN=DA D EN^DGRP7CC
    726 S X=DG(DQ),DIC=DIE
    73  D E31^VADPT62
     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)
    748 S X=DG(DQ),DIC=DIE
    75  X "S DFN=DA(1) D EN^DGMTR K DGREQF"
     9 D AUTOUPD^DGENA2(DA)
    7610 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)
     1DVBHCG ; GENERATED FROM 'DVBHINQ PAT-HINQ COMP' PRINT TEMPLATE (#513) ; 04/03/06 ; (FILE 2, MARGIN=80)
    22 G BEGIN
    33N W !
Note: See TracChangeset for help on using the changeset viewer.