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

PSJUTL6.m

Go to the documentation of this file.
  1. PSJUTL6 ;B'ham/LDT - Re-index "AUDS" x-ref on file 55 ; 18 Aug 98 / 2:48 PM
  1. ;;5.0; INPATIENT MEDICATIONS ;**13**;16 DEC 97
  1. ;
  1. Q
  1. ENNV ; Begin
  1. K ZTSAVE,ZTSK S ZTRTN="ENQN^PSJUTL6",ZTDESC="Re-index of ""AUDS"" x-ref",ZTIO="",ZTDTH=$$CON(XPDQUES("POS ONE")) D ^%ZTLOAD
  1. I $D(ZTSK) D MES^XPDUTL("The Re-index of the ""AUDS"" is queued to run at "_XPDQUES("POS ONE"))
  1. I $D(ZTSK) D MES^XPDUTL("YOU WILL RECEIVE A MAILMAN MESSAGE WHEN TASK #"_ZTSK_" HAS COMPLETED.")
  1. Q
  1. ENQN ; Loop thru Pharmacy Patient file.
  1. D NOW^%DTC N DFN S PSJSTART=$E(%,1,12)
  1. S DFN=0 F S DFN=$O(^PS(55,DFN)) Q:'DFN S DA(1)=DFN,DIK="^PS(55,"_DA(1)_",5,",DIK(1)="10^AUDS" D ENALL^DIK
  1. D SENDMSG
  1. Q
  1. SENDMSG ;Send mail message when check is complete.
  1. K PSG,XMY S XMDUZ="MEDICATIONS,INPATIENT",XMSUB="INPATIENT MEDS ORDER CHECK COMPLETED",XMTEXT="PSG(",XMY(DUZ)="" D NOW^%DTC S Y=% X ^DD("DD")
  1. S PSG(1,0)=" The Re-index of the ""AUDS"" x-ref completed as of "_Y_"."
  1. S X=$$FMDIFF^XLFDT(%,PSJSTART,3) S:$L(X," ")>1 DAYS=+$P(X," "),X=$P(X," ",2) S HOURS=+$P(X,":"),MINS=+$P(X,":",2)
  1. S PSG(2,0)=" ",PSG(3,0)="This process took "_$S($G(DAYS):DAYS_" day"_$E("s",DAYS'=1)_", ",1:"")_HOURS_" hour"_$E("s",HOURS'=1)_" and "_MINS_" minute"_$E("s",MINS'=1)_"."
  1. D ^XMD
  1. ;
  1. DONE ;
  1. K DA,DIK,PSJSTART,X,XMDUZ,XMSUB,XMTEXT,XMY,Y,ZTDESC,ZTDTH,ZTIO,ZTREQ,ZTRTN,ZTSAVE,ZTSK S ZTREQ="@"
  1. Q
  1. ;
  1. GETDT ; check date/time for job to run
  1. N %DT,Y S %DT="NRS"
  1. D ^%DT I Y=-1 K X
  1. E S X=Y
  1. Q
  1. CON(X) ;
  1. N %DT S %DT="NRS" D ^%DT
  1. Q Y