APCLAP9P ; IHS/CMI/LAB - print apc report ;
;;2.0;IHS PCC SUITE;;MAY 14, 2009
START ;
S (APCLTOT,APCLPG)=0 D HEAD
K APCLQUIT
D PRINT
;
DONE ;
D DONE^APCLOSUT
K ^XTMP("APCLAP9",APCLJOB,APCLBT)
Q
PRINT ;
W !,"FACILITY: ",$P(^DIC(4,APCLLOC,0),U)," - ",$P(^AUTTLOC(APCLLOC,0),U,10)
W !,"VISIT DATE RANGE: ",$$FMTE^XLFDT(APCLBD)," - ",$$FMTE^XLFDT(APCLED)
W !!,"Total Visits Processed in PCC: ",APCLGRAN
W !!,?45,"as of the Date the report was run:",!,?45,"# complete",?60,"# incomplete",!?45,"----------",?60,"------------",!
TYPE ;
S APCLX="",C=0 F S APCLX=$O(^XTMP("APCLAP9",APCLJOB,APCLBT,"TYPE",APCLX)) Q:APCLX=""!($D(APCLQUIT)) S C=C+1 D
.I $Y>(IOSL-5) D HEAD Q:$D(APCLQUIT)
.W ! W:C=1 "TYPE: " W ?19,APCLX,?45,$J($P(^XTMP("APCLAP9",APCLJOB,APCLBT,"TYPE",APCLX),U),6),?60,$J($P(^XTMP("APCLAP9",APCLJOB,APCLBT,"TYPE",APCLX),U,2),6)
W !! S APCLX="",C=0 F S APCLX=$O(^XTMP("APCLAP9",APCLJOB,APCLBT,"SC",APCLX)) Q:APCLX=""!($D(APCLQUIT)) S C=C+1 D
.I $Y>(IOSL-5) D HEAD Q:$D(APCLQUIT)
.W ! W:C=1 "SERVICE CATEGORY: " W ?19,$E(APCLX,1,24),?45,$J($P(^XTMP("APCLAP9",APCLJOB,APCLBT,"SC",APCLX),U),6),?60,$J($P(^XTMP("APCLAP9",APCLJOB,APCLBT,"SC",APCLX),U,2),6)
I $Y>(IOSL-5) D HEAD Q:$D(APCLQUIT)
W !!,"APC Acceptable Visits based on Headquarters Definition: ",$J(APCLAPC,7)
EXCL ;
I $Y>(IOSL-5) D HEAD Q:$D(APCLQUIT)
W !!,"Exclusions from APC System:",!
I $Y>(IOSL-5) D HEAD Q:$D(APCLQUIT)
W !?10,"Dental Clinic w/o Medication",?60,$J($S($G(^XTMP("APCLAP9",APCLJOB,APCLBT,"DENTAL NO MED")):^XTMP("APCLAP9",APCLJOB,APCLBT,"DENTAL NO MED"),1:0),6)
W !?10,"Other Excluded Clinic Type",?60,$J($S($G(^XTMP("APCLAP9",APCLJOB,APCLBT,"NONAPCCLN")):^XTMP("APCLAP9",APCLJOB,APCLBT,"NONAPCCLN"),1:0),6)
I $Y>(IOSL-5) D HEAD Q:$D(APCLQUIT)
W !?10,"Incomplete A, O or S",?60,$J($S($G(^XTMP("APCLAP9",APCLJOB,APCLBT,"AOS INCOMPLETE")):^XTMP("APCLAP9",APCLJOB,APCLBT,"AOS INCOMPLETE"),1:0),6)
I $Y>(IOSL-5) D HEAD Q:$D(APCLQUIT)
W !?10,"Non APC Service Category",?60,$J($S($G(^XTMP("APCLAP9",APCLJOB,APCLBT,"NONAPCSC")):^XTMP("APCLAP9",APCLJOB,APCLBT,"NONAPCSC"),1:0),6)
W !?10,"Non APC Visit Type",?60,$J($S($G(^XTMP("APCLAP9",APCLJOB,APCLBT,"NONAPCTYPE")):^XTMP("APCLAP9",APCLJOB,APCLBT,"NONAPCTYPE"),1:0),6)
I $Y>(IOSL-5) D HEAD Q:$D(APCLQUIT)
;W !?10,"Mult Visits same patient, same day, same clinic",?60,$J($S($G(^XTMP("APCLAP9",APCLJOB,APCLBT,"DUPLICATE")):^XTMP("APCLAP9",APCLJOB,APCLBT,"DUPLICATE"),1:0),6)
;I $Y>(IOSL-5) D HEAD Q:$D(APCLQUIT)
W !!?3,"Of the acceptable APC visits, ",$J($S($G(^XTMP("APCLAP9",APCLJOB,APCLBT,"IN XREF")):^XTMP("APCLAP9",APCLJOB,APCLBT,"IN XREF"),1:0),6)," were posted or modified after",!
W ?3,"the last NDW export and would not be reflected in reports from ",!,"the National Data Warehouse."
I $Y>(IOSL-5) D HEAD Q:$D(APCLQUIT)
W !?3,"Of the acceptable APC visits, ",$J($S($G(^XTMP("APCLAP9",APCLJOB,APCLBT,"NO EXPORT - ?")):^XTMP("APCLAP9",APCLJOB,APCLBT,"NO EXPORT - ?"),1:0),6)," were not exported due to an error."
W !?3,"These can be reviewed using other PCC reports.",!
Q
HEAD I 'APCLPG G HEAD1
I $E(IOST)="C",IO=IO(0) W ! S DIR(0)="EO" D ^DIR K DIR I Y=0!(Y="^")!($D(DTOUT)) S APCLQUIT="" Q
HEAD1 ;
W:$D(IOF) @IOF S APCLPG=APCLPG+1
W !?3,$P(^DIC(4,DUZ(2),0),U),?58,$$FMTE^XLFDT(DT),?72,"Page ",APCLPG,!
W ?28,"PCC DATA ANALYSIS REPORT",!
W $TR($J("",80)," ","*"),!
Q
APCLAP9P ; IHS/CMI/LAB - print apc report ;
+1 ;;2.0;IHS PCC SUITE;;MAY 14, 2009
START ;
+1 SET (APCLTOT,APCLPG)=0
DO HEAD
+2 KILL APCLQUIT
+3 DO PRINT
+4 ;
DONE ;
+1 DO DONE^APCLOSUT
+2 KILL ^XTMP("APCLAP9",APCLJOB,APCLBT)
+3 QUIT
PRINT ;
+1 WRITE !,"FACILITY: ",$PIECE(^DIC(4,APCLLOC,0),U)," - ",$PIECE(^AUTTLOC(APCLLOC,0),U,10)
+2 WRITE !,"VISIT DATE RANGE: ",$$FMTE^XLFDT(APCLBD)," - ",$$FMTE^XLFDT(APCLED)
+3 WRITE !!,"Total Visits Processed in PCC: ",APCLGRAN
+4 WRITE !!,?45,"as of the Date the report was run:",!,?45,"# complete",?60,"# incomplete",!?45,"----------",?60,"------------",!
TYPE ;
+1 SET APCLX=""
SET C=0
FOR
SET APCLX=$ORDER(^XTMP("APCLAP9",APCLJOB,APCLBT,"TYPE",APCLX))
IF APCLX=""!($DATA(APCLQUIT))
QUIT
SET C=C+1
Begin DoDot:1
+2 IF $Y>(IOSL-5)
DO HEAD
IF $DATA(APCLQUIT)
QUIT
+3 WRITE !
IF C=1
WRITE "TYPE: "
WRITE ?19,APCLX,?45,$JUSTIFY($PIECE(^XTMP("APCLAP9",APCLJOB,APCLBT,"TYPE",APCLX),U),6),?60,$JUSTIFY($PIECE(^XTMP("APCLAP9",APCLJOB,APCLBT,"TYPE",APCLX),U,2),6)
End DoDot:1
+4 WRITE !!
SET APCLX=""
SET C=0
FOR
SET APCLX=$ORDER(^XTMP("APCLAP9",APCLJOB,APCLBT,"SC",APCLX))
IF APCLX=""!($DATA(APCLQUIT))
QUIT
SET C=C+1
Begin DoDot:1
+5 IF $Y>(IOSL-5)
DO HEAD
IF $DATA(APCLQUIT)
QUIT
+6 WRITE !
IF C=1
WRITE "SERVICE CATEGORY: "
WRITE ?19,$EXTRACT(APCLX,1,24),?45,$JUSTIFY($PIECE(^XTMP("APCLAP9",APCLJOB,APCLBT,"SC",APCLX),U),6),?60,$JUSTIFY($PIECE(^XTMP("APCLAP9",APCLJOB,APCLBT,"SC",APCLX),U,2),6)
End DoDot:1
+7 IF $Y>(IOSL-5)
DO HEAD
IF $DATA(APCLQUIT)
QUIT
+8 WRITE !!,"APC Acceptable Visits based on Headquarters Definition: ",$JUSTIFY(APCLAPC,7)
EXCL ;
+1 IF $Y>(IOSL-5)
DO HEAD
IF $DATA(APCLQUIT)
QUIT
+2 WRITE !!,"Exclusions from APC System:",!
+3 IF $Y>(IOSL-5)
DO HEAD
IF $DATA(APCLQUIT)
QUIT
+4 WRITE !?10,"Dental Clinic w/o Medication",?60,$JUSTIFY($SELECT($GET(^XTMP("APCLAP9",APCLJOB,APCLBT,"DENTAL NO MED")):^XTMP("APCLAP9",APCLJOB,APCLBT,"DENTAL NO MED"),1:0),6)
+5 WRITE !?10,"Other Excluded Clinic Type",?60,$JUSTIFY($SELECT($GET(^XTMP("APCLAP9",APCLJOB,APCLBT,"NONAPCCLN")):^XTMP("APCLAP9",APCLJOB,APCLBT,"NONAPCCLN"),1:0),6)
+6 IF $Y>(IOSL-5)
DO HEAD
IF $DATA(APCLQUIT)
QUIT
+7 WRITE !?10,"Incomplete A, O or S",?60,$JUSTIFY($SELECT($GET(^XTMP("APCLAP9",APCLJOB,APCLBT,"AOS INCOMPLETE")):^XTMP("APCLAP9",APCLJOB,APCLBT,"AOS INCOMPLETE"),1:0),6)
+8 IF $Y>(IOSL-5)
DO HEAD
IF $DATA(APCLQUIT)
QUIT
+9 WRITE !?10,"Non APC Service Category",?60,$JUSTIFY($SELECT($GET(^XTMP("APCLAP9",APCLJOB,APCLBT,"NONAPCSC")):^XTMP("APCLAP9",APCLJOB,APCLBT,"NONAPCSC"),1:0),6)
+10 WRITE !?10,"Non APC Visit Type",?60,$JUSTIFY($SELECT($GET(^XTMP("APCLAP9",APCLJOB,APCLBT,"NONAPCTYPE")):^XTMP("APCLAP9",APCLJOB,APCLBT,"NONAPCTYPE"),1:0),6)
+11 IF $Y>(IOSL-5)
DO HEAD
IF $DATA(APCLQUIT)
QUIT
+12 ;W !?10,"Mult Visits same patient, same day, same clinic",?60,$J($S($G(^XTMP("APCLAP9",APCLJOB,APCLBT,"DUPLICATE")):^XTMP("APCLAP9",APCLJOB,APCLBT,"DUPLICATE"),1:0),6)
+13 ;I $Y>(IOSL-5) D HEAD Q:$D(APCLQUIT)
+14 WRITE !!?3,"Of the acceptable APC visits, ",$JUSTIFY($SELECT($GET(^XTMP("APCLAP9",APCLJOB,APCLBT,"IN XREF")):^XTMP("APCLAP9",APCLJOB,APCLBT,"IN XREF"),1:0),6)," were posted or modified after",!
+15 WRITE ?3,"the last NDW export and would not be reflected in reports from ",!,"the National Data Warehouse."
+16 IF $Y>(IOSL-5)
DO HEAD
IF $DATA(APCLQUIT)
QUIT
+17 WRITE !?3,"Of the acceptable APC visits, ",$JUSTIFY($SELECT($GET(^XTMP("APCLAP9",APCLJOB,APCLBT,"NO EXPORT - ?")):^XTMP("APCLAP9",APCLJOB,APCLBT,"NO EXPORT - ?"),1:0),6)," were not exported due to an error."
+18 WRITE !?3,"These can be reviewed using other PCC reports.",!
+19 QUIT
HEAD IF 'APCLPG
GOTO HEAD1
+1 IF $EXTRACT(IOST)="C"
IF IO=IO(0)
WRITE !
SET DIR(0)="EO"
DO ^DIR
KILL DIR
IF Y=0!(Y="^")!($DATA(DTOUT))
SET APCLQUIT=""
QUIT
HEAD1 ;
+1 IF $DATA(IOF)
WRITE @IOF
SET APCLPG=APCLPG+1
+2 WRITE !?3,$PIECE(^DIC(4,DUZ(2),0),U),?58,$$FMTE^XLFDT(DT),?72,"Page ",APCLPG,!
+3 WRITE ?28,"PCC DATA ANALYSIS REPORT",!
+4 WRITE $TRANSLATE($JUSTIFY("",80)," ","*"),!
+5 QUIT