question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

SearchParameters created with REST API don't work

See original GitHub issue

Describe the bug The server returns the error message Search parameter 'favorite-color' for resource type 'Patient' was not found. after creating the search parameter from the example.

Environment 4.11.1

To Reproduce Steps to reproduce the behavior:

  1. Create the SearchParameter:
POST https://your_fhir_server/api/v4/SearchParameter

{
  "resourceType": "SearchParameter",
  "id": "Patient-favorite-color",
  "url": "http://example.com/fhir/SearchParameter/Patient-favorite-color",
  "version": "4.0.0",
  "name": "favorite-color",
  "status": "draft",
  "experimental": false,
  "date": "2018-12-27T22:37:54+11:00",
  "publisher": "LinuxForHealth FHIR Server Test",
  "contact": [{
    "telecom": [{
      "system": "url",
      "value": "http://linuxforhealth.org"
    }]
  },
  {
    "telecom": [{
      "system": "url",
      "value": "http://linuxforhealth.org"
    }]
  }],
  "description": "the patient's favorite color",
  "code": "favorite-color",
  "base": ["Patient"],
  "type": "string",
  "xpathUsage": "normal",
  "xpath": "f:Patient/f:extension[@url='http://example.com/fhir/extension/Patient/favorite-color']/f:valueString",
  "expression": "Patient.extension.where(url='http://example.com/fhir/extension/Patient/favorite-color').value",
  "multipleOr": true,
  "multipleAnd": true,
  "modifier": []
}
  1. Search with it:
GET https://your_fhir_server/api/v4/Patient?favorite-color:exact=pink

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
renomcommented, Oct 11, 2022

I forgot to wrap the SearchParameter into Bundle inside extension-search-parameters.json. Now it works with extension-search-parameters.json configuration provided.

0reactions
lmsurprecommented, Nov 2, 2022

Glad you got it working with extension-search-parameters.json.

SearchParameter resources from the database should be loaded on server start if you set fhirServer/core/serverRegistryResourceProviderEnabled=true. However, previously ingested resources will need to be reindexed for this new search parameter to take effect. I believe that part is working, but if you find otherwise please open an issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Issue with API url: cannot seem to pass parameters correctly
I have created the url correctly, and if I insert the search parameters directly in the url, when I console log I can...
Read more >
How do searches fit into a RESTful interface?
A client can GET a collection of jobs, using query params to narrow the ... to RESTful and not to ROA, it means...
Read more >
Search REST API Reference - Algolia
Search parameters used to filter the index content. If not specified, all objects are returned. Can only be used on the first call....
Read more >
WordPress REST API: The Next Generation CMS Feature
While WordPress is built on – and will continue to be built on – PHP, the WP REST API is an attempt to...
Read more >
Search Documents (Azure Cognitive Search REST API)
Do not create multiple indexes for each language unless you plan to query one at a time. Paging - Get the first page...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found