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

AUTTFIPS.m

Go to the documentation of this file.
  1. AUTTFIPS ;IHS/SET/GTH - FIPS CODES EXTRINSICS ; [ 01/03/2003 10:48 AM ]
  1. ;;98.1;IHS DICTIONARIES (POINTERS);**12**;MAR 04, 1998;Build 6
  1. ;IHS/SET/GTH AUT*98.1*12 01/02/2003 - New routine.
  1. ;
  1. ST(X) ;PEP;Return FIPS code for X=2-letter-State-designator.
  1. ; e.g.: S State_FIPS=$$ST^AUTTFIPS("AZ")
  1. ; The lookup failed if +State_FIPS = 0
  1. ;
  1. NEW DIC,Y
  1. S DIC=5,DIC(0)="",D="C"
  1. D IX^DIC
  1. I Y<1 Q "00"
  1. S Y="00"_$$GET1^DIQ(5,+Y,2)
  1. Q $E(Y,$L(Y)-1,$L(Y))
  1. ;
  1. CT(AUT) ;PEP;AUT=IEN of ^AUTTCTY(. Return 3-digit FIPS for County.
  1. ; IEN is used assuming RPMS applications will have IEN.
  1. ; e.g.: S County_FIPS=$$CT^AUTTFIPS(4)
  1. ; The lookup failed if +County_FIPS = 0
  1. ;
  1. NEW DIC,X,Y
  1. S AUT=$P(^AUTTCTY(AUT,0),"^",2),X=$P(^(0),"^",1)
  1. I 'AUT Q "000"
  1. S DIC="^DIC(5,"_AUT_",1,",DIC(0)=""
  1. D ^DIC
  1. I Y<1 Q "000"
  1. S Y="000"_$$GET1^DIQ(DIC,+Y,2)
  1. Q $E(Y,$L(Y)-2,$L(Y))
  1. ;