source: WorldVistAEHR/trunk/r/ORDER_ENTRY_RESULTS_REPORTING-OR-OCX--ORRC--ORRJ/ORPRS07.m@ 1087

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

revised back to 6/30/08 version

File size: 2.6 KB
RevLine 
[623]1ORPRS07 ; slc/dcm - Managing multiple reportz ;6/10/97 15:43
2 ;;3.0;ORDER ENTRY/RESULTS REPORTING;;Dec 17, 1997
3EN ;Entry point
4 N ORVP
5 D MAIN("")
6 Q
7MAIN(ORVP) ; Controls branching
8 N DFN,DIC,GMTYP,I,ORANSI,ORDG,OREND,ORH,ORH2,ORPRES,ORSCPAT,ORSDG
9 N ORSHORT,ORSRI,ORSRPT,ORSSTOP,ORSSTRT,ORTIT,ORWHL,VAROOT,XQORSPEW,X,Y
10 N ORAGE,ORATTEND,ORDOB,ORL,ORNP,ORPD,ORPNM,ORPV,ORSEX,ORSSN,ORTS,ORWARD
11 N ORSDG,ORURMBD,ORX,ORCONT,OROPREF
12 I '+$G(ORVP) D P^ORPRS01 Q:$D(ORSCPAT)'>9
13 S ORANSI=0,XQORFLG("SH")=1
14 S (ORANSI,OREND,X)=0
15 I +$G(ORSCPAT)=1,+$G(ORSCPAT(1)) S ORVP=+$G(ORSCPAT(1))_";DPT(",Y=+ORVP D HOMO^ORUDPA
16 S DIC=101 S X="ORS REPORT MENU" D EN^XQOR
17 K VA200,VAERR,VAIN,VADM
18 Q
19EXIT ; Queue output
20 N DUOUT,ORSRI,ORSRPT,ZTDESC,ZTRTN,ZTSAVE S OREND=+$G(OREND)
21 S ORSRI=0 F S ORSRI=$O(Y(ORSRI)) Q:ORSRI'>0 S ORSRPT=ORSRI,ORSRPT(ORSRI)=Y(ORSRI)
22 I $S($D(XQORPOP):1,$G(OREND)=1:1,$D(DUOUT):1,$D(DIROUT):1,'$D(ORSRPT):1,'$D(ORSCPAT)&'+$G(ORVP):1,1:0) Q
23 S (ZTSAVE("OR*"),ZTSAVE("GM*"),ZTSAVE("LR*"))="",IO("Q")=1
24 S ZTRTN="OUTPUT^ORPRS07",ZTDESC="Results Reporting" W ! D DEVICE
25 Q
26OUTPUT ; Loops through ORSRPT( and queues each report
27 N DIROUT,DIRUT,ORH,ORH2,ORMETHOD,ORSEND,ORSHORT,ORSI,ORSJ,ORSRI,ORTIT,ORWHL,X
28 N XQORNOD,XQORSPEW,XY,ORSLTR,ORSPNM,ORDG,ORION S ORION=$G(ION)
29 I +$G(ORVP) D REPORT(ORVP) K OROLOC,ORSSTOP,ORSSTRT,VAROOT,VA,X1 Q
30 S ORSI=0 F S ORSI=$O(ORSCPAT(ORSI)) Q:ORSI'>0!($G(DIROUT))!($$S^%ZTLOAD) S:'$O(ORSCPAT(ORSI)) ORSEND=1 D
31 . S ORVP=+ORSCPAT(ORSI)_";DPT(",ORSPNM=$P(ORSCPAT(ORSI),U,2)
32 . D REPORT(ORVP)
33 K ORNO,ORSPG
34 Q
35REPORT(ORVP) ; Loops through ORSRPT( and prints all reports for ea patient
36 N ORSJ,ORSSTFLG,XQORNOD
37 U IO
38 S ORSJ=0 F S ORSJ=$O(ORSRPT(ORSJ)) Q:ORSJ'>0!+$G(DIROUT)!$G(OREND) D
39 . S XQORNOD=$P(ORSRPT(ORSJ),U,2),ORMETHOD=$G(^ORD(101,+XQORNOD,101.05,20,1))
40 . I $D(ORSSTRT)>9,+XQORNOD S ORSSTRT=+$G(ORSSTRT(XQORNOD)),ORH=$P($G(ORSSTRT(XQORNOD)),U,2)
41 . I $D(ORSSTOP)>9,+XQORNOD S ORSSTOP=+$G(ORSSTOP(XQORNOD)),ORH2=$P($G(ORSSTOP(XQORNOD)),U,2)
42 . I $D(ORSDG(+XQORNOD)) S ORDG=$G(ORSDG(+XQORNOD))
43 . I $L(ORMETHOD) X ORMETHOD I $G(ION)'=ORION S IOP=ORION D ^%ZIS
44 . I +$G(ORSSTFLG) D STOP^ORPRS01 S ORSSTFLG=0
45 Q
46DEVICE ; Device Handling/Output control
47 N IO,IOP,%ZIS
48 S %ZIS="Q",%ZIS("B")="HOME" D ^%ZIS Q:POP
49 I +$G(ORSRPT)>1,(IO'=IO(0)),'$D(IO("Q")) W !,"Printing of multiple reports requires queueing.",!
50 D @$S(+$G(ORSRPT)>1&(IO'=IO(0)):"QUE",$D(IO("Q")):"QUE",1:"NOQUE")
51 Q
52QUE ; Set ZT parameters and tasks ZTRTN
53 N ZTIO K IO("Q")
54 S ZTIO=ION
55 D ^%ZTLOAD W !,$S($D(ZTSK):"Request Queued!",1:"Request Cancelled!")
56 K ZTSK,ZTDESC,ZTDTH,ZTIO,ZTRTN,ZTSAVE D ^%ZISC
57 Q
58NOQUE ; Calls ZTRTN in interactive mode
59 I IO'=IO(0) U IO
60 D @ZTRTN
61 D ^%ZISC
62 Q
Note: See TracBrowser for help on using the repository browser.