Skip to main content
POST
/
v1
/
analyse
Apply a clinical rule to health records
curl --request POST \
  --url https://core.locusmedical.fr/v1/analyse \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "rule": "<string>",
  "records": [
    {
      "id": "patient-4815",
      "age": 62,
      "conditions": [
        "<string>"
      ],
      "medications": [
        "<string>"
      ],
      "allergies": [
        "<string>"
      ],
      "risk_factors": [
        "<string>"
      ],
      "family_history": [
        "<string>"
      ],
      "recent_labs": [
        {
          "name": "<string>",
          "value": "<string>",
          "measured_at": "2025-11-30"
        }
      ],
      "reason_for_visit": "<string>"
    }
  ],
  "source_ids": []
}
'
{
  "rule": "<string>",
  "compiled_criteria": [
    {
      "id": "<string>",
      "description": "<string>",
      "field": "<string>",
      "op": "<string>",
      "value": "<string>",
      "max_age_days": 123
    }
  ],
  "findings": [
    {
      "record_id": "<string>",
      "matched": true,
      "criteria": [
        {
          "criterion_id": "<string>",
          "met": true,
          "rationale": "<string>"
        }
      ],
      "rationale": "<string>",
      "recommendation": "<string>",
      "sources": [
        {
          "reco_id": 123,
          "reco_title": "<string>",
          "source_name": "<string>",
          "deep_link": "<string>"
        }
      ]
    }
  ],
  "metadata": {}
}

Authorizations

Authorization
string
header
required

Locus API key — paste the raw lsk_… value (no 'Bearer ' prefix).

Body

application/json
rule
string
required

Free-text clinical rule / 'équation type' to apply to each health record.

Minimum string length: 1
Example:

"patient sous anticoagulant oral direct ET fonction rénale (DFG) non contrôlée depuis plus de 6 mois"

records
HealthRecord · object[]
required

Patient health records to scan (inline). Bounded per request.

Minimum array length: 1
source_ids
integer[] | null

Optional allow-list of source ids for the recommendation step. Omit (the default) to draw on all sources.

Example:
[]

Response

Successful Response

rule
string
required

Echo of the submitted rule.

compiled_criteria
Criterion · object[]
required

The rule, compiled into evaluable criteria.

findings
Finding · object[]
required

One finding per health record, in input order.

metadata
Metadata · object
required

Run metadata: records_scanned, matched_count, processing_ms.