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. pFHIRRequest.id 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 input.id (nothing):
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)
Quit
} 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:
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" : "http://hl7.org/fhir/StructureDefinition/structuredefinition-wg",
"valueCode" : "oo"
},
{
"url" : "http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-st...",
"valueCode" : "trial-use"
},
{
"url" : "http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm",
"valueInteger" : 2
}],
"url" : "http://hl7.org/fhir/device-status-xxx",
"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" : "http://hl7.org/fhir"
},
{
"system" : "email",
"value" : "fhir@lists.hl7.org"
}]
}],
"description" : "The availability status of the device.",
"caseSensitive" : true,
"valueSet" : "http://hl7.org/fhir/ValueSet/device-status",
"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:
http://[base]/Patient/34567
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