source: FOIAVistA/trunk/r/CLINICAL_REMINDERS-PXRM/PXRMGECT.m@ 1683

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

initial load of FOIAVistA 6/30/08 version

File size: 4.8 KB
Line 
1PXRMGECT ;SLC/JVS GEC-Queued Reports-cont'd ;7/14/05 10:45
2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21
3 Q
4CTL ;Referrals Counts by Location
5 N LOC,TOTAL,ACCTOT,PAGE
6 S ACCTOT=0
7 S REF="^TMP(""PXRMGEC"",$J)"
8 D E^PXRMGECV("CTL",1,BDT,EDT,"F",0)
9 I FORMAT="D" S FOR=0
10 I FORMAT="F" S FOR=1
11 W @IOF
12 W "=============================================================================="
13 W !,"Referral Count by Location"
14 W !,"From: "_$$FMTE^XLFDT(BDT,"5ZM")_" To: "_$$FMTE^XLFDT(EDT,"5ZM")
15 W !,"Report Displays Counts of Complete Referrals Only"
16 I FOR W !,"Location",?25,"Total Count"
17 I 'FOR W !,"Location^Total Count"
18 W !,"=============================================================================="
19 S PAGE=1
20 ;TMP("PXRMGEC",$J,"REFLOCC",LOC)="3"
21 W ! D PAGE^PXRMGECZ
22 S LOC=0 F S LOC=$O(@REF@("REFLOCC",LOC)) Q:LOC="" D
23 .S TOTAL=$G(@REF@("REFLOCC",LOC)) S ACCTOT=ACCTOT+TOTAL
24 .I FOR W !,LOC,?25,$J(TOTAL,3) D PAGE^PXRMGECZ
25 .I 'FOR W !,LOC,"^",TOTAL D PAGE^PXRMGECZ
26 I FOR W !,"_____________________________" D PAGE^PXRMGECZ
27 I FOR W !,"Total Referrals",?25,$J(ACCTOT,3) D PAGE^PXRMGECZ
28 K ^TMP("PXRMGEC",$J)
29 Q
30 ;______________________________________________________________
31CTDR ;Referrals Counts by Provider
32 N DOC,TOTAL,ACCTOT,DIEN,PAGE
33 S ACCTOT=0
34 D E^PXRMGECV("CTDR",1,BDT,EDT,"F",0)
35 I FORMAT="F" S FOR=1
36 I FORMAT="D" S FOR=0
37 W @IOF
38 W "=============================================================================="
39 W !,"Referral Count by Provider"
40 W !,"From: "_$$FMTE^XLFDT(BDT,"5ZM")_" To: "_$$FMTE^XLFDT(EDT,"5ZM")
41 W !,"Report Displays Counts of Complete Referrals Only"
42 I FOR W !,"Provider",?37,"Total Count"
43 I 'FOR W !,"Provider^IEN^Total Count"
44 W !,"=============================================================================="
45 S PAGE=1
46 ;TMP("PXRMGEC",$J,"REFDOCC",DOC)="3"
47 W ! D PAGE^PXRMGECZ
48 S DOC=0 F S DOC=$O(^TMP("PXRMGEC",$J,"REFDOCC",DOC)) Q:DOC="" D
49 .S DIEN=0 F S DIEN=$O(^TMP("PXRMGEC",$J,"REFDOCC",DOC,DIEN)) Q:DIEN="" D
50 ..S TOTAL=$G(^TMP("PXRMGEC",$J,"REFDOCC",DOC,DIEN)) S ACCTOT=ACCTOT+TOTAL
51 ..I FOR W !,DOC," ("_DIEN_")",?37,$J(TOTAL,3) D PAGE^PXRMGECZ
52 ..I 'FOR W !,DOC,"^",DIEN,"^",TOTAL D PAGE^PXRMGECZ
53 I FOR W !,"_____________________________" D PAGE^PXRMGECZ
54 I FOR W !,"Total Referrals",?37,$J(ACCTOT,3) D PAGE^PXRMGECZ
55 K ^TMP("PXRMGEC",$J)
56 Q
57 ;______________________________________________________________
58CTP ;Referrals Counts by Patient
59 N PATIENT,TOTAL,ACCTOT,SSN,CNT,PAGE,DFNN,STATUS,DIV
60 S ACCTOT=0
61 D E^PXRMGECV("CTP",1,BDT,EDT,"F",0)
62 I FORMAT="F" S FOR=1
63 I FORMAT="D" S FOR=0
64 W @IOF
65 W "=============================================================================="
66 W !,"Referral Count by Date"
67 W !,"From: "_$$FMTE^XLFDT(BDT,"5ZM")_" To: "_$$FMTE^XLFDT(EDT,"5ZM")
68 W !,"Report Displays Counts of Complete Referrals Only"
69 I FOR W !,"Patient",?37,"Total Count",?56,"Division"
70 I 'FOR W !,"Patient^SSN^Total Count"
71 W !,"=============================================================================="
72 S PAGE=1
73 S CNT=0
74 ;TMP("PXRMGEC",$J,"REFDFNN,PATIENT)="3"
75 W ! D PAGE^PXRMGECZ
76 S PATIENT=0 F S PATIENT=$O(^TMP("PXRMGEC",$J,"REFDFNN",PATIENT)) Q:PATIENT="" D
77 .S DFNN=$O(^DPT("B",PATIENT,0))
78 .S STATUS=$S($D(^DPT(DFNN,.1)):"INPATIENT",1:"OUTPATIENT")
79 .S DIV=$$GET1^DIQ(2,DFNN,.19)
80 .I STATUS["IN" I DIV="" S DIV="Unknown"
81 .S CNT=CNT+1
82 .S SSN=0 F S SSN=$O(^TMP("PXRMGEC",$J,"REFDFNN",PATIENT,SSN)) Q:SSN="" D
83 ..S TOTAL=$G(^TMP("PXRMGEC",$J,"REFDFNN",PATIENT)) S ACCTOT=ACCTOT+TOTAL
84 ..I FOR W !,CNT," ",PATIENT,?25,SSN,?37,$J(TOTAL,3),?44,STATUS,?56,DIV D PAGE^PXRMGECZ
85 ..I 'FOR W !,PATIENT,"^",SSN,"^",TOTAL D PAGE^PXRMGECZ
86 I FOR W !,"_____________________________" D PAGE^PXRMGECZ
87 I FOR W !,"Total Referrals",?25,SSN,?37,$J(ACCTOT,3) D PAGE^PXRMGECZ
88 K ^TMP("PXRMGEC",$J)
89 Q
90 ;______________________________________________________________
91CTD ;Referrals Counts by Date
92 N DATE,TOTAL,ACCTOT,PAGE
93 S ACCTOT=0
94 D E^PXRMGECV("CTD",1,BDT,EDT,"F",0)
95 I FORMAT="F" S FOR=1
96 I FORMAT="D" S FOR=0
97 W @IOF
98 W "=============================================================================="
99 S PAGE=1
100 W !,"Referral Count by Date"
101 W !,"From: "_$$FMTE^XLFDT(BDT,"5ZM")_" To: "_$$FMTE^XLFDT(EDT,"5ZM")
102 W !,"Report Displays Counts of Complete Referrals Only"
103 I FOR W !,"Date",?25,"Total Count"
104 I 'FOR W !,"Date^Total Count"
105 W !,"=============================================================================="
106 ;TMP("PXRMGEC",$J,"REFDATE",DATE)="3"
107 W !
108 S DATE=0 F S DATE=$O(^TMP("PXRMGEC",$J,"REFDATE",DATE)) Q:DATE="" D
109 .S TOTAL=$G(^TMP("PXRMGEC",$J,"REFDATE",DATE)) S ACCTOT=ACCTOT+TOTAL
110 .I FOR W !,$$FMTE^XLFDT(DATE,"5ZM"),?25,$J(TOTAL,3) D PAGE^PXRMGECZ
111 .I 'FOR W !,$$FMTE^XLFDT(DATE,"5ZM"),"^",TOTAL D PAGE^PXRMGECZ
112 I FOR W !,"_____________________________" D PAGE^PXRMGECZ
113 I FOR W !,"Total Referrals",?25,$J(ACCTOT,3) D PAGE^PXRMGECZ
114 K ^TMP("PXRMGEC",$J)
115 Q
116 ;______________________________________________________________
Note: See TracBrowser for help on using the repository browser.