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

Support customizable compartment definitions #2143

Closed
lmsurpre opened this issue Mar 24, 2021 · 2 comments
Closed

Support customizable compartment definitions #2143

lmsurpre opened this issue Mar 24, 2021 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@lmsurpre
Copy link
Member

lmsurpre commented Mar 24, 2021

Is your feature request related to a problem? Please describe.
Compartment search provides a way to efficient scope a search request to resources that have a single parameter value of some kind (e.g. a specific patient id).

It might be nice for users (i.e. operators of a given fhir server deployment) to be able to both:

  1. customize existing compartments (like the patient compartment) with their own "inclusion criteria" for what to include/exclude; and
  2. define new compartment definitions that can be used to scope search requests by a common criteria

Describe the solution you'd like

  1. Update CompartmentUtil to pull compartment definitions from the registry (instead of a packaged compartments.json).
  2. Document how users/operators can override the default compartment definitions.
  3. Document how users/operators can supply new compartment definitions.

Describe alternatives you've considered
Do not support customizable compartment definitions.

Acceptance Criteria

Additional context
This feature becomes more powerful with #2371

@prb112 prb112 added the enhancement New feature or request label Mar 25, 2021
@lmsurpre lmsurpre added this to the Sprint 2021-07 milestone May 17, 2021
@lmsurpre lmsurpre self-assigned this May 17, 2021
lmsurpre added a commit that referenced this issue May 18, 2021
Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com>
lmsurpre added a commit that referenced this issue May 18, 2021
Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com>
lmsurpre added a commit that referenced this issue May 27, 2021
The CompartmentDefinition resource has a required binding to a fixed
list of compartment types. To support a custom compartments, we will now
look for the `http://ibm.com/fhir/extension/custom-compartment-type`
extension on this element (when it has no value).

Additionally, I created a constant in fhir-core FHIRConstants for our
base extension url and I updated all the different places we have
extension urls to use it.

Finally, I included a couple extra changes that I had sitting around for
the FHIR Registry. If desired, I can split these out into a separate PR.

Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com>
lmsurpre added a commit that referenced this issue May 27, 2021
The CompartmentDefinition resource has a required binding to a fixed
list of compartment types. To support a custom compartments, we will now
look for the `http://ibm.com/fhir/extension/custom-compartment-type`
extension on this element (when it has no value).

Additionally, I created a constant in fhir-core FHIRConstants for our
base extension url and I updated all the different places we have
extension urls to use it.

Finally, I included a couple extra changes that I had sitting around for
the FHIR Registry. If desired, I can split these out into a separate PR.

Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com>
lmsurpre added a commit that referenced this issue May 28, 2021
The CompartmentDefinition resource has a required binding to a fixed
list of compartment types. To support a custom compartments, we will now
look for the `http://ibm.com/fhir/extension/custom-compartment-type`
extension on this element (when it has no value).

Additionally, I created a constant in fhir-core FHIRConstants for our
base extension url and I updated all the different places we have
extension urls to use it.

Finally, I included a couple extra changes that I had sitting around for
the FHIR Registry. If desired, I can split these out into a separate PR.

Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com>
lmsurpre added a commit that referenced this issue May 28, 2021
The CompartmentDefinition resource has a required binding to a fixed
list of compartment types. To support a custom compartments, we will now
look for the `http://ibm.com/fhir/extension/custom-compartment-type`
extension on this element (when it has no value).

Additionally, I created a constant in fhir-core FHIRConstants for our
base extension url and I updated all the different places we have
extension urls to use it.

Finally, I included a couple extra changes that I had sitting around for
the FHIR Registry. If desired, I can split these out into a separate PR.

Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com>
lmsurpre added a commit that referenced this issue May 28, 2021
The CompartmentDefinition resource has a required binding to a fixed
list of compartment types. To support a custom compartments, we will now
look for the `http://ibm.com/fhir/extension/custom-compartment-type`
extension on this element (when it has no value).

Additionally, I created a constant in fhir-core FHIRConstants for our
base extension url and I updated all the different places we have
extension urls to use it.

Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com>
lmsurpre added a commit that referenced this issue Jun 1, 2021
The CompartmentDefinition resource has a required binding to a fixed
list of compartment types. To support a custom compartments, we will now
look for the `http://ibm.com/fhir/extension/custom-compartment-type`
extension on this element (when it has no value).

Additionally, I created a constant in fhir-core FHIRConstants for our
base extension url and I updated all the different places we have
extension urls to use it.

Finally, I included a couple extra changes that I had sitting around for
the FHIR Registry. If desired, I can split these out into a separate PR.

Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com>
@lmsurpre
Copy link
Member Author

lmsurpre commented Jun 4, 2021

I found that the CompartmentDefinition.code has a required binding of Patient | Encounter | RelatedPerson | Practitioner | Device.
Therefor, to enable custom compartment definitions, I introduced a special extension with a url of http://ibm.com/fhir/extension/custom-compartment-type.

Using this extension, I registered a new compartment definition for "DrugPlan" as follows:

[{
    "resourceType": "CompartmentDefinition",
    "url": "http://ibm.com/health-interop/fhir/CompartmentDefinition/drugPlanCompartment",
    "name": "DrugPlan",
    "status": "draft",
    "_code": {
        "extension": [
            {
                "url": "http://terminology.hl7.org/CodeSystem/data-absent-reason",
                "valueCode": "not-permitted"
            },
            {
                "url": "http://ibm.com/fhir/extension/custom-compartment-type",
                "valueCode": "DrugPlan"
            }
        ]
    },
    "search": false,
    "resource": [
        {
            "code": "List",
            "param": [
                "planid"
            ]
        },
        {
            "code": "MedicationKnowledge",
            "param": [
                "DrugPlan"
            ]
        }
    ]
}]

With this CompartmentDefinition and the corresponding search parameter available in the registry, I can now perform compartment searches like GET [base]/DrugPlan/123/List or GET [base]/DrugPlan/123/MedicationKnowledge and the results appear as expected.
Additionally, it becomes possible to scope a request to more than one drugplan via persistence interceptor.

lmsurpre added a commit that referenced this issue Jun 4, 2021
Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com>
lmsurpre added a commit that referenced this issue Jun 4, 2021
Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com>
lmsurpre added a commit that referenced this issue Jun 4, 2021
Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com>
@lmsurpre
Copy link
Member Author

lmsurpre commented Jun 4, 2021

added very basic documentation at #2469
calling this one good

@lmsurpre lmsurpre closed this as completed Jun 4, 2021
tbieste pushed a commit that referenced this issue Jun 9, 2021
The CompartmentDefinition resource has a required binding to a fixed
list of compartment types. To support a custom compartments, we will now
look for the `http://ibm.com/fhir/extension/custom-compartment-type`
extension on this element (when it has no value).

Additionally, I created a constant in fhir-core FHIRConstants for our
base extension url and I updated all the different places we have
extension urls to use it.

Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com>
tbieste pushed a commit that referenced this issue Jun 9, 2021
Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants