- PSSPOST5 ;BIR/EJW-Post install routine ;
- ;;1.0;PHARMACY DATA MANAGEMENT;**55**;9/30/97
- ;External reference to PSNMGR supported by DBIA 2106
- ;External reference to ^XUSEC supported by DBIA 10076
- ; POST-INSTALL ROUTINE FOR PATCH PSS*1*55 - TO POPULATE THE "DTXT" CROSS-REFERENCES IN THE DRUG AND PHARMACY ORDERABLE ITEMS FILE
- S ZTDTH=""
- I $D(ZTQUEUED) S ZTDTH=$H
- I ZTDTH="" D
- .W !,"The background job to populate the 'DTXT' (drug text) cross-reference in the"
- .W !,"PHARMACY ORDERABLE ITEM file (#50.7) and the DRUG file (#50) must be queued."
- .W !,"If no start date/time is entered when prompted, the background job will be"
- .W !,"queued to run NOW."
- .W !
- .D BMES^XPDUTL("Queuing background job to populate the 'DTXT' (drug text) cross-reference...")
- S ZTRTN="RES^PSSPOST5",ZTIO="",ZTDESC="Background job to populate 'DTXT' cross-reference" D ^%ZTLOAD K ZTDTH,ZTRTN,ZTIO,ZTDESC
- W:$D(ZTSK)&('$D(ZTQUEUED)) !!,"Task Queued !",!
- Q
- RES ;
- I '$G(DT) S DT=$$DT^XLFDT
- D NOW^%DTC S ^XTMP("PSSTIMEX","START")=%
- D BMES^XPDUTL("Populating 'DTXT' cross-references...")
- OI ;Updating "DTXT" cross-reference for Orderable Items
- D BMES^XPDUTL("Populating 'DTXT' x-ref for Pharmacy Orderable Items...")
- N PSSOI,PSSTXP,PSSSQ,PSSOICT,PSSDCT
- S (PSSOICT,PSSDCT)=0
- S PSSOI=0 F S PSSOI=$O(^PS(50.7,PSSOI)) Q:'PSSOI I $D(^PS(50.7,PSSOI,1,"B")) D
- .S PSSTXP="" F S PSSTXP=$O(^PS(50.7,PSSOI,1,"B",PSSTXP)) Q:'PSSTXP I $D(^PS(51.7,PSSTXP)) S PSSSQ="" F S PSSSQ=$O(^PS(50.7,PSSOI,1,"B",PSSTXP,PSSSQ)) Q:PSSSQ="" D
- ..I '$D(^PS(50.7,"DTXT",PSSTXP,PSSOI)) S ^PS(50.7,"DTXT",PSSTXP,PSSOI,PSSSQ)="" S PSSOICT=PSSOICT+1
- DRUG ;Updating "DTXT" cross-reference for Drug file
- D BMES^XPDUTL("Populating 'DTXT' x-ref for Drug file...")
- N PSSDRG
- S PSSDRG=0 F S PSSDRG=$O(^PSDRUG(PSSDRG)) Q:'PSSDRG S PSSTXP="" F S PSSTXP=$O(^PSDRUG(PSSDRG,9,"B",PSSTXP)) Q:'PSSTXP I $D(^PS(51.7,PSSTXP)) S PSSSQ="" F S PSSSQ=$O(^PSDRUG(PSSDRG,9,"B",PSSTXP,PSSSQ)) Q:PSSSQ="" D
- .W " ",PSSDRG,"-",PSSTXP I '$D(^PSDRUG("DTXT",PSSTXP,PSSDRG)) S ^PSDRUG("DTXT",PSSTXP,PSSDRG,PSSSQ)="" S PSSDCT=PSSDCT+1
- MAIL ;
- D NOW^%DTC S PSSTIMEB=%
- S Y=$G(^XTMP("PSSTIMEX","START")) D DD^%DT S PSSTIMEA=Y
- S Y=$G(PSSTIMEB) D DD^%DT S PSSTIMEB=Y
- S XMDUZ="PHARMACY DATA MANAGEMENT PACKAGE",XMY(DUZ)="",XMSUB="Drug Text Cross Reference Creation"
- F PSOCXPDA=0:0 S PSOCXPDA=$O(^XUSEC("PSNMGR",PSOCXPDA)) Q:'PSOCXPDA S XMY(PSOCXPDA)=""
- K PSSTEXT S PSSTEXT(1)="Patch PSS*1*55 Drug Text Cross Reference creation is complete.",PSSTEXT(2)="It started on "_$G(PSSTIMEA)_".",PSSTEXT(3)="It ended on "_$G(PSSTIMEB)_"."
- S PSSTEXT(4)=" "
- S PSSTEXT(5)=PSSOICT_" entries were added to the 'DTXT' cross-reference for the PHARMACY ORDERABLE"
- S PSSTEXT(6)="ITEM file (#50.7)."
- S PSSTEXT(7)=" "
- S PSSTEXT(8)=PSSDCT_" entries were added to the 'DTXT' cross-reference for the DRUG file (#50)."
- S PSSTEXT(9)=" "
- S PSSTEXT(10)="This message is being sent to the installer of the patch and holders of the"
- S PSSTEXT(11)="PSNMGR key. The new Drug Text File Report [PSS DRUG TEXT FILE REPORT] option"
- S PSSTEXT(12)="should be run for all drug text entries in the DRUG TEXT file (#51.7)"
- S PSSTEXT(13)="to verify that the correct drug text is associated with the correct entries"
- S PSSTEXT(14)="in the PHARMACY ORDERABLE ITEM file (#50.7) and the DRUG file (#50)."
- S PSSTEXT(15)="A listing of the original drug text file entries distributed with"
- S PSSTEXT(16)="Patch PSS*1*29 is provided in the Pharmacy Data Management user manual."
- S XMTEXT="PSSTEXT(" N DIFROM D ^XMD
- K PSSTIMEA,PSSTIMEB,XMDUZ,XMSUB,PSSTEXT,XMTEXT
- S:$D(ZTQUEUED) ZTREQ="@"
- Q
- ;
- --- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HPSSPOST5 3660 printed Apr 23, 2025@18:48:09 Page 2
- PSSPOST5 ;BIR/EJW-Post install routine ;
- +1 ;;1.0;PHARMACY DATA MANAGEMENT;**55**;9/30/97
- +2 ;External reference to PSNMGR supported by DBIA 2106
- +3 ;External reference to ^XUSEC supported by DBIA 10076
- +4 ; POST-INSTALL ROUTINE FOR PATCH PSS*1*55 - TO POPULATE THE "DTXT" CROSS-REFERENCES IN THE DRUG AND PHARMACY ORDERABLE ITEMS FILE
- +5 SET ZTDTH=""
- +6 IF $DATA(ZTQUEUED)
- SET ZTDTH=$HOROLOG
- +7 IF ZTDTH=""
- Begin DoDot:1
- +8 WRITE !,"The background job to populate the 'DTXT' (drug text) cross-reference in the"
- +9 WRITE !,"PHARMACY ORDERABLE ITEM file (#50.7) and the DRUG file (#50) must be queued."
- +10 WRITE !,"If no start date/time is entered when prompted, the background job will be"
- +11 WRITE !,"queued to run NOW."
- +12 WRITE !
- +13 DO BMES^XPDUTL("Queuing background job to populate the 'DTXT' (drug text) cross-reference...")
- End DoDot:1
- +14 SET ZTRTN="RES^PSSPOST5"
- SET ZTIO=""
- SET ZTDESC="Background job to populate 'DTXT' cross-reference"
- DO ^%ZTLOAD
- KILL ZTDTH,ZTRTN,ZTIO,ZTDESC
- +15 if $DATA(ZTSK)&('$DATA(ZTQUEUED))
- WRITE !!,"Task Queued !",!
- +16 QUIT
- RES ;
- +1 IF '$GET(DT)
- SET DT=$$DT^XLFDT
- +2 DO NOW^%DTC
- SET ^XTMP("PSSTIMEX","START")=%
- +3 DO BMES^XPDUTL("Populating 'DTXT' cross-references...")
- OI ;Updating "DTXT" cross-reference for Orderable Items
- +1 DO BMES^XPDUTL("Populating 'DTXT' x-ref for Pharmacy Orderable Items...")
- +2 NEW PSSOI,PSSTXP,PSSSQ,PSSOICT,PSSDCT
- +3 SET (PSSOICT,PSSDCT)=0
- +4 SET PSSOI=0
- FOR
- SET PSSOI=$ORDER(^PS(50.7,PSSOI))
- if 'PSSOI
- QUIT
- IF $DATA(^PS(50.7,PSSOI,1,"B"))
- Begin DoDot:1
- +5 SET PSSTXP=""
- FOR
- SET PSSTXP=$ORDER(^PS(50.7,PSSOI,1,"B",PSSTXP))
- if 'PSSTXP
- QUIT
- IF $DATA(^PS(51.7,PSSTXP))
- SET PSSSQ=""
- FOR
- SET PSSSQ=$ORDER(^PS(50.7,PSSOI,1,"B",PSSTXP,PSSSQ))
- if PSSSQ=""
- QUIT
- Begin DoDot:2
- +6 IF '$DATA(^PS(50.7,"DTXT",PSSTXP,PSSOI))
- SET ^PS(50.7,"DTXT",PSSTXP,PSSOI,PSSSQ)=""
- SET PSSOICT=PSSOICT+1
- End DoDot:2
- End DoDot:1
- DRUG ;Updating "DTXT" cross-reference for Drug file
- +1 DO BMES^XPDUTL("Populating 'DTXT' x-ref for Drug file...")
- +2 NEW PSSDRG
- +3 SET PSSDRG=0
- FOR
- SET PSSDRG=$ORDER(^PSDRUG(PSSDRG))
- if 'PSSDRG
- QUIT
- SET PSSTXP=""
- FOR
- SET PSSTXP=$ORDER(^PSDRUG(PSSDRG,9,"B",PSSTXP))
- if 'PSSTXP
- QUIT
- IF $DATA(^PS(51.7,PSSTXP))
- SET PSSSQ=""
- FOR
- SET PSSSQ=$ORDER(^PSDRUG(PSSDRG,9,"B",PSSTXP,PSSSQ))
- if PSSSQ=""
- QUIT
- Begin DoDot:1
- +4 WRITE " ",PSSDRG,"-",PSSTXP
- IF '$DATA(^PSDRUG("DTXT",PSSTXP,PSSDRG))
- SET ^PSDRUG("DTXT",PSSTXP,PSSDRG,PSSSQ)=""
- SET PSSDCT=PSSDCT+1
- End DoDot:1
- MAIL ;
- +1 DO NOW^%DTC
- SET PSSTIMEB=%
- +2 SET Y=$GET(^XTMP("PSSTIMEX","START"))
- DO DD^%DT
- SET PSSTIMEA=Y
- +3 SET Y=$GET(PSSTIMEB)
- DO DD^%DT
- SET PSSTIMEB=Y
- +4 SET XMDUZ="PHARMACY DATA MANAGEMENT PACKAGE"
- SET XMY(DUZ)=""
- SET XMSUB="Drug Text Cross Reference Creation"
- +5 FOR PSOCXPDA=0:0
- SET PSOCXPDA=$ORDER(^XUSEC("PSNMGR",PSOCXPDA))
- if 'PSOCXPDA
- QUIT
- SET XMY(PSOCXPDA)=""
- +6 KILL PSSTEXT
- SET PSSTEXT(1)="Patch PSS*1*55 Drug Text Cross Reference creation is complete."
- SET PSSTEXT(2)="It started on "_$GET(PSSTIMEA)_"."
- SET PSSTEXT(3)="It ended on "_$GET(PSSTIMEB)_"."
- +7 SET PSSTEXT(4)=" "
- +8 SET PSSTEXT(5)=PSSOICT_" entries were added to the 'DTXT' cross-reference for the PHARMACY ORDERABLE"
- +9 SET PSSTEXT(6)="ITEM file (#50.7)."
- +10 SET PSSTEXT(7)=" "
- +11 SET PSSTEXT(8)=PSSDCT_" entries were added to the 'DTXT' cross-reference for the DRUG file (#50)."
- +12 SET PSSTEXT(9)=" "
- +13 SET PSSTEXT(10)="This message is being sent to the installer of the patch and holders of the"
- +14 SET PSSTEXT(11)="PSNMGR key. The new Drug Text File Report [PSS DRUG TEXT FILE REPORT] option"
- +15 SET PSSTEXT(12)="should be run for all drug text entries in the DRUG TEXT file (#51.7)"
- +16 SET PSSTEXT(13)="to verify that the correct drug text is associated with the correct entries"
- +17 SET PSSTEXT(14)="in the PHARMACY ORDERABLE ITEM file (#50.7) and the DRUG file (#50)."
- +18 SET PSSTEXT(15)="A listing of the original drug text file entries distributed with"
- +19 SET PSSTEXT(16)="Patch PSS*1*29 is provided in the Pharmacy Data Management user manual."
- +20 SET XMTEXT="PSSTEXT("
- NEW DIFROM
- DO ^XMD
- +21 KILL PSSTIMEA,PSSTIMEB,XMDUZ,XMSUB,PSSTEXT,XMTEXT
- +22 if $DATA(ZTQUEUED)
- SET ZTREQ="@"
- +23 QUIT
- +24 ;