BEHOCNCV ;MSC/IND/PLS/DKM - Cover Sheet: Consult Orders;20-Mar-2007 13:48;DKM
;;1.1;BEH COMPONENTS;**028001;Mar 20, 2007
;=================================================================
; List consult orders
; ADT = Number of hours prior to retrieve
LIST(DATA,DFN,ADT) ;
N ORGRP,ORVP,ORLIST,LP,X,YY
S DATA=$$TMPGBL^CIAVMRPC,ADT=+$G(ADT)
K ^TMP("GMRCR",$J)
D OER^GMRCSLM1(DFN,"","","","",2) ; Condensed format
I $P($G(^TMP("GMRCR",$J,"CS",0)),U,4)>0 D
.S LP=0
.F S LP=$O(^TMP("GMRCR",$J,"CS",LP)) Q:LP<1 D
..S X=^TMP("GMRCR",$J,"CS",LP,0)
..S YY=$$FDATA(X)
..S:$L(YY) @DATA@(LP)=YY
K ^TMP("GMRCR",$J)
Q
; Formats data, returning IEN^STATUS^FORMATTED DATE^TYPE^FM DT
FDATA(X) Q $S('$L(X):"",1:$P(X,U)_U_$P(X,U,4)_U_$$ENTRY^CIAUDT($P(X,U,2))_U_$P(X,U,3)_U_$P(X,U,2))
; Detail of specific consult order
; IEN = IEN of consult order
DETAIL(DATA,DFN,IEN) ;
N GMRCOER
S GMRCOER=2 ; Data style
K ^TMP("GMRCR",$J)
D DT^GMRCSLM2(+IEN)
S DATA=$NA(^TMP("GMRCR",$J,"DT"))
Q
BEHOCNCV ;MSC/IND/PLS/DKM - Cover Sheet: Consult Orders;20-Mar-2007 13:48;DKM
+1 ;;1.1;BEH COMPONENTS;**028001;Mar 20, 2007
+2 ;=================================================================
+3 ; List consult orders
+4 ; ADT = Number of hours prior to retrieve
LIST(DATA,DFN,ADT) ;
+1 NEW ORGRP,ORVP,ORLIST,LP,X,YY
+2 SET DATA=$$TMPGBL^CIAVMRPC
SET ADT=+$GET(ADT)
+3 KILL ^TMP("GMRCR",$JOB)
+4 ; Condensed format
DO OER^GMRCSLM1(DFN,"","","","",2)
+5 IF $PIECE($GET(^TMP("GMRCR",$JOB,"CS",0)),U,4)>0
Begin DoDot:1
+6 SET LP=0
+7 FOR
SET LP=$ORDER(^TMP("GMRCR",$JOB,"CS",LP))
IF LP<1
QUIT
Begin DoDot:2
+8 SET X=^TMP("GMRCR",$JOB,"CS",LP,0)
+9 SET YY=$$FDATA(X)
+10 IF $LENGTH(YY)
SET @DATA@(LP)=YY
End DoDot:2
End DoDot:1
+11 KILL ^TMP("GMRCR",$JOB)
+12 QUIT
+13 ; Formats data, returning IEN^STATUS^FORMATTED DATE^TYPE^FM DT
FDATA(X) QUIT $SELECT('$LENGTH(X):"",1:$PIECE(X,U)_U_$PIECE(X,U,4)_U_$$ENTRY^CIAUDT($PIECE(X,U,2))_U_$PIECE(X,U,3)_U_$PIECE(X,U,2))
+1 ; Detail of specific consult order
+2 ; IEN = IEN of consult order
DETAIL(DATA,DFN,IEN) ;
+1 NEW GMRCOER
+2 ; Data style
SET GMRCOER=2
+3 KILL ^TMP("GMRCR",$JOB)
+4 DO DT^GMRCSLM2(+IEN)
+5 SET DATA=$NAME(^TMP("GMRCR",$JOB,"DT"))
+6 QUIT