Skip to content

Commit 33b9173

Browse files
authored
Travel Pay / Sentence case claim statuses (#21081)
* humanize instead of titleize for sentence case of status; update tests * update swagger docs
1 parent 99be9ab commit 33b9173

File tree

5 files changed

+22
-22
lines changed

5 files changed

+22
-22
lines changed

app/swagger/swagger/schemas/travel_pay.rb

+14-14
Original file line numberDiff line numberDiff line change
@@ -17,26 +17,26 @@ class TravelPay
1717
property :id, type: :string, example: '33333333-5555-4444-bbbb-222222444444'
1818
property :claimNumber, type: :string, example: 'TC1234123412341234'
1919
property :claimStatus, type: :string, enum: [
20-
'Pre Approved For Payment',
20+
'Pre approved for payment',
2121
'Saved',
22-
'In Process',
22+
'In process',
2323
'Pending',
24-
'On Hold',
25-
'In Manual Review',
26-
'Submitted For Payment',
27-
'Claim Paid',
24+
'On hold',
25+
'In manual review',
26+
'Submitted for payment',
27+
'Claim paid',
2828
'Incomplete',
2929
'Appeal',
3030
'Denied',
31-
'Closed With No Payment',
32-
'Claim Submitted',
33-
'Approved For Payment',
34-
'Approved For Payment Incomplete',
35-
'Payment Canceled',
36-
'Partial Payment',
37-
'Fiscal Rescinded',
31+
'Closed with no payment',
32+
'Claim submitted',
33+
'Approved for payment',
34+
'Approved for payment incomplete',
35+
'Payment canceled',
36+
'Partial payment',
37+
'Fiscal rescinded',
3838
'Unspecified'
39-
], example: 'Claim Paid'
39+
], example: 'Claim paid'
4040
property :appointmentDateTime, type: :string, example: '2024-06-13T13:57:07.291Z'
4141
property :facilityName, type: :string, example: 'Cheyenne VA Medical Center'
4242
property :createdOn, type: :string, example: '2024-06-13T13:57:07.291Z'

modules/travel_pay/app/services/travel_pay/claim_association_service.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def associate_appointments_to_claims(params = {})
4141
raw_claims = faraday_response.body['data'].deep_dup
4242

4343
data = raw_claims&.map do |sc|
44-
sc['claimStatus'] = sc['claimStatus'].underscore.titleize
44+
sc['claimStatus'] = sc['claimStatus'].underscore.humanize
4545
sc
4646
end
4747

@@ -67,7 +67,7 @@ def associate_single_appointment_to_claim(params = {})
6767

6868
claim_data = faraday_response.body['data']&.dig(0)
6969

70-
claim_data['claimStatus'] = claim_data['claimStatus'].underscore.titleize if claim_data
70+
claim_data['claimStatus'] = claim_data['claimStatus'].underscore.humanize if claim_data
7171

7272
appt['travelPayClaim'] = {}
7373
appt['travelPayClaim']['metadata'] = build_metadata(faraday_response.body)

modules/travel_pay/app/services/travel_pay/claims_service.rb

+3-3
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def get_claims(params = {})
1515

1616
{
1717
data: claims.map do |sc|
18-
sc['claimStatus'] = sc['claimStatus'].underscore.titleize
18+
sc['claimStatus'] = sc['claimStatus'].underscore.humanize
1919
sc
2020
end
2121
}
@@ -37,7 +37,7 @@ def get_claims_by_date_range(params = {})
3737
'message' => faraday_response.body['message']
3838
},
3939
data: raw_claims&.map do |sc|
40-
sc['claimStatus'] = sc['claimStatus'].underscore.titleize
40+
sc['claimStatus'] = sc['claimStatus'].underscore.humanize
4141
sc
4242
end
4343
}
@@ -64,7 +64,7 @@ def get_claim_by_id(claim_id)
6464
claim = claims.find { |c| c['id'] == claim_id }
6565

6666
if claim
67-
claim['claimStatus'] = claim['claimStatus'].underscore.titleize
67+
claim['claimStatus'] = claim['claimStatus'].underscore.humanize
6868
claim
6969
end
7070
end

modules/travel_pay/spec/services/claims_association_service_spec.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
'id' => '73611905-71bf-46ed-b1ec-e790593b8565',
4444
'claimNumber' => 'TC0004',
4545
'claimName' => '9d81c1a1-cd05-47c6-be97-d14dec579893',
46-
'claimStatus' => 'Claim Submitted',
46+
'claimStatus' => 'ClaimSubmitted',
4747
'appointmentDateTime' => nil,
4848
'facilityName' => 'Tomah VA Medical Center',
4949
'createdOn' => '2023-12-29T22:00:57.915Z',

modules/travel_pay/spec/services/claims_service_spec.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
'id' => '73611905-71bf-46ed-b1ec-e790593b8565',
4141
'claimNumber' => 'TC0004',
4242
'claimName' => '9d81c1a1-cd05-47c6-be97-d14dec579893',
43-
'claimStatus' => 'Claim Submitted',
43+
'claimStatus' => 'ClaimSubmitted',
4444
'appointmentDateTime' => nil,
4545
'facilityName' => 'Tomah VA Medical Center',
4646
'createdOn' => '2023-12-29T22:00:57.915Z',
@@ -67,7 +67,7 @@
6767
end
6868

6969
it 'returns sorted and parsed claims' do
70-
expected_statuses = ['In Progress', 'In Progress', 'Incomplete', 'Claim Submitted']
70+
expected_statuses = ['In progress', 'In progress', 'Incomplete', 'Claim submitted']
7171

7272
claims = @service.get_claims
7373
actual_statuses = claims[:data].pluck('claimStatus')

0 commit comments

Comments
 (0)