BMCRLS ; IHS/PHXAO/TMJ - APC referral counts: show screens ;
;;4.0;REFERRED CARE INFO SYSTEM;;JAN 09, 2006
;
SHOWP ;EP
I '$D(BMCDONE) W:$D(IOF) @IOF
W !!?6,"PRINT Items Selected:"
I BMCCTYP="S" W !,?12,"Report includes sub-totals and total only." Q
I BMCCTYP="T" W !,?12,"Report will includes total only." Q
Q:'$D(^BMCRTMP(BMCRPT,12))
S (BMCI,BMCTCW)=0 F S BMCI=$O(^BMCRTMP(BMCRPT,12,BMCI)) Q:BMCI'=+BMCI S BMCCRIT=$P(^BMCRTMP(BMCRPT,12,BMCI,0),U) D
.W !?12,$P(^BMCTSORT(BMCCRIT,0),U)," - column width ",$P(^BMCRTMP(BMCRPT,12,BMCI,0),U,2) S BMCTCW=BMCTCW+$P(^(0),U,2)+2
.I $Y>(IOSL-5) D PAUSE^BMCRL01 W:$D(IOF) @IOF
W !!?12,"Total Report width (including column margins - 2 spaces): ",BMCTCW
Q
SHOW ;EP
W:$D(IOF) @IOF
I $D(BMCDONE) S BMCLHDR="REPORT SUMMARY" W ?((80-$L(BMCLHDR))/2),BMCLHDR,!
;W !!?6,$S(BMCPTVS="R":"REFERRAL",1:"PATIENT")_" Selection Criteria:"
W !?6,"REFERRAL Selection Criteria:"
Q:'$D(^BMCRTMP(BMCRPT,11))
W !?12,$S(BMCTYPR="P":"PRIMARY REFERRALS",BMCTYPR="S":"SECONDARY REFERRALS",1:"PRIMARY AND SECONDARY REFERRALS")
S BMCI=0 F S BMCI=$O(^BMCRTMP(BMCRPT,11,BMCI)) Q:BMCI'=+BMCI D
.I $Y>(IOSL-5) D PAUSE^BMCRL01 W @IOF
.W !?12,$P(^BMCTSORT(BMCI,0),U),": "
.K BMCQ
.S BMCY="",BMCC=0 F S BMCY=$O(^BMCRTMP(BMCRPT,11,BMCI,11,"B",BMCY)) S BMCC=BMCC+1 Q:BMCY=""!($D(BMCQ)) W:BMCC'=1 " ; " S X=BMCY X:$D(^BMCTSORT(BMCI,2)) ^(2) W X
K BMCC,BMCQ
Q
SHOWR ;EP
I '$D(BMCDONE) W:$D(IOF) @IOF
W !!?6,$S(BMCPTVS="R":"Referral",1:"Patient")_" SORTING Criteria:"
Q:'$G(BMCSORT)
W !?12,$S(BMCPTVS="R":"Referrals",1:"Patients")_" will be sorted by: ",$P(^BMCTSORT(BMCSORT,0),U),!
Q
BMCRLS ; IHS/PHXAO/TMJ - APC referral counts: show screens ;
+1 ;;4.0;REFERRED CARE INFO SYSTEM;;JAN 09, 2006
+2 ;
SHOWP ;EP
+1 IF '$DATA(BMCDONE)
IF $DATA(IOF)
WRITE @IOF
+2 WRITE !!?6,"PRINT Items Selected:"
+3 IF BMCCTYP="S"
WRITE !,?12,"Report includes sub-totals and total only."
QUIT
+4 IF BMCCTYP="T"
WRITE !,?12,"Report will includes total only."
QUIT
+5 IF '$DATA(^BMCRTMP(BMCRPT,12))
QUIT
+6 SET (BMCI,BMCTCW)=0
FOR
SET BMCI=$ORDER(^BMCRTMP(BMCRPT,12,BMCI))
IF BMCI'=+BMCI
QUIT
SET BMCCRIT=$PIECE(^BMCRTMP(BMCRPT,12,BMCI,0),U)
Begin DoDot:1
+7 WRITE !?12,$PIECE(^BMCTSORT(BMCCRIT,0),U)," - column width ",$PIECE(^BMCRTMP(BMCRPT,12,BMCI,0),U,2)
SET BMCTCW=BMCTCW+$PIECE(^(0),U,2)+2
+8 IF $Y>(IOSL-5)
DO PAUSE^BMCRL01
IF $DATA(IOF)
WRITE @IOF
End DoDot:1
+9 WRITE !!?12,"Total Report width (including column margins - 2 spaces): ",BMCTCW
+10 QUIT
SHOW ;EP
+1 IF $DATA(IOF)
WRITE @IOF
+2 IF $DATA(BMCDONE)
SET BMCLHDR="REPORT SUMMARY"
WRITE ?((80-$LENGTH(BMCLHDR))/2),BMCLHDR,!
+3 ;W !!?6,$S(BMCPTVS="R":"REFERRAL",1:"PATIENT")_" Selection Criteria:"
+4 WRITE !?6,"REFERRAL Selection Criteria:"
+5 IF '$DATA(^BMCRTMP(BMCRPT,11))
QUIT
+6 WRITE !?12,$SELECT(BMCTYPR="P":"PRIMARY REFERRALS",BMCTYPR="S":"SECONDARY REFERRALS",1:"PRIMARY AND SECONDARY REFERRALS")
+7 SET BMCI=0
FOR
SET BMCI=$ORDER(^BMCRTMP(BMCRPT,11,BMCI))
IF BMCI'=+BMCI
QUIT
Begin DoDot:1
+8 IF $Y>(IOSL-5)
DO PAUSE^BMCRL01
WRITE @IOF
+9 WRITE !?12,$PIECE(^BMCTSORT(BMCI,0),U),": "
+10 KILL BMCQ
+11 SET BMCY=""
SET BMCC=0
FOR
SET BMCY=$ORDER(^BMCRTMP(BMCRPT,11,BMCI,11,"B",BMCY))
SET BMCC=BMCC+1
IF BMCY=""!($DATA(BMCQ))
QUIT
IF BMCC'=1
WRITE " ; "
SET X=BMCY
IF $DATA(^BMCTSORT(BMCI,2))
XECUTE ^(2)
WRITE X
End DoDot:1
+12 KILL BMCC,BMCQ
+13 QUIT
SHOWR ;EP
+1 IF '$DATA(BMCDONE)
IF $DATA(IOF)
WRITE @IOF
+2 WRITE !!?6,$SELECT(BMCPTVS="R":"Referral",1:"Patient")_" SORTING Criteria:"
+3 IF '$GET(BMCSORT)
QUIT
+4 WRITE !?12,$SELECT(BMCPTVS="R":"Referrals",1:"Patients")_" will be sorted by: ",$PIECE(^BMCTSORT(BMCSORT,0),U),!
+5 QUIT