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-2851: Prevent duplicate 'Laboratory' categories when mapping SpecimenCompounds #575

Closed
wants to merge 5 commits into from

Conversation

MartinWheelerMT
Copy link
Collaborator

@MartinWheelerMT MartinWheelerMT commented Apr 15, 2024

What

Prevent an observation from containing duplicated "Laboratory" categories.

Why

If an Observation being handled by the SpecimenCompoundsMapper already contained a `"Laboratory" category then it would add a new one, resulting in duplication, such as the example below:

{
            "resource": {
                "resourceType": "Observation",
                "id": "C515E71E-2473-11EE-808B-AC162D1F16F0",
                "meta": {
                    "profile": [
                        "https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-Observation-1"
                    ]
                },
                "identifier": [
                    {
                        "system": "https://PSSAdaptor/B83002",
                        "value": "C515E71E-2473-11EE-808B-AC162D1F16F0"
                    }
                ],
                "status": "final",
                "category": [
                    {
                        "coding": [
                            {
                                "system": "http://hl7.org/fhir/observation-category",
                                "code": "laboratory",
                                "display": "Laboratory"
                            }
                        ]
                    },
                    {
                        "coding": [
                            {
                                "system": "http://hl7.org/fhir/observation-category",
                                "code": "laboratory",
                                "display": "Laboratory"
                            }
                        ]
                    }
                ]...

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
  • 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

…ady exists on the provided observation before adding to prevent duplication

Add test to cover this functionality
update integration test output file to remove duplication
@MartinWheelerMT MartinWheelerMT changed the title Update SpecimenCompoundsMapper to check if a laboratory category alre… Prevent duplicate 'Laboratory' categories when mapping SpecimenCompounds Apr 15, 2024
@MartinWheelerMT MartinWheelerMT marked this pull request as ready for review April 15, 2024 14:38
azam145
azam145 previously approved these changes Apr 16, 2024
@adrianclay adrianclay changed the title Prevent duplicate 'Laboratory' categories when mapping SpecimenCompounds NIAD-2851: Prevent duplicate 'Laboratory' categories when mapping SpecimenCompounds Apr 16, 2024
@MartinWheelerMT MartinWheelerMT enabled auto-merge (squash) April 24, 2024 14:25
@adrianclay
Copy link
Collaborator

Resolved by #722

@adrianclay adrianclay closed this Jul 25, 2024
auto-merge was automatically disabled July 25, 2024 16:18

Pull request was closed

@adrianclay adrianclay deleted the diag-report-duplicated-identifier branch July 25, 2024 16:18
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.

4 participants