From 75e97364487831a2c422a958d155e1bcf924550e Mon Sep 17 00:00:00 2001 From: mchristiansonVA <95487885+mchristiansonVA@users.noreply.github.com> Date: Tue, 13 Jun 2023 09:13:11 -0400 Subject: [PATCH] Api 27050 request disability examples (#12931) * Update example.json, fix logic to handle no secondary disabilities case * Add rswag for updated 526 submit example --- .../v2/disability_compensation_validation.rb | 2 +- .../swagger/claims_api/v2/dev/swagger.json | 69 ++++++++-------- .../disability_compensation/example.json | 81 +++++++++---------- .../v2/disability_compensation_pdf_mapper.rb | 2 +- 4 files changed, 74 insertions(+), 80 deletions(-) diff --git a/modules/claims_api/app/controllers/concerns/claims_api/v2/disability_compensation_validation.rb b/modules/claims_api/app/controllers/concerns/claims_api/v2/disability_compensation_validation.rb index 08e16c7d0cc..91c88c38c17 100644 --- a/modules/claims_api/app/controllers/concerns/claims_api/v2/disability_compensation_validation.rb +++ b/modules/claims_api/app/controllers/concerns/claims_api/v2/disability_compensation_validation.rb @@ -416,7 +416,7 @@ def collect_primary_secondary_disability_names(disabilities) names = [] disabilities.each do |disability| names << disability['name'].strip.downcase - disability['secondaryDisabilities'].each do |secondary| + disability['secondaryDisabilities']&.each do |secondary| names << secondary['name'].strip.downcase end end diff --git a/modules/claims_api/app/swagger/claims_api/v2/dev/swagger.json b/modules/claims_api/app/swagger/claims_api/v2/dev/swagger.json index bb6feb244c4..adcecdd7f10 100644 --- a/modules/claims_api/app/swagger/claims_api/v2/dev/swagger.json +++ b/modules/claims_api/app/swagger/claims_api/v2/dev/swagger.json @@ -3863,53 +3863,50 @@ }, "disabilities": [ { - "disabilityActionType": "REOPEN", - "name": "PTSD (post traumatic stress disorder)", - "classificationCode": "ABCDEFGHIJ", - "serviceRelevance": "ABCDEFG", - "approximateDate": "4592-11-04", - "ratedDisabilityId": "ABCDEFGHIJKLMNOPQRSTUVWX", - "diagnosticCode": 0, - "secondaryDisabilities": [ - { - "name": "ABCDEF", - "disabilityActionType": "SECONDARY", - "serviceRelevance": "ABCDEFGHIJKLMNOPQ", - "classificationCode": "ABCDEFGHIJKLMNO", - "approximateDate": "9904-01-03", - "exposureOrEventOrInjury": "EXPOSURE" - } - ], + "disabilityActionType": "NEW", + "name": "Hearing Loss", + "classificationCode": "3140", + "serviceRelevance": "Heavy equipment operator in service", + "approximateDate": "07-1968", + "isRelatedToToxicExposure": false, + "exposureOrEventOrInjury": "Noise" + }, + { + "disabilityActionType": "INCREASE", + "name": "diabetes, adult-onset", + "classificationCode": "2065", + "serviceRelevance": "Service in Vietnam War", + "approximateDate": "12-1972", + "ratedDisabilityId": "1234567", + "diagnosticCode": 9999, "isRelatedToToxicExposure": true, - "exposureOrEventOrInjury": "EXPOSURE" + "exposureOrEventOrInjury": "Agent Orange" }, { - "disabilityActionType": "REOPEN", - "name": "Trauma", - "classificationCode": "ABCDEFGHIJ", - "serviceRelevance": "ABCDEFG", - "approximateDate": "4592-11-04", - "ratedDisabilityId": "ABCDEFGHIJKLMNOPQRSTUVWX", - "diagnosticCode": 0, + "disabilityActionType": "NONE", + "name": "knee condition, right", + "classificationCode": "3710", + "serviceRelevance": "Explanation of service connection", + "approximateDate": "11-04-2019", + "ratedDisabilityId": "1234567", + "diagnosticCode": 9999, + "isRelatedToToxicExposure": false, "secondaryDisabilities": [ { - "name": "GHIJKLM", + "name": "knee condition, left", "disabilityActionType": "SECONDARY", - "serviceRelevance": "ABCDEFGHIJKLMNOPQ", - "classificationCode": "ABCDEFGHIJKLMNO", - "approximateDate": "9904-01-03", - "exposureOrEventOrInjury": "EXPOSURE" + "classificationCode": "3700", + "serviceRelevance": "Injured left knee when brace on right knee failed", + "approximateDate": "06-11-2008" } - ], - "isRelatedToToxicExposure": true, - "exposureOrEventOrInjury": "EXPOSURE" + ] } ], "treatments": [ { "treatedDisabilityNames": [ - "PTSD (post traumatic stress disorder)", - "Trauma" + "Hearing Loss", + "diabetes, adult-onset" ], "center": { "name": "Center One", @@ -3920,7 +3917,7 @@ }, { "treatedDisabilityNames": [ - "Trauma" + "knee condition, right" ], "center": { "name": "Center One", diff --git a/modules/claims_api/config/schemas/v2/request_bodies/disability_compensation/example.json b/modules/claims_api/config/schemas/v2/request_bodies/disability_compensation/example.json index bfb42505994..b2ca7f5d348 100644 --- a/modules/claims_api/config/schemas/v2/request_bodies/disability_compensation/example.json +++ b/modules/claims_api/config/schemas/v2/request_bodies/disability_compensation/example.json @@ -87,51 +87,48 @@ }, "disabilities": [ { - "disabilityActionType": "REOPEN", - "name": "PTSD (post traumatic stress disorder)", - "classificationCode": "ABCDEFGHIJ", - "serviceRelevance": "ABCDEFG", - "approximateDate": "4592-11-04", - "ratedDisabilityId": "ABCDEFGHIJKLMNOPQRSTUVWX", - "diagnosticCode": 0, - "secondaryDisabilities": [ - { - "name": "ABCDEF", - "disabilityActionType": "SECONDARY", - "serviceRelevance": "ABCDEFGHIJKLMNOPQ", - "classificationCode": "ABCDEFGHIJKLMNO", - "approximateDate": "9904-01-03", - "exposureOrEventOrInjury": "EXPOSURE" - } - ], - "isRelatedToToxicExposure": true, - "exposureOrEventOrInjury": "EXPOSURE" + "disabilityActionType": "NEW", + "name": "Hearing Loss", + "classificationCode": "3140", + "serviceRelevance": "Heavy equipment operator in service", + "approximateDate": "07-1968", + "isRelatedToToxicExposure": false, + "exposureOrEventOrInjury": "Noise" }, { - "disabilityActionType": "REOPEN", - "name": "Trauma", - "classificationCode": "ABCDEFGHIJ", - "serviceRelevance": "ABCDEFG", - "approximateDate": "4592-11-04", - "ratedDisabilityId": "ABCDEFGHIJKLMNOPQRSTUVWX", - "diagnosticCode": 0, - "secondaryDisabilities": [ - { - "name": "GHIJKLM", - "disabilityActionType": "SECONDARY", - "serviceRelevance": "ABCDEFGHIJKLMNOPQ", - "classificationCode": "ABCDEFGHIJKLMNO", - "approximateDate": "9904-01-03", - "exposureOrEventOrInjury": "EXPOSURE" - } - ], - "isRelatedToToxicExposure": true, - "exposureOrEventOrInjury": "EXPOSURE" + "disabilityActionType": "INCREASE", + "name": "diabetes, adult-onset", + "classificationCode": "2065", + "serviceRelevance": "Service in Vietnam War", + "approximateDate": "12-1972", + "ratedDisabilityId": "1234567", + "diagnosticCode": 9999, + "isRelatedToToxicExposure": true, + "exposureOrEventOrInjury": "Agent Orange" + }, + { + "disabilityActionType": "NONE", + "name": "knee condition, right", + "classificationCode": "3710", + "serviceRelevance": "Explanation of service connection", + "approximateDate": "11-04-2019", + "ratedDisabilityId": "1234567", + "diagnosticCode": 9999, + "isRelatedToToxicExposure": false, + "secondaryDisabilities": [ + { + "name": "knee condition, left", + "disabilityActionType": "SECONDARY", + "classificationCode": "3700", + "serviceRelevance": "Injured left knee when brace on right knee failed", + "approximateDate": "06-11-2008" + } + ] } - ], + ], "treatments": [ { - "treatedDisabilityNames": ["PTSD (post traumatic stress disorder)", "Trauma"], + "treatedDisabilityNames": ["Hearing Loss", "diabetes, adult-onset"], "center": { "name": "Center One", "state": "GA", @@ -140,7 +137,7 @@ "startDate": "03-1985" }, { - "treatedDisabilityNames": ["Trauma"], + "treatedDisabilityNames": ["knee condition, right"], "center": { "name": "Center One", "state": "GA", @@ -148,7 +145,7 @@ }, "startDate": "03-1985" } - ], + ], "serviceInformation": { "servicePeriods": [ { diff --git a/modules/claims_api/lib/claims_api/v2/disability_compensation_pdf_mapper.rb b/modules/claims_api/lib/claims_api/v2/disability_compensation_pdf_mapper.rb index 0681fa87f65..c705055ddd7 100644 --- a/modules/claims_api/lib/claims_api/v2/disability_compensation_pdf_mapper.rb +++ b/modules/claims_api/lib/claims_api/v2/disability_compensation_pdf_mapper.rb @@ -131,7 +131,7 @@ def transform_disabilities disability.delete('ratedDisabilityId') disability.delete('diagnosticCode') disability.delete('disabilityActionType') - sec_dis = disability['secondaryDisabilities'].map do |secondary_disability| + sec_dis = disability['secondaryDisabilities']&.map do |secondary_disability| secondary_disability['disability'] = secondary_disability['name'] secondary_disability end