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

BDWSRP5.m

Go to the documentation of this file.
  1. BDWSRP5 ; IHS/CMI/LAB - DW REPORT PRINT CONT ;
  1. ;;1.0;IHS DATA WAREHOUSE;;JAN 23, 2006
  1. I $Y>(IOSL-10) D HEAD^BDWSRP Q:$D(BDWSR("QUIT"))
  1. W !!!,"DATA WAREHOUSE RECORDS EXPORTED"
  1. I '$P(^BDWXLOG(BDWSR("LOG"),0),U,18) W !,"There were NO DATA WAREHOUSE VISIT transactions generated.",!! G EOJ
  1. W !,"Following is a breakdown of all encounters that generated DATA WAREHOUSE",!,"transactions by Visit Date, Type, Location, Service Category, Clinic and",!,"Primary Provider Discipline."
  1. INPT ;
  1. S BDWSR("INPT CNT")=0
  1. S X=0 F S X=$O(^BDWXLOG(BDWSR("LOG"),21,X)) Q:X'=+X I $D(^AUPNVSIT(X,0)) S V=^AUPNVSIT(X,0) I $P(^BDWXLOG(BDWSR("LOG"),21,X,0),U,2),$P(V,U,7)="H",$P(V,U,6)=DUZ(2) S BDWSR("INPT CNT")=BDWSR("INPT CNT")+1
  1. I $Y>(IOSL-4) D HEAD^BDWSRP Q:$D(BDWSR("QUIT"))
  1. W !!,"Total # of Hospitalization Encounters to this Facility that were exported: ",BDWSR("INPT CNT"),!
  1. VD ;
  1. ;
  1. S BDWSR("PTR")=0,BDWSR("T")="By Visit Date:",BDWSR("1")="V DATE STATDB",BDWSR("2")="V DATE STATDB",BDWSR("WC")=0
  1. D PROC Q:$D(BDWSR("QUIT"))
  1. TYPE ;
  1. S BDWSR("PTR")=0,BDWSR("T")="By Type:",BDWSR("1")="TYPE STATDB",BDWSR("2")="TYPE STATDB CC",BDWSR("WC")=0
  1. D PROC Q:$D(BDWSR("QUIT"))
  1. LOC ;
  1. S BDWSR("PTR")=1,BDWSR("T")="By Location:",BDWSR("1")="LOC STATDB",BDWSR("2")="LOC STATDB CC",BDWSR("WC")=0,BDWSR("GLOBAL")="^DIC(4,",BDWSR("PIECE")=1
  1. D PROC Q:$D(BDWSR("QUIT"))
  1. SC ;
  1. S BDWSR("PTR")=0,BDWSR("T")="By Service Category:",BDWSR("1")="SC STATDB",BDWSR("2")="SC STATDB CC",BDWSR("WC")=0
  1. D PROC Q:$D(BDWSR("QUIT"))
  1. CLINIC ;
  1. S BDWSR("PTR")=0,BDWSR("T")="By Clinic Type:",BDWSR("1")="CLINIC STATDB",BDWSR("2")="CLINIC STATDB CC",BDWSR("WC")=0
  1. D PROC Q:$D(BDWSR("QUIT"))
  1. PROVDISC ;
  1. S BDWSR("PTR")=0,BDWSR("T")="By Provider Type (Primary Provider only):",BDWSR("1")="PROV STATDB",BDWSR("2")="PROV STATDB CC",BDWSR("WC")=0
  1. D PROC Q:$D(BDWSR("QUIT"))
  1. ERRS ;
  1. I $Y>(IOSL-3) D HEAD^BDWSRP Q:$D(BDWSR("QUIT"))
  1. W !!?18,"Number of encounters skipped:",?50,$$VAL^XBDIQ1(90213,BDWSR("LOG"),.05)
  1. I $Y>(IOSL-3) D HEAD^BDWSRP Q:$D(BDWSR("QUIT"))
  1. I $P($G(^BDWXLOG(BDWSR("LOG"),31)),U,3) W !?20,"Deleted encounters skipped:",?50,$$VAL^XBDIQ1(90213,BDWSR("LOG"),3103)
  1. I $Y>(IOSL-3) D HEAD^BDWSRP Q:$D(BDWSR("QUIT"))
  1. I $P($G(^BDWXLOG(BDWSR("LOG"),31)),U,2) W !?17,"Zero dep entry visits skipped:",?50,$$VAL^XBDIQ1(90213,BDWSR("LOG"),3102)
  1. I $Y>(IOSL-3) D HEAD^BDWSRP Q:$D(BDWSR("QUIT"))
  1. I $P($G(^BDWXLOG(BDWSR("LOG"),31)),U,11) W !?28,"MFI visits skipped:",?50,$$VAL^XBDIQ1(90213,BDWSR("LOG"),3111)
  1. I $Y>(IOSL-3) D HEAD^BDWSRP Q:$D(BDWSR("QUIT"))
  1. I $P($G(^BDWXLOG(BDWSR("LOG"),31)),U,4) W !?17,"NO PATIENT encounters skipped:",?50,$$VAL^XBDIQ1(90213,BDWSR("LOG"),3104)
  1. I $Y>(IOSL-3) D HEAD^BDWSRP Q:$D(BDWSR("QUIT"))
  1. I $P($G(^BDWXLOG(BDWSR("LOG"),31)),U,5) W !?13,"NO LOCATION of encounters skipped:",?50,$$VAL^XBDIQ1(90213,BDWSR("LOG"),3105)
  1. I $Y>(IOSL-3) D HEAD^BDWSRP Q:$D(BDWSR("QUIT"))
  1. I $P($G(^BDWXLOG(BDWSR("LOG"),31)),U,6) W !?11,"NO TYPE OF VISIT encounters skipped:",?50,$$VAL^XBDIQ1(90213,BDWSR("LOG"),3106)
  1. I $Y>(IOSL-3) D HEAD^BDWSRP Q:$D(BDWSR("QUIT"))
  1. I $P($G(^BDWXLOG(BDWSR("LOG"),31)),U,7) W !?8,"NO SERVICE CATEGORY encounters skipped:",?50,$$VAL^XBDIQ1(90213,BDWSR("LOG"),3107)
  1. I $Y>(IOSL-3) D HEAD^BDWSRP Q:$D(BDWSR("QUIT"))
  1. I $P($G(^BDWXLOG(BDWSR("LOG"),31)),U,1) W !?15,"DEMO PATIENT encounters skipped:",?50,$$VAL^XBDIQ1(90213,BDWSR("LOG"),3101)
  1. TEXT ;
  1. I $Y>(IOSL-3) D HEAD^BDWSRP Q:$D(BDWSR("QUIT"))
  1. W !!,"To list the encounters that were skipped, use option DWER."
  1. ;show trailer report
  1. I $Y>(IOSL-3) D HEAD^BDWSRP Q:$D(BDWSR("QUIT"))
  1. W !!,"The following 'trailer report' was included with the export ",!,"to the Data Warehouse:",!
  1. S BDWX=0 F S BDWX=$O(^BDWXLOG(BDWSR("LOG"),99,BDWX)) Q:BDWX'=+BDWX!($D(BDWSR("QUIT"))) D
  1. .I $Y>(IOSL-3) D HEAD^BDWSRP Q:$D(BDWSR("QUIT"))
  1. .W !?3,^BDWXLOG(BDWSR("LOG"),99,BDWX,0)
  1. EOJ ;
  1. Q
  1. PROC ;
  1. I $Y>(IOSL-9) D HEAD^BDWSRP Q:$D(BDWSR("QUIT"))
  1. W !!?10,BDWSR("T")
  1. S BDWSR("N")=0 F S BDWSR("N")=$O(^XTMP("BDWSR",BDWJOB,BDWBTH,"GEN",BDWSR("2"),BDWSR("N"))) Q:BDWSR("N")=""!($D(BDWSR("QUIT"))) D PROC1
  1. Q
  1. PROC1 ;
  1. I BDWSR("2")["DATE" D PRNT Q
  1. S BDWSR("D")=0 F S BDWSR("D")=$O(^XTMP("BDWSR",BDWJOB,BDWBTH,"GEN",BDWSR("2"),BDWSR("N"),BDWSR("D"))) Q:BDWSR("D")="" D PRNT
  1. Q
  1. PRNTDATE ;
  1. S Y=BDWSR("N") D DD^%DT W !?13,Y,?45,$J(^XTMP("BDWSR",BDWJOB,BDWBTH,"GEN",BDWSR("2"),BDWSR("N")),7) S BDWSR("WC")=BDWSR("WC")+1
  1. Q
  1. PRNT ;
  1. I $Y>(IOSL-5) D HEAD^BDWSRP Q:$D(BDWSR("QUIT")) W !!?10,BDWSR("T") W:BDWSR("WC")>0 " (cont.)"
  1. I BDWSR("1")="V DATE STATDB" D PRNTDATE Q
  1. S X=^XTMP("BDWSR",BDWJOB,BDWBTH,"GEN",BDWSR("2"),BDWSR("N"),BDWSR("D"))
  1. I BDWSR("PTR")=1 D PRNTPTR Q
  1. W !?13,BDWSR("D"),?45,$J(X,7) S BDWSR("WC")=BDWSR("WC")+1
  1. Q
  1. PRNTPTR ;
  1. S G=BDWSR("GLOBAL")_BDWSR("D")_")"
  1. W !
  1. I $D(@G@(0)) W ?13,$P(@G@(0),U,BDWSR("PIECE"))
  1. W ?45,$J(X,7)
  1. S BDWSR("WC")=BDWSR("WC")+1
  1. I BDWSR("1")="LOC STATDB" W ?55,"(IHS CODE: ",$P(^AUTTLOC(BDWSR("D"),0),U,10),")"
  1. K G
  1. Q