microsoft / microsoft/fhir-server

The "Citation" resource have no search parameters in FHIR R5

Open
#2,762 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Bug Specification VSTS-Backlog
Dominant language
TSQL
Stars
1.4k
Forks
592
Avg merge
2d 7h
Merged PRs (30d)
41

Description

**Describe the bug**
When getting [Citation](https://hl7.org/fhir/5.0.0-snapshot1/citation.html#resource) resource from the deployed or local running R5 fhir server, the common search parameters like "**_lastUpdated**" is not supported.

**FHIR Version?**
R5

**Data provider?**
CosmosDB

**To Reproduce**
Steps to reproduce the behavior:
1. Deploy or locally run a R5 fhir server.
2. Send the http request like
```https://localhost:44348/Citation?_lastUpdated=ge1970-01-01&_sort=_lastUpdated```

**Expected behavior**
The **Citation** resources.

**Actual behavior**
The fhir server response indicates that "**_lastUpdated**" is not supported, but this parameters is common basic search parameters according to fhir definition.
```Json
"issue": [
{
"severity": "warning",
"code": "not-supported",
"diagnostics": "The search parameter '_lastUpdated' is not supported for resource type 'Citation'."
},
{
"severity": "warning",
"code": "not-supported",
"diagnostics": "Sort parameter value '_lastUpdated' is invalid, must be a subset of valid search parameters for resource type 'Citation'."
}
]
```

**Other**
From the codes, seems ```VersionSpecificModelInfoProvider``` deliberately removed **Citation** from supported resources in [line 54](https://github.com/microsoft/fhir-server/blob/main/src/Microsoft.Health.Fhir.Shared.Core/VersionSpecificModelInfoProvider.cs#L54) when building search parameters definition for resources.

```CSharp
public IReadOnlyCollection GetResourceTypeNames()
{
List supportedResources = ModelInfo.SupportedResources;

if (Version == FhirSpecification.R5)
{
supportedResources = supportedResources.Where(x => x != "CanonicalResource" && x != "MetadataResource" && x != "Citation").ToList();
}

return supportedResources;
}
```

[AB#94600](https://microsofthealth.visualstudio.com/f8da5110-49b1-4e9f-9022-2f58b6124ff9/_workitems/edit/94600)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in src/Microsoft.Health.Fhir.Shared.Core/VersionSpecificModelInfoProvider.cs, especially GetResourceTypeNames and the R5 filtering shown in the issue. Reproduce the Citation request with _lastUpdated and _sort, then verify that Citation is included in the supported search-parameter definitions and both parameters are accepted.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
api, backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.