AQAODEL ; IHS/ORDC/LJF - DELETE AN OCCURRENCE RECORD ;
;;1.01;QAI MANAGEMENT;;OCT 05, 1995
;
;This rtn contians the code for user interface for deleting an
;occurrence. Due to the importance of this data, the entry is just
;flagged as deleted. It can be reopened, if needed. Also, deleted
;occurrence summaries can be printed.
;
ASK ; >>> ask for occ id or patient name or indicator
K AQAOIFN D ASK^AQAOLKP G EXIT:'$D(AQAOIFN)
;
D FIND^AQAOREV1 ;find all reviews and display them
;
DELETE ; >>> delete occurrence
W ! K DIR S DIR(0)="Y",DIR("B")="NO"
S DIR("A")="Are you SURE you want to DELETE this Occurrence"
D ^DIR G EXIT:$D(DIRUT),EXIT:Y'=1
L +^AQAOC(AQAOIFN):1 I '$T D G EXIT
.W !!,"CANNOT DELETE; ANOTHER USER HAS ENTRY LOCKED. TRY AGAIN!",!
L +^AQAGU(0):1 I '$T D G EXIT
.W !!,"CANNOT DELETE; AUDIT FILE LOCKED. TRY AGAIN.",!
;
W !!!?5,"Deleting Occurrence #",AQAOCID,". . . .",!!
S AQAOUDIT("DA")=AQAOIFN,AQAOUDIT("ACTION")="D"
S AQAOUDIT("COMMENT")="DELETING A RECORD" D ^AQAOAUD
K DIE S DIE="^AQAOC(",DA=AQAOIFN,DR=".11////2;.112"
D ^DIE L -^AQAOC(AQAOIFN)
;
;
EXIT ; >> eoj
D KILL^AQAOUTIL Q
AQAODEL ; IHS/ORDC/LJF - DELETE AN OCCURRENCE RECORD ;
+1 ;;1.01;QAI MANAGEMENT;;OCT 05, 1995
+2 ;
+3 ;This rtn contians the code for user interface for deleting an
+4 ;occurrence. Due to the importance of this data, the entry is just
+5 ;flagged as deleted. It can be reopened, if needed. Also, deleted
+6 ;occurrence summaries can be printed.
+7 ;
ASK ; >>> ask for occ id or patient name or indicator
+1 KILL AQAOIFN
DO ASK^AQAOLKP
IF '$DATA(AQAOIFN)
GOTO EXIT
+2 ;
+3 ;find all reviews and display them
DO FIND^AQAOREV1
+4 ;
DELETE ; >>> delete occurrence
+1 WRITE !
KILL DIR
SET DIR(0)="Y"
SET DIR("B")="NO"
+2 SET DIR("A")="Are you SURE you want to DELETE this Occurrence"
+3 DO ^DIR
IF $DATA(DIRUT)
GOTO EXIT
IF Y'=1
GOTO EXIT
+4 LOCK +^AQAOC(AQAOIFN):1
IF '$TEST
Begin DoDot:1
+5 WRITE !!,"CANNOT DELETE; ANOTHER USER HAS ENTRY LOCKED. TRY AGAIN!",!
End DoDot:1
GOTO EXIT
+6 LOCK +^AQAGU(0):1
IF '$TEST
Begin DoDot:1
+7 WRITE !!,"CANNOT DELETE; AUDIT FILE LOCKED. TRY AGAIN.",!
End DoDot:1
GOTO EXIT
+8 ;
+9 WRITE !!!?5,"Deleting Occurrence #",AQAOCID,". . . .",!!
+10 SET AQAOUDIT("DA")=AQAOIFN
SET AQAOUDIT("ACTION")="D"
+11 SET AQAOUDIT("COMMENT")="DELETING A RECORD"
DO ^AQAOAUD
+12 KILL DIE
SET DIE="^AQAOC("
SET DA=AQAOIFN
SET DR=".11////2;.112"
+13 DO ^DIE
LOCK -^AQAOC(AQAOIFN)
+14 ;
+15 ;
EXIT ; >> eoj
+1 DO KILL^AQAOUTIL
QUIT