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

Update original MedicationStatement lastIssueDate for multiple acute med #871

Conversation

adrianclay
Copy link
Collaborator

What

When an accute med has multiple issues, we generate individual plan/statement for each order.

This updates the original statements lastIssueDate to correspond to the date on its corresponding MedicationRequest[order].

Why

Previously the lastIssueDate was the most recent date of all the orders.

Type of change

Bug fix (non-breaking change which fixes an issue)

Checklist:

  • I have performed a self-review of my code
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have updated the Changelog with details of my change in the UNRELEASED section if this change will affect end users
  • A corresponding change has been made to the Mapping Documentation repository

When an accute med has multiple issues, we generate individual plan/statement
for each order.

This updates the original statements lastIssueDate to correspond to the
date on its corresponding MedicationRequest[order].

Previously the lastIssueDate was the most recent date of all the orders.
@adrianclay adrianclay force-pushed the NIAD-3170-update-last-issued-date-on-original-medication-statement branch from 81cf50f to d834285 Compare October 11, 2024 15:48
@adrianclay adrianclay marked this pull request as ready for review October 11, 2024 16:40
final var originalMedicationStatement = getMedicationStatementByPlanId(medicationStatements, plan.getId());
originalMedicationStatement.getExtensionByUrl(MEDICATION_STATEMENT_LAST_ISSUE_DATE_URL).setValue(
orders.get(0).getDispenseRequest().getValidityPeriod().getStartElement()
);
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Not sure I'm a fan of making this anon function even bigger.

@MartinWheelerMT MartinWheelerMT merged commit 53457ac into main Oct 14, 2024
1 check passed
@MartinWheelerMT MartinWheelerMT deleted the NIAD-3170-update-last-issued-date-on-original-medication-statement branch October 14, 2024 08:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants