source: WorldVistAEHR/trunk/r/QUASAR-ACKQ/ACKQPCE3.m@ 724

Last change on this file since 724 was 613, checked in by George Lilly, 15 years ago

initial load of WorldVistAEHR

File size: 1.6 KB
Line 
1ACKQPCE3 ;HCIOFO/AG - Quasar/PCE Interface; August 1999.
2 ;;3.0;QUASAR;;Feb 11, 2000
3 ;;
4 ;
5KILLPCE(ACKVIEN) ; kill a visit from PCE
6 ; see KILLPCE^ACKQPCE for comments. this routine should not be
7 ; called directly, only from ^ACKQPCE (this routine assumes that
8 ; ACKVIEN exists).
9 N ACKDEAD,ACKLOCK,ACKPCE,ACKE,ACKARR,ACKMSG,ACKRSN
10 S ACKDEAD=1,ACKLOCK=0
11 ;
12 ; get the PCE VISIT IEN from the visit file
13 S ACKPCE=$$GET1^DIQ(509850.6,ACKVIEN_",",125,"I")
14 ;
15 ; if no PCE Visit Ien then nothing to do.
16 I 'ACKPCE G KILLPCEX
17 ;
18 ; lock the visit
19 L +^ACK(509850.6,ACKVIEN):0 I $T S ACKLOCK=1
20 ;
21 ; clear any existing PCE Errors for this visit
22 D CLEAR^ACKQPCE(ACKVIEN)
23 ;
24 ; call PCE to delete the visit
25 S ACKE=$$DELVFILE^PXAPI("ALL",ACKPCE,"","",0,0,"")
26 ;
27 ; if deletion not completed then record error and set flag
28 I ACKE'=1 D
29 . K ACKRSN S ACKRSN=0
30 . S ACKMSG="Unable to Delete PCE Visit (error code="_ACKE_")"
31 . D ADDRSN^ACKQPCE2("PCE VISIT",ACKPCE,"",ACKMSG,.ACKRSN)
32 . D FILERSN^ACKQPCE(ACKVIEN,.ACKRSN)
33 . ; file last edited in Quasar date to create exception entry
34 . K ACKARR D NOW^%DTC
35 . S ACKARR(509850.6,ACKVIEN_",",140)=%
36 . D FILE^DIE("","ACKARR","")
37 . S ACKDEAD=0
38 ;
39 ; if deleted ok then update fields and set flag
40 I ACKE=1 D
41 . K ACKARR D NOW^%DTC
42 . S ACKARR(509850.6,ACKVIEN_",",125)="@" ; remove PCE Visit ien
43 . S ACKARR(509850.6,ACKVIEN_",",135)=% ; last sent to pce
44 . D FILE^DIE("","ACKARR","")
45 . S ACKDEAD=1
46 ;
47KILLPCEX ; exit point from KILLPCE
48 ;
49 ; if visit was locked then unlock it
50 I ACKLOCK L -^ACK(509850.6,ACKVIEN)
51 ;
52 ; return whether the PCe visit was killed
53 Q ACKDEAD
54 ;
Note: See TracBrowser for help on using the repository browser.