source: WorldVistAEHR/trunk/r/AUTOMATED_MED_INFO_EXCHANGE-DVBA-DVBC/DVBAB58.m@ 619

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

initial load of WorldVistAEHR

File size: 3.4 KB
Line 
1DVBAB58 ;ALB/SPH - CAPRI INSUFF EXAM TRACKING REPORT ;09/06/00
2 ;;2.7;AMIE;**35**;Apr 10, 1995
3 ;
4STRT(ZMSG,BEGDT,ENDDT,RPTTYPE) ;
5MAIN ;**Select Dte Rng & Rpt Type; call report routine
6 F Q:$D(DVBAOUT) DO
7 .;D HOME^%ZIS
8 .;S TVAR(1,0)="0,0,1,2:2,1^Insufficient 2507 Exam Report"
9 .;D WR^DVBAUTL4("TVAR")
10 .;K TVAR
11 .;S RPTTYPE=$$RPTTYPE^DVBCUTA1()
12 .S:((RPTTYPE'="D")&(RPTTYPE'="S")) DVBAOUT=""
13 .;W:'$D(DVBAOUT) !!
14 .;D:'$D(DVBAOUT) DATE^DVBCUTL4(.BEGDT,.ENDDT)
15 .I $D(ENDDT),(+ENDDT>0) DO
16 ..S ENDDT=ENDDT_".2359"
17 ..I RPTTYPE="S" DO
18 ...D DEVSEL
19 ...I POP D SUMKILL
20 ...I 'POP DO
21 ....I $D(IO("Q")) DO
22 .....N DVBAI
23 .....S ZTRTN="SUM^DVBCIRPT",ZTIO=ION
24 .....S ZTDESC="Summary Insufficient Exam Report"
25 .....F DVBAI="BEGDT","ENDDT" S ZTSAVE(DVBAI)=""
26 .....D ^%ZTLOAD
27 .....N TSK S TSK=$S($D(ZTSK)=0:"C",1:"Y")
28 .....I TSK="Y" W !!,"Summary Report Queued. Task number: ",ZTSK
29 .....K ZTSK D CONTMES^DVBCUTL4
30 .....D SUMKILL
31 ....I '$D(IO("Q")) D SUM
32 ...D ^%ZISC
33 ..I RPTTYPE="D" DO
34 ...D DETSEL^DVBCIRP1 ;**Select the Reasons and Exams to report
35 ...I '$D(DVBAQTSL) DO
36 ....D DEVSEL
37 ....I POP D KVARS^DVBCIRP1
38 ....I 'POP DO
39 .....I $D(IO("Q")) DO
40 ......N DVBAI
41 ......S ZTRTN="DETAIL^DVBCIRP1",ZTIO=ION
42 ......S ZTDESC="Detailed Insufficient Exam Report"
43 ......F DVBAI="BEGDT","ENDDT","DVBAARY(""REASON"",","^TMP($J,""XMTYPE""," S ZTSAVE(DVBAI)=""
44 ......D ^%ZTLOAD
45 ......N TSK S TSK=$S($D(ZTSK)=0:"C",1:"Y")
46 ......I TSK="Y" W !!,"Detail Report Queued. Task number: ",ZTSK
47 ......K ZTSK D CONTMES^DVBCUTL4
48 ......D KVARS^DVBCIRP1
49 .....I '$D(IO("Q")) W:IOST?1"C-".E @IOF D DETAIL^DVBCIRP1
50 ....D ^%ZISC
51 ...K DVBAQTSL
52 ..D CLEANUP
53 D KVARS
54 Q
55 ;
56KVARS ;** Kill the variables used in report
57 K DVBAOUT,ENDDT,BEGDT,DTOUT,DUOUT,RPTTYPE,DVBACAN,DVBASTAT
58 D CLEANUP
59 Q
60 ;
61CLEANUP ;** Kill the variables used by the device handler
62 K %ZIS,POP,%IS,IOP
63 Q
64 ;
65DEVSEL ;** Select the device to report to
66 S %ZIS="AEQ"
67 S %ZIS("A")="Output device: "
68 D ^%ZIS
69 Q
70 ;
71SUM ;** Set up reason counter array, count all 2507's received
72 U IO
73 S (DVBARQCT,DVBAINRQ,DVBAXMCT,DVBAINXM)=0
74 S DVBACAN("REQ")=0,DVBACAN("EXM")=0
75 S DVBAENDL=ENDDT
76 ;
77 ;** Initialize reason counter array
78 F DVBARIFN=0:0 S DVBARIFN=$O(^DVB(396.94,DVBARIFN)) Q:+DVBARIFN'>0 DO
79 .S DVBAINXM(DVBARIFN)=0
80 S DVBAINXM("NO REASON")=0
81 ;
82 ;** Count the total and insufficient number of exams and 2507 requests
83 S DVBADTLP=BEGDT-.0001
84 F S DVBADTLP=$O(^DVB(396.3,"ADP",DVBADTLP)) Q:(DVBADTLP=""!(DVBADTLP>ENDDT)) DO
85 .S DVBAPRIO=""
86 .F S DVBAPRIO=$O(^DVB(396.3,"ADP",DVBADTLP,DVBAPRIO)) Q:DVBAPRIO="" DO
87 ..S DVBADALP=""
88 ..F S DVBADALP=$O(^DVB(396.3,"ADP",DVBADTLP,DVBAPRIO,DVBADALP)) Q:DVBADALP="" DO
89 ...S DVBARQCT=DVBARQCT+1
90 ...K DVBAINSF
91 ...I DVBAPRIO="E" DO
92 ....S DVBAINRQ=DVBAINRQ+1
93 ....I $P(^DVB(396.3,DVBADALP,0),U,18)="RX" S DVBACAN("REQ")=DVBACAN("REQ")+1
94 ....S DVBAINSF=""
95 ...S DVBAXMDA=""
96 ...F S DVBAXMDA=$O(^DVB(396.4,"C",DVBADALP,DVBAXMDA)) Q:DVBAXMDA="" DO
97 ....S DVBAXMCT=DVBAXMCT+1
98 ....I $D(DVBAINSF) DO
99 .....S DVBAINXM=DVBAINXM+1
100 .....S DVBARIFN=$P(^DVB(396.4,DVBAXMDA,0),U,11),DVBASTAT=$P(^(0),U,4)
101 .....S:DVBARIFN="" DVBARIFN="NO REASON"
102 .....S DVBAINXM(DVBARIFN)=DVBAINXM(DVBARIFN)+1
103 .....I DVBASTAT="RX" S DVBACAN("EXM")=DVBACAN("EXM")+1
104 D SUMRPT^DVBCIRP1
105 S:$D(ZTQUEUED) ZTREQ="@"
106 D SUMKILL
107 D ^%ZISC
108 Q
109 ;
110SUMKILL ;** Kill the variables used in the summary report
111 K DVBADTLP,DVBAENDL,DVBARQCT,DVBAINRQ,DVBAXMCT,DVBAINXM
112 K DVBAPRIO,DVBADALP,DVBAXMDA,DVBAINSF,DVBARIFN
113 Q
Note: See TracBrowser for help on using the repository browser.