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

AGTXID.m

Go to the documentation of this file.
  1. AGTXID ;IHS/ASDS/EFG - UNIQUE REGISTRATION RECORD ID ;
  1. ;;7.1;PATIENT REGISTRATION;;AUG 25,2005
  1. ;
  1. UID(AG) ;PEP - Given DFN return unique patient record id.
  1. ;AG can be DFN, but is not required if DFN or DA exists.
  1. ;
  1. ;pt record id = 6DIGIT_PADDFN
  1. ; where 6DIGIT is the ASUFAC at the time of implementation of
  1. ; this functionality. I.e., the existing ASUFAC was frozen and
  1. ; stuffed into the .25 field of the RPMS SITE file.
  1. ;PADDFN = DFN right justified in a field of 10.
  1. ;
  1. ;If not there, stuff the ASUFAC into RPMS SITE for durability.
  1. I '$P($G(^AUTTSITE(1,1)),U,3) S $P(^AUTTSITE(1,1),U,3)=$P(^AUTTLOC($P(^AUTTSITE(1,0),U,1),0),U,10)
  1. ;If AG is not specified, try DFN, then DA if DIC=AUPNPAT.
  1. I '$G(AG),$G(DFN) S AG=DFN
  1. I '$G(AG),$G(DA),$G(DIC)="^AUPNPAT(" S AG=DA
  1. I '$G(AG) Q "DFN undefined."
  1. I '$D(^AUPNPAT(AG)) Q "No entry in AUPNPAT(."
  1. Q $P(^AUTTSITE(1,1),U,3)_$E("0000000000",1,10-$L(AG))_AG