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

Bulk Export Group export - no way to export referenced Location resources #6443

Open
dehall opened this issue Nov 5, 2024 · 0 comments
Open

Comments

@dehall
Copy link

dehall commented Nov 5, 2024

Describe the bug
There's currently no way to export Location resources via a Bulk Export of a Group. This seems like a regression of #4080/#4081 where support for adding resources referenced by other resource types in the Patient compartment was added.

To Reproduce
Approach 1:

  1. Load a Group with some Patients, where a Location resource is referenced by another resource that references the Patient. Sample Bundle (R4) attached: sample_group_to_export.json
  2. Call the $export operation on the Group, with default settings (no additional parameters)
  • eg GET /Group/{id}/$export with header Prefer: respond-async
  • Content-Location in the response will point to the $export-poll-status location to poll, GET that url until it returns the export output
  1. Result: Some data is exported, but the Location is not included; there is no Location file in the export

Approach 2:
4. Call the $export operation on a Group, explicitly specifying Location as a resourceType to return

  • eg GET /Group/{id}/$export?_type=Patient,Encounter,Location
  1. Result: an error is immediately returned: HAPI-0512: Resource types [Location] are invalid for this type of export, as they do not contain search parameters that refer to patients

Expected behavior
It should be possible via some mechanism to include Location resources in a Group export

Screenshots

Environment (please complete the following information):

  • HAPI FHIR Version 7.0.2
    • (but based on the code I expect it's still there in 7.4.5)
  • OS: macOS 14.7.1
  • JDK 17
  • Browser n/a

Additional context
It looks like this used to work when #4081 was merged, but at some point the includes logic was changed and now only resource types that are specifically requested will be returned: https://github.com/hapifhir/hapi-fhir/blob/v7.4.5/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/bulk/export/svc/JpaBulkExportProcessor.java#L591
But as noted it's not possible to specifically request Location resources

Note that #4080 also refers to Organization, Group, and Device resources. Organization and Group are handled separately in the code because and this also allows them to be included when referenced from other resources via the includes logic I linked above

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

No branches or pull requests

1 participant