# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.20.1] - 2026-06-01

### Changed

- **Patient** -- `POST /patients` (create-or-update) no longer matches an existing patient by `externalId`. A patient is now considered existing only by social security number or by the combination of `firstName` + `lastName` + `dateOfBirth`. The `externalId` is still stored but never decides create-vs-update, because some source systems reassign external folder numbers and a reused `externalId` previously overwrote an unrelated patient's record. A reused `externalId` now creates a new patient.


## [1.20.0] - 2026-06-01

### Added

- **Patient** -- New optional field `socialSecurityNumber` (French NIR, 15 characters, nullable) on patient resources, with strict control-key validation (requests with an invalid checksum are rejected). The NIR is used as a high-priority deduplication key when creating or updating patients (server-side; it is not exposed as a public query filter).
- **Client** -- OAuth client schema (embedded in public resources) now exposes four targeting fields: `systems` (array of `mac` / `windows` / `web`), `countries` (ISO 3166-1 alpha-2 codes), `specialties` (medical specialty enums), `clientTypes` (`business_software`, `productivity`). Used by app catalogs like Askara Hub to filter visible apps per platform.


## [1.11.0] - 2026-05-06

### Added

- **Document** -- New value `intervention_report` in the `document.type` enum, used for the new "Compte-rendu d'intervention" document type covering the broad spectrum of clinical interventions (extraction, treatment, follow-up, surgical procedures).


### Changed

- **Document** -- The user-facing label of the `operative_report` document type was renamed from "Compte-rendu opératoire" to "Compte-rendu de pose d'implant" in all locales. The enum value (`operative_report`) and the API contract are unchanged — this is a label-only change visible to users in the application UI. Any client displaying this label from translations should refresh its translation bundle.


## [1.4.0] - 2026-04-07

### Added

- **User** -- New fields `professionCode` (nullable string) and `professionLabel` (nullable string) on user profile, sourced from PSC (Pro Santé Connect) identity provider.
- **Patient** -- New filter parameters `finess` and `finess[]` on `GET /patients` for FINESS establishment filtering.


### Changed

- **User** -- RPPS validation relaxed from strict 11-digit numeric (`^\d{11}$`) to flexible alphanumeric (`^[A-Za-z0-9]+$`, maxLength: 20) to support international practitioner identifiers.
- **User** -- Fields `gender` and `phone` are no longer required on the user profile.


## [1.3.0] - 2026-03-30

*No public API changes. Internal-only: added `write:sts_tokens` OAuth scope for Electron STS token management.*

## [1.2.0] - 2026-03-30

### Added

- **Audio** -- New filter parameter `exists[meeting]` on `GET /audios` to filter audios by meeting association.
- **Patient** -- New filter parameter `exists[meeting]` on `GET /patients`.
- **Document** -- New filter parameter `exists[meeting]` on `GET /documents`.


## [1.1.0] - 2026-02-24

### Added

- **Note** -- New read-only resource with two endpoints: retrieve a collection of notes (`GET /notes`) and retrieve a single note (`GET /notes/{uuid}`). Filterable by uuid, type, patient, audio, createdAt, updatedAt. Sortable by uuid, type, createdAt, updatedAt. Scope: `read:notes`.


### Removed

- **Audio** -- Removed filter parameters `summary` and `summary[]` from `GET /audios`.


## [1.0.0] - 2025-04-29

### Added

#### Askara API Reference (`api.askara.ai`)

- Published the OpenAPI 3.1.0 specification for the Askara public API with OAuth2 authorization code security scheme.
- **Audio** -- Endpoints to retrieve a collection of audios and retrieve a single audio by UUID (read-only). Supports pagination, ordering, text search, and patient expand filters.
- **Contact** -- Endpoints to list, create, retrieve, and update contacts. Supports pagination, ordering, text search, and archive filtering.
- **Document** -- Endpoints to list documents, retrieve a single document, and set a document synchronization status. Supports filtering by synchronization state for integration workflows.
- **Organization** -- Endpoints to list organizations and retrieve a single organization by UUID (read-only).
- **Patient** -- Endpoints to list, create or update (upsert), retrieve, and patch patients. Supports pagination, ordering, text search, external ID matching, and archive filtering.
- **User** -- Endpoints to retrieve the current authenticated user (`/me`) and retrieve a user by UUID (read-only).
- **Webhook** -- Endpoints to list, create, retrieve, update, and delete webhooks for event-driven integrations.


#### SpeechToText API Reference (`stt.askara.ai/v2`)

- Published the OpenAPI 3.1.0 specification for the Askara SpeechToText API, secured via API key (`X-API-KEY` header).
- **Transcription** -- Asynchronous endpoint to submit an audio file URL for speech-to-text processing with a callback URL for result delivery.