ACMRLS ; IHS/TUCSON/TMJ - APC visit counts - show screens ; [ 06/01/1999 1:43 PM ]
;;2.0;DIABETES MANAGEMENT SYSTEM;**5**;JUN 14, 2007
;
SHOWP ;EP
I '$D(ACMDONE) W:$D(IOF) @IOF
I ACMCTYP="F" D FLAT Q ;IHS/CMI/LAB
W !!?6,"PRINT Items Selected:"
I ACMCTYP="S" W !,?12,"Report includes sub-totals and total only." Q
I ACMCTYP="T" W !,?12,"Report will includes total only." Q
Q:'$D(^ACM(58.8,ACMRPT,12))
S (ACMI,ACMTCW)=0 F S ACMI=$O(^ACM(58.8,ACMRPT,12,ACMI)) Q:ACMI'=+ACMI S ACMCRIT=$P(^ACM(58.8,ACMRPT,12,ACMI,0),U) D
.W !?12,$P(^ACM(58.1,ACMCRIT,0),U)," - column width ",$P(^ACM(58.8,ACMRPT,12,ACMI,0),U,2) S ACMTCW=ACMTCW+$P(^(0),U,2)+2
.I $Y>(IOSL-5) D PAUSE^ACMRL01 W:$D(IOF) @IOF
W !!?12,"Total Report width (including column margins - 2 spaces): ",ACMTCW
Q
FLAT ;IHS/CMI/LAB - flat file
W !!?6,"Items selected for flat file output:"
S (ACMI,ACMTCW)=0 F S ACMI=$O(^ACM(58.8,ACMRPT,12,ACMI)) Q:ACMI'=+ACMI S ACMCRIT=$P(^ACM(58.8,ACMRPT,12,ACMI,0),U) D
.W !?12,$P(^ACM(58.1,ACMCRIT,0),U)
.I $Y>(IOSL-5) D PAUSE^ACMRL01 W:$D(IOF) @IOF
Q
SHOW ;EP
W:$D(IOF) @IOF
I $D(ACMDONE) S ACMLHDR="REPORT SUMMARY" W ?((80-$L(ACMLHDR))/2),ACMLHDR,!
W !!?6,"CMS REGISTER PATIENT Selection Criteria:"
Q:'$D(^ACM(58.8,ACMRPT,11))
S ACMI=0 F S ACMI=$O(^ACM(58.8,ACMRPT,11,ACMI)) Q:ACMI'=+ACMI D
.I $Y>(IOSL-5) D PAUSE^ACMRL01 W @IOF
.W !?12,$P(^ACM(58.1,ACMI,0),U),": "
.K ACMQ
.S ACMY="",ACMC=0 F S ACMY=$O(^ACM(58.8,ACMRPT,11,ACMI,11,"B",ACMY)) S ACMC=ACMC+1 Q:ACMY=""!($D(ACMQ)) W:ACMC'=1 " ; " S X=ACMY X:$D(^ACM(58.1,ACMI,2)) ^(2) W X
K ACMC,ACMQ
Q
SHOWR ;EP
I '$D(ACMDONE) W:$D(IOF) @IOF
W !!?6,"CMS REGISTER PATIENT SORTING Criteria:"
Q:'$G(ACMSORT)
W !?12,"CMS REGISTER PATIENTS will be sorted by: ",$P(^ACM(58.1,ACMSORT,0),U),!
Q
ACMRLS ; IHS/TUCSON/TMJ - APC visit counts - show screens ; [ 06/01/1999 1:43 PM ]
+1 ;;2.0;DIABETES MANAGEMENT SYSTEM;**5**;JUN 14, 2007
+2 ;
SHOWP ;EP
+1 IF '$DATA(ACMDONE)
IF $DATA(IOF)
WRITE @IOF
+2 ;IHS/CMI/LAB
IF ACMCTYP="F"
DO FLAT
QUIT
+3 WRITE !!?6,"PRINT Items Selected:"
+4 IF ACMCTYP="S"
WRITE !,?12,"Report includes sub-totals and total only."
QUIT
+5 IF ACMCTYP="T"
WRITE !,?12,"Report will includes total only."
QUIT
+6 IF '$DATA(^ACM(58.8,ACMRPT,12))
QUIT
+7 SET (ACMI,ACMTCW)=0
FOR
SET ACMI=$ORDER(^ACM(58.8,ACMRPT,12,ACMI))
IF ACMI'=+ACMI
QUIT
SET ACMCRIT=$PIECE(^ACM(58.8,ACMRPT,12,ACMI,0),U)
Begin DoDot:1
+8 WRITE !?12,$PIECE(^ACM(58.1,ACMCRIT,0),U)," - column width ",$PIECE(^ACM(58.8,ACMRPT,12,ACMI,0),U,2)
SET ACMTCW=ACMTCW+$PIECE(^(0),U,2)+2
+9 IF $Y>(IOSL-5)
DO PAUSE^ACMRL01
IF $DATA(IOF)
WRITE @IOF
End DoDot:1
+10 WRITE !!?12,"Total Report width (including column margins - 2 spaces): ",ACMTCW
+11 QUIT
FLAT ;IHS/CMI/LAB - flat file
+1 WRITE !!?6,"Items selected for flat file output:"
+2 SET (ACMI,ACMTCW)=0
FOR
SET ACMI=$ORDER(^ACM(58.8,ACMRPT,12,ACMI))
IF ACMI'=+ACMI
QUIT
SET ACMCRIT=$PIECE(^ACM(58.8,ACMRPT,12,ACMI,0),U)
Begin DoDot:1
+3 WRITE !?12,$PIECE(^ACM(58.1,ACMCRIT,0),U)
+4 IF $Y>(IOSL-5)
DO PAUSE^ACMRL01
IF $DATA(IOF)
WRITE @IOF
End DoDot:1
+5 QUIT
SHOW ;EP
+1 IF $DATA(IOF)
WRITE @IOF
+2 IF $DATA(ACMDONE)
SET ACMLHDR="REPORT SUMMARY"
WRITE ?((80-$LENGTH(ACMLHDR))/2),ACMLHDR,!
+3 WRITE !!?6,"CMS REGISTER PATIENT Selection Criteria:"
+4 IF '$DATA(^ACM(58.8,ACMRPT,11))
QUIT
+5 SET ACMI=0
FOR
SET ACMI=$ORDER(^ACM(58.8,ACMRPT,11,ACMI))
IF ACMI'=+ACMI
QUIT
Begin DoDot:1
+6 IF $Y>(IOSL-5)
DO PAUSE^ACMRL01
WRITE @IOF
+7 WRITE !?12,$PIECE(^ACM(58.1,ACMI,0),U),": "
+8 KILL ACMQ
+9 SET ACMY=""
SET ACMC=0
FOR
SET ACMY=$ORDER(^ACM(58.8,ACMRPT,11,ACMI,11,"B",ACMY))
SET ACMC=ACMC+1
IF ACMY=""!($DATA(ACMQ))
QUIT
IF ACMC'=1
WRITE " ; "
SET X=ACMY
IF $DATA(^ACM(58.1,ACMI,2))
XECUTE ^(2)
WRITE X
End DoDot:1
+10 KILL ACMC,ACMQ
+11 QUIT
SHOWR ;EP
+1 IF '$DATA(ACMDONE)
IF $DATA(IOF)
WRITE @IOF
+2 WRITE !!?6,"CMS REGISTER PATIENT SORTING Criteria:"
+3 IF '$GET(ACMSORT)
QUIT
+4 WRITE !?12,"CMS REGISTER PATIENTS will be sorted by: ",$PIECE(^ACM(58.1,ACMSORT,0),U),!
+5 QUIT