-
Notifications
You must be signed in to change notification settings - Fork 2
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
NIAD-3170: Generating acute MedicationRequest[intent=order] which share the same MedicationRequest[intent=plan] #821
Merged
MartinWheelerMT
merged 13 commits into
main
from
niad-3170-medication-request-order-share-the-same-plan
Oct 2, 2024
Merged
NIAD-3170: Generating acute MedicationRequest[intent=order] which share the same MedicationRequest[intent=plan] #821
MartinWheelerMT
merged 13 commits into
main
from
niad-3170-medication-request-order-share-the-same-plan
Oct 2, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add Test to ensure that the correct number of medication request Orders and Plans are created when multiple supplyPrescribes reference the same supplyAuthorise Add unit test source XML Add functionality for the tests above
MartinWheelerMT
changed the title
NIAD-3170: Medication Request Orders and Plans not generated correctly
NIAD-3170: Generating acute MedicationRequest[intent=order] which share the same MedicationRequest[intent=plan]
Sep 19, 2024
Add Test to ensure a new `Plan` is not generated when the original `Plan` is not `Acute` (i.e. `Repeat`). Update Test from previous commit to ensure that it generates and new `Plan` only when the original `Plan` is `Acute`. Add / Rename test files for the above tests. Add Test to ensure that the earliest `Order` references the original `Plan` when a new `Plan` is generated.
MartinWheelerMT
force-pushed
the
niad-3170-medication-request-order-share-the-same-plan
branch
from
September 19, 2024 18:05
74562ca
to
22c8c22
Compare
MartinWheelerMT
force-pushed
the
niad-3170-medication-request-order-share-the-same-plan
branch
from
September 27, 2024 16:39
39ebb04
to
028a2b3
Compare
…s to point to the duplicated plan Add functionality for a new id and identified to be updated for the newly generated plan Add Tests for these
MartinWheelerMT
force-pushed
the
niad-3170-medication-request-order-share-the-same-plan
branch
from
September 27, 2024 16:48
028a2b3
to
6f18812
Compare
…tion references are updated. Added test for this functionality Fix checkstyle issues
MartinWheelerMT
force-pushed
the
niad-3170-medication-request-order-share-the-same-plan
branch
from
September 27, 2024 18:44
723e326
to
8b0761b
Compare
…an when copying a plan
…ed in the order they are processed Update integration test files to reflect changes made
martin-nhs
reviewed
Oct 1, 2024
.../src/main/java/uk/nhs/adaptors/pss/translator/mapper/medication/MedicationRequestMapper.java
Outdated
Show resolved
Hide resolved
martin-nhs
reviewed
Oct 1, 2024
.../src/main/java/uk/nhs/adaptors/pss/translator/mapper/medication/MedicationRequestMapper.java
Outdated
Show resolved
Hide resolved
Refactor large method into smaller parts
martin-nhs
reviewed
Oct 1, 2024
.../src/main/java/uk/nhs/adaptors/pss/translator/mapper/medication/MedicationRequestMapper.java
Show resolved
Hide resolved
martin-nhs
approved these changes
Oct 2, 2024
MartinWheelerMT
deleted the
niad-3170-medication-request-order-share-the-same-plan
branch
October 2, 2024 08:37
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What
For every MedicationRequest[intent=plan] which is referenced via the basedOn field by multiple MedicationRequest[intent=order]s, the Adaptor will generate N new MedicationRequest[intent=plan], where N is the the total number of MedicationRequest[intent=order]s referencing the MedicationRequest[intent=plan] - 1.
The earliest (measured by the dispenseRequest.validityPeriod.startfield) MedicationRequest[intent=order] will keep its reference to the unmodified MedicationRequest[intent=plan]. For each subsequent Order, its basedOn will get updated to the generated version.
For each MedicationRequest[intent=plan] which is generated, it's fields will be copied from the original MedicationRequest[intent=plan]. With the following modifications:
Why
When EMIS prescriptions are post-dated, multiple prescriptions are generated.
When a post-dated prescription is transferred from EMIS it contains multiple MedicationStatements with
ehrSupplyPrescribe
which point to a singleehrSupplyAuthorise
.The adaptor until now has had an assumption that each
ehrSupplyAuthorise
is only referenced by oneehrSupplyPrescribe
.The result of which is that the Adaptor is generating acute medications which don’t match up to a valid GP Connect representation of an acute medication.
Type of change
Please delete options that are not relevant.
Checklist: