-
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-3131] Add ConfidentialityCode support for Conditions
#735
Conversation
…ntly added test pass
…lityCode is at ehrComposition level, NOPAT meta security is still added. Refactors to ConditionMapper.java
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; |
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.
These likely can be private
.
gp2gp-translator/src/test/java/uk/nhs/adaptors/pss/translator/mapper/ConditionMapperTest.java
Outdated
Show resolved
Hide resolved
when(dateTimeMapper.mapDateTime( | ||
any(String.class) | ||
)).thenReturn(EHR_EXTRACT_AVAILABILITY_DATETIME); |
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 a bit of a smell, but not major.
gp2gp-translator/src/test/java/uk/nhs/adaptors/pss/translator/mapper/ConditionMapperTest.java
Outdated
Show resolved
Hide resolved
@@ -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)); |
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.
I'd change this to be something like...
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
What
This PR introduces the capability to handle
confidentialityCodes
forConditions
. The implementation checks if aLinkset
orEhrComposition
contains a confidentiality code with the valueNOPAT
. 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
Checklist: