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

PSO160EN.m

Go to the documentation of this file.
  1. PSO160EN ;BIR/MR-Patch 160 Environment Check routine ;11/27/03
  1. ;;7.0;OUTPATIENT PHARMACY;**160**;DEC 1997
  1. ;External reference to ^ORD(101, is supp. by DBIA# 872
  1. ;
  1. N RXSTS,DIR,SDPRTCL,PSOPRTCL,X,DIC,DA,DLAYGO,DD,DO,DINUM,Y
  1. ;
  1. ;- Looking for 'NON-VA' entry in the RX PATIENT STATUS file (#53)
  1. S XPDABORT=2
  1. S RXSTS="" F S RXSTS=$O(^PS(53,"B",RXSTS)) Q:RXSTS="" D I 'XPDABORT Q
  1. . I $$UP^XLFSTR(RXSTS)="NON-VA" S XPDABORT=0 Q
  1. ;
  1. I XPDABORT D S XPDABORT=2 Q
  1. . W !!,"The RX PATIENT STATUS File (#53) named 'NON-VA' was not found."
  1. . W !,"It must be created before this patch can be installed.",!
  1. . K DIR S DIR(0)="E",DIR("A")="Press Return to Continue"
  1. . D ^DIR K DIR
  1. ;
  1. ;- Checking existence of SD Event Protocol SDAM APPOINTMENT EVENTS
  1. S SDPRTCL=$O(^ORD(101,"B","SDAM APPOINTMENT EVENTS",""))
  1. I 'SDPRTCL D S XPDABORT=2 Q
  1. . W !!,"The Scheduling Event Protocol SDAM APPOINTMENT EVENTS was not found."
  1. . W !,"This protocol must be present before this patch can be installed.",!
  1. . K DIR S DIR(0)="E",DIR("A")="Press Return to Continue"
  1. . D ^DIR K DIR
  1. ;
  1. S PSOPRTCL=$O(^ORD(101,"B","PSO TPB SD SUB",""))
  1. I 'PSOPRTCL D
  1. . N DIC S X="PSO TPB SD SUB",DIC="^ORD(101,",DLAYGO=101,DIC(0)="L"
  1. . S DIC("DR")="4///A"
  1. . D FILE^DICN Q:$G(Y)<0 S PSOPRTCL=+Y
  1. . S ^ORD(101,PSOPRTCL,20)="EN^PSOTPINA"
  1. ;
  1. I 'PSOPRTCL D S XPDABORT=2 Q
  1. . W !!,"The new protocol PSO TPB SD SUB could not be created."
  1. . W !,"The installation of this patch will be aborted.",!
  1. . K DIR S DIR(0)="E",DIR("A")="Press Return to Continue"
  1. . D ^DIR K DIR
  1. ;
  1. I '$D(^ORD(101,SDPRTCL,10,"B",PSOPRTCL)) D
  1. . N DIC S X=PSOPRTCL,DIC="^ORD(101,"_SDPRTCL_",10,",DLAYGO=101.01
  1. . S DA(1)=SDPRTCL,DIC(0)="L" D FILE^DICN I $G(Y)<0 S XPDABORT=2
  1. ;
  1. I XPDABORT D Q
  1. . W !!,"The new Outpatient Pharmacy Protocol PSO TPB SD SUB could not be added as a subscriber"
  1. . W !,"to the Scheduling Event Protocol SDAM APPOINTMENT EVENTS. The installation of this patch"
  1. . W !,"will be aborted.",!
  1. . K DIR S DIR(0)="E",DIR("A")="Press Return to Continue"
  1. . D ^DIR K DIR
  1. ;
  1. Q:'$G(XPDENV)
  1. W ! K %DT D NOW^%DTC S %DT="RAEX",%DT(0)=%,%DT("A")="Queue the Post-Install to run at what Date@Time: "
  1. D ^%DT K %DT I $D(DTOUT)!(Y<0) W !!,"Cannot install the patch without queuing the post-install, install aborted!",! S XPDABORT=2 Q
  1. S @XPDGREF@("PSO160Q")=Y,@XPDGREF@("PSOUSER")=DUZ
  1. Q