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

AGMPPRST.m

Go to the documentation of this file.
  1. AGMPPRST ;GDIT/HS/SWH-Production Status Check; SEP 20, 2017
  1. ;;7.2;IHS PATIENT REGISTRATION;**6**;SEP 28, 2017 ;Build 23
  1. Q
  1. ;
  1. ;
  1. CHKPRST ;Check the latest status information within the ^AGMPPRST global.
  1. L +^AGMPPSCH:5 Q:'$T ;DO NOT START IF ALREADY RUNNING
  1. I $G(^AGMPPRST("STOP")) Q ;If the 'STOP' global is populated we'll not send any alerts.
  1. H 5 ;we hang for 5 seconds to insure the Task running at the same time in the Ensemble MPI namespace has compled.
  1. I $D(^AGMPPRST("Status")) D Q ;If there is a 'Status' entry within the Global continue.
  1. .I $G(^AGMPPRST("Status"))="Running" D Q ;If the 'Status' is set to Running we clear out the saved alert entries.
  1. ..S ^AGMPPRST("LastAlertType")=""
  1. ..S ^AGMPPRST("LastAlertDate")=""
  1. .S TCRNTDT=$P($H,",")
  1. .I $G(^AGMPPRST("Status"))=$G(^AGMPPRST("LastAlertType")) D Q ;If the last alert status is the same as the current alert status.
  1. ..I TCRNTDT>$G(^AGMPPRST("LastAlertDate")) D SNDN(TCRNTDT) ; If the current date is greater than the last sent date we send another alert.
  1. .D SNDN(TCRNTDT) ;If we get here the production status isn't running and the last alert type wasn't the current production status
  1. L -^AGMPPSCH
  1. Q
  1. ;
  1. ;
  1. SNDN(PDATE) ;Send an notification using the NOTIF routine of the AGMPIHLIO file.
  1. D NOTIF^AGMPIHLO("","The MPI Production status: "_^AGMPPRST("Status")_" : "_PDATE)
  1. S ^AGMPPRST("LastAlertDate")=PDATE ;Set the alert date to the date sent in.
  1. S ^AGMPPRST("LastAlertType")=^AGMPPRST("Status") ;Set the alert type to the current status.
  1. Q
  1. ;
  1. ;