[Bug?] Intermittent "Invalid include value 'Encoun...
# support
a
Hey, we've been running into an issue where certain FHIR operations intermittently fail with this error:
Copy code
Invalid include value 'Encounter': must be of the form ResourceType:search-parameter
This happens sporadically across different actions in our app (retrying the request again often works). The affected code isn't interacting with any
Encounter
resource at all. Is anyone else seeing this? Any insight into what might be causing it?
r
Based on the error message, it seems like a syntax error when running an
_include
search. https://www.medplum.com/docs/search/includes#_include-and-_revinclude
If you could share the code you're using to perform the search, we could give some pointers
a
Hi @rahul1, actually our code does not ever use the
_include
parameter. The same code (several different unrelated pieces of code that make calls to
medplum
) that did not generate this error before suddenly began generating this error yesterday.
@rahul1 Something we've just noticed -- we first get an HTTP 400 error:
Copy code
XHRPOST
https://api.medplum.com/fhir/R4/Subscription
[HTTP/2 400  39ms]

{
  "resourceType": "OperationOutcome",
  "issue": [
    {
      "severity": "error",
      "code": "invalid",
      "details": {
        "text": "Invalid include value 'Encounter.subject': must be of the form ResourceType:search-parameter"
      }
    }
  ],
  "extension": [
    {
      "url": "https://medplum.com/fhir/StructureDefinition/tracing",
      "extension": [
        {
          "url": "requestId",
          "valueId": "f04ae746-0726-4ba2-887d-4a7eb7608948"
        },
        {
          "url": "traceId",
          "valueId": "1-67b60539-04acc8ef5a0965a6357fc94d"
        }
      ]
    }
  ]
}
Immediately followed by this error in console:
Copy code
Invalid include value 'Encounter.subject': must be of the form ResourceType:search-parameter <anonymous code>:1:145535
    overrideMethod <anonymous code>:1
    ...
Also, if it's useful context, here is the JSON of the
reqeust
that results in the HTTP 400 error:
Copy code
{
  "resourceType": "Subscription",
  "status": "active",
  "reason": "WebSocket subscription for Practitioner/4afd4fba-bb7c-4f9c-99b4-3682f59b4bcb",
  "criteria": "Communication?recipient=Practitioner/4afd4fba-bb7c-4f9c-99b4-3682f59b4bcb",
  "channel": {
    "type": "websocket"
  }
}
180 Views