microsoft / fhir-server

A service that implements the FHIR standard
MIT License
1.2k stars 517 forks source link

Searching by identifier in a coding system with the :of-type modifier does not work #1424

Open andreracz opened 4 years ago

andreracz commented 4 years ago

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."
        }
    ]
}
andreracz commented 4 years ago

If this is a new feature instead of a Bug, the error should state that the of-type modifier is not supported in order to provide better guidance to the users.

CaitlinV39 commented 4 years ago

AB#77327