Class: ChangeHealth::Response::Claim::ReportData
- Inherits:
-
ResponseData
- Object
- ResponseData
- ChangeHealth::Response::Claim::ReportData
show all
- Defined in:
- lib/change_health/response/claim/report/report_data.rb
Instance Attribute Summary collapse
Attributes inherited from ResponseData
#raw, #response
Class Method Summary
collapse
Instance Method Summary
collapse
#errors, #errors?, #recommend_retry?, #request_body, #server_error
Constructor Details
#initialize(report_name, json, data: nil, response: nil) ⇒ ReportData
10
11
12
13
14
|
# File 'lib/change_health/response/claim/report/report_data.rb', line 10
def initialize(report_name, json, data: nil, response: nil)
super(data: data, response: response)
@report_name = report_name
@json = json
end
|
Instance Attribute Details
#json ⇒ Object
Also known as:
json?
Returns the value of attribute json.
7
8
9
|
# File 'lib/change_health/response/claim/report/report_data.rb', line 7
def json
@json
end
|
#report_name ⇒ Object
Returns the value of attribute report_name.
7
8
9
|
# File 'lib/change_health/response/claim/report/report_data.rb', line 7
def report_name
@report_name
end
|
Class Method Details
.is_277?(report_name) ⇒ Boolean
34
35
36
|
# File 'lib/change_health/response/claim/report/report_data.rb', line 34
def self.is_277?(report_name)
report_name.start_with?('X3')
end
|
.is_835?(report_name) ⇒ Boolean
42
43
44
|
# File 'lib/change_health/response/claim/report/report_data.rb', line 42
def self.is_835?(report_name)
report_name.start_with?('R5')
end
|
.report_type(report_name) ⇒ Object
24
25
26
27
28
|
# File 'lib/change_health/response/claim/report/report_data.rb', line 24
def self.report_type(report_name)
return '277' if is_277?(report_name)
'835' if is_835?(report_name)
end
|
Instance Method Details
#edi? ⇒ Boolean
16
17
18
|
# File 'lib/change_health/response/claim/report/report_data.rb', line 16
def edi?
!@json
end
|
#is_277? ⇒ Boolean
30
31
32
|
# File 'lib/change_health/response/claim/report/report_data.rb', line 30
def is_277?
self.class.is_277?(@report_name)
end
|
#is_835? ⇒ Boolean
38
39
40
|
# File 'lib/change_health/response/claim/report/report_data.rb', line 38
def is_835?
self.class.is_835?(@report_name)
end
|
#presence(obj) ⇒ Object
Ripped from rails Object#presence method
47
48
49
|
# File 'lib/change_health/response/claim/report/report_data.rb', line 47
def presence(obj)
obj unless obj.respond_to?(:empty?) ? !!obj.empty? : !obj
end
|
#report_type ⇒ Object
20
21
22
|
# File 'lib/change_health/response/claim/report/report_data.rb', line 20
def report_type
self.class.report_type(@report_name)
end
|