1 | PSJUTL6 ;B'ham/LDT - Re-index "AUDS" x-ref on file 55 ; 18 Aug 98 / 2:48 PM
|
---|
2 | ;;5.0; INPATIENT MEDICATIONS ;**13**;16 DEC 97
|
---|
3 | ;
|
---|
4 | Q
|
---|
5 | ENNV ; Begin
|
---|
6 | K ZTSAVE,ZTSK S ZTRTN="ENQN^PSJUTL6",ZTDESC="Re-index of ""AUDS"" x-ref",ZTIO="",ZTDTH=$$CON(XPDQUES("POS ONE")) D ^%ZTLOAD
|
---|
7 | I $D(ZTSK) D MES^XPDUTL("The Re-index of the ""AUDS"" is queued to run at "_XPDQUES("POS ONE"))
|
---|
8 | I $D(ZTSK) D MES^XPDUTL("YOU WILL RECEIVE A MAILMAN MESSAGE WHEN TASK #"_ZTSK_" HAS COMPLETED.")
|
---|
9 | Q
|
---|
10 | ENQN ; Loop thru Pharmacy Patient file.
|
---|
11 | D NOW^%DTC N DFN S PSJSTART=$E(%,1,12)
|
---|
12 | 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
|
---|
13 | D SENDMSG
|
---|
14 | Q
|
---|
15 | SENDMSG ;Send mail message when check is complete.
|
---|
16 | 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")
|
---|
17 | S PSG(1,0)=" The Re-index of the ""AUDS"" x-ref completed as of "_Y_"."
|
---|
18 | 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)
|
---|
19 | 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)_"."
|
---|
20 | D ^XMD
|
---|
21 | ;
|
---|
22 | DONE ;
|
---|
23 | K DA,DIK,PSJSTART,X,XMDUZ,XMSUB,XMTEXT,XMY,Y,ZTDESC,ZTDTH,ZTIO,ZTREQ,ZTRTN,ZTSAVE,ZTSK S ZTREQ="@"
|
---|
24 | Q
|
---|
25 | ;
|
---|
26 | GETDT ; check date/time for job to run
|
---|
27 | N %DT,Y S %DT="NRS"
|
---|
28 | D ^%DT I Y=-1 K X
|
---|
29 | E S X=Y
|
---|
30 | Q
|
---|
31 | CON(X) ;
|
---|
32 | N %DT S %DT="NRS" D ^%DT
|
---|
33 | Q Y
|
---|