Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: PSJ0171

PSJ0171.m

Go to the documentation of this file.
  1. PSJ0171 ;BPOIFO/BI - Correct zero node in File 55 Activity Multiple ;01-FEB-06
  1. ;;5.0; INPATIENT MEDICATIONS ;**171**;16 DEC 97
  1. ;
  1. ;Reference to ^PS(55 is supported by DBIA# 2191.
  1. ;
  1. Q
  1. ;
  1. EN ; Check user and Queue Job.
  1. N ZTSAVE,ZTSK,ZTRTN,ZTDESC,ZTIO,ZTDTH,PIMSG
  1. I $G(DUZ)="" W !,"Your DUZ is not defined. It must be defined to run this routine." Q
  1. S ZTRTN="ENQ^PSJ0171",ZTDESC="Inpatient Meds Activity Multiple Cleanup",ZTIO="",ZTDTH=$H D ^%ZTLOAD
  1. D:$D(ZTSK)
  1. .K PIMSG
  1. .S PIMSG(1)="The cleanup of existing Activity Multiple Nodes is"
  1. .S PIMSG(2)="queued to start NOW."
  1. .S PIMSG(3)=" "
  1. .S PIMSG(4)="YOU WILL RECEIVE A MAILMAN MESSAGE WHEN TASK #"_ZTSK_" HAS COMPLETED."
  1. .D MES^XPDUTL(.PIMSG)
  1. D:'$D(ZTSK)
  1. .K PIMSG
  1. .S PIMSG(1)="The cleanup of existing Activity Multiple Nodes was"
  1. .S PIMSG(2)="NOT queued."
  1. .D MES^XPDUTL(.PIMSG)
  1. S ZTREQ="@"
  1. Q
  1. ;
  1. ENQ ; Scan through file ^PS(55 and correct the Activity Multiple Node.
  1. N ZS2,ZS4,ZD6,ZD62
  1. S ZS2=0 F S ZS2=$O(^PS(55,ZS2)) Q:+ZS2=0 D
  1. .S ZS4=0 F S ZS4=$O(^PS(55,ZS2,5,ZS4)) Q:+ZS4=0 D
  1. ..S ZD6=$G(^PS(55,ZS2,5,ZS4,9,0))
  1. ..S ZD62=$P(ZD6,"^",2)
  1. ..I ZD62="55,09D" D
  1. ...S $P(^PS(55,ZS2,5,ZS4,9,0),"^",2)="55.09D"
  1. D SENDMSG
  1. Q
  1. ;
  1. SENDMSG ;Send mail message when check is complete.
  1. N DIFROM,XMDUZ,XMSUB,XMTEXT,XMY,PSG
  1. S XMDUZ="MEDICATIONS,INPATIENT"
  1. S XMSUB="PSJ*5*171 INPATIENT MEDS ACTIVITY MULTIPLE CLEANUP COMPLETED"
  1. S XMTEXT="PSG("
  1. S XMY(DUZ)=""
  1. S PSG(1,0)="The cleanup of the Inpatient Medication Activity Multiple has completed."
  1. D ^XMD
  1. Q