Changeset 1398 for pharmacy-utils


Ignore:
Timestamp:
Apr 12, 2012, 5:05:18 PM (13 years ago)
Author:
Sam Habiel
Message:

All writes support KIDS now; Added ENV check routine

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pharmacy-utils/drug-file-cleanup/VWPSSXPD.m

    r1395 r1398  
    44 ; Licensed under AGPL
    55 ;
    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.
    78 ; Workflow:
    89 ; 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.
    1012 ; 3. Call RESTOCK to sync CPRS files back with drug files.
    1113 ;
     
    1416 ;
    1517 ;
    16 KILLDRUG ; Remove all Drug Data. Public Entry Point. Use this to call the routine.
     18KILLDRUG ; Remove all Drug Data. PEP. Use this to call the routine.
    1719 D DT^DICRW ; Min FM Vars
    18  D EN^DDIOL("Killing Drug File (50)") D DRUG
    19  D EN^DDIOL("Killing Pharmacy Orderable Items (50.7)") D PO
    20  D EN^DDIOL("Removing Pharmacy Orderable Items from the Orderable Item file (101.43)") D O
    21  D EN^DDIOL("Syncing the Order Quick View file (101.44)") D CPRS
     20 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
    2224 QUIT
    2325 ;
    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)
     26RESTOCK ; 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)
    2530 N PSOIEN ; Looper variable
    2631 D DT^DICRW ; Establish FM Basic Variables
    2732 ;
    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
    2935 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)
    3137 . D EN^PSSPOIDT(PSOIEN),EN2^PSSHL1(PSOIEN,"MUP")
    3238 D CPRS ; Update Orderable Item View files
     39 QUIT
     40 ;
     41ENV ; 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
    3352 QUIT
    3453 ;
     
    5574 QUIT
    5675 ;
    57 CPRS ; Now, update the CPRS lists (sync with Orderable Item file) - Uses a CPRS API to do this; Private
     76CPRS ; Now, update the CPRS lists (sync with Orderable Item file) -
     77 ; Uses a CPRS API to do this; Private
    5878 ; Next 3 variables are required as inputs
    5979 N ATTEMPT S ATTEMPT=0 ; Attempt to Update
     
    6585 ; UD RX -> Unit Dose
    6686 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)
    6888 . D FVBLD^ORWUL
    6989 QUIT
Note: See TracChangeset for help on using the changeset viewer.