source: WorldVistAEHR/trunk/r/PHARMACY_DATA_MANAGEMENT-PSS/PSSPOST5.m@ 1361

Last change on this file since 1361 was 613, checked in by George Lilly, 15 years ago

initial load of WorldVistAEHR

File size: 3.5 KB
RevLine 
[613]1PSSPOST5 ;BIR/EJW-Post install routine ;
2 ;;1.0;PHARMACY DATA MANAGEMENT;**55**;9/30/97
3 ;External reference to PSNMGR supported by DBIA 2106
4 ;External reference to ^XUSEC supported by DBIA 10076
5 ; POST-INSTALL ROUTINE FOR PATCH PSS*1*55 - TO POPULATE THE "DTXT" CROSS-REFERENCES IN THE DRUG AND PHARMACY ORDERABLE ITEMS FILE
6 S ZTDTH=""
7 I $D(ZTQUEUED) S ZTDTH=$H
8 I ZTDTH="" D
9 .W !,"The background job to populate the 'DTXT' (drug text) cross-reference in the"
10 .W !,"PHARMACY ORDERABLE ITEM file (#50.7) and the DRUG file (#50) must be queued."
11 .W !,"If no start date/time is entered when prompted, the background job will be"
12 .W !,"queued to run NOW."
13 .W !
14 .D BMES^XPDUTL("Queuing background job to populate the 'DTXT' (drug text) cross-reference...")
15 S ZTRTN="RES^PSSPOST5",ZTIO="",ZTDESC="Background job to populate 'DTXT' cross-reference" D ^%ZTLOAD K ZTDTH,ZTRTN,ZTIO,ZTDESC
16 W:$D(ZTSK)&('$D(ZTQUEUED)) !!,"Task Queued !",!
17 Q
18RES ;
19 I '$G(DT) S DT=$$DT^XLFDT
20 D NOW^%DTC S ^XTMP("PSSTIMEX","START")=%
21 D BMES^XPDUTL("Populating 'DTXT' cross-references...")
22OI ;Updating "DTXT" cross-reference for Orderable Items
23 D BMES^XPDUTL("Populating 'DTXT' x-ref for Pharmacy Orderable Items...")
24 N PSSOI,PSSTXP,PSSSQ,PSSOICT,PSSDCT
25 S (PSSOICT,PSSDCT)=0
26 S PSSOI=0 F S PSSOI=$O(^PS(50.7,PSSOI)) Q:'PSSOI I $D(^PS(50.7,PSSOI,1,"B")) D
27 .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
28 ..I '$D(^PS(50.7,"DTXT",PSSTXP,PSSOI)) S ^PS(50.7,"DTXT",PSSTXP,PSSOI,PSSSQ)="" S PSSOICT=PSSOICT+1
29DRUG ;Updating "DTXT" cross-reference for Drug file
30 D BMES^XPDUTL("Populating 'DTXT' x-ref for Drug file...")
31 N PSSDRG
32 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
33 .W " ",PSSDRG,"-",PSSTXP I '$D(^PSDRUG("DTXT",PSSTXP,PSSDRG)) S ^PSDRUG("DTXT",PSSTXP,PSSDRG,PSSSQ)="" S PSSDCT=PSSDCT+1
34MAIL ;
35 D NOW^%DTC S PSSTIMEB=%
36 S Y=$G(^XTMP("PSSTIMEX","START")) D DD^%DT S PSSTIMEA=Y
37 S Y=$G(PSSTIMEB) D DD^%DT S PSSTIMEB=Y
38 S XMDUZ="PHARMACY DATA MANAGEMENT PACKAGE",XMY(DUZ)="",XMSUB="Drug Text Cross Reference Creation"
39 F PSOCXPDA=0:0 S PSOCXPDA=$O(^XUSEC("PSNMGR",PSOCXPDA)) Q:'PSOCXPDA S XMY(PSOCXPDA)=""
40 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)_"."
41 S PSSTEXT(4)=" "
42 S PSSTEXT(5)=PSSOICT_" entries were added to the 'DTXT' cross-reference for the PHARMACY ORDERABLE"
43 S PSSTEXT(6)="ITEM file (#50.7)."
44 S PSSTEXT(7)=" "
45 S PSSTEXT(8)=PSSDCT_" entries were added to the 'DTXT' cross-reference for the DRUG file (#50)."
46 S PSSTEXT(9)=" "
47 S PSSTEXT(10)="This message is being sent to the installer of the patch and holders of the"
48 S PSSTEXT(11)="PSNMGR key. The new Drug Text File Report [PSS DRUG TEXT FILE REPORT] option"
49 S PSSTEXT(12)="should be run for all drug text entries in the DRUG TEXT file (#51.7)"
50 S PSSTEXT(13)="to verify that the correct drug text is associated with the correct entries"
51 S PSSTEXT(14)="in the PHARMACY ORDERABLE ITEM file (#50.7) and the DRUG file (#50)."
52 S PSSTEXT(15)="A listing of the original drug text file entries distributed with"
53 S PSSTEXT(16)="Patch PSS*1*29 is provided in the Pharmacy Data Management user manual."
54 S XMTEXT="PSSTEXT(" N DIFROM D ^XMD
55 K PSSTIMEA,PSSTIMEB,XMDUZ,XMSUB,PSSTEXT,XMTEXT
56 S:$D(ZTQUEUED) ZTREQ="@"
57 Q
58 ;
Note: See TracBrowser for help on using the repository browser.