class FHIR::STU3::StructureDefinitionFinding

Attributes

attribute[RW]
message[RW]
path[RW]
profileIdA[RW]
profileIdB[RW]
resourceType[RW]

This is not an official FHIR Resource type. It is a data structure used for reporting.

status[RW]
valueA[RW]
valueB[RW]

Public Instance Methods

clone() click to toggle source
# File lib/fhir_stu3_models/fhir_ext/structure_definition_finding.rb, line 42
def clone
  from_json(to_json)
end
error(path, attribute, message, value_a, value_b) click to toggle source
# File lib/fhir_stu3_models/fhir_ext/structure_definition_finding.rb, line 57
def error(path, attribute, message, value_a, value_b)
  obj = clone
  obj.status = 'ERROR'
  obj.path = path
  obj.attribute = attribute
  obj.message = message
  obj.valueA = value_a
  obj.valueB = value_b
  obj
end
from_json(json) click to toggle source
# File lib/fhir_stu3_models/fhir_ext/structure_definition_finding.rb, line 23
def from_json(json)
  obj = FHIR::STU3::StructureDefinitionFinding.new
  if json.is_a? String
    begin
      if json.encoding.names.include? 'UTF-8'
        json.gsub!("\xEF\xBB\xBF".force_encoding('UTF-8'), '') # remove UTF-8 BOM
      end
      hash = JSON.parse(json)
      hash.each do |key, value|
        obj.send("#{key}=".to_sym, value) if value
      end
    rescue => e
      FHIR.logger.error "Failed to parse JSON: #{e.message}"
      return nil
    end
  end
  obj
end
to_json() click to toggle source
# File lib/fhir_stu3_models/fhir_ext/structure_definition_finding.rb, line 19
def to_json
  JSON.pretty_unparse(as_json)
end
to_s() click to toggle source
# File lib/fhir_stu3_models/fhir_ext/structure_definition_finding.rb, line 15
def to_s
  "#{resourceType},#{profileIdA},#{profileIdB},#{path},#{attribute},#{status},#{message},#{valueA},#{valueB}"
end
warning(path, attribute, message, value_a, value_b) click to toggle source
# File lib/fhir_stu3_models/fhir_ext/structure_definition_finding.rb, line 46
def warning(path, attribute, message, value_a, value_b)
  obj = clone
  obj.status = 'WARNING'
  obj.path = path
  obj.attribute = attribute
  obj.message = message
  obj.valueA = value_a
  obj.valueB = value_b
  obj
end