HMPWBM1 ;ASMR/RRB - Medication Order Writeback ;Jul 02, 2015@10:22:02
;;2.0;HEALTH MANAGEMENT PLATFORM;**2**;Oct 10, 2014;Build 28
;Per VA Directive 6402, this routine should not be modified.
;
ORCHECK(HMPOUT,DFN,FID,STRT,ORL,OIL,ORIFN,ORREN) ; Wraps for order checking
;
; Input Parameters:
; DFN(R): Patient IEN
; FID: FILLER ID. Acquired by passing the selected orderDialogIen from the
; ORWDX WRLST RPC output to the ORWDXC FILLID.
; STRT: Desired Date in Mmm DD,YYYY@HH:SS format
; ORL: Ordering Location (locationIen from the Visit)
; OIL: An ordered list (array) of orderable Items for Radiology,
; or orderable items + package info for pharmacy (npatient, outpatient,
; and infusion) and lab as appropriate.
; ORIFN: orderIen (This is only available for existing orders that are being copied, changed, or renewed. New orders do not have an orderIen until they are saved.)
; ORREN: Renewed? 1 = Yes, 0 = No. Note: The ORIFN is required if ORREN = 1
;
;Associated ICRs:
;
; Wrap for ORWDXC ACCEPT
; Description: This RPC returns a list of Order Checks on Accept Order.
;
; Input: See input parameters for ORCHECK entry point above.
;
; Output: Order Checks
; orderIen^orderCheckIen^CDL^message
; orderIen = NEW for new orders.
; CDL = Clinic Danger Level. If CDL = 1, an override comment will be
; required during processing order checks during the signing process.
;
K ^TMP($T(+0),$J)
S HMPOUT=$NA(^TMP($T(+0),$J))
N CNT,OUT,XOUT,XTRA,XTRA1,XTRA2
;
D ACCEPT^ORWDXC(.OUT,.DFN,FID,STRT,ORL,.OIL,ORIFN,ORREN)
I $G(OUT(1))'="" S OUT(0)="ORCHECK"
D GETXTRA(.OUT)
D GETMONO
;
Q
;
SESSION ; This is a place holder for future development of session order checks
;
; I $G(OUT(1))'="" S OUT(0)="SESSION"
; D GETXTRA(.OUT)
; D GETMONO
;
Q
;
GETXTRA(OUT) ; Get extra lines for each order check as required and combine for a single output
;
N CNT
; Check each order check for extra lines, and retreive them
; using the ORCHECK GETXTRA broker call
;
; Input Parameters:
; The inputs for this RPC come from the ORWDXC ACCEPT RPC order check output
; Example: NEW^25^2^||63679,54957,NEW&These checks could not be completed for this patient:
; Note: An order check that is returned with the double pipe (||) as noted above is the
; indication that this RPC needs to be run. Inputs for the RPC are parsed by the ?&?.
; XTRA1: piece 1
; XTRA2: piece 2
;
; Output Parameters: Additional lines of order check text
;
S CNT=""
F S CNT=$O(OUT(CNT)) Q:CNT="" D
. S XTRA=$P(OUT(CNT),"||",2)
. I XTRA'="" D
. . S XTRA1=$P(XTRA,"&",1),XTRA2=$P(XTRA,"&",2)
. . D GETXTRA^ORCHECK(.XOUT,XTRA1,XTRA2)
. . M OUT(CNT)=XOUT
M @HMPOUT@("ORCHK")=OUT
;
Q
;
GETMONO ; Get and consolidate monograph data
;
; This is a place holder for a future story after MOCHA is available for remote checking
;
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HHMPWBM1 3094 printed Dec 13, 2024@01:54:47 Page 2
HMPWBM1 ;ASMR/RRB - Medication Order Writeback ;Jul 02, 2015@10:22:02
+1 ;;2.0;HEALTH MANAGEMENT PLATFORM;**2**;Oct 10, 2014;Build 28
+2 ;Per VA Directive 6402, this routine should not be modified.
+3 ;
ORCHECK(HMPOUT,DFN,FID,STRT,ORL,OIL,ORIFN,ORREN) ; Wraps for order checking
+1 ;
+2 ; Input Parameters:
+3 ; DFN(R): Patient IEN
+4 ; FID: FILLER ID. Acquired by passing the selected orderDialogIen from the
+5 ; ORWDX WRLST RPC output to the ORWDXC FILLID.
+6 ; STRT: Desired Date in Mmm DD,YYYY@HH:SS format
+7 ; ORL: Ordering Location (locationIen from the Visit)
+8 ; OIL: An ordered list (array) of orderable Items for Radiology,
+9 ; or orderable items + package info for pharmacy (npatient, outpatient,
+10 ; and infusion) and lab as appropriate.
+11 ; ORIFN: orderIen (This is only available for existing orders that are being copied, changed, or renewed. New orders do not have an orderIen until they are saved.)
+12 ; ORREN: Renewed? 1 = Yes, 0 = No. Note: The ORIFN is required if ORREN = 1
+13 ;
+14 ;Associated ICRs:
+15 ;
+16 ; Wrap for ORWDXC ACCEPT
+17 ; Description: This RPC returns a list of Order Checks on Accept Order.
+18 ;
+19 ; Input: See input parameters for ORCHECK entry point above.
+20 ;
+21 ; Output: Order Checks
+22 ; orderIen^orderCheckIen^CDL^message
+23 ; orderIen = NEW for new orders.
+24 ; CDL = Clinic Danger Level. If CDL = 1, an override comment will be
+25 ; required during processing order checks during the signing process.
+26 ;
+27 KILL ^TMP($TEXT(+0),$JOB)
+28 SET HMPOUT=$NAME(^TMP($TEXT(+0),$JOB))
+29 NEW CNT,OUT,XOUT,XTRA,XTRA1,XTRA2
+30 ;
+31 DO ACCEPT^ORWDXC(.OUT,.DFN,FID,STRT,ORL,.OIL,ORIFN,ORREN)
+32 IF $GET(OUT(1))'=""
SET OUT(0)="ORCHECK"
+33 DO GETXTRA(.OUT)
+34 DO GETMONO
+35 ;
+36 QUIT
+37 ;
SESSION ; This is a place holder for future development of session order checks
+1 ;
+2 ; I $G(OUT(1))'="" S OUT(0)="SESSION"
+3 ; D GETXTRA(.OUT)
+4 ; D GETMONO
+5 ;
+6 QUIT
+7 ;
GETXTRA(OUT) ; Get extra lines for each order check as required and combine for a single output
+1 ;
+2 NEW CNT
+3 ; Check each order check for extra lines, and retreive them
+4 ; using the ORCHECK GETXTRA broker call
+5 ;
+6 ; Input Parameters:
+7 ; The inputs for this RPC come from the ORWDXC ACCEPT RPC order check output
+8 ; Example: NEW^25^2^||63679,54957,NEW&These checks could not be completed for this patient:
+9 ; Note: An order check that is returned with the double pipe (||) as noted above is the
+10 ; indication that this RPC needs to be run. Inputs for the RPC are parsed by the ?&?.
+11 ; XTRA1: piece 1
+12 ; XTRA2: piece 2
+13 ;
+14 ; Output Parameters: Additional lines of order check text
+15 ;
+16 SET CNT=""
+17 FOR
SET CNT=$ORDER(OUT(CNT))
if CNT=""
QUIT
Begin DoDot:1
+18 SET XTRA=$PIECE(OUT(CNT),"||",2)
+19 IF XTRA'=""
Begin DoDot:2
+20 SET XTRA1=$PIECE(XTRA,"&",1)
SET XTRA2=$PIECE(XTRA,"&",2)
+21 DO GETXTRA^ORCHECK(.XOUT,XTRA1,XTRA2)
+22 MERGE OUT(CNT)=XOUT
End DoDot:2
End DoDot:1
+23 MERGE @HMPOUT@("ORCHK")=OUT
+24 ;
+25 QUIT
+26 ;
GETMONO ; Get and consolidate monograph data
+1 ;
+2 ; This is a place holder for a future story after MOCHA is available for remote checking
+3 ;
+4 QUIT