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

AGSSPSZZ.m

Go to the documentation of this file.
  1. AGSSPSZZ ; IHS/ADC/CRG -FILLING PSEUDO SSNS INTO BLANK SSNS ;
  1. ;;7.1;PATIENT REGISTRATION;;AUG 25,2005
  1. ;
  1. EN ;EP -
  1. ;This program stuffs PSEUDO SSNs into blank Patient SSNs fields.
  1. ;The Pseudo SSN is a combination of .31 of the Location file
  1. ;9999999.06 and the Health Record Number
  1. ;
  1. LOOP ;Loop through all Patients checking SSN field
  1. S AGSSI=0 F S AGSSI=$O(^AUPNPAT(AGSSI)) Q:+AGSSI=0 D IEN
  1. K AGSSI
  1. Q
  1. IEN ;EP--Get IEN in pat file, Use data puller to get SSN, Location and HRN
  1. N AGSSDATA,AGSSN,AGLOC,AGHRN,AGPSEUDO,DIC,DIE,DA,DR
  1. I (AGSSI#100)=0 W "*"
  1. S AGSSN=$$VAL^XBDIQ1(2,AGSSI,.09)
  1. I AGSSN["QAA" W !,"AGSSI:",AGSSI,"SSN: ",AGSSN
  1. Q
  1. PSSN ;Make sure HRN is 6 digits by packing 0s in leading positions
  1. I $L(AGHRN)<6 D
  1. .S AGHRN="00000"_AGHRN
  1. .S AGHRN=$E(AGHRN,($L(AGHRN)-5),$L(AGHRN))
  1. S AGPSEUDO=AGLOC_AGHRN
  1. ;Find all missing SSNs and stuff PSEUDO SSNs into Pat Records
  1. I AGSSN="" D
  1. .S DIC="^DPT("
  1. .S DIE=DIC
  1. .S DA=AGSSI
  1. .S DR=".09////^S X=AGPSEUDO"
  1. .D ^DIE
  1. Q