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

add support for :_include modifier #6

Open
simonvadee opened this issue Jul 2, 2020 · 4 comments
Open

add support for :_include modifier #6

simonvadee opened this issue Jul 2, 2020 · 4 comments
Labels
enhancement New feature or request question Further information is requested

Comments

@simonvadee
Copy link
Contributor

Description

The search is not yet able to handle the _include modifier which allows to "join" resources between them.
For instance, the query string /Observation?category=laboratory&_include=Observation:encounter which is equivalent to

search_context = SearchContext(engine, "Observation")
params = (("category", "laboratory"), ("_include", "Observation:encounter"))
fhir_search = Search(search_context,  params=params)

should output a Bundle like:

{
    "id": "1",
    "meta": {},
    "entry": [
        {
            "fullUrl": "Observation/123",
            "resource": {
                "...": "...",
                "resourceType": "Observation"
            },
            "search": {
                "mode": "match"
            }
        },
        {
            "fullUrl": "Encounter/456",
            "resource": {
                "...": "...",
                "resourceType": "Encounter"
            },
            "search": {
                "mode": "include"
            }
        }
    ],
    "link": [
        {
            "relation": "self",
            "url": "https://some.url"
        }
    ],
    "total": 1,
    "type": "searchset",
    "resourceType": "Bundle"
}

I'm not sure how we should implement "relations" between documents but the parent-child relationship using the join datatype seems to be a good fit.
A first implementation could also consist in running multiple ES queries and construct a bundle from multiple results.

@nazrulworld nazrulworld added enhancement New feature or request question Further information is requested labels Jul 2, 2020
@nazrulworld
Copy link
Owner

Thank you much for this issue :). Yes fully agree about the complexity in implementation, we will need collaborative efforts.
I think we will wait a little bit for this feature until next release done, right now I am waiting for https://pypi.org/project/fhir.resources/ new release (it will bring massive changes and improvements) so next release of fhirpath will be compatible with fhir.resources 6.x.x.

@simonvadee
Copy link
Contributor Author

That's great news, the new version of fhir.resources looks great! Do you have an idea of when the new compatible version of fhirpath will be ready ? Is there anything I can do to help ?

@nazrulworld
Copy link
Owner

Making compatible is in progress, hope will be completed soon. I will invite you soon for this include feature 😃.
Thanks a lot for your support.

@nazrulworld
Copy link
Owner

@simonvadee I think current implementations are already compatible with the latest fhir.resources. You are welcome 🙏 to start working on supporting the _include modifier.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants