VistA-WorldVistAEHR/r/PATIENT_REPRESENTATIVE-QAC/QACALRT0.m

35 lines
1.1 KiB
Mathematica

QACALRT0 ;HISC/DAD-ALERT XREF SET/KILL LOGIC ;3/2/95 09:47
;;2.0;Patient Representative;;07/25/1995
;
SET(QACX,QACD0) ; *** Send an alert
; QACX = NEW PERSON file (#200) IEN
; QACD0 = CONSUMER CONTACT file (#745.1) IEN
I $P($G(^QA(745.1,QACD0,7)),U,2)="C" Q
N XQA,XQAMSG,XQAOPT,XQAROU,XQAID,XQADATA,XQAFLG
S XQA(QACX)=""
S XQAMSG="New Patient Representative report of contact entered"
S XQAMSG=XQAMSG_" ("_$P($G(^QA(745.1,QACD0,0)),U)_")."
S XQAROU="EN^QACALRT1"
S XQAID="QAC-"_$P($G(^QA(745.1,QACD0,0)),U)_"-"_QACX
S XQADATA=QACX_U_QACD0_U_DUZ
D SETUP^XQALERT
Q
;
KILL(QACX,QACD0) ; *** Kill an alert
; QACX = NEW PERSON file (#200) IEN
; QACD0 = CONSUMER CONTACT file (#745.1) IEN
N XQA,XQAMSG,XQAOPT,XQAROU,XQAID,XQADATA,XQAFLG
S XQA(QACX)=""
S XQAID="QAC-"_$P($G(^QA(745.1,QACD0,0)),U)_"-"_QACX
D DELETEA^XQALERT
Q
;
CLOSE(QACD0) ; *** Kill all alerts
; QACD0 = CONSUMER CONTACT file (#745.1) IEN
N QACX,QACD1 S QACD1=0
F S QACD1=$O(^QA(745.1,QACD0,11,QACD1)) Q:QACD1'>0 D
. S QACX=$P($G(^QA(745.1,QACD0,11,QACD1,0)),U)
. I QACX D KILL(QACX,QACD0)
. Q
Q