Observations

Observations represent clinical measurements and findings including vital signs, lab results, and other diagnostic data. All observations are stored as FHIR Observation resources.

Endpoints

POST/api/v1/observations/Create an observation
GET/api/v1/observations/List observations
GET/api/v1/observations/{id}/Get observation details
POST/api/v1/vital-signs/Record vital signs
GET/api/v1/vital-signs/List vital signs

The Observation Object

Attributes

iduuid

Unique identifier.

patient_uhidstring

Patient UHID.

encounter_iduuidnullable

Associated encounter ID.

statusstring

Status: registered, preliminary, final, amended.

categorystring

Category: vital-signs, laboratory, imaging, etc.

codestring

LOINC or SNOMED code for the observation.

code_displaystring

Human-readable name.

valuenumber|string

Observation value.

unitstringnullable

Unit of measurement.

reference_range_lownumbernullable

Low end of normal range.

reference_range_highnumbernullable

High end of normal range.

interpretationstringnullable

Interpretation: normal, abnormal, critical.

performer_iduuidnullable

Provider who recorded the observation.

effective_datetimedatetime

When the observation was made.

fhir_observation_idstring

FHIR Observation resource ID.

RESPONSE200
{
  "id": "obs-123-456-789",
  "patient_uhid": "UG123456789A",
  "encounter_id": "enc-abc-123",
  "status": "final",
  "category": "vital-signs",
  "code": "8867-4",
  "code_display": "Heart rate",
  "value": 72,
  "unit": "beats/min",
  "reference_range_low": 60,
  "reference_range_high": 100,
  "interpretation": "normal",
  "performer_id": "prov-xyz-789",
  "effective_datetime": "2024-01-15T10:30:00Z",
  "fhir_observation_id": "Observation/fhir-obs-123"
}

Create an Observation

Records a new clinical observation for a patient.

POST/api/v1/observations/

Request Body

patient_uhidstringrequired

Patient UHID

codestringrequired

LOINC or SNOMED code

code_displaystringrequired

Human-readable name

valuenumber|stringrequired

Observation value

unitstringoptional

Unit of measurement

categorystringoptional

Category

Default: vital-signs

encounter_iduuidoptional

Associated encounter

reference_range_lownumberoptional

Normal range low

reference_range_highnumberoptional

Normal range high

interpretationstringoptional

Interpretation code

effective_datetimedatetimeoptional

When observed

Request
bash
curl -X POST https://api.mediloop.co/api/v1/observations/ \
  -H "Authorization: Bearer sk_test_..." \
  -H "Content-Type: application/json" \
  -d '{
    "patient_uhid": "UG123456789A",
    "code": "8867-4",
    "code_display": "Heart rate",
    "value": 72,
    "unit": "beats/min",
    "category": "vital-signs",
    "encounter_id": "enc-abc-123",
    "reference_range_low": 60,
    "reference_range_high": 100
  }'
RESPONSE201
{
  "id": "obs-new-123",
  "patient_uhid": "UG123456789A",
  "status": "final",
  "code": "8867-4",
  "code_display": "Heart rate",
  "value": 72,
  "unit": "beats/min",
  "interpretation": "normal",
  "effective_datetime": "2024-01-15T10:30:00Z"
}

Record Vital Signs

Record multiple vital signs in a single request.

POST/api/v1/vital-signs/
Request
bash
curl -X POST https://api.mediloop.co/api/v1/vital-signs/ \
  -H "Authorization: Bearer sk_test_..." \
  -H "Content-Type: application/json" \
  -d '{
    "patient_uhid": "UG123456789A",
    "encounter_id": "enc-abc-123",
    "vitals": {
      "heart_rate": 72,
      "blood_pressure_systolic": 120,
      "blood_pressure_diastolic": 80,
      "temperature": 36.8,
      "respiratory_rate": 16,
      "oxygen_saturation": 98,
      "weight": 70,
      "height": 175
    }
  }'
RESPONSE201
{
  "success": true,
  "patient_uhid": "UG123456789A",
  "observations_created": 8,
  "observation_ids": [
    "obs-hr-001",
    "obs-bp-sys-001",
    "obs-bp-dia-001",
    "obs-temp-001",
    "obs-rr-001",
    "obs-spo2-001",
    "obs-wt-001",
    "obs-ht-001"
  ]
}

List Observations

Retrieve observations with filtering options.

GET/api/v1/observations/

Query Parameters

patient_uhidstringoptional

Filter by patient

encounter_iduuidoptional

Filter by encounter

categorystringoptional

Filter by category

codestringoptional

Filter by LOINC code

date_fromdateoptional

Filter from date

date_todateoptional

Filter to date

Request
bash
curl "https://api.mediloop.co/api/v1/observations/?patient_uhid=UG123456789A&category=vital-signs" \
  -H "Authorization: Bearer sk_test_..."
RESPONSE200
{
  "count": 2,
  "results": [
    {
      "id": "obs-123",
      "code_display": "Heart rate",
      "value": 72,
      "unit": "beats/min",
      "effective_datetime": "2024-01-15T10:30:00Z"
    },
    {
      "id": "obs-124",
      "code_display": "Blood pressure systolic",
      "value": 120,
      "unit": "mmHg",
      "effective_datetime": "2024-01-15T10:30:00Z"
    }
  ]
}

Common LOINC Codes

CodeDisplayUnit
8867-4Heart ratebeats/min
8480-6Systolic blood pressuremmHg
8462-4Diastolic blood pressuremmHg
8310-5Body temperature°C
9279-1Respiratory ratebreaths/min
2708-6Oxygen saturation%
29463-7Body weightkg
8302-2Body heightcm
2339-0Blood glucosemg/dL

Interpretation Codes

CodeDescription
NNormal - within reference range
LLow - below reference range
HHigh - above reference range
LLCritically low
HHCritically high
AAbnormal