PXRMGECT ;SLC/JVS GEC-Queued Reports-cont'd ;7/14/05 10:45
;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21
Q
CTL ;Referrals Counts by Location
N LOC,TOTAL,ACCTOT,PAGE
S ACCTOT=0
S REF="^TMP(""PXRMGEC"",$J)"
D E^PXRMGECV("CTL",1,BDT,EDT,"F",0)
I FORMAT="D" S FOR=0
I FORMAT="F" S FOR=1
W @IOF
W "=============================================================================="
W !,"Referral Count by Location"
W !,"From: "_$$FMTE^XLFDT(BDT,"5ZM")_" To: "_$$FMTE^XLFDT(EDT,"5ZM")
W !,"Report Displays Counts of Complete Referrals Only"
I FOR W !,"Location",?25,"Total Count"
I 'FOR W !,"Location^Total Count"
W !,"=============================================================================="
S PAGE=1
;TMP("PXRMGEC",$J,"REFLOCC",LOC)="3"
W ! D PAGE^PXRMGECZ
S LOC=0 F S LOC=$O(@REF@("REFLOCC",LOC)) Q:LOC="" D
.S TOTAL=$G(@REF@("REFLOCC",LOC)) S ACCTOT=ACCTOT+TOTAL
.I FOR W !,LOC,?25,$J(TOTAL,3) D PAGE^PXRMGECZ
.I 'FOR W !,LOC,"^",TOTAL D PAGE^PXRMGECZ
I FOR W !,"_____________________________" D PAGE^PXRMGECZ
I FOR W !,"Total Referrals",?25,$J(ACCTOT,3) D PAGE^PXRMGECZ
K ^TMP("PXRMGEC",$J)
Q
;______________________________________________________________
CTDR ;Referrals Counts by Provider
N DOC,TOTAL,ACCTOT,DIEN,PAGE
S ACCTOT=0
D E^PXRMGECV("CTDR",1,BDT,EDT,"F",0)
I FORMAT="F" S FOR=1
I FORMAT="D" S FOR=0
W @IOF
W "=============================================================================="
W !,"Referral Count by Provider"
W !,"From: "_$$FMTE^XLFDT(BDT,"5ZM")_" To: "_$$FMTE^XLFDT(EDT,"5ZM")
W !,"Report Displays Counts of Complete Referrals Only"
I FOR W !,"Provider",?37,"Total Count"
I 'FOR W !,"Provider^IEN^Total Count"
W !,"=============================================================================="
S PAGE=1
;TMP("PXRMGEC",$J,"REFDOCC",DOC)="3"
W ! D PAGE^PXRMGECZ
S DOC=0 F S DOC=$O(^TMP("PXRMGEC",$J,"REFDOCC",DOC)) Q:DOC="" D
.S DIEN=0 F S DIEN=$O(^TMP("PXRMGEC",$J,"REFDOCC",DOC,DIEN)) Q:DIEN="" D
..S TOTAL=$G(^TMP("PXRMGEC",$J,"REFDOCC",DOC,DIEN)) S ACCTOT=ACCTOT+TOTAL
..I FOR W !,DOC," ("_DIEN_")",?37,$J(TOTAL,3) D PAGE^PXRMGECZ
..I 'FOR W !,DOC,"^",DIEN,"^",TOTAL D PAGE^PXRMGECZ
I FOR W !,"_____________________________" D PAGE^PXRMGECZ
I FOR W !,"Total Referrals",?37,$J(ACCTOT,3) D PAGE^PXRMGECZ
K ^TMP("PXRMGEC",$J)
Q
;______________________________________________________________
CTP ;Referrals Counts by Patient
N PATIENT,TOTAL,ACCTOT,SSN,CNT,PAGE,DFNN,STATUS,DIV
S ACCTOT=0
D E^PXRMGECV("CTP",1,BDT,EDT,"F",0)
I FORMAT="F" S FOR=1
I FORMAT="D" S FOR=0
W @IOF
W "=============================================================================="
W !,"Referral Count by Date"
W !,"From: "_$$FMTE^XLFDT(BDT,"5ZM")_" To: "_$$FMTE^XLFDT(EDT,"5ZM")
W !,"Report Displays Counts of Complete Referrals Only"
I FOR W !,"Patient",?37,"Total Count",?56,"Division"
I 'FOR W !,"Patient^SSN^Total Count"
W !,"=============================================================================="
S PAGE=1
S CNT=0
;TMP("PXRMGEC",$J,"REFDFNN,PATIENT)="3"
W ! D PAGE^PXRMGECZ
S PATIENT=0 F S PATIENT=$O(^TMP("PXRMGEC",$J,"REFDFNN",PATIENT)) Q:PATIENT="" D
.S DFNN=$O(^DPT("B",PATIENT,0))
.S STATUS=$S($D(^DPT(DFNN,.1)):"INPATIENT",1:"OUTPATIENT")
.S DIV=$$GET1^DIQ(2,DFNN,.19)
.I STATUS["IN" I DIV="" S DIV="Unknown"
.S CNT=CNT+1
.S SSN=0 F S SSN=$O(^TMP("PXRMGEC",$J,"REFDFNN",PATIENT,SSN)) Q:SSN="" D
..S TOTAL=$G(^TMP("PXRMGEC",$J,"REFDFNN",PATIENT)) S ACCTOT=ACCTOT+TOTAL
..I FOR W !,CNT," ",PATIENT,?25,SSN,?37,$J(TOTAL,3),?44,STATUS,?56,DIV D PAGE^PXRMGECZ
..I 'FOR W !,PATIENT,"^",SSN,"^",TOTAL D PAGE^PXRMGECZ
I FOR W !,"_____________________________" D PAGE^PXRMGECZ
I FOR W !,"Total Referrals",?25,SSN,?37,$J(ACCTOT,3) D PAGE^PXRMGECZ
K ^TMP("PXRMGEC",$J)
Q
;______________________________________________________________
CTD ;Referrals Counts by Date
N DATE,TOTAL,ACCTOT,PAGE
S ACCTOT=0
D E^PXRMGECV("CTD",1,BDT,EDT,"F",0)
I FORMAT="F" S FOR=1
I FORMAT="D" S FOR=0
W @IOF
W "=============================================================================="
S PAGE=1
W !,"Referral Count by Date"
W !,"From: "_$$FMTE^XLFDT(BDT,"5ZM")_" To: "_$$FMTE^XLFDT(EDT,"5ZM")
W !,"Report Displays Counts of Complete Referrals Only"
I FOR W !,"Date",?25,"Total Count"
I 'FOR W !,"Date^Total Count"
W !,"=============================================================================="
;TMP("PXRMGEC",$J,"REFDATE",DATE)="3"
W !
S DATE=0 F S DATE=$O(^TMP("PXRMGEC",$J,"REFDATE",DATE)) Q:DATE="" D
.S TOTAL=$G(^TMP("PXRMGEC",$J,"REFDATE",DATE)) S ACCTOT=ACCTOT+TOTAL
.I FOR W !,$$FMTE^XLFDT(DATE,"5ZM"),?25,$J(TOTAL,3) D PAGE^PXRMGECZ
.I 'FOR W !,$$FMTE^XLFDT(DATE,"5ZM"),"^",TOTAL D PAGE^PXRMGECZ
I FOR W !,"_____________________________" D PAGE^PXRMGECZ
I FOR W !,"Total Referrals",?25,$J(ACCTOT,3) D PAGE^PXRMGECZ
K ^TMP("PXRMGEC",$J)
Q
;______________________________________________________________
PXRMGECT ;SLC/JVS GEC-Queued Reports-cont'd ;7/14/05 10:45
+1 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21
+2 QUIT
CTL ;Referrals Counts by Location
+1 NEW LOC,TOTAL,ACCTOT,PAGE
+2 SET ACCTOT=0
+3 SET REF="^TMP(""PXRMGEC"",$J)"
+4 DO E^PXRMGECV("CTL",1,BDT,EDT,"F",0)
+5 IF FORMAT="D"
SET FOR=0
+6 IF FORMAT="F"
SET FOR=1
+7 WRITE @IOF
+8 WRITE "=============================================================================="
+9 WRITE !,"Referral Count by Location"
+10 WRITE !,"From: "_$$FMTE^XLFDT(BDT,"5ZM")_" To: "_$$FMTE^XLFDT(EDT,"5ZM")
+11 WRITE !,"Report Displays Counts of Complete Referrals Only"
+12 IF FOR
WRITE !,"Location",?25,"Total Count"
+13 IF 'FOR
WRITE !,"Location^Total Count"
+14 WRITE !,"=============================================================================="
+15 SET PAGE=1
+16 ;TMP("PXRMGEC",$J,"REFLOCC",LOC)="3"
+17 WRITE !
DO PAGE^PXRMGECZ
+18 SET LOC=0
FOR
SET LOC=$ORDER(@REF@("REFLOCC",LOC))
IF LOC=""
QUIT
Begin DoDot:1
+19 SET TOTAL=$GET(@REF@("REFLOCC",LOC))
SET ACCTOT=ACCTOT+TOTAL
+20 IF FOR
WRITE !,LOC,?25,$JUSTIFY(TOTAL,3)
DO PAGE^PXRMGECZ
+21 IF 'FOR
WRITE !,LOC,"^",TOTAL
DO PAGE^PXRMGECZ
End DoDot:1
+22 IF FOR
WRITE !,"_____________________________"
DO PAGE^PXRMGECZ
+23 IF FOR
WRITE !,"Total Referrals",?25,$JUSTIFY(ACCTOT,3)
DO PAGE^PXRMGECZ
+24 KILL ^TMP("PXRMGEC",$JOB)
+25 QUIT
+26 ;______________________________________________________________
CTDR ;Referrals Counts by Provider
+1 NEW DOC,TOTAL,ACCTOT,DIEN,PAGE
+2 SET ACCTOT=0
+3 DO E^PXRMGECV("CTDR",1,BDT,EDT,"F",0)
+4 IF FORMAT="F"
SET FOR=1
+5 IF FORMAT="D"
SET FOR=0
+6 WRITE @IOF
+7 WRITE "=============================================================================="
+8 WRITE !,"Referral Count by Provider"
+9 WRITE !,"From: "_$$FMTE^XLFDT(BDT,"5ZM")_" To: "_$$FMTE^XLFDT(EDT,"5ZM")
+10 WRITE !,"Report Displays Counts of Complete Referrals Only"
+11 IF FOR
WRITE !,"Provider",?37,"Total Count"
+12 IF 'FOR
WRITE !,"Provider^IEN^Total Count"
+13 WRITE !,"=============================================================================="
+14 SET PAGE=1
+15 ;TMP("PXRMGEC",$J,"REFDOCC",DOC)="3"
+16 WRITE !
DO PAGE^PXRMGECZ
+17 SET DOC=0
FOR
SET DOC=$ORDER(^TMP("PXRMGEC",$JOB,"REFDOCC",DOC))
IF DOC=""
QUIT
Begin DoDot:1
+18 SET DIEN=0
FOR
SET DIEN=$ORDER(^TMP("PXRMGEC",$JOB,"REFDOCC",DOC,DIEN))
IF DIEN=""
QUIT
Begin DoDot:2
+19 SET TOTAL=$GET(^TMP("PXRMGEC",$JOB,"REFDOCC",DOC,DIEN))
SET ACCTOT=ACCTOT+TOTAL
+20 IF FOR
WRITE !,DOC," ("_DIEN_")",?37,$JUSTIFY(TOTAL,3)
DO PAGE^PXRMGECZ
+21 IF 'FOR
WRITE !,DOC,"^",DIEN,"^",TOTAL
DO PAGE^PXRMGECZ
End DoDot:2
End DoDot:1
+22 IF FOR
WRITE !,"_____________________________"
DO PAGE^PXRMGECZ
+23 IF FOR
WRITE !,"Total Referrals",?37,$JUSTIFY(ACCTOT,3)
DO PAGE^PXRMGECZ
+24 KILL ^TMP("PXRMGEC",$JOB)
+25 QUIT
+26 ;______________________________________________________________
CTP ;Referrals Counts by Patient
+1 NEW PATIENT,TOTAL,ACCTOT,SSN,CNT,PAGE,DFNN,STATUS,DIV
+2 SET ACCTOT=0
+3 DO E^PXRMGECV("CTP",1,BDT,EDT,"F",0)
+4 IF FORMAT="F"
SET FOR=1
+5 IF FORMAT="D"
SET FOR=0
+6 WRITE @IOF
+7 WRITE "=============================================================================="
+8 WRITE !,"Referral Count by Date"
+9 WRITE !,"From: "_$$FMTE^XLFDT(BDT,"5ZM")_" To: "_$$FMTE^XLFDT(EDT,"5ZM")
+10 WRITE !,"Report Displays Counts of Complete Referrals Only"
+11 IF FOR
WRITE !,"Patient",?37,"Total Count",?56,"Division"
+12 IF 'FOR
WRITE !,"Patient^SSN^Total Count"
+13 WRITE !,"=============================================================================="
+14 SET PAGE=1
+15 SET CNT=0
+16 ;TMP("PXRMGEC",$J,"REFDFNN,PATIENT)="3"
+17 WRITE !
DO PAGE^PXRMGECZ
+18 SET PATIENT=0
FOR
SET PATIENT=$ORDER(^TMP("PXRMGEC",$JOB,"REFDFNN",PATIENT))
IF PATIENT=""
QUIT
Begin DoDot:1
+19 SET DFNN=$ORDER(^DPT("B",PATIENT,0))
+20 SET STATUS=$SELECT($DATA(^DPT(DFNN,.1)):"INPATIENT",1:"OUTPATIENT")
+21 SET DIV=$$GET1^DIQ(2,DFNN,.19)
+22 IF STATUS["IN"
IF DIV=""
SET DIV="Unknown"
+23 SET CNT=CNT+1
+24 SET SSN=0
FOR
SET SSN=$ORDER(^TMP("PXRMGEC",$JOB,"REFDFNN",PATIENT,SSN))
IF SSN=""
QUIT
Begin DoDot:2
+25 SET TOTAL=$GET(^TMP("PXRMGEC",$JOB,"REFDFNN",PATIENT))
SET ACCTOT=ACCTOT+TOTAL
+26 IF FOR
WRITE !,CNT," ",PATIENT,?25,SSN,?37,$JUSTIFY(TOTAL,3),?44,STATUS,?56,DIV
DO PAGE^PXRMGECZ
+27 IF 'FOR
WRITE !,PATIENT,"^",SSN,"^",TOTAL
DO PAGE^PXRMGECZ
End DoDot:2
End DoDot:1
+28 IF FOR
WRITE !,"_____________________________"
DO PAGE^PXRMGECZ
+29 IF FOR
WRITE !,"Total Referrals",?25,SSN,?37,$JUSTIFY(ACCTOT,3)
DO PAGE^PXRMGECZ
+30 KILL ^TMP("PXRMGEC",$JOB)
+31 QUIT
+32 ;______________________________________________________________
CTD ;Referrals Counts by Date
+1 NEW DATE,TOTAL,ACCTOT,PAGE
+2 SET ACCTOT=0
+3 DO E^PXRMGECV("CTD",1,BDT,EDT,"F",0)
+4 IF FORMAT="F"
SET FOR=1
+5 IF FORMAT="D"
SET FOR=0
+6 WRITE @IOF
+7 WRITE "=============================================================================="
+8 SET PAGE=1
+9 WRITE !,"Referral Count by Date"
+10 WRITE !,"From: "_$$FMTE^XLFDT(BDT,"5ZM")_" To: "_$$FMTE^XLFDT(EDT,"5ZM")
+11 WRITE !,"Report Displays Counts of Complete Referrals Only"
+12 IF FOR
WRITE !,"Date",?25,"Total Count"
+13 IF 'FOR
WRITE !,"Date^Total Count"
+14 WRITE !,"=============================================================================="
+15 ;TMP("PXRMGEC",$J,"REFDATE",DATE)="3"
+16 WRITE !
+17 SET DATE=0
FOR
SET DATE=$ORDER(^TMP("PXRMGEC",$JOB,"REFDATE",DATE))
IF DATE=""
QUIT
Begin DoDot:1
+18 SET TOTAL=$GET(^TMP("PXRMGEC",$JOB,"REFDATE",DATE))
SET ACCTOT=ACCTOT+TOTAL
+19 IF FOR
WRITE !,$$FMTE^XLFDT(DATE,"5ZM"),?25,$JUSTIFY(TOTAL,3)
DO PAGE^PXRMGECZ
+20 IF 'FOR
WRITE !,$$FMTE^XLFDT(DATE,"5ZM"),"^",TOTAL
DO PAGE^PXRMGECZ
End DoDot:1
+21 IF FOR
WRITE !,"_____________________________"
DO PAGE^PXRMGECZ
+22 IF FOR
WRITE !,"Total Referrals",?25,$JUSTIFY(ACCTOT,3)
DO PAGE^PXRMGECZ
+23 KILL ^TMP("PXRMGEC",$JOB)
+24 QUIT
+25 ;______________________________________________________________