source: FOIAVistA/trunk/r/CLINICAL_REMINDERS-PXRM/PXRMGECS.m@ 1446

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

initial load of FOIAVistA 6/30/08 version

File size: 6.3 KB
Line 
1PXRMGECS ;SLC/JVS GEC-Reports-cont'd ;7/14/05 10:45
2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21
3 Q
4 ;____
5DFN2 ;DFN array for By Provider Report
6 N DFN,DOCT,DIADA,DATEV,FLAG,REF,DFN1
7 S REF="^TMP(""PXRMGEC"",$J)",DFN1=0
8 I FORMAT="D" S FOR=0
9 I FORMAT="F" S FOR=1
10 W @IOF
11 W "=============================================================================="
12 W !,"GEC Provider"
13 W !,"From: "_$$FMTE^XLFDT(BDT,"5ZM")_" To: "_$$FMTE^XLFDT(EDT,"5ZM")
14 W !,"Report Displays Counts of Complete Referrals Only"
15 I FOR W !,"Provider"
16 I FOR W !," Patient",?17,"Completion Date",?41,"Dialog"
17 I 'FOR W !,"Provider^IEN^Patient^SS#^Dialog^Completion Date"
18 W !,"=============================================================================="
19 W ! D PB Q:Y=0
20 D E^PXRMGECV("DFN",1,BDT,EDT,"F",0)
21 S DOCT=0 F S DOCT=$O(@REF@("DFN",DOCT)),FLAG=1 Q:DOCT=""!(Y=0) D
22 .I PROV>0&('$D(PROVARY(DOCT))) Q
23 .I FOR W:FLAG=1 !!,IOUON,$$GET1^DIQ(200,DOCT,.01)_" ("_DOCT_")",IOUOFF,! D PB Q:Y=0
24 .I FOR D PB Q:Y=0
25 .S DFN=0 F S DFN=$O(@REF@("DFN",DOCT,DFN)) Q:DFN=""!(Y=0) D
26 ..S DATEV=0 F S DATEV=$O(@REF@("DFN",DOCT,DFN,DATEV)) Q:DATEV="" D
27 ...S DIADA=0 F S DIADA=$O(@REF@("DFN",DOCT,DFN,DATEV,DIADA)) Q:DIADA=""!(Y=0) D
28 ....I FOR W !,?2,$S(DFN'=DFN1!(FLAG=1):$P($G(^DPT(DFN,0)),"^",1)_" ("_$P($G(^DPT(DFN,0)),"^",9)_")"_" ("_$$CNT^PXRMGECL(DOCT,DFN)_" Evaluation(s) )",1:"") D PB Q:Y=0
29 ....I FOR I DFN'=DFN1!(FLAG=1) W !
30 ....S FLAG=0
31 ....W ?17,$P($$FMTE^XLFDT(DATEV,"5ZM"),"@",1,2),?41,$P($P($G(^PXRMD(801.41,DIADA,0)),"^",1)," ",3,6)
32 ....S DFN1=DFN
33 ....I FOR D PB Q:Y=0
34 ....I 'FOR W !,$$GET1^DIQ(200,DOCT,.01)_"^"_DOCT,"^",$P($G(^DPT(DFN,0)),"^",1)_"^"_$P($G(^DPT(DFN,0)),"^",9),"^",$P($P($G(^PXRMD(801.41,DIADA,0)),"^",1)," ",3,6),"^",$P($$FMTE^XLFDT(DATEV,"5ZM"),"@",1,2)
35 K ^TMP("PXRMGEC",$J)
36 Q
37 ;
38CTL ;Referrals Counts by Location
39 N LOC,TOTAL,ACCTOT
40 S ACCTOT=0
41 S REF="^TMP(""PXRMGEC"",$J)"
42 D E^PXRMGECV("CTL",1,BDT,EDT,"F",0)
43 I FORMAT="D" S FOR=0
44 I FORMAT="F" S FOR=1
45 W @IOF
46 W "=============================================================================="
47 W !,"Referral Count by Location"
48 W !,"From: "_$$FMTE^XLFDT(BDT,"5ZM")_" To: "_$$FMTE^XLFDT(EDT,"5ZM")
49 W !,"Report Displays Counts of Complete Referrals Only"
50 I FOR W !,"Location",?25,"Total Count"
51 I 'FOR W !,"Location^Total Count"
52 W !,"=============================================================================="
53 ;TMP("PXRMGEC",$J,"REFLOCC",LOC)="3"
54 W ! D PB Q:Y=0
55 S LOC=0 F S LOC=$O(@REF@("REFLOCC",LOC)) Q:LOC="" D
56 .S TOTAL=$G(@REF@("REFLOCC",LOC)) S ACCTOT=ACCTOT+TOTAL
57 .I FOR W !,LOC,?25,$J(TOTAL,3)
58 .I 'FOR W !,LOC,"^",TOTAL
59 I FOR W !,"_____________________________" D PB Q:Y=0
60 I FOR W !,"Total Referrals",?25,$J(ACCTOT,3) D PB Q:Y=0
61 K ^TMP("PXRMGEC",$J)
62 Q
63 ;______________________________________________________________
64CTDR ;Referrals Counts by Provider
65 N DOC,TOTAL,ACCTOT,DIEN
66 S ACCTOT=0
67 D E^PXRMGECV("CTDR",1,BDT,EDT,"F",0)
68 I FORMAT="F" S FOR=1
69 I FORMAT="D" S FOR=0
70 W @IOF
71 W "=============================================================================="
72 W !,"Referral Count by Provider"
73 W !,"From: "_$$FMTE^XLFDT(BDT,"5ZM")_" To: "_$$FMTE^XLFDT(EDT,"5ZM")
74 W !,"Report Displays Counts of Complete Referrals Only"
75 I FOR W !,"Provider",?37,"Total Count"
76 I 'FOR W !,"Provider^IEN^Total Count"
77 W !,"=============================================================================="
78 ;TMP("PXRMGEC",$J,"REFDOCC",DOC,DIEN)="3"
79 W ! D PB Q:Y=0
80 S DOC=0 F S DOC=$O(^TMP("PXRMGEC",$J,"REFDOCC",DOC)) Q:DOC="" D
81 .S DIEN=0 F S DIEN=$O(^TMP("PXRMGEC",$J,"REFDOCC",DOC,DIEN)) Q:DIEN="" D
82 ..S TOTAL=$G(^TMP("PXRMGEC",$J,"REFDOCC",DOC,DIEN)) S ACCTOT=ACCTOT+TOTAL
83 ..I FOR W !,DOC," ("_DIEN_")",?37,$J(TOTAL,3)
84 ..I 'FOR W !,DOC,"^",DIEN,"^",TOTAL
85 I FOR W !,"_____________________________" D PB Q:Y=0
86 I FOR W !,"Total Referrals",?37,$J(ACCTOT,3) D PB Q:Y=0
87 K ^TMP("PXRMGEC",$J)
88 Q
89 ;______________________________________________________________
90CTP ;Referrals Counts by Patient
91 N PATIENT,TOTAL,ACCTOT,CNT,DFNN,STATUS,DIV
92 S ACCTOT=0
93 D E^PXRMGECV("CTP",1,BDT,EDT,"F",0)
94 I FORMAT="F" S FOR=1
95 I FORMAT="D" S FOR=0
96 W @IOF
97 W "=============================================================================="
98 W !,"Referral Count by Patient"
99 W !,"From: "_$$FMTE^XLFDT(BDT,"5ZM")_" To: "_$$FMTE^XLFDT(EDT,"5ZM")
100 W !,"Report Displays Counts of Complete Referrals Only"
101 I FOR W !,"Patient",?25,"SSN",?37,"Total Count",?56,"Division"
102 I 'FOR W !,"Patient^SSN^Total Count"
103 W !,"=============================================================================="
104 S CNT=0
105 ;TMP("PXRMGEC",$J,"REFDFNN,PATIENT)="3"
106 W ! D PB Q:Y=0
107 S PATIENT=0 F S PATIENT=$O(^TMP("PXRMGEC",$J,"REFDFNN",PATIENT)) Q:PATIENT="" D
108 .S DFNN=$O(^DPT("B",PATIENT,0))
109 .S STATUS=$S($D(^DPT(DFNN,.1)):"INPATIENT",1:"OUTPATIENT")
110 .S DIV=$$GET1^DIQ(2,DFNN,.19)
111 .I STATUS["IN" I DIV="" S DIV="Unknown"
112 .S CNT=CNT+1
113 .S SSN=0 F S SSN=$O(^TMP("PXRMGEC",$J,"REFDFNN",PATIENT,SSN)) Q:SSN="" D
114 ..S TOTAL=$G(^TMP("PXRMGEC",$J,"REFDFNN",PATIENT,SSN)) S ACCTOT=ACCTOT+TOTAL
115 ..I FOR W !,CNT," ",PATIENT,?25,SSN,?37,$J(TOTAL,3),?44,STATUS,?56,DIV D PB Q:Y=0
116 ..I 'FOR W !,PATIENT,"^",SSN,"^",TOTAL
117 I FOR W !,"__________________________________" D PB Q:Y=0
118 I FOR W !,"Total Referrals",?25,$G(SSN),?37,$J(ACCTOT,3)
119 K ^TMP("PXRMGEC",$J)
120 Q
121 ;______________________________________________________________
122CTD ;Referrals Counts by Date
123 N DATE,TOTAL,ACCTOT
124 S ACCTOT=0
125 D E^PXRMGECV("CTD",1,BDT,EDT,"F",0)
126 I FORMAT="F" S FOR=1
127 I FORMAT="D" S FOR=0
128 W @IOF
129 W "=============================================================================="
130 W !,"Referral Count by Date"
131 W !,"From: "_$$FMTE^XLFDT(BDT,"5ZM")_" To: "_$$FMTE^XLFDT(EDT,"5ZM")
132 W !,"Report Displays Counts of Complete Referrals Only"
133 I FOR W !,"Date",?25,"Total Count"
134 I 'FOR W !,"Date^Total Count"
135 W !,"=============================================================================="
136 ;TMP("PXRMGEC",$J,"REFDATE",DATE)="3"
137 W ! D PB Q:Y=0
138 S DATE=0 F S DATE=$O(^TMP("PXRMGEC",$J,"REFDATE",DATE)) Q:DATE="" D
139 .S TOTAL=$G(^TMP("PXRMGEC",$J,"REFDATE",DATE)) S ACCTOT=ACCTOT+TOTAL
140 .I FOR W !,$$FMTE^XLFDT(DATE,"5ZM"),?25,$J(TOTAL,3) D PB Q:Y=0
141 .I 'FOR W !,$$FMTE^XLFDT(DATE,"5ZM"),"^",TOTAL
142 I FOR W !,"_____________________________" D PB Q:Y=0
143 I FOR W !,"Total Referrals",?25,$J(ACCTOT,3) D PB Q:Y=0
144 K ^TMP("PXRMGEC",$J)
145 Q
146 ;
147PB ;PAGE BREAK
148 S Y=""
149 I $Y=(IOSL-2)!($Y=(IOSL-3)) D
150 .K DIR
151 .S DIR(0)="E"
152 .D ^DIR
153 .I Y=1 W @IOF S $Y=0
154 .W !
155 K DIR
156 Q
157 ;
Note: See TracBrowser for help on using the repository browser.