Class: HL7::Message::Segment::ROL

Inherits:
HL7::Message::Segment
  • Object
show all
Defined in:
lib/core_ext/segments/rol.rb

Instance Method Summary collapse

Instance Method Details

#person_hashObject



27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# File 'lib/core_ext/segments/rol.rb', line 27

def person_hash
  person = self.role_person.split(self.item_delim) rescue Array.new(20) {|i|""}
  
  {"id" => person[0],
   "lastName" => person[1],
   "firstName" => person[2],
   "middleInitOrName" => person[3],
   "suffix" => person[4],
   "prefix" => person[5],
   "degree" => person[6],
   "sourceTable" => person[7],
   "assigningAuthority" => person[8],
   "nameTypeCode" => person[9],
   "identifierCheckDigit" => person[10],
   "codeIdCheck" => person[11],
   "identifierTypeCode" => person[12],
   "assigningFacility" => person[13],
   "providerType" => self.role,
   "actionCode" => self.action_code
 }
end

#to_hashObject



21
22
23
24
25
# File 'lib/core_ext/segments/rol.rb', line 21

def to_hash
  return @hash if @hash
  @hash = super.to_hash
  @hash
end