Class: Trizetto::Api::Eligibility::WebService::Subscriber
- Includes:
- Rejectable
- Defined in:
- lib/trizetto/api/eligibility/web_service/subscriber.rb
Overview
The subscriber is who holds the insurance. They may be the patient, or they may have dependents who are the patients.
Constant Summary
Constants inherited from Patient
Instance Attribute Summary
Attributes inherited from Patient
Instance Method Summary collapse
-
#initialize(raw_hash = {}) ⇒ Subscriber
constructor
A new instance of Subscriber.
Methods included from Rejectable
Constructor Details
#initialize(raw_hash = {}) ⇒ Subscriber
Returns a new instance of Subscriber.
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/trizetto/api/eligibility/web_service/subscriber.rb', line 11 def initialize(raw_hash = {}) # If we are in subscriber / depdent relationship, we get back subscribername # instead of patientname (as the subscriber is _not_ the patient). For # convience, we'll transform the subscriber name into a name clean_hash = raw_hash.dup if clean_hash.has_key?(:subscribername) && !clean_hash.has_key?(:patientname) && clean_hash[:subscribername].is_a?(Hash) clean_hash[:patientname] = clean_hash.delete(:subscribername) clean_hash[:patientname].keys.each do |key| if key.to_s =~ /^subscriber(.*)$/ clean_hash[:patientname]["patient#{$1}".to_sym] = clean_hash[:patientname].delete(key) end end end super(clean_hash) end |