Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: ORPRS02

ORPRS02.m

Go to the documentation of this file.
ORPRS02 ; slc/dcm - Jurasic Prints ;11/18/96  20:20
 ;;3.0;ORDER ENTRY/RESULTS REPORTING;**11,69,99,121,189**;Dec 17, 1997
DAY ; Process 24-hr Order Summary
 N I,ORATTEND,ORTIT,ORPRES,ORSHORT,ORDG,ORGRP,ORSEL,ORSEQ
 S OREND=0,ORTIT="DAILY ORDER SUMMARY",ORPRES=1,ORSHORT=$$SHORT
 S ORDG=1,ORGRP("NAM")="ALL",ORGRP("ROOT")=1
 D WRT
 Q
RANGE ; Order Summary for Date/time Range
 N I,ORATTEND,ORTIT,ORPRES,ORSHORT,ORDG,ORGRP,ORSEL,ORSEQ
 S OREND=0,ORTIT="ORDER SUMMARY",ORPRES=1,ORSHORT=$$SHORT
 S ORDG=1,ORGRP("NAM")="ALL",ORGRP("ROOT")=1
 D WRT
 Q
CUSTOM ; Customized Order Summary
 N I,ORATTEND,ORTIT,ORSHORT,ORGRP,ORSEL,ORSEQ
 S OREND=0,ORSHORT=$$SHORT
 S ORGRP("NAM")=^ORD(100.98,ORDG,0),ORGRP("ROOT")=ORBUF,ORGRP("NAM")=$S($L($P(ORGRP("NAM"),"^",3)):$P(ORGRP("NAM"),"^",3),1:$E($P(ORGRP("NAM"),"^"),1,5))
 S ORTIT=$P(ORPRES,";",2)_" for "_ORGRP("NAM")_" SERVICES"
 D WRT
 Q
CHART ; Set up call to print chart copy for patient
 N OREND,OREARLY,ORLATE,DFN
 S OREARLY=+$G(ORSSTRT),ORLATE=+$G(ORSSTOP)
 S DFN=+ORVP D PATIENT^ORPRS06(DFN,OREARLY,ORLATE,IO,21,+$G(ORL))
 Q
WORK ;Set up call for Work Copy patient summary
 N OREND,OREARLY,ORLATE,DFN
 S OREARLY=+$G(ORSSTRT),ORLATE=+$G(ORSSTOP)
 S DFN=+ORVP D WORK^ORPRS06(DFN,OREARLY,ORLATE,IO)
 Q
CONT ; Print Report
 N ZTRTN,ZTDESC
 S ZTRTN="WRT^ORPRS02",ZTDESC=ORTIT
 D @ZTRTN
 Q
WRT ;Entry point for Batch Processing 
 ;Setup display group list, patient list, and process reports  
 N %,%H,%I,DFN,DX,DY,I,II,J,K,ODATE,ORAGE,ORDAD,ORDOB,ORFLAG,ORI,ORIFN
 N ORL,ORLIST,ORLST,ORMD,ORNP,ORODT,ORPD,ORPNM,ORPV,ORREQ,ORSEX
 N ORSSN,ORSTOP,ORSTRT,ORSTS,ORASTS,ORTERM,ORTM,ORTS,ORTX,ORUSER,ORWARD
 N ORSLTR,ORAW,VA,VAROOT,X,X0,X1,X3,Y,Z
 S ORAW=$S(+$$GET^XPAR("SYS","OR ORDER SUMMARY CONTEXT",1,"I"):"AW",1:"")
 U IO
 D EN^ORQ1(ORVP,ORDG,+ORPRES,0,+ORSSTRT,+ORSSTOP,0,1,ORAW,1)
 N ORPI,ORPA,ORPN,X,ORPIFN
 S ORPI=0 F  S ORPI=$O(^TMP("ORR",$J,ORLIST,ORPI)) Q:'ORPI  D
 . S ORPIFN=+^TMP("ORR",$J,ORLIST,ORPI),ORPA=$P(^(ORPI),";",2)
 . I $D(^OR(100,ORPIFN,8,ORPA,0)) S X=^(0),ORPN=$P(X,"^",12)
 . I $G(ORPN),$D(^ORD(100.02,ORPN,1)),'$P(^(1),"^",3) K ^TMP("ORR",$J,ORLIST,ORPI)
 I $$GET^XPAR("ALL","ORPF SUMMARY SORT FORWARD",1,"I") D SORT
 D @$S(ORSHORT:"EN^ORPRS04",1:"EN^ORPRS03")
 K ^TMP("ORR",$J,ORLIST)
 I $D(ZTQUEUED) S ZTREQ="@"
 Q
SHORT() ; Check whether user prefers condensed or expanded printout
 Q +$$GET^XPAR("ALL","ORPF CONDENSED ORDER SUMMARY",1,"I")
 ;
SORT ;Re sort ^TMP("ORR",$J in inverse order
 Q:'$D(^TMP("ORR",$J,ORLIST))
 K ^TMP("ORRF",$J)
 N I,C
 S C=0,I=9999999
 F  S I=$O(^TMP("ORR",$J,ORLIST,I),-1) Q:I<1  S C=C+1,^TMP("ORRF",$J,C)=^(I)
 K ^TMP("ORR",$J,ORLIST)
 M ^TMP("ORR",$J,ORLIST)=^TMP("ORRF",$J)
 K ^TMP("ORRF",$J)
 Q