DGDIS ;ALB/JDS,RN - DISPOSITION A REGISTRATION ; 8/6/04 3:17pm
;;5.3;Registration;**108,121,161,151,459,604,993,1031,1027,1052**;Aug 13, 1993;Build 7
;
D LO^DGUTL
GETL S L=^DG(43,1,0),DISL=+$P(L,"^",7) S:DISL=0 DISL=24 N SDISHDL
FIND W !! S DIC("A")="Disposition PATIENT: ",DIC="^DPT(",DIC(0)="AEQMZ",DIC("S")="I $D(^DPT(""ADA"",1,+Y))" D ^DIC K DIC("S"),DIC("A") G Q:Y'>0 S (DA,DFN,DGDFN)=+Y
S I=+$O(^DPT(DA,"DIS",0)),L=$S($D(^(I,0)):^(0),1:""),(DA,DFN1,DGDFN1)=I,SDL=L ;I $P(L,"^",6)?7N.E!(L="") W !!,"There are no open registrations to disposition for this patient.",!!,*7,*7 K DA,DFN1 G FIND
DP W !!,"LOG DATE",?20,"TYPE OF BENEFIT APPLIED FOR",! F I=1:1:47 W "-"
S L2=";"_$P(^DD(2.101,2,0),"^",3),L3=";"_$P(L,"^",3)_":"
W !,$$FMTE^XLFDT($E($P(L,U),1,12),"5Z"),?20,$P($P(L2,L3,2),";",1)
S DGODSND=L
ANS ;
;** DG*5.3*108; Eligibility Code and Period of Service Checks follow
;**DG*5.3*993; Decoupling project code for register only
N STATUS,DGENRYN,DGINELIG S STATUS=$$STATUS^DGENA($G(DFN)) ; DG*5.3*993
I $$GET^DGENPTA($G(DFN),.DGENPTA) S DGINELIG=$G(DGENPTA("INELDATE"))
I STATUS=25 S DGENRYN=0
N SEEN S SEEN=$$GET1^DIQ(2.101,DFN1_","_DFN_",",7,"I")
; DG*5.3*1031 - added "+"SEEN so NULL value for SEEN is treated as a ZERO
I '$G(DGINELIG),STATUS=25 D
. I +SEEN=0 W !! S DR="1//2;2;2.1;13;5//NOW;D CHT^DGDIS;8"_$S(DUZ'="":";9////"_DUZ,1:""),DIE="^DPT("_DFN_",""DIS"",",DA(1)=DFN,DP=2.101 D ^DIE I $S('$D(^DPT(DFN,"DIS",DA,0)):1,'$P(^(0),"^",6):1,1:0) G DEL
. I SEEN=1 W !! S DR="1//0;2;2.1;13;5//NOW;D CHT^DGDIS;8"_$S(DUZ'="":";9////"_DUZ,1:""),DIE="^DPT("_DFN_",""DIS"",",DA(1)=DFN,DP=2.101 D ^DIE I $S('$D(^DPT(DFN,"DIS",DA,0)):1,'$P(^(0),"^",6):1,1:0) G DEL
I STATUS'=25 W !! S DR="1;2;2.1;13;5//NOW;D CHT^DGDIS;8"_$S(DUZ'="":";9////"_DUZ,1:""),DIE="^DPT("_DFN_",""DIS"",",DA(1)=DFN,DP=2.101 D ^DIE I $S('$D(^DPT(DFN,"DIS",DA,0)):1,'$P(^(0),"^",6):1,1:0) G DEL ; Original code
I $G(DGINELIG),STATUS=25 D
. W !! S DR="1;2;2.1;13;5//NOW;D CHT^DGDIS;8"_$S(DUZ'="":";9////"_DUZ,1:""),DIE="^DPT("_DFN_",""DIS"",",DA(1)=DFN,DP=2.101 D ^DIE I $S('$D(^DPT(DFN,"DIS",DA,0)):1,'$P(^(0),"^",6):1,1:0) G DEL
N DGPOSX,DGELIGX,DGSTRX
I '$D(DFN) D Q Q
S DGELIGX=$S('$D(^DPT(DFN,.36)):1,$P(^(.36),"^",1)']"":1,1:0)
S DGPOSX=$S('$D(^DPT(DFN,.32)):1,$P(^(.32),"^",3)']"":1,1:0)
I (DGELIGX)&(DGPOSX) W !!,"Primary Eligibility Code and Period of Service are unspecified." K DGPOSX,DGELIGX,DGSTRX G DEL
I (DGELIGX)&('DGPOSX) W !!,"Primary Eligibility Code is unspecified." K DGPOSX,DGELIGX,DGSTRX G DEL
I ('DGELIGX)&(DGPOSX) W !!,"Period of Service is unspecified." K DGPOSX,DGELIGX,DGSTRX G DEL
;S DGXXXD=0 D EL^DGREGE
DISP ;**DG*5.3*993; Decoupling project
; DG*5.3*1027 - Made code changes to prevent duplicate prompt "Select the type of disposition:"
I '$G(DGINELIG),STATUS=25 D
. ; DG*5.3*1031 - added "+"SEEN so NULL value for SEEN is treated as a ZERO
. I +SEEN=0 D
. . W ! S DIC="^DIC(37,",DIC(0)="AEQMZ",DIC("A")="Select the type of disposition: ",DIC("S")="I '$P(^(0),""^"",10)"
. . S DIC("B")="CANCEL WITHOUT EXAM" D ^DIC K DIC("A"),DIC("B") I Y'>0 G DEL:X?1"^".E W !!,"A disposition must be entered to continue.",!!,*7,*7 G DISP
. I SEEN=1 D
. . W ! S DIC="^DIC(37,",DIC(0)="AEQMZ",DIC("A")="Select the type of disposition: ",DIC("S")="I '$P(^(0),""^"",10)"
. . D ^DIC K DIC("A"),DIC("B") I Y'>0 G DEL:X?1"^".E W !!,"A disposition must be entered to continue.",!!,*7,*7 G DISP
I STATUS'=25 W ! S DIC="^DIC(37,",DIC(0)="AEQMZ",DIC("A")="Select the type of disposition: ",DIC("S")="I '$P(^(0),""^"",10)" D ^DIC K DIC("A"),DIC("B") I Y'>0 G DEL:X?1"^".E W !!,"A disposition must be entered to continue.",!!,*7,*7 G DISP
I $G(DGINELIG),STATUS=25 D
. W ! S DIC="^DIC(37,",DIC(0)="AEQMZ",DIC("A")="Select the type of disposition: ",DIC("S")="I '$P(^(0),""^"",10)" D ^DIC K DIC("A"),DIC("B") I Y'>0 G DEL:X?1"^".E W !!,"A disposition must be entered to continue.",!!,*7,*7 G DISP
I '$D(Y) D Q Q
D ODS
S DR="" I $P(Y(0),"^",1)["INELIG" S DIE("NO^")="",DR="2.1;"
S DR=DR_"S:'DGODS Y=6;11500.01////1;11500.02////^S X=$S(DGODSE>0:DGODSE,1:"""");"
S DR=DR_"6///"_(+Y),DISP=+Y,DA=DFN1,DP=2.101,DA(1)=DFN D ^DIE K DIE("NO^") S DDT=$S($D(^DPT(DFN,"DIS",DA,0)):^(0),1:""),DGDIV=+$P(DDT,"^",4),DDT=$P(DDT,"^",6) S:'DGDIV DGDIV=""
I $P(^DG(43,1,0),U,30) S %ZIS="N",IOP="HOME" D ^%ZIS I $D(IOS),IOS,$D(^%ZIS(1,+IOS,99)),$D(^%ZIS(1,+^(99),0)) S Y=$P(^(0),U,1),DGIO(10)=Y
S X=$S($D(^DG(40.8,+DGDIV,"DEV")):^("DEV"),1:"1^1^1") S:'$D(DGIO(10)) DGIO(10)=$S($P(X,U,1)]"":$P(X,U,1),1:1)
S DFN=DGDFN,DFN1=DGDFN1,DGXXXD=0,DIE="^DPT("_DFN_",""DIS""," D EL^DGREGE
D MT
D EN1^DGEN(DFN) ;enrollment
W !!,"***** Registration dispositioned *****",!!,*7
D VALIDATE(DFN,DFN1) ; -- call c/o validator
D ACT
K DGDFN1,DGDOM,DGHEM,DGKAAS,DGL,DGNHCU,DGW,MASD,MASDEV,PARA,POP
DONE D Q G FIND
;
Q K %H,%Y,C,D0,D1,DG1,DGA1,DGDFN1,DGL,DGT,DQ,I1,SD321,SDDIV,SDL,VA,VAROOT,Z,DGDFN,DIC,DGIO,DDT,DISP,DGDIV,DA,DR,DFN,DFN1,L,I,Y,X,DIE,DIC,DP
K DGODS,DGODSND,SDISDEL Q
;
CHT S L=^DPT(DA(1),"DIS",DA,0),DGL=0,L2=+$P(L,"^",6),(L1,X)=+L D H^%DTC S LL1=%H,X=L2 D H^%DTC S LL2=%H
S X1=L1#1*10000,X2=L2#1*10000 S:LL2-LL1 X2=X2+(LL2-LL1*2400\1) S X3=X2\100-(X1\100),X2=X2#100,X1=X1#100 S:X1'<X2 X2=X2+60,X3=X3-1
S Y=$S(DUZ'="":9,1:0) S:X3'<DISL Y=8,DGL=1 Q
;
DEL S L=$S($D(^DPT(DFN,"DIS",DFN1,0)):^(0),1:0),X=$P(L,U,6) I X S $P(^(0),U,6)="" F I=0:0 S I=$O(^DD(2.101,5,1,I)) Q:'I X ^(I,2)
I $P($G(^DPT(DFN,"DIS",DFN1,0)),"^",18) D EN^SDCODEL(+$P(^(0),"^",18),1,$G(SDISHDL))
D Q W !!,"* Disposition deleted *",!!,*7,*7 G FIND
;
ODS ;if operation desert shield admission, create an entry in the ODS ADMISSIONS file
N DIE,DGDISTYP
S DGODS=0,DGDISTYP=+Y
I $P(Y(0),"^",1)["ADMIT"!($P(Y(0),"^",1)["ADMISSION"&($P(Y(0),"^",1)'["SCHEDULED")) Q ;don't store dispositions to admit
N Y D PT^DGYZODS I 'DGODS Q
S A1B2FL=11500.4,A1B2DT=+DGODSND D ADD^A1B2UTL S (DA,DGODSE)=+Y
S DIE="^A1B2(11500.4,",DR=".02////^S X=DGODS;.05////^S X=DGDISTYP;" D ^DIE
K DIE,DA Q
;
MT ;Check if user requires a means test. Ask user if s/he wants to
;proceed if one is required.
N DGREQF
D EN^DGMTR
I $P($$MTS^DGMTU(DFN),U,2)="R" D EDT^DGMTU(DFN,DT)
Q
;
ACT ;Execute Program Action
N DFN1
S DGDFN=DFN I $D(^DIC(37,DISP,"P")),^("P")]"" X ^("P")
Q
;
BEFORE(DFN,SDDT,SDEVT,SDISHDL) ; -- set 'before' vars for opt evt drv
; -- use tag for NEWing
N DA,DFN1,DGDFN,DGDFN1,DGODSND
D BEFORE^SDAMEVT3(.DFN,.SDDT,.SDEVT,.SDISHDL)
Q
;
EVT(DFN,SDDT,SDEVT,SDISHDL) ; -- opt evt drv
; -- use tag for NEWing
N DIV,DFN1,DGDFN,SDL,DGDIV,DISP,SD321,SDDIV,I,DGDFN1,DGDOM,DGHEM,DGKAAS,DGL,DGNHCU,DGW,MASD,MASDEV,PARA,POP
D EVT^SDAMEVT3(.DFN,.SDDT,.SDEVT,.SDISHDL)
Q
;
VALIDATE(DFN,DFN1) ; -- c/o validator
; -- use tag for NEWing
N DIV,DGDFN,SDL,DGDIV,DISP,SD321,SDDIV,I,DGDFN1,DGDOM,DGHEM,DGKAAS,DGL,DGNHCU,DGW,MASD,MASDEV,PARA,POP
;
N DGDIS0,DGOE,DGOE0,DGVST
S DGDIS0=$G(^DPT(+DFN,"DIS",+DFN1,0))
I "^0^1^"[(U_$P(DGDIS0,"^",2)_U) D
. ;
. ; -- get encounter
. S DGOE=+$P(DGDIS0,U,18)
. IF 'DGOE Q
. ;
. ; -- get encounter and visit
. S DGOE0=$$GETOE^SDOE(DGOE)
. S DGVST=+$P(DGOE0,U,5)
. IF 'DGVST Q
. ;
. ; -- validate disposition
. D FINAL^SCDXHLDR(DGVST)
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HDGDIS 7291 printed Nov 22, 2024@17:52:02 Page 2
DGDIS ;ALB/JDS,RN - DISPOSITION A REGISTRATION ; 8/6/04 3:17pm
+1 ;;5.3;Registration;**108,121,161,151,459,604,993,1031,1027,1052**;Aug 13, 1993;Build 7
+2 ;
+3 DO LO^DGUTL
GETL SET L=^DG(43,1,0)
SET DISL=+$PIECE(L,"^",7)
if DISL=0
SET DISL=24
NEW SDISHDL
FIND WRITE !!
SET DIC("A")="Disposition PATIENT: "
SET DIC="^DPT("
SET DIC(0)="AEQMZ"
SET DIC("S")="I $D(^DPT(""ADA"",1,+Y))"
DO ^DIC
KILL DIC("S"),DIC("A")
if Y'>0
GOTO Q
SET (DA,DFN,DGDFN)=+Y
+1 ;I $P(L,"^",6)?7N.E!(L="") W !!,"There are no open registrations to disposition for this patient.",!!,*7,*7 K DA,DFN1 G FIND
SET I=+$ORDER(^DPT(DA,"DIS",0))
SET L=$SELECT($DATA(^(I,0)):^(0),1:"")
SET (DA,DFN1,DGDFN1)=I
SET SDL=L
DP WRITE !!,"LOG DATE",?20,"TYPE OF BENEFIT APPLIED FOR",!
FOR I=1:1:47
WRITE "-"
+1 SET L2=";"_$PIECE(^DD(2.101,2,0),"^",3)
SET L3=";"_$PIECE(L,"^",3)_":"
+2 WRITE !,$$FMTE^XLFDT($EXTRACT($PIECE(L,U),1,12),"5Z"),?20,$PIECE($PIECE(L2,L3,2),";",1)
+3 SET DGODSND=L
ANS ;
+1 ;** DG*5.3*108; Eligibility Code and Period of Service Checks follow
+2 ;**DG*5.3*993; Decoupling project code for register only
+3 ; DG*5.3*993
NEW STATUS,DGENRYN,DGINELIG
SET STATUS=$$STATUS^DGENA($GET(DFN))
+4 IF $$GET^DGENPTA($GET(DFN),.DGENPTA)
SET DGINELIG=$GET(DGENPTA("INELDATE"))
+5 IF STATUS=25
SET DGENRYN=0
+6 NEW SEEN
SET SEEN=$$GET1^DIQ(2.101,DFN1_","_DFN_",",7,"I")
+7 ; DG*5.3*1031 - added "+"SEEN so NULL value for SEEN is treated as a ZERO
+8 IF '$GET(DGINELIG)
IF STATUS=25
Begin DoDot:1
+9 IF +SEEN=0
WRITE !!
SET DR="1//2;2;2.1;13;5//NOW;D CHT^DGDIS;8"_$SELECT(DUZ'="":";9////"_DUZ,1:"")
SET DIE="^DPT("_DFN_",""DIS"","
SET DA(1)=DFN
SET DP=2.101
DO ^DIE
IF $SELECT('$DATA(^DPT(DFN,"DIS",DA,0)):1,'$PIECE(^(0),"^",6):1,1:0)
GOTO DEL
+10 IF SEEN=1
WRITE !!
SET DR="1//0;2;2.1;13;5//NOW;D CHT^DGDIS;8"_$SELECT(DUZ'="":";9////"_DUZ,1:"")
SET DIE="^DPT("_DFN_",""DIS"","
SET DA(1)=DFN
SET DP=2.101
DO ^DIE
IF $SELECT('$DATA(^DPT(DFN,"DIS",DA,0)):1,'$PIECE(^(0),"^",6):1,1:0)
GOTO DEL
End DoDot:1
+11 ; Original code
IF STATUS'=25
WRITE !!
SET DR="1;2;2.1;13;5//NOW;D CHT^DGDIS;8"_$SELECT(DUZ'="":";9////"_DUZ,1:"")
SET DIE="^DPT("_DFN_",""DIS"","
SET DA(1)=DFN
SET DP=2.101
DO ^DIE
IF $SELECT('$DATA(^DPT(DFN,"DIS",DA,0)):1,'$PIECE(^(0),"^",6):1,1:0)
GOTO DEL
+12 IF $GET(DGINELIG)
IF STATUS=25
Begin DoDot:1
+13 WRITE !!
SET DR="1;2;2.1;13;5//NOW;D CHT^DGDIS;8"_$SELECT(DUZ'="":";9////"_DUZ,1:"")
SET DIE="^DPT("_DFN_",""DIS"","
SET DA(1)=DFN
SET DP=2.101
DO ^DIE
IF $SELECT('$DATA(^DPT(DFN,"DIS",DA,0)):1,'$PIECE(^(0),"^",6):1,1:0)
GOTO DEL
End DoDot:1
+14 NEW DGPOSX,DGELIGX,DGSTRX
+15 IF '$DATA(DFN)
DO Q
QUIT
+16 SET DGELIGX=$SELECT('$DATA(^DPT(DFN,.36)):1,$PIECE(^(.36),"^",1)']"":1,1:0)
+17 SET DGPOSX=$SELECT('$DATA(^DPT(DFN,.32)):1,$PIECE(^(.32),"^",3)']"":1,1:0)
+18 IF (DGELIGX)&(DGPOSX)
WRITE !!,"Primary Eligibility Code and Period of Service are unspecified."
KILL DGPOSX,DGELIGX,DGSTRX
GOTO DEL
+19 IF (DGELIGX)&('DGPOSX)
WRITE !!,"Primary Eligibility Code is unspecified."
KILL DGPOSX,DGELIGX,DGSTRX
GOTO DEL
+20 IF ('DGELIGX)&(DGPOSX)
WRITE !!,"Period of Service is unspecified."
KILL DGPOSX,DGELIGX,DGSTRX
GOTO DEL
+21 ;S DGXXXD=0 D EL^DGREGE
DISP ;**DG*5.3*993; Decoupling project
+1 ; DG*5.3*1027 - Made code changes to prevent duplicate prompt "Select the type of disposition:"
+2 IF '$GET(DGINELIG)
IF STATUS=25
Begin DoDot:1
+3 ; DG*5.3*1031 - added "+"SEEN so NULL value for SEEN is treated as a ZERO
+4 IF +SEEN=0
Begin DoDot:2
+5 WRITE !
SET DIC="^DIC(37,"
SET DIC(0)="AEQMZ"
SET DIC("A")="Select the type of disposition: "
SET DIC("S")="I '$P(^(0),""^"",10)"
+6 SET DIC("B")="CANCEL WITHOUT EXAM"
DO ^DIC
KILL DIC("A"),DIC("B")
IF Y'>0
if X?1"^".E
GOTO DEL
WRITE !!,"A disposition must be entered to continue.",!!,*7,*7
GOTO DISP
End DoDot:2
+7 IF SEEN=1
Begin DoDot:2
+8 WRITE !
SET DIC="^DIC(37,"
SET DIC(0)="AEQMZ"
SET DIC("A")="Select the type of disposition: "
SET DIC("S")="I '$P(^(0),""^"",10)"
+9 DO ^DIC
KILL DIC("A"),DIC("B")
IF Y'>0
if X?1"^".E
GOTO DEL
WRITE !!,"A disposition must be entered to continue.",!!,*7,*7
GOTO DISP
End DoDot:2
End DoDot:1
+10 IF STATUS'=25
WRITE !
SET DIC="^DIC(37,"
SET DIC(0)="AEQMZ"
SET DIC("A")="Select the type of disposition: "
SET DIC("S")="I '$P(^(0),""^"",10)"
DO ^DIC
KILL DIC("A"),DIC("B")
IF Y'>0
if X?1"^".E
GOTO DEL
WRITE !!,"A disposition must be entered to continue.",!!,*7,*7
GOTO DISP
+11 IF $GET(DGINELIG)
IF STATUS=25
Begin DoDot:1
+12 WRITE !
SET DIC="^DIC(37,"
SET DIC(0)="AEQMZ"
SET DIC("A")="Select the type of disposition: "
SET DIC("S")="I '$P(^(0),""^"",10)"
DO ^DIC
KILL DIC("A"),DIC("B")
IF Y'>0
if X?1"^".E
GOTO DEL
WRITE !!,"A disposition must be entered to continue.",!!,*7,*7
GOTO DISP
End DoDot:1
+13 IF '$DATA(Y)
DO Q
QUIT
+14 DO ODS
+15 SET DR=""
IF $PIECE(Y(0),"^",1)["INELIG"
SET DIE("NO^")=""
SET DR="2.1;"
+16 SET DR=DR_"S:'DGODS Y=6;11500.01////1;11500.02////^S X=$S(DGODSE>0:DGODSE,1:"""");"
+17 SET DR=DR_"6///"_(+Y)
SET DISP=+Y
SET DA=DFN1
SET DP=2.101
SET DA(1)=DFN
DO ^DIE
KILL DIE("NO^")
SET DDT=$SELECT($DATA(^DPT(DFN,"DIS",DA,0)):^(0),1:"")
SET DGDIV=+$PIECE(DDT,"^",4)
SET DDT=$PIECE(DDT,"^",6)
if 'DGDIV
SET DGDIV=""
+18 IF $PIECE(^DG(43,1,0),U,30)
SET %ZIS="N"
SET IOP="HOME"
DO ^%ZIS
IF $DATA(IOS)
IF IOS
IF $DATA(^%ZIS(1,+IOS,99))
IF $DATA(^%ZIS(1,+^(99),0))
SET Y=$PIECE(^(0),U,1)
SET DGIO(10)=Y
+19 SET X=$SELECT($DATA(^DG(40.8,+DGDIV,"DEV")):^("DEV"),1:"1^1^1")
if '$DATA(DGIO(10))
SET DGIO(10)=$SELECT($PIECE(X,U,1)]"":$PIECE(X,U,1),1:1)
+20 SET DFN=DGDFN
SET DFN1=DGDFN1
SET DGXXXD=0
SET DIE="^DPT("_DFN_",""DIS"","
DO EL^DGREGE
+21 DO MT
+22 ;enrollment
DO EN1^DGEN(DFN)
+23 WRITE !!,"***** Registration dispositioned *****",!!,*7
+24 ; -- call c/o validator
DO VALIDATE(DFN,DFN1)
+25 DO ACT
+26 KILL DGDFN1,DGDOM,DGHEM,DGKAAS,DGL,DGNHCU,DGW,MASD,MASDEV,PARA,POP
DONE DO Q
GOTO FIND
+1 ;
Q KILL %H,%Y,C,D0,D1,DG1,DGA1,DGDFN1,DGL,DGT,DQ,I1,SD321,SDDIV,SDL,VA,VAROOT,Z,DGDFN,DIC,DGIO,DDT,DISP,DGDIV,DA,DR,DFN,DFN1,L,I,Y,X,DIE,DIC,DP
+1 KILL DGODS,DGODSND,SDISDEL
QUIT
+2 ;
CHT SET L=^DPT(DA(1),"DIS",DA,0)
SET DGL=0
SET L2=+$PIECE(L,"^",6)
SET (L1,X)=+L
DO H^%DTC
SET LL1=%H
SET X=L2
DO H^%DTC
SET LL2=%H
+1 SET X1=L1#1*10000
SET X2=L2#1*10000
if LL2-LL1
SET X2=X2+(LL2-LL1*2400\1)
SET X3=X2\100-(X1\100)
SET X2=X2#100
SET X1=X1#100
if X1'<X2
SET X2=X2+60
SET X3=X3-1
+2 SET Y=$SELECT(DUZ'="":9,1:0)
if X3'<DISL
SET Y=8
SET DGL=1
QUIT
+3 ;
DEL SET L=$SELECT($DATA(^DPT(DFN,"DIS",DFN1,0)):^(0),1:0)
SET X=$PIECE(L,U,6)
IF X
SET $PIECE(^(0),U,6)=""
FOR I=0:0
SET I=$ORDER(^DD(2.101,5,1,I))
if 'I
QUIT
XECUTE ^(I,2)
+1 IF $PIECE($GET(^DPT(DFN,"DIS",DFN1,0)),"^",18)
DO EN^SDCODEL(+$PIECE(^(0),"^",18),1,$GET(SDISHDL))
+2 DO Q
WRITE !!,"* Disposition deleted *",!!,*7,*7
GOTO FIND
+3 ;
ODS ;if operation desert shield admission, create an entry in the ODS ADMISSIONS file
+1 NEW DIE,DGDISTYP
+2 SET DGODS=0
SET DGDISTYP=+Y
+3 ;don't store dispositions to admit
IF $PIECE(Y(0),"^",1)["ADMIT"!($PIECE(Y(0),"^",1)["ADMISSION"&($PIECE(Y(0),"^",1)'["SCHEDULED"))
QUIT
+4 NEW Y
DO PT^DGYZODS
IF 'DGODS
QUIT
+5 SET A1B2FL=11500.4
SET A1B2DT=+DGODSND
DO ADD^A1B2UTL
SET (DA,DGODSE)=+Y
+6 SET DIE="^A1B2(11500.4,"
SET DR=".02////^S X=DGODS;.05////^S X=DGDISTYP;"
DO ^DIE
+7 KILL DIE,DA
QUIT
+8 ;
MT ;Check if user requires a means test. Ask user if s/he wants to
+1 ;proceed if one is required.
+2 NEW DGREQF
+3 DO EN^DGMTR
+4 IF $PIECE($$MTS^DGMTU(DFN),U,2)="R"
DO EDT^DGMTU(DFN,DT)
+5 QUIT
+6 ;
ACT ;Execute Program Action
+1 NEW DFN1
+2 SET DGDFN=DFN
IF $DATA(^DIC(37,DISP,"P"))
IF ^("P")]""
XECUTE ^("P")
+3 QUIT
+4 ;
BEFORE(DFN,SDDT,SDEVT,SDISHDL) ; -- set 'before' vars for opt evt drv
+1 ; -- use tag for NEWing
+2 NEW DA,DFN1,DGDFN,DGDFN1,DGODSND
+3 DO BEFORE^SDAMEVT3(.DFN,.SDDT,.SDEVT,.SDISHDL)
+4 QUIT
+5 ;
EVT(DFN,SDDT,SDEVT,SDISHDL) ; -- opt evt drv
+1 ; -- use tag for NEWing
+2 NEW DIV,DFN1,DGDFN,SDL,DGDIV,DISP,SD321,SDDIV,I,DGDFN1,DGDOM,DGHEM,DGKAAS,DGL,DGNHCU,DGW,MASD,MASDEV,PARA,POP
+3 DO EVT^SDAMEVT3(.DFN,.SDDT,.SDEVT,.SDISHDL)
+4 QUIT
+5 ;
VALIDATE(DFN,DFN1) ; -- c/o validator
+1 ; -- use tag for NEWing
+2 NEW DIV,DGDFN,SDL,DGDIV,DISP,SD321,SDDIV,I,DGDFN1,DGDOM,DGHEM,DGKAAS,DGL,DGNHCU,DGW,MASD,MASDEV,PARA,POP
+3 ;
+4 NEW DGDIS0,DGOE,DGOE0,DGVST
+5 SET DGDIS0=$GET(^DPT(+DFN,"DIS",+DFN1,0))
+6 IF "^0^1^"[(U_$PIECE(DGDIS0,"^",2)_U)
Begin DoDot:1
+7 ;
+8 ; -- get encounter
+9 SET DGOE=+$PIECE(DGDIS0,U,18)
+10 IF 'DGOE
QUIT
+11 ;
+12 ; -- get encounter and visit
+13 SET DGOE0=$$GETOE^SDOE(DGOE)
+14 SET DGVST=+$PIECE(DGOE0,U,5)
+15 IF 'DGVST
QUIT
+16 ;
+17 ; -- validate disposition
+18 DO FINAL^SCDXHLDR(DGVST)
End DoDot:1
+19 QUIT