---
title: "Import a lab report (CSV, HL7 v2 ORU^R01 or JSON) as laboratory Observations"
method: POST
path: "/v1/patients/{patient_id}/labs/import"
tags: ["REST v1"]
---

# Import a lab report (CSV, HL7 v2 ORU^R01 or JSON) as laboratory Observations

`POST /v1/patients/{patient_id}/labs/import`

## Request

- Base URL: `https://platform.anpheros.com`
- URL: `https://platform.anpheros.com/v1/patients/{patient_id}/labs/import`
- Auth: one of:
  - HTTP bearer
  - API key in header `X-Api-Key`
  - OAuth 2 (authorization code, authorization URL `https://platform.anpheros.com/oauth/authorize`, token URL `https://platform.anpheros.com/oauth/token`; client credentials, token URL `https://platform.anpheros.com/oauth/token`, scopes: `patient/*.rs`, `patient/Observation.rs`, `patient/Observation.rs?category=laboratory`, `patient/Condition.rs`, `patient/MedicationStatement.rs`, `patient/DocumentReference.rs`, `patient/AllergyIntolerance.rs`, `offline_access`, `openid`, `fhirUser`, `anpheros/patterns`)

Un buletin întreg într-o singură cerere: fiecare rând devine un Observation de
laborator (LOINC unde îl recunoaștem, altfel codul laboratorului + textul de pe buletin),
cu interval de referință și interpretare. Rândurile deja importate (același buletin,
marker, dată și valoare) sunt sărite, deci retrimiterea e sigură.

## Path parameters

- `patient_id` string, required

## Query parameters

- `date` string, nullable: Default date (ISO) for rows without one

## Headers

- `Idempotency-Key` string, nullable
- `X-Anpheros-Source-System` string, nullable
- `authorization` string, nullable
- `X-Api-Key` string, nullable
- `X-Anpheros-Acting-As` string, nullable
- `X-Anpheros-On-Behalf-Of` string, nullable

## Response `201`

Successful Response

- LabsImportOut
  - `created` integer, required
  - `skipped` integer, required
  - `unmapped` unknown[], required
    - unknown
  - `warnings` string[], required
  - `observations` unknown[], required
    - unknown

## Other responses

- `401`: Missing, invalid, expired or revoked credential (`WWW-Authenticate: Bearer`).
- `403`: The credential's scope or the patient's consent does not allow this.
- `422`: Validation Error
- `429`: Rate limit exceeded; wait `Retry-After` seconds.

---

[API](https://skmtc.dev/anpheros/apis/anpheros-platform.md) · [All operations](https://skmtc.dev/anpheros/apis/anpheros-platform/llms.txt) · [OpenAPI document](https://skmtc.dev/anpheros/apis/anpheros-platform/revisions/ff567b232dc3?raw)
