PSJ304PO ;TMC-Post Install routine for patch PSJ*5*304 ;10/28/14
;;5.0;INPATIENT MEDICATIONS ;**304**;;Build 22
;
QUE ;
N NAMSP,PATCH,JOBN,ZTSK,ZTRTN,ZTIO,ZTDTH,ZTDESC,Y,ZTQUEUED,ZTREQ,ZTSAVE,CNT,SBJM
S NAMSP="PSJ304PO"
S JOBN="PSJ*5*304 Post Install"
S PATCH="PSJ*5*304"
S Y=$$NOW^XLFDT S ZTDTH=$$FMTH^XLFDT(Y)
;
D BMES^XPDUTL("=============================================================")
D MES^XPDUTL("Queuing background job for "_JOBN_"...")
D MES^XPDUTL("Start time: "_$$HTE^XLFDT(ZTDTH))
D MES^XPDUTL("A MailMan message will be sent to the installer upon Post")
D MES^XPDUTL("Install Completion.")
D MES^XPDUTL("==============================================================")
;
S ZTRTN="EN^"_NAMSP,ZTIO=""
S (SBJM,ZTDESC)="Background job for "_JOBN
S ZTSAVE("JOBN")="",ZTSAVE("ZTDTH")="",ZTSAVE("DUZ")="",ZTSAVE("SBJM")=""
D ^%ZTLOAD
D:$D(ZTSK)
. D MES^XPDUTL("*** Task #"_ZTSK_" Queued! ***")
. D BMES^XPDUTL("")
. S ZTSAVE("ZTSK")=""
D BMES^XPDUTL("")
K XPDQUES
Q
;
EN ;Do Mail Message
N DFN,DA,STARTH,STOPH,SUBJ
S STARTH=$$HTE^XLFDT(ZTDTH)
K DIK S DFN=0 F S DFN=$O(^PS(55,DFN)) Q:'DFN S DA(1)=DFN D
.S DIK="^PS(55,"_DA(1)_",""IV"",",DIK(1)=".03^AIS" D ENALL2^DIK
K DIK S DFN=0 F S DFN=$O(^PS(55,DFN)) Q:'DFN S DA(1)=DFN D
.S DIK="^PS(55,"_DA(1)_","_"""IV"""_",",DIK(1)=".03^AIS" D ENALL^DIK
K DIK
;
;Send message
S CNT=1
S Y=$$NOW^XLFDT S STOPH=$$FMTH^XLFDT(Y),STOPH=$$HTE^XLFDT(STOPH)
S SUBJ="PSJ*5*304 POST INSTALL Complete"
S MSG(CNT)="The AIS cross reference have been re-indexed:",CNT=CNT+1
S MSG(CNT)=" File 55 - AIS for IV Sub-file.",CNT=CNT+1
S MSG(CNT)=" ",CNT=CNT+1
S MSG(CNT)="The background job "_ZTSK_" began "_STARTH_" and ",CNT=CNT+1
S MSG(CNT)="ended "_STOPH_".",CNT=CNT+1
D MAIL(.MSG,SUBJ)
Q
;
MAIL(MSG,SBJ) ; Send out some mail!
N DIFROM,XMDUZ,XMSUB,XMTEXT,XMY,I
S XMDUZ="INPT PHARMACY",XMSUB=SBJM,XMTEXT="MSG("
S XMY(DUZ)=""
D ^XMD
Q ""
;
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HPSJ304PO 1988 printed Dec 13, 2024@02:05:48 Page 2
PSJ304PO ;TMC-Post Install routine for patch PSJ*5*304 ;10/28/14
+1 ;;5.0;INPATIENT MEDICATIONS ;**304**;;Build 22
+2 ;
QUE ;
+1 NEW NAMSP,PATCH,JOBN,ZTSK,ZTRTN,ZTIO,ZTDTH,ZTDESC,Y,ZTQUEUED,ZTREQ,ZTSAVE,CNT,SBJM
+2 SET NAMSP="PSJ304PO"
+3 SET JOBN="PSJ*5*304 Post Install"
+4 SET PATCH="PSJ*5*304"
+5 SET Y=$$NOW^XLFDT
SET ZTDTH=$$FMTH^XLFDT(Y)
+6 ;
+7 DO BMES^XPDUTL("=============================================================")
+8 DO MES^XPDUTL("Queuing background job for "_JOBN_"...")
+9 DO MES^XPDUTL("Start time: "_$$HTE^XLFDT(ZTDTH))
+10 DO MES^XPDUTL("A MailMan message will be sent to the installer upon Post")
+11 DO MES^XPDUTL("Install Completion.")
+12 DO MES^XPDUTL("==============================================================")
+13 ;
+14 SET ZTRTN="EN^"_NAMSP
SET ZTIO=""
+15 SET (SBJM,ZTDESC)="Background job for "_JOBN
+16 SET ZTSAVE("JOBN")=""
SET ZTSAVE("ZTDTH")=""
SET ZTSAVE("DUZ")=""
SET ZTSAVE("SBJM")=""
+17 DO ^%ZTLOAD
+18 if $DATA(ZTSK)
Begin DoDot:1
+19 DO MES^XPDUTL("*** Task #"_ZTSK_" Queued! ***")
+20 DO BMES^XPDUTL("")
+21 SET ZTSAVE("ZTSK")=""
End DoDot:1
+22 DO BMES^XPDUTL("")
+23 KILL XPDQUES
+24 QUIT
+25 ;
EN ;Do Mail Message
+1 NEW DFN,DA,STARTH,STOPH,SUBJ
+2 SET STARTH=$$HTE^XLFDT(ZTDTH)
+3 KILL DIK
SET DFN=0
FOR
SET DFN=$ORDER(^PS(55,DFN))
if 'DFN
QUIT
SET DA(1)=DFN
Begin DoDot:1
+4 SET DIK="^PS(55,"_DA(1)_",""IV"","
SET DIK(1)=".03^AIS"
DO ENALL2^DIK
End DoDot:1
+5 KILL DIK
SET DFN=0
FOR
SET DFN=$ORDER(^PS(55,DFN))
if 'DFN
QUIT
SET DA(1)=DFN
Begin DoDot:1
+6 SET DIK="^PS(55,"_DA(1)_","_"""IV"""_","
SET DIK(1)=".03^AIS"
DO ENALL^DIK
End DoDot:1
+7 KILL DIK
+8 ;
+9 ;Send message
+10 SET CNT=1
+11 SET Y=$$NOW^XLFDT
SET STOPH=$$FMTH^XLFDT(Y)
SET STOPH=$$HTE^XLFDT(STOPH)
+12 SET SUBJ="PSJ*5*304 POST INSTALL Complete"
+13 SET MSG(CNT)="The AIS cross reference have been re-indexed:"
SET CNT=CNT+1
+14 SET MSG(CNT)=" File 55 - AIS for IV Sub-file."
SET CNT=CNT+1
+15 SET MSG(CNT)=" "
SET CNT=CNT+1
+16 SET MSG(CNT)="The background job "_ZTSK_" began "_STARTH_" and "
SET CNT=CNT+1
+17 SET MSG(CNT)="ended "_STOPH_"."
SET CNT=CNT+1
+18 DO MAIL(.MSG,SUBJ)
+19 QUIT
+20 ;
MAIL(MSG,SBJ) ; Send out some mail!
+1 NEW DIFROM,XMDUZ,XMSUB,XMTEXT,XMY,I
+2 SET XMDUZ="INPT PHARMACY"
SET XMSUB=SBJM
SET XMTEXT="MSG("
+3 SET XMY(DUZ)=""
+4 DO ^XMD
+5 QUIT ""
+6 ;