source: FOIAVistA/trunk/r/ORDER_ENTRY_RESULTS_REPORTING-OR-OCX--ORRC--ORRJ/ORCXPNDR.m@ 1613

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

initial load of FOIAVistA 6/30/08 version

File size: 5.6 KB
Line 
1ORCXPNDR ; SLC/MKB,dcm - Expanded display of Reports ;2/12/97 13:48
2 ;;3.0;ORDER ENTRY/RESULTS REPORTING;**25,85,215**;Dec 17, 1997
3EN ; -- build body of report
4 N TYPE S TYPE=$P($G(^TMP("OR",$J,ORTAB,"IDX",NUM)),U,4)
5 I '$L(TYPE)!(+TYPE) D XRAYS^ORCXPND1 Q ;TYPE=case# or null
6 I $L(TYPE),$E(TYPE,1,4)="MED~" D MED(TYPE) Q ;TYPE=MED~procedure ID
7 I $L($T(@TYPE)) D @TYPE
8 Q
9PREP ;
10 W !," ... hold on...building report..."
11 K ^TMP("ORDATA",$J)
12 Q
13DAYS(NUM) ;
14 ;NUM=# of days (default=7)
15 ;Returns -1 if user aborts, otherwise # of days entered.
16D1 N X
17 S:'$G(NUM) NUM=7
18 W !,"Enter # of days to look back: "_NUM_"// " R X:DTIME Q:$E(X)="^" -1
19 S:X="" X=NUM S:X?1"T-"1N.N X=$E(X,3,99)
20 I $E(X)="?"!(X'?1N.N) W !,"Enter the number of days to look back for data." G D1
21 Q X
22TIT(HDR) ;
23 ;HDR=name of header to display
24 S:'$D(HDR) HDR=""
25 D FULL^VALM1 S VALMBCK="R"
26 W !!,"For "_HDR
27 Q
28 ;
29GMTSS ; -- Health Summary
30 N DFN,Y,I,DIC,X,GMTYP
31 D TIT("Health Summary") Q:$$OS()
32 D SELTYP^ORPRS13 I '$G(GMTYP(1)) Q
33 D PREP
34 D RPT^ORWRP(.Y,ID,1,+GMTYP(1))
35 D ITEM^ORCXPND("Health Summary")
36 S I=1 F S I=$O(^TMP("ORDATA",$J,1,I)) Q:I<1 S LCNT=LCNT+1,^TMP("ORXPND",$J,LCNT,0)=^TMP("ORDATA",$J,1,I)
37 K ^TMP("ORDATA",$J)
38 Q
39 ;
40GMTSA ; -- Ad Hoc Health Summary
41 N DFN,Y,I,DIC,X,GMTSTYP,GMTSTITL,GMTSQIT
42 D TIT("Adhoc Health Summary") Q:$$OS()
43 S X="GMTS HS ADHOC",DIC=142,DIZ(0)="ZF" D ^DIC Q:Y'>0 S GMTSTYP=+Y
44 S GMTSTITL="AD HOC" D BUILD^GMTSADOR
45 Q:$D(GMTSQIT)
46 D PREP
47 D RPT^ORWRP(.Y,ID,15,GMTSTYP)
48 D ITEM^ORCXPND("Adhoc Health Summary")
49 S I=1 F S I=$O(^TMP("ORDATA",$J,1,I)) Q:I<1 S LCNT=LCNT+1,^TMP("ORXPND",$J,LCNT,0)=^TMP("ORDATA",$J,1,I)
50 K ^TMP("ORDATA",$J)
51 Q
52 ;
53GMRVC ; -- Vitals Cumulative Report
54 N DFN,Y,I,X,BCNT
55 D TIT("Vitals Cumulative Report") Q:$$OS()
56 S X=$$DAYS(7) Q:X=-1
57 D PREP
58 D RPT^ORWRP(.Y,ID,5,,X,"VITCUM")
59 D ITEM^ORCXPND("Vitals Cumulative Report")
60 S I=3,BCNT=0
61 F S I=$O(^TMP("ORDATA",$J,1,I)) Q:I<1 S X=^(I) D Q:X["No cumulative vitals data for this patient"
62 . I '$L(X) S BCNT=BCNT+1 I BCNT>1 Q
63 . S LCNT=LCNT+1,^TMP("ORXPND",$J,LCNT,0)=X S:$L(X) BCNT=0
64 K ^TMP("ORDATA",$J)
65 Q
66FHP ; -- Dietetics profile
67 N X,I S X=$$P^FHWOR71(+ORVP)
68 D ITEM^ORCXPND("Dietetics Profile"),BLANK^ORCXPND
69 I +X'>0 S LCNT=LCNT+1,^TMP("ORXPND",$J,LCNT,0)=$P(X,U,2) Q ; no rpt
70 S I=0 F S I=$O(^TMP($J,"FHPROF",+ORVP,I)) Q:I'>0 S LCNT=LCNT+1,^TMP("ORXPND",$J,LCNT,0)=^TMP($J,"FHPROF",+ORVP,I)
71 K ^TMP($J,"FHPROF",+ORVP)
72 Q
73 ;
74FHA ; -- Nurtritional Assessments
75 N X,I S ID=$P(ID,";",2),X=$$FHWORASM^FHWORA(+ORVP,ID)
76 D ITEM^ORCXPND("Nutritional Assessment on "_ID),BLANK^ORCXPND
77 I X'>0 S LCNT=LCNT+1,^TMP("ORXPND",$J,LCNT,0)=$P(X,U,2) Q ; no rpt
78 S I=0 F S I=$O(^TMP($J,"FHASM",+ORVP,I)) Q:I'>0 S LCNT=LCNT+1,^TMP("ORXPND",$J,LCNT,0)=^TMP($J,"FHASM",+ORVP,I)
79 K ^TMP($J,"FHASM",+ORVP)
80 Q
81 ;
82ORS ; -- Daily Order Summary
83 N DFN,Y,I,BCNT
84 D TIT("Daily Order Summary") Q:$$OS()
85 D PREP
86 D RPT^ORWRP(.Y,ID,10,,1)
87 D ITEM^ORCXPND("Daily Order Summary")
88 S I=3,BCNT=0
89 F S I=$O(^TMP("ORDATA",$J,1,I)) Q:I<1 S X=^(I) D Q:X["* END OF ORDERS *"
90 . I '$L(X) S BCNT=BCNT+1 I BCNT>1 Q
91 . S LCNT=LCNT+1,^TMP("ORXPND",$J,LCNT,0)=X S:$L(X) BCNT=0
92 K ^TMP("ORDATA",$J)
93 Q
94 ;
95ORD ; -- Order Summary for Date Range
96 N DFN,Y,I,BCNT,OREND,ORSSTRT,ORSSTOP
97 D TIT("Order summary for Date Range") Q:$$OS()
98 D RANGE^ORCXPND3($S($G(ORWARD):7,1:180)) Q:OREND
99 D PREP
100 D RPT^ORWRP(.Y,ID,11,,,,+ORSSTRT,+ORSSTOP)
101 D ITEM^ORCXPND("Order Summary for Date Range")
102 S I=3,BCNT=0
103 F S I=$O(^TMP("ORDATA",$J,1,I)) Q:I<1 S X=^(I) D Q:X["* END OF ORDERS *"
104 . I '$L(X) S BCNT=BCNT+1 I BCNT>1 Q
105 . S LCNT=LCNT+1,^TMP("ORXPND",$J,LCNT,0)=X S:$L(X) BCNT=0
106 K ^TMP("ORDATA",$J)
107 Q
108ORC ; -- Customized order summary
109 N DFN,Y,I,BCNT,ORDG,ORPRES,ORSSTRT,ORSSTOP,OREND
110 D TIT("Custom Order Summary") Q:$$OS()
111 D RANGE^ORCXPND3($S($G(ORWARD):7,1:180)) Q:OREND
112 D CUSTOM^ORPRS01 Q:$G(OREND)
113 D PREP
114 D RPT^ORWRP(.Y,ID,14,,,,+ORSSTRT,+ORSSTOP)
115 D ITEM^ORCXPND("Custom order summary")
116 S I=3,BCNT=0
117 F S I=$O(^TMP("ORDATA",$J,1,I)) Q:I<1 S X=^(I) D Q:X["* END OF ORDERS *"
118 . I '$L(X) S BCNT=BCNT+1 I BCNT>1 Q
119 . S LCNT=LCNT+1,^TMP("ORXPND",$J,LCNT,0)=X S:$L(X) BCNT=0
120 K ^TMP("ORDATA",$J)
121 Q
122ORP ; -- Print Chart Copy Summary
123 N DFN,Y,I,BCNT,ORSSTRT,ORSSTOP,OREND
124 D TIT("Chart Copy Summary") Q:$$OS()
125 D RANGE^ORCXPND3($S($G(ORWARD):7,1:180)) Q:OREND
126 D PREP
127 D RPT^ORWRP(.Y,ID,12,,,,+ORSSTRT,+ORSSTOP)
128 D ITEM^ORCXPND("Chart Copy Summary")
129 S I=.1,BCNT=0
130 F S I=$O(^TMP("ORDATA",$J,1,I)) Q:I<1 S X=^(I) D
131 . I '$L(X) S BCNT=BCNT+1 I BCNT>1 Q
132 . S LCNT=LCNT+1,^TMP("ORXPND",$J,LCNT,0)=X S:$L(X) BCNT=0
133 K ^TMP("ORDATA",$J)
134 Q
135PSO ; -- Outpatient Pharmacy Action Profile
136 N DFN,Y,I,BCNT
137 D TIT("Outpatient Pharmacy Action Profile") Q:$$OS()
138 D PREP
139 D RPT^ORWRP(.Y,ID,13)
140 D ITEM^ORCXPND("Outpatient Pharmacy Action Profile")
141 S I=.1,BCNT=0
142 F S I=$O(^TMP("ORDATA",$J,1,I)) Q:I<1 S X=^(I) D
143 . I '$L(X) S BCNT=BCNT+1 I BCNT>1 Q
144 . S LCNT=LCNT+1,^TMP("ORXPND",$J,LCNT,0)=X S:$L(X) BCNT=0
145 K ^TMP("ORDATA",$J)
146 Q
147OS() ; Check OS- Temporary disabled for OpenM
148 Q 0 ;Open M check disabled - remove if Wally's fix fixed.
149 I $G(^%ZOSF("OS"))["OpenM" W !!,$C(7),"This report is currently unavailable from this menu.",!,"Please use 'OR Other Reports ...' to get this report." D READ^ORUTL
150 Q $G(^%ZOSF("OS"))["OpenM"
151LRA ;AP Report
152 D LRA^ORCXPND3
153 Q
154LRAA ;AP Report (alt)
155 D LRAA^ORCXPND3
156 Q
157LRB1 ;BB Report
158 D LRB1^ORCXPND3
159 Q
160LRB ;BB Report (alt)
161 D LRB^ORCXPND3
162 Q
163LRC ;Lab cumulative
164 D LRC^ORCXPND3
165 Q
166LRG ;Lab Graph
167 D LRG^ORCXPND3
168 Q
169LRI ;Lab Interim by Day
170 D LRI^ORCXPND3
171 Q
172LRGEN ;Lab results by test
173 D LRGEN^ORCXPND3
174 Q
175STAT ;Lab order status
176 D STAT^ORCXPND3
177 Q
178MED(TYPE) ;Medicine Patient Procedure Summary
179 D MED^ORCXPND3(TYPE)
180 Q
Note: See TracBrowser for help on using the repository browser.