Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(update RAI withdraw behavior): Update RAI withdraw behavior to accommodate Medicaid specific biz logic #357

Merged
merged 6 commits into from
Feb 8, 2024

Conversation

mdial89f
Copy link
Contributor

@mdial89f mdial89f commented Feb 2, 2024

Purpose

This changeset updates the RAI Withdraw mechanics to accommodate the specifics of Medicaid RAI response withdrawal.

Linked Issues to Close

Closes https://qmacbis.atlassian.net/browse/OY2-26753

Approach

The RAI lifecycle for medicaid is different than chip.
For medicaid:

  • There can only be exactly one RAI object for a submission.
  • The state needs to be allowed to withdraw and re-respond to that same RAI multiple times.
    For chip:
  • There can be one to many RAI objects for a submission.
  • The state will not re-respond to an RAI. If a response is withdrawn and a new response is required, CMS will issue another RAI.

The updates to the api's withdraw rai function reflect this.

  • For medicaid, on withdraw, we nullify the received date, thereby re-opening the RAI and sending the record back to Pending - RAI status. We also set the withdrawn date.
  • For chip, on withdraw, we leave the received date as is, set the withdrawn date, and send the record back to Pending.
  • For all authorities, we set a detailed message in the status memo field that includes the received and withdrawn dates of the withdrawn package. We do this since Medicaid is overwriting data on the RAI object, and we don't want data loss. Although our mako system will log all events to status memo as they happen, including the response received event, we can't guarantee that the status memo already has that information since we cannot guarantee that the response was submitted through mako. So, our status memo note is verbose. And while it's detailed info is only required for medicaid (since only medicaid overwrites data), I went ahead and set the same message format for all withdraw package events.

MEDICAID Example, after rai response withdraw

Screen Shot 2024-02-02 at 10 04 53 AM Screen Shot 2024-02-02 at 10 05 00 AM Screen Shot 2024-02-02 at 10 09 12 AM

CHIP Example, after rai response withdraw

Screen Shot 2024-02-02 at 10 08 25 AM Screen Shot 2024-02-02 at 10 08 30 AM Screen Shot 2024-02-02 at 10 09 27 AM

Assorted Notes/Considerations/Learning

During the course of work, it was found that the issue rai action was not appearing when expected. For a chip submission, after an rai response is withdrawn, a new RAI may be issued. However, it wasn't showing up. I fixed what I believe to be a fault in the rule logic. The logic now allows RAI issuance if there are no RAIs or the latest RAI is complete.
I updated the checks to reflect the logic of:

  • a respondable RAI is one with a requested date and no received date.
  • an RAI is issuable if there are no RAIs, or the latest RAI has a received date.
  • and RAI response is withdrawable if it has a received date and no withdrawn date.

@@ -119,29 +119,52 @@ export async function withdrawRai(body: RaiWithdraw, document: any) {
const transaction = new sql.Transaction(pool);
try {
await transaction.begin();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is obviously a lot of refactor opportunity here...
I went with the verbose approach, and didn't bother condensing anything, as the api actions in general are soon to be refactored.

@mdial89f mdial89f requested review from benjaminpaige, 13bfrancis and pkim-gswell and removed request for benjaminpaige and 13bfrancis February 2, 2024 09:34
@mdial89f mdial89f added type: FIX Submit bug fixes status: READY PR is ready for review labels Feb 2, 2024
@mdial89f mdial89f changed the title feat(modify rai withdraw beahvior): Update RAI withdraw behavior to accommodate Medicaid specific biz logic feat(update RAI withdraw behavior): Update RAI withdraw behavior to accommodate Medicaid specific biz logic Feb 2, 2024
@mdial89f mdial89f added type: FEAT Submit new features and removed type: FIX Submit bug fixes labels Feb 2, 2024
Copy link
Contributor

@pkim-gswell pkim-gswell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

iapprove

@mdial89f mdial89f added status: TESTING PR is being tested by QA and removed status: READY PR is ready for review labels Feb 5, 2024
@mdial89f mdial89f self-assigned this Feb 5, 2024
@mdial89f mdial89f merged commit 4523f31 into master Feb 8, 2024
16 checks passed
Copy link
Contributor

🎉 This PR is included in version 1.7.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Copy link
Contributor

🎉 This PR is included in version 1.5.0-val.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
released on @val released status: TESTING PR is being tested by QA type: FEAT Submit new features
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants