Class: Oddb2xml::FHIR::Authorization
- Inherits:
-
Object
- Object
- Oddb2xml::FHIR::Authorization
- Defined in:
- lib/oddb2xml/fhir_support.rb
Instance Attribute Summary collapse
-
#auth_type ⇒ Object
readonly
Returns the value of attribute auth_type.
-
#cost_share ⇒ Object
readonly
Returns the value of attribute cost_share.
-
#foph_dossier_no ⇒ Object
readonly
Returns the value of attribute foph_dossier_no.
-
#holder_name ⇒ Object
readonly
Returns the value of attribute holder_name.
-
#identifier ⇒ Object
readonly
Returns the value of attribute identifier.
-
#limitations ⇒ Object
readonly
Returns the value of attribute limitations.
-
#listing_status ⇒ Object
readonly
Returns the value of attribute listing_status.
-
#prices ⇒ Object
readonly
Returns the value of attribute prices.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
-
#subject_reference ⇒ Object
readonly
Returns the value of attribute subject_reference.
Instance Method Summary collapse
-
#initialize(resource) ⇒ Authorization
constructor
A new instance of Authorization.
- #marketing_authorization? ⇒ Boolean
- #reimbursement_sl? ⇒ Boolean
Constructor Details
#initialize(resource) ⇒ Authorization
Returns a new instance of Authorization.
264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 |
# File 'lib/oddb2xml/fhir_support.rb', line 264 def initialize(resource) @identifier = resource.dig("identifier", 0, "value") @auth_type = resource.dig("type", "coding", 0, "display") @holder_name = resource.dig("contained", 0, "name") @subject_reference = resource.dig("subject", 0, "reference") @prices = [] @foph_dossier_no = nil @status = nil @listing_status = nil @cost_share = nil @limitations = [] # Parse extensions for reimbursement info and prices resource["extension"]&.each do |ext| if ext["url"]&.include?("reimbursementSL") parse_reimbursement_extension(ext) end end # Parse indications for limitations parse_indications(resource["indication"]) end |
Instance Attribute Details
#auth_type ⇒ Object (readonly)
Returns the value of attribute auth_type.
261 262 263 |
# File 'lib/oddb2xml/fhir_support.rb', line 261 def auth_type @auth_type end |
#cost_share ⇒ Object (readonly)
Returns the value of attribute cost_share.
261 262 263 |
# File 'lib/oddb2xml/fhir_support.rb', line 261 def cost_share @cost_share end |
#foph_dossier_no ⇒ Object (readonly)
Returns the value of attribute foph_dossier_no.
261 262 263 |
# File 'lib/oddb2xml/fhir_support.rb', line 261 def foph_dossier_no @foph_dossier_no end |
#holder_name ⇒ Object (readonly)
Returns the value of attribute holder_name.
261 262 263 |
# File 'lib/oddb2xml/fhir_support.rb', line 261 def holder_name @holder_name end |
#identifier ⇒ Object (readonly)
Returns the value of attribute identifier.
261 262 263 |
# File 'lib/oddb2xml/fhir_support.rb', line 261 def identifier @identifier end |
#limitations ⇒ Object (readonly)
Returns the value of attribute limitations.
261 262 263 |
# File 'lib/oddb2xml/fhir_support.rb', line 261 def limitations @limitations end |
#listing_status ⇒ Object (readonly)
Returns the value of attribute listing_status.
261 262 263 |
# File 'lib/oddb2xml/fhir_support.rb', line 261 def listing_status @listing_status end |
#prices ⇒ Object (readonly)
Returns the value of attribute prices.
261 262 263 |
# File 'lib/oddb2xml/fhir_support.rb', line 261 def prices @prices end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
261 262 263 |
# File 'lib/oddb2xml/fhir_support.rb', line 261 def status @status end |
#subject_reference ⇒ Object (readonly)
Returns the value of attribute subject_reference.
261 262 263 |
# File 'lib/oddb2xml/fhir_support.rb', line 261 def subject_reference @subject_reference end |
Instance Method Details
#marketing_authorization? ⇒ Boolean
287 288 289 |
# File 'lib/oddb2xml/fhir_support.rb', line 287 def @auth_type == "Marketing Authorisation" end |
#reimbursement_sl? ⇒ Boolean
291 292 293 |
# File 'lib/oddb2xml/fhir_support.rb', line 291 def reimbursement_sl? @auth_type == "Reimbursement SL" end |