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

StructureMap-based extraction #543

Closed
ekigamba opened this issue Jun 9, 2021 · 3 comments · Fixed by #566 · May be fixed by ekigamba/android-fhir#1
Closed

StructureMap-based extraction #543

ekigamba opened this issue Jun 9, 2021 · 3 comments · Fixed by #566 · May be fixed by ekigamba/android-fhir#1
Assignees
Labels
type:enhancement New feature or request

Comments

@ekigamba
Copy link
Contributor

ekigamba commented Jun 9, 2021

Is your feature request related to a problem? Please describe.
Partly yes.

  1. Problem - Extracting complex multiple resources and performing transformations is currently not possible
  2. FHIR Spec support - We need to support SDC StructureMap-based extraction mechanisms

Describe the solution you'd like
Defining a Questionnaire with the StructureMap reference and automatically getting the extracted resources when ResourceMapper#extraction is called with the Questionnaire and QuestionnaireResponse

Scoping

  • Change the ResourceMapper#extraction return type to Bundle
  • Move definition based extraction functionality to a different function
  • Add structuremap-based extraction functionality on a different function
  • Both extraction functions should return a Bundle
  • StructureMap-based extraction should only be used if there is a questionnaire-targetStructureMap extension on the Questionnaire root
  • Fetch the StructureMap from the DB so that it can be invoked against the QuestionnaireResponse - The url of the StructureMap is retrieved from the extension's valueCanonical. Functionality for invoking a StructureMap on a resource is already implemented in the hapi-fhir rg.hl7.fhir.r4.utils.StructureMapUtilities.

Handling of errors

  • If the StructureMap execution fails, no data will be extracted from the Questionnaire
  • If the StructureMap is not found, the extraction fails - We need to figure out a way to retry extraction

Describe alternatives you've considered
None

Additional context
http://build.fhir.org/ig/HL7/sdc/extraction.html#structuremap-based-extraction

Would you like to work on the issue?
Yes

@ekigamba ekigamba added type:enhancement New feature or request data-capture labels Jun 9, 2021
@ekigamba
Copy link
Contributor Author

@jingtang10 Could you take a look at this and see if this implementation is OK with you?

@ekigamba ekigamba self-assigned this Jun 10, 2021
ekigamba added a commit that referenced this issue Jun 21, 2021
- Refactor ResourceMapper#extract function to support both definition-based and StructureMap-based
- Add interface to allow external implementation of fetching StructureMap
- Add tests for StructureMap-based extraction
- Add ca.uhn.hapi.fhir:org.hl7.fhir.validation:5.3.0 dependency for running tests
- Change ResourceMapper#extract signature to return Bundle
- Add overloaded ResourceMapper#extract method with extra StructureMapProvider param
- Update ResourceMapperTest methods descriptions

Fixes #543
ekigamba added a commit that referenced this issue Jun 21, 2021
- Refactor ResourceMapper#extract function to support both definition-based and StructureMap-based
- Add interface to allow external implementation of fetching StructureMap
- Add tests for StructureMap-based extraction
- Add ca.uhn.hapi.fhir:org.hl7.fhir.validation:5.3.0 dependency for running tests
- Change ResourceMapper#extract signature to return Bundle
- Add overloaded ResourceMapper#extract method with extra StructureMapProvider param
- Update ResourceMapperTest methods descriptions

Fixes #543
ekigamba added a commit that referenced this issue Jun 21, 2021
- Refactor ResourceMapper#extract function to support both definition-based and StructureMap-based
- Add interface to allow external implementation of fetching StructureMap
- Add tests for StructureMap-based extraction
- Add ca.uhn.hapi.fhir:org.hl7.fhir.validation:5.3.0 dependency for running tests
- Change ResourceMapper#extract signature to return Bundle
- Add overloaded ResourceMapper#extract method with extra StructureMapProvider param
- Update ResourceMapperTest methods descriptions

Fixes #543
ekigamba added a commit that referenced this issue Jun 22, 2021
- Refactor ResourceMapper#extract function to support both definition-based and StructureMap-based
- Add interface to allow external implementation of fetching StructureMap
- Add tests for StructureMap-based extraction
- Add ca.uhn.hapi.fhir:org.hl7.fhir.validation:5.3.0 dependency for running tests
- Change ResourceMapper#extract signature to return Bundle
- Add overloaded ResourceMapper#extract method with extra StructureMapProvider param
- Update ResourceMapperTest methods descriptions

Fixes #543
ekigamba added a commit that referenced this issue Jun 29, 2021
- Refactor ResourceMapper#extract function to support both definition-based and StructureMap-based
- Add interface to allow external implementation of fetching StructureMap
- Add tests for StructureMap-based extraction
- Add ca.uhn.hapi.fhir:org.hl7.fhir.validation:5.3.0 dependency for running tests
- Change ResourceMapper#extract signature to return Bundle
- Add overloaded ResourceMapper#extract method with extra StructureMapProvider param
- Update ResourceMapperTest methods descriptions

Fixes #543
@jingtang10 jingtang10 reopened this Jul 22, 2021
@jingtang10
Copy link
Collaborator

We still need a follow-up PR to convert the functions to suspend functions.

@ekigamba
Copy link
Contributor Author

@jingtang10 I have created the issue here as discussed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:enhancement New feature or request
Projects
Archived in project
3 participants