-
Notifications
You must be signed in to change notification settings - Fork 69
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
95912 Check most recent status prior to sending ZSF email - IVC CHAMPVA forms #20044
base: master
Are you sure you want to change the base?
95912 Check most recent status prior to sending ZSF email - IVC CHAMPVA forms #20044
Conversation
…-check-most-recent-status-prior-to-sending-zsf-email
## | ||
# Checks if a provided IvcChampvaForm record has a corresponding PEGA report | ||
# | ||
# @param record [IvcChampvaForm] the form record to check against the PEGA reporting API | ||
# @return [Hash|boolean] Either a single PEGA report or `false` (if no report was found) | ||
def record_has_matching_report(record) | ||
# A report looks like: | ||
# { | ||
# "Creation Date"=>"2024-12-17T07:42:28.307000", | ||
# "PEGA Case ID"=>"D-XXXXX", | ||
# "Status"=>"Processed" | ||
# } | ||
|
||
# Querying by date requires a window of at least 1 day: | ||
date_start = record.created_at.strftime('%m/%d/%Y') | ||
date_end = (record.created_at + 1.day).strftime('%m/%d/%Y') | ||
# There should only be one match per case ID, so query reports and grab 0th item: | ||
# TODO: | ||
# In practice this won't actually work, because any report with a `nil` | ||
# `pega_status` on our side won't actually have a `case_id` to filter by... | ||
# what we REALLY need is to add the `form_uuid` property into the PEGA reports | ||
report = get_report(date_start, date_end).select { |rep| rep['PEGA Case ID'] == record.case_id }[0] | ||
# If a report exists, return the IVC record and the corresponding report | ||
# otherwise, return false | ||
record && report ? report : false | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the actual contribution of this PR so far.
This PR is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days. |
Keep |
This PR is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days. |
Keep |
Summary
Related issue(s)
Testing done
Screenshots
Note: Optional
What areas of the site does it impact?
(Describe what parts of the site are impacted andifcode touched other areas)
Acceptance criteria
Requested Feedback
(OPTIONAL)What should the reviewers know in addition to the above. Is there anything specific you wish the reviewer to assist with. Do you have any concerns with this PR, why?