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

BDWRDR21.m

Go to the documentation of this file.
BDWRDR21 ; IHS/CMI/LAB - CONT PROCESS ;
 ;;1.0;IHS DATA WAREHOUSE;;JAN 23, 2006
 ;
DEM ;EP
 S BDWV("PATIENT DFN")=$P(BDWV("V REC"),U,5) I BDWV("PATIENT DFN")="" S BDWE("ERROR")="104" D ^BDWRERR Q
 S Y=BDWV("PATIENT DFN") D ^AUPNPAT
 S BDWV("PATIENT NAME")=$P(^DPT(BDWV("PATIENT DFN"),0),U)
 Q:BDWV("PATIENT NAME")["DEMO,PATIENT"  ;IHS/CMI/LAB - changed to "[" from "="
 Q
SEX ;
 I AUPNSEX="" S BDWE("ERROR")="E601" Q
DOB ;
 I AUPNDOB="" S BDWE("ERROR")="E600" Q
 S X2=AUPNDOB,X1=BDWV("V DATE") D ^%DTC S AUPNDAYS=X
 I '$D(^AUPNPAT(AUPNPAT,11)) S BDWE("ERROR")="E602" Q
COMM ;
 S BDWV("COMMX")=0,BDWV("COMMPX")="" F  S BDWV("COMMX")=$O(^AUPNPAT(AUPNPAT,51,BDWV("COMMX"))) Q:BDWV("COMMX")'=+BDWV("COMMX")  S BDWV("COMMPX")=BDWV("COMMX")
 I BDWV("COMMPX")="" S BDWE("ERROR")="E610" Q
 S BDWV("COMMPX")=$P(^AUPNPAT(AUPNPAT,51,BDWV("COMMPX"),0),U,3) I BDWV("COMMPX")="" S BDWE("ERROR")="E611" Q
 I '$D(^AUTTCOM(BDWV("COMMPX"),0)) S BDWE("ERROR")="E611" Q
 I BDWV("COMMPX")]"" S BDWV("COMM CODE")=$P(^AUTTCOM(BDWV("COMMPX"),0),U,8) I BDWV("COMM CODE")="" S BDWE("ERROR")="E612" Q
TRIBE ;
 S X=$P(^AUPNPAT(AUPNPAT,11),U,8) I X="" S BDWE("ERROR")="E605" D RESET Q
 I $P(^AUTTTRI(X,0),U,4)="Y" S BDWE("ERROR")="E607" D RESET Q
 S BDWV("TRIBE CODE")=$P(^AUTTTRI(X,0),U,2) I BDWV("TRIBE CODE")="" S BDWE("ERROR")="E608" Q
CHART S (BDWV("T-HASF"),BDWV("CHART"))=""
 I $D(^AUPNPAT(BDWV("PATIENT DFN"),41,BDWV("LOC DFN"),0))#2 S BDWV("T-HASF")=$P(^(0),U),BDWV("CHART")=$P(^(0),U,2)
 I BDWV("CHART")="" S BDWV("CHART")=999999 Q
 S BDWV("CHART")=$E("000000",1,6-$L(BDWV("CHART")))_BDWV("CHART")
 Q
 ;
RESET ;EP
 Q:$P(BDWV("V REC"),U,11)
 S DA=BDW("V DFN"),DIE="^AUPNVSIT(",DR=".13///"_DT D ^DIE K DA,DIU,DIE,DR,DIV
 Q