Skip to main content
GET
/
v1
/
state
/
{patient_id}
/
views
/
{view_type}
import olira

olira.init(api_key="YOUR_API_KEY")
view = olira.get_view(patient_id="8a4fde23-0f1b-4c2a-9d7e-b36c1a5f0e82", view_type="symptoms")
print(view.content.get("blocks"))
ViewResult(
    patient_id="8a4fde23-0f1b-4c2a-9d7e-b36c1a5f0e82",
    view_type="symptoms",
    view_id="view-1",
    valid_from=None,
    valid_to=None,
    content={"blocks": [{"block_id": "blk-a", "text": "…"}]},
)
olira.get_view(patient_id: str, view_type: str) -> ViewResult
Requires scope: sdk:state-read

Parameters

patient_id
str
required
Olira patient id.
view_type
str
required
View category slug.

Returns

ViewResult
patient_id
str
Patient id.
view_type
str
View slug.
view_id
str | None
View instance id.
valid_from
str | None
Validity window start.
valid_to
str | None
Validity window end.
content
dict[str, Any]
Typically keys blocks (list), temp (optional). Legacy keys may appear.

Raises

ExceptionWhen
AuthErrorHTTP 401 or 403 — invalid API key or insufficient OAuth scope for this endpoint.
ValidationErrorHTTP 400, 404, or 422 — malformed JSON, unknown patient, or validation failure (message includes response excerpt).
ServerErrorHTTP 409 (e.g. conflicting external identifier) or repeated 5xx after retries; includes status_code when applicable.
RateLimitErrorHTTP 429 — rate limited; check retry_after (seconds).
NetworkErrorConnection timeout, DNS failure, or read error after retries.
import olira

olira.init(api_key="YOUR_API_KEY")
view = olira.get_view(patient_id="8a4fde23-0f1b-4c2a-9d7e-b36c1a5f0e82", view_type="symptoms")
print(view.content.get("blocks"))
ViewResult(
    patient_id="8a4fde23-0f1b-4c2a-9d7e-b36c1a5f0e82",
    view_type="symptoms",
    view_id="view-1",
    valid_from=None,
    valid_to=None,
    content={"blocks": [{"block_id": "blk-a", "text": "…"}]},
)