APCDFOSP ; IHS/CMI/LAB - PRINT FORMS TRACKING SUMMARY ;
;;2.0;IHS PCC SUITE;;MAY 14, 2009
S (APCDPAGE,APCDQUIT)=0 S Y=DT D DD^%DT S APCDDT=Y S Y=APCDBD D DD^%DT S APCDBDT=Y S Y=APCDED D DD^%DT S APCDEDT=Y
I '$D(^XTMP("APCDFOS",APCDJ,APCDBT)) D HEAD W !!,"NO DATA TO REPORT",!! G XIT
D HEAD
D PROC
D XIT
Q
PROC ;
W !!,"This report will include counts on Visits created or appended to during the",!,"data entry process. Data entered via the option ENTER NON-VISIT DATA are not"
W !,"counted because no visit file is created. The count of these forms must be",!,"tallied manually. The counts are taken from the forms tracking file.",!,"Therefore, you must be "
W "running forms tracking for this report to have any data.",!
TOT ;
D:$Y>(IOSL-6) HEAD Q:APCDQUIT
W !,"There were a total of ",APCDTOT," visits processed during the time period.",!,"specified. Below is a further breakdown of these visits.",!
CHS ;
G HOSP
D:$Y>(IOSL-6) HEAD Q:APCDQUIT
W !,"CONTRACT HEALTH SERVICES",!
W !,"There were ",$S($G(^XTMP("APCDFOS",APCDJ,APCDBT,"CHS","TOTAL")):^("TOTAL"),1:" 0")," medical authorizations processed during this period."
G:'$G(^XTMP("APCDFOS",APCDJ,APCDBT,"CHS","TOTAL")) HOSP
D:$Y>(IOSL-6) HEAD Q:APCDQUIT W !!?2,"By SERVICE CATEGORY:"
S X="" F S X=$O(^XTMP("APCDFOS",APCDJ,APCDBT,"CHS","CAT",X)) Q:X=""!(APCDQUIT) D
.D:$Y>(IOSL-6) HEAD Q:APCDQUIT
.W !,?5,$E(X,1,30),?35,$J(^XTMP("APCDFOS",APCDJ,APCDBT,"CHS","CAT",X),8)
.Q
Q:APCDQUIT
D:$Y>(IOSL-6) HEAD Q:APCDQUIT W !!?2,"By LOCATION:"
S X="" F S X=$O(^XTMP("APCDFOS",APCDJ,APCDBT,"CHS","LOC",X)) Q:X=""!(APCDQUIT) D
.D:$Y>(IOSL-6) HEAD Q:APCDQUIT
.W !,?5,$E(X,1,30),?35,$J(^XTMP("APCDFOS",APCDJ,APCDBT,"CHS","LOC",X),8)
.Q
Q:APCDQUIT
HOSP ;
I $Y>(IOSL-8) D HEAD Q:APCDQUIT
W !!!,"HOSPITALIZATIONS (HSA-44)",!
W !,"There were ",$S($G(^XTMP("APCDFOS",APCDJ,APCDBT,"HOSP","TOTAL")):^("TOTAL"),1:" 0")," hospitalization documents during this period."
G:'$G(^XTMP("APCDFOS",APCDJ,APCDBT,"HOSP","TOTAL")) INHOSP
D:$Y>(IOSL-5) HEAD Q:APCDQUIT W !!?2,"By TYPE:"
S X="" F S X=$O(^XTMP("APCDFOS",APCDJ,APCDBT,"HOSP","TYPE",X)) Q:X=""!(APCDQUIT) D
.D:$Y>(IOSL-6) HEAD Q:APCDQUIT
.W !,?5,$E(X,1,30),?35,$J(^XTMP("APCDFOS",APCDJ,APCDBT,"HOSP","TYPE",X),8)
.Q
Q:APCDQUIT
D:$Y>(IOSL-6) HEAD Q:APCDQUIT W !!?2,"By LOCATION:"
S X="" F S X=$O(^XTMP("APCDFOS",APCDJ,APCDBT,"HOSP","LOC",X)) Q:X=""!(APCDQUIT) D
.D:$Y>(IOSL-6) HEAD Q:APCDQUIT
.W !,?5,$E(X,1,30),?35,$J(^XTMP("APCDFOS",APCDJ,APCDBT,"HOSP","LOC",X),8)
.Q
Q:APCDQUIT
INHOSP ;
I $Y>(IOSL-8) D HEAD Q:APCDQUIT
W !!!,"IN-HOSPITAL VISITS (NON-CHS):",!
W !,"There were ",$S($G(^XTMP("APCDFOS",APCDJ,APCDBT,"INHOSP","TOTAL")):^("TOTAL"),1:" 0")," in-hospital documents during this period."
G:'$G(^XTMP("APCDFOS",APCDJ,APCDBT,"INHOSP","TOTAL")) AMB
I $Y>(IOSL-5) D HEAD Q:APCDQUIT
W !!?2,"By TYPE:"
S X="" F S X=$O(^XTMP("APCDFOS",APCDJ,APCDBT,"INHOSP","TYPE",X)) Q:X=""!(APCDQUIT) D
.D:$Y>(IOSL-6) HEAD Q:APCDQUIT
.W !,?5,$E(X,1,30),?35,$J(^XTMP("APCDFOS",APCDJ,APCDBT,"INHOSP","TYPE",X),8)
.Q
Q:APCDQUIT
D:$Y>(IOSL-6) HEAD Q:APCDQUIT W !!?2,"By LOCATION:"
S X="" F S X=$O(^XTMP("APCDFOS",APCDJ,APCDBT,"INHOSP","LOC",X)) Q:X=""!(APCDQUIT) D
.D:$Y>(IOSL-6) HEAD Q:APCDQUIT
.W !,?5,$E(X,1,30),?35,$J(^XTMP("APCDFOS",APCDJ,APCDBT,"INHOSP","LOC",X),8)
.Q
Q:$G(APCDQUIT)
AMB ;
D AMB^APCDFOS2
Q:APCDQUIT
Q
XIT ;
I 'APCDQUIT,$E(IOST)="C",IO=IO(0) S DIR("A")="End of report. Press return.",DIR(0)="E" D ^DIR K DIR
W:$D(IOF) @IOF
K ^XTMP("APCDFOS",APCDJ,APCDBT)
K APCDJ,APCDBT
Q
HEAD ;EP
I 'APCDPAGE G HEAD1
NEW X
I $E(IOST)="C",IO=IO(0) W ! S DIR(0)="EO" D ^DIR K DIR I Y=0!(Y="^")!($D(DTOUT)) S APCDQUIT=1 Q
S APCDPAGE=APCDPAGE+1
W:$D(IOF) @IOF W !,?35,"Data Entry Forms Summary Page ",APCDPAGE,!
Q
HEAD1 ;
W:$D(IOF) @IOF S APCDPAGE=APCDPAGE+1
W !,"Report Run Date: ",APCDDT,?70,"Page ",APCDPAGE
W !!?15,"SUMMARY COUNT OF VISITS PROCESSED BY DATA ENTRY",!
W ?20,"FOR: ",APCDBDT," TO ",APCDEDT,!
S L=$L($P(^DIC(4,DUZ(2),0),U)) W ?((80-L)/2),$P(^DIC(4,DUZ(2),0),U),!
Q
APCDFOSP ; IHS/CMI/LAB - PRINT FORMS TRACKING SUMMARY ;
+1 ;;2.0;IHS PCC SUITE;;MAY 14, 2009
+2 SET (APCDPAGE,APCDQUIT)=0
SET Y=DT
DO DD^%DT
SET APCDDT=Y
SET Y=APCDBD
DO DD^%DT
SET APCDBDT=Y
SET Y=APCDED
DO DD^%DT
SET APCDEDT=Y
+3 IF '$DATA(^XTMP("APCDFOS",APCDJ,APCDBT))
DO HEAD
WRITE !!,"NO DATA TO REPORT",!!
GOTO XIT
+4 DO HEAD
+5 DO PROC
+6 DO XIT
+7 QUIT
PROC ;
+1 WRITE !!,"This report will include counts on Visits created or appended to during the",!,"data entry process. Data entered via the option ENTER NON-VISIT DATA are not"
+2 WRITE !,"counted because no visit file is created. The count of these forms must be",!,"tallied manually. The counts are taken from the forms tracking file.",!,"Therefore, you must be "
+3 WRITE "running forms tracking for this report to have any data.",!
TOT ;
+1 IF $Y>(IOSL-6)
DO HEAD
IF APCDQUIT
QUIT
+2 WRITE !,"There were a total of ",APCDTOT," visits processed during the time period.",!,"specified. Below is a further breakdown of these visits.",!
CHS ;
+1 GOTO HOSP
+2 IF $Y>(IOSL-6)
DO HEAD
IF APCDQUIT
QUIT
+3 WRITE !,"CONTRACT HEALTH SERVICES",!
+4 WRITE !,"There were ",$SELECT($GET(^XTMP("APCDFOS",APCDJ,APCDBT,"CHS","TOTAL")):^("TOTAL"),1:" 0")," medical authorizations processed during this period."
+5 IF '$GET(^XTMP("APCDFOS",APCDJ,APCDBT,"CHS","TOTAL"))
GOTO HOSP
+6 IF $Y>(IOSL-6)
DO HEAD
IF APCDQUIT
QUIT
WRITE !!?2,"By SERVICE CATEGORY:"
+7 SET X=""
FOR
SET X=$ORDER(^XTMP("APCDFOS",APCDJ,APCDBT,"CHS","CAT",X))
IF X=""!(APCDQUIT)
QUIT
Begin DoDot:1
+8 IF $Y>(IOSL-6)
DO HEAD
IF APCDQUIT
QUIT
+9 WRITE !,?5,$EXTRACT(X,1,30),?35,$JUSTIFY(^XTMP("APCDFOS",APCDJ,APCDBT,"CHS","CAT",X),8)
+10 QUIT
End DoDot:1
+11 IF APCDQUIT
QUIT
+12 IF $Y>(IOSL-6)
DO HEAD
IF APCDQUIT
QUIT
WRITE !!?2,"By LOCATION:"
+13 SET X=""
FOR
SET X=$ORDER(^XTMP("APCDFOS",APCDJ,APCDBT,"CHS","LOC",X))
IF X=""!(APCDQUIT)
QUIT
Begin DoDot:1
+14 IF $Y>(IOSL-6)
DO HEAD
IF APCDQUIT
QUIT
+15 WRITE !,?5,$EXTRACT(X,1,30),?35,$JUSTIFY(^XTMP("APCDFOS",APCDJ,APCDBT,"CHS","LOC",X),8)
+16 QUIT
End DoDot:1
+17 IF APCDQUIT
QUIT
HOSP ;
+1 IF $Y>(IOSL-8)
DO HEAD
IF APCDQUIT
QUIT
+2 WRITE !!!,"HOSPITALIZATIONS (HSA-44)",!
+3 WRITE !,"There were ",$SELECT($GET(^XTMP("APCDFOS",APCDJ,APCDBT,"HOSP","TOTAL")):^("TOTAL"),1:" 0")," hospitalization documents during this period."
+4 IF '$GET(^XTMP("APCDFOS",APCDJ,APCDBT,"HOSP","TOTAL"))
GOTO INHOSP
+5 IF $Y>(IOSL-5)
DO HEAD
IF APCDQUIT
QUIT
WRITE !!?2,"By TYPE:"
+6 SET X=""
FOR
SET X=$ORDER(^XTMP("APCDFOS",APCDJ,APCDBT,"HOSP","TYPE",X))
IF X=""!(APCDQUIT)
QUIT
Begin DoDot:1
+7 IF $Y>(IOSL-6)
DO HEAD
IF APCDQUIT
QUIT
+8 WRITE !,?5,$EXTRACT(X,1,30),?35,$JUSTIFY(^XTMP("APCDFOS",APCDJ,APCDBT,"HOSP","TYPE",X),8)
+9 QUIT
End DoDot:1
+10 IF APCDQUIT
QUIT
+11 IF $Y>(IOSL-6)
DO HEAD
IF APCDQUIT
QUIT
WRITE !!?2,"By LOCATION:"
+12 SET X=""
FOR
SET X=$ORDER(^XTMP("APCDFOS",APCDJ,APCDBT,"HOSP","LOC",X))
IF X=""!(APCDQUIT)
QUIT
Begin DoDot:1
+13 IF $Y>(IOSL-6)
DO HEAD
IF APCDQUIT
QUIT
+14 WRITE !,?5,$EXTRACT(X,1,30),?35,$JUSTIFY(^XTMP("APCDFOS",APCDJ,APCDBT,"HOSP","LOC",X),8)
+15 QUIT
End DoDot:1
+16 IF APCDQUIT
QUIT
INHOSP ;
+1 IF $Y>(IOSL-8)
DO HEAD
IF APCDQUIT
QUIT
+2 WRITE !!!,"IN-HOSPITAL VISITS (NON-CHS):",!
+3 WRITE !,"There were ",$SELECT($GET(^XTMP("APCDFOS",APCDJ,APCDBT,"INHOSP","TOTAL")):^("TOTAL"),1:" 0")," in-hospital documents during this period."
+4 IF '$GET(^XTMP("APCDFOS",APCDJ,APCDBT,"INHOSP","TOTAL"))
GOTO AMB
+5 IF $Y>(IOSL-5)
DO HEAD
IF APCDQUIT
QUIT
+6 WRITE !!?2,"By TYPE:"
+7 SET X=""
FOR
SET X=$ORDER(^XTMP("APCDFOS",APCDJ,APCDBT,"INHOSP","TYPE",X))
IF X=""!(APCDQUIT)
QUIT
Begin DoDot:1
+8 IF $Y>(IOSL-6)
DO HEAD
IF APCDQUIT
QUIT
+9 WRITE !,?5,$EXTRACT(X,1,30),?35,$JUSTIFY(^XTMP("APCDFOS",APCDJ,APCDBT,"INHOSP","TYPE",X),8)
+10 QUIT
End DoDot:1
+11 IF APCDQUIT
QUIT
+12 IF $Y>(IOSL-6)
DO HEAD
IF APCDQUIT
QUIT
WRITE !!?2,"By LOCATION:"
+13 SET X=""
FOR
SET X=$ORDER(^XTMP("APCDFOS",APCDJ,APCDBT,"INHOSP","LOC",X))
IF X=""!(APCDQUIT)
QUIT
Begin DoDot:1
+14 IF $Y>(IOSL-6)
DO HEAD
IF APCDQUIT
QUIT
+15 WRITE !,?5,$EXTRACT(X,1,30),?35,$JUSTIFY(^XTMP("APCDFOS",APCDJ,APCDBT,"INHOSP","LOC",X),8)
+16 QUIT
End DoDot:1
+17 IF $GET(APCDQUIT)
QUIT
AMB ;
+1 DO AMB^APCDFOS2
+2 IF APCDQUIT
QUIT
+3 QUIT
XIT ;
+1 IF 'APCDQUIT
IF $EXTRACT(IOST)="C"
IF IO=IO(0)
SET DIR("A")="End of report. Press return."
SET DIR(0)="E"
DO ^DIR
KILL DIR
+2 IF $DATA(IOF)
WRITE @IOF
+3 KILL ^XTMP("APCDFOS",APCDJ,APCDBT)
+4 KILL APCDJ,APCDBT
+5 QUIT
HEAD ;EP
+1 IF 'APCDPAGE
GOTO HEAD1
+2 NEW X
+3 IF $EXTRACT(IOST)="C"
IF IO=IO(0)
WRITE !
SET DIR(0)="EO"
DO ^DIR
KILL DIR
IF Y=0!(Y="^")!($DATA(DTOUT))
SET APCDQUIT=1
QUIT
+4 SET APCDPAGE=APCDPAGE+1
+5 IF $DATA(IOF)
WRITE @IOF
WRITE !,?35,"Data Entry Forms Summary Page ",APCDPAGE,!
+6 QUIT
HEAD1 ;
+1 IF $DATA(IOF)
WRITE @IOF
SET APCDPAGE=APCDPAGE+1
+2 WRITE !,"Report Run Date: ",APCDDT,?70,"Page ",APCDPAGE
+3 WRITE !!?15,"SUMMARY COUNT OF VISITS PROCESSED BY DATA ENTRY",!
+4 WRITE ?20,"FOR: ",APCDBDT," TO ",APCDEDT,!
+5 SET L=$LENGTH($PIECE(^DIC(4,DUZ(2),0),U))
WRITE ?((80-L)/2),$PIECE(^DIC(4,DUZ(2),0),U),!
+6 QUIT