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

BWUCVRC.m

Go to the documentation of this file.
  1. BWUCVRC ;IHS/CIA/DKM - Import race from patient file. ;29-Oct-2003 21:39;PLS
  1. ;;2.0;WOMEN'S HEALTH;**8,9**;22-May-2003 14:55
  1. ;=================================================================
  1. W "Program to import patient race into BW PATIENT file",!
  1. W "Only those races supported by the BW RACE MAPPINGS file ",!
  1. W "will be imported. If a race is not found, the race will ",!
  1. W "be inferred using tribal affliation.",!
  1. W "Use entry point START to initiate process.",!!
  1. Q
  1. START ; EP
  1. N DFN,IEN,RC,CNT,ALL
  1. W "Importing race from PATIENT file into BW PATIENT file"
  1. S (ALL,DFN)=0
  1. F S DFN=$O(^BWP(DFN)) Q:'DFN D:'$O(^(DFN,2,0))
  1. .W "."
  1. .S (IEN,CNT)=0
  1. .F S IEN=$O(^AUPNPAT(DFN,62,IEN)) Q:'IEN S RC=+$G(^(IEN,0)) D
  1. ..D ADDRC(+$E("513427",RC))
  1. .I 'CNT D
  1. ..S RC=+$P($G(^AUPNPAT(DFN,11)),U,8)
  1. ..Q:'RC
  1. ..S RC=+$O(^BWRACE("C",RC,0))
  1. ..S:'RC RC=5
  1. ..D ADDRC(RC)
  1. .S:CNT ^BWP(DFN,2,0)="^9002086.07P^"_CNT_U_CNT,ALL=ALL+1
  1. W !!,"Import completed for ",ALL," patients.",!!
  1. Q
  1. ADDRC(RC) ;
  1. S:RC CNT=CNT+1,^BWP(DFN,2,CNT,0)=RC,^BWP(DFN,2,"B",RC,CNT)=""
  1. Q