ORWCS ; ALB/MJK - Consult Tab Calls ;9/18/96 15:02
;;3.0;ORDER ENTRY/RESULTS REPORTING;;Dec 17, 1997
;
LIST(ORY,DFN,SERV,BEGDT,ENDDT,STATUS) ;
; RPC: ORWCS LIST OF CONSULT REPORTS
; See RPC definition for details on input and output parameters
;
N ORI,ORX,ID,DATE,STAT,PROC,LN
IF '$D(SERV) N SERV S SERV=""
IF '$D(BEGDT) N BEG S BEGDT=""
IF '$D(ENDDT) N END S ENDDT=""
IF '$D(STATUS) N STATUS S STATUS=""
S LN=0
;
S ORY=$NA(^TMP("ORCS",$J)) K @ORY
D OER^GMRCSLM1(DFN,SERV,BEGDT,ENDDT,STATUS)
S ORI=0 F S ORI=$O(^TMP("GMRCR",$J,"CS",ORI)) Q:'ORI S ORX=$G(^(ORI,0)) D
. S ID=$P(ORX,U)
. S DATE=$P(ORX,U,2)
. S STAT=$P(ORX,U,3)
. S PROC=$P(ORX,U,5)
. IF PROC="Consult" S PROC=$$UP^XLFSTR($P(ORX,U,4)_" "_PROC)
. S LN=LN+1
. S @ORY@(LN,0)=ID_U_DATE_U_PROC_U_STAT
Q
;
RPT(ORY,DFN,ORID) ; -- retrieve report text
; RPC: ORWCS REPORT TEXT
; See RPC definition for details on input and output parameters
;
S ORY=$NA(^TMP("GMRCR",$J,"DT")) K @ORY Q:+ORID=0
D DT^GMRCSLM2(ORID)
Q
;
TEST ; -- get a list of reports
N ORY,ORI
D LIST(.ORY,16)
S ORI=0 F S ORI=$O(@ORY@(ORI)) Q:'ORI W !,@ORY@(ORI,0)
Q
TEST1 ; -- print a report
N ORY,ORI
D RPT(.ORY,16,100)
S ORI=0 F S ORI=$O(@ORY@(ORI)) Q:'ORI W !,@ORY@(ORI,0)
Q
;
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HORWCS 1297 printed Dec 13, 2024@02:35:05 Page 2
ORWCS ; ALB/MJK - Consult Tab Calls ;9/18/96 15:02
+1 ;;3.0;ORDER ENTRY/RESULTS REPORTING;;Dec 17, 1997
+2 ;
LIST(ORY,DFN,SERV,BEGDT,ENDDT,STATUS) ;
+1 ; RPC: ORWCS LIST OF CONSULT REPORTS
+2 ; See RPC definition for details on input and output parameters
+3 ;
+4 NEW ORI,ORX,ID,DATE,STAT,PROC,LN
+5 IF '$DATA(SERV)
NEW SERV
SET SERV=""
+6 IF '$DATA(BEGDT)
NEW BEG
SET BEGDT=""
+7 IF '$DATA(ENDDT)
NEW END
SET ENDDT=""
+8 IF '$DATA(STATUS)
NEW STATUS
SET STATUS=""
+9 SET LN=0
+10 ;
+11 SET ORY=$NAME(^TMP("ORCS",$JOB))
KILL @ORY
+12 DO OER^GMRCSLM1(DFN,SERV,BEGDT,ENDDT,STATUS)
+13 SET ORI=0
FOR
SET ORI=$ORDER(^TMP("GMRCR",$JOB,"CS",ORI))
if 'ORI
QUIT
SET ORX=$GET(^(ORI,0))
Begin DoDot:1
+14 SET ID=$PIECE(ORX,U)
+15 SET DATE=$PIECE(ORX,U,2)
+16 SET STAT=$PIECE(ORX,U,3)
+17 SET PROC=$PIECE(ORX,U,5)
+18 IF PROC="Consult"
SET PROC=$$UP^XLFSTR($PIECE(ORX,U,4)_" "_PROC)
+19 SET LN=LN+1
+20 SET @ORY@(LN,0)=ID_U_DATE_U_PROC_U_STAT
End DoDot:1
+21 QUIT
+22 ;
RPT(ORY,DFN,ORID) ; -- retrieve report text
+1 ; RPC: ORWCS REPORT TEXT
+2 ; See RPC definition for details on input and output parameters
+3 ;
+4 SET ORY=$NAME(^TMP("GMRCR",$JOB,"DT"))
KILL @ORY
if +ORID=0
QUIT
+5 DO DT^GMRCSLM2(ORID)
+6 QUIT
+7 ;
TEST ; -- get a list of reports
+1 NEW ORY,ORI
+2 DO LIST(.ORY,16)
+3 SET ORI=0
FOR
SET ORI=$ORDER(@ORY@(ORI))
if 'ORI
QUIT
WRITE !,@ORY@(ORI,0)
+4 QUIT
TEST1 ; -- print a report
+1 NEW ORY,ORI
+2 DO RPT(.ORY,16,100)
+3 SET ORI=0
FOR
SET ORI=$ORDER(@ORY@(ORI))
if 'ORI
QUIT
WRITE !,@ORY@(ORI,0)
+4 QUIT
+5 ;