[613] | 1 | RMPFDE4 ;DDC/PJU - SENDS ALERTS WHEN ELIG REQESTS NOT ACTED ON ;11/01/02
|
---|
| 2 | ;;3.0;REMOTE ORDER ENTRY SYSTEM;;02/18/03
|
---|
| 3 | ;SET RMPFDE4 IN OPTION FILE & REPETITIVE QUE WITH A PARAM OF X DAYS
|
---|
| 4 | START ;;RMPFDY ;time frame
|
---|
| 5 | Q:'$D(^RMPF(791814,"C",2))
|
---|
| 6 | N IEN,RMPFST,RMPFDIFF ;START DATE
|
---|
| 7 | S IEN=0 S:'$G(RMPFDY) RMPFDY=7 ;Defaults to 7 if RMPFDY not set in Rep QUE
|
---|
| 8 | LOOP S IEN=$O(^RMPF(791814,"C",2,IEN)) G:'IEN EXIT ;records in wait status
|
---|
| 9 | ;LOOK FOR END OF GLOBAL RECORDS
|
---|
| 10 | S S0=$G(^RMPF(791814,IEN,0)),S1=$G(^(1)),S2=$G(^(2))
|
---|
| 11 | G:$P(S2,U,2)'=2 LOOP ;acted on already
|
---|
| 12 | G:$P(S0,U,4)>DT LOOP ;expired
|
---|
| 13 | S RMPFST=$P(S0,U,2) ;date input
|
---|
| 14 | G:'RMPFST LOOP ;missing input date
|
---|
| 15 | S RMPFDIFF=$$FMDIFF^XLFDT(DT,RMPFST) ;days since input
|
---|
| 16 | I RMPFDIFF>RMPFDY D SEND(IEN,RMPFDIFF) ;SEND ALERT IF NEC
|
---|
| 17 | G LOOP
|
---|
| 18 | EXIT K RMPFDY D KILL^XM Q
|
---|
| 19 | ;
|
---|
| 20 | SEND(ENT,RMPFDIFF) ;
|
---|
| 21 | ;INPUT ENTRY IN FORM IEN, DIFFERENCE IN DAYS SINCE ENTERED
|
---|
| 22 | N SSN,DFN,NM,MS,RMPFTXT,RMUSER
|
---|
| 23 | S DFN=$P(S0,U,1)
|
---|
| 24 | Q:'DFN D DEM^VADPT Q:VAERR
|
---|
| 25 | S NM=VADM(1) Q:NM=""
|
---|
| 26 | S SSN=$P(VADM(2),U,1)
|
---|
| 27 | S MS=$P(S1,U,2),RMUSER=$P(S0,U,3) ;email# & requesting user
|
---|
| 28 | ;SETUP ALERT
|
---|
| 29 | S RMPFTXT="Action req'd on Elig Req [msg #"_MS_"] for: "_$P(NM,",",1)_"-"_$E(SSN,6,10)_" from "_RMPFDIFF_" days ago."
|
---|
| 30 | S XQA("G.RMPF ROES UPDATES (PSAS)")=""
|
---|
| 31 | S:$L(RMUSER) XQA(RMUSER)=""
|
---|
| 32 | S XQAMSG=RMPFTXT
|
---|
| 33 | S XQAID="RMPF_ELIG_ALERT"
|
---|
| 34 | D SETUP^XQALERT ;SEND
|
---|
| 35 | END Q
|
---|
| 36 | ;sample entry in file after completed
|
---|
| 37 | ;^RMPF(791814,1,0)=733928^3030212^988^3050212
|
---|
| 38 | ;^(1)=NSC^2673145
|
---|
| 39 | ;^(2)=NSC^NSC^1^988^3030218
|
---|