Index: pharmacy-utils/drug-file-cleanup/VWPSSXPD.m
===================================================================
--- pharmacy-utils/drug-file-cleanup/VWPSSXPD.m	(revision 1395)
+++ pharmacy-utils/drug-file-cleanup/VWPSSXPD.m	(revision 1398)
@@ -4,8 +4,10 @@
  ; Licensed under AGPL
  ;
- ; This routine contains utilities to remove a drug file and install a new drug file in VISTA.
+ ; This routine contains utilities to remove a drug file and install a new drug
+ ; file in VISTA.
  ; Workflow:
  ; 1. Call KILLDRUG to remove all Drug Data
- ; 2. Restore a global containing a Drug File (^PSDRUG) and Pharmacy Orderable Item file (^PS(50.6)). Can use a KIDS global transport.
+ ; 2. Restore a global containing a Drug File (^PSDRUG) and Pharmacy Orderable 
+ ;    Item file (^PS(50.6)). Can use a KIDS global transport.
  ; 3. Call RESTOCK to sync CPRS files back with drug files.
  ;
@@ -14,21 +16,38 @@
  ; 
  ; 
-KILLDRUG ; Remove all Drug Data. Public Entry Point. Use this to call the routine.
+KILLDRUG ; Remove all Drug Data. PEP. Use this to call the routine.
  D DT^DICRW ; Min FM Vars
- D EN^DDIOL("Killing Drug File (50)") D DRUG
- D EN^DDIOL("Killing Pharmacy Orderable Items (50.7)") D PO
- D EN^DDIOL("Removing Pharmacy Orderable Items from the Orderable Item file (101.43)") D O
- D EN^DDIOL("Syncing the Order Quick View file (101.44)") D CPRS
+ D MES^XPDUTL("Killing Drug File (50)") D DRUG
+ D MES^XPDUTL("Killing Pharmacy Orderable Item (OI) File (50.7)") D PO
+ D MES^XPDUTL("Removing Pharmacy OIs from the Orderable Item file (101.43)") D O
+ D MES^XPDUTL("Syncing the Order Quick View file (101.44)") D CPRS
  QUIT
  ;
-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)
+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)
  N PSOIEN ; Looper variable
  D DT^DICRW ; Establish FM Basic Variables
  ; 
- ; Loop through Orderable Item file and call the protocol file updater to CPRS Files
+ ; Loop through Orderable Item file and call the protocol file updater to CPRS 
+ ; Files
  S PSOIEN=0 F  S PSOIEN=$O(^PS(50.7,PSOIEN)) Q:'PSOIEN  D 
- . D EN^DDIOL("Updating Pharamcy Orderable Item "_PSOIEN)
+ . D MES^XPDUTL("Updating Pharamcy Orderable Item "_PSOIEN)
  . D EN^PSSPOIDT(PSOIEN),EN2^PSSHL1(PSOIEN,"MUP")
  D CPRS ; Update Orderable Item View files 
+ QUIT
+ ;
+ENV ; Environment Check Routine; KIDS EP
+ N VWPROD S VWPROD=$$PROD^XUPROD() ; Check if a production acc; +ve val is yes
+ W $$CJ^XLFSTR("------   WARNING WARNING WARNING   -----",80),!!  ; Center Justify
+ W "This package will delete your drug file and add a new drug file contained",!
+ W "in the distribution.",!!
+ W "If you have patient pharmacy data, this will CORRUPT your database.",!!
+ W "You are running in a "_$S(VWPROD:"Production",1:"Test")_" Environment.",!!
+ W "Are you sure you want to continue? Type a full YES/yes if you want to proceed)",!
+ N X R "ANSWER: ",X
+ S X=$$UP^XLFSTR(X) ; uppercase
+ I X'="YES" S XPDQUIT=1 ; Quit if the user doesn't say yes
  QUIT
  ;
@@ -55,5 +74,6 @@
  QUIT
  ;
-CPRS ; Now, update the CPRS lists (sync with Orderable Item file) - Uses a CPRS API to do this; Private
+CPRS ; Now, update the CPRS lists (sync with Orderable Item file) - 
+ ; Uses a CPRS API to do this; Private
  ; Next 3 variables are required as inputs
  N ATTEMPT S ATTEMPT=0 ; Attempt to Update
@@ -65,5 +85,5 @@
  ; UD RX -> Unit Dose
  FOR DGNM="IVA RX","IVB RX","IVM RX","NV RX","O RX","UD RX" DO
- . D EN^DDIOL("Rebuilding "_DGNM)
+ . D MES^XPDUTL("Rebuilding "_DGNM)
  . D FVBLD^ORWUL
  QUIT
