ADGDSEP ; IHS/ADC/PDW/ENM - EDIT PAST DAY SURGERIES ; [ 03/25/1999 11:48 AM ]
;;5.0;ADMISSION/DISCHARGE/TRANSFER;;MAR 25, 1999
;
;***> get patient
NAME W !! K DFN S DIC=9009012,DIC(0)="AQEM"
S DIC("A")="Select Day Surgery Patient: "
D ^DIC K DIC("A") G END:X="",END:X=U,NAME:Y<0
;
S (DFN,DA)=+Y D EN^ADGPI ;print patient inquiry info
I $D(^DPT(DFN,.35)),^(.35)]"" K DIR S DIR(0)="Y",DIR("A")="This patient has died. Are you sure you want to continue",DIR("B")="NO" D ^DIR I Y=0 G NAME
;
;***> get day surgery date
DSDATE K DIC S DIC="^ADGDS("_DFN_",""DS"",",DIC(0)="AEQMZ"
S DA(1)=DFN,DA=0 D ^DIC W !! K DIC,DIC("A") G NAME:Y'>0 S DGDFN1=+Y
I $D(^ADGDS(DFN,"DS",DGDFN1,2)),$P(^(2),U)'="" G DSEDIT
W !?5,*7,"Edit active day surgeries in the DAY SURGERY ENTER/EDIT option",! G NAME
;
DSEDIT ;***> edit using input template
S DIDEL=9009012,DR="[ADGDSADD]",DIE="^ADGDS(",DA=DFN
L +^ADGDS(DFN):3 I '$T D G NAME
. W !,*7,"SOMEONE ELSE IS UPDATING THIS DAY SURGERY PATIENT; TRY AGAIN LATER"
S DIE("NO^")="" D ^DIE L -^ADGDS(DFN) K DIE("NO^")
;
;***> print day surgery worksheet
CRB K DIR S DIR("A")="Print Clinical Record Brief",DIR(0)="Y"
S DIR("?")="Enter YES to print a worksheet for this patient"
S DIR("B")="NO" D ^DIR
I Y=1 S DGDFNX=DFN D DS1^ADGCRB0 ;go to print
G NAME
;
END D KILL^ADGUTIL Q
ADGDSEP ; IHS/ADC/PDW/ENM - EDIT PAST DAY SURGERIES ; [ 03/25/1999 11:48 AM ]
+1 ;;5.0;ADMISSION/DISCHARGE/TRANSFER;;MAR 25, 1999
+2 ;
+3 ;***> get patient
NAME WRITE !!
KILL DFN
SET DIC=9009012
SET DIC(0)="AQEM"
+1 SET DIC("A")="Select Day Surgery Patient: "
+2 DO ^DIC
KILL DIC("A")
IF X=""
GOTO END
IF X=U
GOTO END
IF Y<0
GOTO NAME
+3 ;
+4 ;print patient inquiry info
SET (DFN,DA)=+Y
DO EN^ADGPI
+5 IF $DATA(^DPT(DFN,.35))
IF ^(.35)]""
KILL DIR
SET DIR(0)="Y"
SET DIR("A")="This patient has died. Are you sure you want to continue"
SET DIR("B")="NO"
DO ^DIR
IF Y=0
GOTO NAME
+6 ;
+7 ;***> get day surgery date
DSDATE KILL DIC
SET DIC="^ADGDS("_DFN_",""DS"","
SET DIC(0)="AEQMZ"
+1 SET DA(1)=DFN
SET DA=0
DO ^DIC
WRITE !!
KILL DIC,DIC("A")
IF Y'>0
GOTO NAME
SET DGDFN1=+Y
+2 IF $DATA(^ADGDS(DFN,"DS",DGDFN1,2))
IF $PIECE(^(2),U)'=""
GOTO DSEDIT
+3 WRITE !?5,*7,"Edit active day surgeries in the DAY SURGERY ENTER/EDIT option",!
GOTO NAME
+4 ;
DSEDIT ;***> edit using input template
+1 SET DIDEL=9009012
SET DR="[ADGDSADD]"
SET DIE="^ADGDS("
SET DA=DFN
+2 LOCK +^ADGDS(DFN):3
IF '$TEST
Begin DoDot:1
+3 WRITE !,*7,"SOMEONE ELSE IS UPDATING THIS DAY SURGERY PATIENT; TRY AGAIN LATER"
End DoDot:1
GOTO NAME
+4 SET DIE("NO^")=""
DO ^DIE
LOCK -^ADGDS(DFN)
KILL DIE("NO^")
+5 ;
+6 ;***> print day surgery worksheet
CRB KILL DIR
SET DIR("A")="Print Clinical Record Brief"
SET DIR(0)="Y"
+1 SET DIR("?")="Enter YES to print a worksheet for this patient"
+2 SET DIR("B")="NO"
DO ^DIR
+3 ;go to print
IF Y=1
SET DGDFNX=DFN
DO DS1^ADGCRB0
+4 GOTO NAME
+5 ;
END DO KILL^ADGUTIL
QUIT