class FHIR::StructureDefinitionFinding
Attributes
attribute[RW]
message[RW]
path[RW]
profileIdA[RW]
profileIdB[RW]
resourceType[RW]
status[RW]
valueA[RW]
valueB[RW]
Public Instance Methods
clone()
click to toggle source
# File lib/fhir_models/fhir_ext/structure_definition_finding.rb, line 41 def clone from_json(to_json) end
error(path, attribute, message, value_a, value_b)
click to toggle source
# File lib/fhir_models/fhir_ext/structure_definition_finding.rb, line 56 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_models/fhir_ext/structure_definition_finding.rb, line 22 def from_json(json) obj = FHIR::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_models/fhir_ext/structure_definition_finding.rb, line 18 def to_json JSON.pretty_unparse(as_json) end
to_s()
click to toggle source
# File lib/fhir_models/fhir_ext/structure_definition_finding.rb, line 14 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_models/fhir_ext/structure_definition_finding.rb, line 45 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