APCPSRP ; IHS/TUCSON/LAB - print Operational summary AUGUST 14, 1992 ; [ 08/17/03 8:19 PM ]
;;2.0;IHS PCC DATA EXTRACTION SYSTEM;**1,6**;APR 03, 1998
;IHS/CMI/LAB - XTMP
START ;
D CHKSITE^APCPDRI
S APCPSR("FAC PRINT")=$P(^DIC(4,DUZ(2),0),U)
S Y=$P(^APCPLOG(APCPSR("LOG"),0),U,3) D DD^%DT S APCPSR("RUN DATE")=Y
S APCPSR("PG")=0
D HEAD
K APCPSR("QUIT")
D PRINT
I $E(IOST)="C",IO=IO(0) W ! S DIR("A")="End of Report - Hit return",DIR(0)="EO" D ^DIR K DIR
EOJ ;
K APCP1,APCP2,APCP3,APCPX,APCPTOTO,APCPTOTC,APCPLC,APCPT
K APCPPTR,APCPWC,APCP3,APCPT,APCPTOTC,APCPTOTO
K X,Z,G,Y
Q
PRINT ;
OVERVIEW ;
I $Y>(IOSL-12) D HEAD Q:$D(APCPSR("QUIT"))
W !!
W !,"Your site is currently set up to generate the following record types: "
;W:$D(APCPS("APC")) !?10,"- Ambulatory Patient Care (APC) records"
;W:$D(APCPS("INPT")) !?10,"- Direct Inpatient System records"
;W:$D(APCPS("CHA")) !?10,"- Community Health Activity Reporting System (CHA) records"
W:$D(APCPS("STAT")) !?10,"- Statistical Database Records"
W !!,"This PCC Export was processed on ",APCPSR("RUN DATE")," for Posting Dates",!,APCPSR("PRINT BEGIN")," to ",APCPSR("PRINT END"),". A total of ",$P(^APCPLOG(APCPSR("LOG"),0),U,8)," visits were processed, exporting "
W !,"the following ",$P(^APCPLOG(APCPSR("LOG"),0),U,6)," transaction records:",!
;W:$P(^APCPLOG(APCPSR("LOG"),0),U,13) !?5,"- ",$J($P(^APCPLOG(APCPSR("LOG"),0),U,13),6),?15,"Ambulatory Patient Care (APC) Records"
;W:$P(^APCPLOG(APCPSR("LOG"),0),U,11) !?5,"- ",$J($P(^APCPLOG(APCPSR("LOG"),0),U,11),6),?15,"Direct Inpatient Records"
;W:$P(^APCPLOG(APCPSR("LOG"),0),U,14) !?5,"- ",$J($P(^APCPLOG(APCPSR("LOG"),0),U,14),6),?15,"Community Health Activity (CHA) Records"
W:$P(^APCPLOG(APCPSR("LOG"),0),U,18) !?5,"- ",$J($P(^APCPLOG(APCPSR("LOG"),0),U,18),6),?15,"Visits were exported (",$P(^(0),U,17)," total records/transactions)"
GEN ;
G STATDB
;I '$P(^APCPLOG(APCPSR("LOG"),0),U,6) G INPT
W !!,"APC VISITS EXPORTED"
W !,"Following is a breakdown of all visits that generated APC transactions by Visit",!,"Date, Type, Location, Service Category, Clinic and Primary Provider Discipline."
D APC^APCPSRP2
Q:$D(APCPSR("QUIT"))
INPT ;
G:'$P(^APCPLOG(APCPSR("LOG"),0),U,11) DENT
W !!!,"VISITS EXPORTED TO THE IHS DIRECT INPATIENT SYSTEM"
W !,"Following is a breakdown of all visits that generated Direct Inpatient",!,"Transactions:",!
D INPT^APCPSRP2
Q:$D(APCPSR("QUIT"))
;
DENT ;
G:'$D(^XTMP("APCPSR",APCPJOB,APCPBTH,"GEN","DENTWMEDS")) CHA
W !!,"DENTAL VISITS"
W !,^XTMP("APCPSR",APCPJOB,APCPBTH,"GEN","DENTWMEDS")," of the above PHARMACY Clinic visits were actually DENTAL Clinic visits",!,"on which a medication was prescribed. The DENTAL Clinic visits were ",!
W "converted to PHARMACY Clinic prior to generating the APC transaction record.",!
CHA ;PRINT CHA TOTALS
I '$D(APCPS("CHA")) G STATDB
W !!!,"COMMUNITY HEALTH NURSING ACTIVITY (CHA) TRANSACTIONS"
D ^APCPSRP4
Q:$D(APCPSR("QUIT"))
STATDB ;
;G:'$P(^APCPLOG(APCPSR("LOG"),0),U,17) SKIPPED
D ^APCPSRP5
Q:$D(APCPSR("QUIT"))
SKIPPED ;
;G:'$D(^XTMP("APCPSR",APCPJOB,APCPBTH,"SKIPPED","TOTAL")) TAPE
D ^APCPSRP3
Q:$D(APCPSR("QUIT"))
TAPE ;
W !!,"The Transmission Status for this Export is: "
K DIQ,DIC,DA,DR
S DIC="^APCPLOG(",DR=".15",DA=APCPSR("LOG"),DIQ(0)="E" D EN^DIQ1 K DIC,DA,DR,DIQ
W ^UTILITY("DIQ1",$J,9001005,APCPSR("LOG"),.15,"E"),!
Q
HEAD ;EP
I 'APCPSR("PG") G HEAD1
I $E(IOST)="C",IO=IO(0) W ! K DIR S DIR(0)="EO" D ^DIR K DIR I Y=0!(Y="^")!($D(DTOUT)) S APCPSR("QUIT")="" Q
S APCPSR("PG")=APCPSR("PG")+1
W:$D(IOF) @IOF W !?45,"PCC Transmission Summary Page ",APCPSR("PG")
Q
HEAD1 ;
W:$D(IOF) @IOF S APCPSR("PG")=APCPSR("PG")+1
S APCPSR("LENG")=30+$L(APCPSR("FAC PRINT"))
W !,"Report Run Date: ",APCPSR("DTP"),?70,"Page ",APCPSR("PG")
W !!?((80-APCPSR("LENG"))/2),"DATA TRANSMISSION SUMMARY FOR ",APCPSR("FAC PRINT")
W !?20,"Date Export Run: ",APCPSR("RUN DATE")
Q
APCPSRP ; IHS/TUCSON/LAB - print Operational summary AUGUST 14, 1992 ; [ 08/17/03 8:19 PM ]
+1 ;;2.0;IHS PCC DATA EXTRACTION SYSTEM;**1,6**;APR 03, 1998
+2 ;IHS/CMI/LAB - XTMP
START ;
+1 DO CHKSITE^APCPDRI
+2 SET APCPSR("FAC PRINT")=$PIECE(^DIC(4,DUZ(2),0),U)
+3 SET Y=$PIECE(^APCPLOG(APCPSR("LOG"),0),U,3)
DO DD^%DT
SET APCPSR("RUN DATE")=Y
+4 SET APCPSR("PG")=0
+5 DO HEAD
+6 KILL APCPSR("QUIT")
+7 DO PRINT
+8 IF $EXTRACT(IOST)="C"
IF IO=IO(0)
WRITE !
SET DIR("A")="End of Report - Hit return"
SET DIR(0)="EO"
DO ^DIR
KILL DIR
EOJ ;
+1 KILL APCP1,APCP2,APCP3,APCPX,APCPTOTO,APCPTOTC,APCPLC,APCPT
+2 KILL APCPPTR,APCPWC,APCP3,APCPT,APCPTOTC,APCPTOTO
+3 KILL X,Z,G,Y
+4 QUIT
PRINT ;
OVERVIEW ;
+1 IF $Y>(IOSL-12)
DO HEAD
IF $DATA(APCPSR("QUIT"))
QUIT
+2 WRITE !!
+3 WRITE !,"Your site is currently set up to generate the following record types: "
+4 ;W:$D(APCPS("APC")) !?10,"- Ambulatory Patient Care (APC) records"
+5 ;W:$D(APCPS("INPT")) !?10,"- Direct Inpatient System records"
+6 ;W:$D(APCPS("CHA")) !?10,"- Community Health Activity Reporting System (CHA) records"
+7 IF $DATA(APCPS("STAT"))
WRITE !?10,"- Statistical Database Records"
+8 WRITE !!,"This PCC Export was processed on ",APCPSR("RUN DATE")," for Posting Dates",!,APCPSR("PRINT BEGIN")," to ",APCPSR("PRINT END"),". A total of ",$PIECE(^APCPLOG(APCPSR("LOG"),0),U,8)," visits were processed, exporting "
+9 WRITE !,"the following ",$PIECE(^APCPLOG(APCPSR("LOG"),0),U,6)," transaction records:",!
+10 ;W:$P(^APCPLOG(APCPSR("LOG"),0),U,13) !?5,"- ",$J($P(^APCPLOG(APCPSR("LOG"),0),U,13),6),?15,"Ambulatory Patient Care (APC) Records"
+11 ;W:$P(^APCPLOG(APCPSR("LOG"),0),U,11) !?5,"- ",$J($P(^APCPLOG(APCPSR("LOG"),0),U,11),6),?15,"Direct Inpatient Records"
+12 ;W:$P(^APCPLOG(APCPSR("LOG"),0),U,14) !?5,"- ",$J($P(^APCPLOG(APCPSR("LOG"),0),U,14),6),?15,"Community Health Activity (CHA) Records"
+13 IF $PIECE(^APCPLOG(APCPSR("LOG"),0),U,18)
WRITE !?5,"- ",$JUSTIFY($PIECE(^APCPLOG(APCPSR("LOG"),0),U,18),6),?15,"Visits were exported (",$PIECE(^(0),U,17)," total records/transactions)"
GEN ;
+1 GOTO STATDB
+2 ;I '$P(^APCPLOG(APCPSR("LOG"),0),U,6) G INPT
+3 WRITE !!,"APC VISITS EXPORTED"
+4 WRITE !,"Following is a breakdown of all visits that generated APC transactions by Visit",!,"Date, Type, Location, Service Category, Clinic and Primary Provider Discipline."
+5 DO APC^APCPSRP2
+6 IF $DATA(APCPSR("QUIT"))
QUIT
INPT ;
+1 IF '$PIECE(^APCPLOG(APCPSR("LOG"),0),U,11)
GOTO DENT
+2 WRITE !!!,"VISITS EXPORTED TO THE IHS DIRECT INPATIENT SYSTEM"
+3 WRITE !,"Following is a breakdown of all visits that generated Direct Inpatient",!,"Transactions:",!
+4 DO INPT^APCPSRP2
+5 IF $DATA(APCPSR("QUIT"))
QUIT
+6 ;
DENT ;
+1 IF '$DATA(^XTMP("APCPSR",APCPJOB,APCPBTH,"GEN","DENTWMEDS"))
GOTO CHA
+2 WRITE !!,"DENTAL VISITS"
+3 WRITE !,^XTMP("APCPSR",APCPJOB,APCPBTH,"GEN","DENTWMEDS")," of the above PHARMACY Clinic visits were actually DENTAL Clinic visits",!,"on which a medication was prescribed. The DENTAL Clinic visits were ",!
+4 WRITE "converted to PHARMACY Clinic prior to generating the APC transaction record.",!
CHA ;PRINT CHA TOTALS
+1 IF '$DATA(APCPS("CHA"))
GOTO STATDB
+2 WRITE !!!,"COMMUNITY HEALTH NURSING ACTIVITY (CHA) TRANSACTIONS"
+3 DO ^APCPSRP4
+4 IF $DATA(APCPSR("QUIT"))
QUIT
STATDB ;
+1 ;G:'$P(^APCPLOG(APCPSR("LOG"),0),U,17) SKIPPED
+2 DO ^APCPSRP5
+3 IF $DATA(APCPSR("QUIT"))
QUIT
SKIPPED ;
+1 ;G:'$D(^XTMP("APCPSR",APCPJOB,APCPBTH,"SKIPPED","TOTAL")) TAPE
+2 DO ^APCPSRP3
+3 IF $DATA(APCPSR("QUIT"))
QUIT
TAPE ;
+1 WRITE !!,"The Transmission Status for this Export is: "
+2 KILL DIQ,DIC,DA,DR
+3 SET DIC="^APCPLOG("
SET DR=".15"
SET DA=APCPSR("LOG")
SET DIQ(0)="E"
DO EN^DIQ1
KILL DIC,DA,DR,DIQ
+4 WRITE ^UTILITY("DIQ1",$JOB,9001005,APCPSR("LOG"),.15,"E"),!
+5 QUIT
HEAD ;EP
+1 IF 'APCPSR("PG")
GOTO HEAD1
+2 IF $EXTRACT(IOST)="C"
IF IO=IO(0)
WRITE !
KILL DIR
SET DIR(0)="EO"
DO ^DIR
KILL DIR
IF Y=0!(Y="^")!($DATA(DTOUT))
SET APCPSR("QUIT")=""
QUIT
+3 SET APCPSR("PG")=APCPSR("PG")+1
+4 IF $DATA(IOF)
WRITE @IOF
WRITE !?45,"PCC Transmission Summary Page ",APCPSR("PG")
+5 QUIT
HEAD1 ;
+1 IF $DATA(IOF)
WRITE @IOF
SET APCPSR("PG")=APCPSR("PG")+1
+2 SET APCPSR("LENG")=30+$LENGTH(APCPSR("FAC PRINT"))
+3 WRITE !,"Report Run Date: ",APCPSR("DTP"),?70,"Page ",APCPSR("PG")
+4 WRITE !!?((80-APCPSR("LENG"))/2),"DATA TRANSMISSION SUMMARY FOR ",APCPSR("FAC PRINT")
+5 WRITE !?20,"Date Export Run: ",APCPSR("RUN DATE")
+6 QUIT