Which API Request to use for saving patient tolerated high and low heart rate?

Hello everyone,

I need to save patient tolerated high and low (max and min) heart rate values. These values are used to detect heart rate anomaly. These (high/low) values are used later when getting heart rate beats from device.

Which API request to use for storing these type of information?

Best regards,
Ramūnas

There isn’t a great way to capture patient-specific “normal” ranges. You could certainly use Observation, but you’d then need custom code that recognized those Observation.code values to use them in evaluating subsequent heart rates and determining whether they exceeded the bounds or not. Another possibility would be ObservationDefinition with an extension that allowed you to have a patient-specific ObservationDefinition (i.e. with a Reference to the relevant Patient), thus allowing you to specify the relevant low, high, critical, etc. values. I’d encourage you to raise this for discussion on chat.fhir.org on the Orders & Observations stream

1 Like

Thanks for answering.

Unfortunately ObservationDefinition do not have possibility to do reference to the relevant Patient as Observation contains subject to establish relation to Patient.

As you mentioned extension started to think extending Patient to support Low & Hight heart rate.

Right. You’d have to add an extension to ObservationDefinition to allow it to reference the Patient it’s associated with. I wouldn’t recommend extending Patient as, in principle, there could be a whole lot of patient-specific normal ranges you might want to capture.

After extending ObservationDefinition with patient reference. Then how later I could do search with patient ID?

As an example now doing search on Observation by setting subject:
{{API_URL}}/Observation?subject=Patient/b72fb2aa-e3d5-4187-8f75-5a690855d5eb

PS: Thanks for the advice not extending Patient for my use case.

You’d have to define a custom search parameter for ObservationDefinition to allow it to be searched by Patient. (I think both the extension and the new search parameter are candidates for inclusion in a future version of the core spec if you care to submit a change request.)

Unfortunately I can not define custom search parameter as it fails with error “forbidden”.

FHIR service running in the AWS environment.

  1. First of all I did create search parameter
  2. Creating ObservationDefinition with Patient ID extension
  3. Enabling custom search parameter (configureSearch). At this step it fails with message Forbidden.
  4. When trying to GET ObservationDefinition (by skipping 3rd step) it fails with 403 error.

I can not found much information how configureSearch parameter should be enabled on FHIR documentation page. Do you know, is here somewhere detailed information how to do it?

1. POST URL: https://my.amazonaws.com/dev/SearchParameter

{
  "resourceType": "SearchParameter",
  "url": "http://hl7.org/fhir/SearchParameter/patient-patientId",
  "base": ["Patient"],
  "code": "patient-id",
  "name": "patient-id",
  "type": "string",
  "expression": "Patient.extension('http://hl7.org/fhir/StructureDefinition/patient-patientId').value.as(String)",
  "status": "active",
  "description": "Search by Patient ID"
}

2. POST URL: https://my.amazonaws.com/dev/ObservationDefinition

{
   "quantitativeDetails":{
      "decimalPrecision":0,
      "unit":{
         "coding":[
            {
               "display":"BPM",
               "system":"http://unitsofmeasure.org",
               "code":"BPM"
            }
         ]
      }
   },
   "preferredReportName":"Heart rate anomaly range",
   "multipleResultsAllowed":false,
   "code":{
      "coding":[
         {
            "system":"http://terminology.hl7.org/CodeSystem/observation-category",
            "code":"vital-signs"
         }
      ]
   },
   "identifier":[
      {
         "value":"heart-rate-anomaly",
         "id":"aa"
      }
   ],
   "permittedDataType":[
      "Quantity"
   ],
   "qualifiedInterval":[
      {
         "range":{
            "low":{
               "code":"{beats}/min",
               "system":"http://unitsofmeasure.org",
               "value":45,
               "unit":"heart beats per minute"
            },
            "high":{
               "code":"{beats}/min",
               "system":"http://unitsofmeasure.org",
               "value":126,
               "unit":"heart beats per minute"
            }
         },
         "category":"reference"
      }
   ],
   "extension":[
      {
         "url":"http://hl7.org/fhir/SearchParameter/patient-patientId",
         "valueString":"Patient/b72fb2aa-e3d5-4187-8f75-5a690855d5eb"
      }
   ],
   "resourceType":"ObservationDefinition"
}

3. POST URL: https://my.amazonaws.com/dev:configureSearch

{
   "canonicalUrls":[
      "http://hl7.org/fhir/SearchParameter/patient-patientId"
   ]
}

4. GET URL: https://my.amazonaws.com/ObservationDefinition?patient-id:exact=Patient/b72fb2aa-e3d5-4187-8f75-5a690855d5eb

Response Error:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<HTML>
   <HEAD>
      <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
      <TITLE>ERROR: The request could not be satisfied</TITLE>
   </HEAD>
   <BODY>
      <H1>403 ERROR</H1>
      <H2>The request could not be satisfied.</H2>
      <HR noshade size="1px">
      Bad request.
      We can't connect to the server for this app or website at this time. There might be too much traffic or a
      configuration error. Try again later, or contact the app or website owner.
      <BR clear="all">
      If you provide content to customers through CloudFront, you can find steps to troubleshoot and help prevent this error by reviewing the CloudFront documentation.
      <BR clear="all">
      <HR noshade size="1px">
      <PRE>
Generated by cloudfront (CloudFront)
Request ID: xjXc6lKISDV37YezZFAqCW_eB5kfN3odB5lEiARCiRTgTVup7b5nRg==
</PRE>
      <ADDRESS>
      </ADDRESS>
   </BODY>
</HTML>

I would have expected the extension to be an extension on the ObservationDefinition and the SearchParameter to also be defined against ObservationDefinition. That said, I don’t know what sorts of SearchParameters AWS knows how to support automatically.

From your response I have got an understanding, that I am trying to accomplish not in the way you are thinking. Is it right?

If yes, then could you please post some reference or small description how it should be done.

Are you using ObservationDefinition or are you putting extensions on Patient? The examples you posted seem to suggest the latter. I’d proposed the former.

I am adding extension to ObservationDefinition like this:

But you’ve defined your search parameter as having a base of Patient and a context of Patient.extension, not ObservationDefinition.extension.

Thanks for pointing to the problem. I changed expression from Patient to ObservationDefinition. But still having same forbidden error. To day I will contact AWS support.