source: WorldVistAEHR/trunk/r/ORDER_ENTRY_RESULTS_REPORTING-OR-OCX--ORRC--ORRJ/ORS100B.m@ 846

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

initial load of WorldVistAEHR

File size: 6.2 KB
Line 
1ORS100B ;SLC/RAF - Continuation of ORS100A ;10/19/00 13:36
2 ;;3.0;ORDER ENTRY/RESULTS REPORTING;**50**;Dec 17, 1997
3 ;
4WHO ;loops thru the TMP global for output sort by entering person
5 I SORT=5&('$D(LONER)) D
6 .I TYPE=1 S HDR="!!?30,""List of RELEASED but UNSIGNED orders by ENTERING PERSON"""
7 .I TYPE=2 S HDR="!!?40,""List of UNSIGNED orders by ENTERING PERSON"""
8 .I TYPE=3 S HDR="!!?30,""List of UNSIGNED/UNRELEASED orders by ENTERING PERSON"""
9 .S HDR1="!!,""ENTERED BY"",?25,""PROVIDER"",?50,""PATIENT"",?75,""SSN"",?81,""STATUS"",?95,""ORDER #"",?110,""ORDER DATE"""
10 .S PAGE=0 D HDR^ORS100
11 .I '$D(^TMP("ORUNS",$J)) W !,"No unsigned orders found" Q
12 .S WHO="" F S WHO=$O(^TMP("ORUNS",$J,WHO)) Q:WHO=""!STOP D
13 ..S PNM="" F S PNM=$O(^TMP("ORUNS",$J,WHO,PNM)) S CNT=0 Q:PNM=""!STOP D
14 ...S IEN=0 F S IEN=$O(^TMP("ORUNS",$J,WHO,PNM,IEN)) S CNT=CNT+1 Q:'IEN!STOP D
15 ....I 'SUMONLY W $P(^(IEN),U),?25,$P(^(IEN),U,2),?50,$P(^(IEN),U,3),?75,$P(^(IEN),U,4),?81,$P(^(IEN),U,5),?95,$P(^(IEN),U,6),?110,$P(^(IEN),U,7),! D:$Y>(IOSL-4) HDR^ORS100 Q:STOP
16 ....S ^TMP("ORSTATS",$J,WHO,PNM)=CNT
17SWHO ;sorts for a single provider/entering person
18 I SORT=5&($D(LONER)) S LONER="",PAGE=0 F S LONER=$O(LONER(LONER)) Q:LONER=""!STOP D
19 .I TYPE=1 S HDR="!!?30,""List of RELEASED but UNSIGNED orders for "",LONER"
20 .I TYPE=2 S HDR="!!?30,""List of UNSIGNED orders for "",LONER"
21 .I TYPE=3 S HDR="!!?30,""List of UNSIGNED/UNRELEASED orders for "",LONER"
22 .S HDR1="!!,""ENTERED BY"",?25,""PROVIDER"",?50,""PATIENT"",?75,""SSN"",?81,""STATUS"",?95,""ORDER #"",?110,""ORDER DATE"""
23 .D HDR^ORS100
24 .S WHO=LONER I $D(^TMP("ORUNS",$J,WHO)) D
25 ..S PNM="" F S PNM=$O(^TMP("ORUNS",$J,WHO,PNM)) S CNT=0 Q:PNM=""!STOP D
26 ...S IEN=0 F S IEN=$O(^TMP("ORUNS",$J,WHO,PNM,IEN)) S CNT=CNT+1 Q:'IEN!STOP D
27 ....I 'SUMONLY W $P(^(IEN),U),?25,$P(^(IEN),U,2),?50,$P(^(IEN),U,3),?75,$P(^(IEN),U,4),?81,$P(^(IEN),U,5),?95,$P(^(IEN),U,6),?110,$P(^(IEN),U,7),! D:$Y>(IOSL-4) HDR^ORS100 Q:STOP
28 ....S ^TMP("ORSTATS",$J,WHO,PNM)=CNT
29 .I '$D(^TMP("ORUNS",$J,WHO)) W !!,"No unsigned orders found for "_LONER
30DIV ;loops thru the TMP global for output sort by division
31 I SORT=6&('$D(LONER)) D
32 .I TYPE=1 S HDR="!!?30,""List of RELEASED but UNSIGNED orders by DIVISION"""
33 .I TYPE=2 S HDR="!!?30,""List of UNSIGNED orders by DIVISION"""
34 .I TYPE=3 S HDR="!!?30,""List of UNSIGNED/UNRELEASED orders by DIVISION"""
35 .S HDR1="!!?15,""ENTERED BY"",?40,""PATIENT"",?65,""SSN"",?71,""STATUS"",?88,""ORDER #"",?100,""ORDER DATE"""
36 .S PAGE=0 D HDR^ORS100
37 .I '$D(^TMP("ORUNS",$J)) W !,"No unsigned orders found" Q
38 .S DIV="" F S DIV=$O(^TMP("ORUNS",$J,DIV)) Q:DIV=""!STOP W:'SUMONLY "Division: ",DIV D
39 ..S LOC="" F S LOC=$O(^TMP("ORUNS",$J,DIV,LOC)) Q:LOC=""!STOP W:'SUMONLY !?5,"Location: ",LOC D
40 ...S PROV="" F S PROV=$O(^TMP("ORUNS",$J,DIV,LOC,PROV)) Q:PROV=""!STOP W:'SUMONLY !?10,"Provider: ",PROV,! S CNT=0 D
41 ....S IEN=0 F S IEN=$O(^TMP("ORUNS",$J,DIV,LOC,PROV,IEN)) S CNT=CNT+1 Q:'IEN!STOP D
42 .....W:'SUMONLY ?15,$S(PROV'=$P(^TMP("ORUNS",$J,DIV,LOC,PROV,IEN),U,4):$P(^(IEN),U,4),1:""),?40,$P(^(IEN),U,5),?65,$P(^(IEN),U,6),?71,$P(^(IEN),U,7),?88,$P(^(IEN),U,8),?100,$P(^(IEN),U,9),! D:$Y>(IOSL-4) HDR^ORS100 Q:STOP
43 .....S ^TMP("ORSTATS",$J,DIV,LOC,PROV)=CNT
44SDIV ;sorts for a single division
45 I SORT=6&($D(LONER)) S LONER="",PAGE=0 F S LONER=$O(LONER(LONER)) Q:LONER=""!STOP D
46 .I TYPE=1 S HDR="!!?30,""List of RELEASED but UNSIGNED orders for "",LONER"
47 .I TYPE=2 S HDR="!!?30,""List of UNSIGNED orders for "",LONER"
48 .I TYPE=3 S HDR="!!?30,""List of UNSIGNED/UNRELEASED orders for "",LONER"
49 .S HDR1="!!,""PROVIDER"",?25,""ENTERED BY"",?50,""PATIENT"",?75,""SSN"",?80,""STATUS"",?95,""ORDER #"",?110,""ORDER DATE"""
50 .D HDR^ORS100
51 .S DIV=LONER I $D(^TMP("ORUNS",$J,DIV)) D
52 ..S LOC="" F S LOC=$O(^TMP("ORUNS",$J,DIV,LOC)) Q:LOC=""!STOP W:'SUMONLY ?5,"Location: ",LOC,! D W:'SUMONLY !
53 ...S PROV="" F S PROV=$O(^TMP("ORUNS",$J,DIV,LOC,PROV)) S CNT=0 Q:PROV=""!STOP D
54 ....S IEN="" F S IEN=$O(^TMP("ORUNS",$J,DIV,LOC,PROV,IEN)) S CNT=CNT+1 Q:'IEN!STOP D
55 .....W:'SUMONLY $P(^(IEN),U,3),?25,$P(^(IEN),U,4),?50,$P(^(IEN),U,5),?75,$P(^(IEN),U,6),?80,$P(^(IEN),U,7),?95,$P(^(IEN),U,8),?110,$P(^(IEN),U,9),! D:$Y>(IOSL-4) HDR^ORS100 Q:STOP
56 .....S ^TMP("ORSTATS",$J,DIV,LOC,PROV)=CNT
57 .I '$D(^TMP("ORUNS",$J,DIV)) W !!,"No unsigned orders found for "_LONER
58SERV ;loops thru the TMP global for output sort by service
59 I SORT=1&('$D(LONER)) D
60 .I TYPE=1 S HDR="!!?30,""List of RELEASED but UNSIGNED orders by SERVICE/SECTION"""
61 .I TYPE=2 S HDR="!!?30,""List of UNSIGNED orders by SERVICE/SECTION"""
62 .I TYPE=3 S HDR="!!?30,""List of UNSIGNED/UNRELEASED orders by SERVICE/SECTION"""
63 .S HDR1="!!,""PROVIDER"",?25,""ENTERED BY"",?50,""PATIENT"",?75,""SSN"",?81,""STATUS"",?95,""ORDER #"",?110,""ORDER DATE"""
64 .S PAGE=0 D HDR^ORS100
65 .I '$D(^TMP("ORUNS",$J)) W !,"No unsigned orders found" Q
66 .S SER="" F S SER=$O(^TMP("ORUNS",$J,SER)) Q:SER=""!STOP W:'SUMONLY "Service/Section: ",SER,! D W:'SUMONLY !
67 ..S PROV="" F S PROV=$O(^TMP("ORUNS",$J,SER,PROV)) S CNT=0 Q:PROV=""!STOP D
68 ...S IEN=0 F S IEN=$O(^TMP("ORUNS",$J,SER,PROV,IEN)) S CNT=CNT+1 Q:'IEN!STOP D
69 ....W:'SUMONLY $P(^TMP("ORUNS",$J,SER,PROV,IEN),U,2),?25,$P(^(IEN),U,3),?50,$P(^(IEN),U,4),?75,$P(^(IEN),U,5),?81,$P(^(IEN),U,6),?95,$P(^(IEN),U,7),?110,$P(^(IEN),U,8),! D:$Y>(IOSL-4) HDR^ORS100 Q:STOP
70 ....S ^TMP("ORSTATS",$J,SER,PROV)=CNT
71SSERV ;sorts for a single service/section
72 I SORT=1&($D(LONER)) S LONER="",PAGE=0 F S LONER=$O(LONER(LONER)) Q:LONER=""!STOP D
73 .I TYPE=1 S HDR="!!?30,""List of RELEASED but UNSIGNED orders for "",LONER"
74 .I TYPE=2 S HDR="!!?30,""List of UNSIGNED orders for "",LONER"
75 .I TYPE=3 S HDR="!!?30,""List of UNSIGNED/UNRELEASED orders for "",LONER"
76 .S HDR1="!!,""PROVIDER"",?25,""ENTERED BY"",?50,""PATIENT"",?75,""SSN"",?81,""STATUS"",?95,""ORDER #"",?110,""ORDER DATE"""
77 .D HDR^ORS100
78 .S SER=LONER I $D(^TMP("ORUNS",$J,SER)) D
79 ..S PROV="" F S PROV=$O(^TMP("ORUNS",$J,SER,PROV)) S CNT=0 Q:PROV=""!STOP D
80 ...S IEN=0 F S IEN=$O(^TMP("ORUNS",$J,SER,PROV,IEN)) S CNT=CNT+1 Q:'IEN!STOP D
81 ....W:'SUMONLY $P(^(IEN),U,2),?25,$P(^(IEN),U,3),?50,$P(^(IEN),U,4),?75,$P(^(IEN),U,5),?81,$P(^(IEN),U,6),?95,$P(^(IEN),U,7),?110,$P(^(IEN),U,8),! D:$Y>(IOSL-4) HDR^ORS100 Q:STOP
82 ....S ^TMP("ORSTATS",$J,SER,PROV)=CNT
83 .I '$D(^TMP("ORUNS",$J,SER)) W !!,"No unsigned orders found for "_LONER
84 Q
Note: See TracBrowser for help on using the repository browser.