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

Improve mapping logic and robustness in CSV2FHIR maps #97

Open
StephThaoOng opened this issue Dec 3, 2024 · 3 comments
Open

Improve mapping logic and robustness in CSV2FHIR maps #97

StephThaoOng opened this issue Dec 3, 2024 · 3 comments
Assignees
Labels
bug Something isn't working enhancement New feature or request

Comments

@StephThaoOng
Copy link
Collaborator

Improve mapping logic and robustness across CSV2FHIR maps.

While converting Observation/gram-stain from CSV to FHIR, it was observed that some component data was missed on mapping. In this instance, the bug was that the CodeableConcept is not created if coding is not present/populated in the CSV.
Expected behaviour is that CodeableConcept is created if any of the codings or text elements are populated.

A band-aid fix was made only in the CSV2Observation.map (see commit 7952765) to produce the expected output however in general, all the maps need review and improvement to mapping logic, consistency, and robustness.

@StephThaoOng StephThaoOng added bug Something isn't working enhancement New feature or request labels Dec 3, 2024
@jgsuess jgsuess transferred this issue from hl7au/au-fhir-test-data Jan 23, 2025
@ir4y ir4y transferred this issue from hl7au/au-fhir-test-data-utils Jan 30, 2025
@ir4y
Copy link
Collaborator

ir4y commented Jan 30, 2025

I transfered this issue back to au-fhir-test-data since, mappers are located in this repository.

@ir4y
Copy link
Collaborator

ir4y commented Feb 10, 2025

There is an issue with FHIR Mapping language and flat data structures.
FHIR Mapping language reusable component is group.
Group allows you to map one subtree element to another.
The group is invoked by providing two subtree source and destination.
This approach allows you to modularise mappings.
Here you can find an example that maps QuestionnaireResponse to Patient https://github.com/beda-software/FHIRPathMappingLanguage/blob/main/examples/repeatable/fhirmapping.map that uses this technique.

I tried to leverage it for the current project.
Unfortunately it will not work.
Since our source format is CSV, we don't have a subtrees, but it is a requirement for Group in FML to be invoked.

I am proposing to switch from CSV to QuestionnaireResponse format.

With QuestionnaireResponse data structure we can leverage groups and simplify mappings that enhance, readability, support on the long term and allow us avoid bugs like this one across all mappers. Since we can use group as a reusable element for many mappings.

We already have a tool to convert XLS to CSV I can modify it to convert XLS to QuestionnaireResponse.

@ir4y ir4y assigned StephThaoOng and unassigned ir4y Feb 10, 2025
@StephThaoOng
Copy link
Collaborator Author

10/02/25: Infra &Tooling sprint meeting - agreed this a good approach that we should proceed with.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants