APCPSRP3 ; IHS/TUCSON/LAB - PRINT . SECTION AUGUST 14, 1992 ; [ 08/19/03 12:37 PM ]
;;2.0;IHS PCC DATA EXTRACTION SYSTEM;**1,6**;APR 03, 1998
;IHS/CMI/LAB - patch 1 XTMP
;
I $Y>(IOSL-10) D HEAD^APCPSRP Q:$D(APCPSR("QUIT"))
;W !!,"VISITS REVIEWED BUT NOT EXPORTED"
;S X=$S($D(^XTMP("APCPSR",APCPJOB,APCPBTH,"SKIPPED","TOTAL")):^("TOTAL"),1:"")
S X=$P(^APCPLOG(APCPSR("LOG"),0),U,8)-$P(^APCPLOG(APCPSR("LOG"),0),U,18)
I X=0 W !,"All visits reviewed generated a transaction record to be sent to the Data",!,"Center. There were no transaction errors." Q
W !,"A total of ",X," visits DID NOT generate a Statistical Database transaction",!,"record to be passed to the Data Center. Following is a summary of ",!,"those visits and possible reasons why they may not have been exported: "
W !!,"Reasons visits may not have been exported:",!
W !?18,"Visits with Errors:",?40,$$VAL^XBDIQ1(9001005,APCPSR("LOG"),.05)
W:$P(^APCPLOG(APCPSR("LOG"),0),U,19) !?17,"DEMO,PATIENT visits:",?40,$$VAL^XBDIQ1(9001005,APCPSR("LOG"),.19)
W:$P(^APCPLOG(APCPSR("LOG"),0),U,28) !?17,"MFI visits skipped:",?40,$$VAL^XBDIQ1(9001005,APCPSR("LOG"),.28)
W:$P(^APCPLOG(APCPSR("LOG"),0),U,21) !?24,"EVENT visits:",?40,$$VAL^XBDIQ1(9001005,APCPSR("LOG"),.21)
W:$P(^APCPLOG(APCPSR("LOG"),0),U,22) !?22,"DELETED visits:",?40,$$VAL^XBDIQ1(9001005,APCPSR("LOG"),.22)
W:$P(^APCPLOG(APCPSR("LOG"),0),U,23) !?2,"INCOMPLETE Contract or In-Hospital:",?40,$$VAL^XBDIQ1(9001005,APCPSR("LOG"),.23)
W:$P(^APCPLOG(APCPSR("LOG"),0),U,26) !?5,"DELETED Visits w/o prior export:",?40,$$VAL^XBDIQ1(9001005,APCPSR("LOG"),.26)
DEL ;
K APCPSR("ERR TOT") S APCPSR("X")=0 F S APCPSR("X")=$O(^APCPLOG(APCPSR("LOG"),51,APCPSR("X"))) Q:APCPSR("X")'=+APCPSR("X") S Y=$P(^APCPLOG(APCPSR("LOG"),51,APCPSR("X"),0),U,3),APCPSR("ERR TOT",Y)=$G(APCPSR("ERR TOT",Y))+1
S APCPSR("X")="" F S APCPSR("X")=$O(APCPSR("ERR TOT",APCPSR("X"))) Q:APCPSR("X")=""!($D(APCPSR("QUIT"))) D
.I $Y>(IOSL-3) D HEAD^APCPSRP Q:$D(APCPSR("QUIT"))
.W !?10,APCPSR("ERR TOT",APCPSR("X")),?15,APCPSR("X")
;W ! W:$D(^XTMP("APCPSR",APCPJOB,APCPBTH,"SKIPPED","DELV")) !?10,^XTMP("APCPSR",APCPJOB,APCPBTH,"SKIPPED","DELV"),?20,"of these were DELETED Visits"
DEMO ;
;W:$D(^XTMP("APCPSR",APCPJOB,APCPBTH,"SKIPPED","DEMO")) !?10,^XTMP("APCPSR",APCPJOB,APCPBTH,"SKIPPED","DEMO"),?20,"of these were for DEMO,PATIENT"
ERROR ;
G:'$D(^XTMP("APCPSR",APCPJOB,APCPBTH,"SKIPPED","ERRORS")) TYPEERR
W !?10,^XTMP("APCPSR",APCPJOB,APCPBTH,"SKIPPED","TOTALERRS"),?20," of these had Transaction Errors"
;
S APCPSR("PTR")=0,APCPSR("T")="Error Types:",APCPSR("1")="ERRORS",APCPSR("2")="ERRORSC",APCPSR("WC")=0
D PROC Q:$D(APCPSR("QUIT"))
TYPEERR ;
Q
G:'$D(^XTMP("APCPSR",APCPJOB,APCPBTH,"SKIPPED","TYPE ERROR")) SCERR
S APCPSR("PTR")=0,APCPSR("T")="Visit not Exported because of TYPE of VISIT",APCPSR("2")="TYPE ERROR CC",APCPSR("WC")=0
D PROC Q:$D(APCPSR("QUIT"))
SCERR ;
G:'$D(^XTMP("APCPSR",APCPJOB,APCPBTH,"SKIPPED","SC ERROR")) CLINERR
S APCPSR("PTR")=0,APCPSR("T")="Visits not Exported because of SERVICE CATEGORY of VISIT",APCPSR("2")="SC ERROR CC",APCPSR("WC")=0
D PROC Q:$D(APCPSR("QUIT"))
CLINERR ;
G:'$D(^XTMP("APCPSR",APCPJOB,APCPBTH,"SKIPPED","CLINIC ERROR")) REM
S APCPSR("PTR")=0,APCPSR("T")="Visits not Exported because of CLINIC Type",APCPSR("2")="CLINIC ERROR CC",APCPSR("WC")=0
D PROC Q:$D(APCPSR("QUIT"))
CHANCL ; PHN NON CLINIC VISITS
W:$D(^XTMP("APCPSR",APCPJOB,APCPBTH,"SKIPPED","CHANOAPC")) !!?10,^("CHANOAPC"),?20,"of these were PHN Non-Clinic visits"
REM ;
Q:'$D(^XTMP("APCPSR",APCPJOB,APCPBTH,"SKIPPED","TOTALREM"))
W !!,"Following is a breakdown of the remaining ",^XTMP("APCPSR",APCPJOB,APCPBTH,"SKIPPED","TOTALREM")," visits that did not",!,"generate an APC or INPATIENT Transaction record."
S APCPSR("PTR")=0,APCPSR("T")="By Type: ",APCPSR("1")="TYPE",APCPSR("2")="TYPE REM CC",APCPSR("WC")=0
D PROC Q:$D(APCPSR("QUIT"))
SC ;
S APCPSR("PTR")=0,APCPSR("T")="By Service Category: ",APCPSR("1")="SC",APCPSR("2")="SC REM CC",APCPSR("WC")=0
D PROC Q:$D(APCPSR("QUIT"))
CLINIC ;
S APCPSR("PTR")=0,APCPSR("T")="By Clinic Type: ",APCPSR("1")="CLINIC",APCPSR("2")="CLINICC",APCPSR("WC")=0
D PROC Q:$D(APCPSR("QUIT"))
LOC ;
S APCPSR("PTR")=1,APCPSR("T")="By Location:",APCPSR("1")="LOC",APCPSR("2")="LOC REM CC",APCPSR("WC")=0,APCPSR("GLOBAL")="^DIC(4,",APCPSR("PIECE")=1
D PROC Q:$D(APCPSR("QUIT"))
PROVDISC ;
S APCPSR("PTR")=0,APCPSR("T")="By Provider Type (Primary Provider only):",APCPSR("1")="PROV",APCPSR("2")="PROV REM CC",APCPSR("WC")=0
D PROC Q:$D(APCPSR("QUIT"))
VD ;
;
S APCPSR("PTR")=0,APCPSR("T")="By Visit Date:",APCPSR("1")="V DATE REM",APCPSR("2")="V DATE REM",APCPSR("WC")=0
D PROC Q:$D(APCPSR("QUIT"))
EOJ ;
K APCPSR("1"),APCPSR("2"),APCPSR("X"),APCPSR("TOTO"),APCPSR("TOTC"),APCPSR("T")
Q
PROC ;
I $Y>(IOSL-9) D HEAD^APCPSRP Q:$D(APCPSR("QUIT"))
W !!?10,APCPSR("T")
S APCPSR("N")=0 F S APCPSR("N")=$O(^XTMP("APCPSR",APCPJOB,APCPBTH,"SKIPPED",APCPSR("2"),APCPSR("N"))) Q:APCPSR("N")=""!($D(APCPSR("QUIT"))) D PROC1
Q
PROC1 ;
I APCPSR("2")["DATE" D PRNT Q
S APCPSR("D")=0 F S APCPSR("D")=$O(^XTMP("APCPSR",APCPJOB,APCPBTH,"SKIPPED",APCPSR("2"),APCPSR("N"),APCPSR("D"))) Q:APCPSR("D")="" D PRNT
Q
PRNTDATE ;
S Y=APCPSR("N") D DD^%DT W !?13,Y,?45,$J(^XTMP("APCPSR",APCPJOB,APCPBTH,"SKIPPED",APCPSR("2"),APCPSR("N")),7) S APCPSR("WC")=APCPSR("WC")+1
Q
PRNT ;
S APCPSR("NON APC")=""
I $Y>(IOSL-5) D HEAD^APCPSRP Q:$D(APCPSR("QUIT")) W !?10,APCPSR("T") W:APCPSR("WC")>0 " (cont.)"
I APCPSR("1")["V DATE" D PRNTDATE Q
S X=^XTMP("APCPSR",APCPJOB,APCPBTH,"SKIPPED",APCPSR("2"),APCPSR("N"),APCPSR("D"))
I APCPSR("PTR")=1 D PRNTPTR Q
W !?13,APCPSR("NON APC"),$E(APCPSR("D"),1,30),?45,$J(X,7) S APCPSR("WC")=APCPSR("WC")+1
Q
PRNTPTR ;
S G=APCPSR("GLOBAL")_APCPSR("D")_")"
W !?13,$P(@G@(0),U,APCPSR("PIECE")),?45,$J(X,7) S APCPSR("WC")=APCPSR("WC")+1
I APCPSR("1")="LOC" W ?55,"(IHS CODE: ",$P(^AUTTLOC(APCPSR("D"),0),U,10),")"
K G
Q
TOTAL ;
S X=APCPSR("TOTC")
W !?15,"TOTAL:",?45,$J(APCPSR("TOTC"),8),?55,"(",Z,")"
Q
APCPSRP3 ; IHS/TUCSON/LAB - PRINT . SECTION AUGUST 14, 1992 ; [ 08/19/03 12:37 PM ]
+1 ;;2.0;IHS PCC DATA EXTRACTION SYSTEM;**1,6**;APR 03, 1998
+2 ;IHS/CMI/LAB - patch 1 XTMP
+3 ;
+4 IF $Y>(IOSL-10)
DO HEAD^APCPSRP
IF $DATA(APCPSR("QUIT"))
QUIT
+5 ;W !!,"VISITS REVIEWED BUT NOT EXPORTED"
+6 ;S X=$S($D(^XTMP("APCPSR",APCPJOB,APCPBTH,"SKIPPED","TOTAL")):^("TOTAL"),1:"")
+7 SET X=$PIECE(^APCPLOG(APCPSR("LOG"),0),U,8)-$PIECE(^APCPLOG(APCPSR("LOG"),0),U,18)
+8 IF X=0
WRITE !,"All visits reviewed generated a transaction record to be sent to the Data",!,"Center. There were no transaction errors."
QUIT
+9 WRITE !,"A total of ",X," visits DID NOT generate a Statistical Database transaction",!,"record to be passed to the Data Center. Following is a summary of ",!,"those visits and possible reasons why they may not have been exported: "
+10 WRITE !!,"Reasons visits may not have been exported:",!
+11 WRITE !?18,"Visits with Errors:",?40,$$VAL^XBDIQ1(9001005,APCPSR("LOG"),.05)
+12 IF $PIECE(^APCPLOG(APCPSR("LOG"),0),U,19)
WRITE !?17,"DEMO,PATIENT visits:",?40,$$VAL^XBDIQ1(9001005,APCPSR("LOG"),.19)
+13 IF $PIECE(^APCPLOG(APCPSR("LOG"),0),U,28)
WRITE !?17,"MFI visits skipped:",?40,$$VAL^XBDIQ1(9001005,APCPSR("LOG"),.28)
+14 IF $PIECE(^APCPLOG(APCPSR("LOG"),0),U,21)
WRITE !?24,"EVENT visits:",?40,$$VAL^XBDIQ1(9001005,APCPSR("LOG"),.21)
+15 IF $PIECE(^APCPLOG(APCPSR("LOG"),0),U,22)
WRITE !?22,"DELETED visits:",?40,$$VAL^XBDIQ1(9001005,APCPSR("LOG"),.22)
+16 IF $PIECE(^APCPLOG(APCPSR("LOG"),0),U,23)
WRITE !?2,"INCOMPLETE Contract or In-Hospital:",?40,$$VAL^XBDIQ1(9001005,APCPSR("LOG"),.23)
+17 IF $PIECE(^APCPLOG(APCPSR("LOG"),0),U,26)
WRITE !?5,"DELETED Visits w/o prior export:",?40,$$VAL^XBDIQ1(9001005,APCPSR("LOG"),.26)
DEL ;
+1 KILL APCPSR("ERR TOT")
SET APCPSR("X")=0
FOR
SET APCPSR("X")=$ORDER(^APCPLOG(APCPSR("LOG"),51,APCPSR("X")))
IF APCPSR("X")'=+APCPSR("X")
QUIT
SET Y=$PIECE(^APCPLOG(APCPSR("LOG"),51,APCPSR("X"),0),U,3)
SET APCPSR("ERR TOT",Y)=$GET(APCPSR("ERR TOT",Y))+1
+2 SET APCPSR("X")=""
FOR
SET APCPSR("X")=$ORDER(APCPSR("ERR TOT",APCPSR("X")))
IF APCPSR("X")=""!($DATA(APCPSR("QUIT")))
QUIT
Begin DoDot:1
+3 IF $Y>(IOSL-3)
DO HEAD^APCPSRP
IF $DATA(APCPSR("QUIT"))
QUIT
+4 WRITE !?10,APCPSR("ERR TOT",APCPSR("X")),?15,APCPSR("X")
End DoDot:1
+5 ;W ! W:$D(^XTMP("APCPSR",APCPJOB,APCPBTH,"SKIPPED","DELV")) !?10,^XTMP("APCPSR",APCPJOB,APCPBTH,"SKIPPED","DELV"),?20,"of these were DELETED Visits"
DEMO ;
+1 ;W:$D(^XTMP("APCPSR",APCPJOB,APCPBTH,"SKIPPED","DEMO")) !?10,^XTMP("APCPSR",APCPJOB,APCPBTH,"SKIPPED","DEMO"),?20,"of these were for DEMO,PATIENT"
ERROR ;
+1 IF '$DATA(^XTMP("APCPSR",APCPJOB,APCPBTH,"SKIPPED","ERRORS"))
GOTO TYPEERR
+2 WRITE !?10,^XTMP("APCPSR",APCPJOB,APCPBTH,"SKIPPED","TOTALERRS"),?20," of these had Transaction Errors"
+3 ;
+4 SET APCPSR("PTR")=0
SET APCPSR("T")="Error Types:"
SET APCPSR("1")="ERRORS"
SET APCPSR("2")="ERRORSC"
SET APCPSR("WC")=0
+5 DO PROC
IF $DATA(APCPSR("QUIT"))
QUIT
TYPEERR ;
+1 QUIT
+2 IF '$DATA(^XTMP("APCPSR",APCPJOB,APCPBTH,"SKIPPED","TYPE ERROR"))
GOTO SCERR
+3 SET APCPSR("PTR")=0
SET APCPSR("T")="Visit not Exported because of TYPE of VISIT"
SET APCPSR("2")="TYPE ERROR CC"
SET APCPSR("WC")=0
+4 DO PROC
IF $DATA(APCPSR("QUIT"))
QUIT
SCERR ;
+1 IF '$DATA(^XTMP("APCPSR",APCPJOB,APCPBTH,"SKIPPED","SC ERROR"))
GOTO CLINERR
+2 SET APCPSR("PTR")=0
SET APCPSR("T")="Visits not Exported because of SERVICE CATEGORY of VISIT"
SET APCPSR("2")="SC ERROR CC"
SET APCPSR("WC")=0
+3 DO PROC
IF $DATA(APCPSR("QUIT"))
QUIT
CLINERR ;
+1 IF '$DATA(^XTMP("APCPSR",APCPJOB,APCPBTH,"SKIPPED","CLINIC ERROR"))
GOTO REM
+2 SET APCPSR("PTR")=0
SET APCPSR("T")="Visits not Exported because of CLINIC Type"
SET APCPSR("2")="CLINIC ERROR CC"
SET APCPSR("WC")=0
+3 DO PROC
IF $DATA(APCPSR("QUIT"))
QUIT
CHANCL ; PHN NON CLINIC VISITS
+1 IF $DATA(^XTMP("APCPSR",APCPJOB,APCPBTH,"SKIPPED","CHANOAPC"))
WRITE !!?10,^("CHANOAPC"),?20,"of these were PHN Non-Clinic visits"
REM ;
+1 IF '$DATA(^XTMP("APCPSR",APCPJOB,APCPBTH,"SKIPPED","TOTALREM"))
QUIT
+2 WRITE !!,"Following is a breakdown of the remaining ",^XTMP("APCPSR",APCPJOB,APCPBTH,"SKIPPED","TOTALREM")," visits that did not",!,"generate an APC or INPATIENT Transaction record."
+3 SET APCPSR("PTR")=0
SET APCPSR("T")="By Type: "
SET APCPSR("1")="TYPE"
SET APCPSR("2")="TYPE REM CC"
SET APCPSR("WC")=0
+4 DO PROC
IF $DATA(APCPSR("QUIT"))
QUIT
SC ;
+1 SET APCPSR("PTR")=0
SET APCPSR("T")="By Service Category: "
SET APCPSR("1")="SC"
SET APCPSR("2")="SC REM CC"
SET APCPSR("WC")=0
+2 DO PROC
IF $DATA(APCPSR("QUIT"))
QUIT
CLINIC ;
+1 SET APCPSR("PTR")=0
SET APCPSR("T")="By Clinic Type: "
SET APCPSR("1")="CLINIC"
SET APCPSR("2")="CLINICC"
SET APCPSR("WC")=0
+2 DO PROC
IF $DATA(APCPSR("QUIT"))
QUIT
LOC ;
+1 SET APCPSR("PTR")=1
SET APCPSR("T")="By Location:"
SET APCPSR("1")="LOC"
SET APCPSR("2")="LOC REM CC"
SET APCPSR("WC")=0
SET APCPSR("GLOBAL")="^DIC(4,"
SET APCPSR("PIECE")=1
+2 DO PROC
IF $DATA(APCPSR("QUIT"))
QUIT
PROVDISC ;
+1 SET APCPSR("PTR")=0
SET APCPSR("T")="By Provider Type (Primary Provider only):"
SET APCPSR("1")="PROV"
SET APCPSR("2")="PROV REM CC"
SET APCPSR("WC")=0
+2 DO PROC
IF $DATA(APCPSR("QUIT"))
QUIT
VD ;
+1 ;
+2 SET APCPSR("PTR")=0
SET APCPSR("T")="By Visit Date:"
SET APCPSR("1")="V DATE REM"
SET APCPSR("2")="V DATE REM"
SET APCPSR("WC")=0
+3 DO PROC
IF $DATA(APCPSR("QUIT"))
QUIT
EOJ ;
+1 KILL APCPSR("1"),APCPSR("2"),APCPSR("X"),APCPSR("TOTO"),APCPSR("TOTC"),APCPSR("T")
+2 QUIT
PROC ;
+1 IF $Y>(IOSL-9)
DO HEAD^APCPSRP
IF $DATA(APCPSR("QUIT"))
QUIT
+2 WRITE !!?10,APCPSR("T")
+3 SET APCPSR("N")=0
FOR
SET APCPSR("N")=$ORDER(^XTMP("APCPSR",APCPJOB,APCPBTH,"SKIPPED",APCPSR("2"),APCPSR("N")))
IF APCPSR("N")=""!($DATA(APCPSR("QUIT")))
QUIT
DO PROC1
+4 QUIT
PROC1 ;
+1 IF APCPSR("2")["DATE"
DO PRNT
QUIT
+2 SET APCPSR("D")=0
FOR
SET APCPSR("D")=$ORDER(^XTMP("APCPSR",APCPJOB,APCPBTH,"SKIPPED",APCPSR("2"),APCPSR("N"),APCPSR("D")))
IF APCPSR("D")=""
QUIT
DO PRNT
+3 QUIT
PRNTDATE ;
+1 SET Y=APCPSR("N")
DO DD^%DT
WRITE !?13,Y,?45,$JUSTIFY(^XTMP("APCPSR",APCPJOB,APCPBTH,"SKIPPED",APCPSR("2"),APCPSR("N")),7)
SET APCPSR("WC")=APCPSR("WC")+1
+2 QUIT
PRNT ;
+1 SET APCPSR("NON APC")=""
+2 IF $Y>(IOSL-5)
DO HEAD^APCPSRP
IF $DATA(APCPSR("QUIT"))
QUIT
WRITE !?10,APCPSR("T")
IF APCPSR("WC")>0
WRITE " (cont.)"
+3 IF APCPSR("1")["V DATE"
DO PRNTDATE
QUIT
+4 SET X=^XTMP("APCPSR",APCPJOB,APCPBTH,"SKIPPED",APCPSR("2"),APCPSR("N"),APCPSR("D"))
+5 IF APCPSR("PTR")=1
DO PRNTPTR
QUIT
+6 WRITE !?13,APCPSR("NON APC"),$EXTRACT(APCPSR("D"),1,30),?45,$JUSTIFY(X,7)
SET APCPSR("WC")=APCPSR("WC")+1
+7 QUIT
PRNTPTR ;
+1 SET G=APCPSR("GLOBAL")_APCPSR("D")_")"
+2 WRITE !?13,$PIECE(@G@(0),U,APCPSR("PIECE")),?45,$JUSTIFY(X,7)
SET APCPSR("WC")=APCPSR("WC")+1
+3 IF APCPSR("1")="LOC"
WRITE ?55,"(IHS CODE: ",$PIECE(^AUTTLOC(APCPSR("D"),0),U,10),")"
+4 KILL G
+5 QUIT
TOTAL ;
+1 SET X=APCPSR("TOTC")
+2 WRITE !?15,"TOTAL:",?45,$JUSTIFY(APCPSR("TOTC"),8),?55,"(",Z,")"
+3 QUIT