ACKQPCE3 ;HCIOFO/AG - Quasar/PCE Interface; August 1999.
;;3.0;QUASAR;;Feb 11, 2000
;;
;
KILLPCE(ACKVIEN) ; kill a visit from PCE
; see KILLPCE^ACKQPCE for comments. this routine should not be
; called directly, only from ^ACKQPCE (this routine assumes that
; ACKVIEN exists).
N ACKDEAD,ACKLOCK,ACKPCE,ACKE,ACKARR,ACKMSG,ACKRSN
S ACKDEAD=1,ACKLOCK=0
;
; get the PCE VISIT IEN from the visit file
S ACKPCE=$$GET1^DIQ(509850.6,ACKVIEN_",",125,"I")
;
; if no PCE Visit Ien then nothing to do.
I 'ACKPCE G KILLPCEX
;
; lock the visit
L +^ACK(509850.6,ACKVIEN):0 I $T S ACKLOCK=1
;
; clear any existing PCE Errors for this visit
D CLEAR^ACKQPCE(ACKVIEN)
;
; call PCE to delete the visit
S ACKE=$$DELVFILE^PXAPI("ALL",ACKPCE,"","",0,0,"")
;
; if deletion not completed then record error and set flag
I ACKE'=1 D
. K ACKRSN S ACKRSN=0
. S ACKMSG="Unable to Delete PCE Visit (error code="_ACKE_")"
. D ADDRSN^ACKQPCE2("PCE VISIT",ACKPCE,"",ACKMSG,.ACKRSN)
. D FILERSN^ACKQPCE(ACKVIEN,.ACKRSN)
. ; file last edited in Quasar date to create exception entry
. K ACKARR D NOW^%DTC
. S ACKARR(509850.6,ACKVIEN_",",140)=%
. D FILE^DIE("","ACKARR","")
. S ACKDEAD=0
;
; if deleted ok then update fields and set flag
I ACKE=1 D
. K ACKARR D NOW^%DTC
. S ACKARR(509850.6,ACKVIEN_",",125)="@" ; remove PCE Visit ien
. S ACKARR(509850.6,ACKVIEN_",",135)=% ; last sent to pce
. D FILE^DIE("","ACKARR","")
. S ACKDEAD=1
;
KILLPCEX ; exit point from KILLPCE
;
; if visit was locked then unlock it
I ACKLOCK L -^ACK(509850.6,ACKVIEN)
;
; return whether the PCe visit was killed
Q ACKDEAD
;
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HACKQPCE3 1678 printed Dec 13, 2024@02:32:25 Page 2
ACKQPCE3 ;HCIOFO/AG - Quasar/PCE Interface; August 1999.
+1 ;;3.0;QUASAR;;Feb 11, 2000
+2 ;;
+3 ;
KILLPCE(ACKVIEN) ; kill a visit from PCE
+1 ; see KILLPCE^ACKQPCE for comments. this routine should not be
+2 ; called directly, only from ^ACKQPCE (this routine assumes that
+3 ; ACKVIEN exists).
+4 NEW ACKDEAD,ACKLOCK,ACKPCE,ACKE,ACKARR,ACKMSG,ACKRSN
+5 SET ACKDEAD=1
SET ACKLOCK=0
+6 ;
+7 ; get the PCE VISIT IEN from the visit file
+8 SET ACKPCE=$$GET1^DIQ(509850.6,ACKVIEN_",",125,"I")
+9 ;
+10 ; if no PCE Visit Ien then nothing to do.
+11 IF 'ACKPCE
GOTO KILLPCEX
+12 ;
+13 ; lock the visit
+14 LOCK +^ACK(509850.6,ACKVIEN):0
IF $TEST
SET ACKLOCK=1
+15 ;
+16 ; clear any existing PCE Errors for this visit
+17 DO CLEAR^ACKQPCE(ACKVIEN)
+18 ;
+19 ; call PCE to delete the visit
+20 SET ACKE=$$DELVFILE^PXAPI("ALL",ACKPCE,"","",0,0,"")
+21 ;
+22 ; if deletion not completed then record error and set flag
+23 IF ACKE'=1
Begin DoDot:1
+24 KILL ACKRSN
SET ACKRSN=0
+25 SET ACKMSG="Unable to Delete PCE Visit (error code="_ACKE_")"
+26 DO ADDRSN^ACKQPCE2("PCE VISIT",ACKPCE,"",ACKMSG,.ACKRSN)
+27 DO FILERSN^ACKQPCE(ACKVIEN,.ACKRSN)
+28 ; file last edited in Quasar date to create exception entry
+29 KILL ACKARR
DO NOW^%DTC
+30 SET ACKARR(509850.6,ACKVIEN_",",140)=%
+31 DO FILE^DIE("","ACKARR","")
+32 SET ACKDEAD=0
End DoDot:1
+33 ;
+34 ; if deleted ok then update fields and set flag
+35 IF ACKE=1
Begin DoDot:1
+36 KILL ACKARR
DO NOW^%DTC
+37 ; remove PCE Visit ien
SET ACKARR(509850.6,ACKVIEN_",",125)="@"
+38 ; last sent to pce
SET ACKARR(509850.6,ACKVIEN_",",135)=%
+39 DO FILE^DIE("","ACKARR","")
+40 SET ACKDEAD=1
End DoDot:1
+41 ;
KILLPCEX ; exit point from KILLPCE
+1 ;
+2 ; if visit was locked then unlock it
+3 IF ACKLOCK
LOCK -^ACK(509850.6,ACKVIEN)
+4 ;
+5 ; return whether the PCe visit was killed
+6 QUIT ACKDEAD
+7 ;