Class: FHIR::StructureDefinitionFinding
- Inherits:
-
Object
- Object
- FHIR::StructureDefinitionFinding
- Defined in:
- lib/fhir_models/fhir_ext/structure_definition_finding.rb
Instance Attribute Summary collapse
-
#attribute ⇒ Object
Returns the value of attribute attribute.
-
#message ⇒ Object
Returns the value of attribute message.
-
#path ⇒ Object
Returns the value of attribute path.
-
#profileIdA ⇒ Object
Returns the value of attribute profileIdA.
-
#profileIdB ⇒ Object
Returns the value of attribute profileIdB.
-
#resourceType ⇒ Object
This is not an official FHIR Resource type.
-
#status ⇒ Object
Returns the value of attribute status.
-
#valueA ⇒ Object
Returns the value of attribute valueA.
-
#valueB ⇒ Object
Returns the value of attribute valueB.
Instance Method Summary collapse
- #clone ⇒ Object
- #error(path, attribute, message, value_a, value_b) ⇒ Object
- #from_json(json) ⇒ Object
- #to_json(*_args) ⇒ Object
- #to_s ⇒ Object
- #warning(path, attribute, message, value_a, value_b) ⇒ Object
Instance Attribute Details
#attribute ⇒ Object
Returns the value of attribute attribute.
9 10 11 |
# File 'lib/fhir_models/fhir_ext/structure_definition_finding.rb', line 9 def attribute @attribute end |
#message ⇒ Object
Returns the value of attribute message.
10 11 12 |
# File 'lib/fhir_models/fhir_ext/structure_definition_finding.rb', line 10 def @message end |
#path ⇒ Object
Returns the value of attribute path.
8 9 10 |
# File 'lib/fhir_models/fhir_ext/structure_definition_finding.rb', line 8 def path @path end |
#profileIdA ⇒ Object
Returns the value of attribute profileIdA.
5 6 7 |
# File 'lib/fhir_models/fhir_ext/structure_definition_finding.rb', line 5 def profileIdA @profileIdA end |
#profileIdB ⇒ Object
Returns the value of attribute profileIdB.
6 7 8 |
# File 'lib/fhir_models/fhir_ext/structure_definition_finding.rb', line 6 def profileIdB @profileIdB end |
#resourceType ⇒ Object
This is not an official FHIR Resource type. It is a data structure used for reporting.
4 5 6 |
# File 'lib/fhir_models/fhir_ext/structure_definition_finding.rb', line 4 def resourceType @resourceType end |
#status ⇒ Object
Returns the value of attribute status.
7 8 9 |
# File 'lib/fhir_models/fhir_ext/structure_definition_finding.rb', line 7 def status @status end |
#valueA ⇒ Object
Returns the value of attribute valueA.
11 12 13 |
# File 'lib/fhir_models/fhir_ext/structure_definition_finding.rb', line 11 def valueA @valueA end |
#valueB ⇒ Object
Returns the value of attribute valueB.
12 13 14 |
# File 'lib/fhir_models/fhir_ext/structure_definition_finding.rb', line 12 def valueB @valueB end |
Instance Method Details
#clone ⇒ Object
41 42 43 |
# 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) ⇒ Object
56 57 58 59 60 61 62 63 64 65 |
# File 'lib/fhir_models/fhir_ext/structure_definition_finding.rb', line 56 def error(path, attribute, , value_a, value_b) obj = clone obj.status = 'ERROR' obj.path = path obj.attribute = attribute obj. = obj.valueA = value_a obj.valueB = value_b obj end |
#from_json(json) ⇒ Object
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
# 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 StandardError => e FHIR.logger.error "Failed to parse JSON: #{e.}" return nil end end obj end |
#to_json(*_args) ⇒ Object
18 19 20 |
# File 'lib/fhir_models/fhir_ext/structure_definition_finding.rb', line 18 def to_json(*_args) JSON.pretty_unparse(as_json) end |
#to_s ⇒ Object
14 15 16 |
# File 'lib/fhir_models/fhir_ext/structure_definition_finding.rb', line 14 def to_s "#{resourceType},#{profileIdA},#{profileIdB},#{path},#{attribute},#{status},#{},#{valueA},#{valueB}" end |
#warning(path, attribute, message, value_a, value_b) ⇒ Object
45 46 47 48 49 50 51 52 53 54 |
# File 'lib/fhir_models/fhir_ext/structure_definition_finding.rb', line 45 def warning(path, attribute, , value_a, value_b) obj = clone obj.status = 'WARNING' obj.path = path obj.attribute = attribute obj. = obj.valueA = value_a obj.valueB = value_b obj end |