---
title: "Compare one measurement between two periods (beta)"
method: POST
path: "/v1/patients/{patient_id}/patterns/compare"
tags: ["REST v1"]
---

# Compare one measurement between two periods (beta)

`POST /v1/patients/{patient_id}/patterns/compare`

## Request

- Base URL: `https://platform.anpheros.com`
- URL: `https://platform.anpheros.com/v1/patients/{patient_id}/patterns/compare`
- 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`)

Daily medians of the second period against the first (Mann–Whitney, or a seeded permutation test with repeated
values). One test only: q = p. The periods must not overlap and each may span at most 730 days.

## Path parameters

- `patient_id` string, required

## Headers

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

## Response `200`

Successful Response

- PatternCompareOut
  - `finding` PatternFinding: O constatare: ce arată dosarul pe o perioadă, cu datele suport, metoda și limitările ei. Nu e diagnostic; o asociere nu e o cauză; doar `statistically_supported = true` are susținere statistică.
    - `id` string, required
    - `patient` string, required
    - `type` 'trend' | 'baseline_deviation' | 'recurrence' | 'association' | 'convergence', required
    - `subtype` string, nullable
    - `epistemic_status` 'descriptive_observation' | 'statistical_association' | 'validated_prediction', required
    - `strength` 'strong' | 'moderate' | 'weak' | 'not_tested', required
    - `statistically_supported` boolean, required
    - `summary_code` string, required
    - `summary_text` string, required
    - `variables` object[], required
    - `window` object, required
    - `comparison_window` object, nullable
    - `result` object, required
    - `statistics` object, nullable
    - `threshold` object, nullable
    - `evidence` object[], required
    - `evidence_total` integer, required
    - `limitations` object[], required
    - `method` object, required
    - `engine_version` string, required
    - `input_fingerprint` string, required
    - `config_fingerprint` string, required
    - `safety` object, required
    - `review` object, required
  - `not_computed` PatternNotComputed: Ce nu s-a putut calcula și de ce (date insuficiente, fără variație…): nu e o constatare.
    - `type` string, required
    - `variables` object[], required
    - `window` object, required
    - `reason` string, required
    - `detail` string
  - `omitted` string[]
  - `interpretation_guidance` string, required

## 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)
