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-3131] Add ConfidentialityCode support for Conditions #735

Merged
merged 8 commits into from
Aug 1, 2024

Conversation

martin-nhs
Copy link
Contributor

@martin-nhs martin-nhs commented Aug 1, 2024

What

This PR introduces the capability to handle confidentialityCodes for Conditions. The implementation checks if a Linkset or EhrComposition contains a confidentiality code with the value NOPAT. If this code is present, meta security is added to the resource; otherwise, the code is ignored.

Why

More details can be found on the ticket.

Type of change

  • New feature (non-breaking change which adds functionality)

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

@martin-nhs martin-nhs marked this pull request as draft August 1, 2024 11:00
…lityCode is at ehrComposition level, NOPAT meta security is still added. Refactors to ConditionMapper.java
@martin-nhs martin-nhs marked this pull request as ready for review August 1, 2024 11:15
Comment on lines +84 to +87
static final String NAMED_STATEMENT_REF_ID = "NAMED_STATEMENT_REF_ID";
static final String STATEMENT_REF_ID = "STATEMENT_REF_ID";
static final String STATEMENT_REF_ID_1 = "STATEMENT_REF_ID_1";
static final int EXPECTED_NUMBER_OF_EXTENSIONS = 4;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

These likely can be private.

Comment on lines 316 to 318
when(dateTimeMapper.mapDateTime(
any(String.class)
)).thenReturn(EHR_EXTRACT_AVAILABILITY_DATETIME);
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is a bit of a smell, but not major.

@@ -367,8 +451,21 @@ private Bundle buildBundleWithStatementRefObservations() {
.setResource(new Observation().setId(STATEMENT_REF_ID_1)));
}

private void assertConditionsMetaIsExpected(List<Condition> conditions, Meta expectedMeta) {
conditions.forEach(condition -> assertThat(condition.getMeta()).usingRecursiveComparison().isEqualTo(expectedMeta));
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'd change this to be something like...

Suggested change
conditions.forEach(condition -> assertThat(condition.getMeta()).usingRecursiveComparison().isEqualTo(expectedMeta));
assertAll(conditions.map(condition ->
() -> assertThat(condition.getMeta()).usingRecursiveComparison().isEqualTo(expectedMeta)
));

So we get the benefit of the assertAll

@martin-nhs martin-nhs enabled auto-merge (squash) August 1, 2024 11:52
@martin-nhs martin-nhs merged commit 6d89dd4 into main Aug 1, 2024
1 check passed
@martin-nhs martin-nhs deleted the NIAD-3131 branch August 1, 2024 12:33
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