Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: APCPSRP3

APCPSRP3.m

Go to the documentation of this file.
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