APCLVLS ; IHS/CMI/LAB - APC visit counts - show screens ; 29 Jun 2009 7:10 AM
;;2.0;IHS PCC SUITE;**2**;MAY 14, 2009
;
SHOWP ;EP
I '$D(APCLDONE) W:$D(IOF) @IOF
W !!?6,"REPORT/OUTPUT Type:"
I APCLCTYP="S" W !,?12,"Report includes sub-totals by ",$G(APCLSORV)," and total count." Q
I APCLCTYP="T" W !,?12,"Report will include total only." Q
I APCLCTYP="C" W !?12,"SEARCH TEMPLATE ",$P(^DIBT(APCLSTMP,0),U)," will be created.",!?12,"Total record count will be displayed." Q
I APCLCTYP="F" W !?12,"FLAT file of Area Database formatted records will be created.",!?12,"File Name: ",APCLOUTF
Q:'$D(^APCLVRPT(APCLRPT,12))
W !?12,"PRINT Items Selected:"
S (APCLI,APCLTCW)=0 F S APCLI=$O(^APCLVRPT(APCLRPT,12,APCLI)) Q:APCLI'=+APCLI S APCLCRIT=$P(^APCLVRPT(APCLRPT,12,APCLI,0),U) D
.W !?12,$P(^APCLVSTS(APCLCRIT,0),U)," - column width ",$P(^APCLVRPT(APCLRPT,12,APCLI,0),U,2) S APCLTCW=APCLTCW+$P(^(0),U,2)+2
.I $Y>(IOSL-5) D PAUSE^APCLVL01 W:$D(IOF) @IOF
W !?12,"Total Report width (including column margins - 2 spaces): ",APCLTCW
Q
SHOW ;EP
W:$D(IOF) @IOF
I $D(APCLDONE) S APCLLHDR="REPORT SUMMARY" W ?((80-$L(APCLLHDR))/2),APCLLHDR,!
W !!?6,$S(APCLPTVS="V":"VISIT",1:"PATIENT")_" Selection Criteria:"
W:APCLTYPE="VV" !?12,"VISIT Search Template: ",$P(^DIBT(APCLSEAT,0),U)
W:APCLTYPE="VP" !?12,"PATIENT Search Template: ",$P(^DIBT(APCLSEAT,0),U)
W:APCLTYPE["V" !?12,"Encounter Date range: ",APCLBDD," to ",APCLEDD
W:APCLTYPE="PS" !?12,"PATIENT Search Template: ",$P(^DIBT(APCLSEAT,0),U)
I APCLTYPE="PR"!(APCLTYPE="VR") W !!?6,"CMS Register: ",$P(^ACM(41.1,APCLCMSR,0),U) I $D(APCLCMSS) W " Status: ",$O(APCLCMSS(""))
Q:'$D(^APCLVRPT(APCLRPT,11))
S APCLI=0 F S APCLI=$O(^APCLVRPT(APCLRPT,11,APCLI)) Q:APCLI'=+APCLI D
.I $Y>(IOSL-5) D PAUSE^APCLVL01 W @IOF
.W !?12,$P(^APCLVSTS(APCLI,0),U),": "
.K APCLQ
.S APCLY="",APCLC=0 K APCLQ F S APCLY=$O(^APCLVRPT(APCLRPT,11,APCLI,11,"B",APCLY)) S APCLC=APCLC+1 Q:APCLY=""!($D(APCLQ)) S APCLZ=$O(^APCLVRPT(APCLRPT,11,APCLI,11,"B",APCLY,0)) W:APCLC'=1 " ; " S X=APCLY X:$D(^APCLVSTS(APCLI,2)) ^(2) W X
K APCLC,APCLQ
Q
SHOWR ;EP
I '$D(APCLDONE) W:$D(IOF) @IOF
W !!?6,"SORTING Item:"
I APCLCTYP="T" W !?12,"Total only will be displayed, no sorting done.",! Q
I APCLCTYP="C" W !?12,"Search Template being created, no sorting done.",! Q
;W:APCLTYPE="D"&('$D(APCLDONE)) !?12,"Encounter Date range: ",APCLBDD," to ",APCLEDD
;W:APCLTYPE="S"&('$D(APCLDONE)) !?12,"Search Template: ",$P(^DIBT(APCLSEAT,0),U)
Q:'$G(APCLSORT)
W !?12,$S(APCLPTVS="V":"Visits",1:"Patients")_" will be sorted by: ",$P(^APCLVSTS(APCLSORT,0),U),!
Q
APCLVLS ; IHS/CMI/LAB - APC visit counts - show screens ; 29 Jun 2009 7:10 AM
+1 ;;2.0;IHS PCC SUITE;**2**;MAY 14, 2009
+2 ;
SHOWP ;EP
+1 IF '$DATA(APCLDONE)
IF $DATA(IOF)
WRITE @IOF
+2 WRITE !!?6,"REPORT/OUTPUT Type:"
+3 IF APCLCTYP="S"
WRITE !,?12,"Report includes sub-totals by ",$GET(APCLSORV)," and total count."
QUIT
+4 IF APCLCTYP="T"
WRITE !,?12,"Report will include total only."
QUIT
+5 IF APCLCTYP="C"
WRITE !?12,"SEARCH TEMPLATE ",$PIECE(^DIBT(APCLSTMP,0),U)," will be created.",!?12,"Total record count will be displayed."
QUIT
+6 IF APCLCTYP="F"
WRITE !?12,"FLAT file of Area Database formatted records will be created.",!?12,"File Name: ",APCLOUTF
+7 IF '$DATA(^APCLVRPT(APCLRPT,12))
QUIT
+8 WRITE !?12,"PRINT Items Selected:"
+9 SET (APCLI,APCLTCW)=0
FOR
SET APCLI=$ORDER(^APCLVRPT(APCLRPT,12,APCLI))
IF APCLI'=+APCLI
QUIT
SET APCLCRIT=$PIECE(^APCLVRPT(APCLRPT,12,APCLI,0),U)
Begin DoDot:1
+10 WRITE !?12,$PIECE(^APCLVSTS(APCLCRIT,0),U)," - column width ",$PIECE(^APCLVRPT(APCLRPT,12,APCLI,0),U,2)
SET APCLTCW=APCLTCW+$PIECE(^(0),U,2)+2
+11 IF $Y>(IOSL-5)
DO PAUSE^APCLVL01
IF $DATA(IOF)
WRITE @IOF
End DoDot:1
+12 WRITE !?12,"Total Report width (including column margins - 2 spaces): ",APCLTCW
+13 QUIT
SHOW ;EP
+1 IF $DATA(IOF)
WRITE @IOF
+2 IF $DATA(APCLDONE)
SET APCLLHDR="REPORT SUMMARY"
WRITE ?((80-$LENGTH(APCLLHDR))/2),APCLLHDR,!
+3 WRITE !!?6,$SELECT(APCLPTVS="V":"VISIT",1:"PATIENT")_" Selection Criteria:"
+4 IF APCLTYPE="VV"
WRITE !?12,"VISIT Search Template: ",$PIECE(^DIBT(APCLSEAT,0),U)
+5 IF APCLTYPE="VP"
WRITE !?12,"PATIENT Search Template: ",$PIECE(^DIBT(APCLSEAT,0),U)
+6 IF APCLTYPE["V"
WRITE !?12,"Encounter Date range: ",APCLBDD," to ",APCLEDD
+7 IF APCLTYPE="PS"
WRITE !?12,"PATIENT Search Template: ",$PIECE(^DIBT(APCLSEAT,0),U)
+8 IF APCLTYPE="PR"!(APCLTYPE="VR")
WRITE !!?6,"CMS Register: ",$PIECE(^ACM(41.1,APCLCMSR,0),U)
IF $DATA(APCLCMSS)
WRITE " Status: ",$ORDER(APCLCMSS(""))
+9 IF '$DATA(^APCLVRPT(APCLRPT,11))
QUIT
+10 SET APCLI=0
FOR
SET APCLI=$ORDER(^APCLVRPT(APCLRPT,11,APCLI))
IF APCLI'=+APCLI
QUIT
Begin DoDot:1
+11 IF $Y>(IOSL-5)
DO PAUSE^APCLVL01
WRITE @IOF
+12 WRITE !?12,$PIECE(^APCLVSTS(APCLI,0),U),": "
+13 KILL APCLQ
+14 SET APCLY=""
SET APCLC=0
KILL APCLQ
FOR
SET APCLY=$ORDER(^APCLVRPT(APCLRPT,11,APCLI,11,"B",APCLY))
SET APCLC=APCLC+1
IF APCLY=""!($DATA(APCLQ))
QUIT
SET APCLZ=$ORDER(^APCLVRPT(APCLRPT,11,APCLI,11,"B",APCLY,0))
IF APCLC'=1
WRITE " ; "
SET X=APCLY
IF $DATA(^APCLVSTS(APCLI,2))
XECUTE ^(2)
WRITE X
End DoDot:1
+15 KILL APCLC,APCLQ
+16 QUIT
SHOWR ;EP
+1 IF '$DATA(APCLDONE)
IF $DATA(IOF)
WRITE @IOF
+2 WRITE !!?6,"SORTING Item:"
+3 IF APCLCTYP="T"
WRITE !?12,"Total only will be displayed, no sorting done.",!
QUIT
+4 IF APCLCTYP="C"
WRITE !?12,"Search Template being created, no sorting done.",!
QUIT
+5 ;W:APCLTYPE="D"&('$D(APCLDONE)) !?12,"Encounter Date range: ",APCLBDD," to ",APCLEDD
+6 ;W:APCLTYPE="S"&('$D(APCLDONE)) !?12,"Search Template: ",$P(^DIBT(APCLSEAT,0),U)
+7 IF '$GET(APCLSORT)
QUIT
+8 WRITE !?12,$SELECT(APCLPTVS="V":"Visits",1:"Patients")_" will be sorted by: ",$PIECE(^APCLVSTS(APCLSORT,0),U),!
+9 QUIT