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

BDWSR2.m

Go to the documentation of this file.
BDWSR2 ; IHS/CMI/LAB - DW REPORT 2 ;
 ;;1.0;IHS DATA WAREHOUSE;;JAN 23, 2006
 ;IHS/TUCSON/LAB - patch 3 made file 200 compatible
TYPE ;EP
 K ^UTILITY("DIQ1",$J)
 K DIQ,DIC,DA,DR
 S DIC="^AUPNVSIT(",DR=".03",DA=BDWSR("V"),DIQ(0)="E" D EN^DIQ1 K DIC,DA,DR,DIQ
 S BDWSR("TYPE")=^UTILITY("DIQ1",$J,9000010,BDWSR("V"),.03,"E")
 S X="^XTMP("_BDWSR("PROC")_",BDWVAR,BDWSR(""TYPE""))" D COUNT
 Q
SC ;EP
 K ^UTILITY("DIQ1",$J)
 K DIQ,DIC,DA,DR
 S DIC="^AUPNVSIT(",DR=".07",DA=BDWSR("V"),DIQ(0)="E" D EN^DIQ1 K DIC,DA,DR,DIQ
 S BDWSR("SC")=^UTILITY("DIQ1",$J,9000010,BDWSR("V"),.07,"E")
 S X="^XTMP("_BDWSR("PROC")_",BDWVAR,BDWSR(""SC""))" D COUNT
 K ^UTILITY("DIQ1",$J)
 Q
CLINIC ;EP
 S BDWSR("CLN")=$P(^AUPNVSIT(BDWSR("V"),0),U,8) I BDWSR("CLN")="" S BDWSR("CLN")="NO CLINIC",BDWSR("CLN CODE")="" G SETCLIN
 S BDWSR("CLN CODE")=$P(^DIC(40.7,BDWSR("CLN"),0),U,2),BDWSR("CLN")=$P(^DIC(40.7,BDWSR("CLN"),0),U)
 ;I BDWSR("CLN CODE")=56,$D(^AUPNVMED("AD",BDWSR("V"))),BDWVAR="CLINIC" D DENTAL^BDWSR1 S BDWSR("CLN")=BDWSR("PHARM NAME"),BDWSR("CLN CODE")=39
 ;Q:BDWSR("CLN CODE")=56
SETCLIN ;EP
 S X="^XTMP("_BDWSR("PROC")_",BDWVAR,BDWSR(""CLN""))" D COUNT
 ;
 Q
LOC ;EP
 S BDWSR("LOC")=$P(^AUPNVSIT(BDWSR("V"),0),U,6)
 S X="^XTMP("_BDWSR("PROC")_",BDWVAR,BDWSR(""LOC""))" D COUNT
 ;
 Q
PROV ;EP -provider type
 S BDWSR("X")=0 F  S BDWSR("X")=$O(^AUPNVPRV("AD",BDWSR("V"),BDWSR("X"))) Q:BDWSR("X")'=+BDWSR("X")  I $P(^AUPNVPRV(BDWSR("X"),0),U,4)="P" D PROV1
 Q
VD ;EP -tally by visit date
 S BDWSR("V DATE")=$P($P(^AUPNVSIT(BDWSR("V"),0),U),".")
 S X="^XTMP("_BDWSR("PROC")_",BDWVAR,BDWSR(""V DATE""))" D COUNT
 Q
PROV1 ;
 S BDWSR("PROV")=$P(^AUPNVPRV(BDWSR("X"),0),U)
 S BDWSR("DISC")=$$VAL^XBDIQ1(BDWS("PROV FILE"),BDWSR("PROV"),9999999.03)
 Q:BDWSR("DISC")=88
 Q:BDWSR("DISC")=""
 S BDWSR("DISC")=$$VAL^XBDIQ1(BDWS("PROV FILE"),BDWSR("PROV"),$S(BDWS("PROV FILE")=200:53.5,1:2))
 Q:BDWSR("DISC")=""
 S X="^XTMP("_BDWSR("PROC")_",BDWVAR,BDWSR(""DISC""))" D COUNT
 Q
 Q
COUNT ;
 I '$D(@X) S @X=0
 S %=@X,%=%+1,@X=%
 Q
C42 ;;
C51 ;
C52 ;;
C53 ;;
C54 ;;
C56 ;;
C60 ;;
C68 ;;