source: FOIAVistA/trunk/r/ORDER_ENTRY_RESULTS_REPORTING-OR-OCX--ORRC--ORRJ/ORPRS02.m@ 1397

Last change on this file since 1397 was 628, checked in by George Lilly, 15 years ago

initial load of FOIAVistA 6/30/08 version

File size: 2.6 KB
Line 
1ORPRS02 ; slc/dcm - Jurasic Prints ;11/18/96 20:20
2 ;;3.0;ORDER ENTRY/RESULTS REPORTING;**11,69,99,121,189**;Dec 17, 1997
3DAY ; Process 24-hr Order Summary
4 N I,ORATTEND,ORTIT,ORPRES,ORSHORT,ORDG,ORGRP,ORSEL,ORSEQ
5 S OREND=0,ORTIT="DAILY ORDER SUMMARY",ORPRES=1,ORSHORT=$$SHORT
6 S ORDG=1,ORGRP("NAM")="ALL",ORGRP("ROOT")=1
7 D WRT
8 Q
9RANGE ; Order Summary for Date/time Range
10 N I,ORATTEND,ORTIT,ORPRES,ORSHORT,ORDG,ORGRP,ORSEL,ORSEQ
11 S OREND=0,ORTIT="ORDER SUMMARY",ORPRES=1,ORSHORT=$$SHORT
12 S ORDG=1,ORGRP("NAM")="ALL",ORGRP("ROOT")=1
13 D WRT
14 Q
15CUSTOM ; Customized Order Summary
16 N I,ORATTEND,ORTIT,ORSHORT,ORGRP,ORSEL,ORSEQ
17 S OREND=0,ORSHORT=$$SHORT
18 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))
19 S ORTIT=$P(ORPRES,";",2)_" for "_ORGRP("NAM")_" SERVICES"
20 D WRT
21 Q
22CHART ; Set up call to print chart copy for patient
23 N OREND,OREARLY,ORLATE,DFN
24 S OREARLY=+$G(ORSSTRT),ORLATE=+$G(ORSSTOP)
25 S DFN=+ORVP D PATIENT^ORPRS06(DFN,OREARLY,ORLATE,IO,21,+$G(ORL))
26 Q
27WORK ;Set up call for Work Copy patient summary
28 N OREND,OREARLY,ORLATE,DFN
29 S OREARLY=+$G(ORSSTRT),ORLATE=+$G(ORSSTOP)
30 S DFN=+ORVP D WORK^ORPRS06(DFN,OREARLY,ORLATE,IO)
31 Q
32CONT ; Print Report
33 N ZTRTN,ZTDESC
34 S ZTRTN="WRT^ORPRS02",ZTDESC=ORTIT
35 D @ZTRTN
36 Q
37WRT ;Entry point for Batch Processing
38 ;Setup display group list, patient list, and process reports
39 N %,%H,%I,DFN,DX,DY,I,II,J,K,ODATE,ORAGE,ORDAD,ORDOB,ORFLAG,ORI,ORIFN
40 N ORL,ORLIST,ORLST,ORMD,ORNP,ORODT,ORPD,ORPNM,ORPV,ORREQ,ORSEX
41 N ORSSN,ORSTOP,ORSTRT,ORSTS,ORASTS,ORTERM,ORTM,ORTS,ORTX,ORUSER,ORWARD
42 N ORSLTR,ORAW,VA,VAROOT,X,X0,X1,X3,Y,Z
43 S ORAW=$S(+$$GET^XPAR("SYS","OR ORDER SUMMARY CONTEXT",1,"I"):"AW",1:"")
44 U IO
45 D EN^ORQ1(ORVP,ORDG,+ORPRES,0,+ORSSTRT,+ORSSTOP,0,1,ORAW,1)
46 N ORPI,ORPA,ORPN,X,ORPIFN
47 S ORPI=0 F S ORPI=$O(^TMP("ORR",$J,ORLIST,ORPI)) Q:'ORPI D
48 . S ORPIFN=+^TMP("ORR",$J,ORLIST,ORPI),ORPA=$P(^(ORPI),";",2)
49 . I $D(^OR(100,ORPIFN,8,ORPA,0)) S X=^(0),ORPN=$P(X,"^",12)
50 . I $G(ORPN),$D(^ORD(100.02,ORPN,1)),'$P(^(1),"^",3) K ^TMP("ORR",$J,ORLIST,ORPI)
51 I $$GET^XPAR("ALL","ORPF SUMMARY SORT FORWARD",1,"I") D SORT
52 D @$S(ORSHORT:"EN^ORPRS04",1:"EN^ORPRS03")
53 K ^TMP("ORR",$J,ORLIST)
54 I $D(ZTQUEUED) S ZTREQ="@"
55 Q
56SHORT() ; Check whether user prefers condensed or expanded printout
57 Q +$$GET^XPAR("ALL","ORPF CONDENSED ORDER SUMMARY",1,"I")
58 ;
59SORT ;Re sort ^TMP("ORR",$J in inverse order
60 Q:'$D(^TMP("ORR",$J,ORLIST))
61 K ^TMP("ORRF",$J)
62 N I,C
63 S C=0,I=9999999
64 F S I=$O(^TMP("ORR",$J,ORLIST,I),-1) Q:I<1 S C=C+1,^TMP("ORRF",$J,C)=^(I)
65 K ^TMP("ORR",$J,ORLIST)
66 M ^TMP("ORR",$J,ORLIST)=^TMP("ORRF",$J)
67 K ^TMP("ORRF",$J)
68 Q
Note: See TracBrowser for help on using the repository browser.