ORQQCN ; SLC/CLA/REV - Functions which return patient consult requests and results ; APR 30, 2024@15:56
;;3.0;ORDER ENTRY/RESULTS REPORTING;**10,85,620**;Dec 17, 1997;Build 2
LIST(ORY,ORPT,ORSDT,OREDT,ORSERV,ORSTATUS) ; return patient's consult requests between start date and stop date for the service and status indicated:
N I,J,SITE,SEQ,DIFF,ORSRV,ORLOC,GMRCOER
S J=1,SEQ="",GMRCOER=2
S:'$L($G(ORSDT)) ORSDT=""
S:'$L($G(OREDT)) OREDT=""
S:'$L($G(ORSERV))!(+$G(ORSERV)=0) ORSERV=""
S:'$L($G(ORSTATUS)) ORSTATUS="" ;ALL STATI
K ^TMP("GMRCR",$J)
S ORY=$NA(^TMP("ORQQCN",$J,"CS"))
I '$L($G(ORPT)) S ^TMP("ORQQCN",$J,"CS",1,0)="< ERROR DFN IS MISSING >" Q
D OER^GMRCSLM1(ORPT,ORSERV,ORSDT,OREDT,ORSTATUS,GMRCOER)
M @ORY=^TMP("GMRCR",$J,"CS")
K @ORY@("AD")
K @ORY@(0)
K ^TMP("GMRCR",$J)
Q
DETAIL(ORQY,CONSULT) ; return formatted consult request details (plus result note if available):
N GMRCOER
S GMRCOER=2
S ORQY=$NA(^TMP("GMRCR",$J,"DT"))
D DT^GMRCSLM2(CONSULT)
Q
;
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HORQQCN 1013 printed Dec 13, 2024@02:33:33 Page 2
ORQQCN ; SLC/CLA/REV - Functions which return patient consult requests and results ; APR 30, 2024@15:56
+1 ;;3.0;ORDER ENTRY/RESULTS REPORTING;**10,85,620**;Dec 17, 1997;Build 2
LIST(ORY,ORPT,ORSDT,OREDT,ORSERV,ORSTATUS) ; return patient's consult requests between start date and stop date for the service and status indicated:
+1 NEW I,J,SITE,SEQ,DIFF,ORSRV,ORLOC,GMRCOER
+2 SET J=1
SET SEQ=""
SET GMRCOER=2
+3 if '$LENGTH($GET(ORSDT))
SET ORSDT=""
+4 if '$LENGTH($GET(OREDT))
SET OREDT=""
+5 if '$LENGTH($GET(ORSERV))!(+$GET(ORSERV)=0)
SET ORSERV=""
+6 ;ALL STATI
if '$LENGTH($GET(ORSTATUS))
SET ORSTATUS=""
+7 KILL ^TMP("GMRCR",$JOB)
+8 SET ORY=$NAME(^TMP("ORQQCN",$JOB,"CS"))
+9 IF '$LENGTH($GET(ORPT))
SET ^TMP("ORQQCN",$JOB,"CS",1,0)="< ERROR DFN IS MISSING >"
QUIT
+10 DO OER^GMRCSLM1(ORPT,ORSERV,ORSDT,OREDT,ORSTATUS,GMRCOER)
+11 MERGE @ORY=^TMP("GMRCR",$JOB,"CS")
+12 KILL @ORY@("AD")
+13 KILL @ORY@(0)
+14 KILL ^TMP("GMRCR",$JOB)
+15 QUIT
DETAIL(ORQY,CONSULT) ; return formatted consult request details (plus result note if available):
+1 NEW GMRCOER
+2 SET GMRCOER=2
+3 SET ORQY=$NAME(^TMP("GMRCR",$JOB,"DT"))
+4 DO DT^GMRCSLM2(CONSULT)
+5 QUIT
+6 ;