Class: Oddb2xml::FHIR::Authorization

Inherits:
Object
  • Object
show all
Defined in:
lib/oddb2xml/fhir_support.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_typeObject (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_shareObject (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_noObject (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_nameObject (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

#identifierObject (readonly)

Returns the value of attribute identifier.



261
262
263
# File 'lib/oddb2xml/fhir_support.rb', line 261

def identifier
  @identifier
end

#limitationsObject (readonly)

Returns the value of attribute limitations.



261
262
263
# File 'lib/oddb2xml/fhir_support.rb', line 261

def limitations
  @limitations
end

#listing_statusObject (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

#pricesObject (readonly)

Returns the value of attribute prices.



261
262
263
# File 'lib/oddb2xml/fhir_support.rb', line 261

def prices
  @prices
end

#statusObject (readonly)

Returns the value of attribute status.



261
262
263
# File 'lib/oddb2xml/fhir_support.rb', line 261

def status
  @status
end

#subject_referenceObject (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

Returns:

  • (Boolean)


287
288
289
# File 'lib/oddb2xml/fhir_support.rb', line 287

def marketing_authorization?
  @auth_type == "Marketing Authorisation"
end

#reimbursement_sl?Boolean

Returns:

  • (Boolean)


291
292
293
# File 'lib/oddb2xml/fhir_support.rb', line 291

def reimbursement_sl?
  @auth_type == "Reimbursement SL"
end