Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: ORWPS1

ORWPS1.m

Go to the documentation of this file.
ORWPS1 ; SLC/Staff - Meds Tab ;Aug 09, 2021@10:52:15
 ;;3.0;ORDER ENTRY/RESULTS REPORTING;**10,539,405**;Dec 17, 1997;Build 211
 ;
 ;DBIA SECTION
 ;4902 - $$PARK^PSO52EX
 ;
NEWDLG(Y,INPAT) ; Return order dialog info for New Medication
 N DGRP,ID,IEN,TXT,TYP,X,X0,X5
 I INPAT S X=$$GET^XPAR("ALL","ORWDX NEW MED","i","I")
 E  S X=$$GET^XPAR("ALL","ORWDX NEW MED","o","I")
 S IEN=+X,X0=$G(^ORD(101.41,IEN,0)),X5=$G(^(5))
 S TYP=$P(X0,U,4),DGRP=+$P(X0,U,5),ID=+$P(X5,U,5),TXT=$P(X5,U,4)
 S Y=IEN_";"_ID_";"_DGRP_";"_TYP_U_TXT
 Q
PICKUP(Y) ; Return default for refill location
 I $D(^PSX(550,"C")) S Y="M"
 E  S Y="W"
 Q
REFILL(Y,ORDERID,REFLOC,ORVP,ORNP,ORL) ; Refill Request
 D CHKPARK I UNPARK S Y="" Q           ;ADDED LINE OF PAPI CODE
 S ORVP=ORVP_";DPT(",ORL(2)=ORL_";SC(",ORL=ORL(2)
 D REF^ORMBLDPS(ORDERID,REFLOC)
 S Y=""
 Q
CHKPARK ; IF ORDER IS PARKED AND LAST FILL HAS NOT PRINTED A LABEL, REUSE LAST FILL INSTEAD OF ORDERING A NEW REFILL - 405
 N ERRMSG,ORRFILL
 S UNPARK=0,ORRFILL=1
 I '$$PARK^PSO52EX(+ORDERID) Q   ;ICR 4902
 S PSODA=$O(^PSRX("APL",+ORDERID,""))
 D UNPARK^PSOPRKA(PSODA,$P(ORVP,";"),.ERRMSG)
 I $G(ERRMSG(1))'="" Q
 ;S UNPARK=1  ;VGH 5/2
 Q
NVADLG(Y) ; Return order dialog info for a New Non-VA Medication
 N DGRP,ID,IEN,TXT,TYP,X0,X5
 S IEN=+$O(^ORD(101.41,"B","PSH OERR",""))
 I IEN=0 S Y="-1^PSH OERR (Non VA Medications (Documentation)) dialog does not exist" Q
 S X0=$G(^ORD(101.41,IEN,0)),X5=$G(^(5))
 S TYP=$P(X0,U,4),DGRP=+$P(X0,U,5),ID=+$P(X5,U,5),TXT=$P(X5,U,4)
 S Y=IEN_";"_ID_";"_DGRP_";"_TYP_U_TXT
 Q