module FHIR
  class Reference
    def read
      # TODO: how to follow contained references?
      type, id = reference.to_s.split("/")
      return unless [type, id].all?(&:present?)
      klass = "FHIR::#{type}".constantize
      klass.read(client, id)
    end
  end
end

module FHIR
  class Reference
    def read
      # TODO: how to follow contained references?
      type, id = reference.to_s.split("/")
      return unless [type, id].all?(&:present?)
      klass = "FHIR::#{type}".constantize
      klass.read(id, client)
    end
  end
end

Fix flipped arguments to `FHIR::Klass.read`
Fix flipped arguments to `FHIR::Klass.read`

When getting a reference, the call to `FHIR::Klass.read` (where `Klass` is some
FHIR model) had its arguments flipped: the `id` should come first, and the
`client` second.
