API Reference

Overview

Representing a patient’s smoking behavior through the core FHIR Observation Resource.

The profile restricts observation code to be set in 72166-2 Tobacco smoking status NHIS (LOINC).

Each Observation has next elements:

  • a status
  • a category code of ‘social-history’
  • a code for smoking observation
  • a patient
  • a date representing when the smoking status was recorded
  • a result value code for smoking status

Profile specific implementation guidance:

This resource conforms to USCDI V2 profile for Observation - refer to US Core Observation Profile. Observation response will be provided in JSON (refers to Capability Statement) format as per FHIR standard R4 version.

USCore Data ElementFHIR Resource Field
statusObservation.status
codeObservation.code
patientObservation.subject
smoking status recorded dateObservation.effective
valueObservation.value

Must support elements, mandatory and optional search parameters

Observation must support these elements:

  • status
  • Slices for category
    • category:SocialHistory
  • code
  • subject
  • effectiveDateTime
  • valueCodeableConcept

The syntax used to describe the interactions is described here.

The following search parameters and search parameter combinations SHALL be supported:

SHALL support searching for all Observation for a patient using the patient and code search parameters:

  • including optional support for OR search on code (e.g.code={system|}[code],{system|}[code])

GET [base url]/Observation?patient={Type/}[id]&code=http://loinc.org|72166-2

The response to any search operation is always a list of resources in a Bundle or an Operation Outcome.

Observation By Patient Id

Search for Observation by patient.

METHOD GET

[base url]/Observation?patient={Type/}[id]

PARAMS
[base url] - FHIR base url
[id] - Id for the Patient

HEADERS

The Authorization token SHALL be obtained during Authentication and Authorization process. Goto Authentication and Authorization for further details.

HeaderTypeRequired/OptionalValue
Authorizationstringrequired'Bearer'

RESPONSES

CodeDescriptionComment
200OKThe request was processed successfully
400Bad requestInvalid request parameters or FHIR operation outcome resource returned
401UnauthorizedThis code indicates that the client request has not been completed because it lacks valid authentication credentials for the requested resource
404no Route matched with those valuesThe request was able to communicate with a given server, but the server could not find what was requested
500Internal Server ErrorThe server has encountered a situation it doesn't know how to handle

EXAMPLE:

curl --location --request GET 'https://sandbox.fhir.elationemr.com/fhir/Observation?patient=Patient/c5137fa5-3216-b12a-cbbc-a0c6bef361g7' \
--header 'Authorization: Bearer fe1cd986-1ac7-4c26-b8b3-d632a48408fd'

Observation By Id

Get Observation by ID.

METHOD GET

[base url]/Observation/{id}

or

[base url]/Observation?_id={id}

PARAMS
[base url] - FHIR base url
{id} - Id for Observation resource

HEADERS

The Authorization token SHALL be obtained during Authentication and Authorization process. Goto Authentication and Authorization for further details.

HeaderTypeRequired/OptionalValue
Authorizationstringrequired'Bearer'

RESPONSES

CodeDescriptionComment
200OKThe request was processed successfully
400Bad requestInvalid request parameters or FHIR operation outcome resource returned
401UnauthorizedThis code indicates that the client request has not been completed because it lacks valid authentication credentials for the requested resource
404no Route matched with those valuesThe request was able to communicate with a given server, but the server could not find what was requested
500Internal Server ErrorThe server has encountered a situation it doesn't know how to handle

EXAMPLE:

curl --location --request GET 'https://sandbox.fhir.elationemr.com/fhir/Observation/c5137fa5-3216-b12a-cbbc-a0c6bef361g7' \
--header 'Authorization: Bearer fe1cd986-1ac7-4c26-b8b3-d632a48408fd'

Observation by patient and code

Get Observations for the specified patient and code search parameters

METHOD GET

GET [base url]/Observation?patient={Type/}[id]&code=http://loinc.org|72166-2

PARAMS
[base url] - FHIR base url
[id] - patient id
{Type/} - Type for the Reference. Example: Patient

HEADERS

The Authorization token SHALL be obtained during Authentication and Authorization process. Goto Authentication and Authorization for further details.

HeaderTypeRequired/OptionalValue
Authorizationstringrequired'Bearer'

RESPONSES

CodeDescriptionComment
200OKThe request was processed successfully
400Bad requestInvalid request parameters or FHIR operation outcome resource returned
401UnauthorizedThis code indicates that the client request has not been completed because it lacks valid authentication credentials for the requested resource
404no Route matched with those valuesThe request was able to communicate with a given server, but the server could not find what was requested
500Internal Server ErrorThe server has encountered a situation it doesn't know how to handle

EXAMPLE:

curl --location --request GET 'https://sandbox.fhir.elationemr.com/fhir/Observation?patient=Patient/fe1cd986-1ac7-4c26-b8b3-d632a48408fd&code=http://loinc.org|72166-2' \
--header 'Authorization: Bearer 1239b275-909e-4754-8f73-1e411fd6769e'