BCHRLS ; IHS/CMI/LAB - SHOW SCREENS ;
;;2.0;IHS RPMS CHR SYSTEM;;OCT 23, 2012;Build 27
;
SHOWP ;EP
I '$D(BCHDONE) W:$D(IOF) @IOF
W !!?6,"PRINT Items Selected:"
I BCHCTYP="S" W !?12,"Report includes sub-totals and total only." Q
I BCHCTYP="T" W !?12,"Report will includes total only." Q
Q:'$D(^BCHTRPT(BCHRPT,12))
S (BCHI,BCHTCW)=0 F S BCHI=$O(^BCHTRPT(BCHRPT,12,BCHI)) Q:BCHI'=+BCHI S BCHCRIT=$P(^BCHTRPT(BCHRPT,12,BCHI,0),U) D
.W !?12,$P(^BCHSORT(BCHCRIT,0),U)," - column width ",$P(^BCHTRPT(BCHRPT,12,BCHI,0),U,2) S BCHTCW=BCHTCW+$P(^(0),U,2)+2
.I $Y>(IOSL-5) D PAUSE^BCHRL01 W:$D(IOF) @IOF
W !!?12,"Total Report width (including column margins - 2 spaces): ",BCHTCW
Q
SHOW ;EP
W:$D(IOF) @IOF
I $D(BCHDONE) S BCHLHDR="REPORT SUMMARY" W ?((80-$L(BCHLHDR))/2),BCHLHDR,!
W !!?6,$S(BCHPTVS="V":"VISIT",1:"PATIENT")_" Selection Criteria"
W:BCHTYPE="D" !?12,"Date of Service range: ",BCHBDD," to ",BCHEDD
W:BCHTYPE="S" !?12,"Search Template: ",$P(^DIBT(BCHSEAT,0),U)
I $D(BCHRDTR),$D(BCHBDD) W !,"Date of Service range: ",BCHBDD," to ",BCHEDD,"."
Q:'$D(^BCHTRPT(BCHRPT,11))
S BCHI=0 F S BCHI=$O(^BCHTRPT(BCHRPT,11,BCHI)) Q:BCHI'=+BCHI D
.I $Y>(IOSL-5) D PAUSE^BCHRL01 W @IOF
.W !?12,$P(^BCHSORT(BCHI,0),U),": "
.K BCHQ
.S BCHY=0,BCHC=0 F S BCHY=$O(^BCHTRPT(BCHRPT,11,BCHI,11,"B",BCHY)) S BCHC=BCHC+1 Q:BCHY=""!($D(BCHQ)) W:BCHC'=1 " ; " S X=BCHY X:$D(^BCHSORT(BCHI,2)) ^(2) W X
K BCHC,BCHQ
Q
SHOWR ;EP
I '$D(BCHDONE) W:$D(IOF) @IOF
W !!?6,$S(BCHPTVS="V":"Visit",1:"Patient")_" SORTING Criteria"
W:BCHTYPE="D"&('$D(BCHDONE)) !?12,"Date of Service range: ",BCHBDD," to ",BCHEDD
W:BCHTYPE="S"&('$D(BCHDONE)) !?12,"Search Template: ",$P(^DIBT(BCHSEAT,0),U)
Q:'$G(BCHSORT)
W !?12,$S(BCHPTVS="V":"Visits",1:"Patients")_" will be sorted by: ",$P(^BCHSORT(BCHSORT,0),U),!
Q
BCHRLS ; IHS/CMI/LAB - SHOW SCREENS ;
+1 ;;2.0;IHS RPMS CHR SYSTEM;;OCT 23, 2012;Build 27
+2 ;
SHOWP ;EP
+1 IF '$DATA(BCHDONE)
IF $DATA(IOF)
WRITE @IOF
+2 WRITE !!?6,"PRINT Items Selected:"
+3 IF BCHCTYP="S"
WRITE !?12,"Report includes sub-totals and total only."
QUIT
+4 IF BCHCTYP="T"
WRITE !?12,"Report will includes total only."
QUIT
+5 IF '$DATA(^BCHTRPT(BCHRPT,12))
QUIT
+6 SET (BCHI,BCHTCW)=0
FOR
SET BCHI=$ORDER(^BCHTRPT(BCHRPT,12,BCHI))
IF BCHI'=+BCHI
QUIT
SET BCHCRIT=$PIECE(^BCHTRPT(BCHRPT,12,BCHI,0),U)
Begin DoDot:1
+7 WRITE !?12,$PIECE(^BCHSORT(BCHCRIT,0),U)," - column width ",$PIECE(^BCHTRPT(BCHRPT,12,BCHI,0),U,2)
SET BCHTCW=BCHTCW+$PIECE(^(0),U,2)+2
+8 IF $Y>(IOSL-5)
DO PAUSE^BCHRL01
IF $DATA(IOF)
WRITE @IOF
End DoDot:1
+9 WRITE !!?12,"Total Report width (including column margins - 2 spaces): ",BCHTCW
+10 QUIT
SHOW ;EP
+1 IF $DATA(IOF)
WRITE @IOF
+2 IF $DATA(BCHDONE)
SET BCHLHDR="REPORT SUMMARY"
WRITE ?((80-$LENGTH(BCHLHDR))/2),BCHLHDR,!
+3 WRITE !!?6,$SELECT(BCHPTVS="V":"VISIT",1:"PATIENT")_" Selection Criteria"
+4 IF BCHTYPE="D"
WRITE !?12,"Date of Service range: ",BCHBDD," to ",BCHEDD
+5 IF BCHTYPE="S"
WRITE !?12,"Search Template: ",$PIECE(^DIBT(BCHSEAT,0),U)
+6 IF $DATA(BCHRDTR)
IF $DATA(BCHBDD)
WRITE !,"Date of Service range: ",BCHBDD," to ",BCHEDD,"."
+7 IF '$DATA(^BCHTRPT(BCHRPT,11))
QUIT
+8 SET BCHI=0
FOR
SET BCHI=$ORDER(^BCHTRPT(BCHRPT,11,BCHI))
IF BCHI'=+BCHI
QUIT
Begin DoDot:1
+9 IF $Y>(IOSL-5)
DO PAUSE^BCHRL01
WRITE @IOF
+10 WRITE !?12,$PIECE(^BCHSORT(BCHI,0),U),": "
+11 KILL BCHQ
+12 SET BCHY=0
SET BCHC=0
FOR
SET BCHY=$ORDER(^BCHTRPT(BCHRPT,11,BCHI,11,"B",BCHY))
SET BCHC=BCHC+1
IF BCHY=""!($DATA(BCHQ))
QUIT
IF BCHC'=1
WRITE " ; "
SET X=BCHY
IF $DATA(^BCHSORT(BCHI,2))
XECUTE ^(2)
WRITE X
End DoDot:1
+13 KILL BCHC,BCHQ
+14 QUIT
SHOWR ;EP
+1 IF '$DATA(BCHDONE)
IF $DATA(IOF)
WRITE @IOF
+2 WRITE !!?6,$SELECT(BCHPTVS="V":"Visit",1:"Patient")_" SORTING Criteria"
+3 IF BCHTYPE="D"&('$DATA(BCHDONE))
WRITE !?12,"Date of Service range: ",BCHBDD," to ",BCHEDD
+4 IF BCHTYPE="S"&('$DATA(BCHDONE))
WRITE !?12,"Search Template: ",$PIECE(^DIBT(BCHSEAT,0),U)
+5 IF '$GET(BCHSORT)
QUIT
+6 WRITE !?12,$SELECT(BCHPTVS="V":"Visits",1:"Patients")_" will be sorted by: ",$PIECE(^BCHSORT(BCHSORT,0),U),!
+7 QUIT