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

FHIR Search Feature: _include:iterate #1158

Closed
prb112 opened this issue May 27, 2020 · 4 comments
Closed

FHIR Search Feature: _include:iterate #1158

prb112 opened this issue May 27, 2020 · 4 comments
Assignees
Labels
cms-interop This issue is associated with the CMS interoperability rule enhancement New feature or request P2 Priority 2 - Should Have search

Comments

@prb112
Copy link
Contributor

prb112 commented May 27, 2020

FHIR Search has a _include which can be iterative, if (and only if) the modifier :iterate is included
https://www.hl7.org/fhir/search.html#include

The inclusion process can be iterative, if (and only if) the modifier :iterate is included. For 
example, this search returns all Medication Request resources and their prescribing 
Practitioner Resources for the matching Medication Dispense resources: 

GET [base]/MedicationDispense?_include=MedicationDispense:prescription
    &_include:iterate=MedicationRequest:performer&criteria...

Example from PDXNET: {{url}}/Practitioner?identifier=1230782571&_revinclude=PractitionerRole:practitioner&_include:iterate=PractitionerRole:organization

@prb112 prb112 added search enhancement New feature or request labels May 27, 2020
@JohnTimm JohnTimm added the cms-interop This issue is associated with the CMS interoperability rule label Sep 14, 2020
@JohnTimm JohnTimm added this to the Sprint 19 milestone Sep 14, 2020
@lmsurpre lmsurpre modified the milestones: Sprint 19, Sprint 20 Oct 6, 2020
@JohnTimm JohnTimm removed this from the Sprint 20 milestone Oct 12, 2020
@prb112 prb112 added the P2 Priority 2 - Should Have label Feb 18, 2021
@lmsurpre
Copy link
Member

I recommend we only consider going up to one level for the iterate. Otherwise it just gets too hard and performance becomes a bigger concern.

@michaelwschroeder michaelwschroeder self-assigned this Mar 1, 2021
@michaelwschroeder michaelwschroeder added this to the Sprint 2021-04 milestone Mar 10, 2021
@michaelwschroeder
Copy link
Contributor

High-level design doc attached.
issue1158_design.docx

@michaelwschroeder
Copy link
Contributor

Updated design doc attached.[
issue1158_design_v2.docx
](url)

michaelwschroeder added a commit that referenced this issue Mar 24, 2021
Signed-off-by: Mike Schroeder <mschroed@us.ibm.com>
michaelwschroeder added a commit that referenced this issue Mar 25, 2021
Signed-off-by: Mike Schroeder <mschroed@us.ibm.com>
michaelwschroeder added a commit that referenced this issue Mar 25, 2021
Signed-off-by: Mike Schroeder <mschroed@us.ibm.com>
michaelwschroeder added a commit that referenced this issue Mar 25, 2021
Issue #1158 - implement :iterate modifier for include/revinclude
@prb112
Copy link
Contributor Author

prb112 commented Mar 29, 2021

Looks good... sample created linked patients and then iterated over it.

{
    "resourceType": "Bundle",
    "id": "a34d9d6b-3fce-4311-8c45-3ac612540814",
    "type": "searchset",
    "total": 1,
    "link": [
        {
            "relation": "self",
            "url": "https://localhost:9443/fhir-server/api/v4/Patient?_count=10&_id=1784aa352aa-2bdc10a1-4b4d-405e-a8a1-bd1c19afdca5&_include:iterate=Patient:link:Patient&_include:iterate=Patient:link:RelatedPerson&_page=1"
        }
    ],
    "entry": [
        {
            "fullUrl": "https://localhost:9443/fhir-server/api/v4/Patient/1784aa352aa-2bdc10a1-4b4d-405e-a8a1-bd1c19afdca5",
            "resource": {
                "resourceType": "Patient",
                "id": "1784aa352aa-2bdc10a1-4b4d-405e-a8a1-bd1c19afdca5",
                "meta": {
                    "versionId": "1",
                    "lastUpdated": "2021-03-29T18:02:29.285271Z"
                },
                "active": true,
                "name": [
                    {
                        "family": "Ortiz",
                        "given": [
                            "David"
                        ]
                    }
                ],
                "gender": "male",
                "link": [
                    {
                        "other": {
                            "reference": "Patient/1784aa352aa-2bdc10a1-4b4d-405e-a8a1-bd1c19afdca4"
                        },
                        "type": "seealso"
                    }
                ]
            },
            "search": {
                "mode": "match",
                "score": 1
            }
        },
        {
            "fullUrl": "https://localhost:9443/fhir-server/api/v4/Patient/1784aa352aa-2bdc10a1-4b4d-405e-a8a1-bd1c19afdca4",
            "resource": {
                "resourceType": "Patient",
                "id": "1784aa352aa-2bdc10a1-4b4d-405e-a8a1-bd1c19afdca4",
                "meta": {
                    "versionId": "3",
                    "lastUpdated": "2021-03-29T18:00:43.412148Z"
                },
                "active": true,
                "name": [
                    {
                        "family": "Ortiz",
                        "given": [
                            "David"
                        ]
                    }
                ],
                "gender": "male",
                "link": [
                    {
                        "other": {
                            "reference": "Patient/1784aa352aa-2bdc10a1-4b4d-405e-a8a1-bd1c19afdca4"
                        },
                        "type": "seealso"
                    }
                ]
            },
            "search": {
                "mode": "include",
                "score": 1
            }
        }
    ]
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cms-interop This issue is associated with the CMS interoperability rule enhancement New feature or request P2 Priority 2 - Should Have search
Projects
None yet
Development

No branches or pull requests

4 participants