PSO7P448 ;ALB/MRD - Post Install for PSO patch 448 ;5/28/2015
;;7.0;OUTPATIENT PHARMACY;**448**;DEC 1997;Build 25
;
D CLSDAT1(1,2)
D MENU(2,2)
;
Q
;
CLSDAT1(PSOSTEP,PSOTOTAL) ; Job the process to build the new CLSDAT cross-reference.
;
N ZTDESC,ZTDTH,ZTIO,ZTRTN,ZTSK
;
D BMES^XPDUTL(" Step "_PSOSTEP_" of "_PSOTOTAL)
D MES^XPDUTL(" -----------")
D MES^XPDUTL(" Queuing background job to build index of all closed/resolved rejects by")
D MES^XPDUTL(" date closed/resolved. A Mailman message will be sent when it finishes.")
;
; Setup required variables
S ZTRTN="CLSDAT2^PSO7P448",ZTIO="",ZTDTH=$H
S ZTDESC="Background job to build CLSDAT index for PSO*7*448"
;
; Task the job
D ^%ZTLOAD
;
; Check if task was created
I $D(ZTSK) D MES^XPDUTL(" Task #"_ZTSK_" queued.")
I '$D(ZTSK) D MES^XPDUTL(" Task not queued. Please create a support ticket.")
Q
;
CLSDAT2 ; Populate the new CLSDAT cross-reference on
; file #52, Prescription.
;
N PSOCLSDAT,PSOCNTR,PSOREJ,PSORX
;
; Kill off the entire cross-reference.
;
K ^PSRX("CLSDAT")
;
; Loop through all closed/resolved rejects
;
; ^PSRX("REJSTS",1,Rx IEN, reject IEN)
;
S PSORX=0,PSOCNTR=0
F S PSORX=$O(^PSRX("REJSTS",1,PSORX)) Q:'PSORX D
. S PSOREJ=0
. F S PSOREJ=$O(^PSRX("REJSTS",1,PSORX,PSOREJ)) Q:'PSOREJ D
. . ;
. . S PSOCLSDAT=$P($G(^PSRX(PSORX,"REJ",PSOREJ,0)),"^",6)
. . I PSOCLSDAT'="" S ^PSRX("CLSDAT",PSOCLSDAT,PSORX,PSOREJ)="",PSOCNTR=PSOCNTR+1
. . ;
. . Q
. Q
;
; Send mail message when complete.
;
D MAIL(PSOCNTR)
;
Q
;
MAIL(PSOCNTR) ;
;
N CNT,MSG,XMY,XMDUZ,DIFROM,XMSUB,XMTEXT
;
S XMY(DUZ)=""
S XMSUB="PSO*7.0*448 Post install is complete",XMDUZ="Patch PSO*7.0*448"
S XMTEXT="MSG("
;
S CNT=1,MSG(CNT)=""
S CNT=CNT+1,MSG(CNT)="Patch PSO*7.0*448 post install routine has completed."
S CNT=CNT+1,MSG(CNT)=""
S CNT=CNT+1,MSG(CNT)="Added "_PSOCNTR_" entries to the new CLSDAT index in the PRESCRIPTION file."
S CNT=CNT+1,MSG(CNT)=""
S CNT=CNT+1,MSG(CNT)="For more information about this post install, review the patch description."
;
D ^XMD
;
Q
;
N PSORDHM,PSORHA1,XQORM
D BMES^XPDUTL(" Step "_PSOSTEP_" of "_PSOTOTAL)
D MES^XPDUTL(" -----------")
D MES^XPDUTL(" Removing cached hidden menus")
S PSORDHM=$O(^ORD(101,"B","PSO REJECTS HIDDEN ACTIONS #1",0))
S XQORM=PSORDHM_";ORD(101,"
D MES^XPDUTL(" - Removing cached hidden menu for "_$P(^ORD(101,PSORDHM,0),U))
K ^XUTL("XQORM",XQORM)
;
S PSORDHM=$O(^ORD(101,"B","PSO HIDDEN ACTIONS",0))
S XQORM=PSORDHM_";ORD(101,"
D MES^XPDUTL(" - Removing cached hidden menu for "_$P(^ORD(101,PSORDHM,0),U))
K ^XUTL("XQORM",XQORM)
Q
;
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HPSO7P448 2797 printed Dec 13, 2024@02:23:52 Page 2
PSO7P448 ;ALB/MRD - Post Install for PSO patch 448 ;5/28/2015
+1 ;;7.0;OUTPATIENT PHARMACY;**448**;DEC 1997;Build 25
+2 ;
+3 DO CLSDAT1(1,2)
+4 DO MENU(2,2)
+5 ;
+6 QUIT
+7 ;
CLSDAT1(PSOSTEP,PSOTOTAL) ; Job the process to build the new CLSDAT cross-reference.
+1 ;
+2 NEW ZTDESC,ZTDTH,ZTIO,ZTRTN,ZTSK
+3 ;
+4 DO BMES^XPDUTL(" Step "_PSOSTEP_" of "_PSOTOTAL)
+5 DO MES^XPDUTL(" -----------")
+6 DO MES^XPDUTL(" Queuing background job to build index of all closed/resolved rejects by")
+7 DO MES^XPDUTL(" date closed/resolved. A Mailman message will be sent when it finishes.")
+8 ;
+9 ; Setup required variables
+10 SET ZTRTN="CLSDAT2^PSO7P448"
SET ZTIO=""
SET ZTDTH=$HOROLOG
+11 SET ZTDESC="Background job to build CLSDAT index for PSO*7*448"
+12 ;
+13 ; Task the job
+14 DO ^%ZTLOAD
+15 ;
+16 ; Check if task was created
+17 IF $DATA(ZTSK)
DO MES^XPDUTL(" Task #"_ZTSK_" queued.")
+18 IF '$DATA(ZTSK)
DO MES^XPDUTL(" Task not queued. Please create a support ticket.")
+19 QUIT
+20 ;
CLSDAT2 ; Populate the new CLSDAT cross-reference on
+1 ; file #52, Prescription.
+2 ;
+3 NEW PSOCLSDAT,PSOCNTR,PSOREJ,PSORX
+4 ;
+5 ; Kill off the entire cross-reference.
+6 ;
+7 KILL ^PSRX("CLSDAT")
+8 ;
+9 ; Loop through all closed/resolved rejects
+10 ;
+11 ; ^PSRX("REJSTS",1,Rx IEN, reject IEN)
+12 ;
+13 SET PSORX=0
SET PSOCNTR=0
+14 FOR
SET PSORX=$ORDER(^PSRX("REJSTS",1,PSORX))
if 'PSORX
QUIT
Begin DoDot:1
+15 SET PSOREJ=0
+16 FOR
SET PSOREJ=$ORDER(^PSRX("REJSTS",1,PSORX,PSOREJ))
if 'PSOREJ
QUIT
Begin DoDot:2
+17 ;
+18 SET PSOCLSDAT=$PIECE($GET(^PSRX(PSORX,"REJ",PSOREJ,0)),"^",6)
+19 IF PSOCLSDAT'=""
SET ^PSRX("CLSDAT",PSOCLSDAT,PSORX,PSOREJ)=""
SET PSOCNTR=PSOCNTR+1
+20 ;
+21 QUIT
End DoDot:2
+22 QUIT
End DoDot:1
+23 ;
+24 ; Send mail message when complete.
+25 ;
+26 DO MAIL(PSOCNTR)
+27 ;
+28 QUIT
+29 ;
MAIL(PSOCNTR) ;
+1 ;
+2 NEW CNT,MSG,XMY,XMDUZ,DIFROM,XMSUB,XMTEXT
+3 ;
+4 SET XMY(DUZ)=""
+5 SET XMSUB="PSO*7.0*448 Post install is complete"
SET XMDUZ="Patch PSO*7.0*448"
+6 SET XMTEXT="MSG("
+7 ;
+8 SET CNT=1
SET MSG(CNT)=""
+9 SET CNT=CNT+1
SET MSG(CNT)="Patch PSO*7.0*448 post install routine has completed."
+10 SET CNT=CNT+1
SET MSG(CNT)=""
+11 SET CNT=CNT+1
SET MSG(CNT)="Added "_PSOCNTR_" entries to the new CLSDAT index in the PRESCRIPTION file."
+12 SET CNT=CNT+1
SET MSG(CNT)=""
+13 SET CNT=CNT+1
SET MSG(CNT)="For more information about this post install, review the patch description."
+14 ;
+15 DO ^XMD
+16 ;
+17 QUIT
+18 ;
+1 NEW PSORDHM,PSORHA1,XQORM
+2 DO BMES^XPDUTL(" Step "_PSOSTEP_" of "_PSOTOTAL)
+3 DO MES^XPDUTL(" -----------")
+4 DO MES^XPDUTL(" Removing cached hidden menus")
+5 SET PSORDHM=$ORDER(^ORD(101,"B","PSO REJECTS HIDDEN ACTIONS #1",0))
+6 SET XQORM=PSORDHM_";ORD(101,"
+7 DO MES^XPDUTL(" - Removing cached hidden menu for "_$PIECE(^ORD(101,PSORDHM,0),U))
+8 KILL ^XUTL("XQORM",XQORM)
+9 ;
+10 SET PSORDHM=$ORDER(^ORD(101,"B","PSO HIDDEN ACTIONS",0))
+11 SET XQORM=PSORDHM_";ORD(101,"
+12 DO MES^XPDUTL(" - Removing cached hidden menu for "_$PIECE(^ORD(101,PSORDHM,0),U))
+13 KILL ^XUTL("XQORM",XQORM)
+14 QUIT
+15 ;