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 _text and _content common search parameter #481

Open
albertwang-ibm opened this issue Dec 5, 2019 · 7 comments
Open

support _text and _content common search parameter #481

albertwang-ibm opened this issue Dec 5, 2019 · 7 comments
Labels
enhancement New feature or request

Comments

@albertwang-ibm
Copy link
Contributor

albertwang-ibm commented Dec 5, 2019

This task would require large architectural changes.
Currently the resource text is stored in Gzipped BLOB columns.

To use DB2 full text search I think we'd need to use CLOBS.
A better option might be to store the resource text (and narrative text) in Elastic/SOLR or similar.

_content is a common search parameter for all resource types:
id: Resource-content
description: Search on the entire content of the resource
type: string

https://www.hl7.org/fhir/searchparameter-registry.html#common

@albertwang-ibm albertwang-ibm added the enhancement New feature or request label Dec 5, 2019
@prb112
Copy link
Contributor

prb112 commented Dec 5, 2019

This issue is also in our internal repo. Please make sure to close that one and mark it as migrated.

@lmsurpre lmsurpre changed the title support _content common search parameter support _text and _content common search parameter Jan 7, 2020
@gorkemerdogann
Copy link

Do you think add that parameters to this repository?

@prb112
Copy link
Contributor

prb112 commented Mar 12, 2020

Do you think add that parameters to this repository?

@gorkemerdogann The _text and _content parameters require a fairly complicated architecture. Could you elaborate on your use case?

@gorkemerdogann
Copy link

@prb112 Absolutely, they needs very complicated architecture and much more work. For an use case example: I want to search identifier or name property in patient resource with only one parameter(_text). When I pass _text parameter to server, the server can returns records which has the searched value in identifier or name field.

@prb112
Copy link
Contributor

prb112 commented Mar 13, 2020

@prb112 Absolutely, they needs very complicated architecture and much more work. For an use case example: I want to search identifier or name property in patient resource with only one parameter(_text). When I pass _text parameter to server, the server can returns records which has the searched value in identifier or name field.

Hi @gorkemerdogann what type of identifier and do you have an example resource? are you looking for something in natural language text or a fixed value type? we may be able to accomplish your request without a sophisticated _text or _content solution.

@gorkemerdogann
Copy link

Hello @prb112 thank you for your response. I'm looking fixed value type in identifier. I'm providing example resource below. I wrote <SEARCH> keywords in fields that the server has to search in example resource.

{
  "resourceType": "Patient",
  "identifier": [
    {
      "type": {
        "coding": [
          {
            "system": "http://terminology.hl7.org/CodeSystem/v2-0203",
            "code": "PPN",
            "display": "Passport Number"
          }
        ],
        "text": "Passport Number"
      },
      "system": "http://standardhealthrecord.org/fhir/StructureDefinition/passportNumber",
      "value": "<SEARCH>"
    },
    {
      "type": {
        "coding": [
          {
            "system": "http://terminology.hl7.org/CodeSystem/v2-0203",
            "code": "MR",
            "display": "Medical Record Number"
          }
        ],
        "text": "Medical Record Number"
      },
      "system": "http://hospital.smarthealthit.org",
      "value": "<SEARCH>"
    }
  ],
  "name": [
    {
      "use": "official",
      "family": "<SEARCH>",
      "given": [
        "<SEARCH>"
      ],
      "prefix": [
        "Mr."
      ]
    }
  ]
...
}

@prb112
Copy link
Contributor

prb112 commented Mar 16, 2020

While the feature does not yet exist, there may be another way to accomplish this task.

The IBM FHIR Server has a feature for Search Parameter Extensions. These extensions take FHIRPath expressions as part of the extraction routine. For example, the configuration for the my-boolean parameter is:

{
    "resourceType": "Bundle",
    "type": "collection",
    "entry": [{
        "fullUrl": "http://ibm.com/fhir/SearchParameter/Basic-boolean",
        "resource": {
            "resourceType": "SearchParameter",
            "id": "Basic-boolean",
            "url": "http://ibm.com/fhir/SearchParameter/Basic-boolean",
            "name": "my-boolean",
            "status": "active",
            "description": "test param",
            "code": "my-boolean",
            "base": ["Basic"],
            "type": "token",
            "expression": "Basic.extension.where(url='http://example.org/boolean').value",
            "xpath": "f:Basic/f:extension[@url='http://example.org/boolean']/f:valueBoolean",
            "xpathUsage": "normal"
        }
    }]
}

You may be able to add a extension-search-parameters.json with a custom FHIR Path Patient.name.given and the combine function to extract all of the search parameters.

As a user, you would be able to execute a contains search
[base]/Patient?my-custom:contains=IDENTIFIER

I have not tested this approach, but it should work

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

3 participants