BDWPRADD ; IHS/CMI/LAB - SET PATIENT AS AN ADD ;
;;1.0;IHS DATA WAREHOUSE;**2**;JAN 23, 2006
;
START ;EP - called from option
W !!,"This option is used to flag a patient to be sent to the Data"
W !,"Warehouse as an ADD. This option should be used if an edit"
W !,"patient record has failed at the warehouse because the patient"
W !,"was never received as an add prior to the edit message being"
W !,"sent. The patient(s) that you choose will be flagged as adds"
W !,"and sent on the next regularly scheduled data warehouse export (GDW)."
W !!
K BDWR
PATIENT ;
K DIC S DIC="^AUPNPAT(",DIC(0)="AEMQ" D ^DIC
I Y=-1 D DONE Q
S BDWPAT=+Y
W !,"Flagging ",$P(^DPT(BDWPAT,0),U)," as an add."
D ^XBFMK
S DA=BDWPAT,DIE="^AUPNPAT(",DR=".41///@;.42///@;.43///@;.44///@;.45///@" D ^DIE K DA,DIE,DR ;set all export date fields to null
S DA=BDWPAT,DIK="^AUPNDWAF(" D ^DIK K DA,DIK
S DINUM=BDWPAT,X=BDWPAT,DIC="^AUPNDWAF(",DR=".02////"_DT_";.04////"_DT_";.06////"_$S($O(^DPT(BDWPAT,.01,0)):DT,1:"")_";.11////"_$S($$ELIG(BDWPAT):DT,1:"")
S DIC(0)="L",DIADD=1,DLAYGO=9000003.3 K DD,D0,DO D FILE^DICN K DINUM,DIC,DA,DIADD,DLAYGO,DD,DO,D0
I Y=-1 W !!,"adding to dw audit file failed...notify programmer"
D ^XBFMK
G PATIENT
ELIG(P) ;
I $D(^AUPNMCR(P)) Q 1
I $D(^AUPNPRVT(P)) Q 1
I $O(^AUPNMCD("B",P,0)) Q 1
Q 0
DONE ;
D ^XBFMK
K BDWPAT
Q
BDWPRADD ; IHS/CMI/LAB - SET PATIENT AS AN ADD ;
+1 ;;1.0;IHS DATA WAREHOUSE;**2**;JAN 23, 2006
+2 ;
START ;EP - called from option
+1 WRITE !!,"This option is used to flag a patient to be sent to the Data"
+2 WRITE !,"Warehouse as an ADD. This option should be used if an edit"
+3 WRITE !,"patient record has failed at the warehouse because the patient"
+4 WRITE !,"was never received as an add prior to the edit message being"
+5 WRITE !,"sent. The patient(s) that you choose will be flagged as adds"
+6 WRITE !,"and sent on the next regularly scheduled data warehouse export (GDW)."
+7 WRITE !!
+8 KILL BDWR
PATIENT ;
+1 KILL DIC
SET DIC="^AUPNPAT("
SET DIC(0)="AEMQ"
DO ^DIC
+2 IF Y=-1
DO DONE
QUIT
+3 SET BDWPAT=+Y
+4 WRITE !,"Flagging ",$PIECE(^DPT(BDWPAT,0),U)," as an add."
+5 DO ^XBFMK
+6 ;set all export date fields to null
SET DA=BDWPAT
SET DIE="^AUPNPAT("
SET DR=".41///@;.42///@;.43///@;.44///@;.45///@"
DO ^DIE
KILL DA,DIE,DR
+7 SET DA=BDWPAT
SET DIK="^AUPNDWAF("
DO ^DIK
KILL DA,DIK
+8 SET DINUM=BDWPAT
SET X=BDWPAT
SET DIC="^AUPNDWAF("
SET DR=".02////"_DT_";.04////"_DT_";.06////"_$SELECT($ORDER(^DPT(BDWPAT,.01,0)):DT,1:"")_";.11////"_$SELECT($$ELIG(BDWPAT):DT,1:"")
+9 SET DIC(0)="L"
SET DIADD=1
SET DLAYGO=9000003.3
KILL DD,D0,DO
DO FILE^DICN
KILL DINUM,DIC,DA,DIADD,DLAYGO,DD,DO,D0
+10 IF Y=-1
WRITE !!,"adding to dw audit file failed...notify programmer"
+11 DO ^XBFMK
+12 GOTO PATIENT
ELIG(P) ;
+1 IF $DATA(^AUPNMCR(P))
QUIT 1
+2 IF $DATA(^AUPNPRVT(P))
QUIT 1
+3 IF $ORDER(^AUPNMCD("B",P,0))
QUIT 1
+4 QUIT 0
DONE ;
+1 DO ^XBFMK
+2 KILL BDWPAT
+3 QUIT