PSGWCAD1 ;BHAM ISC/CML-Send 'Update AMIS Stats' MailMan message for missing Inpatient Site assignment ; 09/05/90 12:42
;;2.3; Automatic Replenishment/Ward Stock ;;4 JAN 94
MAIL ;Send message for AOUs missing INPATIENT SITE Data
Q:'$O(ERR1(0)) S NUM=5,CNT=0
K XMY,^TMP("PSGWMSG",$J) D NOW^%DTC S Y=X X ^DD("DD") S RDT=Y
F PSGWDUZ=0:0 S PSGWDUZ=$O(^XUSEC("PSGWMGR",PSGWDUZ)) Q:'PSGWDUZ S XMY(PSGWDUZ)=""
I '$D(XMY) F PSGWDUZ=0:0 S PSGWDUZ=$O(^XUSEC("PSGW PARAM",PSGWDUZ)) Q:'PSGWDUZ S XMY(PSGWDUZ)=""
S:'$D(XMY) XMY(.5)="" S ^TMP("PSGWMSG",$J,1,0)=" ********** MISSING DATA NOTIFICATION **********"
S ^TMP("PSGWMSG",$J,2,0)="",^TMP("PSGWMSG",$J,3,0)="On "_RDT_", the nightly job to update the AR/WS AMIS Stats file (#58.5)"
F AOU=0:0 S AOU=$O(ERR1(AOU)) Q:'AOU S NUM=NUM+1,CNT=CNT+1,^TMP("PSGWMSG",$J,NUM,0)=" "_CNT_". "_$P(^PSI(58.1,AOU,0),"^")
S PRT1=$S(CNT>1:"AOUs",1:"AOU"),PRT2=$S(CNT>1:"are",1:"is")
S ^TMP("PSGWMSG",$J,4,0)="was unable to process the AMIS activity for the following "_PRT1_":",^TMP("PSGWMSG",$J,5,0)="",^TMP("PSGWMSG",$J,NUM+1,0)=""
S ^TMP("PSGWMSG",$J,NUM+2,0)="The above "_PRT1_" "_PRT2_" missing an Inpatient Site assignment in the PHARMACY AOU",^TMP("PSGWMSG",$J,NUM+3,0)="STOCK file (#58.1). Until this information is supplied, NO AMIS data can"
S ^TMP("PSGWMSG",$J,NUM+4,0)="be stored for the "_PRT1_".",^TMP("PSGWMSG",$J,NUM+5,0)="",^TMP("PSGWMSG",$J,NUM+6,0)="One of the following Supervisor options may be used to supply the missing"
S ^TMP("PSGWMSG",$J,NUM+7,0)="data: 1. Create the Area of Use",^TMP("PSGWMSG",$J,NUM+8,0)=" 2. Identify AOU INPATIENT SITE",^TMP("PSGWMSG",$J,NUM+9,0)=""
S ^TMP("PSGWMSG",$J,NUM+10,0)="*** Please note that the AMIS data for the listed "_PRT1_" has NOT been lost.",^TMP("PSGWMSG",$J,NUM+11,0)="It will be picked up the next time the nightly job runs AFTER an Inpatient"
S ^TMP("PSGWMSG",$J,NUM+12,0)="Site assignment has been made!!",XMSUB="UPDATE AR/WS AMIS STATS/MISSING DATA",XMDUZ="INPATIENT PHARMACY AR/WS",XMTEXT="^TMP(""PSGWMSG"",$J," D ^XMD
K AOU,CNT,NUM,PSGWDUZ,PRT1,PRT2,RDT,XMDUZ,XMZ,XMY,^TMP("PSGWMSG",$J) Q
PSGWCAD1 ;BHAM ISC/CML-Send 'Update AMIS Stats' MailMan message for missing Inpatient Site assignment ; 09/05/90 12:42
+1 ;;2.3; Automatic Replenishment/Ward Stock ;;4 JAN 94
MAIL ;Send message for AOUs missing INPATIENT SITE Data
+1 IF '$ORDER(ERR1(0))
QUIT
SET NUM=5
SET CNT=0
+2 KILL XMY,^TMP("PSGWMSG",$JOB)
DO NOW^%DTC
SET Y=X
XECUTE ^DD("DD")
SET RDT=Y
+3 FOR PSGWDUZ=0:0
SET PSGWDUZ=$ORDER(^XUSEC("PSGWMGR",PSGWDUZ))
IF 'PSGWDUZ
QUIT
SET XMY(PSGWDUZ)=""
+4 IF '$DATA(XMY)
FOR PSGWDUZ=0:0
SET PSGWDUZ=$ORDER(^XUSEC("PSGW PARAM",PSGWDUZ))
IF 'PSGWDUZ
QUIT
SET XMY(PSGWDUZ)=""
+5 IF '$DATA(XMY)
SET XMY(.5)=""
SET ^TMP("PSGWMSG",$JOB,1,0)=" ********** MISSING DATA NOTIFICATION **********"
+6 SET ^TMP("PSGWMSG",$JOB,2,0)=""
SET ^TMP("PSGWMSG",$JOB,3,0)="On "_RDT_", the nightly job to update the AR/WS AMIS Stats file (#58.5)"
+7 FOR AOU=0:0
SET AOU=$ORDER(ERR1(AOU))
IF 'AOU
QUIT
SET NUM=NUM+1
SET CNT=CNT+1
SET ^TMP("PSGWMSG",$JOB,NUM,0)=" "_CNT_". "_$PIECE(^PSI(58.1,AOU,0),"^")
+8 SET PRT1=$SELECT(CNT>1:"AOUs",1:"AOU")
SET PRT2=$SELECT(CNT>1:"are",1:"is")
+9 SET ^TMP("PSGWMSG",$JOB,4,0)="was unable to process the AMIS activity for the following "_PRT1_":"
SET ^TMP("PSGWMSG",$JOB,5,0)=""
SET ^TMP("PSGWMSG",$JOB,NUM+1,0)=""
+10 SET ^TMP("PSGWMSG",$JOB,NUM+2,0)="The above "_PRT1_" "_PRT2_" missing an Inpatient Site assignment in the PHARMACY AOU"
SET ^TMP("PSGWMSG",$JOB,NUM+3,0)="STOCK file (#58.1). Until this information is supplied, NO AMIS data can"
+11 SET ^TMP("PSGWMSG",$JOB,NUM+4,0)="be stored for the "_PRT1_"."
SET ^TMP("PSGWMSG",$JOB,NUM+5,0)=""
SET ^TMP("PSGWMSG",$JOB,NUM+6,0)="One of the following Supervisor options may be used to supply the missing"
+12 SET ^TMP("PSGWMSG",$JOB,NUM+7,0)="data: 1. Create the Area of Use"
SET ^TMP("PSGWMSG",$JOB,NUM+8,0)=" 2. Identify AOU INPATIENT SITE"
SET ^TMP("PSGWMSG",$JOB,NUM+9,0)=""
+13 SET ^TMP("PSGWMSG",$JOB,NUM+10,0)="*** Please note that the AMIS data for the listed "_PRT1_" has NOT been lost."
SET ^TMP("PSGWMSG",$JOB,NUM+11,0)="It will be picked up the next time the nightly job runs AFTER an Inpatient"
+14 SET ^TMP("PSGWMSG",$JOB,NUM+12,0)="Site assignment has been made!!"
SET XMSUB="UPDATE AR/WS AMIS STATS/MISSING DATA"
SET XMDUZ="INPATIENT PHARMACY AR/WS"
SET XMTEXT="^TMP(""PSGWMSG"",$J,"
DO ^XMD
+15 KILL AOU,CNT,NUM,PSGWDUZ,PRT1,PRT2,RDT,XMDUZ,XMZ,XMY,^TMP("PSGWMSG",$JOB)
QUIT