Skip to main content
Get event log entries for the patient with optional time, type, trace, and JMESPath projection filters.

Parameters

ParameterRequiredTypeDescription
patient_idYesstringPatient user ID
date_fromNostring (ISO 8601)Inclusive lower bound on EventLog.timestamp. Date-only values (e.g. "2018-07-01") are localized to start-of-day in timezone before converting to UTC.
date_toNostring (ISO 8601)Inclusive upper bound on EventLog.timestamp. Date-only values are treated as end-of-day in timezone.
timezoneNostring (IANA)Timezone for resolving date-only date_from / date_to (default: "America/New_York"). Full ISO timestamps with a time component are honored verbatim.
limitNointegerMaximum number of logs to return (max 200, default: 50)
sortNo"desc" or "asc"Timestamp sort order (default: "desc", newest first; use "asc" when scanning from the start of an observation window).
log_typesNoarrayOptional list of EventLog.type values to filter by
trace_typeNostringFilter by trace.object_type (e.g. "check_in_response")
trace_idNostringFilter by trace.object_id (opaque id string)
queryNostring (JMESPath)JMESPath expression applied server-side to the serialized logs array. The expression root is the list of log entries. List results replace logs; non-list results (e.g. length([])) appear under result. Use to project only the payload fields you need; see examples below.
formatNo"raw" or "markdown"Output format (default: raw). "pretty" is accepted as a deprecated alias for "markdown".

query examples

# Extract only the Chief Complaint section from clinical notes (drops Medications / HPI / Social History)
[*].{timestamp: timestamp, complaint: payload.sections[?section_label == 'Chief Complaint'] | [0].content}

# Filter to notes and extract Assessment And Plan only
[?type == 'clinical_note'].{timestamp: timestamp, plan: payload.sections[?section_label == 'Assessment And Plan'] | [0].content}

# Project the first lab result per entry
[*].{timestamp: timestamp, test_name: payload.results[0].test_name, value: payload.results[0].value_numeric, unit: payload.results[0].unit}

# Count procedures by name (case-insensitive; see note below)
length([?icontains(payload.procedure_name, 'chemotherapy')])
clinical_note payloads include Medications, History Of Present Illness, and Social History sections that are typically 200–700 characters each and nearly identical across notes. Always pass a query that projects only the sections you need when fetching clinical notes; this can reduce response size by 80–95%.
Case-insensitive matching: the built-in JMESPath contains() is case-sensitive. Because clinical entity names are typically Title-Case (e.g. "Chemotherapy (procedure)"), the server also provides three custom functions in query expressions: lower(str), upper(str), and icontains(haystack, needle): a case-insensitive, null-safe substring test. Prefer icontains(field, 'value') (or contains(lower(field), 'value')) for any name/text filter. These functions are available on both get_logs and get_view_block queries.

Example output

Illustrative: format: raw returns structured records in the logs array; a query replaces logs with the projected result.
{
  "count": 1,
  "logs": [
    {
      "type": "symptom_report",
      "timestamp": "2026-03-18T09:00:00Z",
      "payload": {
        "instrument": "esas_r",
        "symptoms": [{ "name": "fatigue", "score": 6 }]
      }
    }
  ]
}