class FHIRMapper::Patient
Constants
- ADDRESS_UNKNOWN_POSTCODE
Public Class Methods
Source
# File app/lib/fhir_mapper/patient.rb, line 11 def initialize(patient) @patient = patient end
Public Instance Methods
Source
# File app/lib/fhir_mapper/patient.rb, line 15 def fhir_record(reference_id: nil) FHIR::Patient.new( # The id may be optional, but it's currently needed by the immunisation # record so setting it by default for now. id: reference_id, identifier: [ FHIR::Identifier.new( system: "https://fhir.nhs.uk/Id/nhs-number", value: nhs_number ) ], name: [FHIR::HumanName.new(family: family_name, given: given_name)], birthDate: date_of_birth&.strftime("%Y-%m-%d"), gender: gender_fhir_value, address: [ FHIR::Address.new( postalCode: address_postcode || ADDRESS_UNKNOWN_POSTCODE ) ] ) end