ORPRS12 ; slc/dcm - Interactive Chart Sum by loc, pat or chris ;6/10/97 15:50
;;3.0;ORDER ENTRY/RESULTS REPORTING;**11**;Dec 17, 1997
MAIN ;Controls the uncontrolable
N DIC,VAROOT,XQORSPEW,X,Y
D:$D(ORSCPAT)'>9 P^ORPRS01
I '$O(ORSCPAT(0)) Q
I $S(+$G(DIROUT):1,+$G(OREND):1,+$G(DUOUT):1,1:0) S OREND=+$G(DUOUT) Q
D P
Q
P ; Get Patient, Generate Summary
N DFN,ORATTEND,OREARLY,OREND,ORH,ORH2,ORLATE,ORSSTOP,ORSSTRT,Y,ZTRTN,ZTDESC
S OREND=0
D RANGE^ORPRS01()
Q:OREND
S OREARLY=9999999-ORSSTRT,ORLATE=9999999-ORSSTOP
D QUE^ORUTL1("PQ^ORPRS12","Chart Copy Summary")
Q
PQ ; Queued subroutine for print chart copies by patient
N ORDLRJ,ORI,DFN
S ORDLRJ=$J
S ORI=0 F S ORI=$O(ORSCPAT(ORI)) Q:ORI'>0!+$G(OREND) S DFN=+$G(ORSCPAT(ORI)) D PATIENT^ORPRS06(DFN,OREARLY,ORLATE,IO)
Q
L ;Print for locations stored in ^TMP("OR",loc,"FCE"..., Built by ORLA* routine
N DFN,ORATTEND,ORDLRJ,OREARLY,OREND,ORH,ORH2,ORI,ORLATE,ORSSTOP,ORSSTRT,X,Y,ZTDESC,ZTRTN
S ORDLRJ=$J,OREND=0
D RANGE^ORPRS01()
Q:OREND
S OREARLY=9999999-ORSSTRT,ORLATE=9999999-ORSSTOP
D QUE^ORUTL1("LQ^ORPRS12","Chart Copy Summary by Location")
Q
LQ ; Queued subroutine to print by location
N ORI,ORSSC,ORLOC
S ORI=0 F S ORI=$O(^TMP("OR",ORDLRJ,"FCE",ORI)) Q:ORI'>0 D
. S ORSSC=+^TMP("OR",ORDLRJ,"FCE",ORI)
. S ORLOC=$S(+$G(^SC(+ORSSC,42)):$P($G(^DIC(42,+$G(^SC(+ORSSC,42)),0)),U),1:$P(^TMP("OR",ORDLRJ,"FCE",ORI),U,2)_"^"_1)
. D @$S($L(ORLOC,U)=2:"CLINIC^ORPRS06",1:"WARD^ORPRS06")
K ^TMP("OR",ORDLRJ,"FCE")
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HORPRS12 1533 printed Dec 13, 2024@02:32:59 Page 2
ORPRS12 ; slc/dcm - Interactive Chart Sum by loc, pat or chris ;6/10/97 15:50
+1 ;;3.0;ORDER ENTRY/RESULTS REPORTING;**11**;Dec 17, 1997
MAIN ;Controls the uncontrolable
+1 NEW DIC,VAROOT,XQORSPEW,X,Y
+2 if $DATA(ORSCPAT)'>9
DO P^ORPRS01
+3 IF '$ORDER(ORSCPAT(0))
QUIT
+4 IF $SELECT(+$GET(DIROUT):1,+$GET(OREND):1,+$GET(DUOUT):1,1:0)
SET OREND=+$GET(DUOUT)
QUIT
+5 DO P
+6 QUIT
P ; Get Patient, Generate Summary
+1 NEW DFN,ORATTEND,OREARLY,OREND,ORH,ORH2,ORLATE,ORSSTOP,ORSSTRT,Y,ZTRTN,ZTDESC
+2 SET OREND=0
+3 DO RANGE^ORPRS01()
+4 if OREND
QUIT
+5 SET OREARLY=9999999-ORSSTRT
SET ORLATE=9999999-ORSSTOP
+6 DO QUE^ORUTL1("PQ^ORPRS12","Chart Copy Summary")
+7 QUIT
PQ ; Queued subroutine for print chart copies by patient
+1 NEW ORDLRJ,ORI,DFN
+2 SET ORDLRJ=$JOB
+3 SET ORI=0
FOR
SET ORI=$ORDER(ORSCPAT(ORI))
if ORI'>0!+$GET(OREND)
QUIT
SET DFN=+$GET(ORSCPAT(ORI))
DO PATIENT^ORPRS06(DFN,OREARLY,ORLATE,IO)
+4 QUIT
L ;Print for locations stored in ^TMP("OR",loc,"FCE"..., Built by ORLA* routine
+1 NEW DFN,ORATTEND,ORDLRJ,OREARLY,OREND,ORH,ORH2,ORI,ORLATE,ORSSTOP,ORSSTRT,X,Y,ZTDESC,ZTRTN
+2 SET ORDLRJ=$JOB
SET OREND=0
+3 DO RANGE^ORPRS01()
+4 if OREND
QUIT
+5 SET OREARLY=9999999-ORSSTRT
SET ORLATE=9999999-ORSSTOP
+6 DO QUE^ORUTL1("LQ^ORPRS12","Chart Copy Summary by Location")
+7 QUIT
LQ ; Queued subroutine to print by location
+1 NEW ORI,ORSSC,ORLOC
+2 SET ORI=0
FOR
SET ORI=$ORDER(^TMP("OR",ORDLRJ,"FCE",ORI))
if ORI'>0
QUIT
Begin DoDot:1
+3 SET ORSSC=+^TMP("OR",ORDLRJ,"FCE",ORI)
+4 SET ORLOC=$SELECT(+$GET(^SC(+ORSSC,42)):$PIECE($GET(^DIC(42,+$GET(^SC(+ORSSC,42)),0)),U),1:$PIECE(^TMP("OR",ORDLRJ,"FCE",ORI),U,2)_"^"_1)
+5 DO @$SELECT($LENGTH(ORLOC,U)=2:"CLINIC^ORPRS06",1:"WARD^ORPRS06")
End DoDot:1
+6 KILL ^TMP("OR",ORDLRJ,"FCE")
+7 QUIT