AMHRLS ; IHS/CMI/LAB - SHOW SCREENS ;
;;4.0;IHS BEHAVIORAL HEALTH;;MAY 14, 2010
;
SHOWP ;EP
I '$D(AMHDONE) W:$D(IOF) @IOF
W !!?6,"PRINT Items Selected:"
I AMHCTYP="S" W !?12,"Report includes sub-totals and total only." Q
I AMHCTYP="T" W !?12,"Report will include total only." Q
Q:'$D(^AMHTRPT(AMHRPT,12))
S (AMHI,AMHTCW)=0 F S AMHI=$O(^AMHTRPT(AMHRPT,12,AMHI)) Q:AMHI'=+AMHI S AMHCRIT=$P(^AMHTRPT(AMHRPT,12,AMHI,0),U) D
.W !?12,$P(^AMHSORT(AMHCRIT,0),U)," - column width ",$P(^AMHTRPT(AMHRPT,12,AMHI,0),U,2) S AMHTCW=AMHTCW+$P(^(0),U,2)+2
.I $Y>(IOSL-5) D PAUSE^AMHRL01 W:$D(IOF) @IOF
W !!?12,"Total Report width (including column margins - 2 spaces): ",AMHTCW
Q
SHOW ;EP
W:$D(IOF) @IOF
I $D(AMHDONE) S AMHLHDR="REPORT SUMMARY" W ?((80-$L(AMHLHDR))/2),AMHLHDR,!
W !!?6,AMHPTTX_" Selection Criteria"
W:AMHTYPE="D" !?12,"Encounter Date range: ",AMHBDD," to ",AMHEDD
W:AMHTYPE="S" !?12,"Search Template: ",$P(^DIBT(AMHSEAT,0),U)
I $D(AMHRDTR),$D(AMHBDD) W !,"Encounter Date range: ",AMHBDD," to ",AMHEDD,"."
Q:'$D(^AMHTRPT(AMHRPT,11))
S AMHI=0 F S AMHI=$O(^AMHTRPT(AMHRPT,11,AMHI)) Q:AMHI'=+AMHI D
.I $Y>(IOSL-5) D PAUSE^AMHRL01 W @IOF
.W !?12,$P(^AMHSORT(AMHI,0),U),": "
.K AMHQ
.S AMHY=0,AMHC=0 F S AMHY=$O(^AMHTRPT(AMHRPT,11,AMHI,11,"B",AMHY)) S AMHC=AMHC+1 Q:AMHY=""!($D(AMHQ)) W:AMHC'=1 " ; " S X=AMHY X:$D(^AMHSORT(AMHI,2)) ^(2) W X
K AMHC,AMHQ
Q
SHOWR ;EP
I '$D(AMHDONE) W:$D(IOF) @IOF
W !!?6,AMHPTTX_" SORTING Criteria"
W:AMHTYPE="D"&('$D(AMHDONE)) !?12,"Encounter Date range: ",AMHBDD," to ",AMHEDD
W:AMHTYPE="S"&('$D(AMHDONE)) !?12,"Search Template: ",$P(^DIBT(AMHSEAT,0),U)
Q:'$G(AMHSORT)
W !?12,AMHPTTS_" will be sorted by: ",$P(^AMHSORT(AMHSORT,0),U),!
Q
AMHRLS ; IHS/CMI/LAB - SHOW SCREENS ;
+1 ;;4.0;IHS BEHAVIORAL HEALTH;;MAY 14, 2010
+2 ;
SHOWP ;EP
+1 IF '$DATA(AMHDONE)
IF $DATA(IOF)
WRITE @IOF
+2 WRITE !!?6,"PRINT Items Selected:"
+3 IF AMHCTYP="S"
WRITE !?12,"Report includes sub-totals and total only."
QUIT
+4 IF AMHCTYP="T"
WRITE !?12,"Report will include total only."
QUIT
+5 IF '$DATA(^AMHTRPT(AMHRPT,12))
QUIT
+6 SET (AMHI,AMHTCW)=0
FOR
SET AMHI=$ORDER(^AMHTRPT(AMHRPT,12,AMHI))
IF AMHI'=+AMHI
QUIT
SET AMHCRIT=$PIECE(^AMHTRPT(AMHRPT,12,AMHI,0),U)
Begin DoDot:1
+7 WRITE !?12,$PIECE(^AMHSORT(AMHCRIT,0),U)," - column width ",$PIECE(^AMHTRPT(AMHRPT,12,AMHI,0),U,2)
SET AMHTCW=AMHTCW+$PIECE(^(0),U,2)+2
+8 IF $Y>(IOSL-5)
DO PAUSE^AMHRL01
IF $DATA(IOF)
WRITE @IOF
End DoDot:1
+9 WRITE !!?12,"Total Report width (including column margins - 2 spaces): ",AMHTCW
+10 QUIT
SHOW ;EP
+1 IF $DATA(IOF)
WRITE @IOF
+2 IF $DATA(AMHDONE)
SET AMHLHDR="REPORT SUMMARY"
WRITE ?((80-$LENGTH(AMHLHDR))/2),AMHLHDR,!
+3 WRITE !!?6,AMHPTTX_" Selection Criteria"
+4 IF AMHTYPE="D"
WRITE !?12,"Encounter Date range: ",AMHBDD," to ",AMHEDD
+5 IF AMHTYPE="S"
WRITE !?12,"Search Template: ",$PIECE(^DIBT(AMHSEAT,0),U)
+6 IF $DATA(AMHRDTR)
IF $DATA(AMHBDD)
WRITE !,"Encounter Date range: ",AMHBDD," to ",AMHEDD,"."
+7 IF '$DATA(^AMHTRPT(AMHRPT,11))
QUIT
+8 SET AMHI=0
FOR
SET AMHI=$ORDER(^AMHTRPT(AMHRPT,11,AMHI))
IF AMHI'=+AMHI
QUIT
Begin DoDot:1
+9 IF $Y>(IOSL-5)
DO PAUSE^AMHRL01
WRITE @IOF
+10 WRITE !?12,$PIECE(^AMHSORT(AMHI,0),U),": "
+11 KILL AMHQ
+12 SET AMHY=0
SET AMHC=0
FOR
SET AMHY=$ORDER(^AMHTRPT(AMHRPT,11,AMHI,11,"B",AMHY))
SET AMHC=AMHC+1
IF AMHY=""!($DATA(AMHQ))
QUIT
IF AMHC'=1
WRITE " ; "
SET X=AMHY
IF $DATA(^AMHSORT(AMHI,2))
XECUTE ^(2)
WRITE X
End DoDot:1
+13 KILL AMHC,AMHQ
+14 QUIT
SHOWR ;EP
+1 IF '$DATA(AMHDONE)
IF $DATA(IOF)
WRITE @IOF
+2 WRITE !!?6,AMHPTTX_" SORTING Criteria"
+3 IF AMHTYPE="D"&('$DATA(AMHDONE))
WRITE !?12,"Encounter Date range: ",AMHBDD," to ",AMHEDD
+4 IF AMHTYPE="S"&('$DATA(AMHDONE))
WRITE !?12,"Search Template: ",$PIECE(^DIBT(AMHSEAT,0),U)
+5 IF '$GET(AMHSORT)
QUIT
+6 WRITE !?12,AMHPTTS_" will be sorted by: ",$PIECE(^AMHSORT(AMHSORT,0),U),!
+7 QUIT