Ikara Ikliki · Nov 6, 2019

FHIR Request Resource Id is empty

I am sending a PUT FHIR message for a CodeSystem Resource using the defailt Service and server that was installed when I installed the FHIR on the NameSpace.

When I try to use the FHIR Request "id" property it is empty; e.g. is EMPTY. I really need to get this value, how can I get it?

I added a trace ion both the HS.FHIR.Service and HS.FHIR.Server.Process, details to follow:

The trace in HS.FHIR.Service is as follows, this is inside the OnProcessInput where the Id is validated I added the "else", it prints the line in the "else" and the result is an EMPTY (nothing):

// FHIR resource id specified in the request URL must follow the format rules.
If '##class(HS.FHIR.Utils).IsValidResourceId(pInput.Id) {
Set tStatus = ##class(HS.FHIR.Utils).BadRequest(pInput, .pOutput, "invalid", "Invalid resource id specified: "_pInput.Id)
$$$TRACE("Invalid resource id specified: "_pInput.Id)
else {
$$$TRACE("Valid resource id specified: "_pInput.Id)

Trace in HS.FHIR.Server.Process at the start inside the "Try", and again here pFHIRRequest.Id prints NOTHING:

$$$TRACE("HS.FHIR.Server.Process.ProcessFHIRRequest: pFHIRRequest.Id = "_pFHIRRequest.Id)

0 292
Discussion (3)2
Log in or sign up to continue

The JSON I am using:

  "resourceType" : "CodeSystem",
  "id" : "device-status",
  "meta" : {
    "lastUpdated" : "2019-11-01T09:29:23.356+11:00"
  "text" : {
    "status" : "generated",
    "div" : "<div>!-- Snipped for Brevity --></div>"
  "extension" : [{
    "url" : "",
    "valueCode" : "oo"
    "url" : "",
    "valueCode" : "trial-use"
    "url" : "",
    "valueInteger" : 2
  "url" : "",
  "identifier" : {
    "system" : "urn:ietf:rfc:3986",
    "value" : "urn:oid:2.16.840.1.113883.4.642.4.210"
  "version" : "4.0.1",
  "name" : "FHIRDeviceStatus",
  "title" : "FHIRDeviceStatus",
  "status" : "draft",
  "experimental" : false,
  "date" : "2019-11-01T09:29:23+11:00",
  "publisher" : "HL7 (FHIR Project)",
  "contact" : [{
    "telecom" : [{
      "system" : "url",
      "value" : ""
      "system" : "email",
      "value" : ""
  "description" : "The availability status of the device.",
  "caseSensitive" : true,
  "valueSet" : "",
  "content" : "complete",
  "concept" : [{
    "code" : "active",
    "display" : "Active",
    "definition" : "The device is available for use.  Note: For *implanted devices*  this means that the device is implanted in the patient."
    "code" : "inactive",
    "display" : "Inactive",
    "definition" : "The device is no longer available for use (e.g. lost, expired, damaged).  Note: For *implanted devices*  this means that the device has been removed from the patient."
    "code" : "entered-in-error",
    "display" : "Entered in Error",
    "definition" : "The device was entered in error and voided."
    "code" : "unknown",
    "display" : "Unknown",
    "definition" : "The status of the device has not been determined."

I think I may have possibly answered my own question, the FHIR Request Id shall only be filled out when it is supplied in the URL which is not the case for an update (PUT), but for a request such as GET where the id is part of the URL:


where the Resource id is then 34567.

That implies if I need the Resource Id that is supplied in the JSON "id" field I have to first convert the request payload and de-serialize into the related FHIR resource class and get it then.

Hi Ikara,

Yes, you are correct, for HTTP PUT (FHIR update), the resource id must be specified in the request URL.

Best regards,

Paul Lomayesva

InterSystems Corporation