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.
293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 |
# File 'lib/oddb2xml/fhir_support.rb', line 293 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.
290 291 292 |
# File 'lib/oddb2xml/fhir_support.rb', line 290 def auth_type @auth_type end |
#cost_share ⇒ Object (readonly)
Returns the value of attribute cost_share.
290 291 292 |
# File 'lib/oddb2xml/fhir_support.rb', line 290 def cost_share @cost_share end |
#foph_dossier_no ⇒ Object (readonly)
Returns the value of attribute foph_dossier_no.
290 291 292 |
# File 'lib/oddb2xml/fhir_support.rb', line 290 def foph_dossier_no @foph_dossier_no end |
#holder_name ⇒ Object (readonly)
Returns the value of attribute holder_name.
290 291 292 |
# File 'lib/oddb2xml/fhir_support.rb', line 290 def holder_name @holder_name end |
#identifier ⇒ Object (readonly)
Returns the value of attribute identifier.
290 291 292 |
# File 'lib/oddb2xml/fhir_support.rb', line 290 def identifier @identifier end |
#limitations ⇒ Object (readonly)
Returns the value of attribute limitations.
290 291 292 |
# File 'lib/oddb2xml/fhir_support.rb', line 290 def limitations @limitations end |
#listing_status ⇒ Object (readonly)
Returns the value of attribute listing_status.
290 291 292 |
# File 'lib/oddb2xml/fhir_support.rb', line 290 def listing_status @listing_status end |
#prices ⇒ Object (readonly)
Returns the value of attribute prices.
290 291 292 |
# File 'lib/oddb2xml/fhir_support.rb', line 290 def prices @prices end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
290 291 292 |
# File 'lib/oddb2xml/fhir_support.rb', line 290 def status @status end |
#subject_reference ⇒ Object (readonly)
Returns the value of attribute subject_reference.
290 291 292 |
# File 'lib/oddb2xml/fhir_support.rb', line 290 def subject_reference @subject_reference end |
Instance Method Details
#marketing_authorization? ⇒ Boolean
316 317 318 |
# File 'lib/oddb2xml/fhir_support.rb', line 316 def @auth_type == "Marketing Authorisation" end |
#reimbursement_sl? ⇒ Boolean
320 321 322 |
# File 'lib/oddb2xml/fhir_support.rb', line 320 def reimbursement_sl? @auth_type == "Reimbursement SL" end |