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

NIAD-3220: Detect Referral + Document LinkSets and not create a Problem (Condition) from them #937

Conversation

MartinWheelerMT
Copy link
Collaborator

@MartinWheelerMT MartinWheelerMT commented Nov 20, 2024

What

  • Add functionality to ConditionMapper to ensure that a Condition is not mapped from a LinkSet when it is a "ReferralRequestToExternalDocumentLinkSet."
  • Add unit test for the above functionality.
  • Add functionality to ReferralRequestMapper to set supportingInfo with DocumentReferences to when the ReferralRequest is referenced from a "ReferralRequestToExternalDocumentLinkSet."
  • Add unit test for above functionality.
  • Update PWTP7_vis-output.json to reflect the changes made.

Why

In #936 the functionality was added to identify LinkSets which are a "Referral Request to External Document LinkSet".

A "ReferralRequest to ExternalDocument LinkSet" is defined as a LinkSet which matches the following criteria:

  • It has a code with a value of 394776006 and a system of 2.16.840.1.113883.2.1.3.2.4.15 and no qualifier and no originalText
  • The conditionNamed / namedStatementRef / id[root] is a RequestStatement
  • It has at least 1 component
  • All the component / statementRef / id[root] are references to GP2GP document/attachments.

The purpose of this PR is to use the resource filter previously added to ensure that:

  • A Condition is not created from the LinkSet.
  • In the mapped ReferralRequest, then the supportingInfo field should be populated by DocumentReference references taken from the Linkset statementRef field.

Type of change

Please delete options that are not relevant.

  • 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

…l document LinkSets

* Add Test to check verify that the provided `LinkSet` is a "Referral Request to External Document LinkSet."
* Add test XML file containing a "Referral Request to External Document LinkSet."
* Add method `isReferralRequestToExternalDocumentLinkSet` to `ResourceFilterUtil` with parameters for the `ehrExtract` and te `LinkSet` itself to identify `LinkSets` matching the criteria for a "Referral Request to External Document LinkSet."
…em (Condition) from them

Add functionality to ConditionMapper to ensure that a `Condition` is not mapped from a `LinkSet` when it is a "ReferralRequestToExternalDocumentLinkSet."
Add unit test for the above functionality.
Add functionality to ReferralRequestMapper to set `supportingInfo` with `DocumentReferences` to when the `ReferralRequest` is referenced from a "ReferralRequestToExternalDocumentLinkSet."
Add unit test for above functionality.
Update PWTP7_vis-output.json to reflect the changes made.
@MartinWheelerMT MartinWheelerMT marked this pull request as ready for review November 20, 2024 16:04
…od to set the `supportingInfo` field to the provided newly added List<Reference> parameter.

Update test method which uses this method to pass in an empty list.
Base automatically changed from niad-3220-add-resource-filter-util-for-referral_to_document_linkset to main November 21, 2024 17:03
MartinWheelerMT and others added 4 commits November 21, 2024 17:09
…ple LinkSets referencing the same RequestStatement by adding a custom collector merge function

Add additional test and XML file for this case.
}

@Test
void When_ReferralRequestReferencedByMultipleLinkSets_Expect_AllRelatedDocumentReferencesAddedAsSupportingInfo() {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nice.

);
final var referralRequest = referralRequests.getFirst();
assertAll(
() -> assertThat(referralRequest.getSupportingInfo()).hasSize(expectedSize),
Copy link
Collaborator

Choose a reason for hiding this comment

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

Minor: The containsExactly below already checks that there will be three items, so this is a little redundant.

@MartinWheelerMT MartinWheelerMT merged commit b96deb3 into main Nov 22, 2024
1 check passed
@MartinWheelerMT MartinWheelerMT deleted the niad-3220-handle-referral-request-to-external-document-linkset branch November 22, 2024 10:36
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