microsoft / microsoft/fhir-server
Searching by identifier in a coding system with the :of-type modifier does not work
- Dominant language
- TSQL
- Stars
- 1.4k
- Forks
- 592
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 41
Description
**Describe the bug**
Searching for a patient by Identifier, using the of-type modifier presents the error: Only one token separator can be specified. This is necessary for Brazilian Documents, as the current profile does not specify a System for Brazilian Documents (RG and CPF)
Per the specification (https://www.hl7.org/fhir/search.html):
> :of-type | The search parameter has the format system\|code\|value, where the system and code refer to a Identifier.type.coding.system and .code, and match if any of the type codes match. **All 3 parts must be present**
**FHIR Version?**
R4
**Data provider?**
CosmosDB
**To Reproduce**
Steps to reproduce the behavior:
1. Insert a patient with value:
```
{
"resourceType": "Patient",
"identifier": [
{
"type": {
"coding": [
{
"system": "http://terminology.hl7.org/CodeSystem/v2-0203",
"code": "RRI",
"display": "RG"
}
],
"text": "RG"
},
"value": "1234"
}
]
}
```
2. Search using the URL: `https://xxxx.azurehealthcareapis.com/Patient?identifier:ofType=http://terminology.hl7.org/CodeSystem/v2-0203|RRI|1234`
**Expected behavior**
Patient should be returned.
**Actual behavior**
Error returned:
```
{
"resourceType": "OperationOutcome",
"id": "c3ce4e2e95f07948b6a6002f0dd20816",
"issue": [
{
"severity": "error",
"code": "structure",
"diagnostics": "Only one token separator can be specified."
}
]
}
```
Contributor guide
Research direction
Start by reproducing the R4 Patient search against CosmosDB with the provided :of-type URL and identifier data, then review closed pull request #2149 for prior context. Done means the three-part system|code|value query returns the patient without the token-separator error.
Written by the indexing model from the issue text.
Assessment
- Domain
- api, backend, search
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100