Gonzalo
12/18/2025, 3:33 PM{
"resourceType": "OperationOutcome",
"issue": [
{
"severity": "error",
"code": "invalid",
"details": {
"text": "Incorrect resource type: expected $my-custom-operation, but found <EMPTY>"
}
}
]
}
Which doesn't [match the condition](https://github.com/medplum/medplum/blob/main/packages/server/src/fhir/routes.ts#L439-L444) to try the custom operation.
Is this a known issue?finnbergquist
12/18/2025, 7:54 PMfinnbergquist
12/18/2025, 7:55 PM$my-custom-operation should beGonzalo
12/19/2025, 10:22 AMOperationDefinition with the following body:
{
"resourceType": "OperationDefinition",
"code": "my-custom-operation",
"name": "my-custom-operation",
"kind": "operation",
"system": true,
"type": false,
"instance": false,
"status": "active",
"extension": [
{
"url": "https://medplum.com/fhir/StructureDefinition/operationDefinition-implementation",
"valueReference": {
"reference": "Bot/80935fcc-9c24-4e3c-9851-8cce613f71ca"
}
}
]
}
If I then try to exectute the operation with a POST /fhir/R4/$my-custom-operation I get a Bad Request with:
{
"resourceType": "OperationOutcome",
"issue": [
{
"severity": "error",
"code": "invalid",
"details": {
"text": "Incorrect resource type: expected $my-custom-operation, but found <EMPTY>"
}
}
],
"extension": [
{
"url": "https://medplum.com/fhir/StructureDefinition/tracing",
"extension": [
{
"url": "requestId",
"valueId": "605722d4-4890-4530-a1a0-d44b698b9d68"
},
{
"url": "traceId",
"valueId": "bc8aa396-b1a1-45db-8355-5d3165e98b76"
}
]
}
]
}Gonzalo
12/22/2025, 11:39 AMreshma
12/22/2025, 10:20 PMGonzalo
01/05/2026, 10:05 AM/$my-custom-operation, what would be the base resource in that case @reshma ?finnbergquist
01/05/2026, 10:33 PMGonzalo
01/06/2026, 9:50 AMfinnbergquist
01/06/2026, 5:49 PMtype level operation,Gonzalo
01/06/2026, 5:54 PMfinnbergquist
01/06/2026, 6:02 PMnathan-watkins-unityai
01/09/2026, 4:13 PMGonzalo
01/13/2026, 2:13 PMGonzalo
01/22/2026, 2:27 PMnathan-watkins-unityai
01/22/2026, 2:47 PMnotFound like I had) but looking forward to system level operations!