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

BDWPRADD.m

Go to the documentation of this file.
  1. BDWPRADD ; IHS/CMI/LAB - SET PATIENT AS AN ADD ;
  1. ;;1.0;IHS DATA WAREHOUSE;**2**;JAN 23, 2006
  1. ;
  1. START ;EP - called from option
  1. W !!,"This option is used to flag a patient to be sent to the Data"
  1. W !,"Warehouse as an ADD. This option should be used if an edit"
  1. W !,"patient record has failed at the warehouse because the patient"
  1. W !,"was never received as an add prior to the edit message being"
  1. W !,"sent. The patient(s) that you choose will be flagged as adds"
  1. W !,"and sent on the next regularly scheduled data warehouse export (GDW)."
  1. W !!
  1. K BDWR
  1. PATIENT ;
  1. K DIC S DIC="^AUPNPAT(",DIC(0)="AEMQ" D ^DIC
  1. I Y=-1 D DONE Q
  1. S BDWPAT=+Y
  1. W !,"Flagging ",$P(^DPT(BDWPAT,0),U)," as an add."
  1. D ^XBFMK
  1. S DA=BDWPAT,DIE="^AUPNPAT(",DR=".41///@;.42///@;.43///@;.44///@;.45///@" D ^DIE K DA,DIE,DR ;set all export date fields to null
  1. S DA=BDWPAT,DIK="^AUPNDWAF(" D ^DIK K DA,DIK
  1. 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:"")
  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
  1. I Y=-1 W !!,"adding to dw audit file failed...notify programmer"
  1. D ^XBFMK
  1. G PATIENT
  1. ELIG(P) ;
  1. I $D(^AUPNMCR(P)) Q 1
  1. I $D(^AUPNPRVT(P)) Q 1
  1. I $O(^AUPNMCD("B",P,0)) Q 1
  1. Q 0
  1. DONE ;
  1. D ^XBFMK
  1. K BDWPAT
  1. Q