From 10dad6cb9bbf8ef447125b4c52fee7b36afda0ba Mon Sep 17 00:00:00 2001 From: nader k Date: Fri, 19 Jul 2024 12:49:12 -0700 Subject: [PATCH 1/5] merge nrithner/APPEALS-49245 --- .../decision_review_created_parser.rb | 12 +++--------- .../decision_review_created_parser_spec.rb | 11 +++-------- 2 files changed, 6 insertions(+), 17 deletions(-) diff --git a/app/services/events/decision_review_created/decision_review_created_parser.rb b/app/services/events/decision_review_created/decision_review_created_parser.rb index 36ab06cec30..ad21bbeb5a7 100644 --- a/app/services/events/decision_review_created/decision_review_created_parser.rb +++ b/app/services/events/decision_review_created/decision_review_created_parser.rb @@ -33,24 +33,18 @@ def load_example end def initialize(headers, payload_json) - process_nonrating(payload_json) if payload_json[:request_issues].present? + process_nonrating_issue_category(payload_json) if payload_json[:request_issues].present? @payload = payload_json.to_h.deep_symbolize_keys @headers = headers @veteran = @payload.dig(:veteran) end # Checking for nonrating_issue_category is "Disposition" and processing such issues. - def process_nonrating(payload_json) + def process_nonrating_issue_category(payload_json) payload_json[:request_issues].each do |issue| next unless issue[:nonrating_issue_category] == "Disposition" - contested_id = issue[:contested_decision_issue_id] - ri = RequestIssue.where(contested_decision_issue_id: contested_id) - issue[:nonrating_issue_category] = if contested_id.present? && ri.length == 1 - ri.first.nonrating_issue_category - else - "Unknown Issue Category" - end + issue[:nonrating_issue_category] = "Unknown Issue Category" end end diff --git a/spec/services/events/decision_review_created/decision_review_created_parser_spec.rb b/spec/services/events/decision_review_created/decision_review_created_parser_spec.rb index 22fe0e941e8..379f364c724 100644 --- a/spec/services/events/decision_review_created/decision_review_created_parser_spec.rb +++ b/spec/services/events/decision_review_created/decision_review_created_parser_spec.rb @@ -174,24 +174,19 @@ create(:request_issue, contested_decision_issue_id: 1, nonrating_issue_category: "Valid Category") end - it "sets the nonrating_issue_category from the database when there is exactly one matching issue" do - parser.process_nonrating(payload_with_valid_issue) - expect(payload_with_valid_issue[:request_issues].first[:nonrating_issue_category]).to eq("Valid Category") - end - it "sets the nonrating_issue_category to 'Unknown Issue Category' when there are multiple matching issues" do create(:request_issue, contested_decision_issue_id: 1, nonrating_issue_category: "Another Valid Category") - parser.process_nonrating(payload_with_valid_issue) + parser.process_nonrating_issue_category(payload_with_valid_issue) expect(payload_with_valid_issue[:request_issues].first[:nonrating_issue_category]).to eq("Unknown Issue Category") end it "doesn't change anything if nonrating_issue_category is not Disposition" do - parser.process_nonrating(payload_with_invalid_issue) + parser.process_nonrating_issue_category(payload_with_invalid_issue) expect(payload_with_invalid_issue[:request_issues].first[:nonrating_issue_category]).to eq("Other") end it "sets the nonrating_issue_category to 'Unknown Issue Category' for all request issues when the contested_decision_issue_id is not found" do - parser.process_nonrating(payload_with_unknown_issue) + parser.process_nonrating_issue_category(payload_with_unknown_issue) payload_with_unknown_issue[:request_issues].each do |issue| expect(issue[:nonrating_issue_category]).to eq("Unknown Issue Category") end From e84d2c8aa76d03734cf04179029ff649a7224360 Mon Sep 17 00:00:00 2001 From: nader k Date: Fri, 19 Jul 2024 12:51:14 -0700 Subject: [PATCH 2/5] Merge remote-tracking branch 'origin/kshiflett/APPEALS-48965' into feature/APPEALS-28087-36678 --- app/models/end_product.rb | 4 +- client/constants/END_PRODUCT_CODES.json | 2 + client/constants/EP_CLAIM_TYPES.json | 1256 ++++++++++++----------- lib/helpers/END_PRODUCT_CODES.json | 2 + 4 files changed, 642 insertions(+), 622 deletions(-) diff --git a/app/models/end_product.rb b/app/models/end_product.rb index d8f38f68c30..f54529c66f0 100644 --- a/app/models/end_product.rb +++ b/app/models/end_product.rb @@ -23,7 +23,9 @@ class EndProduct "930AMADOR" => "AMA Difference of Opinion - Rating", "930AMADONR" => "AMA Difference of Opinion - NR", "930DORPMC" => "PMC AMA Difference of Opinion - Rating", - "930DONRPMC" => "PMC AMA Difference of Opinion - NR" + "930DONRPMC" => "PMC AMA Difference of Opinion - NR", + "930ADORPMC" => "PMC AMA Difference of Opinion - Rating", + "930ADONRPMC" => "PMC AMA Difference of Opinion - NR" }.freeze RAMP_CODES = { diff --git a/client/constants/END_PRODUCT_CODES.json b/client/constants/END_PRODUCT_CODES.json index c51e939a78f..a0ea4ea2eb5 100644 --- a/client/constants/END_PRODUCT_CODES.json +++ b/client/constants/END_PRODUCT_CODES.json @@ -115,6 +115,8 @@ "930ASNRCPMC": "PMC Supplemental Claim Non-Rating Control 930", "930DONRPMC": "PMC AMA Difference of Opinion - NR", "930DORPMC": "PMC AMA Difference of Opinion - Rating", + "930ADONRPMC": "PMC AMA Difference of Opinion - NR", + "930ADORPMC": "PMC AMA Difference of Opinion - Rating", "930RC": "Rating Control", "930RCPMC": "PMC-Rating Control" } diff --git a/client/constants/EP_CLAIM_TYPES.json b/client/constants/EP_CLAIM_TYPES.json index 261f8fe61dc..f0e57f46006 100644 --- a/client/constants/EP_CLAIM_TYPES.json +++ b/client/constants/EP_CLAIM_TYPES.json @@ -5,625 +5,639 @@ "family": "040", "official_label": "FID-Supplemental Claim Review", "issue_type": "nonrating" - }, - "030HLRFID": { - "review_type": "higher_level_review", - "benefit_type": "fiduciary", - "family": "030", - "official_label": "FID-Higher-Level Review", - "issue_type": "nonrating" - }, - "040SCR": { - "review_type": "supplemental_claim", - "benefit_type": "compensation", - "family": "040", - "issue_type": "rating", - "official_label": "Supplemental Claim Rating" - }, - "040SCNR": { - "review_type": "supplemental_claim", - "issue_type": "nonrating", - "benefit_type": "compensation", - "family": "040", - "official_label": "Supplemental Claim Non-Rating" - }, - "040SCRGTY": { - "review_type": "supplemental_claim", - "benefit_type": "compensation", - "family": "040", - "issue_type": "rating", - "official_label": "Supplemental Claim Rating > Year" - }, - "030HLRR": { - "review_type": "higher_level_review", - "issue_type": "rating", - "family": "030", - "benefit_type": "compensation", - "official_label": "Higher-Level Review Rating" - }, - "030HLRNR": { - "review_type": "higher_level_review", - "issue_type": "nonrating", - "benefit_type": "compensation", - "family": "030", - "official_label": "Higher-Level Review Non-Rating" - }, - "040SCNRPMC": { - "review_type": "supplemental_claim", - "issue_type": "nonrating", - "benefit_type": "pension", - "family": "040", - "official_label": "PMC Supplemental Claim Non-Rating" - }, - "030HLRRPMC": { - "review_type": "higher_level_review", - "issue_type": "rating", - "benefit_type": "pension", - "family": "030", - "official_label": "PMC Higher-Level Review Rating" - }, - "030HLRNRPMC": { - "review_type": "higher_level_review", - "issue_type": "nonrating", - "benefit_type": "pension", - "family": "030", - "official_label": "PMC Higher-Level Review Non-Rating" - }, - "040ADONRPMC": { - "review_type": "supplemental_claim", - "issue_type": "nonrating", - "benefit_type": "pension", - "family": "040", - "official_label": "PMC AMA Difference of Opinion - NR (040)", - "disposition_type": "difference_of_opinion" - }, - "040ADORPMC": { - "review_type": "supplemental_claim", - "issue_type": "rating", - "benefit_type": "pension", - "family": "040", - "official_label": "PMC AMA Difference of Opinion - Rating (040)", - "disposition_type": "difference_of_opinion" - }, - "040AMADONR": { - "review_type": "supplemental_claim", - "issue_type": "nonrating", - "benefit_type": "compensation", - "family": "040", - "official_label": "AMA Difference of Opinion - NR (040)", - "disposition_type": "difference_of_opinion" - }, - "040AMADOR": { - "review_type": "supplemental_claim", - "issue_type": "rating", - "benefit_type": "compensation", - "family": "040", - "official_label": "AMA Difference of Opinion - Rating (040)", - "disposition_type": "difference_of_opinion" - }, - "040BDENR": { - "review_type": "supplemental_claim", - "issue_type": "nonrating", - "benefit_type": "compensation", - "family": "040", - "official_label": "Board DTA Error Non-Rating", - "disposition_type": "board_remand" - }, - "040BDENRPMC": { - "review_type": "supplemental_claim", - "issue_type": "nonrating", - "benefit_type": "pension", - "family": "040", - "official_label": "PMC Board DTA Error Non-Rating", - "disposition_type": "board_remand" - }, - "040BDER": { - "review_type": "supplemental_claim", - "issue_type": "rating", - "benefit_type": "compensation", - "family": "040", - "official_label": "Board DTA Error Rating", - "disposition_type": "board_remand" - }, - "040HDENR": { - "review_type": "supplemental_claim", - "issue_type": "nonrating", - "benefit_type": "compensation", - "family": "040", - "official_label": "HLR DTA Error - Non-Rating", - "disposition_type": "dta_error" - }, - "040BDERPMC": { - "review_type": "supplemental_claim", - "issue_type": "rating", - "benefit_type": "pension", - "family": "040", - "official_label": "PMC Board DTA Error Rating", - "disposition_type": "dta_error" - }, - "040HDENRPMC": { - "review_type": "supplemental_claim", - "issue_type": "nonrating", - "benefit_type": "pension", - "family": "040", - "official_label": "PMC HLR DTA Error - Non-Rating", - "disposition_type": "dta_error" - }, - "040HDER": { - "review_type": "supplemental_claim", - "issue_type": "rating", - "benefit_type": "compensation", - "family": "040", - "official_label": "HLR DTA Error - Rating", - "disposition_type": "dta_error" - }, - "040HDERPMC": { - "review_type": "supplemental_claim", - "issue_type": "rating", - "benefit_type": "pension", - "family": "040", - "official_label": "PMC HLR DTA Error - Rating", - "disposition_type": "dta_error" - }, - "040SCRPMC": { - "review_type": "supplemental_claim", - "issue_type": "rating", - "benefit_type": "pension", - "family": "040", - "official_label": "PMC Supplemental Claim Rating" - }, - "030BGNRPMC": { - "review_type": "appeal", - "issue_type": "nonrating", - "benefit_type": "pension", - "family": "030", - "official_label": "PMC Board Grant Non-Rating", - "disposition_type": "allowed" - }, - "030BGR": { - "review_type": "appeal", - "issue_type": "rating", - "benefit_type": "compensation", - "family": "030", - "official_label": "Board Grant Rating", - "disposition_type": "allowed" - }, - "030BGRNR": { - "review_type": "appeal", - "issue_type": "nonrating", - "benefit_type": "compensation", - "family": "030", - "official_label": "Board Grant Non-Rating", - "disposition_type": "allowed" - }, - "030BGRPMC": { - "review_type": "appeal", - "issue_type": "rating", - "benefit_type": "pension", - "family": "030", - "official_label": "PMC Board Grant Rating", - "disposition_type": "allowed" - }, - "930AHCNRLPMC": { - "review_type": "higher_level_review", - "issue_type": "nonrating", - "benefit_type": "pension", - "family": "930", - "official_label": "AMA PMC HLR Correction of Non-Rating LQE", - "correction_type": "local_quality_error" - }, - "930AHCNRLQE": { - "review_type": "higher_level_review", - "issue_type": "nonrating", - "benefit_type": "compensation", - "family": "930", - "official_label": "AMA HLR Correction of Non-Rating LQE", - "correction_type": "local_quality_error" - }, - "930AHCNRNPMC": { - "review_type": "higher_level_review", - "issue_type": "nonrating", - "benefit_type": "pension", - "family": "930", - "official_label": "AMA PMC HLR Correction of Non-Rating NQE", - "correction_type": "national_quality_error" - }, - "930AHCNRNQE": { - "review_type": "higher_level_review", - "issue_type": "nonrating", - "benefit_type": "compensation", - "family": "930", - "official_label": "AMA PMC HLR Correction of Non-Rating NQE", - "correction_type": "national_quality_error" - }, - "930AHCRLQPMC": { - "review_type": "higher_level_review", - "issue_type": "rating", - "benefit_type": "pension", - "family": "930", - "official_label": "AMA PMC HLR Correction of Rating LQE", - "correction_type": "local_quality_error" - }, - "930AHCRNQPMC": { - "review_type": "higher_level_review", - "issue_type": "rating", - "benefit_type": "pension", - "family": "930", - "official_label": "AMA PMC HLR Correction of Rating LQE", - "correction_type": "national_quality_error" - }, - "930AHDENLPMC": { - "review_type": "supplemental_claim", - "issue_type": "nonrating", - "benefit_type": "pension", - "family": "930", - "official_label": "AMA PMC HLR DTA Error NR - Correction of LQE", - "disposition_type": "dta_error", - "correction_type": "local_quality_error" - }, - "930AHDENNPMC": { - "review_type": "supplemental_claim", - "issue_type": "nonrating", - "benefit_type": "pension", - "family": "930", - "official_label": "AMA PMC HLR DTA Error NR - Correction of NQE", - "disposition_type": "dta_error", - "correction_type": "national_quality_error" - }, - "930AHDENRPMC": { - "review_type": "supplemental_claim", - "issue_type": "nonrating", - "benefit_type": "pension", - "family": "930", - "official_label": "AMA PMC HLR DTA Error Non-Rating", - "disposition_type": "dta_error" - }, - "930AHDERLPMC": { - "review_type": "supplemental_claim", - "issue_type": "rating", - "benefit_type": "pension", - "family": "930", - "official_label": "AMA PMC HLR DTA Error Rating - Correction of LQE", - "disposition_type": "dta_error", - "correction_type": "local_quality_error" - }, - "930AHDERNPMC": { - "review_type": "supplemental_claim", - "issue_type": "rating", - "benefit_type": "pension", - "family": "930", - "official_label": "AMA PMC HLR DTA Error Rating - Correction of NQE", - "disposition_type": "dta_error", - "correction_type": "national_quality_error" - }, - "930AHDERPMC": { - "review_type": "supplemental_claim", - "issue_type": "rating", - "benefit_type": "pension", - "family": "930", - "official_label": "AMA PMC HLR DTA Error Rating", - "disposition_type": "dta_error" - }, - "930AHNRCPMC": { - "review_type": "higher_level_review", - "issue_type": "nonrating", - "benefit_type": "pension", - "family": "930", - "official_label": "AMA PMC HLR Non-Rating Control", - "disposition_type": "difference_of_opinion" - }, - "930AMADONR": { - "review_type": "supplemental_claim", - "issue_type": "nonrating", - "benefit_type": "compensation", - "family": "930", - "official_label": "AMA Difference of Opinion - NR (930)", - "disposition_type": "difference_of_opinion" - }, - "930AMADOR": { - "review_type": "supplemental_claim", - "issue_type": "rating", - "benefit_type": "compensation", - "family": "930", - "official_label": "AMA Difference of Opinion - Rating (930)", - "disposition_type": "difference_of_opinion" - }, - "930AMAHCRLQE": { - "review_type": "higher_level_review", - "issue_type": "rating", - "benefit_type": "compensation", - "family": "930", - "official_label": "AMA HLR Correction of Rating LQE", - "correction_type": "local_quality_error" - }, - "930AMAHCRNQE": { - "review_type": "higher_level_review", - "issue_type": "rating", - "benefit_type": "compensation", - "family": "930", - "official_label": "AMA HLR Correction of Rating NQE", - "correction_type": "national_quality_error" - }, - "930AMAHDENCL": { - "review_type": "supplemental_claim", - "issue_type": "nonrating", - "benefit_type": "compensation", - "family": "930", - "official_label": "AMA HLR DTA Error NR - Correction of LQE", - "correction_type": "local_quality_error", - "disposition_type": "dta_error" - }, - "930AMAHDENCN": { - "review_type": "supplemental_claim", - "issue_type": "nonrating", - "benefit_type": "compensation", - "family": "930", - "official_label": "AMA HLR DTA Error NR - Correction of NQE", - "correction_type": "national_quality_error", - "disposition_type": "dta_error" - }, - "930AMAHDENR": { - "review_type": "supplemental_claim", - "issue_type": "nonrating", - "benefit_type": "compensation", - "family": "930", - "official_label": "AMA HLR DTA Error Non-Rating", - "correction_type": "control", - "disposition_type": "dta_error" - }, - "930AMAHDER": { - "review_type": "supplemental_claim", - "issue_type": "rating", - "benefit_type": "compensation", - "family": "930", - "official_label": "AMA HLR DTA Error Rating", - "correction_type": "control", - "disposition_type": "dta_error" - }, - "930AMAHDERCL": { - "review_type": "supplemental_claim", - "issue_type": "rating", - "benefit_type": "compensation", - "family": "930", - "official_label": "AMA HLR DTA Error Rating - Correction of LQE", - "correction_type": "local_quality_error", - "disposition_type": "dta_error" - }, - "930AMAHDERCN": { - "review_type": "supplemental_claim", - "issue_type": "rating", - "benefit_type": "compensation", - "family": "930", - "official_label": "AMA HLR DTA Error Rating - Correction of NQE", - "correction_type": "national_quality_error", - "disposition_type": "dta_error" - }, - "930AMAHNRC": { - "review_type": "higher_level_review", - "issue_type": "nonrating", - "benefit_type": "compensation", - "family": "930", - "official_label": "AMA HLR Non-Rating Control", - "correction_type": "control" - }, - "930AMAHRC": { - "review_type": "higher_level_review", - "issue_type": "rating", - "benefit_type": "compensation", - "family": "930", - "official_label": "AMA HLR Rating Control", - "correction_type": "control" - }, - "930AMAHRCPMC": { - "review_type": "higher_level_review", - "issue_type": "rating", - "benefit_type": "pension", - "family": "930", - "official_label": "AMA PMC HLR Rating Control", - "correction_type": "control" - }, - "930AMARNRC": { - "review_type": "supplemental_claim", - "issue_type": "nonrating", - "benefit_type": "compensation", - "family": "930", - "official_label": "AMA Remand Non-Rating Control", - "correction_type": "control", - "disposition_type": "board_remand" - }, - "930AMARRC": { - "review_type": "supplemental_claim", - "issue_type": "rating", - "benefit_type": "compensation", - "family": "930", - "official_label": "AMA Remand Rating Control", - "correction_type": "control", - "disposition_type": "board_remand" - }, - "930AMARRCLQE": { - "review_type": "supplemental_claim", - "issue_type": "rating", - "benefit_type": "compensation", - "family": "930", - "official_label": "AMA Remand Rating Correction of LQE", - "correction_type": "local_quality_error", - "disposition_type": "board_remand" - }, - "930AMARRCNQE": { - "review_type": "supplemental_claim", - "issue_type": "rating", - "benefit_type": "compensation", - "family": "930", - "official_label": "AMA Remand Rating Correction of NQE", - "correction_type": "national_quality_error", - "disposition_type": "board_remand" - }, - "930AMARRCPMC": { - "review_type": "supplemental_claim", - "issue_type": "rating", - "benefit_type": "pension", - "family": "930", - "official_label": "AMA PMC Remand Rating Control", - "correction_type": "control", - "disposition_type": "board_remand" - }, - "930AMASCRLQE": { - "review_type": "supplemental_claim", - "issue_type": "rating", - "benefit_type": "compensation", - "family": "930", - "official_label": "AMA Supp Correction of Rating LQE", - "correction_type": "local_quality_error" - }, - "930AMASCRNQE": { - "review_type": "supplemental_claim", - "issue_type": "rating", - "benefit_type": "compensation", - "family": "930", - "official_label": "AMA Supp Correction of Rating NQE", - "correction_type": "national_quality_error" - }, - "930AMASNRC": { - "review_type": "supplemental_claim", - "issue_type": "nonrating", - "benefit_type": "compensation", - "family": "930", - "official_label": "AMA Supp Non-Rating Control", - "correction_type": "control" - }, - "930AMASRC": { - "review_type": "supplemental_claim", - "issue_type": "rating", - "benefit_type": "compensation", - "family": "930", - "official_label": "AMA Supp Rating Control", - "correction_type": "control" - }, - "930AMASRCPMC": { - "review_type": "supplemental_claim", - "issue_type": "rating", - "benefit_type": "pension", - "family": "930", - "official_label": "AMA PMC Supp Rating Control", - "correction_type": "control" - }, - "930ARNRCLPMC": { - "review_type": "supplemental_claim", - "issue_type": "nonrating", - "benefit_type": "pension", - "family": "930", - "official_label": "AMA PMC Remand Non-Rating Correction of LQE", - "correction_type": "local_quality_error", - "disposition_type": "board_remand" - }, - "930ARNRCLQE": { - "review_type": "supplemental_claim", - "issue_type": "nonrating", - "benefit_type": "compensation", - "family": "930", - "official_label": "AMA Remand Non-Rating Correction of LQE", - "correction_type": "local_quality_error", - "disposition_type": "board_remand" - }, - "930ARNRCNPMC": { - "review_type": "supplemental_claim", - "issue_type": "nonrating", - "benefit_type": "pension", - "family": "930", - "official_label": "AMA PMC Remand Non-Rating Correction of NQE", - "correction_type": "national_quality_error", - "disposition_type": "board_remand" - }, - "930ARNRCNQE": { - "review_type": "supplemental_claim", - "issue_type": "nonrating", - "benefit_type": "compensation", - "family": "930", - "official_label": "AMA Remand Non-Rating Correction of NQE", - "correction_type": "national_quality_error", - "disposition_type": "board_remand" - }, - "930ARNRCPMC": { - "review_type": "supplemental_claim", - "issue_type": "nonrating", - "benefit_type": "pension", - "family": "930", - "official_label": "AMA PMC Remand Non-Rating Control", - "correction_type": "control", - "disposition_type": "board_remand" - }, - "930ARRCLQPMC": { - "review_type": "supplemental_claim", - "issue_type": "rating", - "benefit_type": "pension", - "family": "930", - "official_label": "AMA PMC Remand Rating Correction of LQE", - "correction_type": "local_quality_error", - "disposition_type": "board_remand" - }, - "930ARRCNQPMC": { - "review_type": "supplemental_claim", - "issue_type": "rating", - "benefit_type": "pension", - "family": "930", - "official_label": "AMA PMC Remand Rating Correction of NQE", - "correction_type": "national_quality_error", - "disposition_type": "board_remand" - }, - "930ASCNRLPMC": { - "review_type": "supplemental_claim", - "issue_type": "nonrating", - "benefit_type": "pension", - "family": "930", - "official_label": "AMA PMC Supp Correction of Non-Rating LQE", - "correction_type": "local_quality_error" - }, - "930ASCNRLQE": { - "review_type": "supplemental_claim", - "issue_type": "nonrating", - "benefit_type": "compensation", - "family": "930", - "official_label": "AMA Supp Correction of Non-Rating LQE", - "correction_type": "local_quality_error" - }, - "930ASCNRNPMC": { - "review_type": "supplemental_claim", - "issue_type": "nonrating", - "benefit_type": "pension", - "family": "930", - "official_label": "AMA PMC Supp Correction of Non-Rating NQE", - "correction_type": "national_quality_error" - }, - "930ASCNRNQE": { - "review_type": "supplemental_claim", - "issue_type": "nonrating", - "benefit_type": "compensation", - "family": "930", - "official_label": "AMA Supp Correction of Non-Rating NQE", - "correction_type": "national_quality_error" - }, - "930ASCRLQPMC": { - "review_type": "supplemental_claim", - "issue_type": "rating", - "benefit_type": "pension", - "family": "930", - "official_label": "AMA PMC Supp Correction of Rating LQE", - "correction_type": "local_quality_error" - }, - "930ASCRNQPMC": { - "review_type": "supplemental_claim", - "issue_type": "rating", - "benefit_type": "pension", - "family": "930", - "official_label": "AMA PMC Supp Correction of Rating NQE", - "correction_type": "national_quality_error" - }, - "930ASNRCPMC": { - "review_type": "supplemental_claim", - "issue_type": "nonrating", - "benefit_type": "pension", - "family": "930", - "official_label": "AMA PMC Supp Non-Rating Control", - "correction_type": "control" - } + }, + "030HLRFID": { + "review_type": "higher_level_review", + "benefit_type": "fiduciary", + "family": "030", + "official_label": "FID-Higher-Level Review", + "issue_type": "nonrating" + }, + "040SCR": { + "review_type": "supplemental_claim", + "benefit_type": "compensation", + "family": "040", + "issue_type": "rating", + "official_label": "Supplemental Claim Rating" + }, + "040SCNR": { + "review_type": "supplemental_claim", + "issue_type": "nonrating", + "benefit_type": "compensation", + "family": "040", + "official_label": "Supplemental Claim Non-Rating" + }, + "040SCRGTY": { + "review_type": "supplemental_claim", + "benefit_type": "compensation", + "family": "040", + "issue_type": "rating", + "official_label": "Supplemental Claim Rating > Year" + }, + "030HLRR": { + "review_type": "higher_level_review", + "issue_type": "rating", + "family": "030", + "benefit_type": "compensation", + "official_label": "Higher-Level Review Rating" + }, + "030HLRNR": { + "review_type": "higher_level_review", + "issue_type": "nonrating", + "benefit_type": "compensation", + "family": "030", + "official_label": "Higher-Level Review Non-Rating" + }, + "040SCNRPMC": { + "review_type": "supplemental_claim", + "issue_type": "nonrating", + "benefit_type": "pension", + "family": "040", + "official_label": "PMC Supplemental Claim Non-Rating" + }, + "030HLRRPMC": { + "review_type": "higher_level_review", + "issue_type": "rating", + "benefit_type": "pension", + "family": "030", + "official_label": "PMC Higher-Level Review Rating" + }, + "030HLRNRPMC": { + "review_type": "higher_level_review", + "issue_type": "nonrating", + "benefit_type": "pension", + "family": "030", + "official_label": "PMC Higher-Level Review Non-Rating" + }, + "040ADONRPMC": { + "review_type": "supplemental_claim", + "issue_type": "nonrating", + "benefit_type": "pension", + "family": "040", + "official_label": "PMC AMA Difference of Opinion - NR (040)", + "disposition_type": "difference_of_opinion" + }, + "040ADORPMC": { + "review_type": "supplemental_claim", + "issue_type": "rating", + "benefit_type": "pension", + "family": "040", + "official_label": "PMC AMA Difference of Opinion - Rating (040)", + "disposition_type": "difference_of_opinion" + }, + "040AMADONR": { + "review_type": "supplemental_claim", + "issue_type": "nonrating", + "benefit_type": "compensation", + "family": "040", + "official_label": "AMA Difference of Opinion - NR (040)", + "disposition_type": "difference_of_opinion" + }, + "040AMADOR": { + "review_type": "supplemental_claim", + "issue_type": "rating", + "benefit_type": "compensation", + "family": "040", + "official_label": "AMA Difference of Opinion - Rating (040)", + "disposition_type": "difference_of_opinion" + }, + "040BDENR": { + "review_type": "supplemental_claim", + "issue_type": "nonrating", + "benefit_type": "compensation", + "family": "040", + "official_label": "Board DTA Error Non-Rating", + "disposition_type": "board_remand" + }, + "040BDENRPMC": { + "review_type": "supplemental_claim", + "issue_type": "nonrating", + "benefit_type": "pension", + "family": "040", + "official_label": "PMC Board DTA Error Non-Rating", + "disposition_type": "board_remand" + }, + "040BDER": { + "review_type": "supplemental_claim", + "issue_type": "rating", + "benefit_type": "compensation", + "family": "040", + "official_label": "Board DTA Error Rating", + "disposition_type": "board_remand" + }, + "040HDENR": { + "review_type": "supplemental_claim", + "issue_type": "nonrating", + "benefit_type": "compensation", + "family": "040", + "official_label": "HLR DTA Error - Non-Rating", + "disposition_type": "dta_error" + }, + "040BDERPMC": { + "review_type": "supplemental_claim", + "issue_type": "rating", + "benefit_type": "pension", + "family": "040", + "official_label": "PMC Board DTA Error Rating", + "disposition_type": "dta_error" + }, + "040HDENRPMC": { + "review_type": "supplemental_claim", + "issue_type": "nonrating", + "benefit_type": "pension", + "family": "040", + "official_label": "PMC HLR DTA Error - Non-Rating", + "disposition_type": "dta_error" + }, + "040HDER": { + "review_type": "supplemental_claim", + "issue_type": "rating", + "benefit_type": "compensation", + "family": "040", + "official_label": "HLR DTA Error - Rating", + "disposition_type": "dta_error" + }, + "040HDERPMC": { + "review_type": "supplemental_claim", + "issue_type": "rating", + "benefit_type": "pension", + "family": "040", + "official_label": "PMC HLR DTA Error - Rating", + "disposition_type": "dta_error" + }, + "040SCRPMC": { + "review_type": "supplemental_claim", + "issue_type": "rating", + "benefit_type": "pension", + "family": "040", + "official_label": "PMC Supplemental Claim Rating" + }, + "030BGNRPMC": { + "review_type": "appeal", + "issue_type": "nonrating", + "benefit_type": "pension", + "family": "030", + "official_label": "PMC Board Grant Non-Rating", + "disposition_type": "allowed" + }, + "030BGR": { + "review_type": "appeal", + "issue_type": "rating", + "benefit_type": "compensation", + "family": "030", + "official_label": "Board Grant Rating", + "disposition_type": "allowed" + }, + "030BGRNR": { + "review_type": "appeal", + "issue_type": "nonrating", + "benefit_type": "compensation", + "family": "030", + "official_label": "Board Grant Non-Rating", + "disposition_type": "allowed" + }, + "030BGRPMC": { + "review_type": "appeal", + "issue_type": "rating", + "benefit_type": "pension", + "family": "030", + "official_label": "PMC Board Grant Rating", + "disposition_type": "allowed" + }, + "930AHCNRLPMC": { + "review_type": "higher_level_review", + "issue_type": "nonrating", + "benefit_type": "pension", + "family": "930", + "official_label": "AMA PMC HLR Correction of Non-Rating LQE", + "correction_type": "local_quality_error" + }, + "930AHCNRLQE": { + "review_type": "higher_level_review", + "issue_type": "nonrating", + "benefit_type": "compensation", + "family": "930", + "official_label": "AMA HLR Correction of Non-Rating LQE", + "correction_type": "local_quality_error" + }, + "930AHCNRNPMC": { + "review_type": "higher_level_review", + "issue_type": "nonrating", + "benefit_type": "pension", + "family": "930", + "official_label": "AMA PMC HLR Correction of Non-Rating NQE", + "correction_type": "national_quality_error" + }, + "930AHCNRNQE": { + "review_type": "higher_level_review", + "issue_type": "nonrating", + "benefit_type": "compensation", + "family": "930", + "official_label": "AMA PMC HLR Correction of Non-Rating NQE", + "correction_type": "national_quality_error" + }, + "930AHCRLQPMC": { + "review_type": "higher_level_review", + "issue_type": "rating", + "benefit_type": "pension", + "family": "930", + "official_label": "AMA PMC HLR Correction of Rating LQE", + "correction_type": "local_quality_error" + }, + "930AHCRNQPMC": { + "review_type": "higher_level_review", + "issue_type": "rating", + "benefit_type": "pension", + "family": "930", + "official_label": "AMA PMC HLR Correction of Rating LQE", + "correction_type": "national_quality_error" + }, + "930AHDENLPMC": { + "review_type": "supplemental_claim", + "issue_type": "nonrating", + "benefit_type": "pension", + "family": "930", + "official_label": "AMA PMC HLR DTA Error NR - Correction of LQE", + "disposition_type": "dta_error", + "correction_type": "local_quality_error" + }, + "930AHDENNPMC": { + "review_type": "supplemental_claim", + "issue_type": "nonrating", + "benefit_type": "pension", + "family": "930", + "official_label": "AMA PMC HLR DTA Error NR - Correction of NQE", + "disposition_type": "dta_error", + "correction_type": "national_quality_error" + }, + "930AHDENRPMC": { + "review_type": "supplemental_claim", + "issue_type": "nonrating", + "benefit_type": "pension", + "family": "930", + "official_label": "AMA PMC HLR DTA Error Non-Rating", + "disposition_type": "dta_error" + }, + "930AHDERLPMC": { + "review_type": "supplemental_claim", + "issue_type": "rating", + "benefit_type": "pension", + "family": "930", + "official_label": "AMA PMC HLR DTA Error Rating - Correction of LQE", + "disposition_type": "dta_error", + "correction_type": "local_quality_error" + }, + "930AHDERNPMC": { + "review_type": "supplemental_claim", + "issue_type": "rating", + "benefit_type": "pension", + "family": "930", + "official_label": "AMA PMC HLR DTA Error Rating - Correction of NQE", + "disposition_type": "dta_error", + "correction_type": "national_quality_error" + }, + "930AHDERPMC": { + "review_type": "supplemental_claim", + "issue_type": "rating", + "benefit_type": "pension", + "family": "930", + "official_label": "AMA PMC HLR DTA Error Rating", + "disposition_type": "dta_error" + }, + "930AHNRCPMC": { + "review_type": "higher_level_review", + "issue_type": "nonrating", + "benefit_type": "pension", + "family": "930", + "official_label": "AMA PMC HLR Non-Rating Control", + "disposition_type": "difference_of_opinion" + }, + "930AMADONR": { + "review_type": "supplemental_claim", + "issue_type": "nonrating", + "benefit_type": "compensation", + "family": "930", + "official_label": "AMA Difference of Opinion - NR (930)", + "disposition_type": "difference_of_opinion" + }, + "930AMADOR": { + "review_type": "supplemental_claim", + "issue_type": "rating", + "benefit_type": "compensation", + "family": "930", + "official_label": "AMA Difference of Opinion - Rating (930)", + "disposition_type": "difference_of_opinion" + }, + "930AMAHCRLQE": { + "review_type": "higher_level_review", + "issue_type": "rating", + "benefit_type": "compensation", + "family": "930", + "official_label": "AMA HLR Correction of Rating LQE", + "correction_type": "local_quality_error" + }, + "930AMAHCRNQE": { + "review_type": "higher_level_review", + "issue_type": "rating", + "benefit_type": "compensation", + "family": "930", + "official_label": "AMA HLR Correction of Rating NQE", + "correction_type": "national_quality_error" + }, + "930AMAHDENCL": { + "review_type": "supplemental_claim", + "issue_type": "nonrating", + "benefit_type": "compensation", + "family": "930", + "official_label": "AMA HLR DTA Error NR - Correction of LQE", + "correction_type": "local_quality_error", + "disposition_type": "dta_error" + }, + "930AMAHDENCN": { + "review_type": "supplemental_claim", + "issue_type": "nonrating", + "benefit_type": "compensation", + "family": "930", + "official_label": "AMA HLR DTA Error NR - Correction of NQE", + "correction_type": "national_quality_error", + "disposition_type": "dta_error" + }, + "930AMAHDENR": { + "review_type": "supplemental_claim", + "issue_type": "nonrating", + "benefit_type": "compensation", + "family": "930", + "official_label": "AMA HLR DTA Error Non-Rating", + "correction_type": "control", + "disposition_type": "dta_error" + }, + "930AMAHDER": { + "review_type": "supplemental_claim", + "issue_type": "rating", + "benefit_type": "compensation", + "family": "930", + "official_label": "AMA HLR DTA Error Rating", + "correction_type": "control", + "disposition_type": "dta_error" + }, + "930AMAHDERCL": { + "review_type": "supplemental_claim", + "issue_type": "rating", + "benefit_type": "compensation", + "family": "930", + "official_label": "AMA HLR DTA Error Rating - Correction of LQE", + "correction_type": "local_quality_error", + "disposition_type": "dta_error" + }, + "930AMAHDERCN": { + "review_type": "supplemental_claim", + "issue_type": "rating", + "benefit_type": "compensation", + "family": "930", + "official_label": "AMA HLR DTA Error Rating - Correction of NQE", + "correction_type": "national_quality_error", + "disposition_type": "dta_error" + }, + "930AMAHNRC": { + "review_type": "higher_level_review", + "issue_type": "nonrating", + "benefit_type": "compensation", + "family": "930", + "official_label": "AMA HLR Non-Rating Control", + "correction_type": "control" + }, + "930AMAHRC": { + "review_type": "higher_level_review", + "issue_type": "rating", + "benefit_type": "compensation", + "family": "930", + "official_label": "AMA HLR Rating Control", + "correction_type": "control" + }, + "930AMAHRCPMC": { + "review_type": "higher_level_review", + "issue_type": "rating", + "benefit_type": "pension", + "family": "930", + "official_label": "AMA PMC HLR Rating Control", + "correction_type": "control" + }, + "930AMARNRC": { + "review_type": "supplemental_claim", + "issue_type": "nonrating", + "benefit_type": "compensation", + "family": "930", + "official_label": "AMA Remand Non-Rating Control", + "correction_type": "control", + "disposition_type": "board_remand" + }, + "930AMARRC": { + "review_type": "supplemental_claim", + "issue_type": "rating", + "benefit_type": "compensation", + "family": "930", + "official_label": "AMA Remand Rating Control", + "correction_type": "control", + "disposition_type": "board_remand" + }, + "930AMARRCLQE": { + "review_type": "supplemental_claim", + "issue_type": "rating", + "benefit_type": "compensation", + "family": "930", + "official_label": "AMA Remand Rating Correction of LQE", + "correction_type": "local_quality_error", + "disposition_type": "board_remand" + }, + "930AMARRCNQE": { + "review_type": "supplemental_claim", + "issue_type": "rating", + "benefit_type": "compensation", + "family": "930", + "official_label": "AMA Remand Rating Correction of NQE", + "correction_type": "national_quality_error", + "disposition_type": "board_remand" + }, + "930AMARRCPMC": { + "review_type": "supplemental_claim", + "issue_type": "rating", + "benefit_type": "pension", + "family": "930", + "official_label": "AMA PMC Remand Rating Control", + "correction_type": "control", + "disposition_type": "board_remand" + }, + "930AMASCRLQE": { + "review_type": "supplemental_claim", + "issue_type": "rating", + "benefit_type": "compensation", + "family": "930", + "official_label": "AMA Supp Correction of Rating LQE", + "correction_type": "local_quality_error" + }, + "930AMASCRNQE": { + "review_type": "supplemental_claim", + "issue_type": "rating", + "benefit_type": "compensation", + "family": "930", + "official_label": "AMA Supp Correction of Rating NQE", + "correction_type": "national_quality_error" + }, + "930AMASNRC": { + "review_type": "supplemental_claim", + "issue_type": "nonrating", + "benefit_type": "compensation", + "family": "930", + "official_label": "AMA Supp Non-Rating Control", + "correction_type": "control" + }, + "930AMASRC": { + "review_type": "supplemental_claim", + "issue_type": "rating", + "benefit_type": "compensation", + "family": "930", + "official_label": "AMA Supp Rating Control", + "correction_type": "control" + }, + "930AMASRCPMC": { + "review_type": "supplemental_claim", + "issue_type": "rating", + "benefit_type": "pension", + "family": "930", + "official_label": "AMA PMC Supp Rating Control", + "correction_type": "control" + }, + "930ARNRCLPMC": { + "review_type": "supplemental_claim", + "issue_type": "nonrating", + "benefit_type": "pension", + "family": "930", + "official_label": "AMA PMC Remand Non-Rating Correction of LQE", + "correction_type": "local_quality_error", + "disposition_type": "board_remand" + }, + "930ARNRCLQE": { + "review_type": "supplemental_claim", + "issue_type": "nonrating", + "benefit_type": "compensation", + "family": "930", + "official_label": "AMA Remand Non-Rating Correction of LQE", + "correction_type": "local_quality_error", + "disposition_type": "board_remand" + }, + "930ARNRCNPMC": { + "review_type": "supplemental_claim", + "issue_type": "nonrating", + "benefit_type": "pension", + "family": "930", + "official_label": "AMA PMC Remand Non-Rating Correction of NQE", + "correction_type": "national_quality_error", + "disposition_type": "board_remand" + }, + "930ARNRCNQE": { + "review_type": "supplemental_claim", + "issue_type": "nonrating", + "benefit_type": "compensation", + "family": "930", + "official_label": "AMA Remand Non-Rating Correction of NQE", + "correction_type": "national_quality_error", + "disposition_type": "board_remand" + }, + "930ARNRCPMC": { + "review_type": "supplemental_claim", + "issue_type": "nonrating", + "benefit_type": "pension", + "family": "930", + "official_label": "AMA PMC Remand Non-Rating Control", + "correction_type": "control", + "disposition_type": "board_remand" + }, + "930ARRCLQPMC": { + "review_type": "supplemental_claim", + "issue_type": "rating", + "benefit_type": "pension", + "family": "930", + "official_label": "AMA PMC Remand Rating Correction of LQE", + "correction_type": "local_quality_error", + "disposition_type": "board_remand" + }, + "930ARRCNQPMC": { + "review_type": "supplemental_claim", + "issue_type": "rating", + "benefit_type": "pension", + "family": "930", + "official_label": "AMA PMC Remand Rating Correction of NQE", + "correction_type": "national_quality_error", + "disposition_type": "board_remand" + }, + "930ASCNRLPMC": { + "review_type": "supplemental_claim", + "issue_type": "nonrating", + "benefit_type": "pension", + "family": "930", + "official_label": "AMA PMC Supp Correction of Non-Rating LQE", + "correction_type": "local_quality_error" + }, + "930ASCNRLQE": { + "review_type": "supplemental_claim", + "issue_type": "nonrating", + "benefit_type": "compensation", + "family": "930", + "official_label": "AMA Supp Correction of Non-Rating LQE", + "correction_type": "local_quality_error" + }, + "930ASCNRNPMC": { + "review_type": "supplemental_claim", + "issue_type": "nonrating", + "benefit_type": "pension", + "family": "930", + "official_label": "AMA PMC Supp Correction of Non-Rating NQE", + "correction_type": "national_quality_error" + }, + "930ASCNRNQE": { + "review_type": "supplemental_claim", + "issue_type": "nonrating", + "benefit_type": "compensation", + "family": "930", + "official_label": "AMA Supp Correction of Non-Rating NQE", + "correction_type": "national_quality_error" + }, + "930ASCRLQPMC": { + "review_type": "supplemental_claim", + "issue_type": "rating", + "benefit_type": "pension", + "family": "930", + "official_label": "AMA PMC Supp Correction of Rating LQE", + "correction_type": "local_quality_error" + }, + "930ASCRNQPMC": { + "review_type": "supplemental_claim", + "issue_type": "rating", + "benefit_type": "pension", + "family": "930", + "official_label": "AMA PMC Supp Correction of Rating NQE", + "correction_type": "national_quality_error" + }, + "930ASNRCPMC": { + "review_type": "supplemental_claim", + "issue_type": "nonrating", + "benefit_type": "pension", + "family": "930", + "official_label": "AMA PMC Supp Non-Rating Control", + "correction_type": "control" + }, + "930ADONRPMC": { + "review_type": "supplemental_claim", + "issue_type": "nonrating", + "benefit_type": "pension", + "family": "930", + "official_label": "PMC AMA Difference of Opinion - NR" + }, + "930ADORPMC": { + "review_type": "supplemental_claim", + "issue_type": "rating", + "benefit_type": "pension", + "family": "930", + "official_label": "PMC AMA Difference of Opinion - Rating" + } } diff --git a/lib/helpers/END_PRODUCT_CODES.json b/lib/helpers/END_PRODUCT_CODES.json index c51e939a78f..a0ea4ea2eb5 100644 --- a/lib/helpers/END_PRODUCT_CODES.json +++ b/lib/helpers/END_PRODUCT_CODES.json @@ -115,6 +115,8 @@ "930ASNRCPMC": "PMC Supplemental Claim Non-Rating Control 930", "930DONRPMC": "PMC AMA Difference of Opinion - NR", "930DORPMC": "PMC AMA Difference of Opinion - Rating", + "930ADONRPMC": "PMC AMA Difference of Opinion - NR", + "930ADORPMC": "PMC AMA Difference of Opinion - Rating", "930RC": "Rating Control", "930RCPMC": "PMC-Rating Control" } From a1b4dd228ec5b97ca8f2cdb876ef8488b8e6d31b Mon Sep 17 00:00:00 2001 From: nader k Date: Fri, 19 Jul 2024 12:53:28 -0700 Subject: [PATCH 3/5] Merge remote-tracking branch 'origin/cmartine/APPEALS-49863' into feature/APPEALS-28087-36678 --- app/serializers/api/v3/issues/ama/request_issue_serializer.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/serializers/api/v3/issues/ama/request_issue_serializer.rb b/app/serializers/api/v3/issues/ama/request_issue_serializer.rb index 960b3102cf2..b47a6d61718 100644 --- a/app/serializers/api/v3/issues/ama/request_issue_serializer.rb +++ b/app/serializers/api/v3/issues/ama/request_issue_serializer.rb @@ -110,7 +110,7 @@ class Api::V3::Issues::Ama::RequestIssueSerializer attribute :edited_by_css_id do |object| if object&.edited_description.present? - object&.end_product_establishment&.user&.station_id + object&.end_product_establishment&.user&.css_id end end From d6e1030e63b048a89d635ee78ef9332ce0bf28a9 Mon Sep 17 00:00:00 2001 From: Will Love Date: Mon, 22 Jul 2024 11:45:11 -0400 Subject: [PATCH 4/5] code climate spec fix (#22211) * code climate spec fix * up argument count * created a parser helper for reusable methods * reset codeclimate back to original and added issue parser * modified methods to take in a hash instead of multiple params * reduced create params down to 3 params * added space inside * swapped to safe navigator for intake check * fixed spec * fixed linting issue * fixed failing spec * fixed merge conflicts with code changes for helper --------- Co-authored-by: TuckerRose Co-authored-by: TuckerRose Co-authored-by: Nader Kutub --- .../v1/decision_review_created_controller.rb | 3 +- app/helpers/parser_helper.rb | 28 ++++ app/models/claim_review.rb | 2 +- .../decision_review_created_issue_parser.rb | 112 +++++++++++++++ .../events/decision_review_created.rb | 16 ++- .../decision_review_created/create_intake.rb | 7 +- .../create_request_issues.rb | 61 ++++---- .../decision_review_created_parser.rb | 130 +----------------- .../scenario_a_spec.rb | 4 +- .../create_request_issues_spec.rb | 4 +- .../decision_review_created_parser_spec.rb | 52 +++---- .../events/decision_review_created_spec.rb | 5 +- 12 files changed, 228 insertions(+), 196 deletions(-) create mode 100644 app/helpers/parser_helper.rb create mode 100644 app/services/decision_review_created_issue_parser.rb diff --git a/app/controllers/api/events/v1/decision_review_created_controller.rb b/app/controllers/api/events/v1/decision_review_created_controller.rb index 2b03c570ca8..31c0dcb4ff2 100644 --- a/app/controllers/api/events/v1/decision_review_created_controller.rb +++ b/app/controllers/api/events/v1/decision_review_created_controller.rb @@ -25,7 +25,8 @@ def decision_review_created claim_id = drc_params[:claim_id] headers = request.headers - ::Events::DecisionReviewCreated.create!(consumer_event_id, claim_id, headers, drc_params) + consumer_and_claim_ids = { consumer_event_id: consumer_event_id, reference_id: claim_id } + ::Events::DecisionReviewCreated.create!(consumer_and_claim_ids, headers, drc_params) render json: { message: "DecisionReviewCreatedEvent successfully processed and backfilled" }, status: :created rescue Caseflow::Error::RedisLockFailed => error render json: { message: error.message }, status: :conflict diff --git a/app/helpers/parser_helper.rb b/app/helpers/parser_helper.rb new file mode 100644 index 00000000000..bcbf72d14a3 --- /dev/null +++ b/app/helpers/parser_helper.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +module ParserHelper + # Checking for nonrating_issue_category is "Disposition" and processing such issues. + def process_nonrating_issue_category(payload_json) + payload_json[:request_issues].each do |issue| + next unless issue[:nonrating_issue_category] == "Disposition" + + issue[:nonrating_issue_category] = "Unknown Issue Category" + end + end + + # Generic/universal methods + # rubocop:disable Rails/TimeZone + def convert_milliseconds_to_datetime(milliseconds) + milliseconds.nil? ? nil : Time.at(milliseconds.to_i / 1000).to_datetime + end + # rubocop:enable Rails/TimeZone + + # convert logical date int to date + def logical_date_converter(logical_date_int) + return nil if logical_date_int.nil? || logical_date_int.to_i.days == 0 + + base_date = Date.new(1970, 1, 1) + converted_date = base_date + logical_date_int.to_i.days + converted_date + end +end diff --git a/app/models/claim_review.rb b/app/models/claim_review.rb index 6daf0b571d6..f25bfc609ac 100644 --- a/app/models/claim_review.rb +++ b/app/models/claim_review.rb @@ -310,7 +310,7 @@ def cleared_nonrating_ep? def from_decision_review_created_event? # refer back to the associated Intake to see if both objects came from DRCE - intake ? intake.from_decision_review_created_event? : false + intake&.from_decision_review_created_event? || false end def sct_appeal? diff --git a/app/services/decision_review_created_issue_parser.rb b/app/services/decision_review_created_issue_parser.rb new file mode 100644 index 00000000000..09cfb3e31cd --- /dev/null +++ b/app/services/decision_review_created_issue_parser.rb @@ -0,0 +1,112 @@ +# frozen_string_literal: true + +class DecisionReviewCreatedIssueParser + include ParserHelper + attr_reader :issue + + def initialize(issue) + @issue = issue + end + + def ri_benefit_type + @issue.dig(:benefit_type) + end + + def ri_contested_issue_description + @issue.dig(:contested_issue_description) + end + + def ri_contention_reference_id + @issue.dig(:contention_reference_id) + end + + def ri_contested_rating_decision_reference_id + @issue.dig(:contested_rating_decision_reference_id) + end + + def ri_contested_rating_issue_profile_date + @issue.dig(:contested_rating_issue_profile_date) + end + + def ri_contested_rating_issue_reference_id + @issue.dig(:contested_rating_issue_reference_id) + end + + def ri_contested_decision_issue_id + @issue.dig(:contested_decision_issue_id) + end + + def ri_decision_date + decision_date_int = @issue.dig(:decision_date) + logical_date_converter(decision_date_int) + end + + def ri_ineligible_due_to_id + @issue.dig(:ineligible_due_to_id) + end + + def ri_ineligible_reason + @issue.dig(:ineligible_reason) + end + + def ri_is_unidentified + @issue.dig(:is_unidentified) + end + + def ri_unidentified_issue_text + @issue.dig(:unidentified_issue_text) + end + + def ri_nonrating_issue_category + @issue.dig(:nonrating_issue_category) + end + + def ri_nonrating_issue_description + @issue.dig(:nonrating_issue_description) + end + + def ri_untimely_exemption + @issue.dig(:untimely_exemption) + end + + def ri_untimely_exemption_notes + @issue.dig(:untimely_exemption_notes) + end + + def ri_vacols_id + @issue.dig(:vacols_id) + end + + def ri_vacols_sequence_id + @issue.dig(:vacols_sequence_id) + end + + def ri_closed_at + @issue.dig(:closed_at) + end + + def ri_closed_status + @issue.dig(:closed_status) + end + + def ri_contested_rating_issue_diagnostic_code + @issue.dig(:contested_rating_issue_diagnostic_code) + end + + def ri_ramp_claim_id + @issue.dig(:ramp_claim_id) + end + + def ri_rating_issue_associated_at + ri_rating_issue_associated_at_in_ms = @issue.dig(:rating_issue_associated_at) + convert_milliseconds_to_datetime(ri_rating_issue_associated_at_in_ms) + end + + def ri_nonrating_issue_bgs_id + @issue.dig(:nonrating_issue_bgs_id) + end + + def ri_nonrating_issue_bgs_source + @issue.dig(:nonrating_issue_bgs_source) + end +end diff --git a/app/services/events/decision_review_created.rb b/app/services/events/decision_review_created.rb index 837a1d3a7b1..d5f9c665391 100644 --- a/app/services/events/decision_review_created.rb +++ b/app/services/events/decision_review_created.rb @@ -13,7 +13,9 @@ class Events::DecisionReviewCreated class << self # rubocop:disable Metrics/AbcSize, Metrics/MethodLength, Lint/UselessAssignment - def create!(consumer_event_id, reference_id, headers, payload) + def create!(params, headers, payload) + consumer_event_id = params[:consumer_event_id] + reference_id = params[:reference_id] return if Event.exists_and_is_completed?(consumer_event_id) redis = Redis.new(url: Rails.application.secrets.redis_url_cache) @@ -48,8 +50,10 @@ def create!(consumer_event_id, reference_id, headers, payload) decision_review: decision_review) # NOTE: event, user, and veteran need to be before this call. - Events::DecisionReviewCreated::CreateIntake.process!(event: event, user: user, veteran: vet, parser: parser, - decision_review: decision_review) + Events::DecisionReviewCreated::CreateIntake.process!( + { event: event, user: user, veteran: vet, + parser: parser, decision_review: decision_review } + ) # NOTE: end_product_establishment & station_id is coming from the payload # claim_review can either be a higher_level_revew or supplemental_claim @@ -58,8 +62,10 @@ def create!(consumer_event_id, reference_id, headers, payload) user: user) # NOTE: 'epe' arg is the obj created as a result of the CreateEpEstablishment service class - Events::DecisionReviewCreated::CreateRequestIssues.process!(event: event, parser: parser, epe: epe, - decision_review: decision_review) + Events::DecisionReviewCreated::CreateRequestIssues.process!( + { event: event, parser: parser, epe: epe, + decision_review: decision_review } + ) # NOTE: decision_review arg can either be a HLR or SC object. process! will only run if # decision_review.legacy_opt_in_approved is true diff --git a/app/services/events/decision_review_created/create_intake.rb b/app/services/events/decision_review_created/create_intake.rb index fc366b7003b..e7496768674 100644 --- a/app/services/events/decision_review_created/create_intake.rb +++ b/app/services/events/decision_review_created/create_intake.rb @@ -7,7 +7,12 @@ class Events::DecisionReviewCreated::CreateIntake # that was created in the DecisionReviewCreated Service. class << self - def process!(event:, user:, veteran:, parser:, decision_review:) + def process!(params) + event = params[:event] + user = params[:user] + veteran = params[:veteran] + parser = params[:parser] + decision_review = params[:decision_review] # create Intake intake = Intake.create!(veteran_file_number: veteran.file_number, user: user, diff --git a/app/services/events/decision_review_created/create_request_issues.rb b/app/services/events/decision_review_created/create_request_issues.rb index f8eccc5b6f0..427677ff511 100644 --- a/app/services/events/decision_review_created/create_request_issues.rb +++ b/app/services/events/decision_review_created/create_request_issues.rb @@ -4,8 +4,8 @@ # when an Event is received using the data sent from VBMS class Events::DecisionReviewCreated::CreateRequestIssues class << self - def process!(event:, parser:, epe:, decision_review:) - create_request_issue_backfill(event, parser, epe, decision_review) + def process!(params) + create_request_issue_backfill(params) rescue StandardError => error raise Caseflow::Error::DecisionReviewCreatedRequestIssuesError, error.message end @@ -14,38 +14,43 @@ def process!(event:, parser:, epe:, decision_review:) # iterate through the array of issues and create backfill object from each one # rubocop:disable Metrics/MethodLength, Metrics/AbcSize - def create_request_issue_backfill(event, parser, epe, decision_review) + def create_request_issue_backfill(params) + event = params[:event] + epe = params[:epe] + parser = params[:parser] + decision_review = params[:decision_review] request_issues = parser.request_issues newly_created_issues = [] request_issues&.each do |issue| # create backfill RI object using extracted values + parser_issues = DecisionReviewCreatedIssueParser.new(issue) ri = RequestIssue.create!( - benefit_type: parser.ri_benefit_type(issue), - contested_issue_description: parser.ri_contested_issue_description(issue), - contention_reference_id: parser.ri_contention_reference_id(issue), - contested_rating_decision_reference_id: parser.ri_contested_rating_decision_reference_id(issue), - contested_rating_issue_profile_date: parser.ri_contested_rating_issue_profile_date(issue), - contested_rating_issue_reference_id: parser.ri_contested_rating_issue_reference_id(issue), - contested_decision_issue_id: parser.ri_contested_decision_issue_id(issue), - decision_date: parser.ri_decision_date(issue), - ineligible_due_to_id: parser.ri_ineligible_due_to_id(issue), - ineligible_reason: parser.ri_ineligible_reason(issue), - is_unidentified: parser.ri_is_unidentified(issue), - unidentified_issue_text: parser.ri_unidentified_issue_text(issue), - nonrating_issue_category: parser.ri_nonrating_issue_category(issue), - nonrating_issue_description: parser.ri_nonrating_issue_description(issue), - untimely_exemption: parser.ri_untimely_exemption(issue), - untimely_exemption_notes: parser.ri_untimely_exemption_notes(issue), - vacols_id: parser.ri_vacols_id(issue), - vacols_sequence_id: parser.ri_vacols_sequence_id(issue), - closed_at: parser.ri_closed_at(issue), - closed_status: parser.ri_closed_status(issue), - contested_rating_issue_diagnostic_code: parser.ri_contested_rating_issue_diagnostic_code(issue), - ramp_claim_id: parser.ri_ramp_claim_id(issue), - rating_issue_associated_at: parser.ri_rating_issue_associated_at(issue), - nonrating_issue_bgs_id: parser.ri_nonrating_issue_bgs_id(issue), - nonrating_issue_bgs_source: parser.ri_nonrating_issue_bgs_source(issue), + benefit_type: parser_issues.ri_benefit_type, + contested_issue_description: parser_issues.ri_contested_issue_description, + contention_reference_id: parser_issues.ri_contention_reference_id, + contested_rating_decision_reference_id: parser_issues.ri_contested_rating_decision_reference_id, + contested_rating_issue_profile_date: parser_issues.ri_contested_rating_issue_profile_date, + contested_rating_issue_reference_id: parser_issues.ri_contested_rating_issue_reference_id, + contested_decision_issue_id: parser_issues.ri_contested_decision_issue_id, + decision_date: parser_issues.ri_decision_date, + ineligible_due_to_id: parser_issues.ri_ineligible_due_to_id, + ineligible_reason: parser_issues.ri_ineligible_reason, + is_unidentified: parser_issues.ri_is_unidentified, + unidentified_issue_text: parser_issues.ri_unidentified_issue_text, + nonrating_issue_category: parser_issues.ri_nonrating_issue_category, + nonrating_issue_description: parser_issues.ri_nonrating_issue_description, + untimely_exemption: parser_issues.ri_untimely_exemption, + untimely_exemption_notes: parser_issues.ri_untimely_exemption_notes, + vacols_id: parser_issues.ri_vacols_id, + vacols_sequence_id: parser_issues.ri_vacols_sequence_id, + closed_at: parser_issues.ri_closed_at, + closed_status: parser_issues.ri_closed_status, + contested_rating_issue_diagnostic_code: parser_issues.ri_contested_rating_issue_diagnostic_code, + ramp_claim_id: parser_issues.ri_ramp_claim_id, + rating_issue_associated_at: parser_issues.ri_rating_issue_associated_at, + nonrating_issue_bgs_id: parser_issues.ri_nonrating_issue_bgs_id, + nonrating_issue_bgs_source: parser_issues.ri_nonrating_issue_bgs_source, end_product_establishment_id: epe.id, veteran_participant_id: parser.veteran_participant_id, decision_review: decision_review diff --git a/app/services/events/decision_review_created/decision_review_created_parser.rb b/app/services/events/decision_review_created/decision_review_created_parser.rb index ad21bbeb5a7..8bf110ab982 100644 --- a/app/services/events/decision_review_created/decision_review_created_parser.rb +++ b/app/services/events/decision_review_created/decision_review_created_parser.rb @@ -4,6 +4,7 @@ # DecisionReviewCreated and it's service Classes class Events::DecisionReviewCreated::DecisionReviewCreatedParser include Events::VeteranExtractorInterface + include ParserHelper attr_reader :headers, :payload @@ -39,31 +40,6 @@ def initialize(headers, payload_json) @veteran = @payload.dig(:veteran) end - # Checking for nonrating_issue_category is "Disposition" and processing such issues. - def process_nonrating_issue_category(payload_json) - payload_json[:request_issues].each do |issue| - next unless issue[:nonrating_issue_category] == "Disposition" - - issue[:nonrating_issue_category] = "Unknown Issue Category" - end - end - - # Generic/universal methods - # rubocop:disable Rails/TimeZone - def convert_milliseconds_to_datetime(milliseconds) - milliseconds.nil? ? nil : Time.at(milliseconds.to_i / 1000).to_datetime - end - # rubocop:enable Rails/TimeZone - - # convert logical date int to date - def logical_date_converter(logical_date_int) - return nil if logical_date_int.nil? || logical_date_int.to_i.days == 0 - - base_date = Date.new(1970, 1, 1) - converted_date = base_date + logical_date_int.to_i.days - converted_date - end - def css_id @payload.dig(:css_id) end @@ -325,108 +301,4 @@ def epe_development_item_reference_id def request_issues @payload.dig(:request_issues) end - - # Individual RequestIssue parsing methods - # An RI instance will be passed in as you iterate through the array - def ri_benefit_type(issue) - issue.dig(:benefit_type) - end - - def ri_contested_issue_description(issue) - issue.dig(:contested_issue_description) - end - - def ri_contention_reference_id(issue) - issue.dig(:contention_reference_id) - end - - def ri_contested_rating_decision_reference_id(issue) - issue.dig(:contested_rating_decision_reference_id) - end - - def ri_contested_rating_issue_profile_date(issue) - issue.dig(:contested_rating_issue_profile_date) - end - - def ri_contested_rating_issue_reference_id(issue) - issue.dig(:contested_rating_issue_reference_id) - end - - def ri_contested_decision_issue_id(issue) - issue.dig(:contested_decision_issue_id) - end - - def ri_decision_date(issue) - decision_date_int = issue.dig(:decision_date) - logical_date_converter(decision_date_int) - end - - def ri_ineligible_due_to_id(issue) - issue.dig(:ineligible_due_to_id) - end - - def ri_ineligible_reason(issue) - issue.dig(:ineligible_reason) - end - - def ri_is_unidentified(issue) - issue.dig(:is_unidentified) - end - - def ri_unidentified_issue_text(issue) - issue.dig(:unidentified_issue_text) - end - - def ri_nonrating_issue_category(issue) - issue.dig(:nonrating_issue_category) - end - - def ri_nonrating_issue_description(issue) - issue.dig(:nonrating_issue_description) - end - - def ri_untimely_exemption(issue) - issue.dig(:untimely_exemption) - end - - def ri_untimely_exemption_notes(issue) - issue.dig(:untimely_exemption_notes) - end - - def ri_vacols_id(issue) - issue.dig(:vacols_id) - end - - def ri_vacols_sequence_id(issue) - issue.dig(:vacols_sequence_id) - end - - def ri_closed_at(issue) - issue.dig(:closed_at) - end - - def ri_closed_status(issue) - issue.dig(:closed_status) - end - - def ri_contested_rating_issue_diagnostic_code(issue) - issue.dig(:contested_rating_issue_diagnostic_code) - end - - def ri_ramp_claim_id(issue) - issue.dig(:ramp_claim_id) - end - - def ri_rating_issue_associated_at(issue) - ri_rating_issue_associated_at_in_ms = issue.dig(:rating_issue_associated_at) - convert_milliseconds_to_datetime(ri_rating_issue_associated_at_in_ms) - end - - def ri_nonrating_issue_bgs_id(issue) - issue.dig(:nonrating_issue_bgs_id) - end - - def ri_nonrating_issue_bgs_source(issue) - issue.dig(:nonrating_issue_bgs_source) - end end diff --git a/spec/feature/events/decision_review_created/scenario_a_spec.rb b/spec/feature/events/decision_review_created/scenario_a_spec.rb index 1272ecc4dae..f74ee9cf095 100644 --- a/spec/feature/events/decision_review_created/scenario_a_spec.rb +++ b/spec/feature/events/decision_review_created/scenario_a_spec.rb @@ -11,7 +11,7 @@ middle_name: "Goob", ssn: "989773212", name_suffix: "") end - def json_payload + def json_test_payload { "event_id": "123", "claim_id": "9999", @@ -99,7 +99,7 @@ def json_payload end let!(:valid_params) do - json_payload + json_test_payload end context "with a valid token and user exists" do diff --git a/spec/services/events/decision_review_created/create_request_issues_spec.rb b/spec/services/events/decision_review_created/create_request_issues_spec.rb index ed131c74104..46ac93be150 100644 --- a/spec/services/events/decision_review_created/create_request_issues_spec.rb +++ b/spec/services/events/decision_review_created/create_request_issues_spec.rb @@ -83,8 +83,8 @@ parser = Events::DecisionReviewCreated::DecisionReviewCreatedParser.new({}, hash) higher_level_review.update!(legacy_opt_in_approved: true) - backfilled_issues = subject.process!(event: event, parser: parser, epe: epe, - decision_review: higher_level_review) + backfilled_issues = subject.process!({ event: event, parser: parser, epe: epe, + decision_review: higher_level_review }) expect(backfilled_issues.count).to eq(1) expect(RequestIssue.count).to eq(1) diff --git a/spec/services/events/decision_review_created/decision_review_created_parser_spec.rb b/spec/services/events/decision_review_created/decision_review_created_parser_spec.rb index 379f364c724..92c5d09e6db 100644 --- a/spec/services/events/decision_review_created/decision_review_created_parser_spec.rb +++ b/spec/services/events/decision_review_created/decision_review_created_parser_spec.rb @@ -101,31 +101,33 @@ total_issues = parser.request_issues expect(total_issues.count).to eq(1) issue = total_issues.first - expect(parser.ri_benefit_type(issue)).to eq response_hash.request_issues.first["benefit_type"] - expect(parser.ri_contested_issue_description(issue)).to eq response_hash.request_issues.first["contested_issue_description"] - expect(parser.ri_contention_reference_id(issue)).to eq response_hash.request_issues.first["contention_reference_id"] - expect(parser.ri_contested_rating_decision_reference_id(issue)).to eq response_hash.request_issues.first["contested_rating_decision_reference_id"] - expect(parser.ri_contested_rating_issue_profile_date(issue)).to eq response_hash.request_issues.first["contested_rating_issue_profile_date"] - expect(parser.ri_contested_rating_issue_reference_id(issue)).to eq response_hash.request_issues.first["contested_rating_issue_reference_id"] - expect(parser.ri_contested_decision_issue_id(issue)).to eq response_hash.request_issues.first["contested_decision_issue_id"] - expect(parser.ri_decision_date(issue)).to eq parser.logical_date_converter(response_hash.request_issues.first["decision_date"]) - expect(parser.ri_ineligible_due_to_id(issue)).to eq response_hash.request_issues.first["ineligible_due_to_id"] - expect(parser.ri_ineligible_reason(issue)).to eq response_hash.request_issues.first["ineligible_reason"] - expect(parser.ri_is_unidentified(issue)).to eq response_hash.request_issues.first["is_unidentified"] - expect(parser.ri_unidentified_issue_text(issue)).to eq response_hash.request_issues.first["unidentified_issue_text"] - expect(parser.ri_nonrating_issue_category(issue)).to eq response_hash.request_issues.first["nonrating_issue_category"] - expect(parser.ri_nonrating_issue_description(issue)).to eq response_hash.request_issues.first["nonrating_issue_description"] - expect(parser.ri_untimely_exemption(issue)).to eq response_hash.request_issues.first["untimely_exemption"] - expect(parser.ri_untimely_exemption_notes(issue)).to eq response_hash.request_issues.first["untimely_exemption_notes"] - expect(parser.ri_vacols_id(issue)).to eq response_hash.request_issues.first["vacols_id"] - expect(parser.ri_vacols_sequence_id(issue)).to eq response_hash.request_issues.first["vacols_sequence_id"] - expect(parser.ri_closed_at(issue)).to eq response_hash.request_issues.first["closed_at"] - expect(parser.ri_closed_status(issue)).to eq response_hash.request_issues.first["closed_status"] - expect(parser.ri_contested_rating_issue_diagnostic_code(issue)).to eq response_hash.request_issues.first["contested_rating_issue_diagnostic_code"] - expect(parser.ri_ramp_claim_id(issue)).to eq response_hash.request_issues.first["ramp_claim_id"] - expect(parser.ri_rating_issue_associated_at(issue)).to eq response_hash.request_issues.first["rating_issue_associated_at"] - expect(parser.ri_nonrating_issue_bgs_id(issue)).to eq response_hash.request_issues.first["nonrating_issue_bgs_id"] - expect(parser.ri_nonrating_issue_bgs_source(issue)).to eq response_hash.request_issues.first["nonrating_issue_bgs_source"] + parser_issues = DecisionReviewCreatedIssueParser.new(issue) + expect(parser_issues.ri_benefit_type).to eq response_hash.request_issues.first["benefit_type"] + expect(parser_issues.ri_benefit_type).to eq response_hash.request_issues.first["benefit_type"] + expect(parser_issues.ri_contested_issue_description).to eq response_hash.request_issues.first["contested_issue_description"] + expect(parser_issues.ri_contention_reference_id).to eq response_hash.request_issues.first["contention_reference_id"] + expect(parser_issues.ri_contested_rating_decision_reference_id).to eq response_hash.request_issues.first["contested_rating_decision_reference_id"] + expect(parser_issues.ri_contested_rating_issue_profile_date).to eq response_hash.request_issues.first["contested_rating_issue_profile_date"] + expect(parser_issues.ri_contested_rating_issue_reference_id).to eq response_hash.request_issues.first["contested_rating_issue_reference_id"] + expect(parser_issues.ri_contested_decision_issue_id).to eq response_hash.request_issues.first["contested_decision_issue_id"] + expect(parser_issues.ri_decision_date).to eq parser.logical_date_converter(response_hash.request_issues.first["decision_date"]) + expect(parser_issues.ri_ineligible_due_to_id).to eq response_hash.request_issues.first["ineligible_due_to_id"] + expect(parser_issues.ri_ineligible_reason).to eq response_hash.request_issues.first["ineligible_reason"] + expect(parser_issues.ri_is_unidentified).to eq response_hash.request_issues.first["is_unidentified"] + expect(parser_issues.ri_unidentified_issue_text).to eq response_hash.request_issues.first["unidentified_issue_text"] + expect(parser_issues.ri_nonrating_issue_category).to eq response_hash.request_issues.first["nonrating_issue_category"] + expect(parser_issues.ri_nonrating_issue_description).to eq response_hash.request_issues.first["nonrating_issue_description"] + expect(parser_issues.ri_untimely_exemption).to eq response_hash.request_issues.first["untimely_exemption"] + expect(parser_issues.ri_untimely_exemption_notes).to eq response_hash.request_issues.first["untimely_exemption_notes"] + expect(parser_issues.ri_vacols_id).to eq response_hash.request_issues.first["vacols_id"] + expect(parser_issues.ri_vacols_sequence_id).to eq response_hash.request_issues.first["vacols_sequence_id"] + expect(parser_issues.ri_closed_at).to eq response_hash.request_issues.first["closed_at"] + expect(parser_issues.ri_closed_status).to eq response_hash.request_issues.first["closed_status"] + expect(parser_issues.ri_contested_rating_issue_diagnostic_code).to eq response_hash.request_issues.first["contested_rating_issue_diagnostic_code"] + expect(parser_issues.ri_ramp_claim_id).to eq response_hash.request_issues.first["ramp_claim_id"] + expect(parser_issues.ri_rating_issue_associated_at).to eq response_hash.request_issues.first["rating_issue_associated_at"] + expect(parser_issues.ri_nonrating_issue_bgs_id).to eq response_hash.request_issues.first["nonrating_issue_bgs_id"] + expect(parser_issues.ri_nonrating_issue_bgs_source).to eq response_hash.request_issues.first["nonrating_issue_bgs_source"] end describe "#process_nonrating" do let(:payload_with_valid_issue) do diff --git a/spec/services/events/decision_review_created_spec.rb b/spec/services/events/decision_review_created_spec.rb index 35e65027687..9733cef4e86 100644 --- a/spec/services/events/decision_review_created_spec.rb +++ b/spec/services/events/decision_review_created_spec.rb @@ -9,9 +9,10 @@ let!(:json_payload) { read_json_payload } let!(:headers) { sample_headers } let!(:parser) { Events::DecisionReviewCreated::DecisionReviewCreatedParser.load_example } + let!(:params) { { consumer_event_id: consumer_event_id, reference_id: reference_id } } describe "#create!" do - subject { described_class.create!(consumer_event_id, reference_id, headers, read_json_payload) } + subject { described_class.create!(params, headers, read_json_payload) } context "When event is completed info field returns to default state" do it "event field is an empty json object" do @@ -77,7 +78,7 @@ expect(Rails.logger).to receive(:error) do |message| expect(message).to include(standard_error.message) end - expect { described_class.create!(consumer_event_id, reference_id, headers, json_payload) } + expect { described_class.create!(params, headers, json_payload) } .to raise_error(StandardError) end From e2718db0aa5eac941b76b5390e0407bd5e19835c Mon Sep 17 00:00:00 2001 From: Jonathan Tsang <98970951+jtsangVA@users.noreply.github.com> Date: Thu, 18 Jul 2024 16:52:17 -0400 Subject: [PATCH 5/5] Jonathan/appeals 51926 (#22215) * Hide UI changes behind featureFlag * fixed lint spacing warnings --- app/views/higher_level_reviews/edit.html.erb | 3 +- app/views/queue/index.html.erb | 3 +- app/views/supplemental_claims/edit.html.erb | 3 +- .../app/intake/pages/addIssues/addIssues.jsx | 174 +++++++++--------- client/app/queue/OtherReviewsTable.jsx | 133 +++++++------ 5 files changed, 169 insertions(+), 147 deletions(-) diff --git a/app/views/higher_level_reviews/edit.html.erb b/app/views/higher_level_reviews/edit.html.erb index 1141abf655f..367cbc686d3 100644 --- a/app/views/higher_level_reviews/edit.html.erb +++ b/app/views/higher_level_reviews/edit.html.erb @@ -17,7 +17,8 @@ featureToggles: { useAmaActivationDate: FeatureToggle.enabled?(:use_ama_activation_date, user: current_user), correctClaimReviews: FeatureToggle.enabled?(:correct_claim_reviews, user: current_user), - covidTimelinessExemption: FeatureToggle.enabled?(:covid_timeliness_exemption, user: current_user) + covidTimelinessExemption: FeatureToggle.enabled?(:covid_timeliness_exemption, user: current_user), + disableAmaEventing: FeatureToggle.enabled?(:disable_ama_eventing, user: current_user) } }) %> <% end %> diff --git a/app/views/queue/index.html.erb b/app/views/queue/index.html.erb index 966d8cf2f03..2965ee72ddb 100644 --- a/app/views/queue/index.html.erb +++ b/app/views/queue/index.html.erb @@ -73,7 +73,8 @@ additional_remand_reasons: FeatureToggle.enabled?(:additional_remand_reasons, user: current_user), acd_cases_tied_to_judges_no_longer_with_board: FeatureToggle.enabled?(:acd_cases_tied_to_judges_no_longer_with_board, user: current_user), admin_case_distribution: FeatureToggle.enabled?(:admin_case_distribution, user: current_user), - acd_exclude_from_affinity: FeatureToggle.enabled?(:acd_exclude_from_affinity, user: current_user) + acd_exclude_from_affinity: FeatureToggle.enabled?(:acd_exclude_from_affinity, user: current_user), + disable_ama_eventing: FeatureToggle.enabled?(:disable_ama_eventing, user: current_user) } }) %> <% end %> diff --git a/app/views/supplemental_claims/edit.html.erb b/app/views/supplemental_claims/edit.html.erb index 8641e9d1677..5419b2d10ab 100644 --- a/app/views/supplemental_claims/edit.html.erb +++ b/app/views/supplemental_claims/edit.html.erb @@ -17,7 +17,8 @@ featureToggles: { useAmaActivationDate: FeatureToggle.enabled?(:use_ama_activation_date, user: current_user), correctClaimReviews: FeatureToggle.enabled?(:correct_claim_reviews, user: current_user), - covidTimelinessExemption: FeatureToggle.enabled?(:covid_timeliness_exemption, user: current_user) + covidTimelinessExemption: FeatureToggle.enabled?(:covid_timeliness_exemption, user: current_user), + disableAmaEventing: FeatureToggle.enabled?(:disable_ama_eventing, user: current_user) } }) %> <% end %> diff --git a/client/app/intake/pages/addIssues/addIssues.jsx b/client/app/intake/pages/addIssues/addIssues.jsx index a270a1b3fd5..d887038ef76 100644 --- a/client/app/intake/pages/addIssues/addIssues.jsx +++ b/client/app/intake/pages/addIssues/addIssues.jsx @@ -115,97 +115,97 @@ class AddIssuesPage extends React.Component { const identifier = issueModificationRequest.identifier; switch (requestType) { - case 'reviewIssueModificationRequest': - this.setState({ - pendingIssueModification: issueModificationRequest - }); - this.props.toggleRequestIssueModificationModal(identifier); - break; - case 'reviewIssueAdditionRequest': - this.setState({ - pendingIssueModification: issueModificationRequest - }); - this.props.toggleRequestIssueAdditionModal(identifier); - break; - case 'reviewIssueWithdrawalRequest': - this.setState({ - pendingIssueModification: issueModificationRequest - }); - this.props.toggleRequestIssueWithdrawalModal(identifier); - break; - case 'reviewIssueRemovalRequest': - this.setState({ - pendingIssueModification: issueModificationRequest, - }); - this.props.toggleRequestIssueRemovalModal(identifier); - break; - case 'cancelReviewIssueRequest': - this.setState({ - pendingIssueModification: issueModificationRequest, - }); - this.props.toggleCancelPendingRequestIssueModal(); - break; - default: - // Do nothing if the dropdown option was not set or implemented. - break; + case 'reviewIssueModificationRequest': + this.setState({ + pendingIssueModification: issueModificationRequest + }); + this.props.toggleRequestIssueModificationModal(identifier); + break; + case 'reviewIssueAdditionRequest': + this.setState({ + pendingIssueModification: issueModificationRequest + }); + this.props.toggleRequestIssueAdditionModal(identifier); + break; + case 'reviewIssueWithdrawalRequest': + this.setState({ + pendingIssueModification: issueModificationRequest + }); + this.props.toggleRequestIssueWithdrawalModal(identifier); + break; + case 'reviewIssueRemovalRequest': + this.setState({ + pendingIssueModification: issueModificationRequest, + }); + this.props.toggleRequestIssueRemovalModal(identifier); + break; + case 'cancelReviewIssueRequest': + this.setState({ + pendingIssueModification: issueModificationRequest, + }); + this.props.toggleCancelPendingRequestIssueModal(); + break; + default: + // Do nothing if the dropdown option was not set or implemented. + break; } }; onClickIssueAction = (index, option = 'remove') => { switch (option) { - case 'add_decision_date': - this.props.toggleAddDecisionDateModal(); - this.setState({ issueAddDecisionDateIndex: index }); - break; - case 'remove': - if (this.props.toggleIssueRemoveModal) { - // on the edit page, so show the remove modal - this.setState({ - issueRemoveIndex: index - }); - this.props.toggleIssueRemoveModal(); - } else { - this.props.removeIssue(index); - } - break; - case 'withdraw': - this.props.withdrawIssue(index); - break; - case 'correct': - this.props.toggleCorrectionTypeModal({ index }); - break; - case 'undo_correction': - this.props.undoCorrection(index); - break; - case 'edit': - this.setState({ - issueIndex: index - }); - this.props.toggleEditIntakeIssueModal({ index }); - break; - case 'requestModification': - this.setState({ - issueIndex: index, - pendingIssueModification: {} - }); - this.props.toggleRequestIssueModificationModal(index); - break; - case 'requestRemoval': - this.setState({ - issueIndex: index, - pendingIssueModification: {} - }); - this.props.toggleRequestIssueRemovalModal(index); - break; - case 'requestWithdrawal': + case 'add_decision_date': + this.props.toggleAddDecisionDateModal(); + this.setState({ issueAddDecisionDateIndex: index }); + break; + case 'remove': + if (this.props.toggleIssueRemoveModal) { + // on the edit page, so show the remove modal this.setState({ - issueIndex: index, - pendingIssueModification: {} + issueRemoveIndex: index }); - this.props.toggleRequestIssueWithdrawalModal(index); - break; - default: - this.props.undoCorrection(index); + this.props.toggleIssueRemoveModal(); + } else { + this.props.removeIssue(index); + } + break; + case 'withdraw': + this.props.withdrawIssue(index); + break; + case 'correct': + this.props.toggleCorrectionTypeModal({ index }); + break; + case 'undo_correction': + this.props.undoCorrection(index); + break; + case 'edit': + this.setState({ + issueIndex: index + }); + this.props.toggleEditIntakeIssueModal({ index }); + break; + case 'requestModification': + this.setState({ + issueIndex: index, + pendingIssueModification: {} + }); + this.props.toggleRequestIssueModificationModal(index); + break; + case 'requestRemoval': + this.setState({ + issueIndex: index, + pendingIssueModification: {} + }); + this.props.toggleRequestIssueRemovalModal(index); + break; + case 'requestWithdrawal': + this.setState({ + issueIndex: index, + pendingIssueModification: {} + }); + this.props.toggleRequestIssueWithdrawalModal(index); + break; + default: + this.props.undoCorrection(index); } }; @@ -337,7 +337,7 @@ class AddIssuesPage extends React.Component { const intakeData = intakeForms[formType]; const appealInfo = intakeForms.appeal; - const { useAmaActivationDate, hlrScUnrecognizedClaimants } = featureToggles; + const { useAmaActivationDate, hlrScUnrecognizedClaimants, disableAmaEventing } = featureToggles; const hasClearedEp = intakeData && (intakeData.hasClearedRatingEp || intakeData.hasClearedNonratingEp); if (this.willRedirect(intakeData, hasClearedEp)) { @@ -639,7 +639,9 @@ class AddIssuesPage extends React.Component { let rowObjects = fieldsForFormType; - rowObjects = rowObjects.concat(intakeSystemLabelRow()); + if (!disableAmaEventing) { + rowObjects = rowObjects.concat(intakeSystemLabelRow()); + } Object.keys(issuesBySection).sort(). map((key) => { diff --git a/client/app/queue/OtherReviewsTable.jsx b/client/app/queue/OtherReviewsTable.jsx index fb28a0f8772..e2d0025118d 100644 --- a/client/app/queue/OtherReviewsTable.jsx +++ b/client/app/queue/OtherReviewsTable.jsx @@ -63,70 +63,85 @@ class OtherReviewsTable extends React.PureComponent { getKeyForRow = (rowNumber, object) => `${object.reviewType}-${object.claimId}`; - getColumns = () => [ - { - valueFunction: (review) => - }, - { - header: COPY.OTHER_REVIEWS_TABLE_APPELLANT_NAME_COLUMN_TITLE, - valueFunction: (review) => review.claimantNames.length > 0 ? - review.claimantNames.join(', ') : - review.veteranFullName - }, - { - header: COPY.OTHER_REVIEWS_TABLE_REVIEW_TYPE_COLUMN_TITLE, - valueFunction: (review) => { - return - - {_.startCase(review.reviewType)} - - ; - } - }, - { - header: COPY.OTHER_REVIEWS_TABLE_RECEIPT_DATE_COLUMN_TITLE, - valueFunction: (review) => - }, - { - header: COPY.OTHER_REVIEWS_TABLE_EP_CODE_COLUMN_TITLE, - valueFunction: (review) => { - if (review.endProductStatuses && review.endProductStatuses.length > 0) { - if (review.endProductStatuses.length > 1) { - return review.endProductStatuses.map((endProduct, i) => { - return - {endProduct.ep_code} - ; - }); + getColumns = () => { + const { featureToggles } = this.props; + + // Check if disable_ama_eventing is false to determine whether to show the BadgeArea column + const showBadgeAreaColumn = !featureToggles.disable_ama_eventing; + + const columns = [ + { + header: COPY.OTHER_REVIEWS_TABLE_APPELLANT_NAME_COLUMN_TITLE, + valueFunction: (review) => review.claimantNames.length > 0 ? + review.claimantNames.join(', ') : + review.veteranFullName + }, + { + header: COPY.OTHER_REVIEWS_TABLE_REVIEW_TYPE_COLUMN_TITLE, + valueFunction: (review) => ( + + + {_.startCase(review.reviewType)} + + + ) + }, + { + header: COPY.OTHER_REVIEWS_TABLE_RECEIPT_DATE_COLUMN_TITLE, + valueFunction: (review) => + }, + { + header: COPY.OTHER_REVIEWS_TABLE_EP_CODE_COLUMN_TITLE, + valueFunction: (review) => { + if (review.endProductStatuses && review.endProductStatuses.length > 0) { + if (review.endProductStatuses.length > 1) { + return review.endProductStatuses.map((endProduct, i) => ( + + {endProduct.ep_code} + + )); + } + const endProduct = review.endProductStatuses[0]; + + return endProduct.ep_code; } - const endProduct = review.endProductStatuses[0]; - return endProduct.ep_code; + return {COPY[CLAIM_REVIEW_TEXT[review.reviewType]]}; } - - return {COPY[CLAIM_REVIEW_TEXT[review.reviewType]]}; - } - }, - { - header: COPY.OTHER_REVIEWS_TABLE_EP_STATUS_COLUMN_TITLE, - valueFunction: (review) => { - if (review.endProductStatuses && review.endProductStatuses.length > 0) { - if (review.endProductStatuses.length > 1) { - return review.endProductStatuses.map((endProduct, i) => { - return {endProduct.ep_status}; - }); + }, + { + header: COPY.OTHER_REVIEWS_TABLE_EP_STATUS_COLUMN_TITLE, + valueFunction: (review) => { + if (review.endProductStatuses && review.endProductStatuses.length > 0) { + if (review.endProductStatuses.length > 1) { + return review.endProductStatuses.map((endProduct, i) => ( + + {endProduct.ep_status} + + )); + } + const endProduct = review.endProductStatuses[0]; + + return endProduct.ep_status; } - const endProduct = review.endProductStatuses[0]; - return endProduct.ep_status; + return ''; } - - return ''; } + ]; + + // Conditionally include the BadgeArea column at the start of row based on showBadgeAreaColumn + if (showBadgeAreaColumn) { + columns.unshift({ + valueFunction: (review) => + }); } - ]; + + return columns; + }; render = () => { if (this.props.reviews.length === 0) { @@ -152,12 +167,14 @@ OtherReviewsTable.propTypes = { reviews: PropTypes.arrayOf(PropTypes.object).isRequired, veteranName: PropTypes.string, styling: PropTypes.object, - clearCaseListSearch: PropTypes.func + clearCaseListSearch: PropTypes.func, + featureToggles: PropTypes.object }; const mapStateToProps = (state) => ({ userCssId: state.ui.userCssId, - userRole: state.ui.userRole + userRole: state.ui.userRole, + featureToggles: state.ui.featureToggles }); const mapDispatchToProps = (dispatch) => bindActionCreators({