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

APCPSRP5.m

Go to the documentation of this file.
APCPSRP5 ; IHS/TUCSON/LAB - PRINT . SECTION AUGUST 14, 1992 ; [ 08/17/2003   8:15 PM ]
 ;;2.0;IHS PCC DATA EXTRACTION SYSTEM;**1,3**;APR 03, 1998
 ;IHS/CMI/LAB - modified for displaying #hospital visits
 ;IHS/CMI/LAB - XTMP
 ;
 I $Y>(IOSL-10) D HEAD^APCPSRP Q:$D(APCPSR("QUIT"))
 W !!!,"STATISTICAL DATABASE RECORDS EXPORTED"
 I '$P(^APCPLOG(APCPSR("LOG"),0),U,17) W !,"There were NO STATISTICAL DATABASE transactions generated.",!! G EOJ
 W !,"Following is a breakdown of all visits that generated STATISTICAL DATABASE",!,"transactions by Visit Date, Type, Location, Service Category, Clinic and",!," Primary Provider Discipline."
INPT ;
 S APCPSR("INPT CNT")=0
 S X=0 F  S X=$O(^APCPLOG(APCPSR("LOG"),21,X)) Q:X'=+X  I $D(^AUPNVSIT(X,0)) S V=^AUPNVSIT(X,0) I $P(^APCPLOG(APCPSR("LOG"),21,X,0),U,5),$P(V,U,7)="H",$P(V,U,6)=DUZ(2) S APCPSR("INPT CNT")=APCPSR("INPT CNT")+1
 I $Y>(IOSL-4) D HEAD^APCPSRP Q:$D(APCPSR("QUIT"))
 W !!,"Total Number of Hospitalization Visits to this Facility that were exported: ",APCPSR("INPT CNT"),!
VD ;
 ;
 S APCPSR("PTR")=0,APCPSR("T")="By Visit Date:",APCPSR("1")="V DATE STATDB",APCPSR("2")="V DATE STATDB",APCPSR("WC")=0
 D PROC Q:$D(APCPSR("QUIT"))
TYPE ;
 S APCPSR("PTR")=0,APCPSR("T")="By Type:",APCPSR("1")="TYPE STATDB",APCPSR("2")="TYPE STATDB CC",APCPSR("WC")=0
 D PROC Q:$D(APCPSR("QUIT"))
LOC ;
 S APCPSR("PTR")=1,APCPSR("T")="By Location:",APCPSR("1")="LOC STATDB",APCPSR("2")="LOC STATDB CC",APCPSR("WC")=0,APCPSR("GLOBAL")="^DIC(4,",APCPSR("PIECE")=1
 D PROC Q:$D(APCPSR("QUIT"))
SC ;
 S APCPSR("PTR")=0,APCPSR("T")="By Service Category:",APCPSR("1")="SC STATDB",APCPSR("2")="SC STATDB CC",APCPSR("WC")=0
 D PROC Q:$D(APCPSR("QUIT"))
CLINIC ;
 S APCPSR("PTR")=0,APCPSR("T")="By Clinic Type:",APCPSR("1")="CLINIC STATDB",APCPSR("2")="CLINIC STATDB CC",APCPSR("WC")=0
 D PROC Q:$D(APCPSR("QUIT"))
PROVDISC ;
 S APCPSR("PTR")=0,APCPSR("T")="By Provider Type (Primary Provider only):",APCPSR("1")="PROV STATDB",APCPSR("2")="PROV STATDB CC",APCPSR("WC")=0
 D PROC Q:$D(APCPSR("QUIT"))
EOJ ;
 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,"GEN",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,"GEN",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,"GEN",APCPSR("2"),APCPSR("N")),7) S APCPSR("WC")=APCPSR("WC")+1
 Q
PRNT ;
 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 STATDB" D PRNTDATE Q
 S X=^XTMP("APCPSR",APCPJOB,APCPBTH,"GEN",APCPSR("2"),APCPSR("N"),APCPSR("D"))
 I APCPSR("PTR")=1 D PRNTPTR Q
 W !?13,APCPSR("D"),?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