source: WorldVistAEHR/trunk/r/PHARMACY_DATA_MANAGEMENT-PSS/PSSPOST2.m@ 1639

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

initial load of WorldVistAEHR

File size: 4.7 KB
Line 
1PSSPOST2 ;BIR/LDT-Post install routine ;08/01/00
2 ;;1.0;PHARMACY DATA MANAGEMENT;**38**;9/30/97
3 ;External reference to ORY94 supported by DBIA 3415
4 ; POST-INSTALL ROUTINE
5 I $$PATCH^XPDUTL("PSS*1.0*38") G END ; has patch already been installed
6RES ;
7 I '$G(DT) S DT=$$DT^XLFDT
8 ;Delete AD cross references on Orderable Items in Files 52.6 and 52.7
9 D DELIX^DDMOD(52.7,9,2)
10 D DELIX^DDMOD(52.6,15,2)
11 ;Delete CHANGE TYPE OF ORDER FROM OERR field (#20.412) and IV IDENTIFIER field (#32) from the PHARMACY SYSTEM file (#59.7)
12 D BMES^XPDUTL("Deleting obsolete fields...")
13 S DA=20.412 S DIK="^DD(59.7,",DA(1)=59.7 D ^DIK K DIK
14 ;Delete CORRESPONDING UD ITEM field (#3) and CORRESPONDING IV ITEM field (#4) from the PHARMACY ORDERABLE ITEM file (#50.7)
15 F DA=3,4 S DIK="^DD(50.7,",DA(1)=50.7 D ^DIK K DIK
16 ;Delete Instructions multiple and Pre-Ordering Enhancement field
17 S DA=2,DA(1)=50.6066,DIK="^DD(50.6066," D ^DIK K DA,DIK
18 S DA=4,DIK="^DD(50.606,",DA(1)=50.606 D ^DIK K DA,DIK
19 K DIU S DIU=50.6062,DIU(0)="S" D EN^DIU2 K DIU
20 D BMES^XPDUTL("Deleting obsolete data...")
21 N PSSDF,PSSDF1 F PSSDF=0:0 S PSSDF=$O(^PS(50.606,PSSDF)) Q:'PSSDF D
22 .K ^PS(50.606,PSSDF,"INS")
23 .I $D(^PS(50.606,PSSDF,"MISC")) S $P(^PS(50.606,PSSDF,"MISC"),"^",2)=""
24 .F PSSDF1=0:0 S PSSDF1=$O(^PS(50.606,PSSDF,"NOUN",PSSDF1)) Q:'PSSDF1 I $D(^PS(50.606,PSSDF,"NOUN",PSSDF1,0)) S $P(^(0),"^",3)=""
25 N PSSPSF S PSSPSF=0 F S PSSPSF=$O(^PS(59.7,PSSPSF)) Q:'PSSPSF S $P(^PS(59.7,PSSPSF,20.4),"^",16)=""
26 N PSSOI S PSSOI=0 F S PSSOI=$O(^PS(50.7,PSSOI)) Q:'PSSOI S $P(^PS(50.7,PSSOI,0),"^",10)="",$P(^(0),"^",11)=""
27 ;
28 ;fix options (matching) DISABLE A/SMATCHING, MODIFY DD, FIX FROM DRIG ENTER.EDIT
29 ;D QUICK^ORUPDATE ; loop through orders, call PSSQORD
30 ;This quick order update may take a while, can CPRS write dots
31CON N PSSL,PSSPOI,PSSADD,PSSSOL,PSSDRG,PSSNEWOI,PSSOLDOI,PSSXDATE
32 ;Converting Additives and Solutions to new Orderable Items
33 S X1=DT,X2=+30 D C^%DTC S PSSXDATE=$G(X)
34 S ^XTMP("PSSCONA",0)=PSSXDATE_"^"_DT,^XTMP("PSSCONS",0)=PSSXDATE_"^"_DT
35 D BMES^XPDUTL("Updating IV Additive Orderable Items...")
36 F PSSL=0:0 S PSSL=$O(^PS(52.6,PSSL)) Q:'PSSL D:$D(^PS(52.6,PSSL,0))
37 .S PSSOLDOI=$P($G(^PS(52.6,PSSL,0)),"^",11) S $P(^PS(52.6,PSSL,0),"^",11)=""
38 .I PSSOLDOI K ^PS(52.6,"AOI",PSSOLDOI,PSSL)
39 .S PSSDRG=$P($G(^PS(52.6,PSSL,0)),"^",2) I 'PSSDRG Q
40 .S PSSNEWOI=$P($G(^PSDRUG(PSSDRG,2)),"^") D I 'PSSNEWOI Q
41 ..I PSSOLDOI,PSSNEWOI S:'$D(^PSDRUG("A526",PSSDRG,PSSL)) ^XTMP("PSSCONA",PSSOLDOI,PSSL)=PSSNEWOI
42 .I '$D(^PS(50.7,PSSNEWOI,0)) Q
43 .S $P(^PS(52.6,PSSL,0),"^",11)=PSSNEWOI,^PS(52.6,"AOI",PSSNEWOI,PSSL)="",^PSDRUG("A526",PSSDRG,PSSL)=""
44 D BMES^XPDUTL("Updating IV Solution Orderable Items...")
45 F PSSL=0:0 S PSSL=$O(^PS(52.7,PSSL)) Q:'PSSL D:$D(^PS(52.7,PSSL,0))
46 .S PSSOLDOI=$P($G(^PS(52.7,PSSL,0)),"^",11) S $P(^PS(52.7,PSSL,0),"^",11)=""
47 .I PSSOLDOI K ^PS(52.7,"AOI",PSSOLDOI,PSSL)
48 .S PSSDRG=$P($G(^PS(52.7,PSSL,0)),"^",2) I 'PSSDRG Q
49 .S PSSNEWOI=$P($G(^PSDRUG(PSSDRG,2)),"^") D I 'PSSNEWOI Q
50 ..I PSSOLDOI,PSSNEWOI S:'$D(^PSDRUG("A527",PSSDRG,PSSL)) ^XTMP("PSSCONS",PSSOLDOI,PSSL)=PSSNEWOI
51 .I '$D(^PS(50.7,PSSNEWOI,0)) Q
52 .S $P(^PS(52.7,PSSL,0),"^",11)=PSSNEWOI,^PS(52.7,"AOI",PSSNEWOI,PSSL)="",^PSDRUG("A527",PSSDRG,PSSL)=""
53OI ;Updating CPRS with new Orderable Item information
54 N PSSORITM,PSSRI,PSSORIDT,PSSCONTX,PSSRD1,PSSRD2
55 D BMES^XPDUTL("Setting new Orderable Item cross reference...")
56 S PSSCONTX=0
57 F PSSRD1=0:0 S PSSRD1=$O(^PSDRUG(PSSRD1)) Q:'PSSRD1 D
58 .S PSSRD2=$P($G(^PSDRUG(PSSRD1,2)),"^") Q:'PSSRD2
59 .S ^PS(50.7,"A50",PSSRD2,PSSRD1)=""
60 .I '(PSSCONTX#50) W "."
61 .S PSSCONTX=PSSCONTX+1
62 S PSSCONTX=0
63 D BMES^XPDUTL("Updating Pharmacy Orderable Items...")
64 I '$G(DT) S DT=$$DT^XLFDT
65 F PSSRI=0:0 S PSSRI=$O(^PS(50.7,PSSRI)) Q:'PSSRI D:$D(^PS(50.7,PSSRI,0))
66 .S PSSORITM=PSSRI
67 .S $P(^PS(50.7,PSSORITM,0),"^",12)=""
68 .I $P(^PS(50.7,PSSORITM,0),"^",3) D
69 ..S PSSORIDT=$P(^PS(50.7,PSSORITM,0),"^",4) I PSSORIDT,PSSORIDT'>DT Q
70 ..S $P(^PS(50.7,PSSORITM,0),"^",4)=DT
71 .S PSSCROSS=1,PSSTEST=PSSORITM D EN1^PSSPOIDT K PSSTEST,PSSCROSS
72 .I '(PSSCONTX#10) W "."
73 .S PSSCONTX=PSSCONTX+1
74 ;D BMES^XPDUTL("Queue Inpatient Medications order conversion...")
75 ;S ZTDTH=$H,ZTRTN="CNIV^PSJUTL1()",ZTIO="",ZTDESC="Inpatient medications order conversion" D ^%ZTLOAD
76 ;D EN^PSOPOST2
77 D POST^ORY94
78 ;D POE^PSJPST50
79MAIL ;
80 D NOW^%DTC S PSSTIMEB=%
81 S Y=$G(^XTMP("PSSTIMEX","START")) D DD^%DT S PSSTIMEA=Y
82 S Y=$G(PSSTIMEB) D DD^%DT S PSSTIMEB=Y
83 S XMDUZ="PHARMACY DATA MANAGEMENT PACKAGE",XMY(DUZ)="",XMSUB="Pharmacy Ordering Enhancements Install"
84 K PSSTEXT S PSSTEXT(1)="The Pharmacy Ordering Enhancements installation is complete.",PSSTEXT(2)="It started on "_$G(PSSTIMEA)_".",PSSTEXT(3)="It ended on "_$G(PSSTIMEB)_"."
85 S XMTEXT="PSSTEXT(" N DIFROM D ^XMD
86 K PSSTIMEA,PSSTIMEB,XMDUZ,XMSUB,PSSTEXT,XMTEXT
87END ;
88 Q
89RESTART ;restart post init job
90 G RES
91 Q
Note: See TracBrowser for help on using the repository browser.