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

NAID-3122 - Add confidentialityCode support to AllergyIntoleranceMapper.java #684

Merged
merged 37 commits into from
Jul 3, 2024

Conversation

martin-nhs
Copy link
Contributor

@martin-nhs martin-nhs commented Jul 2, 2024

What

Given the following XML which is parsed by the AllergyIntolleranceMapper:

<confidentialityCode
  code="NOPAT"
  codeSystem="2.16.840.1.113883.4.642.3.47"
  displayName="no disclosure to patient, family or caregivers without attending provider's authorization" />

When the element is mapped, then expect the bundle to contain:

{
  "meta": {
    "security": [
      {
        "system": "http://hl7.org/fhir/v3/ActCode",
        "code": "NOPAT",
        "display": "no disclosure to patient, family or caregivers without attending provider's authorization"
      }
    ]
  }
}

Why

Please include details of the reasoning for these changes

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 July 2, 2024 08:32
@martin-nhs martin-nhs marked this pull request as ready for review July 2, 2024 12:02
@martin-nhs martin-nhs requested review from adrianclay and ole4ryb July 2, 2024 12:02
@martin-nhs martin-nhs changed the title Niad 3122 NAID-3122 - Add confidentialityCode support to AllergyIntoleranceMapper.java Jul 2, 2024
@martin-nhs martin-nhs enabled auto-merge (squash) July 2, 2024 12:25
@@ -88,14 +92,18 @@ private AllergyIntolerance mapAllergyIntolerance(RCMRMT030101UKEhrComposition eh
.getId()
.getRoot();

final Meta meta = CONFIDENTIALITY_CODE_PRESENT.test(observationStatement) ?
Copy link
Collaborator

Choose a reason for hiding this comment

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

I suspect this refactoring won't be the most desirable once we've implemented a few of these mappers, but given my mindset of refactoring when the duplication is indeed visible and a problem, let's leave it as it is for now.

@martin-nhs martin-nhs requested a review from adrianclay July 3, 2024 09:39
import java.util.Optional;

public final class ConfidentialityUtil {
private ConfidentialityUtil() { }
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it would be good to break a line after line 11 otherwise it is very difficult to read such a class.
Also, it would be good to have a line break between the constructor and the static variable.

ole4ryb
ole4ryb previously approved these changes Jul 3, 2024
@martin-nhs martin-nhs merged commit 8c5ce1f into main Jul 3, 2024
1 check was pending
@martin-nhs martin-nhs deleted the NIAD-3122 branch July 3, 2024 14:17
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.

3 participants