PSJ0171 ;BPOIFO/BI - Correct zero node in File 55 Activity Multiple ;01-FEB-06
;;5.0; INPATIENT MEDICATIONS ;**171**;16 DEC 97
;
;Reference to ^PS(55 is supported by DBIA# 2191.
;
Q
;
EN ; Check user and Queue Job.
N ZTSAVE,ZTSK,ZTRTN,ZTDESC,ZTIO,ZTDTH,PIMSG
I $G(DUZ)="" W !,"Your DUZ is not defined. It must be defined to run this routine." Q
S ZTRTN="ENQ^PSJ0171",ZTDESC="Inpatient Meds Activity Multiple Cleanup",ZTIO="",ZTDTH=$H D ^%ZTLOAD
D:$D(ZTSK)
.K PIMSG
.S PIMSG(1)="The cleanup of existing Activity Multiple Nodes is"
.S PIMSG(2)="queued to start NOW."
.S PIMSG(3)=" "
.S PIMSG(4)="YOU WILL RECEIVE A MAILMAN MESSAGE WHEN TASK #"_ZTSK_" HAS COMPLETED."
.D MES^XPDUTL(.PIMSG)
D:'$D(ZTSK)
.K PIMSG
.S PIMSG(1)="The cleanup of existing Activity Multiple Nodes was"
.S PIMSG(2)="NOT queued."
.D MES^XPDUTL(.PIMSG)
S ZTREQ="@"
Q
;
ENQ ; Scan through file ^PS(55 and correct the Activity Multiple Node.
N ZS2,ZS4,ZD6,ZD62
S ZS2=0 F S ZS2=$O(^PS(55,ZS2)) Q:+ZS2=0 D
.S ZS4=0 F S ZS4=$O(^PS(55,ZS2,5,ZS4)) Q:+ZS4=0 D
..S ZD6=$G(^PS(55,ZS2,5,ZS4,9,0))
..S ZD62=$P(ZD6,"^",2)
..I ZD62="55,09D" D
...S $P(^PS(55,ZS2,5,ZS4,9,0),"^",2)="55.09D"
D SENDMSG
Q
;
SENDMSG ;Send mail message when check is complete.
N DIFROM,XMDUZ,XMSUB,XMTEXT,XMY,PSG
S XMDUZ="MEDICATIONS,INPATIENT"
S XMSUB="PSJ*5*171 INPATIENT MEDS ACTIVITY MULTIPLE CLEANUP COMPLETED"
S XMTEXT="PSG("
S XMY(DUZ)=""
S PSG(1,0)="The cleanup of the Inpatient Medication Activity Multiple has completed."
D ^XMD
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HPSJ0171 1567 printed Dec 13, 2024@02:05:37 Page 2
PSJ0171 ;BPOIFO/BI - Correct zero node in File 55 Activity Multiple ;01-FEB-06
+1 ;;5.0; INPATIENT MEDICATIONS ;**171**;16 DEC 97
+2 ;
+3 ;Reference to ^PS(55 is supported by DBIA# 2191.
+4 ;
+5 QUIT
+6 ;
EN ; Check user and Queue Job.
+1 NEW ZTSAVE,ZTSK,ZTRTN,ZTDESC,ZTIO,ZTDTH,PIMSG
+2 IF $GET(DUZ)=""
WRITE !,"Your DUZ is not defined. It must be defined to run this routine."
QUIT
+3 SET ZTRTN="ENQ^PSJ0171"
SET ZTDESC="Inpatient Meds Activity Multiple Cleanup"
SET ZTIO=""
SET ZTDTH=$HOROLOG
DO ^%ZTLOAD
+4 if $DATA(ZTSK)
Begin DoDot:1
+5 KILL PIMSG
+6 SET PIMSG(1)="The cleanup of existing Activity Multiple Nodes is"
+7 SET PIMSG(2)="queued to start NOW."
+8 SET PIMSG(3)=" "
+9 SET PIMSG(4)="YOU WILL RECEIVE A MAILMAN MESSAGE WHEN TASK #"_ZTSK_" HAS COMPLETED."
+10 DO MES^XPDUTL(.PIMSG)
End DoDot:1
+11 if '$DATA(ZTSK)
Begin DoDot:1
+12 KILL PIMSG
+13 SET PIMSG(1)="The cleanup of existing Activity Multiple Nodes was"
+14 SET PIMSG(2)="NOT queued."
+15 DO MES^XPDUTL(.PIMSG)
End DoDot:1
+16 SET ZTREQ="@"
+17 QUIT
+18 ;
ENQ ; Scan through file ^PS(55 and correct the Activity Multiple Node.
+1 NEW ZS2,ZS4,ZD6,ZD62
+2 SET ZS2=0
FOR
SET ZS2=$ORDER(^PS(55,ZS2))
if +ZS2=0
QUIT
Begin DoDot:1
+3 SET ZS4=0
FOR
SET ZS4=$ORDER(^PS(55,ZS2,5,ZS4))
if +ZS4=0
QUIT
Begin DoDot:2
+4 SET ZD6=$GET(^PS(55,ZS2,5,ZS4,9,0))
+5 SET ZD62=$PIECE(ZD6,"^",2)
+6 IF ZD62="55,09D"
Begin DoDot:3
+7 SET $PIECE(^PS(55,ZS2,5,ZS4,9,0),"^",2)="55.09D"
End DoDot:3
End DoDot:2
End DoDot:1
+8 DO SENDMSG
+9 QUIT
+10 ;
SENDMSG ;Send mail message when check is complete.
+1 NEW DIFROM,XMDUZ,XMSUB,XMTEXT,XMY,PSG
+2 SET XMDUZ="MEDICATIONS,INPATIENT"
+3 SET XMSUB="PSJ*5*171 INPATIENT MEDS ACTIVITY MULTIPLE CLEANUP COMPLETED"
+4 SET XMTEXT="PSG("
+5 SET XMY(DUZ)=""
+6 SET PSG(1,0)="The cleanup of the Inpatient Medication Activity Multiple has completed."
+7 DO ^XMD
+8 QUIT