Changeset 1398 for pharmacy-utils
- Timestamp:
- Apr 12, 2012, 5:05:18 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pharmacy-utils/drug-file-cleanup/VWPSSXPD.m
r1395 r1398 4 4 ; Licensed under AGPL 5 5 ; 6 ; This routine contains utilities to remove a drug file and install a new drug file in VISTA. 6 ; This routine contains utilities to remove a drug file and install a new drug 7 ; file in VISTA. 7 8 ; Workflow: 8 9 ; 1. Call KILLDRUG to remove all Drug Data 9 ; 2. Restore a global containing a Drug File (^PSDRUG) and Pharmacy Orderable Item file (^PS(50.6)). Can use a KIDS global transport. 10 ; 2. Restore a global containing a Drug File (^PSDRUG) and Pharmacy Orderable 11 ; Item file (^PS(50.6)). Can use a KIDS global transport. 10 12 ; 3. Call RESTOCK to sync CPRS files back with drug files. 11 13 ; … … 14 16 ; 15 17 ; 16 KILLDRUG ; Remove all Drug Data. P ublic Entry Point. Use this to call the routine.18 KILLDRUG ; Remove all Drug Data. PEP. Use this to call the routine. 17 19 D DT^DICRW ; Min FM Vars 18 D EN^DDIOL("Killing Drug File (50)") D DRUG19 D EN^DDIOL("Killing Pharmacy Orderable Items(50.7)") D PO20 D EN^DDIOL("Removing Pharmacy Orderable Items from the Orderable Item file (101.43)") D O21 D EN^DDIOL("Syncing the Order Quick View file (101.44)") D CPRS20 D MES^XPDUTL("Killing Drug File (50)") D DRUG 21 D MES^XPDUTL("Killing Pharmacy Orderable Item (OI) File (50.7)") D PO 22 D MES^XPDUTL("Removing Pharmacy OIs from the Orderable Item file (101.43)") D O 23 D MES^XPDUTL("Syncing the Order Quick View file (101.44)") D CPRS 22 24 QUIT 23 25 ; 24 RESTOCK ; Restock CPRS Orderable Items from new Drug & Pharmacy Orderable Item File. Public Entry Point. Call this after repopulating the drug file (50) and the pharmacy orderable item file (50.7) 26 RESTOCK ; Restock CPRS Orderable Items from new Drug & Pharmacy Orderable Item 27 ; File. Public Entry Point. 28 ; Call this after repopulating the drug file (50) and the pharmacy orderable 29 ; item file (50.7) 25 30 N PSOIEN ; Looper variable 26 31 D DT^DICRW ; Establish FM Basic Variables 27 32 ; 28 ; Loop through Orderable Item file and call the protocol file updater to CPRS Files 33 ; Loop through Orderable Item file and call the protocol file updater to CPRS 34 ; Files 29 35 S PSOIEN=0 F S PSOIEN=$O(^PS(50.7,PSOIEN)) Q:'PSOIEN D 30 . D EN^DDIOL("Updating Pharamcy Orderable Item "_PSOIEN)36 . D MES^XPDUTL("Updating Pharamcy Orderable Item "_PSOIEN) 31 37 . D EN^PSSPOIDT(PSOIEN),EN2^PSSHL1(PSOIEN,"MUP") 32 38 D CPRS ; Update Orderable Item View files 39 QUIT 40 ; 41 ENV ; Environment Check Routine; KIDS EP 42 N VWPROD S VWPROD=$$PROD^XUPROD() ; Check if a production acc; +ve val is yes 43 W $$CJ^XLFSTR("------ WARNING WARNING WARNING -----",80),!! ; Center Justify 44 W "This package will delete your drug file and add a new drug file contained",! 45 W "in the distribution.",!! 46 W "If you have patient pharmacy data, this will CORRUPT your database.",!! 47 W "You are running in a "_$S(VWPROD:"Production",1:"Test")_" Environment.",!! 48 W "Are you sure you want to continue? Type a full YES/yes if you want to proceed)",! 49 N X R "ANSWER: ",X 50 S X=$$UP^XLFSTR(X) ; uppercase 51 I X'="YES" S XPDQUIT=1 ; Quit if the user doesn't say yes 33 52 QUIT 34 53 ; … … 55 74 QUIT 56 75 ; 57 CPRS ; Now, update the CPRS lists (sync with Orderable Item file) - Uses a CPRS API to do this; Private 76 CPRS ; Now, update the CPRS lists (sync with Orderable Item file) - 77 ; Uses a CPRS API to do this; Private 58 78 ; Next 3 variables are required as inputs 59 79 N ATTEMPT S ATTEMPT=0 ; Attempt to Update … … 65 85 ; UD RX -> Unit Dose 66 86 FOR DGNM="IVA RX","IVB RX","IVM RX","NV RX","O RX","UD RX" DO 67 . D EN^DDIOL("Rebuilding "_DGNM)87 . D MES^XPDUTL("Rebuilding "_DGNM) 68 88 . D FVBLD^ORWUL 69 89 QUIT
Note:
See TracChangeset
for help on using the changeset viewer.