Class: Roqua::Healthy::A19::EpicNameParser

Inherits:
NameParser
  • Object
show all
Defined in:
lib/roqua/healthy/a19/epic_name_parser.rb

Overview

The CDIS EPD returns names in a format different from most other EPD vendors. This parser overrides some methods that are affected by the differences.

Instance Attribute Summary

Attributes inherited from NameParser

#message

Instance Method Summary collapse

Methods inherited from NameParser

#display_name, #initialize

Constructor Details

This class inherits a constructor from Roqua::Healthy::A19::NameParser

Instance Method Details

#firstnameObject



10
11
12
# File 'lib/roqua/healthy/a19/epic_name_parser.rb', line 10

def firstname
  names[:legal].fetch('PID.5.2')
end

#initialsObject



14
15
16
# File 'lib/roqua/healthy/a19/epic_name_parser.rb', line 14

def initials
  [names[:legal]['PID.5.2'][0], names[:legal]['PID.5.3']].map(&:presence).join(' ').strip
end

#lastnameObject



18
19
20
# File 'lib/roqua/healthy/a19/epic_name_parser.rb', line 18

def lastname
  names[:legal].fetch('PID.5.1').fetch('PID.5.1.1')
end

#nicknameObject



22
23
24
25
# File 'lib/roqua/healthy/a19/epic_name_parser.rb', line 22

def nickname
  return unless names[:nick]
  names[:nick].fetch('PID.5.2')
end