Log FHIR resource
Submits a single FHIR R4 resource JSON object.
POST
sdk:event-log
Olira maps it to one or more platform log types via the FHIR absorber (same schema mapper used by Epic/Cerner integrations and Console FHIR upload), then processes each event immediately for the patient — unlike olira.log(), you do not choose log_type or build Olira-shaped payloads yourself. One resource may produce zero events (unsupported type or unmappable fields), one event, or several (e.g. CarePlan). See Supported FHIR resources below for the full resourceType → event type matrix.
Parameters
Olira patient id (from create_patient or your patient registry).
FHIR R4 resource object with resourceType set. Supported types are listed in Supported FHIR resources below (17 resource families, including Observation, Condition, MedicationRequest, Patient, DocumentReference, DiagnosticReport, etc.).
Returns
BatchResult
Number of mapped events processed through patient state.
Number of mapped events skipped or failed.
Mapping or processing errors (e.g. unknown resource fields, replay conflict).
Supported FHIR resources
FHIR resourceType | Olira event type(s) | Notes |
|---|---|---|
Observation | vitals_measurement, lab_results, genomic_variant, clinical_measurement, functional_class, clinical_finding, social_determinants, treatment_response_assessment | Routed by category and LOINC. Vital-signs Observations at the same effectiveDateTime merge into one vitals_measurement when submitted in a multi-entry Bundle; via log_fhir (single resource) each vital-signs Observation is processed alone. |
Patient | demographics | — |
Appointment | care_encounter | — |
Encounter | care_encounter | — |
Condition | condition | — |
MedicationRequest, MedicationStatement, MedicationAdministration | medication_list_update | Medication display/dose resolved from the resource; sibling Medication entries in a Bundle are not visible to log_fhir. |
AllergyIntolerance | allergy_intolerance | — |
CarePlan | clinical_plan_item, treatment_phase | treatment_phase uses a heuristic on plan category/text. |
CareTeam | care_team | — |
DiagnosticReport | lab_results, imaging_result, procedure_result, unstructured_report | Never clinical_note. Panel lab results need referenced Observation resources in the same Bundle; log_fhir cannot resolve result[] references across separate calls. |
DocumentReference | clinical_note, unstructured_report | Inline base64 attachment.data is decoded into note text. attachment.url is not fetched — placeholder text only. |
Procedure | procedure | — |
Immunization | immunization | — |
FamilyMemberHistory | family_history | — |
Goal | care_goal | — |
Coverage | insurance | — |
RelatedPerson | emergency_contact | — |
Per-resource examples
Each call accepts one FHIR resource. Linked resources in the same payload are not resolved together (for example, lab Observations referenced from a DiagnosticReport). Use historical ingestion or an EHR integration when you need multi-resource imports.
Unsupported resource types (zero events accepted): QuestionnaireResponse, ImagingStudy, ServiceRequest, Task, AdverseEvent, Device, EpisodeOfCare, ClinicalImpression, MolecularSequence, and standalone Binary. Support for additional FHIR resource types is added continuously.
Ingested data is stored as Olira event logs (type and payload), not as raw FHIR. Read it back with get_logs() or logs().
Raises
| Exception | When |
|---|---|
AuthError | HTTP 401 or 403 — invalid API key or insufficient OAuth scope for this endpoint. |
ServerError | HTTP 409 (e.g. conflicting external identifier) or repeated 5xx after retries; includes status_code when applicable. |
RateLimitError | HTTP 429 — rate limited; check retry_after (seconds). |
NetworkError | Connection timeout, DNS failure, or read error after retries. |
ValidationError | HTTP 422 — missing resourceType or malformed request. Also raised when the resource maps to zero Olira events (unsupported type, unrecognized fields, or Observation with unrecognized category/LOINC) — the exception message explains why. |

