Class: Oddb2xml::FHIR::Bundle
- Inherits:
-
Object
- Object
- Oddb2xml::FHIR::Bundle
- Defined in:
- lib/oddb2xml/fhir_support.rb
Overview
Bundle represents one line in the NDJSON file
Instance Attribute Summary collapse
-
#authorizations ⇒ Object
readonly
Returns the value of attribute authorizations.
-
#clinical_use_definitions ⇒ Object
readonly
Returns the value of attribute clinical_use_definitions.
-
#ingredients ⇒ Object
readonly
Returns the value of attribute ingredients.
-
#medicinal_product ⇒ Object
readonly
Returns the value of attribute medicinal_product.
-
#packages ⇒ Object
readonly
Returns the value of attribute packages.
Instance Method Summary collapse
-
#cud_text_by_id ⇒ Object
Lookup map: CUD id (e.g. “NORDIMET” or “GLIVEC.01”) => indication text.
-
#initialize(json_line) ⇒ Bundle
constructor
A new instance of Bundle.
Constructor Details
#initialize(json_line) ⇒ Bundle
Returns a new instance of Bundle.
169 170 171 172 173 |
# File 'lib/oddb2xml/fhir_support.rb', line 169 def initialize(json_line) data = JSON.parse(json_line) @entries = data["entry"] || [] parse_entries end |
Instance Attribute Details
#authorizations ⇒ Object (readonly)
Returns the value of attribute authorizations.
167 168 169 |
# File 'lib/oddb2xml/fhir_support.rb', line 167 def @authorizations end |
#clinical_use_definitions ⇒ Object (readonly)
Returns the value of attribute clinical_use_definitions.
167 168 169 |
# File 'lib/oddb2xml/fhir_support.rb', line 167 def clinical_use_definitions @clinical_use_definitions end |
#ingredients ⇒ Object (readonly)
Returns the value of attribute ingredients.
167 168 169 |
# File 'lib/oddb2xml/fhir_support.rb', line 167 def ingredients @ingredients end |
#medicinal_product ⇒ Object (readonly)
Returns the value of attribute medicinal_product.
167 168 169 |
# File 'lib/oddb2xml/fhir_support.rb', line 167 def medicinal_product @medicinal_product end |
#packages ⇒ Object (readonly)
Returns the value of attribute packages.
167 168 169 |
# File 'lib/oddb2xml/fhir_support.rb', line 167 def packages @packages end |
Instance Method Details
#cud_text_by_id ⇒ Object
Lookup map: CUD id (e.g. “NORDIMET” or “GLIVEC.01”) => indication text. Used to resolve limitation texts that are stored as a reference on the RegulatedAuthorization rather than inline.
178 179 180 181 182 183 |
# File 'lib/oddb2xml/fhir_support.rb', line 178 def cud_text_by_id @cud_text_by_id ||= @clinical_use_definitions.each_with_object({}) do |cud, acc| next unless cud.id && cud.text acc[cud.id] = cud.text end end |