change_healthcare-eligibility 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (59) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +11 -0
  3. data/.rspec +3 -0
  4. data/.rubocop.yml +130 -0
  5. data/.ruby-version +1 -0
  6. data/.travis.yml +7 -0
  7. data/Gemfile +4 -0
  8. data/Gemfile.lock +59 -0
  9. data/LICENSE.txt +21 -0
  10. data/README.md +64 -0
  11. data/Rakefile +6 -0
  12. data/bin/console +11 -0
  13. data/bin/rspec +29 -0
  14. data/bin/setup +8 -0
  15. data/change_healthcare-eligibility.gemspec +44 -0
  16. data/lib/change_healthcare/eligibility.rb +13 -0
  17. data/lib/change_healthcare/eligibility/inspector.rb +82 -0
  18. data/lib/change_healthcare/eligibility/swagger_client.rb +81 -0
  19. data/lib/change_healthcare/eligibility/swagger_client/api_client.rb +388 -0
  20. data/lib/change_healthcare/eligibility/swagger_client/api_error.rb +40 -0
  21. data/lib/change_healthcare/eligibility/swagger_client/configuration.rb +202 -0
  22. data/lib/change_healthcare/eligibility/swagger_client/eligibility_api.rb +198 -0
  23. data/lib/change_healthcare/eligibility/swagger_client/models/additional_identification.rb +266 -0
  24. data/lib/change_healthcare/eligibility/swagger_client/models/additional_information.rb +185 -0
  25. data/lib/change_healthcare/eligibility/swagger_client/models/address.rb +218 -0
  26. data/lib/change_healthcare/eligibility/swagger_client/models/benefits_additional_information.rb +376 -0
  27. data/lib/change_healthcare/eligibility/swagger_client/models/benefits_date_information.rb +340 -0
  28. data/lib/change_healthcare/eligibility/swagger_client/models/benefits_information.rb +338 -0
  29. data/lib/change_healthcare/eligibility/swagger_client/models/benefits_related_entity.rb +240 -0
  30. data/lib/change_healthcare/eligibility/swagger_client/models/benefits_service_delivery.rb +220 -0
  31. data/lib/change_healthcare/eligibility/swagger_client/models/composite_medical_procedure_identifier.rb +218 -0
  32. data/lib/change_healthcare/eligibility/swagger_client/models/eligibility_additional_information.rb +200 -0
  33. data/lib/change_healthcare/eligibility/swagger_client/models/encounter.rb +359 -0
  34. data/lib/change_healthcare/eligibility/swagger_client/models/error.rb +205 -0
  35. data/lib/change_healthcare/eligibility/swagger_client/models/health_care_diagnosis_code.rb +190 -0
  36. data/lib/change_healthcare/eligibility/swagger_client/models/health_care_information.rb +229 -0
  37. data/lib/change_healthcare/eligibility/swagger_client/models/health_check.rb +190 -0
  38. data/lib/change_healthcare/eligibility/swagger_client/models/information_receiver_name.rb +303 -0
  39. data/lib/change_healthcare/eligibility/swagger_client/models/loop_2000_cd2100_cd_segment_nm1_ref_dmg_ins_mpi_prv_notes_response_member.rb +429 -0
  40. data/lib/change_healthcare/eligibility/swagger_client/models/loop_2100_a_segments_nm1_and_per_notes_information_source_name.rb +293 -0
  41. data/lib/change_healthcare/eligibility/swagger_client/models/loop_2100_a_segments_per_element_per03_8_notes_communication.rb +194 -0
  42. data/lib/change_healthcare/eligibility/swagger_client/models/loop_2100_a_segments_per_notes_information_source_contact_information.rb +198 -0
  43. data/lib/change_healthcare/eligibility/swagger_client/models/loop_2100_bcd_segment_nm1_prv_notes_provider.rb +322 -0
  44. data/lib/change_healthcare/eligibility/swagger_client/models/loop_2100_cd_segment_trn_notes_subscriber_trace_numbers.rb +218 -0
  45. data/lib/change_healthcare/eligibility/swagger_client/models/loop_2110_cd_segments_ref_notes_subscriber_dependent_additional_identification.rb +488 -0
  46. data/lib/change_healthcare/eligibility/swagger_client/models/medical_eligibility.rb +272 -0
  47. data/lib/change_healthcare/eligibility/swagger_client/models/medical_procedure.rb +254 -0
  48. data/lib/change_healthcare/eligibility/swagger_client/models/plan_date_information.rb +340 -0
  49. data/lib/change_healthcare/eligibility/swagger_client/models/plan_status.rb +204 -0
  50. data/lib/change_healthcare/eligibility/swagger_client/models/provider.rb +304 -0
  51. data/lib/change_healthcare/eligibility/swagger_client/models/provider_information.rb +190 -0
  52. data/lib/change_healthcare/eligibility/swagger_client/models/raw_x12_request.rb +190 -0
  53. data/lib/change_healthcare/eligibility/swagger_client/models/request_dependent.rb +452 -0
  54. data/lib/change_healthcare/eligibility/swagger_client/models/request_subscriber.rb +456 -0
  55. data/lib/change_healthcare/eligibility/swagger_client/models/response.rb +322 -0
  56. data/lib/change_healthcare/eligibility/swagger_client/version.rb +17 -0
  57. data/lib/change_healthcare/eligibility/version.rb +5 -0
  58. data/lib/change_healthcare/eligibility/wrapper.rb +124 -0
  59. metadata +214 -0
@@ -0,0 +1,218 @@
1
+ # #Eligibility
2
+ #
3
+ # Reference for developers
4
+ #
5
+ # OpenAPI spec version: v3
6
+ #
7
+ # Generated by: https://github.com/swagger-api/swagger-codegen.git
8
+ # Swagger Codegen version: 2.4.17
9
+ #
10
+
11
+ require 'date'
12
+
13
+ module ChangeHealthcare
14
+ module Eligibility
15
+ module SwaggerClient
16
+ class CompositeMedicalProcedureIdentifier
17
+ attr_accessor :diagnosis_code_pointer, :procedure_code, :procedure_modifiers, :product_or_service_id, :product_or_service_id_qualifier, :product_or_service_id_qualifier_code
18
+
19
+ # Attribute mapping from ruby-style variable name to JSON key.
20
+ def self.attribute_map
21
+ {
22
+ 'diagnosis_code_pointer': :diagnosisCodePointer,
23
+ 'procedure_code': :procedureCode,
24
+ 'procedure_modifiers': :procedureModifiers,
25
+ 'product_or_service_id': :productOrServiceID,
26
+ 'product_or_service_id_qualifier': :productOrServiceIdQualifier,
27
+ 'product_or_service_id_qualifier_code': :productOrServiceIdQualifierCode
28
+ }
29
+ end
30
+
31
+ # Attribute type mapping.
32
+ def self.swagger_types
33
+ {
34
+ 'diagnosis_code_pointer': :'Array<String>',
35
+ 'procedure_code': :String,
36
+ 'procedure_modifiers': :'Array<String>',
37
+ 'product_or_service_id': :String,
38
+ 'product_or_service_id_qualifier': :String,
39
+ 'product_or_service_id_qualifier_code': :String
40
+ }
41
+ end
42
+
43
+ # Initializes the object
44
+ # @param [Hash] attributes Model attributes in the form of hash
45
+ def initialize(attributes = {})
46
+ return unless attributes.is_a?(Hash)
47
+
48
+ # convert string to symbol for hash key
49
+ attributes = attributes.transform_keys(&:to_sym)
50
+
51
+ if attributes.key?(:diagnosisCodePointer)
52
+ if (value = attributes[:diagnosisCodePointer]).is_a?(Array)
53
+ self.diagnosis_code_pointer = value
54
+ end
55
+ end
56
+
57
+ self.procedure_code = attributes[:procedureCode] if attributes.key?(:procedureCode)
58
+
59
+ if attributes.key?(:procedureModifiers)
60
+ if (value = attributes[:procedureModifiers]).is_a?(Array)
61
+ self.procedure_modifiers = value
62
+ end
63
+ end
64
+
65
+ self.product_or_service_id = attributes[:productOrServiceID] if attributes.key?(:productOrServiceID)
66
+
67
+ self.product_or_service_id_qualifier = attributes[:productOrServiceIdQualifier] if attributes.key?(:productOrServiceIdQualifier)
68
+
69
+ self.product_or_service_id_qualifier_code = attributes[:productOrServiceIdQualifierCode] if attributes.key?(:productOrServiceIdQualifierCode)
70
+ end
71
+
72
+ # Show invalid properties with the reasons. Usually used together with valid?
73
+ # @return Array for valid properties with the reasons
74
+ def list_invalid_properties
75
+ []
76
+ end
77
+
78
+ # Check to see if the all the properties in the model are valid
79
+ # @return true if the model is valid
80
+ def valid?
81
+ true
82
+ end
83
+
84
+ # Checks equality by comparing each attribute.
85
+ # @param [Object] Object to be compared
86
+ def ==(o)
87
+ return true if equal?(o)
88
+
89
+ self.class == o.class &&
90
+ diagnosis_code_pointer == o.diagnosis_code_pointer &&
91
+ procedure_code == o.procedure_code &&
92
+ procedure_modifiers == o.procedure_modifiers &&
93
+ product_or_service_id == o.product_or_service_id &&
94
+ product_or_service_id_qualifier == o.product_or_service_id_qualifier &&
95
+ product_or_service_id_qualifier_code == o.product_or_service_id_qualifier_code
96
+ end
97
+
98
+ # @see the `==` method
99
+ # @param [Object] Object to be compared
100
+ def eql?(o)
101
+ self == o
102
+ end
103
+
104
+ # Calculates hash code according to all attributes.
105
+ # @return [Fixnum] Hash code
106
+ def hash
107
+ [diagnosis_code_pointer, procedure_code, procedure_modifiers, product_or_service_id, product_or_service_id_qualifier, product_or_service_id_qualifier_code].hash
108
+ end
109
+
110
+ # Builds the object from hash
111
+ # @param [Hash] attributes Model attributes in the form of hash
112
+ # @return [Object] Returns the model itself
113
+ def build_from_hash(attributes)
114
+ return nil unless attributes.is_a?(Hash)
115
+
116
+ self.class.swagger_types.each_pair do |key, type|
117
+ if type =~ /\AArray<(.*)>/i
118
+ # check to ensure the input is an array given that the attribute
119
+ # is documented as an array but the input is not
120
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
121
+ send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize(Regexp.last_match(1), v) })
122
+ end
123
+ elsif !attributes[self.class.attribute_map[key]].nil?
124
+ send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
125
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
126
+ end
127
+
128
+ self
129
+ end
130
+
131
+ # Deserializes the data based on type
132
+ # @param string type Data type
133
+ # @param string value Value to be deserialized
134
+ # @return [Object] Deserialized data
135
+ def _deserialize(type, value)
136
+ case type.to_sym
137
+ when :DateTime
138
+ DateTime.parse(value)
139
+ when :Date
140
+ Date.parse(value)
141
+ when :String
142
+ value.to_s
143
+ when :Integer
144
+ value.to_i
145
+ when :Float
146
+ value.to_f
147
+ when :BOOLEAN
148
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
149
+ true
150
+ else
151
+ false
152
+ end
153
+ when :Object
154
+ # generic object (usually a Hash), return directly
155
+ value
156
+ when /\AArray<(?<inner_type>.+)>\z/
157
+ inner_type = Regexp.last_match[:inner_type]
158
+ value.map { |v| _deserialize(inner_type, v) }
159
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
160
+ k_type = Regexp.last_match[:k_type]
161
+ v_type = Regexp.last_match[:v_type]
162
+ {}.tap do |hash|
163
+ value.each do |k, v|
164
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
165
+ end
166
+ end
167
+ else # model
168
+ temp_model = SwaggerClient.const_get(type).new
169
+ temp_model.build_from_hash(value)
170
+ end
171
+ end
172
+
173
+ # Returns the string representation of the object
174
+ # @return [String] String presentation of the object
175
+ def to_s
176
+ to_hash.to_s
177
+ end
178
+
179
+ # to_body is an alias to to_hash (backward compatibility)
180
+ # @return [Hash] Returns the object in the form of hash
181
+ def to_body
182
+ to_hash
183
+ end
184
+
185
+ # Returns the object in the form of hash
186
+ # @return [Hash] Returns the object in the form of hash
187
+ def to_hash
188
+ hash = {}
189
+ self.class.attribute_map.each_pair do |attr, param|
190
+ value = send(attr)
191
+ next if value.nil?
192
+
193
+ hash[param] = _to_hash(value)
194
+ end
195
+ hash
196
+ end
197
+
198
+ # Outputs non-array value in the form of hash
199
+ # For object, use to_hash. Otherwise, just return the value
200
+ # @param [Object] value Any valid value
201
+ # @return [Hash] Returns the value in the form of hash
202
+ def _to_hash(value)
203
+ if value.is_a?(Array)
204
+ value.compact.map { |v| _to_hash(v) }
205
+ elsif value.is_a?(Hash)
206
+ {}.tap do |hash|
207
+ value.each { |k, v| hash[k] = _to_hash(v) }
208
+ end
209
+ elsif value.respond_to? :to_hash
210
+ value.to_hash
211
+ else
212
+ value
213
+ end
214
+ end
215
+ end
216
+ end
217
+ end
218
+ end
@@ -0,0 +1,200 @@
1
+ # #Eligibility
2
+ #
3
+ # Reference for developers
4
+ #
5
+ # OpenAPI spec version: v3
6
+ #
7
+ # Generated by: https://github.com/swagger-api/swagger-codegen.git
8
+ # Swagger Codegen version: 2.4.17
9
+ #
10
+
11
+ require 'date'
12
+
13
+ module ChangeHealthcare
14
+ module Eligibility
15
+ module SwaggerClient
16
+ class EligibilityAdditionalInformation
17
+ attr_accessor :code_category, :code_list_qualifier_code, :industry_code, :injured_body_part_name
18
+
19
+ # Attribute mapping from ruby-style variable name to JSON key.
20
+ def self.attribute_map
21
+ {
22
+ 'code_category': :codeCategory,
23
+ 'code_list_qualifier_code': :codeListQualifierCode,
24
+ 'industry_code': :industryCode,
25
+ 'injured_body_part_name': :injuredBodyPartName
26
+ }
27
+ end
28
+
29
+ # Attribute type mapping.
30
+ def self.swagger_types
31
+ {
32
+ 'code_category': :String,
33
+ 'code_list_qualifier_code': :String,
34
+ 'industry_code': :String,
35
+ 'injured_body_part_name': :String
36
+ }
37
+ end
38
+
39
+ # Initializes the object
40
+ # @param [Hash] attributes Model attributes in the form of hash
41
+ def initialize(attributes = {})
42
+ return unless attributes.is_a?(Hash)
43
+
44
+ # convert string to symbol for hash key
45
+ attributes = attributes.transform_keys(&:to_sym)
46
+
47
+ self.code_category = attributes[:codeCategory] if attributes.key?(:codeCategory)
48
+
49
+ self.code_list_qualifier_code = attributes[:codeListQualifierCode] if attributes.key?(:codeListQualifierCode)
50
+
51
+ self.industry_code = attributes[:industryCode] if attributes.key?(:industryCode)
52
+
53
+ self.injured_body_part_name = attributes[:injuredBodyPartName] if attributes.key?(:injuredBodyPartName)
54
+ end
55
+
56
+ # Show invalid properties with the reasons. Usually used together with valid?
57
+ # @return Array for valid properties with the reasons
58
+ def list_invalid_properties
59
+ []
60
+ end
61
+
62
+ # Check to see if the all the properties in the model are valid
63
+ # @return true if the model is valid
64
+ def valid?
65
+ true
66
+ end
67
+
68
+ # Checks equality by comparing each attribute.
69
+ # @param [Object] Object to be compared
70
+ def ==(o)
71
+ return true if equal?(o)
72
+
73
+ self.class == o.class &&
74
+ code_category == o.code_category &&
75
+ code_list_qualifier_code == o.code_list_qualifier_code &&
76
+ industry_code == o.industry_code &&
77
+ injured_body_part_name == o.injured_body_part_name
78
+ end
79
+
80
+ # @see the `==` method
81
+ # @param [Object] Object to be compared
82
+ def eql?(o)
83
+ self == o
84
+ end
85
+
86
+ # Calculates hash code according to all attributes.
87
+ # @return [Fixnum] Hash code
88
+ def hash
89
+ [code_category, code_list_qualifier_code, industry_code, injured_body_part_name].hash
90
+ end
91
+
92
+ # Builds the object from hash
93
+ # @param [Hash] attributes Model attributes in the form of hash
94
+ # @return [Object] Returns the model itself
95
+ def build_from_hash(attributes)
96
+ return nil unless attributes.is_a?(Hash)
97
+
98
+ self.class.swagger_types.each_pair do |key, type|
99
+ if type =~ /\AArray<(.*)>/i
100
+ # check to ensure the input is an array given that the attribute
101
+ # is documented as an array but the input is not
102
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
103
+ send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize(Regexp.last_match(1), v) })
104
+ end
105
+ elsif !attributes[self.class.attribute_map[key]].nil?
106
+ send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
107
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
108
+ end
109
+
110
+ self
111
+ end
112
+
113
+ # Deserializes the data based on type
114
+ # @param string type Data type
115
+ # @param string value Value to be deserialized
116
+ # @return [Object] Deserialized data
117
+ def _deserialize(type, value)
118
+ case type.to_sym
119
+ when :DateTime
120
+ DateTime.parse(value)
121
+ when :Date
122
+ Date.parse(value)
123
+ when :String
124
+ value.to_s
125
+ when :Integer
126
+ value.to_i
127
+ when :Float
128
+ value.to_f
129
+ when :BOOLEAN
130
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
131
+ true
132
+ else
133
+ false
134
+ end
135
+ when :Object
136
+ # generic object (usually a Hash), return directly
137
+ value
138
+ when /\AArray<(?<inner_type>.+)>\z/
139
+ inner_type = Regexp.last_match[:inner_type]
140
+ value.map { |v| _deserialize(inner_type, v) }
141
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
142
+ k_type = Regexp.last_match[:k_type]
143
+ v_type = Regexp.last_match[:v_type]
144
+ {}.tap do |hash|
145
+ value.each do |k, v|
146
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
147
+ end
148
+ end
149
+ else # model
150
+ temp_model = SwaggerClient.const_get(type).new
151
+ temp_model.build_from_hash(value)
152
+ end
153
+ end
154
+
155
+ # Returns the string representation of the object
156
+ # @return [String] String presentation of the object
157
+ def to_s
158
+ to_hash.to_s
159
+ end
160
+
161
+ # to_body is an alias to to_hash (backward compatibility)
162
+ # @return [Hash] Returns the object in the form of hash
163
+ def to_body
164
+ to_hash
165
+ end
166
+
167
+ # Returns the object in the form of hash
168
+ # @return [Hash] Returns the object in the form of hash
169
+ def to_hash
170
+ hash = {}
171
+ self.class.attribute_map.each_pair do |attr, param|
172
+ value = send(attr)
173
+ next if value.nil?
174
+
175
+ hash[param] = _to_hash(value)
176
+ end
177
+ hash
178
+ end
179
+
180
+ # Outputs non-array value in the form of hash
181
+ # For object, use to_hash. Otherwise, just return the value
182
+ # @param [Object] value Any valid value
183
+ # @return [Hash] Returns the value in the form of hash
184
+ def _to_hash(value)
185
+ if value.is_a?(Array)
186
+ value.compact.map { |v| _to_hash(v) }
187
+ elsif value.is_a?(Hash)
188
+ {}.tap do |hash|
189
+ value.each { |k, v| hash[k] = _to_hash(v) }
190
+ end
191
+ elsif value.respond_to? :to_hash
192
+ value.to_hash
193
+ else
194
+ value
195
+ end
196
+ end
197
+ end
198
+ end
199
+ end
200
+ end
@@ -0,0 +1,359 @@
1
+ # #Eligibility
2
+ #
3
+ # Reference for developers
4
+ #
5
+ # OpenAPI spec version: v3
6
+ #
7
+ # Generated by: https://github.com/swagger-api/swagger-codegen.git
8
+ # Swagger Codegen version: 2.4.17
9
+ #
10
+
11
+ require 'date'
12
+
13
+ module ChangeHealthcare
14
+ module Eligibility
15
+ module SwaggerClient
16
+ # Loop: 2110[C|D], Notes: Eligibility or Benefit Information
17
+ class Encounter
18
+ # Loop: 2100[C|D], Segment: DTP, Element: DTP02, Notes: Date Time Period
19
+ attr_accessor :beginning_date_of_service
20
+
21
+ # Loop: 2100[C|D], Segment: DTP, Element: DTP02, Notes: Date Time Period
22
+ attr_accessor :date_of_service
23
+
24
+ attr_accessor :date_range
25
+
26
+ # Loop: 2110[C|D], Segment: EQ, Element: EQ05, Notes: Composite Diagnosis Code Pointer
27
+ attr_accessor :diagnosis_code_pointer
28
+
29
+ # Loop: 2100[C|D], Segment: DTP, Element: DTP02, Notes: Date Time Period
30
+ attr_accessor :end_date_of_service
31
+
32
+ # Loop: 2110[C|D], Segment: III, Element: III02, Notes: III01=ZZ Industry Code, Allowed Values are: '01' Pharmacy,'03' School,'04' Homeless Shelter,'05' Indian Health Service Free-standing Facility,'06' Indian Health Service Provider-based Facility,'07' Tribal 638 Free-standing Facility,'08' Tribal 638 Provider-based Facility,'11' Office,'12' Home,'13' Assisted Living Facility,'14' Group Home,'15' Mobile Unit,'20' Urgent Care Facility,'21' Inpatient Hospital,'22' Outpatient Hospital,'23' Emergency Room - Hospital,'24' Ambulatory Surgical Center,'25' Birthing Center,'26' Military Treatment Facility,'31' Skilled Nursing Facility,'32' Nursing Facility,'33' Custodial Care Facility,'34' Hospice,'41' Ambulance - Land,'42' Ambulance - Air or Water,'49' Independent Clinic,'50' Federally Qualified Health Center,'51' Inpatient Psychiatric Facility,'52' Psychiatric Facility - Partial Hospitalization,'53' Community Mental Health Center,'54' Intermediate Care Facility/Mentally Retarded,'55' Residential Substance Abuse Treatment Facility,'56' Psychiatric Residential Treatment Center,'57' Non-residential Substance Abuse Treatment Facility,'60' Mass Immunization Center,'61'Comprehensive Inpatient Rehabilitation Facility,'62' Comprehensive Outpatient Rehabilitation Facility,'65' End-Stage Renal Disease Treatment Facility,'71' Public Health Clinic,'72' Rural Health Clinic,'81' Independent Laboratory,'99' Other Place of Service
33
+ attr_accessor :industry_code
34
+
35
+ # Loop: 2110[C|D], Segment: EQ, Element: EQ02-1-3, Notes: Composite Medical Procedure Identifier
36
+ attr_accessor :medical_procedures
37
+
38
+ # Loop: 2110[C|D], Segment: REF, Element: REF02, Notes: Prior Authorization or Referral Number
39
+ attr_accessor :prior_authorization_or_referral_number
40
+
41
+ # Loop: 2110[C|D], Segment: EQ, Element: EQ02-2, Notes: Composite Medical Procedure Identifier - Procedure Code
42
+ attr_accessor :procedure_code
43
+
44
+ # Loop: 2110[C|D], Segment: EQ, Element: EQ02-3, Notes: Composite Medical Procedure Identifier - Procedure Modifier
45
+ attr_accessor :procedure_modifiers
46
+
47
+ # Loop: 2110[C|D], Segment: EQ, Element: EQ02-1, Notes: Composite Medical Procedure Identifier - Product or Service ID Qualifier, Allowed Values are: 'AD' American Dental Association Codes, 'CJ' Current Procedural Terminology (CPT) Codes,'HC' Health Care Financing Administration Common Procedural Coding System (HCPCS) Codes,'ID' International Classification of Diseases, 9th Revision, Clinical Modification (ICD-9-CM) - Procedure, 'IV' Home Infusion EDI Coalition (HIEC) Product/Service Code, 'N4' National Drug Code in 5-4-2 Format, 'ZZ' Mutually Defined
48
+ attr_accessor :product_or_service_id_qualifier
49
+
50
+ # Loop: 2110[C|D], Segment: REF, Element: REF01, Notes: Prior Authorization or Referral Number, Allowed Values are: '9F' Referral Number, 'G1' Prior Authorization Number
51
+ attr_accessor :reference_identification_qualifier
52
+
53
+ # Loop: 2110[C|D], Segment: EQ, Element: EQ01, Notes: Service Type Codes
54
+ attr_accessor :service_type_codes
55
+
56
+ class EnumAttributeValidator
57
+ attr_reader :datatype, :allowable_values
58
+
59
+ def initialize(datatype, allowable_values)
60
+ @allowable_values = allowable_values.map do |value|
61
+ case datatype.to_s
62
+ when /Integer/i
63
+ value.to_i
64
+ when /Float/i
65
+ value.to_f
66
+ else
67
+ value
68
+ end
69
+ end
70
+ end
71
+
72
+ def valid?(value)
73
+ !value || allowable_values.include?(value)
74
+ end
75
+ end
76
+
77
+ # Attribute mapping from ruby-style variable name to JSON key.
78
+ def self.attribute_map
79
+ {
80
+ 'beginning_date_of_service': :beginningDateOfService,
81
+ 'date_of_service': :dateOfService,
82
+ 'date_range': :dateRange,
83
+ 'diagnosis_code_pointer': :diagnosisCodePointer,
84
+ 'end_date_of_service': :endDateOfService,
85
+ 'industry_code': :industryCode,
86
+ 'medical_procedures': :medicalProcedures,
87
+ 'prior_authorization_or_referral_number': :priorAuthorizationOrReferralNumber,
88
+ 'procedure_code': :procedureCode,
89
+ 'procedure_modifiers': :procedureModifiers,
90
+ 'product_or_service_id_qualifier': :productOrServiceIDQualifier,
91
+ 'reference_identification_qualifier': :referenceIdentificationQualifier,
92
+ 'service_type_codes': :serviceTypeCodes
93
+ }
94
+ end
95
+
96
+ # Attribute type mapping.
97
+ def self.swagger_types
98
+ {
99
+ 'beginning_date_of_service': :String,
100
+ 'date_of_service': :String,
101
+ 'date_range': :BOOLEAN,
102
+ 'diagnosis_code_pointer': :'Array<String>',
103
+ 'end_date_of_service': :String,
104
+ 'industry_code': :String,
105
+ 'medical_procedures': :'Array<MedicalProcedure>',
106
+ 'prior_authorization_or_referral_number': :String,
107
+ 'procedure_code': :String,
108
+ 'procedure_modifiers': :'Array<String>',
109
+ 'product_or_service_id_qualifier': :String,
110
+ 'reference_identification_qualifier': :String,
111
+ 'service_type_codes': :'Array<String>'
112
+ }
113
+ end
114
+
115
+ # Initializes the object
116
+ # @param [Hash] attributes Model attributes in the form of hash
117
+ def initialize(attributes = {})
118
+ return unless attributes.is_a?(Hash)
119
+
120
+ # convert string to symbol for hash key
121
+ attributes = attributes.transform_keys(&:to_sym)
122
+
123
+ self.beginning_date_of_service = attributes[:beginningDateOfService] if attributes.key?(:beginningDateOfService)
124
+
125
+ self.date_of_service = attributes[:dateOfService] if attributes.key?(:dateOfService)
126
+
127
+ self.date_range = attributes[:dateRange] if attributes.key?(:dateRange)
128
+
129
+ if attributes.key?(:diagnosisCodePointer)
130
+ if (value = attributes[:diagnosisCodePointer]).is_a?(Array)
131
+ self.diagnosis_code_pointer = value
132
+ end
133
+ end
134
+
135
+ self.end_date_of_service = attributes[:endDateOfService] if attributes.key?(:endDateOfService)
136
+
137
+ self.industry_code = attributes[:industryCode] if attributes.key?(:industryCode)
138
+
139
+ if attributes.key?(:medicalProcedures)
140
+ if (value = attributes[:medicalProcedures]).is_a?(Array)
141
+ self.medical_procedures = value
142
+ end
143
+ end
144
+
145
+ self.prior_authorization_or_referral_number = attributes[:priorAuthorizationOrReferralNumber] if attributes.key?(:priorAuthorizationOrReferralNumber)
146
+
147
+ self.procedure_code = attributes[:procedureCode] if attributes.key?(:procedureCode)
148
+
149
+ if attributes.key?(:procedureModifiers)
150
+ if (value = attributes[:procedureModifiers]).is_a?(Array)
151
+ self.procedure_modifiers = value
152
+ end
153
+ end
154
+
155
+ self.product_or_service_id_qualifier = attributes[:productOrServiceIDQualifier] if attributes.key?(:productOrServiceIDQualifier)
156
+
157
+ self.reference_identification_qualifier = attributes[:referenceIdentificationQualifier] if attributes.key?(:referenceIdentificationQualifier)
158
+
159
+ if attributes.key?(:serviceTypeCodes)
160
+ if (value = attributes[:serviceTypeCodes]).is_a?(Array)
161
+ self.service_type_codes = value
162
+ end
163
+ end
164
+ end
165
+
166
+ # Show invalid properties with the reasons. Usually used together with valid?
167
+ # @return Array for valid properties with the reasons
168
+ def list_invalid_properties
169
+ []
170
+ end
171
+
172
+ # Check to see if the all the properties in the model are valid
173
+ # @return true if the model is valid
174
+ def valid?
175
+ industry_code_validator = EnumAttributeValidator.new('String', %w[01 03 04 05 06 07 08 11 12 13 14 15 20 21 22 23 24 25 26 31 32 33 34 41 42 49 50 51 52 53 54 55 56 57 60 61 62 65 71 72 81 99])
176
+ return false unless industry_code_validator.valid?(@industry_code)
177
+
178
+ product_or_service_id_qualifier_validator = EnumAttributeValidator.new('String', %w[AD CJ HC ID IV N4 ZZ])
179
+ return false unless product_or_service_id_qualifier_validator.valid?(@product_or_service_id_qualifier)
180
+
181
+ reference_identification_qualifier_validator = EnumAttributeValidator.new('String', %w[9F G1])
182
+ return false unless reference_identification_qualifier_validator.valid?(@reference_identification_qualifier)
183
+
184
+ true
185
+ end
186
+
187
+ # Custom attribute writer method checking allowed values (enum).
188
+ # @param [Object] industry_code Object to be assigned
189
+ def industry_code=(industry_code)
190
+ validator = EnumAttributeValidator.new('String', %w[01 03 04 05 06 07 08 11 12 13 14 15 20 21 22 23 24 25 26 31 32 33 34 41 42 49 50 51 52 53 54 55 56 57 60 61 62 65 71 72 81 99])
191
+ raise ArgumentError, %(invalid value for "industry_code", must be one of #{validator.allowable_values}.) unless validator.valid?(industry_code)
192
+
193
+ @industry_code = industry_code
194
+ end
195
+
196
+ # Custom attribute writer method checking allowed values (enum).
197
+ # @param [Object] product_or_service_id_qualifier Object to be assigned
198
+ def product_or_service_id_qualifier=(product_or_service_id_qualifier)
199
+ validator = EnumAttributeValidator.new('String', %w[AD CJ HC ID IV N4 ZZ])
200
+ unless validator.valid?(product_or_service_id_qualifier)
201
+ raise ArgumentError, %(invalid value for "product_or_service_id_qualifier", must be one of #{validator.allowable_values}.)
202
+ end
203
+
204
+ @product_or_service_id_qualifier = product_or_service_id_qualifier
205
+ end
206
+
207
+ # Custom attribute writer method checking allowed values (enum).
208
+ # @param [Object] reference_identification_qualifier Object to be assigned
209
+ def reference_identification_qualifier=(reference_identification_qualifier)
210
+ validator = EnumAttributeValidator.new('String', %w[9F G1])
211
+ unless validator.valid?(reference_identification_qualifier)
212
+ raise ArgumentError, %(invalid value for "reference_identification_qualifier", must be one of #{validator.allowable_values}.)
213
+ end
214
+
215
+ @reference_identification_qualifier = reference_identification_qualifier
216
+ end
217
+
218
+ # Checks equality by comparing each attribute.
219
+ # @param [Object] Object to be compared
220
+ def ==(o)
221
+ return true if equal?(o)
222
+
223
+ self.class == o.class &&
224
+ beginning_date_of_service == o.beginning_date_of_service &&
225
+ date_of_service == o.date_of_service &&
226
+ date_range == o.date_range &&
227
+ diagnosis_code_pointer == o.diagnosis_code_pointer &&
228
+ end_date_of_service == o.end_date_of_service &&
229
+ industry_code == o.industry_code &&
230
+ medical_procedures == o.medical_procedures &&
231
+ prior_authorization_or_referral_number == o.prior_authorization_or_referral_number &&
232
+ procedure_code == o.procedure_code &&
233
+ procedure_modifiers == o.procedure_modifiers &&
234
+ product_or_service_id_qualifier == o.product_or_service_id_qualifier &&
235
+ reference_identification_qualifier == o.reference_identification_qualifier &&
236
+ service_type_codes == o.service_type_codes
237
+ end
238
+
239
+ # @see the `==` method
240
+ # @param [Object] Object to be compared
241
+ def eql?(o)
242
+ self == o
243
+ end
244
+
245
+ # Calculates hash code according to all attributes.
246
+ # @return [Fixnum] Hash code
247
+ def hash
248
+ [beginning_date_of_service, date_of_service, date_range, diagnosis_code_pointer, end_date_of_service, industry_code, medical_procedures, prior_authorization_or_referral_number, procedure_code, procedure_modifiers, product_or_service_id_qualifier, reference_identification_qualifier, service_type_codes].hash
249
+ end
250
+
251
+ # Builds the object from hash
252
+ # @param [Hash] attributes Model attributes in the form of hash
253
+ # @return [Object] Returns the model itself
254
+ def build_from_hash(attributes)
255
+ return nil unless attributes.is_a?(Hash)
256
+
257
+ self.class.swagger_types.each_pair do |key, type|
258
+ if type =~ /\AArray<(.*)>/i
259
+ # check to ensure the input is an array given that the attribute
260
+ # is documented as an array but the input is not
261
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
262
+ send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize(Regexp.last_match(1), v) })
263
+ end
264
+ elsif !attributes[self.class.attribute_map[key]].nil?
265
+ send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
266
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
267
+ end
268
+
269
+ self
270
+ end
271
+
272
+ # Deserializes the data based on type
273
+ # @param string type Data type
274
+ # @param string value Value to be deserialized
275
+ # @return [Object] Deserialized data
276
+ def _deserialize(type, value)
277
+ case type.to_sym
278
+ when :DateTime
279
+ DateTime.parse(value)
280
+ when :Date
281
+ Date.parse(value)
282
+ when :String
283
+ value.to_s
284
+ when :Integer
285
+ value.to_i
286
+ when :Float
287
+ value.to_f
288
+ when :BOOLEAN
289
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
290
+ true
291
+ else
292
+ false
293
+ end
294
+ when :Object
295
+ # generic object (usually a Hash), return directly
296
+ value
297
+ when /\AArray<(?<inner_type>.+)>\z/
298
+ inner_type = Regexp.last_match[:inner_type]
299
+ value.map { |v| _deserialize(inner_type, v) }
300
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
301
+ k_type = Regexp.last_match[:k_type]
302
+ v_type = Regexp.last_match[:v_type]
303
+ {}.tap do |hash|
304
+ value.each do |k, v|
305
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
306
+ end
307
+ end
308
+ else # model
309
+ temp_model = SwaggerClient.const_get(type).new
310
+ temp_model.build_from_hash(value)
311
+ end
312
+ end
313
+
314
+ # Returns the string representation of the object
315
+ # @return [String] String presentation of the object
316
+ def to_s
317
+ to_hash.to_s
318
+ end
319
+
320
+ # to_body is an alias to to_hash (backward compatibility)
321
+ # @return [Hash] Returns the object in the form of hash
322
+ def to_body
323
+ to_hash
324
+ end
325
+
326
+ # Returns the object in the form of hash
327
+ # @return [Hash] Returns the object in the form of hash
328
+ def to_hash
329
+ hash = {}
330
+ self.class.attribute_map.each_pair do |attr, param|
331
+ value = send(attr)
332
+ next if value.nil?
333
+
334
+ hash[param] = _to_hash(value)
335
+ end
336
+ hash
337
+ end
338
+
339
+ # Outputs non-array value in the form of hash
340
+ # For object, use to_hash. Otherwise, just return the value
341
+ # @param [Object] value Any valid value
342
+ # @return [Hash] Returns the value in the form of hash
343
+ def _to_hash(value)
344
+ if value.is_a?(Array)
345
+ value.compact.map { |v| _to_hash(v) }
346
+ elsif value.is_a?(Hash)
347
+ {}.tap do |hash|
348
+ value.each { |k, v| hash[k] = _to_hash(v) }
349
+ end
350
+ elsif value.respond_to? :to_hash
351
+ value.to_hash
352
+ else
353
+ value
354
+ end
355
+ end
356
+ end
357
+ end
358
+ end
359
+ end