openapi: 3.1.0
paths:
  /auth/b2b/login:
    post:
      description: |
        This API endpoint logs a user in to a project.

        ## Example cURL request

        ```bash
        curl -X POST \
         --url 'https://api.dev.ovok.com/auth/b2b/login' \
         -H 'Content-Type: application/json' \
         -d '{
            "email": "max.mustermann@example.com",
            "password": "p}mz%#iqsHnP]&#x3D;I9",
            "clientId": "87ea5dfc-8b8e-384d-8489-79496e706390",
            "tenantId": "87ea5dfc-8b8e-384d-8489-79496e706390"
        }'
        ```
      operationId: AuthB2BLoginController_login
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/RequestLoginV2Dto"
      responses:
        "200":
          description: Register response with tokens and IDs.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ResponseRegisterLoginDto"
        "400":
          description: The request could not be operated by the server.
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: number
                    example: 400
                  message:
                    type: string
                  error:
                    type: string
                    example: Bad Request
                required:
                  - statusCode
                  - message
        "401":
          description: The resource owner or authorization server denied the request.
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: number
                    example: 401
                  message:
                    type: string
                  error:
                    type: string
                    example: Unauthorized
                required:
                  - statusCode
                  - message
        "404":
          description: The requested resource could not be found.
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: number
                    example: 404
                  message:
                    type: string
                  error:
                    type: string
                    example: Not Found
                required:
                  - statusCode
                  - message
        "422":
          description: The request could not be validated by the server.
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: number
                    example: 422
                  message:
                    type: string
                  error:
                    type: string
                    example: Unprocessable Entity
                required:
                  - statusCode
                  - message
        "500":
          description: The server encountered an unexpected condition. Please try again
            later.
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: number
                    example: 500
                  message:
                    type: string
                  error:
                    type: string
                    example: Internal Server Error
                required:
                  - statusCode
                  - message
      summary: Login
      tags:
        - Authentication - B2B
  /auth/b2b/register:
    post:
      description: |
        This API endpoint registers a user to a project.

        ## Example cURL request

        ```bash
        curl -X POST \
         --url 'https://api.dev.ovok.com/auth/b2b/register' \
         -H 'Content-Type: application/json' \
         -d '{
            "email": "max.mustermann@example.com",
            "password": "p}mz%#iqsHnP]&#x3D;I9",
            "name": "Max",
            "surname": "Mustermann",
            "tenantId": "87ea5dfc-8b8e-384d-8489-79496e706390",
            "clientId": "87ea5dfc-8b8e-384d-8489-79496e706390"
        }'
        ```
      operationId: AuthB2BRegisterController_register
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/RequestRegisterV2Dto"
      responses:
        "200":
          description: Login response with tokens and IDs.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ResponseRegisterLoginDto"
        "400":
          description: The request could not be operated by the server.
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: number
                    example: 400
                  message:
                    type: string
                  error:
                    type: string
                    example: Bad Request
                required:
                  - statusCode
                  - message
        "401":
          description: The resource owner or authorization server denied the request.
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: number
                    example: 401
                  message:
                    type: string
                  error:
                    type: string
                    example: Unauthorized
                required:
                  - statusCode
                  - message
        "404":
          description: The requested resource could not be found.
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: number
                    example: 404
                  message:
                    type: string
                  error:
                    type: string
                    example: Not Found
                required:
                  - statusCode
                  - message
        "422":
          description: The request could not be validated by the server.
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: number
                    example: 422
                  message:
                    type: string
                  error:
                    type: string
                    example: Unprocessable Entity
                required:
                  - statusCode
                  - message
        "500":
          description: The server encountered an unexpected condition. Please try again
            later.
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: number
                    example: 500
                  message:
                    type: string
                  error:
                    type: string
                    example: Internal Server Error
                required:
                  - statusCode
                  - message
      summary: Register an account
      tags:
        - Authentication - B2B
  /auth/refresh-token:
    post:
      description: >
        By making a POST request to this endpoint you can refresh the access
        token, ensuring uninterrupted access to protected resources.


        ## Example cURL request


        ```bash

        curl -X POST \
         --url 'https://api.dev.ovok.com/auth/refresh-token' \
         -H 'Content-Type: application/json' \
         -d '{
            "refresh_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3MzEzMzY0NDIsImV4cCI6MTczMTM0MDA0Mn0.MQbovtK2tKu8Zj6_7vaqSVXWunIG8-iuwa6JEXCqXAQ"
        }'

        ```
      operationId: AuthController_refreshToken
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/RefreshTokenDto"
      responses:
        "200":
          description: Access token, refresh token and expiration time.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ResponseTokenDto"
        "400": &a1
          description: The request could not be operated by the server.
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: number
                    example: 400
                  message:
                    type: string
                  error:
                    type: string
                    example: Bad Request
                required:
                  - statusCode
                  - message
        "401": &a2
          description: The resource owner or authorization server denied the request.
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: number
                    example: 401
                  message:
                    type: string
                  error:
                    type: string
                    example: Unauthorized
                required:
                  - statusCode
                  - message
        "404": &a3
          description: The requested resource could not be found.
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: number
                    example: 404
                  message:
                    type: string
                  error:
                    type: string
                    example: Not Found
                required:
                  - statusCode
                  - message
        "422": &a4
          description: The request could not be validated by the server.
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: number
                    example: 422
                  message:
                    type: string
                  error:
                    type: string
                    example: Unprocessable Entity
                required:
                  - statusCode
                  - message
        "500": &a5
          description: The server encountered an unexpected condition. Please try again
            later.
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: number
                    example: 500
                  message:
                    type: string
                  error:
                    type: string
                    example: Internal Server Error
                required:
                  - statusCode
                  - message
      summary: Refresh access token
      tags:
        - Authentication
  /v1/auth/logout:
    post:
      description: |
        ## Log out

        Server-side logout — adds the caller's Bearer token to a Redis-backed
        revocation denylist so it cannot be replayed after the user signs out.

        Closes the token-reuse-after-logout gap tracked in
        [carehub-product-roadmap#949](https://github.com/Actimi/carehub-product-roadmap/issues/949).
        Prior to this endpoint, the FE could only clear `localStorage`; the
        token itself stayed cryptographically valid on every API endpoint for
        its natural 60-minute lifetime.

        ## Behaviour

        - **Auth required.** The caller must be authenticated; unauthed callers
          receive `401` via the global `BearerAuthGuard`.
        - **Idempotent.** Repeated calls from the same token return `204` and
          have no additional side-effects.
        - **TTL.** The denylist entry lives for exactly the token's remaining
          lifetime (from the `exp` claim). The denylist cannot grow larger than
          the pool of currently-live tokens.
        - **No response body.** Returns `204 No Content`.

        ## Frontend integration

        Call `POST /v1/auth/logout` before clearing local storage on user-
        initiated logout. After the call succeeds (or fails — a Redis outage
        must not block the UX), also clear the local session state and route
        the user to the sign-in page. The revocation guard on the next authed
        request will surface `401` for any lingering token copy captured via
        XSS, shoulder surfing, or a compromised device.
      operationId: AuthController_logout[0]_v1
      parameters: []
      responses:
        "200":
          description: Token was added to the revocation denylist. Returns 204 No Content.
        "400": *a1
        "401": *a2
        "404": *a3
        "422": *a4
        "500": *a5
      summary: Log out (server-side token revocation)
      tags:
        - Authentication
  /auth/logout:
    post:
      description: |
        ## Log out

        Server-side logout — adds the caller's Bearer token to a Redis-backed
        revocation denylist so it cannot be replayed after the user signs out.

        Closes the token-reuse-after-logout gap tracked in
        [carehub-product-roadmap#949](https://github.com/Actimi/carehub-product-roadmap/issues/949).
        Prior to this endpoint, the FE could only clear `localStorage`; the
        token itself stayed cryptographically valid on every API endpoint for
        its natural 60-minute lifetime.

        ## Behaviour

        - **Auth required.** The caller must be authenticated; unauthed callers
          receive `401` via the global `BearerAuthGuard`.
        - **Idempotent.** Repeated calls from the same token return `204` and
          have no additional side-effects.
        - **TTL.** The denylist entry lives for exactly the token's remaining
          lifetime (from the `exp` claim). The denylist cannot grow larger than
          the pool of currently-live tokens.
        - **No response body.** Returns `204 No Content`.

        ## Frontend integration

        Call `POST /v1/auth/logout` before clearing local storage on user-
        initiated logout. After the call succeeds (or fails — a Redis outage
        must not block the UX), also clear the local session state and route
        the user to the sign-in page. The revocation guard on the next authed
        request will surface `401` for any lingering token copy captured via
        XSS, shoulder surfing, or a compromised device.
      operationId: AuthController_logout[1]
      parameters: []
      responses:
        "200":
          description: Token was added to the revocation denylist. Returns 204 No Content.
        "400": *a1
        "401": *a2
        "404": *a3
        "422": *a4
        "500": *a5
      summary: Log out (server-side token revocation)
      tags:
        - Authentication
  /auth/delete:
    delete:
      description: >
        The Delete User API endpoint schedules user account deletion from the
        Ovok platform to be carried out in 30 days.

        <br>User deletion can be aborted by logging in to the account.


        ## Example cURL request


        ```bash

        curl -X DELETE \
         --url 'https://api.dev.ovok.com/auth/delete' \
         -H 'Authorization: Bearer example.jwt.eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3ODY4OTk5NzcsImV4cCI6MTc4NjkwMzU3N30.sZTke9fx_gPeoj2v-FL9GhDqY0hh9EzdEc4XywFqb84' \
         -H 'Content-Type: application/json' \
         -d '{
            "days": 30,
            "wipe": false
        }'

        ```
      operationId: AuthDeleteController_deleteUser
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/RequestDeleteDto"
      responses:
        "200":
          description: User account deletion confirmation.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ResponseDeleteDto"
        "400":
          description: The request could not be operated by the server.
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: number
                    example: 400
                  message:
                    type: string
                  error:
                    type: string
                    example: Bad Request
                required:
                  - statusCode
                  - message
        "401":
          description: The resource owner or authorization server denied the request.
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: number
                    example: 401
                  message:
                    type: string
                  error:
                    type: string
                    example: Unauthorized
                required:
                  - statusCode
                  - message
        "404":
          description: The requested resource could not be found.
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: number
                    example: 404
                  message:
                    type: string
                  error:
                    type: string
                    example: Not Found
                required:
                  - statusCode
                  - message
        "422":
          description: The request could not be validated by the server.
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: number
                    example: 422
                  message:
                    type: string
                  error:
                    type: string
                    example: Unprocessable Entity
                required:
                  - statusCode
                  - message
        "500":
          description: The server encountered an unexpected condition. Please try again
            later.
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: number
                    example: 500
                  message:
                    type: string
                  error:
                    type: string
                    example: Internal Server Error
                required:
                  - statusCode
                  - message
      security:
        - bearer: []
      summary: Schedule user account deletion
      tags:
        - Authentication
  /v2/auth/login:
    post:
      description: >
        The Login API endpoint facilitates the authentication process, allowing
        users to obtain a JWT (JSON Web Token) for subsequent authorized
        requests.

        <br>This API is crucial for secure access to Ovok services.


        ## Example cURL request


        ```bash

        curl -X POST \
         --url 'https://api.dev.ovok.com/auth/login' \
         -H 'Content-Type: application/json' \
         -d '{
            "email": "john.doe@mail.com",
            "password": "password1234",
            "clientId": "5e505642-9024-474d-9434-e5a44f505cc5"
        }'

        ```
      operationId: AuthLoginController_login_v2
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/LoginDto"
      responses:
        "200":
          description: Access token, refresh token and expiration time.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ResponseRegisterLoginDto"
        "400":
          description: The request could not be operated by the server.
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: number
                    example: 400
                  message:
                    type: string
                  error:
                    type: string
                    example: Bad Request
                required:
                  - statusCode
                  - message
        "401":
          description: The resource owner or authorization server denied the request.
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: number
                    example: 401
                  message:
                    type: string
                  error:
                    type: string
                    example: Unauthorized
                required:
                  - statusCode
                  - message
        "404":
          description: The requested resource could not be found.
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: number
                    example: 404
                  message:
                    type: string
                  error:
                    type: string
                    example: Not Found
                required:
                  - statusCode
                  - message
        "422":
          description: The request could not be validated by the server.
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: number
                    example: 422
                  message:
                    type: string
                  error:
                    type: string
                    example: Unprocessable Entity
                required:
                  - statusCode
                  - message
        "500":
          description: The server encountered an unexpected condition. Please try again
            later.
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: number
                    example: 500
                  message:
                    type: string
                  error:
                    type: string
                    example: Internal Server Error
                required:
                  - statusCode
                  - message
      summary: Login
      tags:
        - Authentication
  /auth/me:
    get:
      description: >
        This API fetches the user profile information.


        ## Example cURL request


        ```bash

        curl -X GET \
         --url 'https://api.dev.ovok.com/auth/me' \
         -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3MzEzMzY0NDIsImV4cCI6MTczMTM0MDA0Mn0.MQbovtK2tKu8Zj6_7vaqSVXWunIG8-iuwa6JEXCqXAQ'
        ```
      operationId: AuthMeController_getUserProfile
      parameters: []
      responses:
        "200":
          description: User profile returned.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ResponseMeDto"
        "400":
          description: The request could not be operated by the server.
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: number
                    example: 400
                  message:
                    type: string
                  error:
                    type: string
                    example: Bad Request
                required:
                  - statusCode
                  - message
        "401":
          description: The resource owner or authorization server denied the request.
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: number
                    example: 401
                  message:
                    type: string
                  error:
                    type: string
                    example: Unauthorized
                required:
                  - statusCode
                  - message
        "404":
          description: The requested resource could not be found.
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: number
                    example: 404
                  message:
                    type: string
                  error:
                    type: string
                    example: Not Found
                required:
                  - statusCode
                  - message
        "422":
          description: The request could not be validated by the server.
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: number
                    example: 422
                  message:
                    type: string
                  error:
                    type: string
                    example: Unprocessable Entity
                required:
                  - statusCode
                  - message
        "500":
          description: The server encountered an unexpected condition. Please try again
            later.
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: number
                    example: 500
                  message:
                    type: string
                  error:
                    type: string
                    example: Internal Server Error
                required:
                  - statusCode
                  - message
      security:
        - bearer: []
      summary: Get account information
      tags:
        - Authentication
  /auth/register:
    post:
      description: >
        The Register API endpoint allows users to create a new account on the
        Ovok platform.

        <br>This API is essential for onboarding new users and providing access
        to Ovok services.


        ## Example cURL request


        ```bash

        curl -X POST \
         --url 'https://api.dev.ovok.com/auth/register' \
         -H 'Content-Type: application/json' \
         -d '{
            "email": "john.doe@mail.com",
            "password": "password1234",
            "clientId": "5e505642-9024-474d-9434-e5a44f505cc5",
            "type": "Patient",
            "name": "John",
            "surname": "Doe"
        }'

        ```
      operationId: AuthRegisterController_register
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/RegisterDto"
      responses:
        "200":
          description: Access token, refresh token and expiration time.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ResponseRegisterLoginDto"
        "400":
          description: The request could not be operated by the server.
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: number
                    example: 400
                  message:
                    type: string
                  error:
                    type: string
                    example: Bad Request
                required:
                  - statusCode
                  - message
        "401":
          description: The resource owner or authorization server denied the request.
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: number
                    example: 401
                  message:
                    type: string
                  error:
                    type: string
                    example: Unauthorized
                required:
                  - statusCode
                  - message
        "404":
          description: The requested resource could not be found.
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: number
                    example: 404
                  message:
                    type: string
                  error:
                    type: string
                    example: Not Found
                required:
                  - statusCode
                  - message
        "422":
          description: The request could not be validated by the server.
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: number
                    example: 422
                  message:
                    type: string
                  error:
                    type: string
                    example: Unprocessable Entity
                required:
                  - statusCode
                  - message
        "500":
          description: The server encountered an unexpected condition. Please try again
            later.
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: number
                    example: 500
                  message:
                    type: string
                  error:
                    type: string
                    example: Internal Server Error
                required:
                  - statusCode
                  - message
      summary: Register an account
      tags:
        - Authentication
  /auth/session:
    get:
      description: >
        The GET Session API endpoint retrieves all sessions from the Ovok
        platform.


        ## Example cURL request


        ```bash

        curl -X GET \
         --url 'https://api.dev.ovok.com/auth/session' \
         -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3ODY4OTk5NzcsImV4cCI6MTc4NjkwMzU3N30.sZTke9fx_gPeoj2v-FL9GhDqY0hh9EzdEc4XywFqb84'
        ```
      operationId: AuthSessionController_findAll
      parameters: []
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SessionsResponseDto"
        "400": &a6
          description: The request could not be operated by the server.
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: number
                    example: 400
                  message:
                    type: string
                  error:
                    type: string
                    example: Bad Request
                required:
                  - statusCode
                  - message
        "401": &a7
          description: The resource owner or authorization server denied the request.
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: number
                    example: 401
                  message:
                    type: string
                  error:
                    type: string
                    example: Unauthorized
                required:
                  - statusCode
                  - message
        "404": &a8
          description: The requested resource could not be found.
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: number
                    example: 404
                  message:
                    type: string
                  error:
                    type: string
                    example: Not Found
                required:
                  - statusCode
                  - message
        "422": &a9
          description: The request could not be validated by the server.
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: number
                    example: 422
                  message:
                    type: string
                  error:
                    type: string
                    example: Unprocessable Entity
                required:
                  - statusCode
                  - message
        "500": &a10
          description: The server encountered an unexpected condition. Please try again
            later.
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: number
                    example: 500
                  message:
                    type: string
                  error:
                    type: string
                    example: Internal Server Error
                required:
                  - statusCode
                  - message
      security: &a11
        - bearer: []
      summary: Get all sessions
      tags:
        - Authentication - Session Management
  /auth/session/{option}:
    delete:
      description: >
        The Delete Session API endpoint revokes session(s) from the Ovok
        platform. The access and refresh tokens for the sessions(s) will be
        invalidated.

        You can specify if you'd like to revoke `all`, `current`, `other` or a
        specific session by providing the session ID.


        ## Example cURL request


        ```bash

        curl -X DELETE \
         --url 'https://api.dev.ovok.com/auth/session/other' \
         -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3ODY4OTk5NzcsImV4cCI6MTc4NjkwMzU3N30.sZTke9fx_gPeoj2v-FL9GhDqY0hh9EzdEc4XywFqb84'
        ```
      operationId: AuthSessionController_revokeSessions
      parameters:
        - name: option
          required: true
          in: path
          schema:
            oneOf:
              - type: string
                enum:
                  - current
                  - other
                  - all
              - type: string
                format: uuid
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SessionsResponseDto"
        "400": *a6
        "401": *a7
        "404": *a8
        "422": *a9
        "500": *a10
      security: *a11
      summary: Revoke sessions
      tags:
        - Authentication - Session Management
  /auth/tenant/Practitioner/login/start:
    post:
      description: Login with email and password. Response either contains challange
        or MFA challenge - which is followed up by challenge as a second step as
        well.
      operationId: TenantPractitionerAuthController_startLogin
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/StartPractitionerLoginBodyDto"
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/StartPractitionerLoginResponseDto"
        "400": &a12
          description: The request could not be operated by the server.
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: number
                    example: 400
                  message:
                    type: string
                  error:
                    type: string
                    example: Bad Request
                required:
                  - statusCode
                  - message
        "401": &a13
          description: The resource owner or authorization server denied the request.
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: number
                    example: 401
                  message:
                    type: string
                  error:
                    type: string
                    example: Unauthorized
                required:
                  - statusCode
                  - message
        "404": &a14
          description: The requested resource could not be found.
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: number
                    example: 404
                  message:
                    type: string
                  error:
                    type: string
                    example: Not Found
                required:
                  - statusCode
                  - message
        "422": &a15
          description: The request could not be validated by the server.
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: number
                    example: 422
                  message:
                    type: string
                  error:
                    type: string
                    example: Unprocessable Entity
                required:
                  - statusCode
                  - message
        "500": &a16
          description: The server encountered an unexpected condition. Please try again
            later.
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: number
                    example: 500
                  message:
                    type: string
                  error:
                    type: string
                    example: Internal Server Error
                required:
                  - statusCode
                  - message
      summary: Practitioner - Login
      tags:
        - Tenant Authentication
  /auth/tenant/Practitioner/login/token:
    post:
      description: Login with challenge token. Success response contains access and
        refresh tokens.
      operationId: TenantPractitionerAuthController_finishLogin
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/FinishPractitionerLoginBodyDto"
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ResponseRegisterLoginDto"
        "400": *a12
        "401": *a13
        "404": *a14
        "422": *a15
        "500": *a16
      summary: Practitioner - Exchange Token
      tags:
        - Tenant Authentication
  /auth/tenant/Practitioner/login/mfa:
    post:
      description: Login with MFA token. Success response contains a challenge token
        that can be used to finish login via login/token endpoint.
      operationId: TenantPractitionerAuthController_mfaStart
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/StartPractitionerMFABodyDto"
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/StartPractitionerMFAResponseDto"
        "400": *a12
        "401": *a13
        "404": *a14
        "422": *a15
        "500": *a16
      summary: Practitioner - MFA
      tags:
        - Tenant Authentication
  /auth/tenant/Patient/login/start:
    post:
      description: Login with email and password. Response either contains challange
        or MFA challenge - which is followed up by challenge as a second step as
        well.
      operationId: TenantPatientAuthController_startLogin
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/StartPatientLoginBodyDto"
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/StartPatientLoginResponseDto"
        "400": &a17
          description: The request could not be operated by the server.
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: number
                    example: 400
                  message:
                    type: string
                  error:
                    type: string
                    example: Bad Request
                required:
                  - statusCode
                  - message
        "401": &a18
          description: The resource owner or authorization server denied the request.
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: number
                    example: 401
                  message:
                    type: string
                  error:
                    type: string
                    example: Unauthorized
                required:
                  - statusCode
                  - message
        "404": &a19
          description: The requested resource could not be found.
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: number
                    example: 404
                  message:
                    type: string
                  error:
                    type: string
                    example: Not Found
                required:
                  - statusCode
                  - message
        "422": &a20
          description: The request could not be validated by the server.
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: number
                    example: 422
                  message:
                    type: string
                  error:
                    type: string
                    example: Unprocessable Entity
                required:
                  - statusCode
                  - message
        "500": &a21
          description: The server encountered an unexpected condition. Please try again
            later.
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: number
                    example: 500
                  message:
                    type: string
                  error:
                    type: string
                    example: Internal Server Error
                required:
                  - statusCode
                  - message
      summary: Patient - Login
      tags:
        - Tenant Authentication
  /auth/tenant/Patient/login/token:
    post:
      description: Login with challenge token. Success response contains access and
        refresh tokens.
      operationId: TenantPatientAuthController_finishLogin
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/FinishPatientLoginBodyDto"
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ResponseRegisterLoginDto"
        "400": *a17
        "401": *a18
        "404": *a19
        "422": *a20
        "500": *a21
      summary: Patient - Exchange Token
      tags:
        - Tenant Authentication
  /auth/tenant/Patient/login/mfa:
    post:
      description: Login with MFA token. Success response contains a challenge token
        that can be used to finish login via login/token endpoint.
      operationId: TenantPatientAuthController_mfaStart
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/StartPatientMFABodyDto"
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/StartPatientMFAResponseDto"
        "400": *a17
        "401": *a18
        "404": *a19
        "422": *a20
        "500": *a21
      summary: Patient - MFA
      tags:
        - Tenant Authentication
  /auth/tenant/Patient/register:
    post:
      description: Register a new user.
      operationId: TenantPatientAuthController_register
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/RegisterPatientBodyDto"
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ResponseRegisterLoginDto"
        "400": *a17
        "401": *a18
        "404": *a19
        "422": *a20
        "500": *a21
      summary: Patient - Register
      tags:
        - Tenant Authentication
  /locales:
    get:
      description: Fetch the enabled locales and the default locale for localization.
      operationId: LocaleController_getLocale
      parameters: []
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/LocaleBodyDto"
        "400": &a22
          description: The request could not be operated by the server.
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: number
                    example: 400
                  message:
                    type: string
                  error:
                    type: string
                    example: Bad Request
                required:
                  - statusCode
                  - message
        "401": &a23
          description: The resource owner or authorization server denied the request.
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: number
                    example: 401
                  message:
                    type: string
                  error:
                    type: string
                    example: Unauthorized
                required:
                  - statusCode
                  - message
        "404": &a24
          description: The requested resource could not be found.
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: number
                    example: 404
                  message:
                    type: string
                  error:
                    type: string
                    example: Not Found
                required:
                  - statusCode
                  - message
        "422": &a25
          description: The request could not be validated by the server.
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: number
                    example: 422
                  message:
                    type: string
                  error:
                    type: string
                    example: Unprocessable Entity
                required:
                  - statusCode
                  - message
        "500": &a26
          description: The server encountered an unexpected condition. Please try again
            later.
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: number
                    example: 500
                  message:
                    type: string
                  error:
                    type: string
                    example: Internal Server Error
                required:
                  - statusCode
                  - message
      security: &a27
        - bearer: []
      summary: Get available locales
      tags:
        - Localization
    patch:
      description: Enable or disable the available locales for localization.
      operationId: LocaleController_patchLocale
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/LocaleBodyDto"
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/LocaleBodyDto"
        "400": *a22
        "401": *a23
        "404": *a24
        "422": *a25
        "500": *a26
      security: *a27
      summary: Update the available locales
      tags:
        - Localization
  /organizations/code/email:
    post:
      description: Receive organization codes to your email
      operationId: OrganizationCodeController_sendEmailOfOrganizations
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/EmailRequestBodyDto"
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/EmailRequestBodyDto"
        "400": &a28
          description: The request could not be operated by the server.
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: number
                    example: 400
                  message:
                    type: string
                  error:
                    type: string
                    example: Bad Request
                required:
                  - statusCode
                  - message
        "401": &a29
          description: The resource owner or authorization server denied the request.
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: number
                    example: 401
                  message:
                    type: string
                  error:
                    type: string
                    example: Unauthorized
                required:
                  - statusCode
                  - message
        "404": &a30
          description: The requested resource could not be found.
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: number
                    example: 404
                  message:
                    type: string
                  error:
                    type: string
                    example: Not Found
                required:
                  - statusCode
                  - message
        "422": &a31
          description: The request could not be validated by the server.
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: number
                    example: 422
                  message:
                    type: string
                  error:
                    type: string
                    example: Unprocessable Entity
                required:
                  - statusCode
                  - message
        "500": &a32
          description: The server encountered an unexpected condition. Please try again
            later.
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: number
                    example: 500
                  message:
                    type: string
                  error:
                    type: string
                    example: Internal Server Error
                required:
                  - statusCode
                  - message
      summary: Receive Organization Codes
      tags:
        - Organization Code Information
  /organizations/code:
    get:
      description: Get organization code
      operationId: OrganizationCodeController_getOrganizationCode
      parameters: []
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/TenantCodeDto"
        "400": *a28
        "401": *a29
        "404": *a30
        "422": *a31
        "500": *a32
      summary: Get Organization Code
      tags:
        - Organization Code Information
  /partner/health-check:
    get:
      operationId: PartnerController_healthCheck[0]
      parameters: []
      responses:
        "200":
          description: ""
        "400": &a33
          description: The request could not be operated by the server.
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: number
                    example: 400
                  message:
                    type: string
                  error:
                    type: string
                    example: Bad Request
                required:
                  - statusCode
                  - message
        "401": &a34
          description: The resource owner or authorization server denied the request.
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: number
                    example: 401
                  message:
                    type: string
                  error:
                    type: string
                    example: Unauthorized
                required:
                  - statusCode
                  - message
        "404": &a35
          description: The requested resource could not be found.
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: number
                    example: 404
                  message:
                    type: string
                  error:
                    type: string
                    example: Not Found
                required:
                  - statusCode
                  - message
        "422": &a36
          description: The request could not be validated by the server.
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: number
                    example: 422
                  message:
                    type: string
                  error:
                    type: string
                    example: Unprocessable Entity
                required:
                  - statusCode
                  - message
        "500": &a37
          description: The server encountered an unexpected condition. Please try again
            later.
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: number
                    example: 500
                  message:
                    type: string
                  error:
                    type: string
                    example: Internal Server Error
                required:
                  - statusCode
                  - message
      tags:
        - Partner
  /v1/partner/health-check:
    get:
      operationId: PartnerController_healthCheck[1]_v1
      parameters: []
      responses:
        "200":
          description: ""
        "400": *a33
        "401": *a34
        "404": *a35
        "422": *a36
        "500": *a37
      tags:
        - Partner
  /v2/partner/health-check:
    get:
      operationId: PartnerController_healthCheck[2]_v2
      parameters: []
      responses:
        "200":
          description: ""
        "400": *a33
        "401": *a34
        "404": *a35
        "422": *a36
        "500": *a37
      tags:
        - Partner
  /v3/partner/health-check:
    get:
      operationId: PartnerController_healthCheck[3]_v3
      parameters: []
      responses:
        "200":
          description: ""
        "400": *a33
        "401": *a34
        "404": *a35
        "422": *a36
        "500": *a37
      tags:
        - Partner
  /ai/translation:
    post:
      description: >
        AI Translation uses LLMs for translation.


        ### Warning


        The translation may fail or return hallucinated results due to the
        nature of LLMs.


        ### Body Parameters


        | Parameter        | Type       |
        Description                                     |
        Example                                 |

        | ---------------- | ---------- |
        ----------------------------------------------- |
        --------------------------------------- |

        | `sourceLanguage` | `string`   | ISO 639-1 language code, or full
        language name. | `en-US`                                 |

        | `targetLanguage` | `string`   | ISO 639-1 language code, or full
        language name. | `de-DE`                                 |

        | `text`           | `string[]` | The text to
        translate.                          | `["Hello, world!", "How is ?"]` |


        > String values in the `text` array can be in any format, including
        HTML, Markdown, or plain text and may contain variables with double
        curly braces.
      operationId: TranslationController_translate
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CreateTranslationRequestDto"
      responses:
        "200":
          description: ""
        "400":
          description: The request could not be operated by the server.
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: number
                    example: 400
                  message:
                    type: string
                  error:
                    type: string
                    example: Bad Request
                required:
                  - statusCode
                  - message
        "401":
          description: The resource owner or authorization server denied the request.
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: number
                    example: 401
                  message:
                    type: string
                  error:
                    type: string
                    example: Unauthorized
                required:
                  - statusCode
                  - message
        "404":
          description: The requested resource could not be found.
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: number
                    example: 404
                  message:
                    type: string
                  error:
                    type: string
                    example: Not Found
                required:
                  - statusCode
                  - message
        "422":
          description: The request could not be validated by the server.
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: number
                    example: 422
                  message:
                    type: string
                  error:
                    type: string
                    example: Unprocessable Entity
                required:
                  - statusCode
                  - message
        "500":
          description: The server encountered an unexpected condition. Please try again
            later.
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: number
                    example: 500
                  message:
                    type: string
                  error:
                    type: string
                    example: Internal Server Error
                required:
                  - statusCode
                  - message
      summary: Translate
      tags:
        - AI Translation
  /document:
    post:
      description: >
        Generate a file upload url and credentials


        ### Parameters


        | Parameter     | In     |
        Description                                    | Example     |

        | ------------- | ------ |
        ---------------------------------------------- | ----------- |

        | `contentType` | `body` | The mime type of the
        file                      | `image/png` |

        | `fileName`    | `body` | The filename of the resource to be saved
        with. | `cat.png`   |


        ### Response


        ```json

        {
          "id": "12345",
          "lastUpdated": "2000-01-01T00:00:00.000Z",
          "author": {
            "reference": "Practitioner/...",
            "display": "Max Mustermann"
          },
          "fileName": "cat.png",
          "contentType": "image/png",
          "uploadOptions": {
            "url": "https://s3.eu-central-1.amazonaws.com/s...",
            "fields": {
              "bucket": "s...",
              "X-Amz-Algorithm": "A...",
              "X-Amz-Credential": "A...",
              "X-Amz-Date": "2025...",
              "key": "bi...",
              "Policy": "ey...",
              "X-Amz-Signature": "a6..."
            }
          }
        }

        ```


        By using the credentials provided in the `uploadOptions`, you can use
        any http client to upload your file in http form field.

        All of the `field` values in the `uploadOptions` should be provided as
        form data key value pairs, along with another form data field `file`
        with the value of actual file itself.


        ```ts

        import axios from 'axios';

        import * as fs from 'fs';

        import FormData from 'form-data';


        async function uploadFileWithCredentials(filePath: string,
        uploadCredentialsResponse: any) {
          const { url, fields } = uploadCredentialsResponse.uploadOptions;
          const formData = new FormData();

          for (const [key, value] of Object.entries(fields)) {
            formData.append(key, value);
          }

          try {
            const fileContent = fs.readFileSync(filePath);
            formData.append('file', fileContent);

            const response = await axios.post(url, formData, {
              headers: formData.getHeaders(),
            });
            console.log('Upload successful:', response.status);
          } catch (error: any) {
            console.error('Upload failed:', error);
          }
        }


        const uploadCredentialsResponse = {
          id: '12345',
          lastUpdated: '2000-01-01T00:00:00.000Z',
          author: {
            reference: 'Practitioner/...',
            display: 'Max Mustermann',
          },
          fileName: 'cat.png',
          contentType: 'image/png',
          uploadOptions: {
            url: 'https://s3.eu-central-1.amazonaws.com/s...',
            fields: {
              bucket: 's...',
              'X-Amz-Algorithm': 'A...',
              'X-Amz-Credential': 'A...',
              'X-Amz-Date': '2025...',
              key: 'bi...',
              Policy: 'ey...',
              'X-Amz-Signature': 'a6...',
            },
          },
        };


        uploadFileWithCredentials('path/to/cat.png', uploadCredentialsResponse);

        ```
      operationId: DocumentController_createUploadCredentials
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/PostFileUploadDto"
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FileEntryDto"
        "400": &a38
          description: The request could not be operated by the server.
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: number
                    example: 400
                  message:
                    type: string
                  error:
                    type: string
                    example: Bad Request
                required:
                  - statusCode
                  - message
        "401": &a39
          description: The resource owner or authorization server denied the request.
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: number
                    example: 401
                  message:
                    type: string
                  error:
                    type: string
                    example: Unauthorized
                required:
                  - statusCode
                  - message
        "404": &a40
          description: The requested resource could not be found.
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: number
                    example: 404
                  message:
                    type: string
                  error:
                    type: string
                    example: Not Found
                required:
                  - statusCode
                  - message
        "422": &a41
          description: The request could not be validated by the server.
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: number
                    example: 422
                  message:
                    type: string
                  error:
                    type: string
                    example: Unprocessable Entity
                required:
                  - statusCode
                  - message
        "500": &a42
          description: The server encountered an unexpected condition. Please try again
            later.
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: number
                    example: 500
                  message:
                    type: string
                  error:
                    type: string
                    example: Internal Server Error
                required:
                  - statusCode
                  - message
      security:
        - bearer: []
      summary: Upload document - Generate credentials
      tags:
        - Document
    get:
      description: >
        File search


        Information such as id, contentType, fileName, public token.


        ### Parameters


        | Parameter | In      |
        Description                                                     |
        Example |

        | --------- | ------- |
        --------------------------------------------------------------- |
        ------- |

        | `_count`  | `query` | Total amount of file informations per
        query                     | `10`    |

        | `_offset` | `query` | Total amount of file informations to be skipped
        (page \* count) | `0`     |
      operationId: DocumentController_searchFiles
      parameters:
        - name: _count
          required: false
          in: query
          schema:
            default: "100"
            type: string
        - name: _offset
          required: false
          in: query
          schema:
            default: "0"
            type: string
        - name: _sort
          required: false
          in: query
          schema:
            default: -_lastUpdated
            type: string
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GetSearchFilesResponseDto"
        "400": *a38
        "401": *a39
        "404": *a40
        "422": *a41
        "500": *a42
      security:
        - bearer: []
      summary: Search documents
      tags:
        - Document
  /document/public/{token}:
    get:
      description: |
        Public file download

        Information such as id, contentType, fileName, publicToken can be fetched by querying /fhir/DocumentReference.

        ### Parameters

        | Parameter | In       | Description                                                                                                  | Example             |
        | --------- | -------- | ------------------------------------------------------------------------------------------------------------ | ------------------- |
        | `token`   | `params` | The DocumentReference public token found in the extension of the resource                                    | `example.jwt.eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3ODY4OTk5NzcsImV4cCI6MTc4NjkwMzU3N30.sZTke9fx_gPeoj2v-FL9GhDqY0hh9EzdEc4XywFqb84` |
        | `width`   | `query`  | The width of the image to resize the image to (optional)                                                     | `100`               |
        | `height`  | `query`  | The height of the image to resize the image to (optional)                                                    | `100`               |
        | `fit`     | `query`  | The fit of the image to resize the image to (optional) [See](https://sharp.pixelplumbing.com/api-resize#fit) | `cover`             |

        > Useful for embedding images with \<img\> tags on websites, predefined HTML files. Note that anyone with the url will be able to access the file without any Authorization.
      operationId: DocumentController_getPublicFileUrl
      parameters:
        - name: token
          required: true
          in: path
          description: The public token of the DocumentReference resource
          schema:
            type: string
        - name: ETag
          required: false
          in: header
          description: The ETag of the file for GET requests. If provided, the server will
            check the value of the ETag against the value of the ETag in the
            request headers. If the values match, the server will return a 304
            Not Modified response. If the values do not match, the server will
            return a 200 OK response and the file content, if the file exists.
          schema:
            type: string
        - name: width
          required: false
          in: query
          description: The width of the binary resource if the resource is an image.
          schema:
            type: string
        - name: height
          required: false
          in: query
          description: The height of the binary resource if the resource is an image.
          schema:
            type: string
        - name: fit
          required: false
          in: query
          description: The fit of the image. See
            https://sharp.pixelplumbing.com/api-resize#fit for more information.
          schema:
            default: cover
            type: string
            enum:
              - cover
              - contain
              - fill
              - inside
              - outside
      responses:
        "200":
          description: ""
        "400": *a38
        "401": *a39
        "404": *a40
        "422": *a41
        "500": *a42
      summary: Get a document as public user
      tags:
        - Document
  /document/{id}:
    get:
      description: |
        File download

        Information such as id, contentType, fileName can be fetched by querying /fhir/DocumentReference.

        ### Parameters

        | Parameter | In       | Description                                                                                                  | Example              |
        | --------- | -------- | ------------------------------------------------------------------------------------------------------------ | -------------------- |
        | `id`      | `params` | The DocumentReference id of the file resource                                                                | `c3499c27-2973-0a7f-807e-fb8676a92dcb` |
        | `width`   | `query`  | The width of the image to resize the image to (optional)                                                     | `100`                |
        | `height`  | `query`  | The height of the image to resize the image to (optional)                                                    | `100`                |
        | `fit`     | `query`  | The fit of the image to resize the image to (optional) [See](https://sharp.pixelplumbing.com/api-resize#fit) | `cover`              |
      operationId: DocumentController_getFileUrl
      parameters:
        - name: id
          required: true
          in: path
          description: The id of the DocumentReference resource
          schema:
            format: uuid
            type: string
        - name: ETag
          required: false
          in: header
          description: The ETag of the file for GET requests. If provided, the server will
            check the value of the ETag against the value of the ETag in the
            request headers. If the values match, the server will return a 304
            Not Modified response. If the values do not match, the server will
            return a 200 OK response and the file content, if the file exists.
          schema:
            type: string
        - name: width
          required: false
          in: query
          description: The width of the binary resource if the resource is an image.
          schema:
            type: string
        - name: height
          required: false
          in: query
          description: The height of the binary resource if the resource is an image.
          schema:
            type: string
        - name: fit
          required: false
          in: query
          description: The fit of the image. See
            https://sharp.pixelplumbing.com/api-resize#fit for more information.
          schema:
            default: cover
            type: string
            enum:
              - cover
              - contain
              - fill
              - inside
              - outside
      responses:
        "200":
          description: ""
        "400": *a38
        "401": *a39
        "404": *a40
        "422": *a41
        "500": *a42
      security:
        - bearer: []
      summary: Get a document as authenticated user
      tags:
        - Document
    delete:
      description: >
        Delete document


        Deletes a document and its associated file from the system.


        ### Parameters


        | Parameter | In     |
        Description                                        | Example   |

        | --------- | ------ |
        -------------------------------------------------- | --------- |

        | `id`      | `path` | The id of the DocumentReference resource to
        delete | `023f2f-` |


        ### Response


        ```json

        {
          "message": "Document deleted successfully"
        }

        ```


        > Note: This operation will permanently delete both the
        DocumentReference metadata and the associated binary file from S3. This
        action cannot be undone.
      operationId: DocumentController_deleteDocument
      parameters:
        - name: id
          required: true
          in: path
          description: The id of the DocumentReference resource
          schema:
            format: uuid
            type: string
      responses:
        "200":
          description: ""
        "400": *a38
        "401": *a39
        "404": *a40
        "422": *a41
        "500": *a42
      security:
        - bearer: []
      summary: Delete a document
      tags:
        - Document
    patch:
      description: |
        Update document metadata

        Updates the name and/or publicity settings of an uploaded document.

        ### Parameters

        | Parameter  | In     | Description                                                                  | Example   |
        | ---------- | ------ | ---------------------------------------------------------------------------- | --------- |
        | `id`       | `path` | The id of the DocumentReference resource to update                           | `023f2f-` |
        | `fileName` | `body` | The new filename for the document (optional)                                 | `cat.png` |
        | `isPublic` | `body` | Whether the document should be publicly accessible (optional, true or false) | `false`   |

        ### Request Body

        ```json
        {
          "fileName": "updated-image.png",
          "isPublic": "false"
        }
        ```

        ### Response

        Returns the updated document information in the same format as the create endpoint:

        ```json
        {
          "id": "12345",
          "meta": {
            "lastUpdated": "2000-01-01T00:00:00.000Z"
          },
          "author": {
            "reference": "Practitioner/...",
            "display": "Max Mustermann"
          },
          "fileName": "updated-image.png",
          "contentType": "image/png",
          "publicToken": null
        }
        ```
      operationId: DocumentController_updateDocumentMetadata
      parameters:
        - name: id
          required: true
          in: path
          description: The id of the DocumentReference resource
          schema:
            format: uuid
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/UpdateDocumentMetadataDto"
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FileEntryDto"
        "400": *a38
        "401": *a39
        "404": *a40
        "422": *a41
        "500": *a42
      security:
        - bearer: []
      summary: Update document metadata
      tags:
        - Document
    post:
      description: >
        Generate credentials for file replacement


        The file replacement follows the same pattern as file creation - you
        first get upload credentials, then upload directly to S3.


        ### Parameters


        | Parameter     | In       |
        Description                                    | Example     |

        | ------------- | -------- |
        ---------------------------------------------- | ----------- |

        | `id`          | `params` | The id of the
        DocumentReference                | `023f2f-`   |

        | `fileName`    | `body`   | The filename of the resource to be saved
        with. | `cat.png`   |

        | `contentType` | `body`   | The mime type of the
        file                      | `image/png` |


        ### Response


        Similar to document creation, this endpoint returns upload credentials:


        ```json

        {
          "id": "12345",
          "lastUpdated": "2000-01-01T00:00:00.000Z",
          "author": {
            "reference": "Practitioner/...",
            "display": "Max Mustermann"
          },
          "fileName": "cat.png",
          "contentType": "image/png",
          "uploadOptions": {
            "url": "https://s3.eu-central-1.amazonaws.com/s...",
            "fields": {
              "bucket": "s...",
              "X-Amz-Algorithm": "A...",
              "X-Amz-Credential": "A...",
              "X-Amz-Date": "2025...",
              "key": "bi...",
              "Policy": "ey...",
              "X-Amz-Signature": "a6..."
            }
          }
        }

        ```


        Use the credentials in `uploadOptions` to upload your replacement file
        directly to S3 using form data, exactly like the initial upload process.
      operationId: DocumentController_generateReplaceCredentials
      parameters:
        - name: id
          required: true
          in: path
          description: The id of the DocumentReference resource
          schema:
            format: uuid
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/ReplaceDocumentFileDto"
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FileEntryDto"
        "400": *a38
        "401": *a39
        "404": *a40
        "422": *a41
        "500": *a42
      security:
        - bearer: []
      summary: Generate credentials for document file replacement
      tags:
        - Document
  /bots:
    post:
      description: >
        This API executes a bot by its identifier.

        <br>Additional parameters can be provided in the request body.


        ## Example bot resource


        ```json

        {
          "resourceType": "Bot",
          "identifier": [{
            "system": "https://example.com",
            "value": "get-users"
          }],
          ...
        }

        ```


        ## Example cURL request


        The bot identifier is provided in the query, while additional parameters
        are sent in the JSON body.


        ```bash

        curl -X POST \
         --url 'https://api.dev.ovok.com/bots?identifier=https://example.com|get-users' \
         -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3MzEzMzY0NDIsImV4cCI6MTczMTM0MDA0Mn0.MQbovtK2tKu8Zj6_7vaqSVXWunIG8-iuwa6JEXCqXAQ' \
         -H 'Content-Type: application/json' \
         -d '{
            "parameter1": "value1",
            "parameter2": "value2"
        }'

        ```


        **Note**: The `https://example.com|get-users` query parameter value
        consists of identifier's `system` and `value` properties merged by a
        single pipe `|` symbol, following the FHIR search parameter syntax.
      operationId: BotsController_execBotByIdentifierPOST
      parameters:
        - name: identifier
          required: true
          in: query
          description: 'Identifier containing system and/or value parameters, e.g.:
            "https://api.ovok.com/fhir/Identifier/my-resource|abc123",
            "https://api.ovok.com/fhir/Identifier/my-resource", "abc123"'
          schema:
            type: string
      responses:
        "200":
          description: Bot response.
        "400":
          description: The request could not be operated by the server.
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: number
                    example: 400
                  message:
                    type: string
                  error:
                    type: string
                    example: Bad Request
                required:
                  - statusCode
                  - message
        "401":
          description: The resource owner or authorization server denied the request.
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: number
                    example: 401
                  message:
                    type: string
                  error:
                    type: string
                    example: Unauthorized
                required:
                  - statusCode
                  - message
        "404":
          description: The requested resource could not be found.
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: number
                    example: 404
                  message:
                    type: string
                  error:
                    type: string
                    example: Not Found
                required:
                  - statusCode
                  - message
        "422":
          description: The request could not be validated by the server.
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: number
                    example: 422
                  message:
                    type: string
                  error:
                    type: string
                    example: Unprocessable Entity
                required:
                  - statusCode
                  - message
        "500":
          description: The server encountered an unexpected condition. Please try again
            later.
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: number
                    example: 500
                  message:
                    type: string
                  error:
                    type: string
                    example: Internal Server Error
                required:
                  - statusCode
                  - message
      summary: Execute a bot with request body
      tags:
        - Bots - Execute a custom script
  /cms/{type}/map/{language}:
    get:
      description: >
        # Search Mapped Content


        Search CMS content with a side-by-side mapping between the project's
        default language and a target language.

        <br>Each result contains a `source` (default-language entry) and a
        `target` (requested-language entry) for the same content key. This is
        useful for translation management UIs where editors need to see original
        and translated content together.


        ## Path Parameters


        | Parameter  |
        Description                                                     |
        Example     |

        | ---------- |
        --------------------------------------------------------------- |
        ----------- |

        | `type`     | Content type (e.g. `article`, `faq`,
        `exercise`)                | `article`   |

        | `language` | Target ISO language code to map against the default
        language     | `de-DE`     |


        ## Query Parameters


        | Parameter  | Type     | Description                                  |
        Default |

        | ---------- | -------- | -------------------------------------------- |
        ------- |

        | `search`   | `string` | Free-text fuzzy search across title, section
        text, author, and key | -       |

        | `code`     | `string` | Filter by content code                       |
        -       |

        | `_count`   | `number` | Page size                                    |
        `10`    |

        | `_offset`  | `number` | Number of items to skip                      |
        `0`     |


        ## Example cURL request


        ```bash

        curl -X GET \
         --url 'https://api.dev.ovok.com/cms/article/map/de-DE?search=Blog&_count=20&_offset=0' \
         -H 'Authorization: Bearer <token>'
        ```


        ## Response


        ```json

        {
          "total": 1,
          "resources": [
            {
              "source": { "title": "My Blog", "language": "en-US", "key": "article-my-blog-a1b2c3d4" },
              "target": { "title": "Mein Blog", "language": "de-DE", "key": "article-my-blog-a1b2c3d4" }
            }
          ]
        }

        ```


        **Notes:** If a content key exists in the default language but has no
        translation yet, `target` will be absent from that entry. The reverse is
        also possible if orphaned translations exist.
      operationId: CMSController_searchMappedContent[0]
      parameters:
        - name: type
          required: true
          in: path
          schema:
            type: string
            enum:
              - blog
              - video
              - audio
              - template
              - export-template
        - name: language
          required: true
          in: path
          schema:
            type: string
            enum:
              - Cy-az-AZ
              - Cy-sr-SP
              - Cy-uz-UZ
              - Lt-az-AZ
              - Lt-sr-SP
              - Lt-uz-UZ
              - aa
              - ab
              - ae
              - af
              - af-ZA
              - ak
              - am
              - an
              - ar
              - ar-AE
              - ar-BH
              - ar-DZ
              - ar-EG
              - ar-IQ
              - ar-JO
              - ar-KW
              - ar-LB
              - ar-LY
              - ar-MA
              - ar-OM
              - ar-QA
              - ar-SA
              - ar-SY
              - ar-TN
              - ar-YE
              - as
              - av
              - ay
              - az
              - ba
              - be
              - be-BY
              - bg
              - bg-BG
              - bh
              - bi
              - bm
              - bn
              - bo
              - br
              - bs
              - ca
              - ca-ES
              - ce
              - ch
              - co
              - cr
              - cs
              - cs-CZ
              - cu
              - cv
              - cy
              - da
              - da-DK
              - de
              - de-AT
              - de-CH
              - de-DE
              - de-LI
              - de-LU
              - div-MV
              - dv
              - dz
              - ee
              - el
              - el-GR
              - en
              - en-AU
              - en-BZ
              - en-CA
              - en-CB
              - en-GB
              - en-IE
              - en-JM
              - en-NZ
              - en-PH
              - en-TT
              - en-US
              - en-ZA
              - en-ZW
              - eo
              - es
              - es-AR
              - es-BO
              - es-CL
              - es-CO
              - es-CR
              - es-DO
              - es-EC
              - es-ES
              - es-GT
              - es-HN
              - es-MX
              - es-NI
              - es-PA
              - es-PE
              - es-PR
              - es-PY
              - es-SV
              - es-UY
              - es-VE
              - et
              - et-EE
              - eu
              - eu-ES
              - fa
              - fa-IR
              - ff
              - fi
              - fi-FI
              - fj
              - fo
              - fo-FO
              - fr
              - fr-BE
              - fr-CA
              - fr-CH
              - fr-FR
              - fr-LU
              - fr-MC
              - fy
              - ga
              - gd
              - gl
              - gl-ES
              - gn
              - gu
              - gu-IN
              - gv
              - ha
              - he
              - he-IL
              - hi
              - hi-IN
              - ho
              - hr
              - hr-HR
              - ht
              - hu
              - hu-HU
              - hy
              - hy-AM
              - hz
              - ia
              - id
              - id-ID
              - ie
              - ig
              - ii
              - ik
              - io
              - is
              - is-IS
              - it
              - it-CH
              - it-IT
              - iu
              - ja
              - ja-JP
              - jv
              - ka
              - ka-GE
              - kg
              - ki
              - kj
              - kk
              - kk-KZ
              - kl
              - km
              - kn
              - kn-IN
              - ko
              - ko-KR
              - kr
              - ks
              - ku
              - kv
              - kw
              - ky
              - ky-KZ
              - la
              - lb
              - lg
              - li
              - ln
              - lo
              - lt
              - lt-LT
              - lu
              - lv
              - lv-LV
              - mg
              - mh
              - mi
              - mk
              - mk-MK
              - ml
              - mn
              - mn-MN
              - mr
              - mr-IN
              - ms
              - ms-BN
              - ms-MY
              - mt
              - my
              - na
              - nb
              - nb-NO
              - nd
              - ne
              - ng
              - nl
              - nl-BE
              - nl-NL
              - nn
              - nn-NO
              - no
              - nr
              - nv
              - ny
              - oc
              - oj
              - om
              - or
              - os
              - pa
              - pa-IN
              - pi
              - pl
              - pl-PL
              - ps
              - pt
              - pt-BR
              - pt-PT
              - qu
              - rm
              - rn
              - ro
              - ro-RO
              - ru
              - ru-RU
              - rw
              - sa
              - sa-IN
              - sc
              - sd
              - se
              - sg
              - si
              - sk
              - sk-SK
              - sl
              - sl-SI
              - sm
              - sn
              - so
              - sq
              - sq-AL
              - sr
              - ss
              - st
              - su
              - sv
              - sv-FI
              - sv-SE
              - sw
              - sw-KE
              - ta
              - ta-IN
              - te
              - te-IN
              - tg
              - th
              - th-TH
              - ti
              - tk
              - tl
              - tn
              - to
              - tr
              - tr-TR
              - ts
              - tt
              - tt-RU
              - tw
              - ty
              - ug
              - uk
              - uk-UA
              - ur
              - ur-PK
              - uz
              - ve
              - vi
              - vi-VN
              - vo
              - wa
              - wo
              - xh
              - yi
              - yo
              - za
              - zh
              - zh-CHS
              - zh-CHT
              - zh-CN
              - zh-HK
              - zh-MO
              - zh-SG
              - zh-TW
              - zu
        - name: search
          required: false
          in: query
          schema:
            type: string
        - name: code
          required: false
          in: query
          schema:
            type: string
        - name: _count
          required: false
          in: query
          schema:
            default: "10"
            type: string
        - name: _offset
          required: false
          in: query
          schema:
            default: "0"
            type: string
      responses:
        "200":
          description: ""
        "400": &a43
          description: The request could not be operated by the server.
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: number
                    example: 400
                  message:
                    type: string
                  error:
                    type: string
                    example: Bad Request
                required:
                  - statusCode
                  - message
        "401": &a44
          description: The resource owner or authorization server denied the request.
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: number
                    example: 401
                  message:
                    type: string
                  error:
                    type: string
                    example: Unauthorized
                required:
                  - statusCode
                  - message
        "404": &a45
          description: The requested resource could not be found.
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: number
                    example: 404
                  message:
                    type: string
                  error:
                    type: string
                    example: Not Found
                required:
                  - statusCode
                  - message
        "422": &a46
          description: The request could not be validated by the server.
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: number
                    example: 422
                  message:
                    type: string
                  error:
                    type: string
                    example: Unprocessable Entity
                required:
                  - statusCode
                  - message
        "500": &a47
          description: The server encountered an unexpected condition. Please try again
            later.
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: number
                    example: 500
                  message:
                    type: string
                  error:
                    type: string
                    example: Internal Server Error
                required:
                  - statusCode
                  - message
      security:
        - &a48
          bearer: []
        - bearer: []
      summary: Search mapped content
      tags:
        - CMS (FHIR Legacy)
  /internal/cms/{type}/map/{language}:
    get:
      description: >
        # Search Mapped Content


        Search CMS content with a side-by-side mapping between the project's
        default language and a target language.

        <br>Each result contains a `source` (default-language entry) and a
        `target` (requested-language entry) for the same content key. This is
        useful for translation management UIs where editors need to see original
        and translated content together.


        ## Path Parameters


        | Parameter  |
        Description                                                     |
        Example     |

        | ---------- |
        --------------------------------------------------------------- |
        ----------- |

        | `type`     | Content type (e.g. `article`, `faq`,
        `exercise`)                | `article`   |

        | `language` | Target ISO language code to map against the default
        language     | `de-DE`     |


        ## Query Parameters


        | Parameter  | Type     | Description                                  |
        Default |

        | ---------- | -------- | -------------------------------------------- |
        ------- |

        | `search`   | `string` | Free-text fuzzy search across title, section
        text, author, and key | -       |

        | `code`     | `string` | Filter by content code                       |
        -       |

        | `_count`   | `number` | Page size                                    |
        `10`    |

        | `_offset`  | `number` | Number of items to skip                      |
        `0`     |


        ## Example cURL request


        ```bash

        curl -X GET \
         --url 'https://api.dev.ovok.com/cms/article/map/de-DE?search=Blog&_count=20&_offset=0' \
         -H 'Authorization: Bearer <token>'
        ```


        ## Response


        ```json

        {
          "total": 1,
          "resources": [
            {
              "source": { "title": "My Blog", "language": "en-US", "key": "article-my-blog-a1b2c3d4" },
              "target": { "title": "Mein Blog", "language": "de-DE", "key": "article-my-blog-a1b2c3d4" }
            }
          ]
        }

        ```


        **Notes:** If a content key exists in the default language but has no
        translation yet, `target` will be absent from that entry. The reverse is
        also possible if orphaned translations exist.
      operationId: CMSController_searchMappedContent[1]
      parameters:
        - name: type
          required: true
          in: path
          schema:
            type: string
            enum:
              - blog
              - video
              - audio
              - template
              - export-template
        - name: language
          required: true
          in: path
          schema:
            type: string
            enum:
              - Cy-az-AZ
              - Cy-sr-SP
              - Cy-uz-UZ
              - Lt-az-AZ
              - Lt-sr-SP
              - Lt-uz-UZ
              - aa
              - ab
              - ae
              - af
              - af-ZA
              - ak
              - am
              - an
              - ar
              - ar-AE
              - ar-BH
              - ar-DZ
              - ar-EG
              - ar-IQ
              - ar-JO
              - ar-KW
              - ar-LB
              - ar-LY
              - ar-MA
              - ar-OM
              - ar-QA
              - ar-SA
              - ar-SY
              - ar-TN
              - ar-YE
              - as
              - av
              - ay
              - az
              - ba
              - be
              - be-BY
              - bg
              - bg-BG
              - bh
              - bi
              - bm
              - bn
              - bo
              - br
              - bs
              - ca
              - ca-ES
              - ce
              - ch
              - co
              - cr
              - cs
              - cs-CZ
              - cu
              - cv
              - cy
              - da
              - da-DK
              - de
              - de-AT
              - de-CH
              - de-DE
              - de-LI
              - de-LU
              - div-MV
              - dv
              - dz
              - ee
              - el
              - el-GR
              - en
              - en-AU
              - en-BZ
              - en-CA
              - en-CB
              - en-GB
              - en-IE
              - en-JM
              - en-NZ
              - en-PH
              - en-TT
              - en-US
              - en-ZA
              - en-ZW
              - eo
              - es
              - es-AR
              - es-BO
              - es-CL
              - es-CO
              - es-CR
              - es-DO
              - es-EC
              - es-ES
              - es-GT
              - es-HN
              - es-MX
              - es-NI
              - es-PA
              - es-PE
              - es-PR
              - es-PY
              - es-SV
              - es-UY
              - es-VE
              - et
              - et-EE
              - eu
              - eu-ES
              - fa
              - fa-IR
              - ff
              - fi
              - fi-FI
              - fj
              - fo
              - fo-FO
              - fr
              - fr-BE
              - fr-CA
              - fr-CH
              - fr-FR
              - fr-LU
              - fr-MC
              - fy
              - ga
              - gd
              - gl
              - gl-ES
              - gn
              - gu
              - gu-IN
              - gv
              - ha
              - he
              - he-IL
              - hi
              - hi-IN
              - ho
              - hr
              - hr-HR
              - ht
              - hu
              - hu-HU
              - hy
              - hy-AM
              - hz
              - ia
              - id
              - id-ID
              - ie
              - ig
              - ii
              - ik
              - io
              - is
              - is-IS
              - it
              - it-CH
              - it-IT
              - iu
              - ja
              - ja-JP
              - jv
              - ka
              - ka-GE
              - kg
              - ki
              - kj
              - kk
              - kk-KZ
              - kl
              - km
              - kn
              - kn-IN
              - ko
              - ko-KR
              - kr
              - ks
              - ku
              - kv
              - kw
              - ky
              - ky-KZ
              - la
              - lb
              - lg
              - li
              - ln
              - lo
              - lt
              - lt-LT
              - lu
              - lv
              - lv-LV
              - mg
              - mh
              - mi
              - mk
              - mk-MK
              - ml
              - mn
              - mn-MN
              - mr
              - mr-IN
              - ms
              - ms-BN
              - ms-MY
              - mt
              - my
              - na
              - nb
              - nb-NO
              - nd
              - ne
              - ng
              - nl
              - nl-BE
              - nl-NL
              - nn
              - nn-NO
              - no
              - nr
              - nv
              - ny
              - oc
              - oj
              - om
              - or
              - os
              - pa
              - pa-IN
              - pi
              - pl
              - pl-PL
              - ps
              - pt
              - pt-BR
              - pt-PT
              - qu
              - rm
              - rn
              - ro
              - ro-RO
              - ru
              - ru-RU
              - rw
              - sa
              - sa-IN
              - sc
              - sd
              - se
              - sg
              - si
              - sk
              - sk-SK
              - sl
              - sl-SI
              - sm
              - sn
              - so
              - sq
              - sq-AL
              - sr
              - ss
              - st
              - su
              - sv
              - sv-FI
              - sv-SE
              - sw
              - sw-KE
              - ta
              - ta-IN
              - te
              - te-IN
              - tg
              - th
              - th-TH
              - ti
              - tk
              - tl
              - tn
              - to
              - tr
              - tr-TR
              - ts
              - tt
              - tt-RU
              - tw
              - ty
              - ug
              - uk
              - uk-UA
              - ur
              - ur-PK
              - uz
              - ve
              - vi
              - vi-VN
              - vo
              - wa
              - wo
              - xh
              - yi
              - yo
              - za
              - zh
              - zh-CHS
              - zh-CHT
              - zh-CN
              - zh-HK
              - zh-MO
              - zh-SG
              - zh-TW
              - zu
        - name: search
          required: false
          in: query
          schema:
            type: string
        - name: code
          required: false
          in: query
          schema:
            type: string
        - name: _count
          required: false
          in: query
          schema:
            default: "10"
            type: string
        - name: _offset
          required: false
          in: query
          schema:
            default: "0"
            type: string
      responses:
        "200":
          description: ""
        "400": *a43
        "401": *a44
        "404": *a45
        "422": *a46
        "500": *a47
      security:
        - *a48
        - bearer: []
      summary: Search mapped content
      tags:
        - CMS (FHIR Legacy)
  /cms/{type}/{language}/copy-from-parent-project:
    post:
      description: Copy contents.
      operationId: CMSController_copyContents[0]
      parameters:
        - name: type
          required: true
          in: path
          schema:
            type: string
            enum:
              - blog
              - video
              - audio
              - template
              - export-template
        - name: language
          required: true
          in: path
          schema:
            type: string
            enum:
              - Cy-az-AZ
              - Cy-sr-SP
              - Cy-uz-UZ
              - Lt-az-AZ
              - Lt-sr-SP
              - Lt-uz-UZ
              - aa
              - ab
              - ae
              - af
              - af-ZA
              - ak
              - am
              - an
              - ar
              - ar-AE
              - ar-BH
              - ar-DZ
              - ar-EG
              - ar-IQ
              - ar-JO
              - ar-KW
              - ar-LB
              - ar-LY
              - ar-MA
              - ar-OM
              - ar-QA
              - ar-SA
              - ar-SY
              - ar-TN
              - ar-YE
              - as
              - av
              - ay
              - az
              - ba
              - be
              - be-BY
              - bg
              - bg-BG
              - bh
              - bi
              - bm
              - bn
              - bo
              - br
              - bs
              - ca
              - ca-ES
              - ce
              - ch
              - co
              - cr
              - cs
              - cs-CZ
              - cu
              - cv
              - cy
              - da
              - da-DK
              - de
              - de-AT
              - de-CH
              - de-DE
              - de-LI
              - de-LU
              - div-MV
              - dv
              - dz
              - ee
              - el
              - el-GR
              - en
              - en-AU
              - en-BZ
              - en-CA
              - en-CB
              - en-GB
              - en-IE
              - en-JM
              - en-NZ
              - en-PH
              - en-TT
              - en-US
              - en-ZA
              - en-ZW
              - eo
              - es
              - es-AR
              - es-BO
              - es-CL
              - es-CO
              - es-CR
              - es-DO
              - es-EC
              - es-ES
              - es-GT
              - es-HN
              - es-MX
              - es-NI
              - es-PA
              - es-PE
              - es-PR
              - es-PY
              - es-SV
              - es-UY
              - es-VE
              - et
              - et-EE
              - eu
              - eu-ES
              - fa
              - fa-IR
              - ff
              - fi
              - fi-FI
              - fj
              - fo
              - fo-FO
              - fr
              - fr-BE
              - fr-CA
              - fr-CH
              - fr-FR
              - fr-LU
              - fr-MC
              - fy
              - ga
              - gd
              - gl
              - gl-ES
              - gn
              - gu
              - gu-IN
              - gv
              - ha
              - he
              - he-IL
              - hi
              - hi-IN
              - ho
              - hr
              - hr-HR
              - ht
              - hu
              - hu-HU
              - hy
              - hy-AM
              - hz
              - ia
              - id
              - id-ID
              - ie
              - ig
              - ii
              - ik
              - io
              - is
              - is-IS
              - it
              - it-CH
              - it-IT
              - iu
              - ja
              - ja-JP
              - jv
              - ka
              - ka-GE
              - kg
              - ki
              - kj
              - kk
              - kk-KZ
              - kl
              - km
              - kn
              - kn-IN
              - ko
              - ko-KR
              - kr
              - ks
              - ku
              - kv
              - kw
              - ky
              - ky-KZ
              - la
              - lb
              - lg
              - li
              - ln
              - lo
              - lt
              - lt-LT
              - lu
              - lv
              - lv-LV
              - mg
              - mh
              - mi
              - mk
              - mk-MK
              - ml
              - mn
              - mn-MN
              - mr
              - mr-IN
              - ms
              - ms-BN
              - ms-MY
              - mt
              - my
              - na
              - nb
              - nb-NO
              - nd
              - ne
              - ng
              - nl
              - nl-BE
              - nl-NL
              - nn
              - nn-NO
              - no
              - nr
              - nv
              - ny
              - oc
              - oj
              - om
              - or
              - os
              - pa
              - pa-IN
              - pi
              - pl
              - pl-PL
              - ps
              - pt
              - pt-BR
              - pt-PT
              - qu
              - rm
              - rn
              - ro
              - ro-RO
              - ru
              - ru-RU
              - rw
              - sa
              - sa-IN
              - sc
              - sd
              - se
              - sg
              - si
              - sk
              - sk-SK
              - sl
              - sl-SI
              - sm
              - sn
              - so
              - sq
              - sq-AL
              - sr
              - ss
              - st
              - su
              - sv
              - sv-FI
              - sv-SE
              - sw
              - sw-KE
              - ta
              - ta-IN
              - te
              - te-IN
              - tg
              - th
              - th-TH
              - ti
              - tk
              - tl
              - tn
              - to
              - tr
              - tr-TR
              - ts
              - tt
              - tt-RU
              - tw
              - ty
              - ug
              - uk
              - uk-UA
              - ur
              - ur-PK
              - uz
              - ve
              - vi
              - vi-VN
              - vo
              - wa
              - wo
              - xh
              - yi
              - yo
              - za
              - zh
              - zh-CHS
              - zh-CHT
              - zh-CN
              - zh-HK
              - zh-MO
              - zh-SG
              - zh-TW
              - zu
      responses:
        "200":
          description: ""
        "400": *a43
        "401": *a44
        "404": *a45
        "422": *a46
        "500": *a47
      security:
        - *a48
        - bearer: []
      summary: Copy contents
      tags:
        - CMS (FHIR Legacy)
  /internal/cms/{type}/{language}/copy-from-parent-project:
    post:
      description: Copy contents.
      operationId: CMSController_copyContents[1]
      parameters:
        - name: type
          required: true
          in: path
          schema:
            type: string
            enum:
              - blog
              - video
              - audio
              - template
              - export-template
        - name: language
          required: true
          in: path
          schema:
            type: string
            enum:
              - Cy-az-AZ
              - Cy-sr-SP
              - Cy-uz-UZ
              - Lt-az-AZ
              - Lt-sr-SP
              - Lt-uz-UZ
              - aa
              - ab
              - ae
              - af
              - af-ZA
              - ak
              - am
              - an
              - ar
              - ar-AE
              - ar-BH
              - ar-DZ
              - ar-EG
              - ar-IQ
              - ar-JO
              - ar-KW
              - ar-LB
              - ar-LY
              - ar-MA
              - ar-OM
              - ar-QA
              - ar-SA
              - ar-SY
              - ar-TN
              - ar-YE
              - as
              - av
              - ay
              - az
              - ba
              - be
              - be-BY
              - bg
              - bg-BG
              - bh
              - bi
              - bm
              - bn
              - bo
              - br
              - bs
              - ca
              - ca-ES
              - ce
              - ch
              - co
              - cr
              - cs
              - cs-CZ
              - cu
              - cv
              - cy
              - da
              - da-DK
              - de
              - de-AT
              - de-CH
              - de-DE
              - de-LI
              - de-LU
              - div-MV
              - dv
              - dz
              - ee
              - el
              - el-GR
              - en
              - en-AU
              - en-BZ
              - en-CA
              - en-CB
              - en-GB
              - en-IE
              - en-JM
              - en-NZ
              - en-PH
              - en-TT
              - en-US
              - en-ZA
              - en-ZW
              - eo
              - es
              - es-AR
              - es-BO
              - es-CL
              - es-CO
              - es-CR
              - es-DO
              - es-EC
              - es-ES
              - es-GT
              - es-HN
              - es-MX
              - es-NI
              - es-PA
              - es-PE
              - es-PR
              - es-PY
              - es-SV
              - es-UY
              - es-VE
              - et
              - et-EE
              - eu
              - eu-ES
              - fa
              - fa-IR
              - ff
              - fi
              - fi-FI
              - fj
              - fo
              - fo-FO
              - fr
              - fr-BE
              - fr-CA
              - fr-CH
              - fr-FR
              - fr-LU
              - fr-MC
              - fy
              - ga
              - gd
              - gl
              - gl-ES
              - gn
              - gu
              - gu-IN
              - gv
              - ha
              - he
              - he-IL
              - hi
              - hi-IN
              - ho
              - hr
              - hr-HR
              - ht
              - hu
              - hu-HU
              - hy
              - hy-AM
              - hz
              - ia
              - id
              - id-ID
              - ie
              - ig
              - ii
              - ik
              - io
              - is
              - is-IS
              - it
              - it-CH
              - it-IT
              - iu
              - ja
              - ja-JP
              - jv
              - ka
              - ka-GE
              - kg
              - ki
              - kj
              - kk
              - kk-KZ
              - kl
              - km
              - kn
              - kn-IN
              - ko
              - ko-KR
              - kr
              - ks
              - ku
              - kv
              - kw
              - ky
              - ky-KZ
              - la
              - lb
              - lg
              - li
              - ln
              - lo
              - lt
              - lt-LT
              - lu
              - lv
              - lv-LV
              - mg
              - mh
              - mi
              - mk
              - mk-MK
              - ml
              - mn
              - mn-MN
              - mr
              - mr-IN
              - ms
              - ms-BN
              - ms-MY
              - mt
              - my
              - na
              - nb
              - nb-NO
              - nd
              - ne
              - ng
              - nl
              - nl-BE
              - nl-NL
              - nn
              - nn-NO
              - no
              - nr
              - nv
              - ny
              - oc
              - oj
              - om
              - or
              - os
              - pa
              - pa-IN
              - pi
              - pl
              - pl-PL
              - ps
              - pt
              - pt-BR
              - pt-PT
              - qu
              - rm
              - rn
              - ro
              - ro-RO
              - ru
              - ru-RU
              - rw
              - sa
              - sa-IN
              - sc
              - sd
              - se
              - sg
              - si
              - sk
              - sk-SK
              - sl
              - sl-SI
              - sm
              - sn
              - so
              - sq
              - sq-AL
              - sr
              - ss
              - st
              - su
              - sv
              - sv-FI
              - sv-SE
              - sw
              - sw-KE
              - ta
              - ta-IN
              - te
              - te-IN
              - tg
              - th
              - th-TH
              - ti
              - tk
              - tl
              - tn
              - to
              - tr
              - tr-TR
              - ts
              - tt
              - tt-RU
              - tw
              - ty
              - ug
              - uk
              - uk-UA
              - ur
              - ur-PK
              - uz
              - ve
              - vi
              - vi-VN
              - vo
              - wa
              - wo
              - xh
              - yi
              - yo
              - za
              - zh
              - zh-CHS
              - zh-CHT
              - zh-CN
              - zh-HK
              - zh-MO
              - zh-SG
              - zh-TW
              - zu
      responses:
        "200":
          description: ""
        "400": *a43
        "401": *a44
        "404": *a45
        "422": *a46
        "500": *a47
      security:
        - *a48
        - bearer: []
      summary: Copy contents
      tags:
        - CMS (FHIR Legacy)
  /cms/{type}/{language}/{key}/copy-from-parent-project:
    post:
      description: Copy a content.
      operationId: CMSController_copySingleContent[0]
      parameters:
        - name: type
          required: true
          in: path
          schema:
            type: string
            enum:
              - blog
              - video
              - audio
              - template
              - export-template
        - name: language
          required: true
          in: path
          schema:
            type: string
            enum:
              - Cy-az-AZ
              - Cy-sr-SP
              - Cy-uz-UZ
              - Lt-az-AZ
              - Lt-sr-SP
              - Lt-uz-UZ
              - aa
              - ab
              - ae
              - af
              - af-ZA
              - ak
              - am
              - an
              - ar
              - ar-AE
              - ar-BH
              - ar-DZ
              - ar-EG
              - ar-IQ
              - ar-JO
              - ar-KW
              - ar-LB
              - ar-LY
              - ar-MA
              - ar-OM
              - ar-QA
              - ar-SA
              - ar-SY
              - ar-TN
              - ar-YE
              - as
              - av
              - ay
              - az
              - ba
              - be
              - be-BY
              - bg
              - bg-BG
              - bh
              - bi
              - bm
              - bn
              - bo
              - br
              - bs
              - ca
              - ca-ES
              - ce
              - ch
              - co
              - cr
              - cs
              - cs-CZ
              - cu
              - cv
              - cy
              - da
              - da-DK
              - de
              - de-AT
              - de-CH
              - de-DE
              - de-LI
              - de-LU
              - div-MV
              - dv
              - dz
              - ee
              - el
              - el-GR
              - en
              - en-AU
              - en-BZ
              - en-CA
              - en-CB
              - en-GB
              - en-IE
              - en-JM
              - en-NZ
              - en-PH
              - en-TT
              - en-US
              - en-ZA
              - en-ZW
              - eo
              - es
              - es-AR
              - es-BO
              - es-CL
              - es-CO
              - es-CR
              - es-DO
              - es-EC
              - es-ES
              - es-GT
              - es-HN
              - es-MX
              - es-NI
              - es-PA
              - es-PE
              - es-PR
              - es-PY
              - es-SV
              - es-UY
              - es-VE
              - et
              - et-EE
              - eu
              - eu-ES
              - fa
              - fa-IR
              - ff
              - fi
              - fi-FI
              - fj
              - fo
              - fo-FO
              - fr
              - fr-BE
              - fr-CA
              - fr-CH
              - fr-FR
              - fr-LU
              - fr-MC
              - fy
              - ga
              - gd
              - gl
              - gl-ES
              - gn
              - gu
              - gu-IN
              - gv
              - ha
              - he
              - he-IL
              - hi
              - hi-IN
              - ho
              - hr
              - hr-HR
              - ht
              - hu
              - hu-HU
              - hy
              - hy-AM
              - hz
              - ia
              - id
              - id-ID
              - ie
              - ig
              - ii
              - ik
              - io
              - is
              - is-IS
              - it
              - it-CH
              - it-IT
              - iu
              - ja
              - ja-JP
              - jv
              - ka
              - ka-GE
              - kg
              - ki
              - kj
              - kk
              - kk-KZ
              - kl
              - km
              - kn
              - kn-IN
              - ko
              - ko-KR
              - kr
              - ks
              - ku
              - kv
              - kw
              - ky
              - ky-KZ
              - la
              - lb
              - lg
              - li
              - ln
              - lo
              - lt
              - lt-LT
              - lu
              - lv
              - lv-LV
              - mg
              - mh
              - mi
              - mk
              - mk-MK
              - ml
              - mn
              - mn-MN
              - mr
              - mr-IN
              - ms
              - ms-BN
              - ms-MY
              - mt
              - my
              - na
              - nb
              - nb-NO
              - nd
              - ne
              - ng
              - nl
              - nl-BE
              - nl-NL
              - nn
              - nn-NO
              - no
              - nr
              - nv
              - ny
              - oc
              - oj
              - om
              - or
              - os
              - pa
              - pa-IN
              - pi
              - pl
              - pl-PL
              - ps
              - pt
              - pt-BR
              - pt-PT
              - qu
              - rm
              - rn
              - ro
              - ro-RO
              - ru
              - ru-RU
              - rw
              - sa
              - sa-IN
              - sc
              - sd
              - se
              - sg
              - si
              - sk
              - sk-SK
              - sl
              - sl-SI
              - sm
              - sn
              - so
              - sq
              - sq-AL
              - sr
              - ss
              - st
              - su
              - sv
              - sv-FI
              - sv-SE
              - sw
              - sw-KE
              - ta
              - ta-IN
              - te
              - te-IN
              - tg
              - th
              - th-TH
              - ti
              - tk
              - tl
              - tn
              - to
              - tr
              - tr-TR
              - ts
              - tt
              - tt-RU
              - tw
              - ty
              - ug
              - uk
              - uk-UA
              - ur
              - ur-PK
              - uz
              - ve
              - vi
              - vi-VN
              - vo
              - wa
              - wo
              - xh
              - yi
              - yo
              - za
              - zh
              - zh-CHS
              - zh-CHT
              - zh-CN
              - zh-HK
              - zh-MO
              - zh-SG
              - zh-TW
              - zu
        - name: key
          required: true
          in: path
          description: A key that is used to identify the content between languages.
          schema:
            minLength: 16
            type: string
      responses:
        "200":
          description: ""
        "400": *a43
        "401": *a44
        "404": *a45
        "422": *a46
        "500": *a47
      security:
        - *a48
        - bearer: []
      summary: Copy a content
      tags:
        - CMS (FHIR Legacy)
  /internal/cms/{type}/{language}/{key}/copy-from-parent-project:
    post:
      description: Copy a content.
      operationId: CMSController_copySingleContent[1]
      parameters:
        - name: type
          required: true
          in: path
          schema:
            type: string
            enum:
              - blog
              - video
              - audio
              - template
              - export-template
        - name: language
          required: true
          in: path
          schema:
            type: string
            enum:
              - Cy-az-AZ
              - Cy-sr-SP
              - Cy-uz-UZ
              - Lt-az-AZ
              - Lt-sr-SP
              - Lt-uz-UZ
              - aa
              - ab
              - ae
              - af
              - af-ZA
              - ak
              - am
              - an
              - ar
              - ar-AE
              - ar-BH
              - ar-DZ
              - ar-EG
              - ar-IQ
              - ar-JO
              - ar-KW
              - ar-LB
              - ar-LY
              - ar-MA
              - ar-OM
              - ar-QA
              - ar-SA
              - ar-SY
              - ar-TN
              - ar-YE
              - as
              - av
              - ay
              - az
              - ba
              - be
              - be-BY
              - bg
              - bg-BG
              - bh
              - bi
              - bm
              - bn
              - bo
              - br
              - bs
              - ca
              - ca-ES
              - ce
              - ch
              - co
              - cr
              - cs
              - cs-CZ
              - cu
              - cv
              - cy
              - da
              - da-DK
              - de
              - de-AT
              - de-CH
              - de-DE
              - de-LI
              - de-LU
              - div-MV
              - dv
              - dz
              - ee
              - el
              - el-GR
              - en
              - en-AU
              - en-BZ
              - en-CA
              - en-CB
              - en-GB
              - en-IE
              - en-JM
              - en-NZ
              - en-PH
              - en-TT
              - en-US
              - en-ZA
              - en-ZW
              - eo
              - es
              - es-AR
              - es-BO
              - es-CL
              - es-CO
              - es-CR
              - es-DO
              - es-EC
              - es-ES
              - es-GT
              - es-HN
              - es-MX
              - es-NI
              - es-PA
              - es-PE
              - es-PR
              - es-PY
              - es-SV
              - es-UY
              - es-VE
              - et
              - et-EE
              - eu
              - eu-ES
              - fa
              - fa-IR
              - ff
              - fi
              - fi-FI
              - fj
              - fo
              - fo-FO
              - fr
              - fr-BE
              - fr-CA
              - fr-CH
              - fr-FR
              - fr-LU
              - fr-MC
              - fy
              - ga
              - gd
              - gl
              - gl-ES
              - gn
              - gu
              - gu-IN
              - gv
              - ha
              - he
              - he-IL
              - hi
              - hi-IN
              - ho
              - hr
              - hr-HR
              - ht
              - hu
              - hu-HU
              - hy
              - hy-AM
              - hz
              - ia
              - id
              - id-ID
              - ie
              - ig
              - ii
              - ik
              - io
              - is
              - is-IS
              - it
              - it-CH
              - it-IT
              - iu
              - ja
              - ja-JP
              - jv
              - ka
              - ka-GE
              - kg
              - ki
              - kj
              - kk
              - kk-KZ
              - kl
              - km
              - kn
              - kn-IN
              - ko
              - ko-KR
              - kr
              - ks
              - ku
              - kv
              - kw
              - ky
              - ky-KZ
              - la
              - lb
              - lg
              - li
              - ln
              - lo
              - lt
              - lt-LT
              - lu
              - lv
              - lv-LV
              - mg
              - mh
              - mi
              - mk
              - mk-MK
              - ml
              - mn
              - mn-MN
              - mr
              - mr-IN
              - ms
              - ms-BN
              - ms-MY
              - mt
              - my
              - na
              - nb
              - nb-NO
              - nd
              - ne
              - ng
              - nl
              - nl-BE
              - nl-NL
              - nn
              - nn-NO
              - no
              - nr
              - nv
              - ny
              - oc
              - oj
              - om
              - or
              - os
              - pa
              - pa-IN
              - pi
              - pl
              - pl-PL
              - ps
              - pt
              - pt-BR
              - pt-PT
              - qu
              - rm
              - rn
              - ro
              - ro-RO
              - ru
              - ru-RU
              - rw
              - sa
              - sa-IN
              - sc
              - sd
              - se
              - sg
              - si
              - sk
              - sk-SK
              - sl
              - sl-SI
              - sm
              - sn
              - so
              - sq
              - sq-AL
              - sr
              - ss
              - st
              - su
              - sv
              - sv-FI
              - sv-SE
              - sw
              - sw-KE
              - ta
              - ta-IN
              - te
              - te-IN
              - tg
              - th
              - th-TH
              - ti
              - tk
              - tl
              - tn
              - to
              - tr
              - tr-TR
              - ts
              - tt
              - tt-RU
              - tw
              - ty
              - ug
              - uk
              - uk-UA
              - ur
              - ur-PK
              - uz
              - ve
              - vi
              - vi-VN
              - vo
              - wa
              - wo
              - xh
              - yi
              - yo
              - za
              - zh
              - zh-CHS
              - zh-CHT
              - zh-CN
              - zh-HK
              - zh-MO
              - zh-SG
              - zh-TW
              - zu
        - name: key
          required: true
          in: path
          description: A key that is used to identify the content between languages.
          schema:
            minLength: 16
            type: string
      responses:
        "200":
          description: ""
        "400": *a43
        "401": *a44
        "404": *a45
        "422": *a46
        "500": *a47
      security:
        - *a48
        - bearer: []
      summary: Copy a content
      tags:
        - CMS (FHIR Legacy)
  /cms/{type}/{language}:
    post:
      description: >
        # Create Content


        Create a new CMS content entry for a given content type and language.

        <br>The content is stored as a FHIR Composition resource scoped to the
        caller's project. A unique key is auto-generated from the title and used
        to link translations across languages.


        ## Path Parameters


        | Parameter  | Description                                      |
        Example     |

        | ---------- | ------------------------------------------------ |
        ----------- |

        | `type`     | Content type (e.g. `article`, `faq`, `exercise`) |
        `article`   |

        | `language` | ISO language code                                |
        `en-US`     |


        ## Request Body


        | Field      | Type       |
        Description                                                  |

        | ---------- | ---------- |
        ------------------------------------------------------------ |

        | `title`    | `string`   | Title of the content
        entry                                   |

        | `category` | `string`   | Category
        identifier                                          |

        | `section`  | `array`    | Array of sections, each with `title`,
        `text`, and `code`     |

        | `code`     | `string`   | Optional code used for additional
        classification             |


        ## Example cURL request


        ```bash

        curl -X POST \
         --url 'https://api.dev.ovok.com/cms/article/en-US' \
         -H 'Authorization: Bearer <token>' \
         -H 'Content-Type: application/json' \
         -d '{
            "title": "My Blog",
            "category": "123",
            "section": [
              { "title": "Intro", "text": "Welcome text", "code": ["main-content"] }
            ]
        }'

        ```


        **Side Effects:** A background job is enqueued for every other language
        configured in the project locale, so translation stubs can be generated
        automatically.


        **Notes:** The same description is reused for the **Update content**
        (`PUT /:language/:key`) route. Updates follow the same body schema but
        target an existing key.
      operationId: CMSController_createContent[0]
      parameters:
        - name: type
          required: true
          in: path
          schema:
            type: string
            enum:
              - blog
              - video
              - audio
              - template
              - export-template
        - name: language
          required: true
          in: path
          schema:
            type: string
            enum:
              - Cy-az-AZ
              - Cy-sr-SP
              - Cy-uz-UZ
              - Lt-az-AZ
              - Lt-sr-SP
              - Lt-uz-UZ
              - aa
              - ab
              - ae
              - af
              - af-ZA
              - ak
              - am
              - an
              - ar
              - ar-AE
              - ar-BH
              - ar-DZ
              - ar-EG
              - ar-IQ
              - ar-JO
              - ar-KW
              - ar-LB
              - ar-LY
              - ar-MA
              - ar-OM
              - ar-QA
              - ar-SA
              - ar-SY
              - ar-TN
              - ar-YE
              - as
              - av
              - ay
              - az
              - ba
              - be
              - be-BY
              - bg
              - bg-BG
              - bh
              - bi
              - bm
              - bn
              - bo
              - br
              - bs
              - ca
              - ca-ES
              - ce
              - ch
              - co
              - cr
              - cs
              - cs-CZ
              - cu
              - cv
              - cy
              - da
              - da-DK
              - de
              - de-AT
              - de-CH
              - de-DE
              - de-LI
              - de-LU
              - div-MV
              - dv
              - dz
              - ee
              - el
              - el-GR
              - en
              - en-AU
              - en-BZ
              - en-CA
              - en-CB
              - en-GB
              - en-IE
              - en-JM
              - en-NZ
              - en-PH
              - en-TT
              - en-US
              - en-ZA
              - en-ZW
              - eo
              - es
              - es-AR
              - es-BO
              - es-CL
              - es-CO
              - es-CR
              - es-DO
              - es-EC
              - es-ES
              - es-GT
              - es-HN
              - es-MX
              - es-NI
              - es-PA
              - es-PE
              - es-PR
              - es-PY
              - es-SV
              - es-UY
              - es-VE
              - et
              - et-EE
              - eu
              - eu-ES
              - fa
              - fa-IR
              - ff
              - fi
              - fi-FI
              - fj
              - fo
              - fo-FO
              - fr
              - fr-BE
              - fr-CA
              - fr-CH
              - fr-FR
              - fr-LU
              - fr-MC
              - fy
              - ga
              - gd
              - gl
              - gl-ES
              - gn
              - gu
              - gu-IN
              - gv
              - ha
              - he
              - he-IL
              - hi
              - hi-IN
              - ho
              - hr
              - hr-HR
              - ht
              - hu
              - hu-HU
              - hy
              - hy-AM
              - hz
              - ia
              - id
              - id-ID
              - ie
              - ig
              - ii
              - ik
              - io
              - is
              - is-IS
              - it
              - it-CH
              - it-IT
              - iu
              - ja
              - ja-JP
              - jv
              - ka
              - ka-GE
              - kg
              - ki
              - kj
              - kk
              - kk-KZ
              - kl
              - km
              - kn
              - kn-IN
              - ko
              - ko-KR
              - kr
              - ks
              - ku
              - kv
              - kw
              - ky
              - ky-KZ
              - la
              - lb
              - lg
              - li
              - ln
              - lo
              - lt
              - lt-LT
              - lu
              - lv
              - lv-LV
              - mg
              - mh
              - mi
              - mk
              - mk-MK
              - ml
              - mn
              - mn-MN
              - mr
              - mr-IN
              - ms
              - ms-BN
              - ms-MY
              - mt
              - my
              - na
              - nb
              - nb-NO
              - nd
              - ne
              - ng
              - nl
              - nl-BE
              - nl-NL
              - nn
              - nn-NO
              - no
              - nr
              - nv
              - ny
              - oc
              - oj
              - om
              - or
              - os
              - pa
              - pa-IN
              - pi
              - pl
              - pl-PL
              - ps
              - pt
              - pt-BR
              - pt-PT
              - qu
              - rm
              - rn
              - ro
              - ro-RO
              - ru
              - ru-RU
              - rw
              - sa
              - sa-IN
              - sc
              - sd
              - se
              - sg
              - si
              - sk
              - sk-SK
              - sl
              - sl-SI
              - sm
              - sn
              - so
              - sq
              - sq-AL
              - sr
              - ss
              - st
              - su
              - sv
              - sv-FI
              - sv-SE
              - sw
              - sw-KE
              - ta
              - ta-IN
              - te
              - te-IN
              - tg
              - th
              - th-TH
              - ti
              - tk
              - tl
              - tn
              - to
              - tr
              - tr-TR
              - ts
              - tt
              - tt-RU
              - tw
              - ty
              - ug
              - uk
              - uk-UA
              - ur
              - ur-PK
              - uz
              - ve
              - vi
              - vi-VN
              - vo
              - wa
              - wo
              - xh
              - yi
              - yo
              - za
              - zh
              - zh-CHS
              - zh-CHT
              - zh-CN
              - zh-HK
              - zh-MO
              - zh-SG
              - zh-TW
              - zu
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/ContentBodyDto"
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ContentDto"
        "400": *a43
        "401": *a44
        "404": *a45
        "422": *a46
        "500": *a47
      security:
        - *a48
        - bearer: []
      summary: Create content
      tags:
        - CMS (FHIR Legacy)
    get:
      description: >
        # Search Content


        Search and paginate CMS content entries for a given content type and
        language.

        <br>Results are sorted by date (newest first). An optional free-text
        search performs fuzzy matching across title, author, category, section
        titles, section text, and key.


        ## Path Parameters


        | Parameter  |
        Description                                                     |
        Example     |

        | ---------- |
        --------------------------------------------------------------- |
        ----------- |

        | `type`     | Content type (e.g. `article`, `faq`,
        `exercise`)                | `article`   |

        | `language` | ISO language
        code                                               | `en-US`     |


        ## Query Parameters


        | Parameter  | Type     | Description                                  |
        Default |

        | ---------- | -------- | -------------------------------------------- |
        ------- |

        | `search`   | `string` | Free-text fuzzy search term                  |
        -       |

        | `code`     | `string` | Filter by content code                       |
        -       |

        | `_count`   | `number` | Page size                                    |
        `10`    |

        | `_offset`  | `number` | Number of items to skip                      |
        `0`     |


        ## Example cURL request


        ```bash

        curl -X GET \
         --url 'https://api.dev.ovok.com/cms/article/en-US?search=Blog&_count=20&_offset=0' \
         -H 'Authorization: Bearer <token>'
        ```


        ## Response


        ```json

        {
          "total": 42,
          "resources": [
            {
              "id": "composition-id",
              "title": "My Blog",
              "category": "123",
              "section": [],
              "language": "en-US",
              "key": "article-my-blog-a1b2c3d4",
              "type": "article",
              "date": "2025-01-15T12:00:00.000Z",
              "author": {
                "reference": "Practitioner/abc",
                "display": "Dr. Smith"
              }
            }
          ]
        }

        ```


        **Notes:** The fuzzy search uses Fuse.js. When no `search` term is
        provided, all entries for the given type and language are returned,
        paginated by `_count` and `_offset`.
      operationId: CMSController_searchContent[0]
      parameters:
        - name: type
          required: true
          in: path
          schema:
            type: string
            enum:
              - blog
              - video
              - audio
              - template
              - export-template
        - name: language
          required: true
          in: path
          schema:
            type: string
            enum:
              - Cy-az-AZ
              - Cy-sr-SP
              - Cy-uz-UZ
              - Lt-az-AZ
              - Lt-sr-SP
              - Lt-uz-UZ
              - aa
              - ab
              - ae
              - af
              - af-ZA
              - ak
              - am
              - an
              - ar
              - ar-AE
              - ar-BH
              - ar-DZ
              - ar-EG
              - ar-IQ
              - ar-JO
              - ar-KW
              - ar-LB
              - ar-LY
              - ar-MA
              - ar-OM
              - ar-QA
              - ar-SA
              - ar-SY
              - ar-TN
              - ar-YE
              - as
              - av
              - ay
              - az
              - ba
              - be
              - be-BY
              - bg
              - bg-BG
              - bh
              - bi
              - bm
              - bn
              - bo
              - br
              - bs
              - ca
              - ca-ES
              - ce
              - ch
              - co
              - cr
              - cs
              - cs-CZ
              - cu
              - cv
              - cy
              - da
              - da-DK
              - de
              - de-AT
              - de-CH
              - de-DE
              - de-LI
              - de-LU
              - div-MV
              - dv
              - dz
              - ee
              - el
              - el-GR
              - en
              - en-AU
              - en-BZ
              - en-CA
              - en-CB
              - en-GB
              - en-IE
              - en-JM
              - en-NZ
              - en-PH
              - en-TT
              - en-US
              - en-ZA
              - en-ZW
              - eo
              - es
              - es-AR
              - es-BO
              - es-CL
              - es-CO
              - es-CR
              - es-DO
              - es-EC
              - es-ES
              - es-GT
              - es-HN
              - es-MX
              - es-NI
              - es-PA
              - es-PE
              - es-PR
              - es-PY
              - es-SV
              - es-UY
              - es-VE
              - et
              - et-EE
              - eu
              - eu-ES
              - fa
              - fa-IR
              - ff
              - fi
              - fi-FI
              - fj
              - fo
              - fo-FO
              - fr
              - fr-BE
              - fr-CA
              - fr-CH
              - fr-FR
              - fr-LU
              - fr-MC
              - fy
              - ga
              - gd
              - gl
              - gl-ES
              - gn
              - gu
              - gu-IN
              - gv
              - ha
              - he
              - he-IL
              - hi
              - hi-IN
              - ho
              - hr
              - hr-HR
              - ht
              - hu
              - hu-HU
              - hy
              - hy-AM
              - hz
              - ia
              - id
              - id-ID
              - ie
              - ig
              - ii
              - ik
              - io
              - is
              - is-IS
              - it
              - it-CH
              - it-IT
              - iu
              - ja
              - ja-JP
              - jv
              - ka
              - ka-GE
              - kg
              - ki
              - kj
              - kk
              - kk-KZ
              - kl
              - km
              - kn
              - kn-IN
              - ko
              - ko-KR
              - kr
              - ks
              - ku
              - kv
              - kw
              - ky
              - ky-KZ
              - la
              - lb
              - lg
              - li
              - ln
              - lo
              - lt
              - lt-LT
              - lu
              - lv
              - lv-LV
              - mg
              - mh
              - mi
              - mk
              - mk-MK
              - ml
              - mn
              - mn-MN
              - mr
              - mr-IN
              - ms
              - ms-BN
              - ms-MY
              - mt
              - my
              - na
              - nb
              - nb-NO
              - nd
              - ne
              - ng
              - nl
              - nl-BE
              - nl-NL
              - nn
              - nn-NO
              - no
              - nr
              - nv
              - ny
              - oc
              - oj
              - om
              - or
              - os
              - pa
              - pa-IN
              - pi
              - pl
              - pl-PL
              - ps
              - pt
              - pt-BR
              - pt-PT
              - qu
              - rm
              - rn
              - ro
              - ro-RO
              - ru
              - ru-RU
              - rw
              - sa
              - sa-IN
              - sc
              - sd
              - se
              - sg
              - si
              - sk
              - sk-SK
              - sl
              - sl-SI
              - sm
              - sn
              - so
              - sq
              - sq-AL
              - sr
              - ss
              - st
              - su
              - sv
              - sv-FI
              - sv-SE
              - sw
              - sw-KE
              - ta
              - ta-IN
              - te
              - te-IN
              - tg
              - th
              - th-TH
              - ti
              - tk
              - tl
              - tn
              - to
              - tr
              - tr-TR
              - ts
              - tt
              - tt-RU
              - tw
              - ty
              - ug
              - uk
              - uk-UA
              - ur
              - ur-PK
              - uz
              - ve
              - vi
              - vi-VN
              - vo
              - wa
              - wo
              - xh
              - yi
              - yo
              - za
              - zh
              - zh-CHS
              - zh-CHT
              - zh-CN
              - zh-HK
              - zh-MO
              - zh-SG
              - zh-TW
              - zu
        - name: search
          required: false
          in: query
          schema:
            type: string
        - name: code
          required: false
          in: query
          schema:
            type: string
        - name: _count
          required: false
          in: query
          schema:
            default: "10"
            type: string
        - name: _offset
          required: false
          in: query
          schema:
            default: "0"
            type: string
      responses:
        "200":
          description: ""
        "400": *a43
        "401": *a44
        "404": *a45
        "422": *a46
        "500": *a47
      security:
        - *a48
        - bearer: []
      summary: Search content
      tags:
        - CMS (FHIR Legacy)
  /internal/cms/{type}/{language}:
    post:
      description: >
        # Create Content


        Create a new CMS content entry for a given content type and language.

        <br>The content is stored as a FHIR Composition resource scoped to the
        caller's project. A unique key is auto-generated from the title and used
        to link translations across languages.


        ## Path Parameters


        | Parameter  | Description                                      |
        Example     |

        | ---------- | ------------------------------------------------ |
        ----------- |

        | `type`     | Content type (e.g. `article`, `faq`, `exercise`) |
        `article`   |

        | `language` | ISO language code                                |
        `en-US`     |


        ## Request Body


        | Field      | Type       |
        Description                                                  |

        | ---------- | ---------- |
        ------------------------------------------------------------ |

        | `title`    | `string`   | Title of the content
        entry                                   |

        | `category` | `string`   | Category
        identifier                                          |

        | `section`  | `array`    | Array of sections, each with `title`,
        `text`, and `code`     |

        | `code`     | `string`   | Optional code used for additional
        classification             |


        ## Example cURL request


        ```bash

        curl -X POST \
         --url 'https://api.dev.ovok.com/cms/article/en-US' \
         -H 'Authorization: Bearer <token>' \
         -H 'Content-Type: application/json' \
         -d '{
            "title": "My Blog",
            "category": "123",
            "section": [
              { "title": "Intro", "text": "Welcome text", "code": ["main-content"] }
            ]
        }'

        ```


        **Side Effects:** A background job is enqueued for every other language
        configured in the project locale, so translation stubs can be generated
        automatically.


        **Notes:** The same description is reused for the **Update content**
        (`PUT /:language/:key`) route. Updates follow the same body schema but
        target an existing key.
      operationId: CMSController_createContent[1]
      parameters:
        - name: type
          required: true
          in: path
          schema:
            type: string
            enum:
              - blog
              - video
              - audio
              - template
              - export-template
        - name: language
          required: true
          in: path
          schema:
            type: string
            enum:
              - Cy-az-AZ
              - Cy-sr-SP
              - Cy-uz-UZ
              - Lt-az-AZ
              - Lt-sr-SP
              - Lt-uz-UZ
              - aa
              - ab
              - ae
              - af
              - af-ZA
              - ak
              - am
              - an
              - ar
              - ar-AE
              - ar-BH
              - ar-DZ
              - ar-EG
              - ar-IQ
              - ar-JO
              - ar-KW
              - ar-LB
              - ar-LY
              - ar-MA
              - ar-OM
              - ar-QA
              - ar-SA
              - ar-SY
              - ar-TN
              - ar-YE
              - as
              - av
              - ay
              - az
              - ba
              - be
              - be-BY
              - bg
              - bg-BG
              - bh
              - bi
              - bm
              - bn
              - bo
              - br
              - bs
              - ca
              - ca-ES
              - ce
              - ch
              - co
              - cr
              - cs
              - cs-CZ
              - cu
              - cv
              - cy
              - da
              - da-DK
              - de
              - de-AT
              - de-CH
              - de-DE
              - de-LI
              - de-LU
              - div-MV
              - dv
              - dz
              - ee
              - el
              - el-GR
              - en
              - en-AU
              - en-BZ
              - en-CA
              - en-CB
              - en-GB
              - en-IE
              - en-JM
              - en-NZ
              - en-PH
              - en-TT
              - en-US
              - en-ZA
              - en-ZW
              - eo
              - es
              - es-AR
              - es-BO
              - es-CL
              - es-CO
              - es-CR
              - es-DO
              - es-EC
              - es-ES
              - es-GT
              - es-HN
              - es-MX
              - es-NI
              - es-PA
              - es-PE
              - es-PR
              - es-PY
              - es-SV
              - es-UY
              - es-VE
              - et
              - et-EE
              - eu
              - eu-ES
              - fa
              - fa-IR
              - ff
              - fi
              - fi-FI
              - fj
              - fo
              - fo-FO
              - fr
              - fr-BE
              - fr-CA
              - fr-CH
              - fr-FR
              - fr-LU
              - fr-MC
              - fy
              - ga
              - gd
              - gl
              - gl-ES
              - gn
              - gu
              - gu-IN
              - gv
              - ha
              - he
              - he-IL
              - hi
              - hi-IN
              - ho
              - hr
              - hr-HR
              - ht
              - hu
              - hu-HU
              - hy
              - hy-AM
              - hz
              - ia
              - id
              - id-ID
              - ie
              - ig
              - ii
              - ik
              - io
              - is
              - is-IS
              - it
              - it-CH
              - it-IT
              - iu
              - ja
              - ja-JP
              - jv
              - ka
              - ka-GE
              - kg
              - ki
              - kj
              - kk
              - kk-KZ
              - kl
              - km
              - kn
              - kn-IN
              - ko
              - ko-KR
              - kr
              - ks
              - ku
              - kv
              - kw
              - ky
              - ky-KZ
              - la
              - lb
              - lg
              - li
              - ln
              - lo
              - lt
              - lt-LT
              - lu
              - lv
              - lv-LV
              - mg
              - mh
              - mi
              - mk
              - mk-MK
              - ml
              - mn
              - mn-MN
              - mr
              - mr-IN
              - ms
              - ms-BN
              - ms-MY
              - mt
              - my
              - na
              - nb
              - nb-NO
              - nd
              - ne
              - ng
              - nl
              - nl-BE
              - nl-NL
              - nn
              - nn-NO
              - no
              - nr
              - nv
              - ny
              - oc
              - oj
              - om
              - or
              - os
              - pa
              - pa-IN
              - pi
              - pl
              - pl-PL
              - ps
              - pt
              - pt-BR
              - pt-PT
              - qu
              - rm
              - rn
              - ro
              - ro-RO
              - ru
              - ru-RU
              - rw
              - sa
              - sa-IN
              - sc
              - sd
              - se
              - sg
              - si
              - sk
              - sk-SK
              - sl
              - sl-SI
              - sm
              - sn
              - so
              - sq
              - sq-AL
              - sr
              - ss
              - st
              - su
              - sv
              - sv-FI
              - sv-SE
              - sw
              - sw-KE
              - ta
              - ta-IN
              - te
              - te-IN
              - tg
              - th
              - th-TH
              - ti
              - tk
              - tl
              - tn
              - to
              - tr
              - tr-TR
              - ts
              - tt
              - tt-RU
              - tw
              - ty
              - ug
              - uk
              - uk-UA
              - ur
              - ur-PK
              - uz
              - ve
              - vi
              - vi-VN
              - vo
              - wa
              - wo
              - xh
              - yi
              - yo
              - za
              - zh
              - zh-CHS
              - zh-CHT
              - zh-CN
              - zh-HK
              - zh-MO
              - zh-SG
              - zh-TW
              - zu
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/ContentBodyDto"
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ContentDto"
        "400": *a43
        "401": *a44
        "404": *a45
        "422": *a46
        "500": *a47
      security:
        - *a48
        - bearer: []
      summary: Create content
      tags:
        - CMS (FHIR Legacy)
    get:
      description: >
        # Search Content


        Search and paginate CMS content entries for a given content type and
        language.

        <br>Results are sorted by date (newest first). An optional free-text
        search performs fuzzy matching across title, author, category, section
        titles, section text, and key.


        ## Path Parameters


        | Parameter  |
        Description                                                     |
        Example     |

        | ---------- |
        --------------------------------------------------------------- |
        ----------- |

        | `type`     | Content type (e.g. `article`, `faq`,
        `exercise`)                | `article`   |

        | `language` | ISO language
        code                                               | `en-US`     |


        ## Query Parameters


        | Parameter  | Type     | Description                                  |
        Default |

        | ---------- | -------- | -------------------------------------------- |
        ------- |

        | `search`   | `string` | Free-text fuzzy search term                  |
        -       |

        | `code`     | `string` | Filter by content code                       |
        -       |

        | `_count`   | `number` | Page size                                    |
        `10`    |

        | `_offset`  | `number` | Number of items to skip                      |
        `0`     |


        ## Example cURL request


        ```bash

        curl -X GET \
         --url 'https://api.dev.ovok.com/cms/article/en-US?search=Blog&_count=20&_offset=0' \
         -H 'Authorization: Bearer <token>'
        ```


        ## Response


        ```json

        {
          "total": 42,
          "resources": [
            {
              "id": "composition-id",
              "title": "My Blog",
              "category": "123",
              "section": [],
              "language": "en-US",
              "key": "article-my-blog-a1b2c3d4",
              "type": "article",
              "date": "2025-01-15T12:00:00.000Z",
              "author": {
                "reference": "Practitioner/abc",
                "display": "Dr. Smith"
              }
            }
          ]
        }

        ```


        **Notes:** The fuzzy search uses Fuse.js. When no `search` term is
        provided, all entries for the given type and language are returned,
        paginated by `_count` and `_offset`.
      operationId: CMSController_searchContent[1]
      parameters:
        - name: type
          required: true
          in: path
          schema:
            type: string
            enum:
              - blog
              - video
              - audio
              - template
              - export-template
        - name: language
          required: true
          in: path
          schema:
            type: string
            enum:
              - Cy-az-AZ
              - Cy-sr-SP
              - Cy-uz-UZ
              - Lt-az-AZ
              - Lt-sr-SP
              - Lt-uz-UZ
              - aa
              - ab
              - ae
              - af
              - af-ZA
              - ak
              - am
              - an
              - ar
              - ar-AE
              - ar-BH
              - ar-DZ
              - ar-EG
              - ar-IQ
              - ar-JO
              - ar-KW
              - ar-LB
              - ar-LY
              - ar-MA
              - ar-OM
              - ar-QA
              - ar-SA
              - ar-SY
              - ar-TN
              - ar-YE
              - as
              - av
              - ay
              - az
              - ba
              - be
              - be-BY
              - bg
              - bg-BG
              - bh
              - bi
              - bm
              - bn
              - bo
              - br
              - bs
              - ca
              - ca-ES
              - ce
              - ch
              - co
              - cr
              - cs
              - cs-CZ
              - cu
              - cv
              - cy
              - da
              - da-DK
              - de
              - de-AT
              - de-CH
              - de-DE
              - de-LI
              - de-LU
              - div-MV
              - dv
              - dz
              - ee
              - el
              - el-GR
              - en
              - en-AU
              - en-BZ
              - en-CA
              - en-CB
              - en-GB
              - en-IE
              - en-JM
              - en-NZ
              - en-PH
              - en-TT
              - en-US
              - en-ZA
              - en-ZW
              - eo
              - es
              - es-AR
              - es-BO
              - es-CL
              - es-CO
              - es-CR
              - es-DO
              - es-EC
              - es-ES
              - es-GT
              - es-HN
              - es-MX
              - es-NI
              - es-PA
              - es-PE
              - es-PR
              - es-PY
              - es-SV
              - es-UY
              - es-VE
              - et
              - et-EE
              - eu
              - eu-ES
              - fa
              - fa-IR
              - ff
              - fi
              - fi-FI
              - fj
              - fo
              - fo-FO
              - fr
              - fr-BE
              - fr-CA
              - fr-CH
              - fr-FR
              - fr-LU
              - fr-MC
              - fy
              - ga
              - gd
              - gl
              - gl-ES
              - gn
              - gu
              - gu-IN
              - gv
              - ha
              - he
              - he-IL
              - hi
              - hi-IN
              - ho
              - hr
              - hr-HR
              - ht
              - hu
              - hu-HU
              - hy
              - hy-AM
              - hz
              - ia
              - id
              - id-ID
              - ie
              - ig
              - ii
              - ik
              - io
              - is
              - is-IS
              - it
              - it-CH
              - it-IT
              - iu
              - ja
              - ja-JP
              - jv
              - ka
              - ka-GE
              - kg
              - ki
              - kj
              - kk
              - kk-KZ
              - kl
              - km
              - kn
              - kn-IN
              - ko
              - ko-KR
              - kr
              - ks
              - ku
              - kv
              - kw
              - ky
              - ky-KZ
              - la
              - lb
              - lg
              - li
              - ln
              - lo
              - lt
              - lt-LT
              - lu
              - lv
              - lv-LV
              - mg
              - mh
              - mi
              - mk
              - mk-MK
              - ml
              - mn
              - mn-MN
              - mr
              - mr-IN
              - ms
              - ms-BN
              - ms-MY
              - mt
              - my
              - na
              - nb
              - nb-NO
              - nd
              - ne
              - ng
              - nl
              - nl-BE
              - nl-NL
              - nn
              - nn-NO
              - no
              - nr
              - nv
              - ny
              - oc
              - oj
              - om
              - or
              - os
              - pa
              - pa-IN
              - pi
              - pl
              - pl-PL
              - ps
              - pt
              - pt-BR
              - pt-PT
              - qu
              - rm
              - rn
              - ro
              - ro-RO
              - ru
              - ru-RU
              - rw
              - sa
              - sa-IN
              - sc
              - sd
              - se
              - sg
              - si
              - sk
              - sk-SK
              - sl
              - sl-SI
              - sm
              - sn
              - so
              - sq
              - sq-AL
              - sr
              - ss
              - st
              - su
              - sv
              - sv-FI
              - sv-SE
              - sw
              - sw-KE
              - ta
              - ta-IN
              - te
              - te-IN
              - tg
              - th
              - th-TH
              - ti
              - tk
              - tl
              - tn
              - to
              - tr
              - tr-TR
              - ts
              - tt
              - tt-RU
              - tw
              - ty
              - ug
              - uk
              - uk-UA
              - ur
              - ur-PK
              - uz
              - ve
              - vi
              - vi-VN
              - vo
              - wa
              - wo
              - xh
              - yi
              - yo
              - za
              - zh
              - zh-CHS
              - zh-CHT
              - zh-CN
              - zh-HK
              - zh-MO
              - zh-SG
              - zh-TW
              - zu
        - name: search
          required: false
          in: query
          schema:
            type: string
        - name: code
          required: false
          in: query
          schema:
            type: string
        - name: _count
          required: false
          in: query
          schema:
            default: "10"
            type: string
        - name: _offset
          required: false
          in: query
          schema:
            default: "0"
            type: string
      responses:
        "200":
          description: ""
        "400": *a43
        "401": *a44
        "404": *a45
        "422": *a46
        "500": *a47
      security:
        - *a48
        - bearer: []
      summary: Search content
      tags:
        - CMS (FHIR Legacy)
  /cms/{type}/{language}/{key}:
    put:
      description: >
        # Create Content


        Create a new CMS content entry for a given content type and language.

        <br>The content is stored as a FHIR Composition resource scoped to the
        caller's project. A unique key is auto-generated from the title and used
        to link translations across languages.


        ## Path Parameters


        | Parameter  | Description                                      |
        Example     |

        | ---------- | ------------------------------------------------ |
        ----------- |

        | `type`     | Content type (e.g. `article`, `faq`, `exercise`) |
        `article`   |

        | `language` | ISO language code                                |
        `en-US`     |


        ## Request Body


        | Field      | Type       |
        Description                                                  |

        | ---------- | ---------- |
        ------------------------------------------------------------ |

        | `title`    | `string`   | Title of the content
        entry                                   |

        | `category` | `string`   | Category
        identifier                                          |

        | `section`  | `array`    | Array of sections, each with `title`,
        `text`, and `code`     |

        | `code`     | `string`   | Optional code used for additional
        classification             |


        ## Example cURL request


        ```bash

        curl -X POST \
         --url 'https://api.dev.ovok.com/cms/article/en-US' \
         -H 'Authorization: Bearer <token>' \
         -H 'Content-Type: application/json' \
         -d '{
            "title": "My Blog",
            "category": "123",
            "section": [
              { "title": "Intro", "text": "Welcome text", "code": ["main-content"] }
            ]
        }'

        ```


        **Side Effects:** A background job is enqueued for every other language
        configured in the project locale, so translation stubs can be generated
        automatically.


        **Notes:** The same description is reused for the **Update content**
        (`PUT /:language/:key`) route. Updates follow the same body schema but
        target an existing key.
      operationId: CMSController_updateContent[0]
      parameters:
        - name: type
          required: true
          in: path
          schema:
            type: string
            enum:
              - blog
              - video
              - audio
              - template
              - export-template
        - name: language
          required: true
          in: path
          schema:
            type: string
            enum:
              - Cy-az-AZ
              - Cy-sr-SP
              - Cy-uz-UZ
              - Lt-az-AZ
              - Lt-sr-SP
              - Lt-uz-UZ
              - aa
              - ab
              - ae
              - af
              - af-ZA
              - ak
              - am
              - an
              - ar
              - ar-AE
              - ar-BH
              - ar-DZ
              - ar-EG
              - ar-IQ
              - ar-JO
              - ar-KW
              - ar-LB
              - ar-LY
              - ar-MA
              - ar-OM
              - ar-QA
              - ar-SA
              - ar-SY
              - ar-TN
              - ar-YE
              - as
              - av
              - ay
              - az
              - ba
              - be
              - be-BY
              - bg
              - bg-BG
              - bh
              - bi
              - bm
              - bn
              - bo
              - br
              - bs
              - ca
              - ca-ES
              - ce
              - ch
              - co
              - cr
              - cs
              - cs-CZ
              - cu
              - cv
              - cy
              - da
              - da-DK
              - de
              - de-AT
              - de-CH
              - de-DE
              - de-LI
              - de-LU
              - div-MV
              - dv
              - dz
              - ee
              - el
              - el-GR
              - en
              - en-AU
              - en-BZ
              - en-CA
              - en-CB
              - en-GB
              - en-IE
              - en-JM
              - en-NZ
              - en-PH
              - en-TT
              - en-US
              - en-ZA
              - en-ZW
              - eo
              - es
              - es-AR
              - es-BO
              - es-CL
              - es-CO
              - es-CR
              - es-DO
              - es-EC
              - es-ES
              - es-GT
              - es-HN
              - es-MX
              - es-NI
              - es-PA
              - es-PE
              - es-PR
              - es-PY
              - es-SV
              - es-UY
              - es-VE
              - et
              - et-EE
              - eu
              - eu-ES
              - fa
              - fa-IR
              - ff
              - fi
              - fi-FI
              - fj
              - fo
              - fo-FO
              - fr
              - fr-BE
              - fr-CA
              - fr-CH
              - fr-FR
              - fr-LU
              - fr-MC
              - fy
              - ga
              - gd
              - gl
              - gl-ES
              - gn
              - gu
              - gu-IN
              - gv
              - ha
              - he
              - he-IL
              - hi
              - hi-IN
              - ho
              - hr
              - hr-HR
              - ht
              - hu
              - hu-HU
              - hy
              - hy-AM
              - hz
              - ia
              - id
              - id-ID
              - ie
              - ig
              - ii
              - ik
              - io
              - is
              - is-IS
              - it
              - it-CH
              - it-IT
              - iu
              - ja
              - ja-JP
              - jv
              - ka
              - ka-GE
              - kg
              - ki
              - kj
              - kk
              - kk-KZ
              - kl
              - km
              - kn
              - kn-IN
              - ko
              - ko-KR
              - kr
              - ks
              - ku
              - kv
              - kw
              - ky
              - ky-KZ
              - la
              - lb
              - lg
              - li
              - ln
              - lo
              - lt
              - lt-LT
              - lu
              - lv
              - lv-LV
              - mg
              - mh
              - mi
              - mk
              - mk-MK
              - ml
              - mn
              - mn-MN
              - mr
              - mr-IN
              - ms
              - ms-BN
              - ms-MY
              - mt
              - my
              - na
              - nb
              - nb-NO
              - nd
              - ne
              - ng
              - nl
              - nl-BE
              - nl-NL
              - nn
              - nn-NO
              - no
              - nr
              - nv
              - ny
              - oc
              - oj
              - om
              - or
              - os
              - pa
              - pa-IN
              - pi
              - pl
              - pl-PL
              - ps
              - pt
              - pt-BR
              - pt-PT
              - qu
              - rm
              - rn
              - ro
              - ro-RO
              - ru
              - ru-RU
              - rw
              - sa
              - sa-IN
              - sc
              - sd
              - se
              - sg
              - si
              - sk
              - sk-SK
              - sl
              - sl-SI
              - sm
              - sn
              - so
              - sq
              - sq-AL
              - sr
              - ss
              - st
              - su
              - sv
              - sv-FI
              - sv-SE
              - sw
              - sw-KE
              - ta
              - ta-IN
              - te
              - te-IN
              - tg
              - th
              - th-TH
              - ti
              - tk
              - tl
              - tn
              - to
              - tr
              - tr-TR
              - ts
              - tt
              - tt-RU
              - tw
              - ty
              - ug
              - uk
              - uk-UA
              - ur
              - ur-PK
              - uz
              - ve
              - vi
              - vi-VN
              - vo
              - wa
              - wo
              - xh
              - yi
              - yo
              - za
              - zh
              - zh-CHS
              - zh-CHT
              - zh-CN
              - zh-HK
              - zh-MO
              - zh-SG
              - zh-TW
              - zu
        - name: key
          required: true
          in: path
          description: A key that is used to identify the content between languages.
          schema:
            minLength: 16
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/ContentBodyDto"
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ContentDto"
        "400": *a43
        "401": *a44
        "404": *a45
        "422": *a46
        "500": *a47
      security:
        - *a48
        - bearer: []
      summary: Update content
      tags:
        - CMS (FHIR Legacy)
    get:
      description: >
        # Get Content by Key and Language


        Retrieve a single CMS content entry by its unique key and language.

        <br>Returns the full content DTO including title, sections, author,
        date, and category.


        ## Path Parameters


        | Parameter  |
        Description                                                     |
        Example                      |

        | ---------- |
        --------------------------------------------------------------- |
        ---------------------------- |

        | `type`     | Content type (e.g. `article`, `faq`,
        `exercise`)                | `article`                    |

        | `language` | ISO language
        code                                               |
        `en-US`                      |

        | `key`      | Unique content key that links translations across
        languages     | `article-my-blog-a1b2c3d4`  |


        ## Example cURL request


        ```bash

        curl -X GET \
         --url 'https://api.dev.ovok.com/cms/article/en-US/article-my-blog-a1b2c3d4' \
         -H 'Authorization: Bearer <token>'
        ```


        ## Response


        Returns a `ContentDto` object:


        ```json

        {
          "id": "composition-id",
          "title": "My Blog",
          "category": "123",
          "section": [
            { "title": "Intro", "text": "Welcome text", "code": ["main-content"] }
          ],
          "language": "en-US",
          "key": "article-my-blog-a1b2c3d4",
          "type": "article",
          "date": "2025-01-15T12:00:00.000Z",
          "author": {
            "reference": "Practitioner/abc",
            "display": "Dr. Smith"
          }
        }

        ```


        **Notes:** Returns `404 Not Found` if no content matches the given type,
        language, and key within the caller's project.
      operationId: CMSController_getContent[0]
      parameters:
        - name: type
          required: true
          in: path
          schema:
            type: string
            enum:
              - blog
              - video
              - audio
              - template
              - export-template
        - name: language
          required: true
          in: path
          schema:
            type: string
            enum:
              - Cy-az-AZ
              - Cy-sr-SP
              - Cy-uz-UZ
              - Lt-az-AZ
              - Lt-sr-SP
              - Lt-uz-UZ
              - aa
              - ab
              - ae
              - af
              - af-ZA
              - ak
              - am
              - an
              - ar
              - ar-AE
              - ar-BH
              - ar-DZ
              - ar-EG
              - ar-IQ
              - ar-JO
              - ar-KW
              - ar-LB
              - ar-LY
              - ar-MA
              - ar-OM
              - ar-QA
              - ar-SA
              - ar-SY
              - ar-TN
              - ar-YE
              - as
              - av
              - ay
              - az
              - ba
              - be
              - be-BY
              - bg
              - bg-BG
              - bh
              - bi
              - bm
              - bn
              - bo
              - br
              - bs
              - ca
              - ca-ES
              - ce
              - ch
              - co
              - cr
              - cs
              - cs-CZ
              - cu
              - cv
              - cy
              - da
              - da-DK
              - de
              - de-AT
              - de-CH
              - de-DE
              - de-LI
              - de-LU
              - div-MV
              - dv
              - dz
              - ee
              - el
              - el-GR
              - en
              - en-AU
              - en-BZ
              - en-CA
              - en-CB
              - en-GB
              - en-IE
              - en-JM
              - en-NZ
              - en-PH
              - en-TT
              - en-US
              - en-ZA
              - en-ZW
              - eo
              - es
              - es-AR
              - es-BO
              - es-CL
              - es-CO
              - es-CR
              - es-DO
              - es-EC
              - es-ES
              - es-GT
              - es-HN
              - es-MX
              - es-NI
              - es-PA
              - es-PE
              - es-PR
              - es-PY
              - es-SV
              - es-UY
              - es-VE
              - et
              - et-EE
              - eu
              - eu-ES
              - fa
              - fa-IR
              - ff
              - fi
              - fi-FI
              - fj
              - fo
              - fo-FO
              - fr
              - fr-BE
              - fr-CA
              - fr-CH
              - fr-FR
              - fr-LU
              - fr-MC
              - fy
              - ga
              - gd
              - gl
              - gl-ES
              - gn
              - gu
              - gu-IN
              - gv
              - ha
              - he
              - he-IL
              - hi
              - hi-IN
              - ho
              - hr
              - hr-HR
              - ht
              - hu
              - hu-HU
              - hy
              - hy-AM
              - hz
              - ia
              - id
              - id-ID
              - ie
              - ig
              - ii
              - ik
              - io
              - is
              - is-IS
              - it
              - it-CH
              - it-IT
              - iu
              - ja
              - ja-JP
              - jv
              - ka
              - ka-GE
              - kg
              - ki
              - kj
              - kk
              - kk-KZ
              - kl
              - km
              - kn
              - kn-IN
              - ko
              - ko-KR
              - kr
              - ks
              - ku
              - kv
              - kw
              - ky
              - ky-KZ
              - la
              - lb
              - lg
              - li
              - ln
              - lo
              - lt
              - lt-LT
              - lu
              - lv
              - lv-LV
              - mg
              - mh
              - mi
              - mk
              - mk-MK
              - ml
              - mn
              - mn-MN
              - mr
              - mr-IN
              - ms
              - ms-BN
              - ms-MY
              - mt
              - my
              - na
              - nb
              - nb-NO
              - nd
              - ne
              - ng
              - nl
              - nl-BE
              - nl-NL
              - nn
              - nn-NO
              - no
              - nr
              - nv
              - ny
              - oc
              - oj
              - om
              - or
              - os
              - pa
              - pa-IN
              - pi
              - pl
              - pl-PL
              - ps
              - pt
              - pt-BR
              - pt-PT
              - qu
              - rm
              - rn
              - ro
              - ro-RO
              - ru
              - ru-RU
              - rw
              - sa
              - sa-IN
              - sc
              - sd
              - se
              - sg
              - si
              - sk
              - sk-SK
              - sl
              - sl-SI
              - sm
              - sn
              - so
              - sq
              - sq-AL
              - sr
              - ss
              - st
              - su
              - sv
              - sv-FI
              - sv-SE
              - sw
              - sw-KE
              - ta
              - ta-IN
              - te
              - te-IN
              - tg
              - th
              - th-TH
              - ti
              - tk
              - tl
              - tn
              - to
              - tr
              - tr-TR
              - ts
              - tt
              - tt-RU
              - tw
              - ty
              - ug
              - uk
              - uk-UA
              - ur
              - ur-PK
              - uz
              - ve
              - vi
              - vi-VN
              - vo
              - wa
              - wo
              - xh
              - yi
              - yo
              - za
              - zh
              - zh-CHS
              - zh-CHT
              - zh-CN
              - zh-HK
              - zh-MO
              - zh-SG
              - zh-TW
              - zu
        - name: key
          required: true
          in: path
          description: A key that is used to identify the content between languages.
          schema:
            minLength: 16
            type: string
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ContentDto"
        "400": *a43
        "401": *a44
        "404": *a45
        "422": *a46
        "500": *a47
      security:
        - *a48
        - bearer: []
      summary: Get content by key and language
      tags:
        - CMS (FHIR Legacy)
    delete:
      description: >
        # Delete Content


        Delete a CMS content entry identified by its language and key.

        <br>If the specified language is the project's default language, all
        translations sharing the same key are deleted as well. If it is a
        non-default language, only that single translation is removed.


        ## Path Parameters


        | Parameter  |
        Description                                                     |
        Example                      |

        | ---------- |
        --------------------------------------------------------------- |
        ---------------------------- |

        | `type`     | Content type (e.g. `article`, `faq`,
        `exercise`)                | `article`                    |

        | `language` | ISO language code of the content to
        delete                      | `en-US`                      |

        | `key`      | Unique content key that links translations across
        languages     | `article-my-blog-a1b2c3d4`  |


        ## Example cURL request


        ```bash

        curl -X DELETE \
         --url 'https://api.dev.ovok.com/cms/article/en-US/article-my-blog-a1b2c3d4' \
         -H 'Authorization: Bearer <token>'
        ```


        **Side Effects:** Deleting the default-language entry cascades to all
        related language variants. Deleting a non-default language entry only
        removes that single translation.


        **Notes:** The language provided in the path is validated against the
        project's configured locales before deletion proceeds.
      operationId: CMSController_deleteContent[0]
      parameters:
        - name: type
          required: true
          in: path
          schema:
            type: string
            enum:
              - blog
              - video
              - audio
              - template
              - export-template
        - name: language
          required: true
          in: path
          schema:
            type: string
            enum:
              - Cy-az-AZ
              - Cy-sr-SP
              - Cy-uz-UZ
              - Lt-az-AZ
              - Lt-sr-SP
              - Lt-uz-UZ
              - aa
              - ab
              - ae
              - af
              - af-ZA
              - ak
              - am
              - an
              - ar
              - ar-AE
              - ar-BH
              - ar-DZ
              - ar-EG
              - ar-IQ
              - ar-JO
              - ar-KW
              - ar-LB
              - ar-LY
              - ar-MA
              - ar-OM
              - ar-QA
              - ar-SA
              - ar-SY
              - ar-TN
              - ar-YE
              - as
              - av
              - ay
              - az
              - ba
              - be
              - be-BY
              - bg
              - bg-BG
              - bh
              - bi
              - bm
              - bn
              - bo
              - br
              - bs
              - ca
              - ca-ES
              - ce
              - ch
              - co
              - cr
              - cs
              - cs-CZ
              - cu
              - cv
              - cy
              - da
              - da-DK
              - de
              - de-AT
              - de-CH
              - de-DE
              - de-LI
              - de-LU
              - div-MV
              - dv
              - dz
              - ee
              - el
              - el-GR
              - en
              - en-AU
              - en-BZ
              - en-CA
              - en-CB
              - en-GB
              - en-IE
              - en-JM
              - en-NZ
              - en-PH
              - en-TT
              - en-US
              - en-ZA
              - en-ZW
              - eo
              - es
              - es-AR
              - es-BO
              - es-CL
              - es-CO
              - es-CR
              - es-DO
              - es-EC
              - es-ES
              - es-GT
              - es-HN
              - es-MX
              - es-NI
              - es-PA
              - es-PE
              - es-PR
              - es-PY
              - es-SV
              - es-UY
              - es-VE
              - et
              - et-EE
              - eu
              - eu-ES
              - fa
              - fa-IR
              - ff
              - fi
              - fi-FI
              - fj
              - fo
              - fo-FO
              - fr
              - fr-BE
              - fr-CA
              - fr-CH
              - fr-FR
              - fr-LU
              - fr-MC
              - fy
              - ga
              - gd
              - gl
              - gl-ES
              - gn
              - gu
              - gu-IN
              - gv
              - ha
              - he
              - he-IL
              - hi
              - hi-IN
              - ho
              - hr
              - hr-HR
              - ht
              - hu
              - hu-HU
              - hy
              - hy-AM
              - hz
              - ia
              - id
              - id-ID
              - ie
              - ig
              - ii
              - ik
              - io
              - is
              - is-IS
              - it
              - it-CH
              - it-IT
              - iu
              - ja
              - ja-JP
              - jv
              - ka
              - ka-GE
              - kg
              - ki
              - kj
              - kk
              - kk-KZ
              - kl
              - km
              - kn
              - kn-IN
              - ko
              - ko-KR
              - kr
              - ks
              - ku
              - kv
              - kw
              - ky
              - ky-KZ
              - la
              - lb
              - lg
              - li
              - ln
              - lo
              - lt
              - lt-LT
              - lu
              - lv
              - lv-LV
              - mg
              - mh
              - mi
              - mk
              - mk-MK
              - ml
              - mn
              - mn-MN
              - mr
              - mr-IN
              - ms
              - ms-BN
              - ms-MY
              - mt
              - my
              - na
              - nb
              - nb-NO
              - nd
              - ne
              - ng
              - nl
              - nl-BE
              - nl-NL
              - nn
              - nn-NO
              - no
              - nr
              - nv
              - ny
              - oc
              - oj
              - om
              - or
              - os
              - pa
              - pa-IN
              - pi
              - pl
              - pl-PL
              - ps
              - pt
              - pt-BR
              - pt-PT
              - qu
              - rm
              - rn
              - ro
              - ro-RO
              - ru
              - ru-RU
              - rw
              - sa
              - sa-IN
              - sc
              - sd
              - se
              - sg
              - si
              - sk
              - sk-SK
              - sl
              - sl-SI
              - sm
              - sn
              - so
              - sq
              - sq-AL
              - sr
              - ss
              - st
              - su
              - sv
              - sv-FI
              - sv-SE
              - sw
              - sw-KE
              - ta
              - ta-IN
              - te
              - te-IN
              - tg
              - th
              - th-TH
              - ti
              - tk
              - tl
              - tn
              - to
              - tr
              - tr-TR
              - ts
              - tt
              - tt-RU
              - tw
              - ty
              - ug
              - uk
              - uk-UA
              - ur
              - ur-PK
              - uz
              - ve
              - vi
              - vi-VN
              - vo
              - wa
              - wo
              - xh
              - yi
              - yo
              - za
              - zh
              - zh-CHS
              - zh-CHT
              - zh-CN
              - zh-HK
              - zh-MO
              - zh-SG
              - zh-TW
              - zu
        - name: key
          required: true
          in: path
          description: A key that is used to identify the content between languages.
          schema:
            minLength: 16
            type: string
      responses:
        "200":
          description: ""
        "400": *a43
        "401": *a44
        "404": *a45
        "422": *a46
        "500": *a47
      security:
        - *a48
        - bearer: []
      summary: Delete content
      tags:
        - CMS (FHIR Legacy)
  /internal/cms/{type}/{language}/{key}:
    put:
      description: >
        # Create Content


        Create a new CMS content entry for a given content type and language.

        <br>The content is stored as a FHIR Composition resource scoped to the
        caller's project. A unique key is auto-generated from the title and used
        to link translations across languages.


        ## Path Parameters


        | Parameter  | Description                                      |
        Example     |

        | ---------- | ------------------------------------------------ |
        ----------- |

        | `type`     | Content type (e.g. `article`, `faq`, `exercise`) |
        `article`   |

        | `language` | ISO language code                                |
        `en-US`     |


        ## Request Body


        | Field      | Type       |
        Description                                                  |

        | ---------- | ---------- |
        ------------------------------------------------------------ |

        | `title`    | `string`   | Title of the content
        entry                                   |

        | `category` | `string`   | Category
        identifier                                          |

        | `section`  | `array`    | Array of sections, each with `title`,
        `text`, and `code`     |

        | `code`     | `string`   | Optional code used for additional
        classification             |


        ## Example cURL request


        ```bash

        curl -X POST \
         --url 'https://api.dev.ovok.com/cms/article/en-US' \
         -H 'Authorization: Bearer <token>' \
         -H 'Content-Type: application/json' \
         -d '{
            "title": "My Blog",
            "category": "123",
            "section": [
              { "title": "Intro", "text": "Welcome text", "code": ["main-content"] }
            ]
        }'

        ```


        **Side Effects:** A background job is enqueued for every other language
        configured in the project locale, so translation stubs can be generated
        automatically.


        **Notes:** The same description is reused for the **Update content**
        (`PUT /:language/:key`) route. Updates follow the same body schema but
        target an existing key.
      operationId: CMSController_updateContent[1]
      parameters:
        - name: type
          required: true
          in: path
          schema:
            type: string
            enum:
              - blog
              - video
              - audio
              - template
              - export-template
        - name: language
          required: true
          in: path
          schema:
            type: string
            enum:
              - Cy-az-AZ
              - Cy-sr-SP
              - Cy-uz-UZ
              - Lt-az-AZ
              - Lt-sr-SP
              - Lt-uz-UZ
              - aa
              - ab
              - ae
              - af
              - af-ZA
              - ak
              - am
              - an
              - ar
              - ar-AE
              - ar-BH
              - ar-DZ
              - ar-EG
              - ar-IQ
              - ar-JO
              - ar-KW
              - ar-LB
              - ar-LY
              - ar-MA
              - ar-OM
              - ar-QA
              - ar-SA
              - ar-SY
              - ar-TN
              - ar-YE
              - as
              - av
              - ay
              - az
              - ba
              - be
              - be-BY
              - bg
              - bg-BG
              - bh
              - bi
              - bm
              - bn
              - bo
              - br
              - bs
              - ca
              - ca-ES
              - ce
              - ch
              - co
              - cr
              - cs
              - cs-CZ
              - cu
              - cv
              - cy
              - da
              - da-DK
              - de
              - de-AT
              - de-CH
              - de-DE
              - de-LI
              - de-LU
              - div-MV
              - dv
              - dz
              - ee
              - el
              - el-GR
              - en
              - en-AU
              - en-BZ
              - en-CA
              - en-CB
              - en-GB
              - en-IE
              - en-JM
              - en-NZ
              - en-PH
              - en-TT
              - en-US
              - en-ZA
              - en-ZW
              - eo
              - es
              - es-AR
              - es-BO
              - es-CL
              - es-CO
              - es-CR
              - es-DO
              - es-EC
              - es-ES
              - es-GT
              - es-HN
              - es-MX
              - es-NI
              - es-PA
              - es-PE
              - es-PR
              - es-PY
              - es-SV
              - es-UY
              - es-VE
              - et
              - et-EE
              - eu
              - eu-ES
              - fa
              - fa-IR
              - ff
              - fi
              - fi-FI
              - fj
              - fo
              - fo-FO
              - fr
              - fr-BE
              - fr-CA
              - fr-CH
              - fr-FR
              - fr-LU
              - fr-MC
              - fy
              - ga
              - gd
              - gl
              - gl-ES
              - gn
              - gu
              - gu-IN
              - gv
              - ha
              - he
              - he-IL
              - hi
              - hi-IN
              - ho
              - hr
              - hr-HR
              - ht
              - hu
              - hu-HU
              - hy
              - hy-AM
              - hz
              - ia
              - id
              - id-ID
              - ie
              - ig
              - ii
              - ik
              - io
              - is
              - is-IS
              - it
              - it-CH
              - it-IT
              - iu
              - ja
              - ja-JP
              - jv
              - ka
              - ka-GE
              - kg
              - ki
              - kj
              - kk
              - kk-KZ
              - kl
              - km
              - kn
              - kn-IN
              - ko
              - ko-KR
              - kr
              - ks
              - ku
              - kv
              - kw
              - ky
              - ky-KZ
              - la
              - lb
              - lg
              - li
              - ln
              - lo
              - lt
              - lt-LT
              - lu
              - lv
              - lv-LV
              - mg
              - mh
              - mi
              - mk
              - mk-MK
              - ml
              - mn
              - mn-MN
              - mr
              - mr-IN
              - ms
              - ms-BN
              - ms-MY
              - mt
              - my
              - na
              - nb
              - nb-NO
              - nd
              - ne
              - ng
              - nl
              - nl-BE
              - nl-NL
              - nn
              - nn-NO
              - no
              - nr
              - nv
              - ny
              - oc
              - oj
              - om
              - or
              - os
              - pa
              - pa-IN
              - pi
              - pl
              - pl-PL
              - ps
              - pt
              - pt-BR
              - pt-PT
              - qu
              - rm
              - rn
              - ro
              - ro-RO
              - ru
              - ru-RU
              - rw
              - sa
              - sa-IN
              - sc
              - sd
              - se
              - sg
              - si
              - sk
              - sk-SK
              - sl
              - sl-SI
              - sm
              - sn
              - so
              - sq
              - sq-AL
              - sr
              - ss
              - st
              - su
              - sv
              - sv-FI
              - sv-SE
              - sw
              - sw-KE
              - ta
              - ta-IN
              - te
              - te-IN
              - tg
              - th
              - th-TH
              - ti
              - tk
              - tl
              - tn
              - to
              - tr
              - tr-TR
              - ts
              - tt
              - tt-RU
              - tw
              - ty
              - ug
              - uk
              - uk-UA
              - ur
              - ur-PK
              - uz
              - ve
              - vi
              - vi-VN
              - vo
              - wa
              - wo
              - xh
              - yi
              - yo
              - za
              - zh
              - zh-CHS
              - zh-CHT
              - zh-CN
              - zh-HK
              - zh-MO
              - zh-SG
              - zh-TW
              - zu
        - name: key
          required: true
          in: path
          description: A key that is used to identify the content between languages.
          schema:
            minLength: 16
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/ContentBodyDto"
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ContentDto"
        "400": *a43
        "401": *a44
        "404": *a45
        "422": *a46
        "500": *a47
      security:
        - *a48
        - bearer: []
      summary: Update content
      tags:
        - CMS (FHIR Legacy)
    get:
      description: >
        # Get Content by Key and Language


        Retrieve a single CMS content entry by its unique key and language.

        <br>Returns the full content DTO including title, sections, author,
        date, and category.


        ## Path Parameters


        | Parameter  |
        Description                                                     |
        Example                      |

        | ---------- |
        --------------------------------------------------------------- |
        ---------------------------- |

        | `type`     | Content type (e.g. `article`, `faq`,
        `exercise`)                | `article`                    |

        | `language` | ISO language
        code                                               |
        `en-US`                      |

        | `key`      | Unique content key that links translations across
        languages     | `article-my-blog-a1b2c3d4`  |


        ## Example cURL request


        ```bash

        curl -X GET \
         --url 'https://api.dev.ovok.com/cms/article/en-US/article-my-blog-a1b2c3d4' \
         -H 'Authorization: Bearer <token>'
        ```


        ## Response


        Returns a `ContentDto` object:


        ```json

        {
          "id": "composition-id",
          "title": "My Blog",
          "category": "123",
          "section": [
            { "title": "Intro", "text": "Welcome text", "code": ["main-content"] }
          ],
          "language": "en-US",
          "key": "article-my-blog-a1b2c3d4",
          "type": "article",
          "date": "2025-01-15T12:00:00.000Z",
          "author": {
            "reference": "Practitioner/abc",
            "display": "Dr. Smith"
          }
        }

        ```


        **Notes:** Returns `404 Not Found` if no content matches the given type,
        language, and key within the caller's project.
      operationId: CMSController_getContent[1]
      parameters:
        - name: type
          required: true
          in: path
          schema:
            type: string
            enum:
              - blog
              - video
              - audio
              - template
              - export-template
        - name: language
          required: true
          in: path
          schema:
            type: string
            enum:
              - Cy-az-AZ
              - Cy-sr-SP
              - Cy-uz-UZ
              - Lt-az-AZ
              - Lt-sr-SP
              - Lt-uz-UZ
              - aa
              - ab
              - ae
              - af
              - af-ZA
              - ak
              - am
              - an
              - ar
              - ar-AE
              - ar-BH
              - ar-DZ
              - ar-EG
              - ar-IQ
              - ar-JO
              - ar-KW
              - ar-LB
              - ar-LY
              - ar-MA
              - ar-OM
              - ar-QA
              - ar-SA
              - ar-SY
              - ar-TN
              - ar-YE
              - as
              - av
              - ay
              - az
              - ba
              - be
              - be-BY
              - bg
              - bg-BG
              - bh
              - bi
              - bm
              - bn
              - bo
              - br
              - bs
              - ca
              - ca-ES
              - ce
              - ch
              - co
              - cr
              - cs
              - cs-CZ
              - cu
              - cv
              - cy
              - da
              - da-DK
              - de
              - de-AT
              - de-CH
              - de-DE
              - de-LI
              - de-LU
              - div-MV
              - dv
              - dz
              - ee
              - el
              - el-GR
              - en
              - en-AU
              - en-BZ
              - en-CA
              - en-CB
              - en-GB
              - en-IE
              - en-JM
              - en-NZ
              - en-PH
              - en-TT
              - en-US
              - en-ZA
              - en-ZW
              - eo
              - es
              - es-AR
              - es-BO
              - es-CL
              - es-CO
              - es-CR
              - es-DO
              - es-EC
              - es-ES
              - es-GT
              - es-HN
              - es-MX
              - es-NI
              - es-PA
              - es-PE
              - es-PR
              - es-PY
              - es-SV
              - es-UY
              - es-VE
              - et
              - et-EE
              - eu
              - eu-ES
              - fa
              - fa-IR
              - ff
              - fi
              - fi-FI
              - fj
              - fo
              - fo-FO
              - fr
              - fr-BE
              - fr-CA
              - fr-CH
              - fr-FR
              - fr-LU
              - fr-MC
              - fy
              - ga
              - gd
              - gl
              - gl-ES
              - gn
              - gu
              - gu-IN
              - gv
              - ha
              - he
              - he-IL
              - hi
              - hi-IN
              - ho
              - hr
              - hr-HR
              - ht
              - hu
              - hu-HU
              - hy
              - hy-AM
              - hz
              - ia
              - id
              - id-ID
              - ie
              - ig
              - ii
              - ik
              - io
              - is
              - is-IS
              - it
              - it-CH
              - it-IT
              - iu
              - ja
              - ja-JP
              - jv
              - ka
              - ka-GE
              - kg
              - ki
              - kj
              - kk
              - kk-KZ
              - kl
              - km
              - kn
              - kn-IN
              - ko
              - ko-KR
              - kr
              - ks
              - ku
              - kv
              - kw
              - ky
              - ky-KZ
              - la
              - lb
              - lg
              - li
              - ln
              - lo
              - lt
              - lt-LT
              - lu
              - lv
              - lv-LV
              - mg
              - mh
              - mi
              - mk
              - mk-MK
              - ml
              - mn
              - mn-MN
              - mr
              - mr-IN
              - ms
              - ms-BN
              - ms-MY
              - mt
              - my
              - na
              - nb
              - nb-NO
              - nd
              - ne
              - ng
              - nl
              - nl-BE
              - nl-NL
              - nn
              - nn-NO
              - no
              - nr
              - nv
              - ny
              - oc
              - oj
              - om
              - or
              - os
              - pa
              - pa-IN
              - pi
              - pl
              - pl-PL
              - ps
              - pt
              - pt-BR
              - pt-PT
              - qu
              - rm
              - rn
              - ro
              - ro-RO
              - ru
              - ru-RU
              - rw
              - sa
              - sa-IN
              - sc
              - sd
              - se
              - sg
              - si
              - sk
              - sk-SK
              - sl
              - sl-SI
              - sm
              - sn
              - so
              - sq
              - sq-AL
              - sr
              - ss
              - st
              - su
              - sv
              - sv-FI
              - sv-SE
              - sw
              - sw-KE
              - ta
              - ta-IN
              - te
              - te-IN
              - tg
              - th
              - th-TH
              - ti
              - tk
              - tl
              - tn
              - to
              - tr
              - tr-TR
              - ts
              - tt
              - tt-RU
              - tw
              - ty
              - ug
              - uk
              - uk-UA
              - ur
              - ur-PK
              - uz
              - ve
              - vi
              - vi-VN
              - vo
              - wa
              - wo
              - xh
              - yi
              - yo
              - za
              - zh
              - zh-CHS
              - zh-CHT
              - zh-CN
              - zh-HK
              - zh-MO
              - zh-SG
              - zh-TW
              - zu
        - name: key
          required: true
          in: path
          description: A key that is used to identify the content between languages.
          schema:
            minLength: 16
            type: string
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ContentDto"
        "400": *a43
        "401": *a44
        "404": *a45
        "422": *a46
        "500": *a47
      security:
        - *a48
        - bearer: []
      summary: Get content by key and language
      tags:
        - CMS (FHIR Legacy)
    delete:
      description: >
        # Delete Content


        Delete a CMS content entry identified by its language and key.

        <br>If the specified language is the project's default language, all
        translations sharing the same key are deleted as well. If it is a
        non-default language, only that single translation is removed.


        ## Path Parameters


        | Parameter  |
        Description                                                     |
        Example                      |

        | ---------- |
        --------------------------------------------------------------- |
        ---------------------------- |

        | `type`     | Content type (e.g. `article`, `faq`,
        `exercise`)                | `article`                    |

        | `language` | ISO language code of the content to
        delete                      | `en-US`                      |

        | `key`      | Unique content key that links translations across
        languages     | `article-my-blog-a1b2c3d4`  |


        ## Example cURL request


        ```bash

        curl -X DELETE \
         --url 'https://api.dev.ovok.com/cms/article/en-US/article-my-blog-a1b2c3d4' \
         -H 'Authorization: Bearer <token>'
        ```


        **Side Effects:** Deleting the default-language entry cascades to all
        related language variants. Deleting a non-default language entry only
        removes that single translation.


        **Notes:** The language provided in the path is validated against the
        project's configured locales before deletion proceeds.
      operationId: CMSController_deleteContent[1]
      parameters:
        - name: type
          required: true
          in: path
          schema:
            type: string
            enum:
              - blog
              - video
              - audio
              - template
              - export-template
        - name: language
          required: true
          in: path
          schema:
            type: string
            enum:
              - Cy-az-AZ
              - Cy-sr-SP
              - Cy-uz-UZ
              - Lt-az-AZ
              - Lt-sr-SP
              - Lt-uz-UZ
              - aa
              - ab
              - ae
              - af
              - af-ZA
              - ak
              - am
              - an
              - ar
              - ar-AE
              - ar-BH
              - ar-DZ
              - ar-EG
              - ar-IQ
              - ar-JO
              - ar-KW
              - ar-LB
              - ar-LY
              - ar-MA
              - ar-OM
              - ar-QA
              - ar-SA
              - ar-SY
              - ar-TN
              - ar-YE
              - as
              - av
              - ay
              - az
              - ba
              - be
              - be-BY
              - bg
              - bg-BG
              - bh
              - bi
              - bm
              - bn
              - bo
              - br
              - bs
              - ca
              - ca-ES
              - ce
              - ch
              - co
              - cr
              - cs
              - cs-CZ
              - cu
              - cv
              - cy
              - da
              - da-DK
              - de
              - de-AT
              - de-CH
              - de-DE
              - de-LI
              - de-LU
              - div-MV
              - dv
              - dz
              - ee
              - el
              - el-GR
              - en
              - en-AU
              - en-BZ
              - en-CA
              - en-CB
              - en-GB
              - en-IE
              - en-JM
              - en-NZ
              - en-PH
              - en-TT
              - en-US
              - en-ZA
              - en-ZW
              - eo
              - es
              - es-AR
              - es-BO
              - es-CL
              - es-CO
              - es-CR
              - es-DO
              - es-EC
              - es-ES
              - es-GT
              - es-HN
              - es-MX
              - es-NI
              - es-PA
              - es-PE
              - es-PR
              - es-PY
              - es-SV
              - es-UY
              - es-VE
              - et
              - et-EE
              - eu
              - eu-ES
              - fa
              - fa-IR
              - ff
              - fi
              - fi-FI
              - fj
              - fo
              - fo-FO
              - fr
              - fr-BE
              - fr-CA
              - fr-CH
              - fr-FR
              - fr-LU
              - fr-MC
              - fy
              - ga
              - gd
              - gl
              - gl-ES
              - gn
              - gu
              - gu-IN
              - gv
              - ha
              - he
              - he-IL
              - hi
              - hi-IN
              - ho
              - hr
              - hr-HR
              - ht
              - hu
              - hu-HU
              - hy
              - hy-AM
              - hz
              - ia
              - id
              - id-ID
              - ie
              - ig
              - ii
              - ik
              - io
              - is
              - is-IS
              - it
              - it-CH
              - it-IT
              - iu
              - ja
              - ja-JP
              - jv
              - ka
              - ka-GE
              - kg
              - ki
              - kj
              - kk
              - kk-KZ
              - kl
              - km
              - kn
              - kn-IN
              - ko
              - ko-KR
              - kr
              - ks
              - ku
              - kv
              - kw
              - ky
              - ky-KZ
              - la
              - lb
              - lg
              - li
              - ln
              - lo
              - lt
              - lt-LT
              - lu
              - lv
              - lv-LV
              - mg
              - mh
              - mi
              - mk
              - mk-MK
              - ml
              - mn
              - mn-MN
              - mr
              - mr-IN
              - ms
              - ms-BN
              - ms-MY
              - mt
              - my
              - na
              - nb
              - nb-NO
              - nd
              - ne
              - ng
              - nl
              - nl-BE
              - nl-NL
              - nn
              - nn-NO
              - no
              - nr
              - nv
              - ny
              - oc
              - oj
              - om
              - or
              - os
              - pa
              - pa-IN
              - pi
              - pl
              - pl-PL
              - ps
              - pt
              - pt-BR
              - pt-PT
              - qu
              - rm
              - rn
              - ro
              - ro-RO
              - ru
              - ru-RU
              - rw
              - sa
              - sa-IN
              - sc
              - sd
              - se
              - sg
              - si
              - sk
              - sk-SK
              - sl
              - sl-SI
              - sm
              - sn
              - so
              - sq
              - sq-AL
              - sr
              - ss
              - st
              - su
              - sv
              - sv-FI
              - sv-SE
              - sw
              - sw-KE
              - ta
              - ta-IN
              - te
              - te-IN
              - tg
              - th
              - th-TH
              - ti
              - tk
              - tl
              - tn
              - to
              - tr
              - tr-TR
              - ts
              - tt
              - tt-RU
              - tw
              - ty
              - ug
              - uk
              - uk-UA
              - ur
              - ur-PK
              - uz
              - ve
              - vi
              - vi-VN
              - vo
              - wa
              - wo
              - xh
              - yi
              - yo
              - za
              - zh
              - zh-CHS
              - zh-CHT
              - zh-CN
              - zh-HK
              - zh-MO
              - zh-SG
              - zh-TW
              - zu
        - name: key
          required: true
          in: path
          description: A key that is used to identify the content between languages.
          schema:
            minLength: 16
            type: string
      responses:
        "200":
          description: ""
        "400": *a43
        "401": *a44
        "404": *a45
        "422": *a46
        "500": *a47
      security:
        - *a48
        - bearer: []
      summary: Delete content
      tags:
        - CMS (FHIR Legacy)
  /fhir/Observation/$lastn:
    get:
      description: >
        This endpoint allows users to fetch patient informations, specifically
        observations.


        ## Example cURL request


        ```bash

        curl -X GET \
         -G 'https://api.dev.ovok.com/fhir/Observation/$lastn' \
         -d 'patient=Patient/e70f3aec-d37e-453d-887b-72654c26b3fe' \
         -d 'max=2' \
         -d 'code=131328,8886-4'
        ```


        ## Example JSON response


        ```json

        {
          "resourceType": "Bundle",
          "type": "searchset",
          "entry": [
            {
              "resource": {
                "resourceType": "Observation",
                "subject": {
                  "reference": "Patient/7c4d044d-af23-4ef8-948b-c4503e64e528",
                  "display": "Max Mustermann"
                },
                "code": {
                  "coding": [
                    {
                      "system": "http://loinc.org",
                      "code": "131328"
                    }
                  ]
                },
                "status": "amended",
                "id": "a4508b00-7854-4108-a903-57aa67eaa79e"
              },
              "fullUrl": "https://fhir.ovok.com/fhir/R4/Observation/a4508b00-7854-4108-a903-57aa67eaa79e"
            },
            {
              "resource": {
                "resourceType": "Observation",
                "status": "final",
                "valueQuantity": {
                  "unit": "bpm",
                  "value": 150
                },
                "code": {
                  "coding": [
                    {
                      "system": "http://loinc.org",
                      "code": "8883-1"
                    },
                    {
                      "system": "http://loinc.org",
                      "code": "8886-4"
                    }
                  ]
                },
                "subject": {
                  "reference": "Patient/7c4d044d-af23-4ef8-948b-c4503e64e528",
                  "display": "Max Mustermann"
                },
                "id": "32fd6e5d-fa2f-4923-97ac-1042ed3f90bb"
              },
              "fullUrl": "https://fhir.ovok.com/fhir/R4/Observation/32fd6e5d-fa2f-4923-97ac-1042ed3f90bb"
            }
          ]
        }

        ```
      operationId: FhirController_getPatientLastObservation[0]
      parameters:
        - name: patient
          required: false
          in: query
          description: Patient reference.
          schema:
            type: string
        - name: max
          required: false
          in: query
          description: Maximum number of observations to return.
          schema:
            default: "1"
            type: string
        - name: code
          required: false
          in: query
          description: Observation code(s) with comma separated values, e.g.
            "131328,8886-4".
          schema:
            type: string
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PatientObservationResponseDto"
        "400": &a49
          description: The request could not be operated by the server.
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: number
                    example: 400
                  message:
                    type: string
                  error:
                    type: string
                    example: Bad Request
                required:
                  - statusCode
                  - message
        "401": &a50
          description: The resource owner or authorization server denied the request.
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: number
                    example: 401
                  message:
                    type: string
                  error:
                    type: string
                    example: Unauthorized
                required:
                  - statusCode
                  - message
        "404": &a51
          description: The requested resource could not be found.
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: number
                    example: 404
                  message:
                    type: string
                  error:
                    type: string
                    example: Not Found
                required:
                  - statusCode
                  - message
        "422": &a52
          description: The request could not be validated by the server.
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: number
                    example: 422
                  message:
                    type: string
                  error:
                    type: string
                    example: Unprocessable Entity
                required:
                  - statusCode
                  - message
        "500": &a53
          description: The server encountered an unexpected condition. Please try again
            later.
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: number
                    example: 500
                  message:
                    type: string
                  error:
                    type: string
                    example: Internal Server Error
                required:
                  - statusCode
                  - message
      summary: Get last observations
      tags:
        - FHIR Operations
  /fhir/R4/Observation/$lastn:
    get:
      description: >
        This endpoint allows users to fetch patient informations, specifically
        observations.


        ## Example cURL request


        ```bash

        curl -X GET \
         -G 'https://api.dev.ovok.com/fhir/Observation/$lastn' \
         -d 'patient=Patient/e70f3aec-d37e-453d-887b-72654c26b3fe' \
         -d 'max=2' \
         -d 'code=131328,8886-4'
        ```


        ## Example JSON response


        ```json

        {
          "resourceType": "Bundle",
          "type": "searchset",
          "entry": [
            {
              "resource": {
                "resourceType": "Observation",
                "subject": {
                  "reference": "Patient/7c4d044d-af23-4ef8-948b-c4503e64e528",
                  "display": "Max Mustermann"
                },
                "code": {
                  "coding": [
                    {
                      "system": "http://loinc.org",
                      "code": "131328"
                    }
                  ]
                },
                "status": "amended",
                "id": "a4508b00-7854-4108-a903-57aa67eaa79e"
              },
              "fullUrl": "https://fhir.ovok.com/fhir/R4/Observation/a4508b00-7854-4108-a903-57aa67eaa79e"
            },
            {
              "resource": {
                "resourceType": "Observation",
                "status": "final",
                "valueQuantity": {
                  "unit": "bpm",
                  "value": 150
                },
                "code": {
                  "coding": [
                    {
                      "system": "http://loinc.org",
                      "code": "8883-1"
                    },
                    {
                      "system": "http://loinc.org",
                      "code": "8886-4"
                    }
                  ]
                },
                "subject": {
                  "reference": "Patient/7c4d044d-af23-4ef8-948b-c4503e64e528",
                  "display": "Max Mustermann"
                },
                "id": "32fd6e5d-fa2f-4923-97ac-1042ed3f90bb"
              },
              "fullUrl": "https://fhir.ovok.com/fhir/R4/Observation/32fd6e5d-fa2f-4923-97ac-1042ed3f90bb"
            }
          ]
        }

        ```
      operationId: FhirController_getPatientLastObservation[1]
      parameters:
        - name: patient
          required: false
          in: query
          description: Patient reference.
          schema:
            type: string
        - name: max
          required: false
          in: query
          description: Maximum number of observations to return.
          schema:
            default: "1"
            type: string
        - name: code
          required: false
          in: query
          description: Observation code(s) with comma separated values, e.g.
            "131328,8886-4".
          schema:
            type: string
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PatientObservationResponseDto"
        "400": *a49
        "401": *a50
        "404": *a51
        "422": *a52
        "500": *a53
      summary: Get last observations
      tags:
        - FHIR Operations
  /fhir/R5/Observation/$lastn:
    get:
      description: >
        This endpoint allows users to fetch patient informations, specifically
        observations.


        ## Example cURL request


        ```bash

        curl -X GET \
         -G 'https://api.dev.ovok.com/fhir/Observation/$lastn' \
         -d 'patient=Patient/e70f3aec-d37e-453d-887b-72654c26b3fe' \
         -d 'max=2' \
         -d 'code=131328,8886-4'
        ```


        ## Example JSON response


        ```json

        {
          "resourceType": "Bundle",
          "type": "searchset",
          "entry": [
            {
              "resource": {
                "resourceType": "Observation",
                "subject": {
                  "reference": "Patient/7c4d044d-af23-4ef8-948b-c4503e64e528",
                  "display": "Max Mustermann"
                },
                "code": {
                  "coding": [
                    {
                      "system": "http://loinc.org",
                      "code": "131328"
                    }
                  ]
                },
                "status": "amended",
                "id": "a4508b00-7854-4108-a903-57aa67eaa79e"
              },
              "fullUrl": "https://fhir.ovok.com/fhir/R4/Observation/a4508b00-7854-4108-a903-57aa67eaa79e"
            },
            {
              "resource": {
                "resourceType": "Observation",
                "status": "final",
                "valueQuantity": {
                  "unit": "bpm",
                  "value": 150
                },
                "code": {
                  "coding": [
                    {
                      "system": "http://loinc.org",
                      "code": "8883-1"
                    },
                    {
                      "system": "http://loinc.org",
                      "code": "8886-4"
                    }
                  ]
                },
                "subject": {
                  "reference": "Patient/7c4d044d-af23-4ef8-948b-c4503e64e528",
                  "display": "Max Mustermann"
                },
                "id": "32fd6e5d-fa2f-4923-97ac-1042ed3f90bb"
              },
              "fullUrl": "https://fhir.ovok.com/fhir/R4/Observation/32fd6e5d-fa2f-4923-97ac-1042ed3f90bb"
            }
          ]
        }

        ```
      operationId: FhirController_getPatientLastObservation[2]
      parameters:
        - name: patient
          required: false
          in: query
          description: Patient reference.
          schema:
            type: string
        - name: max
          required: false
          in: query
          description: Maximum number of observations to return.
          schema:
            default: "1"
            type: string
        - name: code
          required: false
          in: query
          description: Observation code(s) with comma separated values, e.g.
            "131328,8886-4".
          schema:
            type: string
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PatientObservationResponseDto"
        "400": *a49
        "401": *a50
        "404": *a51
        "422": *a52
        "500": *a53
      summary: Get last observations
      tags:
        - FHIR Operations
  /fhir/Device/{id}/telemetry:
    get:
      description: >
        Returns the current effective telemetry for a device as a FHIR searchset
        Bundle of Observations, derived from the device's state machine
        snapshot. One Observation per metric is included: presence, heart rate
        (when a fresh value is cached), respiratory rate (when a fresh value is
        cached), and sleep status. Each Observation uses its own
        `effectiveInstant` so clients can reason about staleness per metric.


        ## Example cURL request


        ```bash

        curl -X GET \
         'https://api.dev.ovok.com/fhir/R4/Device/87ea5dfc-8b8e-384d-8489-79496e706390/telemetry' \
         -H 'Authorization: Bearer <token>'
        ```


        ## Example JSON response


        ```json

        {
          "resourceType": "Bundle",
          "type": "searchset",
          "total": 4,
          "entry": [
            {
              "resource": {
                "resourceType": "Observation",
                "id": "presence",
                "status": "final",
                "code": {
                  "coding": [
                    {
                      "system": "https://sleepiz.com/fhir/CodeSystem/observation-codes",
                      "code": "presence-detection",
                      "display": "Presence detection"
                    }
                  ]
                },
                "subject": { "reference": "Device/87ea5dfc-8b8e-384d-8489-79496e706390" },
                "device": { "reference": "Device/87ea5dfc-8b8e-384d-8489-79496e706390" },
                "effectiveInstant": "2026-04-22T10:00:00.000Z",
                "valueBoolean": true
              }
            },
            {
              "resource": {
                "resourceType": "Observation",
                "id": "heartRate",
                "status": "final",
                "code": {
                  "coding": [{ "system": "http://loinc.org", "code": "8867-4", "display": "Heart rate" }]
                },
                "subject": { "reference": "Device/87ea5dfc-8b8e-384d-8489-79496e706390" },
                "device": { "reference": "Device/87ea5dfc-8b8e-384d-8489-79496e706390" },
                "effectiveInstant": "2026-04-22T10:00:00.000Z",
                "valueQuantity": { "value": 72, "unit": "beats/min", "system": "http://unitsofmeasure.org", "code": "/min" }
              }
            },
            {
              "resource": {
                "resourceType": "Observation",
                "id": "respiratoryRate",
                "status": "final",
                "code": {
                  "coding": [{ "system": "http://loinc.org", "code": "9279-1", "display": "Respiratory rate" }]
                },
                "subject": { "reference": "Device/87ea5dfc-8b8e-384d-8489-79496e706390" },
                "device": { "reference": "Device/87ea5dfc-8b8e-384d-8489-79496e706390" },
                "effectiveInstant": "2026-04-22T10:00:00.000Z",
                "valueQuantity": { "value": 14, "unit": "breaths/min", "system": "http://unitsofmeasure.org", "code": "/min" }
              }
            },
            {
              "resource": {
                "resourceType": "Observation",
                "id": "sleep",
                "status": "final",
                "code": {
                  "coding": [{ "system": "http://loinc.org", "code": "107145-5", "display": "Sleep status" }]
                },
                "subject": { "reference": "Device/87ea5dfc-8b8e-384d-8489-79496e706390" },
                "device": { "reference": "Device/87ea5dfc-8b8e-384d-8489-79496e706390" },
                "effectiveInstant": "2026-04-22T10:00:00.000Z",
                "valueCodeableConcept": { "text": "asleep" }
              }
            }
          ]
        }

        ```
      operationId: FhirController_getDeviceTelemetry[0]
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/DeviceTelemetryResponseDto"
        "400": *a49
        "401": *a50
        "404": *a51
        "422": *a52
        "500": *a53
      summary: Get device telemetry
      tags:
        - FHIR Operations
  /fhir/R4/Device/{id}/telemetry:
    get:
      description: >
        Returns the current effective telemetry for a device as a FHIR searchset
        Bundle of Observations, derived from the device's state machine
        snapshot. One Observation per metric is included: presence, heart rate
        (when a fresh value is cached), respiratory rate (when a fresh value is
        cached), and sleep status. Each Observation uses its own
        `effectiveInstant` so clients can reason about staleness per metric.


        ## Example cURL request


        ```bash

        curl -X GET \
         'https://api.dev.ovok.com/fhir/R4/Device/87ea5dfc-8b8e-384d-8489-79496e706390/telemetry' \
         -H 'Authorization: Bearer <token>'
        ```


        ## Example JSON response


        ```json

        {
          "resourceType": "Bundle",
          "type": "searchset",
          "total": 4,
          "entry": [
            {
              "resource": {
                "resourceType": "Observation",
                "id": "presence",
                "status": "final",
                "code": {
                  "coding": [
                    {
                      "system": "https://sleepiz.com/fhir/CodeSystem/observation-codes",
                      "code": "presence-detection",
                      "display": "Presence detection"
                    }
                  ]
                },
                "subject": { "reference": "Device/87ea5dfc-8b8e-384d-8489-79496e706390" },
                "device": { "reference": "Device/87ea5dfc-8b8e-384d-8489-79496e706390" },
                "effectiveInstant": "2026-04-22T10:00:00.000Z",
                "valueBoolean": true
              }
            },
            {
              "resource": {
                "resourceType": "Observation",
                "id": "heartRate",
                "status": "final",
                "code": {
                  "coding": [{ "system": "http://loinc.org", "code": "8867-4", "display": "Heart rate" }]
                },
                "subject": { "reference": "Device/87ea5dfc-8b8e-384d-8489-79496e706390" },
                "device": { "reference": "Device/87ea5dfc-8b8e-384d-8489-79496e706390" },
                "effectiveInstant": "2026-04-22T10:00:00.000Z",
                "valueQuantity": { "value": 72, "unit": "beats/min", "system": "http://unitsofmeasure.org", "code": "/min" }
              }
            },
            {
              "resource": {
                "resourceType": "Observation",
                "id": "respiratoryRate",
                "status": "final",
                "code": {
                  "coding": [{ "system": "http://loinc.org", "code": "9279-1", "display": "Respiratory rate" }]
                },
                "subject": { "reference": "Device/87ea5dfc-8b8e-384d-8489-79496e706390" },
                "device": { "reference": "Device/87ea5dfc-8b8e-384d-8489-79496e706390" },
                "effectiveInstant": "2026-04-22T10:00:00.000Z",
                "valueQuantity": { "value": 14, "unit": "breaths/min", "system": "http://unitsofmeasure.org", "code": "/min" }
              }
            },
            {
              "resource": {
                "resourceType": "Observation",
                "id": "sleep",
                "status": "final",
                "code": {
                  "coding": [{ "system": "http://loinc.org", "code": "107145-5", "display": "Sleep status" }]
                },
                "subject": { "reference": "Device/87ea5dfc-8b8e-384d-8489-79496e706390" },
                "device": { "reference": "Device/87ea5dfc-8b8e-384d-8489-79496e706390" },
                "effectiveInstant": "2026-04-22T10:00:00.000Z",
                "valueCodeableConcept": { "text": "asleep" }
              }
            }
          ]
        }

        ```
      operationId: FhirController_getDeviceTelemetry[1]
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/DeviceTelemetryResponseDto"
        "400": *a49
        "401": *a50
        "404": *a51
        "422": *a52
        "500": *a53
      summary: Get device telemetry
      tags:
        - FHIR Operations
  /fhir/R5/Device/{id}/telemetry:
    get:
      description: >
        Returns the current effective telemetry for a device as a FHIR searchset
        Bundle of Observations, derived from the device's state machine
        snapshot. One Observation per metric is included: presence, heart rate
        (when a fresh value is cached), respiratory rate (when a fresh value is
        cached), and sleep status. Each Observation uses its own
        `effectiveInstant` so clients can reason about staleness per metric.


        ## Example cURL request


        ```bash

        curl -X GET \
         'https://api.dev.ovok.com/fhir/R4/Device/87ea5dfc-8b8e-384d-8489-79496e706390/telemetry' \
         -H 'Authorization: Bearer <token>'
        ```


        ## Example JSON response


        ```json

        {
          "resourceType": "Bundle",
          "type": "searchset",
          "total": 4,
          "entry": [
            {
              "resource": {
                "resourceType": "Observation",
                "id": "presence",
                "status": "final",
                "code": {
                  "coding": [
                    {
                      "system": "https://sleepiz.com/fhir/CodeSystem/observation-codes",
                      "code": "presence-detection",
                      "display": "Presence detection"
                    }
                  ]
                },
                "subject": { "reference": "Device/87ea5dfc-8b8e-384d-8489-79496e706390" },
                "device": { "reference": "Device/87ea5dfc-8b8e-384d-8489-79496e706390" },
                "effectiveInstant": "2026-04-22T10:00:00.000Z",
                "valueBoolean": true
              }
            },
            {
              "resource": {
                "resourceType": "Observation",
                "id": "heartRate",
                "status": "final",
                "code": {
                  "coding": [{ "system": "http://loinc.org", "code": "8867-4", "display": "Heart rate" }]
                },
                "subject": { "reference": "Device/87ea5dfc-8b8e-384d-8489-79496e706390" },
                "device": { "reference": "Device/87ea5dfc-8b8e-384d-8489-79496e706390" },
                "effectiveInstant": "2026-04-22T10:00:00.000Z",
                "valueQuantity": { "value": 72, "unit": "beats/min", "system": "http://unitsofmeasure.org", "code": "/min" }
              }
            },
            {
              "resource": {
                "resourceType": "Observation",
                "id": "respiratoryRate",
                "status": "final",
                "code": {
                  "coding": [{ "system": "http://loinc.org", "code": "9279-1", "display": "Respiratory rate" }]
                },
                "subject": { "reference": "Device/87ea5dfc-8b8e-384d-8489-79496e706390" },
                "device": { "reference": "Device/87ea5dfc-8b8e-384d-8489-79496e706390" },
                "effectiveInstant": "2026-04-22T10:00:00.000Z",
                "valueQuantity": { "value": 14, "unit": "breaths/min", "system": "http://unitsofmeasure.org", "code": "/min" }
              }
            },
            {
              "resource": {
                "resourceType": "Observation",
                "id": "sleep",
                "status": "final",
                "code": {
                  "coding": [{ "system": "http://loinc.org", "code": "107145-5", "display": "Sleep status" }]
                },
                "subject": { "reference": "Device/87ea5dfc-8b8e-384d-8489-79496e706390" },
                "device": { "reference": "Device/87ea5dfc-8b8e-384d-8489-79496e706390" },
                "effectiveInstant": "2026-04-22T10:00:00.000Z",
                "valueCodeableConcept": { "text": "asleep" }
              }
            }
          ]
        }

        ```
      operationId: FhirController_getDeviceTelemetry[2]
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/DeviceTelemetryResponseDto"
        "400": *a49
        "401": *a50
        "404": *a51
        "422": *a52
        "500": *a53
      summary: Get device telemetry
      tags:
        - FHIR Operations
  /fhir/Device/{id}/telemetry/history:
    get:
      description: Query observation history for a device from Signals. Defaults to
        the last 72 hours.
      operationId: FhirController_getDeviceTelemetryHistory[0]
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
        - name: from
          required: false
          in: query
          schema:
            format: date-time
            type: string
        - name: to
          required: false
          in: query
          schema:
            format: date-time
            type: string
        - name: code
          required: false
          in: query
          schema:
            type: string
        - name: page
          required: false
          in: query
          schema:
            minimum: 1
            default: 1
            type: integer
        - name: pageSize
          required: false
          in: query
          schema:
            minimum: 1
            maximum: 100
            default: 50
            type: integer
      responses:
        "200":
          description: ""
        "400": *a49
        "401": *a50
        "404": *a51
        "422": *a52
        "500": *a53
      summary: Get device telemetry history
      tags:
        - FHIR Operations
  /fhir/R4/Device/{id}/telemetry/history:
    get:
      description: Query observation history for a device from Signals. Defaults to
        the last 72 hours.
      operationId: FhirController_getDeviceTelemetryHistory[1]
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
        - name: from
          required: false
          in: query
          schema:
            format: date-time
            type: string
        - name: to
          required: false
          in: query
          schema:
            format: date-time
            type: string
        - name: code
          required: false
          in: query
          schema:
            type: string
        - name: page
          required: false
          in: query
          schema:
            minimum: 1
            default: 1
            type: integer
        - name: pageSize
          required: false
          in: query
          schema:
            minimum: 1
            maximum: 100
            default: 50
            type: integer
      responses:
        "200":
          description: ""
        "400": *a49
        "401": *a50
        "404": *a51
        "422": *a52
        "500": *a53
      summary: Get device telemetry history
      tags:
        - FHIR Operations
  /fhir/R5/Device/{id}/telemetry/history:
    get:
      description: Query observation history for a device from Signals. Defaults to
        the last 72 hours.
      operationId: FhirController_getDeviceTelemetryHistory[2]
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
        - name: from
          required: false
          in: query
          schema:
            format: date-time
            type: string
        - name: to
          required: false
          in: query
          schema:
            format: date-time
            type: string
        - name: code
          required: false
          in: query
          schema:
            type: string
        - name: page
          required: false
          in: query
          schema:
            minimum: 1
            default: 1
            type: integer
        - name: pageSize
          required: false
          in: query
          schema:
            minimum: 1
            maximum: 100
            default: 50
            type: integer
      responses:
        "200":
          description: ""
        "400": *a49
        "401": *a50
        "404": *a51
        "422": *a52
        "500": *a53
      summary: Get device telemetry history
      tags:
        - FHIR Operations
  /fhir/Patient:
    post:
      description: Create a FHIR Patient resource. When withSignals=true, also
        provisions a corresponding Signals patient.
      operationId: FhirController_createPatient[0]
      parameters:
        - name: withSignals
          required: false
          in: query
          schema:
            default: false
            type: boolean
      responses:
        "200":
          description: ""
        "400": *a49
        "401": *a50
        "404": *a51
        "422": *a52
        "500": *a53
      summary: Create Patient with Signals linking
      tags:
        - FHIR Operations
  /fhir/R4/Patient:
    post:
      description: Create a FHIR Patient resource. When withSignals=true, also
        provisions a corresponding Signals patient.
      operationId: FhirController_createPatient[1]
      parameters:
        - name: withSignals
          required: false
          in: query
          schema:
            default: false
            type: boolean
      responses:
        "200":
          description: ""
        "400": *a49
        "401": *a50
        "404": *a51
        "422": *a52
        "500": *a53
      summary: Create Patient with Signals linking
      tags:
        - FHIR Operations
  /fhir/R5/Patient:
    post:
      description: Create a FHIR Patient resource. When withSignals=true, also
        provisions a corresponding Signals patient.
      operationId: FhirController_createPatient[2]
      parameters:
        - name: withSignals
          required: false
          in: query
          schema:
            default: false
            type: boolean
      responses:
        "200":
          description: ""
        "400": *a49
        "401": *a50
        "404": *a51
        "422": *a52
        "500": *a53
      summary: Create Patient with Signals linking
      tags:
        - FHIR Operations
  /fhir/Patient/{id}/threshold:
    put:
      description: Save a patient-level threshold CarePlan. When updateOnSignals=true,
        also pushes the configuration to Signals.
      operationId: FhirController_updatePatientThreshold[0]
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
        - name: updateOnSignals
          required: false
          in: query
          schema:
            default: false
            type: boolean
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/PatientThresholdBodyDto"
      responses:
        "200":
          description: ""
        "400": *a49
        "401": *a50
        "404": *a51
        "422": *a52
        "500": *a53
      summary: Update patient threshold
      tags:
        - FHIR Operations
  /fhir/R4/Patient/{id}/threshold:
    put:
      description: Save a patient-level threshold CarePlan. When updateOnSignals=true,
        also pushes the configuration to Signals.
      operationId: FhirController_updatePatientThreshold[1]
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
        - name: updateOnSignals
          required: false
          in: query
          schema:
            default: false
            type: boolean
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/PatientThresholdBodyDto"
      responses:
        "200":
          description: ""
        "400": *a49
        "401": *a50
        "404": *a51
        "422": *a52
        "500": *a53
      summary: Update patient threshold
      tags:
        - FHIR Operations
  /fhir/R5/Patient/{id}/threshold:
    put:
      description: Save a patient-level threshold CarePlan. When updateOnSignals=true,
        also pushes the configuration to Signals.
      operationId: FhirController_updatePatientThreshold[2]
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
        - name: updateOnSignals
          required: false
          in: query
          schema:
            default: false
            type: boolean
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/PatientThresholdBodyDto"
      responses:
        "200":
          description: ""
        "400": *a49
        "401": *a50
        "404": *a51
        "422": *a52
        "500": *a53
      summary: Update patient threshold
      tags:
        - FHIR Operations
  /fhir/Questionnaire/{id}/$populate:
    post:
      description: |
        This endpoint builds a FHIR QuestionnaireResponse based on provided questionnaire, patient and context.

        Here is an example questionnaire and its usage to generate a questionnaire response.

        The questionnaire has some variables fetched at runtime:

        - `ObsBodyHeight` which is the result of the following query: `Observation?code=8302-2&_count=1&_sort=-date&patient=Patient/{{%patient.id}}`.
        - `patient` which is the patient reference that is fetched at runtime with `launchContext`.

        The other variables can be sent from the client side in the request body if desired. See the example request body for more information.

        `patient-height` and `patient-weight` are the linkIds of the questionnaire items that will be populated with the fetched values and they will be used in the generated questionnaire response.

        ### Example questionnaire

        ```json
        {
          "resourceType": "Questionnaire",
          "extension": [
            {
              "url": "http://hl7.org/fhir/StructureDefinition/variable",
              "valueExpression": {
                "name": "ObsBodyHeight",
                "language": "application/x-fhir-query",
                "expression": "Observation?code=8302-2&_count=1&_sort=-date&patient=Patient/patientId
              }
            },
            {
              "url": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-launchContext",
              "extension": [
                {
                  "url": "name",
                  "valueCoding": {
                    "system": "http://hl7.org/fhir/uv/sdc/CodeSystem/launchContext",
                    "code": "patient"
                  }
                },
                {
                  "url": "type",
                  "valueCode": "Patient"
                },
                {
                  "url": "description",
                  "valueString": "The patient that is to be used to pre-populate the form"
                }
              ]
            },
            {
              "url": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-targetStructureMap",
              "valueCanonical": "https://smartforms.csiro.au/docs/StructureMap/extract-bmi"
            }
          ],
          "url": "https://fhir.ovok.com/fhir/R4/Questionnaire/example-questionnaire-id",
          "version": "0.1.0",
          "name": "CalculatedExpressionBMICalculatorPrepop",
          "title": "CalculatedExpression BMI Calculator - Pre-population",
          "status": "draft",
          "date": "2024-12-18",
          "publisher": "AEHRC CSIRO",
          "item": [
            {
              "extension": [
                {
                  "url": "http://hl7.org/fhir/StructureDefinition/variable",
                  "valueExpression": {
                    "name": "height",
                    "language": "text/fhirpath",
                    // NOTE: Here it's accessing the global variables
                    // NOTE: Instead you can also use the fetched Observation resource with %ObsBodyHeight.entry.resource.valueQuantity.value, and you don't need to use it in the request body anymore, however this would mean that the result is coming from the server and not from the client (Patient).
                    "expression": "%response.item.where(linkId='bmi-calculation').item.where(linkId='patient-height').answer.valueDecimal"
                  }
                },
                {
                  "url": "http://hl7.org/fhir/StructureDefinition/variable",
                  "valueExpression": {
                    "name": "weight",
                    "language": "text/fhirpath",
                    // NOTE: Here it's accessing the locally available context
                    "expression": "item.where(linkId='patient-weight').answer.valueDecimal"
                  }
                }
              ],
              "linkId": "bmi-calculation",
              "text": "BMI Calculation",
              "type": "group",
              "repeats": false,
              "item": [
                {
                  "linkId": "patient-height",
                  "text": "Height",
                  "type": "decimal",
                  "repeats": false,
                  "readOnly": false
                },
                {
                  "linkId": "patient-weight",
                  "text": "Weight",
                  "type": "decimal",
                  "repeats": false,
                  "readOnly": false
                },
                {
                  "extension": [
                    {
                      "url": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-calculatedExpression",
                      "valueExpression": {
                        "description": "BMI calculation",
                        "language": "text/fhirpath",
                        "expression": "(%weight/((%height/100).power(2))).round(1)"
                      }
                    },
                    {
                      "url": "http://hl7.org/fhir/StructureDefinition/questionnaire-unit",
                      "valueCoding": {
                        "system": "http://unitsofmeasure.org",
                        "code": "kg/m2",
                        "display": "kg/m2"
                      }
                    },
                    {
                      "url": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-observationExtract",
                      "valueBoolean": true
                    }
                  ],
                  "linkId": "bmi-result",
                  "code": [
                    {
                      "system": "http://snomed.info/sct",
                      "code": "60621009",
                      "display": "Body mass index"
                    }
                  ],
                  "text": "Value",
                  "type": "decimal",
                  "repeats": false,
                  "readOnly": true
                }
              ]
            }
          ],
          "id": "example-questionnaire-id"
        }
        ```

        ### Example request body

        ```json
        {
          "resourceType": "Parameters",
          "parameter": [
            {
              "name": "context",
              "part": [
                {
                  "name": "name",
                  "valueString": "myCustomVariableName"
                },
                {
                  "name": "content",
                  "resource": {
                    // NOTE: This can be accessed within the questionnaire response with %context.myCustomVariableName.myCustomDataKey
                    "myCustomDataKey": "myCustomDataValue"
                  }
                }
              ]
            },
            {
              "name": "response",
              "resource": {
                "resourceType": "QuestionnaireResponse",
                "status": "in-progress",
                "item": [
                  {
                    "linkId": "bmi-calculation",
                    "text": "BMI Calculation",
                    "item": [
                      {
                        "linkId": "patient-height",
                        "text": "Height",
                        "answer": [
                          {
                            // NOTE: You can also use the value of this item in the questionnaire response with %response.item.where(linkId='patient-height').answer.valueDecimal
                            // OR directly use without the global context with item.where(linkId='patient-height').answer.valueDecimal
                            "valueDecimal": 175
                          }
                        ]
                      },
                      {
                        "linkId": "patient-weight",
                        "text": "Weight",
                        "answer": [
                          {
                            "valueDecimal": 100
                          }
                        ]
                      }
                    ]
                  }
                ]
              }
            }
          ]
        }
        ```

        ### Example cURL request

        ```bash
        curl -X POST \
         --url 'https://api.dev.ovok.com/fhir/Questionnaire/example-questionnaire-id/$populate' \
         -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3ODY4OTk5NzcsImV4cCI6MTc4NjkwMzU3N30.sZTke9fx_gPeoj2v-FL9GhDqY0hh9EzdEc4XywFqb84' \
         -H 'Content-Type: application/json' \
         -d @populate-body.json # @populate-body.json is the request body from the previous example
        ```

        ### Example response, which is either a QuestionnaireResponse or an OperationOutcome (error)

        ```json
        {
          "resourceType": "QuestionnaireResponse",
          "status": "in-progress",
          "item": [
            {
              "linkId": "bmi-calculation",
              "text": "BMI Calculation",
              "item": [
                {
                  "linkId": "patient-height",
                  "text": "Height",
                  "answer": [
                    {
                      "valueDecimal": 175
                    }
                  ]
                },
                {
                  "linkId": "patient-weight",
                  "text": "Weight",
                  "answer": [
                    {
                      "valueDecimal": 100
                    }
                  ]
                },
                {
                  "linkId": "bmi-result",
                  "answer": [
                    {
                      "valueDecimal": 32.7
                    }
                  ],
                  "text": "Value"
                }
              ]
            }
          ]
        }
        ```

        Now you can use the response (QuestionnaireResponse) and POST it if you want to save it to the server.
      operationId: FhirController_populateQuestionnaire[0]
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/PopulateBodyRequestDto"
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PopulateBodyResponseDto"
        "400": *a49
        "401": *a50
        "404": *a51
        "422": *a52
        "500": *a53
      summary: Populate questionnaire
      tags:
        - FHIR Operations
  /fhir/R4/Questionnaire/{id}/$populate:
    post:
      description: |
        This endpoint builds a FHIR QuestionnaireResponse based on provided questionnaire, patient and context.

        Here is an example questionnaire and its usage to generate a questionnaire response.

        The questionnaire has some variables fetched at runtime:

        - `ObsBodyHeight` which is the result of the following query: `Observation?code=8302-2&_count=1&_sort=-date&patient=Patient/{{%patient.id}}`.
        - `patient` which is the patient reference that is fetched at runtime with `launchContext`.

        The other variables can be sent from the client side in the request body if desired. See the example request body for more information.

        `patient-height` and `patient-weight` are the linkIds of the questionnaire items that will be populated with the fetched values and they will be used in the generated questionnaire response.

        ### Example questionnaire

        ```json
        {
          "resourceType": "Questionnaire",
          "extension": [
            {
              "url": "http://hl7.org/fhir/StructureDefinition/variable",
              "valueExpression": {
                "name": "ObsBodyHeight",
                "language": "application/x-fhir-query",
                "expression": "Observation?code=8302-2&_count=1&_sort=-date&patient=Patient/patientId
              }
            },
            {
              "url": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-launchContext",
              "extension": [
                {
                  "url": "name",
                  "valueCoding": {
                    "system": "http://hl7.org/fhir/uv/sdc/CodeSystem/launchContext",
                    "code": "patient"
                  }
                },
                {
                  "url": "type",
                  "valueCode": "Patient"
                },
                {
                  "url": "description",
                  "valueString": "The patient that is to be used to pre-populate the form"
                }
              ]
            },
            {
              "url": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-targetStructureMap",
              "valueCanonical": "https://smartforms.csiro.au/docs/StructureMap/extract-bmi"
            }
          ],
          "url": "https://fhir.ovok.com/fhir/R4/Questionnaire/example-questionnaire-id",
          "version": "0.1.0",
          "name": "CalculatedExpressionBMICalculatorPrepop",
          "title": "CalculatedExpression BMI Calculator - Pre-population",
          "status": "draft",
          "date": "2024-12-18",
          "publisher": "AEHRC CSIRO",
          "item": [
            {
              "extension": [
                {
                  "url": "http://hl7.org/fhir/StructureDefinition/variable",
                  "valueExpression": {
                    "name": "height",
                    "language": "text/fhirpath",
                    // NOTE: Here it's accessing the global variables
                    // NOTE: Instead you can also use the fetched Observation resource with %ObsBodyHeight.entry.resource.valueQuantity.value, and you don't need to use it in the request body anymore, however this would mean that the result is coming from the server and not from the client (Patient).
                    "expression": "%response.item.where(linkId='bmi-calculation').item.where(linkId='patient-height').answer.valueDecimal"
                  }
                },
                {
                  "url": "http://hl7.org/fhir/StructureDefinition/variable",
                  "valueExpression": {
                    "name": "weight",
                    "language": "text/fhirpath",
                    // NOTE: Here it's accessing the locally available context
                    "expression": "item.where(linkId='patient-weight').answer.valueDecimal"
                  }
                }
              ],
              "linkId": "bmi-calculation",
              "text": "BMI Calculation",
              "type": "group",
              "repeats": false,
              "item": [
                {
                  "linkId": "patient-height",
                  "text": "Height",
                  "type": "decimal",
                  "repeats": false,
                  "readOnly": false
                },
                {
                  "linkId": "patient-weight",
                  "text": "Weight",
                  "type": "decimal",
                  "repeats": false,
                  "readOnly": false
                },
                {
                  "extension": [
                    {
                      "url": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-calculatedExpression",
                      "valueExpression": {
                        "description": "BMI calculation",
                        "language": "text/fhirpath",
                        "expression": "(%weight/((%height/100).power(2))).round(1)"
                      }
                    },
                    {
                      "url": "http://hl7.org/fhir/StructureDefinition/questionnaire-unit",
                      "valueCoding": {
                        "system": "http://unitsofmeasure.org",
                        "code": "kg/m2",
                        "display": "kg/m2"
                      }
                    },
                    {
                      "url": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-observationExtract",
                      "valueBoolean": true
                    }
                  ],
                  "linkId": "bmi-result",
                  "code": [
                    {
                      "system": "http://snomed.info/sct",
                      "code": "60621009",
                      "display": "Body mass index"
                    }
                  ],
                  "text": "Value",
                  "type": "decimal",
                  "repeats": false,
                  "readOnly": true
                }
              ]
            }
          ],
          "id": "example-questionnaire-id"
        }
        ```

        ### Example request body

        ```json
        {
          "resourceType": "Parameters",
          "parameter": [
            {
              "name": "context",
              "part": [
                {
                  "name": "name",
                  "valueString": "myCustomVariableName"
                },
                {
                  "name": "content",
                  "resource": {
                    // NOTE: This can be accessed within the questionnaire response with %context.myCustomVariableName.myCustomDataKey
                    "myCustomDataKey": "myCustomDataValue"
                  }
                }
              ]
            },
            {
              "name": "response",
              "resource": {
                "resourceType": "QuestionnaireResponse",
                "status": "in-progress",
                "item": [
                  {
                    "linkId": "bmi-calculation",
                    "text": "BMI Calculation",
                    "item": [
                      {
                        "linkId": "patient-height",
                        "text": "Height",
                        "answer": [
                          {
                            // NOTE: You can also use the value of this item in the questionnaire response with %response.item.where(linkId='patient-height').answer.valueDecimal
                            // OR directly use without the global context with item.where(linkId='patient-height').answer.valueDecimal
                            "valueDecimal": 175
                          }
                        ]
                      },
                      {
                        "linkId": "patient-weight",
                        "text": "Weight",
                        "answer": [
                          {
                            "valueDecimal": 100
                          }
                        ]
                      }
                    ]
                  }
                ]
              }
            }
          ]
        }
        ```

        ### Example cURL request

        ```bash
        curl -X POST \
         --url 'https://api.dev.ovok.com/fhir/Questionnaire/example-questionnaire-id/$populate' \
         -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3ODY4OTk5NzcsImV4cCI6MTc4NjkwMzU3N30.sZTke9fx_gPeoj2v-FL9GhDqY0hh9EzdEc4XywFqb84' \
         -H 'Content-Type: application/json' \
         -d @populate-body.json # @populate-body.json is the request body from the previous example
        ```

        ### Example response, which is either a QuestionnaireResponse or an OperationOutcome (error)

        ```json
        {
          "resourceType": "QuestionnaireResponse",
          "status": "in-progress",
          "item": [
            {
              "linkId": "bmi-calculation",
              "text": "BMI Calculation",
              "item": [
                {
                  "linkId": "patient-height",
                  "text": "Height",
                  "answer": [
                    {
                      "valueDecimal": 175
                    }
                  ]
                },
                {
                  "linkId": "patient-weight",
                  "text": "Weight",
                  "answer": [
                    {
                      "valueDecimal": 100
                    }
                  ]
                },
                {
                  "linkId": "bmi-result",
                  "answer": [
                    {
                      "valueDecimal": 32.7
                    }
                  ],
                  "text": "Value"
                }
              ]
            }
          ]
        }
        ```

        Now you can use the response (QuestionnaireResponse) and POST it if you want to save it to the server.
      operationId: FhirController_populateQuestionnaire[1]
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/PopulateBodyRequestDto"
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PopulateBodyResponseDto"
        "400": *a49
        "401": *a50
        "404": *a51
        "422": *a52
        "500": *a53
      summary: Populate questionnaire
      tags:
        - FHIR Operations
  /fhir/R5/Questionnaire/{id}/$populate:
    post:
      description: |
        This endpoint builds a FHIR QuestionnaireResponse based on provided questionnaire, patient and context.

        Here is an example questionnaire and its usage to generate a questionnaire response.

        The questionnaire has some variables fetched at runtime:

        - `ObsBodyHeight` which is the result of the following query: `Observation?code=8302-2&_count=1&_sort=-date&patient=Patient/{{%patient.id}}`.
        - `patient` which is the patient reference that is fetched at runtime with `launchContext`.

        The other variables can be sent from the client side in the request body if desired. See the example request body for more information.

        `patient-height` and `patient-weight` are the linkIds of the questionnaire items that will be populated with the fetched values and they will be used in the generated questionnaire response.

        ### Example questionnaire

        ```json
        {
          "resourceType": "Questionnaire",
          "extension": [
            {
              "url": "http://hl7.org/fhir/StructureDefinition/variable",
              "valueExpression": {
                "name": "ObsBodyHeight",
                "language": "application/x-fhir-query",
                "expression": "Observation?code=8302-2&_count=1&_sort=-date&patient=Patient/patientId
              }
            },
            {
              "url": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-launchContext",
              "extension": [
                {
                  "url": "name",
                  "valueCoding": {
                    "system": "http://hl7.org/fhir/uv/sdc/CodeSystem/launchContext",
                    "code": "patient"
                  }
                },
                {
                  "url": "type",
                  "valueCode": "Patient"
                },
                {
                  "url": "description",
                  "valueString": "The patient that is to be used to pre-populate the form"
                }
              ]
            },
            {
              "url": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-targetStructureMap",
              "valueCanonical": "https://smartforms.csiro.au/docs/StructureMap/extract-bmi"
            }
          ],
          "url": "https://fhir.ovok.com/fhir/R4/Questionnaire/example-questionnaire-id",
          "version": "0.1.0",
          "name": "CalculatedExpressionBMICalculatorPrepop",
          "title": "CalculatedExpression BMI Calculator - Pre-population",
          "status": "draft",
          "date": "2024-12-18",
          "publisher": "AEHRC CSIRO",
          "item": [
            {
              "extension": [
                {
                  "url": "http://hl7.org/fhir/StructureDefinition/variable",
                  "valueExpression": {
                    "name": "height",
                    "language": "text/fhirpath",
                    // NOTE: Here it's accessing the global variables
                    // NOTE: Instead you can also use the fetched Observation resource with %ObsBodyHeight.entry.resource.valueQuantity.value, and you don't need to use it in the request body anymore, however this would mean that the result is coming from the server and not from the client (Patient).
                    "expression": "%response.item.where(linkId='bmi-calculation').item.where(linkId='patient-height').answer.valueDecimal"
                  }
                },
                {
                  "url": "http://hl7.org/fhir/StructureDefinition/variable",
                  "valueExpression": {
                    "name": "weight",
                    "language": "text/fhirpath",
                    // NOTE: Here it's accessing the locally available context
                    "expression": "item.where(linkId='patient-weight').answer.valueDecimal"
                  }
                }
              ],
              "linkId": "bmi-calculation",
              "text": "BMI Calculation",
              "type": "group",
              "repeats": false,
              "item": [
                {
                  "linkId": "patient-height",
                  "text": "Height",
                  "type": "decimal",
                  "repeats": false,
                  "readOnly": false
                },
                {
                  "linkId": "patient-weight",
                  "text": "Weight",
                  "type": "decimal",
                  "repeats": false,
                  "readOnly": false
                },
                {
                  "extension": [
                    {
                      "url": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-calculatedExpression",
                      "valueExpression": {
                        "description": "BMI calculation",
                        "language": "text/fhirpath",
                        "expression": "(%weight/((%height/100).power(2))).round(1)"
                      }
                    },
                    {
                      "url": "http://hl7.org/fhir/StructureDefinition/questionnaire-unit",
                      "valueCoding": {
                        "system": "http://unitsofmeasure.org",
                        "code": "kg/m2",
                        "display": "kg/m2"
                      }
                    },
                    {
                      "url": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-observationExtract",
                      "valueBoolean": true
                    }
                  ],
                  "linkId": "bmi-result",
                  "code": [
                    {
                      "system": "http://snomed.info/sct",
                      "code": "60621009",
                      "display": "Body mass index"
                    }
                  ],
                  "text": "Value",
                  "type": "decimal",
                  "repeats": false,
                  "readOnly": true
                }
              ]
            }
          ],
          "id": "example-questionnaire-id"
        }
        ```

        ### Example request body

        ```json
        {
          "resourceType": "Parameters",
          "parameter": [
            {
              "name": "context",
              "part": [
                {
                  "name": "name",
                  "valueString": "myCustomVariableName"
                },
                {
                  "name": "content",
                  "resource": {
                    // NOTE: This can be accessed within the questionnaire response with %context.myCustomVariableName.myCustomDataKey
                    "myCustomDataKey": "myCustomDataValue"
                  }
                }
              ]
            },
            {
              "name": "response",
              "resource": {
                "resourceType": "QuestionnaireResponse",
                "status": "in-progress",
                "item": [
                  {
                    "linkId": "bmi-calculation",
                    "text": "BMI Calculation",
                    "item": [
                      {
                        "linkId": "patient-height",
                        "text": "Height",
                        "answer": [
                          {
                            // NOTE: You can also use the value of this item in the questionnaire response with %response.item.where(linkId='patient-height').answer.valueDecimal
                            // OR directly use without the global context with item.where(linkId='patient-height').answer.valueDecimal
                            "valueDecimal": 175
                          }
                        ]
                      },
                      {
                        "linkId": "patient-weight",
                        "text": "Weight",
                        "answer": [
                          {
                            "valueDecimal": 100
                          }
                        ]
                      }
                    ]
                  }
                ]
              }
            }
          ]
        }
        ```

        ### Example cURL request

        ```bash
        curl -X POST \
         --url 'https://api.dev.ovok.com/fhir/Questionnaire/example-questionnaire-id/$populate' \
         -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3ODY4OTk5NzcsImV4cCI6MTc4NjkwMzU3N30.sZTke9fx_gPeoj2v-FL9GhDqY0hh9EzdEc4XywFqb84' \
         -H 'Content-Type: application/json' \
         -d @populate-body.json # @populate-body.json is the request body from the previous example
        ```

        ### Example response, which is either a QuestionnaireResponse or an OperationOutcome (error)

        ```json
        {
          "resourceType": "QuestionnaireResponse",
          "status": "in-progress",
          "item": [
            {
              "linkId": "bmi-calculation",
              "text": "BMI Calculation",
              "item": [
                {
                  "linkId": "patient-height",
                  "text": "Height",
                  "answer": [
                    {
                      "valueDecimal": 175
                    }
                  ]
                },
                {
                  "linkId": "patient-weight",
                  "text": "Weight",
                  "answer": [
                    {
                      "valueDecimal": 100
                    }
                  ]
                },
                {
                  "linkId": "bmi-result",
                  "answer": [
                    {
                      "valueDecimal": 32.7
                    }
                  ],
                  "text": "Value"
                }
              ]
            }
          ]
        }
        ```

        Now you can use the response (QuestionnaireResponse) and POST it if you want to save it to the server.
      operationId: FhirController_populateQuestionnaire[2]
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/PopulateBodyRequestDto"
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PopulateBodyResponseDto"
        "400": *a49
        "401": *a50
        "404": *a51
        "422": *a52
        "500": *a53
      summary: Populate questionnaire
      tags:
        - FHIR Operations
  /fhir/QuestionnaireResponse/{id}/$extract:
    post:
      description: >
        This endpoint builds Observations based on the provided
        QuestionnaireResponse.


        Please use the `Questionnaire/<id>/$populate` endpoint to get the
        QuestionnaireResponse first, save it and then use the id of the saved
        QuestionnaireResponse in this endpoint.


        ### Example questionnaire response resource in the database


        ```json

        {
          "resourceType": "QuestionnaireResponse",
          "status": "in-progress",
          "questionnaire": "https://fhir.ovok.com/fhir/R4/Questionnaire/59d9a1ce-008c-4e4f-97fb-ef598d3f2c34|0.1.0",
          "item": [
            {
              "linkId": "bmi-calculation",
              "text": "BMI Calculation",
              "item": [
                {
                  "linkId": "bmi-result",
                  "answer": [
                    {
                      "valueDecimal": 32.7
                    }
                  ],
                  "text": "Value"
                },
                {
                  "linkId": "patient-height",
                  "text": "Height",
                  "answer": [
                    {
                      "valueDecimal": 175
                    }
                  ]
                },
                {
                  "linkId": "patient-weight",
                  "text": "Weight",
                  "answer": [
                    {
                      "valueDecimal": 100
                    }
                  ]
                }
              ]
            }
          ],
          "subject": {
            "type": "Patient",
            "reference": "Patient/1684f841-953a-41c2-a298-64af08945349"
          },
          "id": "example-questionnaire-response-id"
        }

        ```


        Given that the above questionnaire response is saved in the database,
        you can use the id of the questionnaire response in this endpoint to
        extract the Observations.


        ### Example request


        ```bash

        curl -X POST \
          --url 'https://api.dev.ovok.com/QuestionnaireResponse/example-questionnaire-response-id/$extract' \
          --header 'Authorization: Bearer example.jwt.eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3ODY4OTk5NzcsImV4cCI6MTc4NjkwMzU3N30.sZTke9fx_gPeoj2v-FL9GhDqY0hh9EzdEc4XywFqb84'
        ```


        ### Example response containing a bundle of Observations (wrapped in a
        Parameter resource)


        ```json

        {
          "resourceType": "Parameters",
          "parameter": [
            {
              "name": "response",
              "resource": {
                "resourceType": "Bundle",
                "type": "transaction",
                "entry": [
                  {
                    "request": {
                      "method": "POST",
                      "url": "Observation"
                    },
                    "resource": {
                      "resourceType": "Observation",
                      "status": "final",
                      "code": {
                        "coding": [
                          {
                            "system": "http://snomed.info/sct",
                            "code": "60621009",
                            "display": "Body mass index"
                          }
                        ]
                      },
                      "subject": {
                        "type": "Patient",
                        "reference": "Patient/1684f841-953a-41c2-a298-64af08945349"
                      },
                      "derivedFrom": [
                        {
                          "reference": "QuestionnaireResponse/26073103-8a48-4fed-8f38-b1b1e39f4083"
                        }
                      ],
                      "valueQuantity": {
                        "value": 32.7
                      }
                    }
                  }
                ]
              }
            }
          ]
        }

        ```
      operationId: FhirController_extractObservationsFromQuestionnaireResponse[0]
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ExtractBodyResponseDto"
        "400": *a49
        "401": *a50
        "404": *a51
        "422": *a52
        "500": *a53
      summary: Extract observations from questionnaire response
      tags:
        - FHIR Operations
  /fhir/R4/QuestionnaireResponse/{id}/$extract:
    post:
      description: >
        This endpoint builds Observations based on the provided
        QuestionnaireResponse.


        Please use the `Questionnaire/<id>/$populate` endpoint to get the
        QuestionnaireResponse first, save it and then use the id of the saved
        QuestionnaireResponse in this endpoint.


        ### Example questionnaire response resource in the database


        ```json

        {
          "resourceType": "QuestionnaireResponse",
          "status": "in-progress",
          "questionnaire": "https://fhir.ovok.com/fhir/R4/Questionnaire/59d9a1ce-008c-4e4f-97fb-ef598d3f2c34|0.1.0",
          "item": [
            {
              "linkId": "bmi-calculation",
              "text": "BMI Calculation",
              "item": [
                {
                  "linkId": "bmi-result",
                  "answer": [
                    {
                      "valueDecimal": 32.7
                    }
                  ],
                  "text": "Value"
                },
                {
                  "linkId": "patient-height",
                  "text": "Height",
                  "answer": [
                    {
                      "valueDecimal": 175
                    }
                  ]
                },
                {
                  "linkId": "patient-weight",
                  "text": "Weight",
                  "answer": [
                    {
                      "valueDecimal": 100
                    }
                  ]
                }
              ]
            }
          ],
          "subject": {
            "type": "Patient",
            "reference": "Patient/1684f841-953a-41c2-a298-64af08945349"
          },
          "id": "example-questionnaire-response-id"
        }

        ```


        Given that the above questionnaire response is saved in the database,
        you can use the id of the questionnaire response in this endpoint to
        extract the Observations.


        ### Example request


        ```bash

        curl -X POST \
          --url 'https://api.dev.ovok.com/QuestionnaireResponse/example-questionnaire-response-id/$extract' \
          --header 'Authorization: Bearer example.jwt.eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3ODY4OTk5NzcsImV4cCI6MTc4NjkwMzU3N30.sZTke9fx_gPeoj2v-FL9GhDqY0hh9EzdEc4XywFqb84'
        ```


        ### Example response containing a bundle of Observations (wrapped in a
        Parameter resource)


        ```json

        {
          "resourceType": "Parameters",
          "parameter": [
            {
              "name": "response",
              "resource": {
                "resourceType": "Bundle",
                "type": "transaction",
                "entry": [
                  {
                    "request": {
                      "method": "POST",
                      "url": "Observation"
                    },
                    "resource": {
                      "resourceType": "Observation",
                      "status": "final",
                      "code": {
                        "coding": [
                          {
                            "system": "http://snomed.info/sct",
                            "code": "60621009",
                            "display": "Body mass index"
                          }
                        ]
                      },
                      "subject": {
                        "type": "Patient",
                        "reference": "Patient/1684f841-953a-41c2-a298-64af08945349"
                      },
                      "derivedFrom": [
                        {
                          "reference": "QuestionnaireResponse/26073103-8a48-4fed-8f38-b1b1e39f4083"
                        }
                      ],
                      "valueQuantity": {
                        "value": 32.7
                      }
                    }
                  }
                ]
              }
            }
          ]
        }

        ```
      operationId: FhirController_extractObservationsFromQuestionnaireResponse[1]
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ExtractBodyResponseDto"
        "400": *a49
        "401": *a50
        "404": *a51
        "422": *a52
        "500": *a53
      summary: Extract observations from questionnaire response
      tags:
        - FHIR Operations
  /fhir/R5/QuestionnaireResponse/{id}/$extract:
    post:
      description: >
        This endpoint builds Observations based on the provided
        QuestionnaireResponse.


        Please use the `Questionnaire/<id>/$populate` endpoint to get the
        QuestionnaireResponse first, save it and then use the id of the saved
        QuestionnaireResponse in this endpoint.


        ### Example questionnaire response resource in the database


        ```json

        {
          "resourceType": "QuestionnaireResponse",
          "status": "in-progress",
          "questionnaire": "https://fhir.ovok.com/fhir/R4/Questionnaire/59d9a1ce-008c-4e4f-97fb-ef598d3f2c34|0.1.0",
          "item": [
            {
              "linkId": "bmi-calculation",
              "text": "BMI Calculation",
              "item": [
                {
                  "linkId": "bmi-result",
                  "answer": [
                    {
                      "valueDecimal": 32.7
                    }
                  ],
                  "text": "Value"
                },
                {
                  "linkId": "patient-height",
                  "text": "Height",
                  "answer": [
                    {
                      "valueDecimal": 175
                    }
                  ]
                },
                {
                  "linkId": "patient-weight",
                  "text": "Weight",
                  "answer": [
                    {
                      "valueDecimal": 100
                    }
                  ]
                }
              ]
            }
          ],
          "subject": {
            "type": "Patient",
            "reference": "Patient/1684f841-953a-41c2-a298-64af08945349"
          },
          "id": "example-questionnaire-response-id"
        }

        ```


        Given that the above questionnaire response is saved in the database,
        you can use the id of the questionnaire response in this endpoint to
        extract the Observations.


        ### Example request


        ```bash

        curl -X POST \
          --url 'https://api.dev.ovok.com/QuestionnaireResponse/example-questionnaire-response-id/$extract' \
          --header 'Authorization: Bearer example.jwt.eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3ODY4OTk5NzcsImV4cCI6MTc4NjkwMzU3N30.sZTke9fx_gPeoj2v-FL9GhDqY0hh9EzdEc4XywFqb84'
        ```


        ### Example response containing a bundle of Observations (wrapped in a
        Parameter resource)


        ```json

        {
          "resourceType": "Parameters",
          "parameter": [
            {
              "name": "response",
              "resource": {
                "resourceType": "Bundle",
                "type": "transaction",
                "entry": [
                  {
                    "request": {
                      "method": "POST",
                      "url": "Observation"
                    },
                    "resource": {
                      "resourceType": "Observation",
                      "status": "final",
                      "code": {
                        "coding": [
                          {
                            "system": "http://snomed.info/sct",
                            "code": "60621009",
                            "display": "Body mass index"
                          }
                        ]
                      },
                      "subject": {
                        "type": "Patient",
                        "reference": "Patient/1684f841-953a-41c2-a298-64af08945349"
                      },
                      "derivedFrom": [
                        {
                          "reference": "QuestionnaireResponse/26073103-8a48-4fed-8f38-b1b1e39f4083"
                        }
                      ],
                      "valueQuantity": {
                        "value": 32.7
                      }
                    }
                  }
                ]
              }
            }
          ]
        }

        ```
      operationId: FhirController_extractObservationsFromQuestionnaireResponse[2]
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ExtractBodyResponseDto"
        "400": *a49
        "401": *a50
        "404": *a51
        "422": *a52
        "500": *a53
      summary: Extract observations from questionnaire response
      tags:
        - FHIR Operations
  /localization/i18next/{language}:
    get:
      description: >
        Download the i18next JSON file for applications


        Applications require the i18next JSON file to be downloaded and used to
        initialize the i18next library.

        The response is a JSON object with the i18next format.


        > NOTE: The provided language must be enabled in the system by calling
        Locale APIs.
      operationId: LocalizationI18NextController_getAllI18n
      parameters:
        - name: language
          required: true
          in: path
          schema:
            type: string
            enum:
              - Cy-az-AZ
              - Cy-sr-SP
              - Cy-uz-UZ
              - Lt-az-AZ
              - Lt-sr-SP
              - Lt-uz-UZ
              - aa
              - ab
              - ae
              - af
              - af-ZA
              - ak
              - am
              - an
              - ar
              - ar-AE
              - ar-BH
              - ar-DZ
              - ar-EG
              - ar-IQ
              - ar-JO
              - ar-KW
              - ar-LB
              - ar-LY
              - ar-MA
              - ar-OM
              - ar-QA
              - ar-SA
              - ar-SY
              - ar-TN
              - ar-YE
              - as
              - av
              - ay
              - az
              - ba
              - be
              - be-BY
              - bg
              - bg-BG
              - bh
              - bi
              - bm
              - bn
              - bo
              - br
              - bs
              - ca
              - ca-ES
              - ce
              - ch
              - co
              - cr
              - cs
              - cs-CZ
              - cu
              - cv
              - cy
              - da
              - da-DK
              - de
              - de-AT
              - de-CH
              - de-DE
              - de-LI
              - de-LU
              - div-MV
              - dv
              - dz
              - ee
              - el
              - el-GR
              - en
              - en-AU
              - en-BZ
              - en-CA
              - en-CB
              - en-GB
              - en-IE
              - en-JM
              - en-NZ
              - en-PH
              - en-TT
              - en-US
              - en-ZA
              - en-ZW
              - eo
              - es
              - es-AR
              - es-BO
              - es-CL
              - es-CO
              - es-CR
              - es-DO
              - es-EC
              - es-ES
              - es-GT
              - es-HN
              - es-MX
              - es-NI
              - es-PA
              - es-PE
              - es-PR
              - es-PY
              - es-SV
              - es-UY
              - es-VE
              - et
              - et-EE
              - eu
              - eu-ES
              - fa
              - fa-IR
              - ff
              - fi
              - fi-FI
              - fj
              - fo
              - fo-FO
              - fr
              - fr-BE
              - fr-CA
              - fr-CH
              - fr-FR
              - fr-LU
              - fr-MC
              - fy
              - ga
              - gd
              - gl
              - gl-ES
              - gn
              - gu
              - gu-IN
              - gv
              - ha
              - he
              - he-IL
              - hi
              - hi-IN
              - ho
              - hr
              - hr-HR
              - ht
              - hu
              - hu-HU
              - hy
              - hy-AM
              - hz
              - ia
              - id
              - id-ID
              - ie
              - ig
              - ii
              - ik
              - io
              - is
              - is-IS
              - it
              - it-CH
              - it-IT
              - iu
              - ja
              - ja-JP
              - jv
              - ka
              - ka-GE
              - kg
              - ki
              - kj
              - kk
              - kk-KZ
              - kl
              - km
              - kn
              - kn-IN
              - ko
              - ko-KR
              - kr
              - ks
              - ku
              - kv
              - kw
              - ky
              - ky-KZ
              - la
              - lb
              - lg
              - li
              - ln
              - lo
              - lt
              - lt-LT
              - lu
              - lv
              - lv-LV
              - mg
              - mh
              - mi
              - mk
              - mk-MK
              - ml
              - mn
              - mn-MN
              - mr
              - mr-IN
              - ms
              - ms-BN
              - ms-MY
              - mt
              - my
              - na
              - nb
              - nb-NO
              - nd
              - ne
              - ng
              - nl
              - nl-BE
              - nl-NL
              - nn
              - nn-NO
              - no
              - nr
              - nv
              - ny
              - oc
              - oj
              - om
              - or
              - os
              - pa
              - pa-IN
              - pi
              - pl
              - pl-PL
              - ps
              - pt
              - pt-BR
              - pt-PT
              - qu
              - rm
              - rn
              - ro
              - ro-RO
              - ru
              - ru-RU
              - rw
              - sa
              - sa-IN
              - sc
              - sd
              - se
              - sg
              - si
              - sk
              - sk-SK
              - sl
              - sl-SI
              - sm
              - sn
              - so
              - sq
              - sq-AL
              - sr
              - ss
              - st
              - su
              - sv
              - sv-FI
              - sv-SE
              - sw
              - sw-KE
              - ta
              - ta-IN
              - te
              - te-IN
              - tg
              - th
              - th-TH
              - ti
              - tk
              - tl
              - tn
              - to
              - tr
              - tr-TR
              - ts
              - tt
              - tt-RU
              - tw
              - ty
              - ug
              - uk
              - uk-UA
              - ur
              - ur-PK
              - uz
              - ve
              - vi
              - vi-VN
              - vo
              - wa
              - wo
              - xh
              - yi
              - yo
              - za
              - zh
              - zh-CHS
              - zh-CHT
              - zh-CN
              - zh-HK
              - zh-MO
              - zh-SG
              - zh-TW
              - zu
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/i18nGetDto"
        "400": &a54
          description: The request could not be operated by the server.
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: number
                    example: 400
                  message:
                    type: string
                  error:
                    type: string
                    example: Bad Request
                required:
                  - statusCode
                  - message
        "401": &a55
          description: The resource owner or authorization server denied the request.
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: number
                    example: 401
                  message:
                    type: string
                  error:
                    type: string
                    example: Unauthorized
                required:
                  - statusCode
                  - message
        "404": &a56
          description: The requested resource could not be found.
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: number
                    example: 404
                  message:
                    type: string
                  error:
                    type: string
                    example: Not Found
                required:
                  - statusCode
                  - message
        "422": &a57
          description: The request could not be validated by the server.
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: number
                    example: 422
                  message:
                    type: string
                  error:
                    type: string
                    example: Unprocessable Entity
                required:
                  - statusCode
                  - message
        "500": &a58
          description: The server encountered an unexpected condition. Please try again
            later.
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: number
                    example: 500
                  message:
                    type: string
                  error:
                    type: string
                    example: Internal Server Error
                required:
                  - statusCode
                  - message
      security: &a59
        - bearer: []
      summary: i18next - Get JSON
      tags:
        - Localization Keys
    patch:
      description: >
        Update the i18next JSON file for applications


        The i18next JSON file is used to update the localization in a frontend
        application at runtime/compile time.

        The request doesn't return anything and updating the i18next JSON file
        is an async process.


        NOTE: All pre-existing and matching localizations will be overwritten,
        pre-existing and non-matching localizations will not be affected and
        non-pre-existing localizations will be created.


        > NOTE: The provided language must be enabled in the system by calling
        Locale APIs.
      operationId: LocalizationI18NextController_patchAllI18n
      parameters:
        - name: language
          required: true
          in: path
          schema:
            type: string
            enum:
              - Cy-az-AZ
              - Cy-sr-SP
              - Cy-uz-UZ
              - Lt-az-AZ
              - Lt-sr-SP
              - Lt-uz-UZ
              - aa
              - ab
              - ae
              - af
              - af-ZA
              - ak
              - am
              - an
              - ar
              - ar-AE
              - ar-BH
              - ar-DZ
              - ar-EG
              - ar-IQ
              - ar-JO
              - ar-KW
              - ar-LB
              - ar-LY
              - ar-MA
              - ar-OM
              - ar-QA
              - ar-SA
              - ar-SY
              - ar-TN
              - ar-YE
              - as
              - av
              - ay
              - az
              - ba
              - be
              - be-BY
              - bg
              - bg-BG
              - bh
              - bi
              - bm
              - bn
              - bo
              - br
              - bs
              - ca
              - ca-ES
              - ce
              - ch
              - co
              - cr
              - cs
              - cs-CZ
              - cu
              - cv
              - cy
              - da
              - da-DK
              - de
              - de-AT
              - de-CH
              - de-DE
              - de-LI
              - de-LU
              - div-MV
              - dv
              - dz
              - ee
              - el
              - el-GR
              - en
              - en-AU
              - en-BZ
              - en-CA
              - en-CB
              - en-GB
              - en-IE
              - en-JM
              - en-NZ
              - en-PH
              - en-TT
              - en-US
              - en-ZA
              - en-ZW
              - eo
              - es
              - es-AR
              - es-BO
              - es-CL
              - es-CO
              - es-CR
              - es-DO
              - es-EC
              - es-ES
              - es-GT
              - es-HN
              - es-MX
              - es-NI
              - es-PA
              - es-PE
              - es-PR
              - es-PY
              - es-SV
              - es-UY
              - es-VE
              - et
              - et-EE
              - eu
              - eu-ES
              - fa
              - fa-IR
              - ff
              - fi
              - fi-FI
              - fj
              - fo
              - fo-FO
              - fr
              - fr-BE
              - fr-CA
              - fr-CH
              - fr-FR
              - fr-LU
              - fr-MC
              - fy
              - ga
              - gd
              - gl
              - gl-ES
              - gn
              - gu
              - gu-IN
              - gv
              - ha
              - he
              - he-IL
              - hi
              - hi-IN
              - ho
              - hr
              - hr-HR
              - ht
              - hu
              - hu-HU
              - hy
              - hy-AM
              - hz
              - ia
              - id
              - id-ID
              - ie
              - ig
              - ii
              - ik
              - io
              - is
              - is-IS
              - it
              - it-CH
              - it-IT
              - iu
              - ja
              - ja-JP
              - jv
              - ka
              - ka-GE
              - kg
              - ki
              - kj
              - kk
              - kk-KZ
              - kl
              - km
              - kn
              - kn-IN
              - ko
              - ko-KR
              - kr
              - ks
              - ku
              - kv
              - kw
              - ky
              - ky-KZ
              - la
              - lb
              - lg
              - li
              - ln
              - lo
              - lt
              - lt-LT
              - lu
              - lv
              - lv-LV
              - mg
              - mh
              - mi
              - mk
              - mk-MK
              - ml
              - mn
              - mn-MN
              - mr
              - mr-IN
              - ms
              - ms-BN
              - ms-MY
              - mt
              - my
              - na
              - nb
              - nb-NO
              - nd
              - ne
              - ng
              - nl
              - nl-BE
              - nl-NL
              - nn
              - nn-NO
              - no
              - nr
              - nv
              - ny
              - oc
              - oj
              - om
              - or
              - os
              - pa
              - pa-IN
              - pi
              - pl
              - pl-PL
              - ps
              - pt
              - pt-BR
              - pt-PT
              - qu
              - rm
              - rn
              - ro
              - ro-RO
              - ru
              - ru-RU
              - rw
              - sa
              - sa-IN
              - sc
              - sd
              - se
              - sg
              - si
              - sk
              - sk-SK
              - sl
              - sl-SI
              - sm
              - sn
              - so
              - sq
              - sq-AL
              - sr
              - ss
              - st
              - su
              - sv
              - sv-FI
              - sv-SE
              - sw
              - sw-KE
              - ta
              - ta-IN
              - te
              - te-IN
              - tg
              - th
              - th-TH
              - ti
              - tk
              - tl
              - tn
              - to
              - tr
              - tr-TR
              - ts
              - tt
              - tt-RU
              - tw
              - ty
              - ug
              - uk
              - uk-UA
              - ur
              - ur-PK
              - uz
              - ve
              - vi
              - vi-VN
              - vo
              - wa
              - wo
              - xh
              - yi
              - yo
              - za
              - zh
              - zh-CHS
              - zh-CHT
              - zh-CN
              - zh-HK
              - zh-MO
              - zh-SG
              - zh-TW
              - zu
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/i18nPatchDto"
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/i18nPatchDto"
        "400": *a54
        "401": *a55
        "404": *a56
        "422": *a57
        "500": *a58
      security: *a59
      summary: i18next - Update JSON
      tags:
        - Localization Keys
  /localization/map/{target}:
    get:
      description: |
        Map a localization to a target language

        All query parameters are FHIR query parameteters.

        ### Parameters

        | Parameter Example            | Description                                                              |
        | ---------------------------- | ------------------------------------------------------------------------ |
        | category=key&#124;home.about | Get all localizations for the key `home.about`                           |
        | title:contains=About Page    | Get all localizations where the value of the title contains `About Page` |
        | \_offset=0                   | Offset of the first localization                                         |
        | \_count=10                   | Count of the localizations                                               |

        > NOTE: The provided language must be enabled in the system by calling Locale APIs.
      operationId: LocalizationMappedController_mapLocalizations
      parameters:
        - name: target
          required: true
          in: path
          schema:
            type: string
            enum:
              - Cy-az-AZ
              - Cy-sr-SP
              - Cy-uz-UZ
              - Lt-az-AZ
              - Lt-sr-SP
              - Lt-uz-UZ
              - aa
              - ab
              - ae
              - af
              - af-ZA
              - ak
              - am
              - an
              - ar
              - ar-AE
              - ar-BH
              - ar-DZ
              - ar-EG
              - ar-IQ
              - ar-JO
              - ar-KW
              - ar-LB
              - ar-LY
              - ar-MA
              - ar-OM
              - ar-QA
              - ar-SA
              - ar-SY
              - ar-TN
              - ar-YE
              - as
              - av
              - ay
              - az
              - ba
              - be
              - be-BY
              - bg
              - bg-BG
              - bh
              - bi
              - bm
              - bn
              - bo
              - br
              - bs
              - ca
              - ca-ES
              - ce
              - ch
              - co
              - cr
              - cs
              - cs-CZ
              - cu
              - cv
              - cy
              - da
              - da-DK
              - de
              - de-AT
              - de-CH
              - de-DE
              - de-LI
              - de-LU
              - div-MV
              - dv
              - dz
              - ee
              - el
              - el-GR
              - en
              - en-AU
              - en-BZ
              - en-CA
              - en-CB
              - en-GB
              - en-IE
              - en-JM
              - en-NZ
              - en-PH
              - en-TT
              - en-US
              - en-ZA
              - en-ZW
              - eo
              - es
              - es-AR
              - es-BO
              - es-CL
              - es-CO
              - es-CR
              - es-DO
              - es-EC
              - es-ES
              - es-GT
              - es-HN
              - es-MX
              - es-NI
              - es-PA
              - es-PE
              - es-PR
              - es-PY
              - es-SV
              - es-UY
              - es-VE
              - et
              - et-EE
              - eu
              - eu-ES
              - fa
              - fa-IR
              - ff
              - fi
              - fi-FI
              - fj
              - fo
              - fo-FO
              - fr
              - fr-BE
              - fr-CA
              - fr-CH
              - fr-FR
              - fr-LU
              - fr-MC
              - fy
              - ga
              - gd
              - gl
              - gl-ES
              - gn
              - gu
              - gu-IN
              - gv
              - ha
              - he
              - he-IL
              - hi
              - hi-IN
              - ho
              - hr
              - hr-HR
              - ht
              - hu
              - hu-HU
              - hy
              - hy-AM
              - hz
              - ia
              - id
              - id-ID
              - ie
              - ig
              - ii
              - ik
              - io
              - is
              - is-IS
              - it
              - it-CH
              - it-IT
              - iu
              - ja
              - ja-JP
              - jv
              - ka
              - ka-GE
              - kg
              - ki
              - kj
              - kk
              - kk-KZ
              - kl
              - km
              - kn
              - kn-IN
              - ko
              - ko-KR
              - kr
              - ks
              - ku
              - kv
              - kw
              - ky
              - ky-KZ
              - la
              - lb
              - lg
              - li
              - ln
              - lo
              - lt
              - lt-LT
              - lu
              - lv
              - lv-LV
              - mg
              - mh
              - mi
              - mk
              - mk-MK
              - ml
              - mn
              - mn-MN
              - mr
              - mr-IN
              - ms
              - ms-BN
              - ms-MY
              - mt
              - my
              - na
              - nb
              - nb-NO
              - nd
              - ne
              - ng
              - nl
              - nl-BE
              - nl-NL
              - nn
              - nn-NO
              - no
              - nr
              - nv
              - ny
              - oc
              - oj
              - om
              - or
              - os
              - pa
              - pa-IN
              - pi
              - pl
              - pl-PL
              - ps
              - pt
              - pt-BR
              - pt-PT
              - qu
              - rm
              - rn
              - ro
              - ro-RO
              - ru
              - ru-RU
              - rw
              - sa
              - sa-IN
              - sc
              - sd
              - se
              - sg
              - si
              - sk
              - sk-SK
              - sl
              - sl-SI
              - sm
              - sn
              - so
              - sq
              - sq-AL
              - sr
              - ss
              - st
              - su
              - sv
              - sv-FI
              - sv-SE
              - sw
              - sw-KE
              - ta
              - ta-IN
              - te
              - te-IN
              - tg
              - th
              - th-TH
              - ti
              - tk
              - tl
              - tn
              - to
              - tr
              - tr-TR
              - ts
              - tt
              - tt-RU
              - tw
              - ty
              - ug
              - uk
              - uk-UA
              - ur
              - ur-PK
              - uz
              - ve
              - vi
              - vi-VN
              - vo
              - wa
              - wo
              - xh
              - yi
              - yo
              - za
              - zh
              - zh-CHS
              - zh-CHT
              - zh-CN
              - zh-HK
              - zh-MO
              - zh-SG
              - zh-TW
              - zu
        - name: _count
          required: false
          in: query
          schema:
            default: "10"
            type: string
        - name: _offset
          required: false
          in: query
          schema:
            default: "0"
            type: string
        - name: _sort
          required: false
          in: query
          schema:
            default: -date
            type: string
        - name: search
          required: false
          in: query
          schema:
            type: string
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PaginatedMapSearchResponseDto"
        "400":
          description: The request could not be operated by the server.
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: number
                    example: 400
                  message:
                    type: string
                  error:
                    type: string
                    example: Bad Request
                required:
                  - statusCode
                  - message
        "401":
          description: The resource owner or authorization server denied the request.
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: number
                    example: 401
                  message:
                    type: string
                  error:
                    type: string
                    example: Unauthorized
                required:
                  - statusCode
                  - message
        "404":
          description: The requested resource could not be found.
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: number
                    example: 404
                  message:
                    type: string
                  error:
                    type: string
                    example: Not Found
                required:
                  - statusCode
                  - message
        "422":
          description: The request could not be validated by the server.
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: number
                    example: 422
                  message:
                    type: string
                  error:
                    type: string
                    example: Unprocessable Entity
                required:
                  - statusCode
                  - message
        "500":
          description: The server encountered an unexpected condition. Please try again
            later.
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: number
                    example: 500
                  message:
                    type: string
                  error:
                    type: string
                    example: Internal Server Error
                required:
                  - statusCode
                  - message
      security:
        - bearer: []
      summary: Mapped Localizations
      tags:
        - Localization Keys
  /localization/{language}:
    get:
      description: |
        Get all localizations

        All query parameters are FHIR query parameteters and therefore optional.

        ### Parameters

        | Parameter Example            | Description                                                              |
        | ---------------------------- | ------------------------------------------------------------------------ |
        | category=language&#124;en-US | Get all localizations for the language `en-US`                           |
        | category=key&#124;home.about | Get all localizations for the key `home.about`                           |
        | title:contains=About Page    | Get all localizations where the value of the title contains `About Page` |
        | \_offset=0                   | Offset of the first localization                                         |
        | \_count=10                   | Count of the localizations                                               |

        > NOTE: The provided language must be enabled in the system by calling Locale APIs.
      operationId: LocalizationController_getLocalizations
      parameters:
        - name: language
          required: true
          in: path
          schema:
            type: string
            enum:
              - Cy-az-AZ
              - Cy-sr-SP
              - Cy-uz-UZ
              - Lt-az-AZ
              - Lt-sr-SP
              - Lt-uz-UZ
              - aa
              - ab
              - ae
              - af
              - af-ZA
              - ak
              - am
              - an
              - ar
              - ar-AE
              - ar-BH
              - ar-DZ
              - ar-EG
              - ar-IQ
              - ar-JO
              - ar-KW
              - ar-LB
              - ar-LY
              - ar-MA
              - ar-OM
              - ar-QA
              - ar-SA
              - ar-SY
              - ar-TN
              - ar-YE
              - as
              - av
              - ay
              - az
              - ba
              - be
              - be-BY
              - bg
              - bg-BG
              - bh
              - bi
              - bm
              - bn
              - bo
              - br
              - bs
              - ca
              - ca-ES
              - ce
              - ch
              - co
              - cr
              - cs
              - cs-CZ
              - cu
              - cv
              - cy
              - da
              - da-DK
              - de
              - de-AT
              - de-CH
              - de-DE
              - de-LI
              - de-LU
              - div-MV
              - dv
              - dz
              - ee
              - el
              - el-GR
              - en
              - en-AU
              - en-BZ
              - en-CA
              - en-CB
              - en-GB
              - en-IE
              - en-JM
              - en-NZ
              - en-PH
              - en-TT
              - en-US
              - en-ZA
              - en-ZW
              - eo
              - es
              - es-AR
              - es-BO
              - es-CL
              - es-CO
              - es-CR
              - es-DO
              - es-EC
              - es-ES
              - es-GT
              - es-HN
              - es-MX
              - es-NI
              - es-PA
              - es-PE
              - es-PR
              - es-PY
              - es-SV
              - es-UY
              - es-VE
              - et
              - et-EE
              - eu
              - eu-ES
              - fa
              - fa-IR
              - ff
              - fi
              - fi-FI
              - fj
              - fo
              - fo-FO
              - fr
              - fr-BE
              - fr-CA
              - fr-CH
              - fr-FR
              - fr-LU
              - fr-MC
              - fy
              - ga
              - gd
              - gl
              - gl-ES
              - gn
              - gu
              - gu-IN
              - gv
              - ha
              - he
              - he-IL
              - hi
              - hi-IN
              - ho
              - hr
              - hr-HR
              - ht
              - hu
              - hu-HU
              - hy
              - hy-AM
              - hz
              - ia
              - id
              - id-ID
              - ie
              - ig
              - ii
              - ik
              - io
              - is
              - is-IS
              - it
              - it-CH
              - it-IT
              - iu
              - ja
              - ja-JP
              - jv
              - ka
              - ka-GE
              - kg
              - ki
              - kj
              - kk
              - kk-KZ
              - kl
              - km
              - kn
              - kn-IN
              - ko
              - ko-KR
              - kr
              - ks
              - ku
              - kv
              - kw
              - ky
              - ky-KZ
              - la
              - lb
              - lg
              - li
              - ln
              - lo
              - lt
              - lt-LT
              - lu
              - lv
              - lv-LV
              - mg
              - mh
              - mi
              - mk
              - mk-MK
              - ml
              - mn
              - mn-MN
              - mr
              - mr-IN
              - ms
              - ms-BN
              - ms-MY
              - mt
              - my
              - na
              - nb
              - nb-NO
              - nd
              - ne
              - ng
              - nl
              - nl-BE
              - nl-NL
              - nn
              - nn-NO
              - no
              - nr
              - nv
              - ny
              - oc
              - oj
              - om
              - or
              - os
              - pa
              - pa-IN
              - pi
              - pl
              - pl-PL
              - ps
              - pt
              - pt-BR
              - pt-PT
              - qu
              - rm
              - rn
              - ro
              - ro-RO
              - ru
              - ru-RU
              - rw
              - sa
              - sa-IN
              - sc
              - sd
              - se
              - sg
              - si
              - sk
              - sk-SK
              - sl
              - sl-SI
              - sm
              - sn
              - so
              - sq
              - sq-AL
              - sr
              - ss
              - st
              - su
              - sv
              - sv-FI
              - sv-SE
              - sw
              - sw-KE
              - ta
              - ta-IN
              - te
              - te-IN
              - tg
              - th
              - th-TH
              - ti
              - tk
              - tl
              - tn
              - to
              - tr
              - tr-TR
              - ts
              - tt
              - tt-RU
              - tw
              - ty
              - ug
              - uk
              - uk-UA
              - ur
              - ur-PK
              - uz
              - ve
              - vi
              - vi-VN
              - vo
              - wa
              - wo
              - xh
              - yi
              - yo
              - za
              - zh
              - zh-CHS
              - zh-CHT
              - zh-CN
              - zh-HK
              - zh-MO
              - zh-SG
              - zh-TW
              - zu
        - name: _count
          required: false
          in: query
          schema:
            default: "10"
            type: string
        - name: _offset
          required: false
          in: query
          schema:
            default: "0"
            type: string
        - name: _sort
          required: false
          in: query
          schema:
            default: -date
            type: string
        - name: search
          required: false
          in: query
          schema:
            type: string
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PaginatedSearchResponseDto"
        "400": &a60
          description: The request could not be operated by the server.
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: number
                    example: 400
                  message:
                    type: string
                  error:
                    type: string
                    example: Bad Request
                required:
                  - statusCode
                  - message
        "401": &a61
          description: The resource owner or authorization server denied the request.
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: number
                    example: 401
                  message:
                    type: string
                  error:
                    type: string
                    example: Unauthorized
                required:
                  - statusCode
                  - message
        "404": &a62
          description: The requested resource could not be found.
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: number
                    example: 404
                  message:
                    type: string
                  error:
                    type: string
                    example: Not Found
                required:
                  - statusCode
                  - message
        "422": &a63
          description: The request could not be validated by the server.
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: number
                    example: 422
                  message:
                    type: string
                  error:
                    type: string
                    example: Unprocessable Entity
                required:
                  - statusCode
                  - message
        "500": &a64
          description: The server encountered an unexpected condition. Please try again
            later.
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: number
                    example: 500
                  message:
                    type: string
                  error:
                    type: string
                    example: Internal Server Error
                required:
                  - statusCode
                  - message
      security: &a65
        - bearer: []
      summary: Get all localizations
      tags:
        - Localization Keys
  /localization/{language}/{key}:
    get:
      description: >
        Get a single localization by language and key


        The response is a JSON object with the localization.


        > NOTE: The provided language must be enabled in the system by calling
        Locale APIs.
      operationId: LocalizationController_getLocalization
      parameters:
        - name: key
          required: true
          in: path
          schema:
            pattern: ^[a-zA-Z0-9_-][a-zA-Z0-9_\-.]*$
            example: home.screen.title
            type: string
        - name: language
          required: true
          in: path
          schema:
            type: string
            enum:
              - Cy-az-AZ
              - Cy-sr-SP
              - Cy-uz-UZ
              - Lt-az-AZ
              - Lt-sr-SP
              - Lt-uz-UZ
              - aa
              - ab
              - ae
              - af
              - af-ZA
              - ak
              - am
              - an
              - ar
              - ar-AE
              - ar-BH
              - ar-DZ
              - ar-EG
              - ar-IQ
              - ar-JO
              - ar-KW
              - ar-LB
              - ar-LY
              - ar-MA
              - ar-OM
              - ar-QA
              - ar-SA
              - ar-SY
              - ar-TN
              - ar-YE
              - as
              - av
              - ay
              - az
              - ba
              - be
              - be-BY
              - bg
              - bg-BG
              - bh
              - bi
              - bm
              - bn
              - bo
              - br
              - bs
              - ca
              - ca-ES
              - ce
              - ch
              - co
              - cr
              - cs
              - cs-CZ
              - cu
              - cv
              - cy
              - da
              - da-DK
              - de
              - de-AT
              - de-CH
              - de-DE
              - de-LI
              - de-LU
              - div-MV
              - dv
              - dz
              - ee
              - el
              - el-GR
              - en
              - en-AU
              - en-BZ
              - en-CA
              - en-CB
              - en-GB
              - en-IE
              - en-JM
              - en-NZ
              - en-PH
              - en-TT
              - en-US
              - en-ZA
              - en-ZW
              - eo
              - es
              - es-AR
              - es-BO
              - es-CL
              - es-CO
              - es-CR
              - es-DO
              - es-EC
              - es-ES
              - es-GT
              - es-HN
              - es-MX
              - es-NI
              - es-PA
              - es-PE
              - es-PR
              - es-PY
              - es-SV
              - es-UY
              - es-VE
              - et
              - et-EE
              - eu
              - eu-ES
              - fa
              - fa-IR
              - ff
              - fi
              - fi-FI
              - fj
              - fo
              - fo-FO
              - fr
              - fr-BE
              - fr-CA
              - fr-CH
              - fr-FR
              - fr-LU
              - fr-MC
              - fy
              - ga
              - gd
              - gl
              - gl-ES
              - gn
              - gu
              - gu-IN
              - gv
              - ha
              - he
              - he-IL
              - hi
              - hi-IN
              - ho
              - hr
              - hr-HR
              - ht
              - hu
              - hu-HU
              - hy
              - hy-AM
              - hz
              - ia
              - id
              - id-ID
              - ie
              - ig
              - ii
              - ik
              - io
              - is
              - is-IS
              - it
              - it-CH
              - it-IT
              - iu
              - ja
              - ja-JP
              - jv
              - ka
              - ka-GE
              - kg
              - ki
              - kj
              - kk
              - kk-KZ
              - kl
              - km
              - kn
              - kn-IN
              - ko
              - ko-KR
              - kr
              - ks
              - ku
              - kv
              - kw
              - ky
              - ky-KZ
              - la
              - lb
              - lg
              - li
              - ln
              - lo
              - lt
              - lt-LT
              - lu
              - lv
              - lv-LV
              - mg
              - mh
              - mi
              - mk
              - mk-MK
              - ml
              - mn
              - mn-MN
              - mr
              - mr-IN
              - ms
              - ms-BN
              - ms-MY
              - mt
              - my
              - na
              - nb
              - nb-NO
              - nd
              - ne
              - ng
              - nl
              - nl-BE
              - nl-NL
              - nn
              - nn-NO
              - no
              - nr
              - nv
              - ny
              - oc
              - oj
              - om
              - or
              - os
              - pa
              - pa-IN
              - pi
              - pl
              - pl-PL
              - ps
              - pt
              - pt-BR
              - pt-PT
              - qu
              - rm
              - rn
              - ro
              - ro-RO
              - ru
              - ru-RU
              - rw
              - sa
              - sa-IN
              - sc
              - sd
              - se
              - sg
              - si
              - sk
              - sk-SK
              - sl
              - sl-SI
              - sm
              - sn
              - so
              - sq
              - sq-AL
              - sr
              - ss
              - st
              - su
              - sv
              - sv-FI
              - sv-SE
              - sw
              - sw-KE
              - ta
              - ta-IN
              - te
              - te-IN
              - tg
              - th
              - th-TH
              - ti
              - tk
              - tl
              - tn
              - to
              - tr
              - tr-TR
              - ts
              - tt
              - tt-RU
              - tw
              - ty
              - ug
              - uk
              - uk-UA
              - ur
              - ur-PK
              - uz
              - ve
              - vi
              - vi-VN
              - vo
              - wa
              - wo
              - xh
              - yi
              - yo
              - za
              - zh
              - zh-CHS
              - zh-CHT
              - zh-CN
              - zh-HK
              - zh-MO
              - zh-SG
              - zh-TW
              - zu
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/LocalizationDto"
        "400": *a60
        "401": *a61
        "404": *a62
        "422": *a63
        "500": *a64
      security: *a65
      summary: Get a single localization
      tags:
        - Localization Keys
    put:
      description: >
        Update or create a single localization by language and key


        The request body is a JSON object with the localization.


        > NOTE: The provided language must be enabled in the system by calling
        Locale APIs.
      operationId: LocalizationController_updateLocalization
      parameters:
        - name: key
          required: true
          in: path
          schema:
            pattern: ^[a-zA-Z0-9_-][a-zA-Z0-9_\-.]*$
            example: home.screen.title
            type: string
        - name: language
          required: true
          in: path
          schema:
            type: string
            enum:
              - Cy-az-AZ
              - Cy-sr-SP
              - Cy-uz-UZ
              - Lt-az-AZ
              - Lt-sr-SP
              - Lt-uz-UZ
              - aa
              - ab
              - ae
              - af
              - af-ZA
              - ak
              - am
              - an
              - ar
              - ar-AE
              - ar-BH
              - ar-DZ
              - ar-EG
              - ar-IQ
              - ar-JO
              - ar-KW
              - ar-LB
              - ar-LY
              - ar-MA
              - ar-OM
              - ar-QA
              - ar-SA
              - ar-SY
              - ar-TN
              - ar-YE
              - as
              - av
              - ay
              - az
              - ba
              - be
              - be-BY
              - bg
              - bg-BG
              - bh
              - bi
              - bm
              - bn
              - bo
              - br
              - bs
              - ca
              - ca-ES
              - ce
              - ch
              - co
              - cr
              - cs
              - cs-CZ
              - cu
              - cv
              - cy
              - da
              - da-DK
              - de
              - de-AT
              - de-CH
              - de-DE
              - de-LI
              - de-LU
              - div-MV
              - dv
              - dz
              - ee
              - el
              - el-GR
              - en
              - en-AU
              - en-BZ
              - en-CA
              - en-CB
              - en-GB
              - en-IE
              - en-JM
              - en-NZ
              - en-PH
              - en-TT
              - en-US
              - en-ZA
              - en-ZW
              - eo
              - es
              - es-AR
              - es-BO
              - es-CL
              - es-CO
              - es-CR
              - es-DO
              - es-EC
              - es-ES
              - es-GT
              - es-HN
              - es-MX
              - es-NI
              - es-PA
              - es-PE
              - es-PR
              - es-PY
              - es-SV
              - es-UY
              - es-VE
              - et
              - et-EE
              - eu
              - eu-ES
              - fa
              - fa-IR
              - ff
              - fi
              - fi-FI
              - fj
              - fo
              - fo-FO
              - fr
              - fr-BE
              - fr-CA
              - fr-CH
              - fr-FR
              - fr-LU
              - fr-MC
              - fy
              - ga
              - gd
              - gl
              - gl-ES
              - gn
              - gu
              - gu-IN
              - gv
              - ha
              - he
              - he-IL
              - hi
              - hi-IN
              - ho
              - hr
              - hr-HR
              - ht
              - hu
              - hu-HU
              - hy
              - hy-AM
              - hz
              - ia
              - id
              - id-ID
              - ie
              - ig
              - ii
              - ik
              - io
              - is
              - is-IS
              - it
              - it-CH
              - it-IT
              - iu
              - ja
              - ja-JP
              - jv
              - ka
              - ka-GE
              - kg
              - ki
              - kj
              - kk
              - kk-KZ
              - kl
              - km
              - kn
              - kn-IN
              - ko
              - ko-KR
              - kr
              - ks
              - ku
              - kv
              - kw
              - ky
              - ky-KZ
              - la
              - lb
              - lg
              - li
              - ln
              - lo
              - lt
              - lt-LT
              - lu
              - lv
              - lv-LV
              - mg
              - mh
              - mi
              - mk
              - mk-MK
              - ml
              - mn
              - mn-MN
              - mr
              - mr-IN
              - ms
              - ms-BN
              - ms-MY
              - mt
              - my
              - na
              - nb
              - nb-NO
              - nd
              - ne
              - ng
              - nl
              - nl-BE
              - nl-NL
              - nn
              - nn-NO
              - no
              - nr
              - nv
              - ny
              - oc
              - oj
              - om
              - or
              - os
              - pa
              - pa-IN
              - pi
              - pl
              - pl-PL
              - ps
              - pt
              - pt-BR
              - pt-PT
              - qu
              - rm
              - rn
              - ro
              - ro-RO
              - ru
              - ru-RU
              - rw
              - sa
              - sa-IN
              - sc
              - sd
              - se
              - sg
              - si
              - sk
              - sk-SK
              - sl
              - sl-SI
              - sm
              - sn
              - so
              - sq
              - sq-AL
              - sr
              - ss
              - st
              - su
              - sv
              - sv-FI
              - sv-SE
              - sw
              - sw-KE
              - ta
              - ta-IN
              - te
              - te-IN
              - tg
              - th
              - th-TH
              - ti
              - tk
              - tl
              - tn
              - to
              - tr
              - tr-TR
              - ts
              - tt
              - tt-RU
              - tw
              - ty
              - ug
              - uk
              - uk-UA
              - ur
              - ur-PK
              - uz
              - ve
              - vi
              - vi-VN
              - vo
              - wa
              - wo
              - xh
              - yi
              - yo
              - za
              - zh
              - zh-CHS
              - zh-CHT
              - zh-CN
              - zh-HK
              - zh-MO
              - zh-SG
              - zh-TW
              - zu
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/LocalizationRequestBodyDto"
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/LocalizationDto"
        "400": *a60
        "401": *a61
        "404": *a62
        "422": *a63
        "500": *a64
      security: *a65
      summary: Update a single localization
      tags:
        - Localization Keys
    delete:
      description: >
        Delete a single localization by language and key


        The request doesn't return anything.


        > NOTE: The provided language must be enabled in the system by calling
        Locale APIs.
      operationId: LocalizationController_deleteLocalization
      parameters:
        - name: key
          required: true
          in: path
          schema:
            pattern: ^[a-zA-Z0-9_-][a-zA-Z0-9_\-.]*$
            example: home.screen.title
            type: string
        - name: language
          required: true
          in: path
          schema:
            type: string
            enum:
              - Cy-az-AZ
              - Cy-sr-SP
              - Cy-uz-UZ
              - Lt-az-AZ
              - Lt-sr-SP
              - Lt-uz-UZ
              - aa
              - ab
              - ae
              - af
              - af-ZA
              - ak
              - am
              - an
              - ar
              - ar-AE
              - ar-BH
              - ar-DZ
              - ar-EG
              - ar-IQ
              - ar-JO
              - ar-KW
              - ar-LB
              - ar-LY
              - ar-MA
              - ar-OM
              - ar-QA
              - ar-SA
              - ar-SY
              - ar-TN
              - ar-YE
              - as
              - av
              - ay
              - az
              - ba
              - be
              - be-BY
              - bg
              - bg-BG
              - bh
              - bi
              - bm
              - bn
              - bo
              - br
              - bs
              - ca
              - ca-ES
              - ce
              - ch
              - co
              - cr
              - cs
              - cs-CZ
              - cu
              - cv
              - cy
              - da
              - da-DK
              - de
              - de-AT
              - de-CH
              - de-DE
              - de-LI
              - de-LU
              - div-MV
              - dv
              - dz
              - ee
              - el
              - el-GR
              - en
              - en-AU
              - en-BZ
              - en-CA
              - en-CB
              - en-GB
              - en-IE
              - en-JM
              - en-NZ
              - en-PH
              - en-TT
              - en-US
              - en-ZA
              - en-ZW
              - eo
              - es
              - es-AR
              - es-BO
              - es-CL
              - es-CO
              - es-CR
              - es-DO
              - es-EC
              - es-ES
              - es-GT
              - es-HN
              - es-MX
              - es-NI
              - es-PA
              - es-PE
              - es-PR
              - es-PY
              - es-SV
              - es-UY
              - es-VE
              - et
              - et-EE
              - eu
              - eu-ES
              - fa
              - fa-IR
              - ff
              - fi
              - fi-FI
              - fj
              - fo
              - fo-FO
              - fr
              - fr-BE
              - fr-CA
              - fr-CH
              - fr-FR
              - fr-LU
              - fr-MC
              - fy
              - ga
              - gd
              - gl
              - gl-ES
              - gn
              - gu
              - gu-IN
              - gv
              - ha
              - he
              - he-IL
              - hi
              - hi-IN
              - ho
              - hr
              - hr-HR
              - ht
              - hu
              - hu-HU
              - hy
              - hy-AM
              - hz
              - ia
              - id
              - id-ID
              - ie
              - ig
              - ii
              - ik
              - io
              - is
              - is-IS
              - it
              - it-CH
              - it-IT
              - iu
              - ja
              - ja-JP
              - jv
              - ka
              - ka-GE
              - kg
              - ki
              - kj
              - kk
              - kk-KZ
              - kl
              - km
              - kn
              - kn-IN
              - ko
              - ko-KR
              - kr
              - ks
              - ku
              - kv
              - kw
              - ky
              - ky-KZ
              - la
              - lb
              - lg
              - li
              - ln
              - lo
              - lt
              - lt-LT
              - lu
              - lv
              - lv-LV
              - mg
              - mh
              - mi
              - mk
              - mk-MK
              - ml
              - mn
              - mn-MN
              - mr
              - mr-IN
              - ms
              - ms-BN
              - ms-MY
              - mt
              - my
              - na
              - nb
              - nb-NO
              - nd
              - ne
              - ng
              - nl
              - nl-BE
              - nl-NL
              - nn
              - nn-NO
              - no
              - nr
              - nv
              - ny
              - oc
              - oj
              - om
              - or
              - os
              - pa
              - pa-IN
              - pi
              - pl
              - pl-PL
              - ps
              - pt
              - pt-BR
              - pt-PT
              - qu
              - rm
              - rn
              - ro
              - ro-RO
              - ru
              - ru-RU
              - rw
              - sa
              - sa-IN
              - sc
              - sd
              - se
              - sg
              - si
              - sk
              - sk-SK
              - sl
              - sl-SI
              - sm
              - sn
              - so
              - sq
              - sq-AL
              - sr
              - ss
              - st
              - su
              - sv
              - sv-FI
              - sv-SE
              - sw
              - sw-KE
              - ta
              - ta-IN
              - te
              - te-IN
              - tg
              - th
              - th-TH
              - ti
              - tk
              - tl
              - tn
              - to
              - tr
              - tr-TR
              - ts
              - tt
              - tt-RU
              - tw
              - ty
              - ug
              - uk
              - uk-UA
              - ur
              - ur-PK
              - uz
              - ve
              - vi
              - vi-VN
              - vo
              - wa
              - wo
              - xh
              - yi
              - yo
              - za
              - zh
              - zh-CHS
              - zh-CHT
              - zh-CN
              - zh-HK
              - zh-MO
              - zh-SG
              - zh-TW
              - zu
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/LocalizationDto"
        "400": *a60
        "401": *a61
        "404": *a62
        "422": *a63
        "500": *a64
      security: *a65
      summary: Delete a single localization
      tags:
        - Localization Keys
info:
  title: Public APIs
  description: >-
    This is the public API for the OVOK platform. It contains all the public

    endpoints for the platform. This API is used by the web application and the

    mobile application. It is also used by the FHIR API to provide a high level

    interface to the FHIR resources. The FHIR API is a lower level API that
    provides

    direct access to the FHIR resources. Please refer to the FHIR API
    documentation [here](https://ovok.redocly.app) for more information.
  version: 2026.08.16
  contact: {}
tags: []
servers:
  - url: https://api.dev.ovok.com
    description: Sandbox server
components:
  securitySchemes:
    bearer:
      scheme: bearer
      bearerFormat: JWT
      type: http
    api-key:
      type: apiKey
      in: header
      name: x-api-key
  schemas:
    ResponseBodyAccountsDataDto:
      type: array
      items:
        type: object
        properties:
          email:
            type: string
            format: email
            description: User email.
          name:
            type: string
            description: User name.
        required:
          - email
          - name
        example:
          email: max.mustermann@example.com
          name: Max Mustermann
      example:
        - email: max.mustermann@example.com
          name: Max Mustermann
    RequestB2BInviteDto:
      type: object
      properties:
        email:
          type: string
          format: email
          description: The email of the user registering, must be a valid email in order
            to send a verification email
        name:
          type: string
          minLength: 1
          maxLength: 128
          description: The name of the user registering.
        surname:
          type: string
          minLength: 1
          maxLength: 128
          description: The surname of the user registering.
        tenantId:
          type: string
          format: uuid
          description: ID of the parent project.
        admin:
          default: false
          type: boolean
          description: Whether the user is an admin.
      required:
        - email
        - name
        - tenantId
      example:
        email: max.mustermann@example.com
        name: Max
        surname: Mustermann
        tenantId: 79762310-6da9-48e3-f18a-8ae1f4a6dc25
        admin: true
    RequestLoginV2Dto:
      type: object
      properties:
        email:
          type: string
          format: email
          description: The user's email address.
        password:
          type: string
          minLength: 1
          maxLength: 128
          description: The user's password.
        clientId:
          type: string
          format: uuid
          description: ID of the client.
        tenantId:
          type: string
          format: uuid
          description: ID of the tenant.
      required:
        - email
        - password
        - clientId
        - tenantId
      example:
        email: max.mustermann@example.com
        password: p}mz%#iqsHnP]=I9
        clientId: a703da46-ec97-a84a-4573-c50634706367
        tenantId: f6f4da8d-93e8-8a08-220e-03b7810451d3
    ResponseRegisterLoginDto:
      type: object
      properties:
        accessToken:
          type: string
          description: Bearer access token. Expires in 1 hour.
        refreshToken:
          type: string
          description: Refresh token.
        expiresIn:
          default: 3600
          type: integer
          description: Token expiration.
        project:
          type: object
          properties:
            reference:
              type: string
              description: Reference of the project.
            display:
              type: string
              description: Display name of the project.
          required:
            - reference
            - display
        profile:
          type: object
          properties:
            reference:
              type: string
              description: Reference of the profile.
            display:
              type: string
              description: Display name of the profile.
          required:
            - reference
            - display
      required:
        - accessToken
        - project
        - profile
      example:
        accessToken: example.jwt.eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3ODY4OTk5NzcsImV4cCI6MTc4NjkwMzU3N30.sZTke9fx_gPeoj2v-FL9GhDqY0hh9EzdEc4XywFqb84
        refreshToken: example.jwt.eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3ODY4OTk5NzcsImV4cCI6MTc4NjkwMzU3N30.sZTke9fx_gPeoj2v-FL9GhDqY0hh9EzdEc4XywFqb84
        expiresIn: 3600
        project:
          reference: Project/f6f4da8d-93e8-8a08-220e-03b7810451d3
          display: My Medical Project
        profile:
          reference: Patient/de5c57ff-7257-57b0-13ab-aab6f5f91498
          display: Max Mustermann
    RequestRegisterV2Dto:
      type: object
      properties:
        email:
          type: string
          format: email
          description: The email of the user registering, must be a valid email in order
            to send a verification email
        password:
          type: string
          minLength: 1
          maxLength: 128
        name:
          type: string
          minLength: 1
          maxLength: 128
          description: The name of the user registering.
        surname:
          type: string
          minLength: 1
          maxLength: 128
          description: The surname of the user registering.
        tenantId:
          type: string
          format: uuid
          description: ID of the parent project.
        clientId:
          type: string
          format: uuid
          description: ID of the client.
      required:
        - email
        - password
        - name
        - surname
        - tenantId
        - clientId
      example:
        email: max.mustermann@example.com
        password: p}mz%#iqsHnP]=I9
        name: Max
        surname: Mustermann
        tenantId: 79762310-6da9-48e3-f18a-8ae1f4a6dc25
        clientId: a703da46-ec97-a84a-4573-c50634706367
    GoogleLoginDto:
      type: object
      properties:
        idToken:
          type: string
        access_token:
          type: string
        expires_in:
          type: number
        scope:
          type: string
        token_type:
          type: string
      required:
        - idToken
      example:
        idToken: example.jwt.eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3ODY4OTk5NzcsImV4cCI6MTc4NjkwMzU3N30.sZTke9fx_gPeoj2v-FL9GhDqY0hh9EzdEc4XywFqb84
        access_token: example.jwt.eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3ODY4OTk5NzcsImV4cCI6MTc4NjkwMzU3N30.sZTke9fx_gPeoj2v-FL9GhDqY0hh9EzdEc4XywFqb84
        expires_in: 3600
        scope: openid
        token_type: bearer
    ResponseTokenDto:
      type: object
      properties:
        access_token:
          type: string
          description: Bearer access token. Expires in 1 hour.
        refresh_token:
          type: string
          description: Refresh token.
        expires_in:
          type: integer
          description: Token expiration.
      required:
        - access_token
        - expires_in
      example:
        access_token: example.jwt.eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3ODY4OTk5NzcsImV4cCI6MTc4NjkwMzU3N30.sZTke9fx_gPeoj2v-FL9GhDqY0hh9EzdEc4XywFqb84
        refresh_token: example.jwt.eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3ODY4OTk5NzcsImV4cCI6MTc4NjkwMzU3N30.sZTke9fx_gPeoj2v-FL9GhDqY0hh9EzdEc4XywFqb84
        expires_in: 3600
    AppleLoginDto:
      type: object
      properties:
        identityToken:
          type: string
        realUserStatus:
          oneOf:
            - type: number
          nullable: true
        authorizationCode:
          oneOf:
            - type: string
          nullable: true
        state:
          oneOf:
            - type: string
          nullable: true
        fullName:
          type: object
          properties:
            namePrefix:
              oneOf:
                - type: string
              nullable: true
            givenName:
              oneOf:
                - type: string
              nullable: true
            familyName:
              oneOf:
                - type: string
              nullable: true
            nickname:
              oneOf:
                - type: string
              nullable: true
            middleName:
              oneOf:
                - type: string
              nullable: true
            nameSuffix:
              oneOf:
                - type: string
              nullable: true
          required:
            - namePrefix
            - givenName
            - familyName
            - nickname
            - middleName
            - nameSuffix
        user:
          oneOf:
            - type: string
          nullable: true
        email:
          oneOf:
            - type: string
          nullable: true
      required:
        - identityToken
        - realUserStatus
        - authorizationCode
        - state
        - user
        - email
      example:
        identityToken: example.jwt.eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3ODY4OTk5NzcsImV4cCI6MTc4NjkwMzU3N30.sZTke9fx_gPeoj2v-FL9GhDqY0hh9EzdEc4XywFqb84
        realUserStatus: 1
        authorizationCode: hfdwe58hgsj734jh358j632gi954g.0.wfgsfv.krsvEREWF_WRFCVsrbc
        state: null
        fullName:
          namePrefix: Dr.
          givenName: Max
          familyName: Mustermann
          nickname: Maxi
          middleName: John
          nameSuffix: Esq.
        user: 834456.54ltk5mn78n23jrki7k76564edkl64l12qe.3790
        email: max.mustermann@example.com
    ChangePasswordRequestBodyDto:
      type: object
      properties:
        oldPassword:
          type: string
        newPassword:
          type: string
      required:
        - oldPassword
        - newPassword
    NewMemberRequestDto:
      type: object
      properties:
        email:
          type: string
          format: email
        name:
          type: string
          minLength: 1
        surname:
          type: string
        admin:
          default: false
          type: boolean
        type:
          type: string
          enum:
            - Patient
            - Practitioner
        projectId:
          type: string
      required:
        - email
        - name
        - type
        - projectId
      example:
        email: max.mustermann@example.com
        name: Max
        surname: Mustermann
        admin: false
        type: Patient
        projectId: f6f4da8d-93e8-8a08-220e-03b7810451d3
    RefreshTokenDto:
      type: object
      properties:
        refresh_token:
          type: string
          minLength: 1
          description: Refresh token.
      required:
        - refresh_token
      example:
        refresh_token: example.jwt.eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3ODY4OTk5NzcsImV4cCI6MTc4NjkwMzU3N30.sZTke9fx_gPeoj2v-FL9GhDqY0hh9EzdEc4XywFqb84
    RequestDeleteDto:
      type: object
      properties:
        days:
          default: 30
          type: integer
          minimum: 0
          maximum: 90
          description: After how many days the user should be deleted.
        wipe:
          default: false
          type: boolean
          description: Deletes all medical data related to the user. If true, all medical
            data of the user will be deleted at the time of deletion. By
            default, this is false.
      example:
        days: 30
        wipe: false
    ResponseDeleteDto:
      type: object
      properties:
        scheduled:
          type: string
          description: Has the user account been scheduled for deletion.
        user:
          type: object
          properties:
            resourceType:
              default: User
              type: string
              description: Resource type.
            id:
              type: string
              description: User ID.
            firstName:
              type: string
              description: First name.
            lastName:
              type: string
              description: Last name.
            email:
              type: string
              format: email
              description: Email.
            project:
              type: object
              properties:
                reference:
                  type: string
                  description: Project reference.
                display:
                  type: string
                  description: Project name.
              description: Project containing the User.
            meta:
              type: object
              properties:
                versionId:
                  type: string
                  description: Version ID.
                lastUpdated:
                  type: string
                  description: Date when the resource was last changed.
                author:
                  type: object
                  properties:
                    reference:
                      type: string
                      description: Author reference.
                    display:
                      type: string
                      description: Author name.
                  description: Who changed the resource last.
                project:
                  type: string
                  description: ID of project, which contains this resource.
                compartment:
                  type: array
                  items:
                    type: object
                    properties:
                      reference:
                        type: string
                        description: Resource reference.
                  description: List of compartments that contain this resource.
          required:
            - firstName
            - lastName
          description: User resource.
      example:
        scheduled: 2026-08-16T17:06:17.445Z
        user:
          resourceType: User
          id: 9f8a2389-a20c-a075-2aa9-e95093515517
          firstName: Max
          lastName: Mustermann
          email: max.mustermann@example.com
          project:
            reference: Project/f6f4da8d-93e8-8a08-220e-03b7810451d3
            display: My Medical Project
          meta:
            versionId: 87ea5dfc-8b8e-384d-8489-79496e706390
            lastUpdated: 2026-08-16T17:06:17.445Z
            author:
              reference: cd495e76-8385-ecb1-00a6-7e0381de4e42
              display: John Doe
            project: f6f4da8d-93e8-8a08-220e-03b7810451d3
            compartment:
              - reference: Project/f6f4da8d-93e8-8a08-220e-03b7810451d3
              - reference: Patient/de5c57ff-7257-57b0-13ab-aab6f5f91498
    LoginDto:
      type: object
      properties:
        email:
          type: string
          format: email
          description: The user's email address.
        password:
          type: string
          minLength: 1
          maxLength: 128
          description: The user's password.
        clientId:
          type: string
          format: uuid
          description: The client ID from the ClientApplication resource.
      required:
        - email
        - password
        - clientId
      example:
        email: max.mustermann@example.com
        password: p}mz%#iqsHnP]=I9
        clientId: c3499c27-2973-0a7f-807e-fb8676a92dcb
    ChangePasswordDto:
      type: object
      properties:
        oldPassword:
          type: string
          example: OldPassword
          description: Old password.
        newPassword:
          type: string
          example: Password1234
          description: New password.
        confirmPassword:
          type: string
          example: Password1234
          description: New password confirmation.
      required:
        - oldPassword
        - newPassword
        - confirmPassword
    ResetPasswordDto:
      type: object
      properties:
        email:
          type: string
          format: email
          description: Email address.
        clientId:
          type: string
          description: Client ID. Only required for patients.
        type:
          type: string
          enum:
            - Patient
            - Practitioner
          description: The type of the user.
      required:
        - email
        - type
      examples:
        - email: max.mustermann@example.com
          clientId: a703da46-ec97-a84a-4573-c50634706367
          type: Patient
        - email: max.mustermann@example.com
          type: Practitioner
    SetPasswordDto:
      type: object
      properties:
        id:
          type: string
          example: 12345-12345-12345
          description: ID generated in UserSecurityRequest.
        secret:
          type: string
          example: abcde12345
          description: Secret generated in UserSecurityRequest.
        password:
          type: string
          example: MyVerySecretPassword
          description: New password to be assigned to the user.
      required:
        - id
        - secret
        - password
    UpdateEmailDto:
      type: object
      properties:
        newEmailAddress:
          type: string
          example: email@example.com
          description: New email address.
        confirmNewEmailAddress:
          type: string
          example: email@example.com
          description: Confirm new email address.
      required:
        - newEmailAddress
        - confirmNewEmailAddress
    DeregisterDto:
      type: object
      properties:
        deleteAllUserData:
          type: boolean
          example: false
          description: >-
            Delete all user data. Empty value is treated as "false" by default.
                - true: delete ProjectMembership, profile (Patient/Practitioner), User.
                - false: delete ProjectMembership.
    SignupDto:
      type: object
      properties:
        email:
          type: string
          example: email@example.com
          description: Email address.
        firstName:
          type: string
          example: John
          description: First name.
        lastName:
          type: string
          example: Doe
          description: Last name.
        projectId:
          type: string
          example: 12345-12345-12345
          description: Project ID.
        resourceType:
          type: string
          enum:
            - Patient
            - Practitioner
          description: The type of user to be signed up.
        sendDefaultEmail:
          type: boolean
          example: true
          description: Should the default invitation email be sent to the user. If there
            is a custom E-Mail bot, this should be set to false.
        password:
          type: string
          example: Password1234
          description: The user password. If this is not set, the user will be sent a link
            to set their password. Then it is necessary to either set  the
            parameter `sendDefaultEmail` to `true` or send a custom email to the
            user with a bot.
        clientId:
          type: string
          example: 12345-12345-12345
          description: Provide client ID if the user should be logged in directly after
            signup.
        organizationId:
          type: string
          example: 12345-12345-12345
          description: Organization ID, to assign the Patient to an organization or to
            create a PractitionerRole for the Practitioner.
      required:
        - email
        - firstName
        - lastName
        - projectId
        - resourceType
        - sendDefaultEmail
    SocialBodyResponseDto:
      type: object
      properties:
        accessToken:
          type: string
          description: The access token
        refreshToken:
          type: string
          description: The refresh token
        expiresIn:
          type: number
          description: The expires in
        profile:
          type: object
          properties:
            reference:
              type: string
              description: The profile reference
            display:
              type: string
              description: The profile display
          required:
            - reference
            - display
        project:
          type: object
          properties:
            reference:
              type: string
              description: The project reference
            display:
              type: string
              description: The project display
          required:
            - reference
            - display
      required:
        - accessToken
        - refreshToken
        - expiresIn
        - profile
        - project
      example:
        accessToken: example.jwt.eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3ODY4OTk5NzcsImV4cCI6MTc4NjkwMzU3N30.sZTke9fx_gPeoj2v-FL9GhDqY0hh9EzdEc4XywFqb84
        refreshToken: example.jwt.eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3ODY4OTk5NzcsImV4cCI6MTc4NjkwMzU3N30.sZTke9fx_gPeoj2v-FL9GhDqY0hh9EzdEc4XywFqb84
        expiresIn: 3600
        profile:
          reference: Patient/de5c57ff-7257-57b0-13ab-aab6f5f91498
          display: Dr. Max John Mustermann
        project:
          reference: Project/f6f4da8d-93e8-8a08-220e-03b7810451d3
          display: Dr. Max John Mustermann
    ResponseMeDto:
      type: object
      properties:
        project:
          type: object
          properties:
            resourceType:
              type: string
              enum:
                - Project
            id:
              type: string
            name:
              type: string
            strictMode:
              type: boolean
          required:
            - resourceType
            - id
            - name
            - strictMode
        membership:
          type: object
          properties:
            resourceType:
              type: string
              enum:
                - ProjectMembership
            id:
              type: string
            user:
              type: object
              properties:
                reference:
                  type: string
                display:
                  type: string
              required:
                - reference
                - display
          required:
            - resourceType
            - id
            - user
        profile:
          type: object
          properties:
            resourceType:
              type: string
              enum:
                - Patient
            id:
              type: string
            name:
              type: array
              items:
                type: object
                properties:
                  given:
                    type: array
                    items:
                      type: string
                  family:
                    type: string
                required:
                  - given
                  - family
            telecom:
              type: array
              items:
                type: object
                properties:
                  system:
                    type: string
                  use:
                    type: string
                  value:
                    type: string
                required:
                  - system
                  - use
                  - value
          required:
            - resourceType
            - id
            - name
            - telecom
        config:
          type: object
          properties:
            resourceType:
              type: string
              enum:
                - UserConfiguration
            menu:
              type: array
              items:
                type: object
                properties:
                  title:
                    type: string
                  link:
                    type: array
                    items:
                      type: object
                      properties:
                        name:
                          type: string
                        target:
                          type: string
                      required:
                        - name
                        - target
                required:
                  - title
                  - link
          required:
            - resourceType
            - menu
        accessPolicy:
          type: object
          properties:
            resourceType:
              type: string
              enum:
                - AccessPolicy
            resource:
              type: array
              items:
                type: object
                properties:
                  resourceType:
                    type: string
                required:
                  - resourceType
            ipAccessRule:
              type: array
              items:
                type: object
                properties:
                  ip:
                    type: string
                required:
                  - ip
          required:
            - resourceType
            - resource
            - ipAccessRule
        security:
          type: object
          properties:
            mfaEnrolled:
              type: boolean
            sessions:
              type: array
              items:
                type: object
                properties:
                  id:
                    type: string
                  lastUpdated:
                    type: string
                  authMethod:
                    type: string
                  remoteAddress:
                    type: string
                required:
                  - id
                  - lastUpdated
                  - authMethod
                  - remoteAddress
          required:
            - mfaEnrolled
            - sessions
      required:
        - project
        - membership
        - profile
        - config
        - accessPolicy
        - security
      example:
        project:
          resourceType: Project
          id: f6f4da8d-93e8-8a08-220e-03b7810451d3
          name: Example Project
          strictMode: true
        membership:
          resourceType: ProjectMembership
          id: d7f418aa-467d-d1ea-f0fc-d2dd841733e6
          user:
            reference: 9f8a2389-a20c-a075-2aa9-e95093515517
            display: max.mustermann@example.com
        profile:
          resourceType: Patient
          id: de5c57ff-7257-57b0-13ab-aab6f5f91498
          name:
            - given:
                - Example Patient
              family: "1"
          telecom:
            - system: email
              use: work
              value: max.mustermann@example.com
        config:
          resourceType: UserConfiguration
          menu:
            - title: Favorites
              link: []
        accessPolicy:
          resourceType: AccessPolicy
          resource:
            - resourceType: "*"
          ipAccessRule: []
        security:
          mfaEnrolled: false
          sessions: []
    RegisterDto:
      type: object
      properties:
        email:
          type: string
          format: email
          description: The email of the user registering, must be a valid email in order
            to send a verification email
        password:
          type: string
          minLength: 1
          maxLength: 128
        clientId:
          type: string
          format: uuid
          description: The client id of the user registering, must be a client id of an
            existing client resource in the Project
        name:
          type: string
          minLength: 1
          maxLength: 128
          description: The name of the user registering.
        surname:
          type: string
          minLength: 1
          maxLength: 128
          description: The surname of the user registering.
      required:
        - email
        - password
        - clientId
        - name
        - surname
      example:
        email: max.mustermann@example.com
        password: p}mz%#iqsHnP]=I9
        clientId: c3499c27-2973-0a7f-807e-fb8676a92dcb
        name: Max
        surname: Mustermann
    OperationOutcomeV2Dto:
      type: object
      properties:
        resourceType:
          default: OperationOutcome
          type: string
        issue:
          type: array
          items:
            type: object
            properties:
              severity:
                type: string
                enum:
                  - fatal
                  - error
                  - warning
                  - information
                description: Outcome severity.
              code:
                type: string
                enum:
                  - invalid
                  - structure
                  - required
                  - value
                  - invariant
                  - security
                  - login
                  - unknown
                  - expired
                  - forbidden
                  - suppressed
                  - processing
                  - not-supported
                  - duplicate
                  - multiple-matches
                  - not-found
                  - deleted
                  - too-long
                  - code-invalid
                  - extension
                  - too-costly
                  - business-rule
                  - conflict
                  - transient
                  - lock-error
                  - no-store
                  - exception
                  - timeout
                  - incomplete
                  - throttled
                  - informational
                description: Code.
              details:
                type: object
                properties:
                  text:
                    type: string
                    description: Outcome description.
                required:
                  - text
                description: Outcome details.
            required:
              - severity
              - code
              - details
      required:
        - issue
      example:
        resourceType: OperationOutcome
        issue:
          - severity: information
            code: informational
            details:
              text: OK
    ProcessResetPasswordEmailDto:
      type: object
      properties:
        id:
          type: string
          description: The ID UserSecurityRequest.
        secret:
          type: string
          description: The secret of the UserSecurityRequest.
        password:
          type: string
          description: The new password.
      required:
        - id
        - secret
        - password
      example:
        id: 87ea5dfc-8b8e-384d-8489-79496e706390
        secret: ugs2LsGM2e
        password: p}mz%#iqsHnP]=I9
    SessionsResponseDto:
      type: object
      properties:
        sessions:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
                format: uuid
              lastUpdated:
                type: string
                format: date-time
              authMethod:
                type: string
              remoteAddress:
                type: string
              browser:
                type: string
              os:
                type: string
            required:
              - id
              - lastUpdated
              - authMethod
              - remoteAddress
              - browser
              - os
            example:
              id: 4e5a2893-bdcc-7d23-9c1d-b72e4c4ffbe4
              lastUpdated: 2026-08-16T17:06:17.445Z
              authMethod: password
              remoteAddress: 192.168.1.1
              browser: Chrome
              os: Mac OS
      required:
        - sessions
      example:
        sessions:
          - id: 4e5a2893-bdcc-7d23-9c1d-b72e4c4ffbe4
            lastUpdated: 2026-08-16T17:06:17.445Z
            authMethod: password
            remoteAddress: 192.168.1.1
            browser: Chrome
            os: Mac OS
    ResponseBodyTanLoginDto:
      type: object
      properties:
        accessToken:
          type: string
          description: Bearer access token. Expires in 1 hour.
        expiresIn:
          default: 3600
          type: integer
          description: Token expiration.
        project:
          type: object
          properties:
            reference:
              type: string
              description: Reference of the project.
            display:
              type: string
              description: Display name of the project.
          required:
            - reference
            - display
        profile:
          type: object
          properties:
            reference:
              type: string
              description: Reference of the profile.
            display:
              type: string
              description: Display name of the profile.
          required:
            - reference
            - display
      required:
        - accessToken
        - project
        - profile
      example:
        accessToken: example.jwt.eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3ODY4OTk5NzcsImV4cCI6MTc4NjkwMzU3N30.sZTke9fx_gPeoj2v-FL9GhDqY0hh9EzdEc4XywFqb84
        expiresIn: 3600
        project:
          reference: Project/f6f4da8d-93e8-8a08-220e-03b7810451d3
          display: My Medical Project
        profile:
          reference: Patient/de5c57ff-7257-57b0-13ab-aab6f5f91498
          display: Max Mustermann
    RequestParamTanLoginDto:
      type: object
      properties:
        tan:
          type: string
          minLength: 1
          maxLength: 256
          pattern: ^[a-zA-Z0-9_-]+$
          description: TAN code for login.
      required:
        - tan
      example:
        tan: yBzyWsNbjGD8
    StartPractitionerLoginBodyDto:
      type: object
      properties:
        email:
          type: string
          format: email
        password:
          type: string
        codeChallenge:
          type: string
          description: A randomly generated text that is sent from client application, the
            client application should generate it using the codeVerifier from
            the challange
      required:
        - email
        - password
        - codeChallenge
      example:
        email: max.mustermann@example.com
        password: p}mz%#iqsHnP]=I9
        codeChallenge: 14hNhiZoOLnjz4ODnf5VPHPdkWEj8Ond
    StartPractitionerLoginResponseDto:
      oneOf:
        - type: object
          properties:
            nextStep:
              type: string
              enum:
                - token
            sessionCode:
              type: string
            tenants:
              type: array
              items:
                type: object
                properties:
                  project: {}
                  profile: {}
                  tenantCode:
                    type: string
                required:
                  - tenantCode
          required:
            - nextStep
            - sessionCode
            - tenants
        - type: object
          properties:
            nextStep:
              type: string
              enum:
                - mfa
            loginId:
              type: string
          required:
            - nextStep
            - loginId
      example:
        nextStep: token
        sessionCode: FQEHyUr3lFKF4EJjpw7PoUtr8lorhCRx
        tenantCode: big-health-company
    FinishPractitionerLoginBodyDto:
      type: object
      properties:
        sessionCode:
          type: string
        codeVerifier:
          type: string
        tenantCode:
          type: string
      required:
        - sessionCode
        - codeVerifier
        - tenantCode
      example:
        sessionCode: aLnjkmtH1cdLvreSt6bDbWZkenOMggfZ
        codeVerifier: jg0EqduDJFjjQtrJRzhw3VxL1hHzJonOZbvvR5Jl38gibwSajg4kT3XiOmFo3RtR
        tenantCode: big-health-company
    StartPractitionerMFABodyDto:
      type: object
      properties:
        mfaToken:
          type: string
          minLength: 6
        loginId:
          type: string
          format: uuid
      required:
        - mfaToken
        - loginId
    StartPractitionerMFAResponseDto:
      type: object
      properties:
        nextStep:
          type: string
          enum:
            - token
        sessionCode:
          type: string
        tenants:
          type: array
          items:
            type: object
            properties:
              project: {}
              profile: {}
              tenantCode:
                type: string
            required:
              - tenantCode
      required:
        - nextStep
        - sessionCode
        - tenants
      example:
        nextStep: token
        sessionCode: vEZnBVP9xRspu8UxHnuqYXEXUkJaZ0V2
    StartPatientLoginBodyDto:
      type: object
      properties:
        email:
          type: string
          format: email
        password:
          type: string
        tenantCode:
          type: string
          description: Tenant code, e.g. "big-health-company"
        codeChallenge:
          type: string
          description: A randomly generated text that is sent from client application, the
            client application should generate it using the codeVerifier from
            the challange
      required:
        - email
        - password
        - tenantCode
        - codeChallenge
      example:
        email: max.mustermann@example.com
        password: p}mz%#iqsHnP]=I9
        codeChallenge: pqR5G92IbVOCWtPACBLcx86EmOYmn708
        tenantCode: big-health-company
    StartPatientLoginResponseDto:
      oneOf:
        - type: object
          properties:
            nextStep:
              type: string
              enum:
                - token
            sessionCode:
              type: string
          required:
            - nextStep
            - sessionCode
        - type: object
          properties:
            nextStep:
              type: string
              enum:
                - mfa
            loginId:
              type: string
          required:
            - nextStep
            - loginId
      example:
        nextStep: token
        sessionCode: 8lXWd0pWP7o9GAb1jo9V5XbG1eQ3BfvE
    FinishPatientLoginBodyDto:
      type: object
      properties:
        sessionCode:
          type: string
        codeVerifier:
          type: string
      required:
        - sessionCode
        - codeVerifier
      example:
        sessionCode: fl6618a8K5eu1O3PWOwUhs6lhMAG5RWg
        codeVerifier: 3DKDOYhlHokUwu9REWBSNSShG2VJukVze8hFruwx0tUZvWEEdmVpbayPkqdYu5AH
    StartPatientMFABodyDto:
      type: object
      properties:
        mfaToken:
          type: string
          minLength: 6
        loginId:
          type: string
          format: uuid
      required:
        - mfaToken
        - loginId
    StartPatientMFAResponseDto:
      type: object
      properties:
        nextStep:
          type: string
          enum:
            - token
        sessionCode:
          type: string
      required:
        - nextStep
        - sessionCode
      example:
        nextStep: token
        sessionCode: JhoN5997iV9NgD2P6GWuSG2LPlxayRg3
    RegisterPatientBodyDto:
      type: object
      properties:
        email:
          type: string
          format: email
        password:
          type: string
        name:
          type: string
        surname:
          type: string
        tenantCode:
          type: string
      required:
        - email
        - password
        - name
        - surname
        - tenantCode
      example:
        email: max.mustermann@example.com
        password: p}mz%#iqsHnP]=I9
        name: Max
        surname: Mustermann
        tenantCode: big-health-company
    EmailTemplateTemplatesDto:
      type: object
      additionalProperties:
        type: object
        additionalProperties: {}
    LocaleBodyDto:
      type: object
      properties:
        languages:
          type: array
          items:
            type: string
            enum:
              - Cy-az-AZ
              - Cy-sr-SP
              - Cy-uz-UZ
              - Lt-az-AZ
              - Lt-sr-SP
              - Lt-uz-UZ
              - aa
              - ab
              - ae
              - af
              - af-ZA
              - ak
              - am
              - an
              - ar
              - ar-AE
              - ar-BH
              - ar-DZ
              - ar-EG
              - ar-IQ
              - ar-JO
              - ar-KW
              - ar-LB
              - ar-LY
              - ar-MA
              - ar-OM
              - ar-QA
              - ar-SA
              - ar-SY
              - ar-TN
              - ar-YE
              - as
              - av
              - ay
              - az
              - ba
              - be
              - be-BY
              - bg
              - bg-BG
              - bh
              - bi
              - bm
              - bn
              - bo
              - br
              - bs
              - ca
              - ca-ES
              - ce
              - ch
              - co
              - cr
              - cs
              - cs-CZ
              - cu
              - cv
              - cy
              - da
              - da-DK
              - de
              - de-AT
              - de-CH
              - de-DE
              - de-LI
              - de-LU
              - div-MV
              - dv
              - dz
              - ee
              - el
              - el-GR
              - en
              - en-AU
              - en-BZ
              - en-CA
              - en-CB
              - en-GB
              - en-IE
              - en-JM
              - en-NZ
              - en-PH
              - en-TT
              - en-US
              - en-ZA
              - en-ZW
              - eo
              - es
              - es-AR
              - es-BO
              - es-CL
              - es-CO
              - es-CR
              - es-DO
              - es-EC
              - es-ES
              - es-GT
              - es-HN
              - es-MX
              - es-NI
              - es-PA
              - es-PE
              - es-PR
              - es-PY
              - es-SV
              - es-UY
              - es-VE
              - et
              - et-EE
              - eu
              - eu-ES
              - fa
              - fa-IR
              - ff
              - fi
              - fi-FI
              - fj
              - fo
              - fo-FO
              - fr
              - fr-BE
              - fr-CA
              - fr-CH
              - fr-FR
              - fr-LU
              - fr-MC
              - fy
              - ga
              - gd
              - gl
              - gl-ES
              - gn
              - gu
              - gu-IN
              - gv
              - ha
              - he
              - he-IL
              - hi
              - hi-IN
              - ho
              - hr
              - hr-HR
              - ht
              - hu
              - hu-HU
              - hy
              - hy-AM
              - hz
              - ia
              - id
              - id-ID
              - ie
              - ig
              - ii
              - ik
              - io
              - is
              - is-IS
              - it
              - it-CH
              - it-IT
              - iu
              - ja
              - ja-JP
              - jv
              - ka
              - ka-GE
              - kg
              - ki
              - kj
              - kk
              - kk-KZ
              - kl
              - km
              - kn
              - kn-IN
              - ko
              - ko-KR
              - kr
              - ks
              - ku
              - kv
              - kw
              - ky
              - ky-KZ
              - la
              - lb
              - lg
              - li
              - ln
              - lo
              - lt
              - lt-LT
              - lu
              - lv
              - lv-LV
              - mg
              - mh
              - mi
              - mk
              - mk-MK
              - ml
              - mn
              - mn-MN
              - mr
              - mr-IN
              - ms
              - ms-BN
              - ms-MY
              - mt
              - my
              - na
              - nb
              - nb-NO
              - nd
              - ne
              - ng
              - nl
              - nl-BE
              - nl-NL
              - nn
              - nn-NO
              - no
              - nr
              - nv
              - ny
              - oc
              - oj
              - om
              - or
              - os
              - pa
              - pa-IN
              - pi
              - pl
              - pl-PL
              - ps
              - pt
              - pt-BR
              - pt-PT
              - qu
              - rm
              - rn
              - ro
              - ro-RO
              - ru
              - ru-RU
              - rw
              - sa
              - sa-IN
              - sc
              - sd
              - se
              - sg
              - si
              - sk
              - sk-SK
              - sl
              - sl-SI
              - sm
              - sn
              - so
              - sq
              - sq-AL
              - sr
              - ss
              - st
              - su
              - sv
              - sv-FI
              - sv-SE
              - sw
              - sw-KE
              - ta
              - ta-IN
              - te
              - te-IN
              - tg
              - th
              - th-TH
              - ti
              - tk
              - tl
              - tn
              - to
              - tr
              - tr-TR
              - ts
              - tt
              - tt-RU
              - tw
              - ty
              - ug
              - uk
              - uk-UA
              - ur
              - ur-PK
              - uz
              - ve
              - vi
              - vi-VN
              - vo
              - wa
              - wo
              - xh
              - yi
              - yo
              - za
              - zh
              - zh-CHS
              - zh-CHT
              - zh-CN
              - zh-HK
              - zh-MO
              - zh-SG
              - zh-TW
              - zu
          minItems: 1
        defaultLanguage:
          type: string
          enum:
            - Cy-az-AZ
            - Cy-sr-SP
            - Cy-uz-UZ
            - Lt-az-AZ
            - Lt-sr-SP
            - Lt-uz-UZ
            - aa
            - ab
            - ae
            - af
            - af-ZA
            - ak
            - am
            - an
            - ar
            - ar-AE
            - ar-BH
            - ar-DZ
            - ar-EG
            - ar-IQ
            - ar-JO
            - ar-KW
            - ar-LB
            - ar-LY
            - ar-MA
            - ar-OM
            - ar-QA
            - ar-SA
            - ar-SY
            - ar-TN
            - ar-YE
            - as
            - av
            - ay
            - az
            - ba
            - be
            - be-BY
            - bg
            - bg-BG
            - bh
            - bi
            - bm
            - bn
            - bo
            - br
            - bs
            - ca
            - ca-ES
            - ce
            - ch
            - co
            - cr
            - cs
            - cs-CZ
            - cu
            - cv
            - cy
            - da
            - da-DK
            - de
            - de-AT
            - de-CH
            - de-DE
            - de-LI
            - de-LU
            - div-MV
            - dv
            - dz
            - ee
            - el
            - el-GR
            - en
            - en-AU
            - en-BZ
            - en-CA
            - en-CB
            - en-GB
            - en-IE
            - en-JM
            - en-NZ
            - en-PH
            - en-TT
            - en-US
            - en-ZA
            - en-ZW
            - eo
            - es
            - es-AR
            - es-BO
            - es-CL
            - es-CO
            - es-CR
            - es-DO
            - es-EC
            - es-ES
            - es-GT
            - es-HN
            - es-MX
            - es-NI
            - es-PA
            - es-PE
            - es-PR
            - es-PY
            - es-SV
            - es-UY
            - es-VE
            - et
            - et-EE
            - eu
            - eu-ES
            - fa
            - fa-IR
            - ff
            - fi
            - fi-FI
            - fj
            - fo
            - fo-FO
            - fr
            - fr-BE
            - fr-CA
            - fr-CH
            - fr-FR
            - fr-LU
            - fr-MC
            - fy
            - ga
            - gd
            - gl
            - gl-ES
            - gn
            - gu
            - gu-IN
            - gv
            - ha
            - he
            - he-IL
            - hi
            - hi-IN
            - ho
            - hr
            - hr-HR
            - ht
            - hu
            - hu-HU
            - hy
            - hy-AM
            - hz
            - ia
            - id
            - id-ID
            - ie
            - ig
            - ii
            - ik
            - io
            - is
            - is-IS
            - it
            - it-CH
            - it-IT
            - iu
            - ja
            - ja-JP
            - jv
            - ka
            - ka-GE
            - kg
            - ki
            - kj
            - kk
            - kk-KZ
            - kl
            - km
            - kn
            - kn-IN
            - ko
            - ko-KR
            - kr
            - ks
            - ku
            - kv
            - kw
            - ky
            - ky-KZ
            - la
            - lb
            - lg
            - li
            - ln
            - lo
            - lt
            - lt-LT
            - lu
            - lv
            - lv-LV
            - mg
            - mh
            - mi
            - mk
            - mk-MK
            - ml
            - mn
            - mn-MN
            - mr
            - mr-IN
            - ms
            - ms-BN
            - ms-MY
            - mt
            - my
            - na
            - nb
            - nb-NO
            - nd
            - ne
            - ng
            - nl
            - nl-BE
            - nl-NL
            - nn
            - nn-NO
            - no
            - nr
            - nv
            - ny
            - oc
            - oj
            - om
            - or
            - os
            - pa
            - pa-IN
            - pi
            - pl
            - pl-PL
            - ps
            - pt
            - pt-BR
            - pt-PT
            - qu
            - rm
            - rn
            - ro
            - ro-RO
            - ru
            - ru-RU
            - rw
            - sa
            - sa-IN
            - sc
            - sd
            - se
            - sg
            - si
            - sk
            - sk-SK
            - sl
            - sl-SI
            - sm
            - sn
            - so
            - sq
            - sq-AL
            - sr
            - ss
            - st
            - su
            - sv
            - sv-FI
            - sv-SE
            - sw
            - sw-KE
            - ta
            - ta-IN
            - te
            - te-IN
            - tg
            - th
            - th-TH
            - ti
            - tk
            - tl
            - tn
            - to
            - tr
            - tr-TR
            - ts
            - tt
            - tt-RU
            - tw
            - ty
            - ug
            - uk
            - uk-UA
            - ur
            - ur-PK
            - uz
            - ve
            - vi
            - vi-VN
            - vo
            - wa
            - wo
            - xh
            - yi
            - yo
            - za
            - zh
            - zh-CHS
            - zh-CHT
            - zh-CN
            - zh-HK
            - zh-MO
            - zh-SG
            - zh-TW
            - zu
      required:
        - languages
        - defaultLanguage
      example:
        languages:
          - en-US
          - fr-FR
          - de-DE
        defaultLanguage: en-US
    CarehubPolicyListResponseDto:
      type: object
      properties:
        total:
          type: number
        resources:
          type: array
          items:
            type: object
            properties:
              policy:
                type: object
                properties:
                  resourceType:
                    type: string
                    enum:
                      - AccessPolicy
                  id:
                    type: string
                  name:
                    type: string
                  resource:
                    type: array
                    items:
                      type: object
                      properties:
                        resourceType:
                          type: string
                        interaction:
                          type: array
                          items:
                            type: string
                        criteria:
                          type: string
                        readonly:
                          type: boolean
                      required:
                        - resourceType
                      additionalProperties: true
                  meta:
                    type: object
                    properties:
                      project:
                        type: string
                      author:
                        type: object
                        properties:
                          reference:
                            type: string
                        required:
                          - reference
                      lastUpdated:
                        type: string
                required:
                  - resourceType
                  - id
                  - name
              members:
                type: array
                items:
                  type: object
                  properties:
                    reference:
                      type: string
                    display:
                      type: string
                  required:
                    - reference
            required:
              - policy
              - members
            example: &a66
              policy:
                resourceType: AccessPolicy
                id: cca28116-f888-97bf-c336-5b992bd02672
                name: Practitioner Access Policy
                resource:
                  - resourceType: Patient
                    interaction:
                      - read
                      - search
                      - update
                  - resourceType: Device
                    interaction:
                      - read
                      - search
                    readonly: true
                meta:
                  project: f6f4da8d-93e8-8a08-220e-03b7810451d3
                  author:
                    reference: Practitioner/cd495e76-8385-ecb1-00a6-7e0381de4e42
                  lastUpdated: 2026-08-16T17:06:17.445Z
              members:
                - reference: Practitioner/cd495e76-8385-ecb1-00a6-7e0381de4e42
                  display: Dr. Max John Mustermann
                - reference: Practitioner/19263dc5-b9c6-0f14-af25-193a8e813a1d
                  display: Dr. Max Mustermann
      required:
        - total
        - resources
      example:
        total: 2
        resources:
          - policy:
              resourceType: AccessPolicy
              id: cca28116-f888-97bf-c336-5b992bd02672
              name: Practitioner Access Policy
              resource:
                - resourceType: Patient
                  interaction:
                    - read
                    - search
                    - update
              meta:
                project: f6f4da8d-93e8-8a08-220e-03b7810451d3
                author:
                  reference: Practitioner/cd495e76-8385-ecb1-00a6-7e0381de4e42
                lastUpdated: 2026-08-16T17:06:17.445Z
            members:
              - reference: Practitioner/cd495e76-8385-ecb1-00a6-7e0381de4e42
                display: Dr. Max John Mustermann
          - policy:
              resourceType: AccessPolicy
              id: 4c8bf5ff-1416-e255-cfe8-4335fa7299d8
              name: Admin Access Policy
              resource:
                - resourceType: Patient
                - resourceType: Device
                  readonly: true
              meta:
                project: f6f4da8d-93e8-8a08-220e-03b7810451d3
                author:
                  reference: Practitioner/cd495e76-8385-ecb1-00a6-7e0381de4e42
                lastUpdated: 2026-08-16T17:06:17.445Z
            members:
              - reference: Practitioner/cd495e76-8385-ecb1-00a6-7e0381de4e42
                display: Dr. Max John Mustermann
              - reference: Practitioner/19263dc5-b9c6-0f14-af25-193a8e813a1d
                display: Dr. Max Mustermann
    CarehubPolicyResponseDto:
      type: object
      properties:
        policy:
          type: object
          properties:
            resourceType:
              type: string
              enum:
                - AccessPolicy
            id:
              type: string
            name:
              type: string
            resource:
              type: array
              items:
                type: object
                properties:
                  resourceType:
                    type: string
                  interaction:
                    type: array
                    items:
                      type: string
                  criteria:
                    type: string
                  readonly:
                    type: boolean
                required:
                  - resourceType
                additionalProperties: true
            meta:
              type: object
              properties:
                project:
                  type: string
                author:
                  type: object
                  properties:
                    reference:
                      type: string
                  required:
                    - reference
                lastUpdated:
                  type: string
          required:
            - resourceType
            - id
            - name
        members:
          type: array
          items:
            type: object
            properties:
              reference:
                type: string
              display:
                type: string
            required:
              - reference
      required:
        - policy
        - members
      example: *a66
    CarehubCreatePolicyDto:
      type: object
      properties:
        policy:
          type: object
          properties:
            name:
              type: string
              minLength: 1
              maxLength: 255
            resourceType:
              type: string
              enum:
                - AccessPolicy
            resource:
              type: array
              items:
                type: object
                properties:
                  resourceType:
                    type: string
                    minLength: 1
                    maxLength: 255
                  interaction:
                    type: array
                    items:
                      type: string
                      enum:
                        - read
                        - create
                        - update
                        - delete
                        - search
                        - history
                        - vread
                required:
                  - resourceType
                  - interaction
          required:
            - name
            - resourceType
            - resource
        members:
          type: array
          items:
            type: object
            properties:
              reference:
                type: string
              display:
                type: string
            required:
              - reference
              - display
      required:
        - policy
        - members
      description: Create a policy
      example:
        policy:
          resourceType: AccessPolicy
          name: Policy 1
          resource:
            - resourceType: Patient
              interaction:
                - read
                - create
                - update
                - delete
                - search
                - history
                - vread
        members:
          - reference: Patient/1
            display: John Doe
    CarehubUpdatePolicyDto:
      type: object
      properties:
        policy:
          type: object
          properties:
            name:
              type: string
              minLength: 1
              maxLength: 255
            resourceType:
              type: string
              enum:
                - AccessPolicy
            id:
              type: string
              format: uuid
            resource:
              type: array
              items:
                type: object
                properties:
                  resourceType:
                    type: string
                    minLength: 1
                    maxLength: 255
                  interaction:
                    type: array
                    items:
                      type: string
                      enum:
                        - read
                        - create
                        - update
                        - delete
                        - search
                        - history
                        - vread
                required:
                  - resourceType
                  - interaction
          required:
            - name
            - resourceType
            - id
            - resource
        members:
          type: array
          items:
            type: object
            properties:
              reference:
                type: string
              display:
                type: string
            required:
              - reference
      required:
        - policy
        - members
      description: Create a policy
      example:
        policy:
          resourceType: AccessPolicy
          name: Policy 1
          resource:
            - resourceType: Patient
              interaction:
                - read
                - create
                - update
                - delete
                - search
                - history
                - vread
        members:
          - reference: Patient/1
            display: John Doe
    SubProjectRequestBodyDto:
      type: object
      properties:
        name:
          type: string
          minLength: 1
        extension: {}
        parentProjectId:
          type: string
          format: uuid
      required:
        - name
      example:
        name: Actimi
    SubProjectsResponseDto:
      type: object
      properties:
        currentProjectId:
          type: string
        parentProjectId:
          type: string
          nullable: true
        subProjectIds:
          type: array
          items:
            type: string
      required:
        - currentProjectId
        - parentProjectId
        - subProjectIds
      example:
        parentProjectId: f6f4da8d-93e8-8a08-220e-03b7810451d3
        subProjectIds:
          - 8618c885-485f-614e-f65e-c365e1be0086
          - 06c4d19a-2f20-242f-4194-966ec82b63e2
          - 25654af8-b5de-5060-1e09-ef4fd62e592f
          - 43583c84-f8d2-a31a-3f64-0c545e22d847
    EmailRequestBodyDto:
      type: object
      properties:
        email:
          type: string
          format: email
      required:
        - email
      example:
        email: max.mustermann@example.com
    TenantCodeDto:
      type: object
      properties:
        id:
          type: string
        code:
          type: string
        projectId:
          type: string
      required:
        - code
        - projectId
      description: Tenant code
      example:
        id: aa2c96da-cf00-c451-ef46-5f6115a45a20
        code: FHXQ-123
        project: Project/f6f4da8d-93e8-8a08-220e-03b7810451d3
    AuthRequestDto:
      type: object
      properties:
        apiKey:
          type: string
          description: The API key of the partner.
      required:
        - apiKey
      example:
        apiKey: "1234567890"
    CreateChatSessionDto:
      type: object
      properties:
        assistant:
          type: object
          properties:
            system:
              type: string
              description: The system message that the AI Assistant will be prompted with.
            context:
              type: array
              items:
                type: string
              description: The context of the AI Assistant.
            history:
              default: 10
              type: number
              minimum: 1
              maximum: 30
              description: Number of messages to consider for context for the AI Assistant.
            participant:
              description: The participant that will be the AI Assistant in the chat session.
                ie. Practitioner/cd495e76-8385-ecb1-00a6-7e0381de4e42
              type: string
          required:
            - system
            - participant
        participant:
          type: string
          description: The participants in the chat, ie.
            Patient/de5c57ff-7257-57b0-13ab-aab6f5f91498
        title:
          type: string
          description: The title of the chat session.
        messages:
          type: array
          items:
            type: object
            properties:
              sender:
                type: string
                description: The sender of the message, ie.
                  Practitioner/cd495e76-8385-ecb1-00a6-7e0381de4e42
              mode:
                type: string
                enum:
                  - user
                  - assistant
                  - system
                description: The mode of the message, use "system" for hidden prompts to AI. Use
                  "user" for messages that come from user messages. Use
                  "assistant" for messages that come from the AI Assistant. By
                  default you don't need to set this.
              content:
                type: string
                maxLength: 512
                description: The message content.
            required:
              - sender
              - content
      required:
        - assistant
        - participant
        - messages
      example: &a67
        assistant:
          system: You are an AI Assistant, you will be helping the patient with their
            queries.
          history: 10
          participant: Practitioner/cd495e76-8385-ecb1-00a6-7e0381de4e42
        title: My Chat Session
        context:
          - Observation?_count=20&_sort=-date
          - Condition?_count=20&_sort=-onset-date
        participant: Patient/de5c57ff-7257-57b0-13ab-aab6f5f91498
        messages:
          - sender: Practitioner/cd495e76-8385-ecb1-00a6-7e0381de4e42
            mode: user
            content: Hello
    SendChatMessageDto:
      type: object
      properties:
        content:
          type: string
          maxLength: 512
          description: The message content.
        sender:
          type: string
          description: The sender of the message, ie.
            Patient/de5c57ff-7257-57b0-13ab-aab6f5f91498.
        mode:
          type: string
          enum:
            - user
            - assistant
            - system
          description: >-
            The mode of the message, ie. user. You don't have to specify this,
            it will default to user

            If you want to send a message as a system to hide the sender, you
            can specify it here too!
        replyTo:
          type: string
          description: The reply is optional, ie.
            Communication/ade0d50c-9254-cf0c-9459-bbfe2398553c.
      required:
        - content
        - sender
      example:
        reference: Communication/ade0d50c-9254-cf0c-9459-bbfe2398553c
        content: This is a message
        sender: Patient/de5c57ff-7257-57b0-13ab-aab6f5f91498
        mode: user
        replyTo: Communication/ade0d50c-9254-cf0c-9459-bbfe2398553c
    GetChatSessionsResponseDto:
      type: object
      properties:
        sessions:
          type: array
          items:
            type: object
            properties:
              assistant:
                type: object
                properties:
                  system:
                    type: string
                    description: The system message that the AI Assistant will be prompted with.
                  context:
                    type: array
                    items:
                      type: string
                    description: The context of the AI Assistant.
                  history:
                    default: 10
                    type: number
                    minimum: 1
                    maximum: 30
                    description: Number of messages to consider for context for the AI Assistant.
                  participant:
                    description: The participant that will be the AI Assistant in the chat session.
                      ie. Practitioner/cd495e76-8385-ecb1-00a6-7e0381de4e42
                    type: string
                required:
                  - system
                  - participant
              participant:
                type: string
                description: The participants in the chat, ie.
                  Patient/de5c57ff-7257-57b0-13ab-aab6f5f91498
              title:
                type: string
                description: The title of the chat session.
              messages:
                type: array
                items:
                  type: object
                  properties:
                    sender:
                      type: string
                      description: The sender of the message, ie.
                        Practitioner/cd495e76-8385-ecb1-00a6-7e0381de4e42
                    mode:
                      type: string
                      enum:
                        - user
                        - assistant
                        - system
                      description: The mode of the message, use "system" for hidden prompts to AI. Use
                        "user" for messages that come from user messages. Use
                        "assistant" for messages that come from the AI
                        Assistant. By default you don't need to set this.
                    content:
                      type: string
                      maxLength: 512
                      description: The message content.
                  required:
                    - sender
                    - content
            required:
              - assistant
              - participant
              - messages
            example: *a67
      required:
        - sessions
      example:
        sessions:
          - assistant:
              system: You are an AI Assistant, you will be helping the patient with their
                queries.
              history: 10
              participant: Practitioner/cd495e76-8385-ecb1-00a6-7e0381de4e42
            title: My Chat Session
            context:
              - Observation?_count=20&_sort=-date
              - Condition?_count=20&_sort=-onset-date
            participant: Patient/de5c57ff-7257-57b0-13ab-aab6f5f91498
            messages:
              - sender: Practitioner/cd495e76-8385-ecb1-00a6-7e0381de4e42
                mode: user
                content: Hello
    CreatedChatMessagesDto:
      type: object
      properties:
        messages:
          type: array
          items:
            type: object
            properties:
              reference:
                type: string
              sender:
                type: string
              content:
                type: string
              sentAt:
                type: string
              mode:
                type: string
            required:
              - reference
              - sender
              - content
              - sentAt
              - mode
            example:
              reference: Communication/ade0d50c-9254-cf0c-9459-bbfe2398553c
              sender: Practitioner/cd495e76-8385-ecb1-00a6-7e0381de4e42
              content: Hello, how are you?
              sentAt: 2021-01-01T00:00:00.000Z
              mode: user
      required:
        - messages
      example:
        messages:
          - reference: Communication/ade0d50c-9254-cf0c-9459-bbfe2398553c
            sender: Practitioner/cd495e76-8385-ecb1-00a6-7e0381de4e42
            content: Hello, how are you?
            sentAt: 2021-01-01T00:00:00.000Z
            mode: user
    AIFhirSimpleStreamRequestBodyDto:
      type: object
      properties:
        text:
          type: string
          minLength: 1
          maxLength: 10000
        fhirVersion:
          type: string
          enum:
            - R4
            - R5
      required:
        - text
      example:
        text: Find me a patient with the name "John Doe"
        fhirVersion: R4
    AIFhirStreamRequestBodyDto:
      type: object
      properties:
        messages:
          type: array
          items:
            type: object
            properties:
              role:
                type: string
                enum:
                  - system
                  - user
                  - assistant
              content:
                type: string
                maxLength: 10000
            required:
              - role
              - content
          minItems: 1
          maxItems: 100
      required:
        - messages
      example:
        text: Find me a patient with the name "John Doe"
    CreateTranslationRequestDto:
      type: object
      properties:
        sourceLanguage:
          type: string
          minLength: 2
          maxLength: 100
        targetLanguage:
          type: string
          minLength: 2
          maxLength: 100
        text:
          type: array
          items:
            type: string
            minLength: 1
            maxLength: 10000
          minItems: 1
      required:
        - sourceLanguage
        - targetLanguage
        - text
      example:
        sourceLanguage: en
        targetLanguage: de
        text:
          - Hello {{name}}, how are you?
          - Doing well, thank you {{ anotherName }}. I am glad you picked up the
            phone.
          - <p>No worries sir, I will take <b>care</b> of it.</p>
    CarehubProjectUsersResponseDto:
      type: object
      properties:
        total:
          type: number
          minimum: 0
        page:
          type: number
          minimum: 0
        count:
          type: number
          minimum: 1
        resources:
          type: array
          items:
            type: object
            properties:
              user:
                type: object
                properties:
                  resourceType:
                    type: string
                    enum:
                      - User
                  id:
                    type: string
                  firstName:
                    type: string
                  lastName:
                    type: string
                  email:
                    type: string
                  project:
                    type: object
                    properties:
                      reference:
                        type: string
                      display:
                        type: string
                    additionalProperties: true
                  meta:
                    type: object
                    properties:
                      project:
                        type: string
                      lastUpdated:
                        type: string
                required:
                  - resourceType
                  - id
              profile:
                type: object
                properties:
                  resourceType:
                    type: string
                    enum:
                      - Practitioner
                  id:
                    type: string
                  name:
                    type: array
                    items:
                      type: object
                      properties:
                        use:
                          type: string
                        text:
                          type: string
                        family:
                          type: string
                        given:
                          type: array
                          items:
                            type: string
                        prefix:
                          type: array
                          items:
                            type: string
                        suffix:
                          type: array
                          items:
                            type: string
                      additionalProperties: true
                  meta:
                    type: object
                    properties:
                      project:
                        type: string
                      lastUpdated:
                        type: string
                required:
                  - resourceType
                  - id
              membership:
                type: object
                properties:
                  resourceType:
                    type: string
                    enum:
                      - ProjectMembership
                  id:
                    type: string
                  project:
                    type: object
                    properties:
                      reference:
                        type: string
                      display:
                        type: string
                    additionalProperties: true
                  user:
                    type: object
                    properties:
                      reference:
                        type: string
                      display:
                        type: string
                    additionalProperties: true
                  profile:
                    type: object
                    properties:
                      reference:
                        type: string
                      display:
                        type: string
                    additionalProperties: true
                  accessPolicy:
                    type: object
                    properties:
                      reference:
                        type: string
                      display:
                        type: string
                    additionalProperties: true
                  meta:
                    type: object
                    properties:
                      project:
                        type: string
                      lastUpdated:
                        type: string
                required:
                  - resourceType
                  - id
              status:
                type: string
                enum:
                  - Active
                  - Pending
              accessPolicy:
                type: object
                properties:
                  resourceType:
                    type: string
                    enum:
                      - AccessPolicy
                  id:
                    type: string
                  name:
                    type: string
                required:
                  - resourceType
                  - id
            required:
              - user
              - profile
              - membership
              - status
            example:
              user:
                resourceType: User
                id: 9f8a2389-a20c-a075-2aa9-e95093515517
                firstName: Max
                lastName: Mustermann
                email: max.mustermann@example.com
              profile:
                resourceType: Practitioner
                id: cd495e76-8385-ecb1-00a6-7e0381de4e42
              membership:
                resourceType: ProjectMembership
                id: d7f418aa-467d-d1ea-f0fc-d2dd841733e6
              status: Active
              accessPolicy:
                resourceType: AccessPolicy
                id: cca28116-f888-97bf-c336-5b992bd02672
                name: Practitioner access
      required:
        - total
        - page
        - count
        - resources
      example:
        total: 1
        page: 0
        count: 20
        resources:
          - user:
              resourceType: User
              id: 9f8a2389-a20c-a075-2aa9-e95093515517
              firstName: Max
              lastName: Mustermann
              email: max.mustermann@example.com
            profile:
              resourceType: Practitioner
              id: cd495e76-8385-ecb1-00a6-7e0381de4e42
            membership:
              resourceType: ProjectMembership
              id: d7f418aa-467d-d1ea-f0fc-d2dd841733e6
            status: Active
    CarehubProjectRequestBodyDto:
      type: object
      properties:
        id:
          type: string
          format: uuid
        name:
          type: string
          minLength: 1
        contact:
          type: array
          items:
            type: object
            properties:
              telecom:
                type: array
                items:
                  type: object
                  properties:
                    system:
                      type: string
                      enum:
                        - email
                        - phone
                        - fax
                        - pager
                        - url
                        - sms
                        - other
                    use:
                      type: string
                      enum:
                        - work
                        - temp
                        - old
                        - mobile
                    value:
                      type: string
                      minLength: 1
              name:
                type: object
                properties:
                  use:
                    type: string
                    enum:
                      - temp
                      - old
                      - official
                      - usual
                      - nickname
                      - anonymous
                      - maiden
                  prefix:
                    type: array
                    items:
                      type: string
                      minLength: 1
                  given:
                    type: array
                    items:
                      type: string
                      minLength: 1
                  family:
                    type: string
                    minLength: 1
                  suffix:
                    type: array
                    items:
                      type: string
                      minLength: 1
              address:
                type: object
                properties:
                  use:
                    type: string
                    enum:
                      - work
                      - temp
                      - old
                      - billing
                  type:
                    type: string
                    enum:
                      - postal
                      - physical
                      - both
                  text:
                    type: string
                    minLength: 1
                  line:
                    type: array
                    items:
                      type: string
                      minLength: 1
                  city:
                    type: string
                    minLength: 1
                  district:
                    type: string
                    minLength: 1
                  state:
                    type: string
                    minLength: 1
                  postalCode:
                    type: string
                    minLength: 1
                  country:
                    type: string
                    minLength: 1
        address:
          type: array
          items:
            type: object
            properties:
              use:
                type: string
                enum:
                  - work
                  - temp
                  - old
                  - billing
              type:
                type: string
                enum:
                  - postal
                  - physical
                  - both
              text:
                type: string
                minLength: 1
              line:
                type: array
                items:
                  type: string
                  minLength: 1
              city:
                type: string
                minLength: 1
              district:
                type: string
                minLength: 1
              state:
                type: string
                minLength: 1
              postalCode:
                type: string
                minLength: 1
              country:
                type: string
                minLength: 1
        extension: {}
        settings:
          type: object
          properties:
            timeZone:
              type: string
            trendsPeriod:
              type: object
              properties:
                start:
                  type: string
                  pattern: ^([01]\d|2[0-3]):([0-5]\d:([0-5]\d))$
                durationSeconds:
                  type: number
                  minimum: 0
              required:
                - start
                - durationSeconds
      required:
        - name
      example:
        id: f6f4da8d-93e8-8a08-220e-03b7810451d3
        name: Actimi
        contact:
          - telecom:
              - system: email
                use: work
                value: info@actimi.com
            gender: male
            name:
              use: official
              given:
                - John
              family: Doe
            address:
              line:
                - 123 Main St
              city: Anytown
              state: NY
              postalCode: "12345"
              country: USA
        address:
          - line:
              - 123 Main St
            city: Anytown
            state: NY
            postalCode: "12345"
            country: USA
    CarehubProjectsResponseDto:
      type: object
      properties:
        currentProject:
          type: object
          properties:
            resourceType:
              type: string
              enum:
                - Project
            id:
              type: string
            name:
              type: string
            address:
              type: array
              items:
                type: object
                properties:
                  use:
                    type: string
                    enum:
                      - work
                      - temp
                      - old
                      - billing
                  type:
                    type: string
                    enum:
                      - postal
                      - physical
                      - both
                  text:
                    type: string
                    minLength: 1
                  line:
                    type: array
                    items:
                      type: string
                      minLength: 1
                  city:
                    type: string
                    minLength: 1
                  district:
                    type: string
                    minLength: 1
                  state:
                    type: string
                    minLength: 1
                  postalCode:
                    type: string
                    minLength: 1
                  country:
                    type: string
                    minLength: 1
            contact:
              type: array
              items:
                type: object
                properties:
                  telecom:
                    type: array
                    items:
                      type: object
                      properties:
                        system:
                          type: string
                          enum:
                            - email
                            - phone
                            - fax
                            - pager
                            - url
                            - sms
                            - other
                        use:
                          type: string
                          enum:
                            - work
                            - temp
                            - old
                            - mobile
                        value:
                          type: string
                          minLength: 1
                  name:
                    type: object
                    properties:
                      use:
                        type: string
                        enum:
                          - temp
                          - old
                          - official
                          - usual
                          - nickname
                          - anonymous
                          - maiden
                      prefix:
                        type: array
                        items:
                          type: string
                          minLength: 1
                      given:
                        type: array
                        items:
                          type: string
                          minLength: 1
                      family:
                        type: string
                        minLength: 1
                      suffix:
                        type: array
                        items:
                          type: string
                          minLength: 1
                  address:
                    type: object
                    properties:
                      use:
                        type: string
                        enum:
                          - work
                          - temp
                          - old
                          - billing
                      type:
                        type: string
                        enum:
                          - postal
                          - physical
                          - both
                      text:
                        type: string
                        minLength: 1
                      line:
                        type: array
                        items:
                          type: string
                          minLength: 1
                      city:
                        type: string
                        minLength: 1
                      district:
                        type: string
                        minLength: 1
                      state:
                        type: string
                        minLength: 1
                      postalCode:
                        type: string
                        minLength: 1
                      country:
                        type: string
                        minLength: 1
            settings:
              type: object
              properties:
                timeZone:
                  type: string
                trendsPeriod:
                  type: object
                  properties:
                    start:
                      type: string
                      pattern: ^([01]\d|2[0-3]):([0-5]\d:([0-5]\d))$
                    durationSeconds:
                      type: number
                      minimum: 0
                  required:
                    - start
                    - durationSeconds
          required:
            - resourceType
            - id
            - name
        parentProject:
          type: object
          properties:
            resourceType:
              type: string
              enum:
                - Project
            id:
              type: string
            name:
              type: string
            address:
              type: array
              items:
                type: object
                properties:
                  use:
                    type: string
                    enum:
                      - work
                      - temp
                      - old
                      - billing
                  type:
                    type: string
                    enum:
                      - postal
                      - physical
                      - both
                  text:
                    type: string
                    minLength: 1
                  line:
                    type: array
                    items:
                      type: string
                      minLength: 1
                  city:
                    type: string
                    minLength: 1
                  district:
                    type: string
                    minLength: 1
                  state:
                    type: string
                    minLength: 1
                  postalCode:
                    type: string
                    minLength: 1
                  country:
                    type: string
                    minLength: 1
            contact:
              type: array
              items:
                type: object
                properties:
                  telecom:
                    type: array
                    items:
                      type: object
                      properties:
                        system:
                          type: string
                          enum:
                            - email
                            - phone
                            - fax
                            - pager
                            - url
                            - sms
                            - other
                        use:
                          type: string
                          enum:
                            - work
                            - temp
                            - old
                            - mobile
                        value:
                          type: string
                          minLength: 1
                  name:
                    type: object
                    properties:
                      use:
                        type: string
                        enum:
                          - temp
                          - old
                          - official
                          - usual
                          - nickname
                          - anonymous
                          - maiden
                      prefix:
                        type: array
                        items:
                          type: string
                          minLength: 1
                      given:
                        type: array
                        items:
                          type: string
                          minLength: 1
                      family:
                        type: string
                        minLength: 1
                      suffix:
                        type: array
                        items:
                          type: string
                          minLength: 1
                  address:
                    type: object
                    properties:
                      use:
                        type: string
                        enum:
                          - work
                          - temp
                          - old
                          - billing
                      type:
                        type: string
                        enum:
                          - postal
                          - physical
                          - both
                      text:
                        type: string
                        minLength: 1
                      line:
                        type: array
                        items:
                          type: string
                          minLength: 1
                      city:
                        type: string
                        minLength: 1
                      district:
                        type: string
                        minLength: 1
                      state:
                        type: string
                        minLength: 1
                      postalCode:
                        type: string
                        minLength: 1
                      country:
                        type: string
                        minLength: 1
            settings:
              type: object
              properties:
                timeZone:
                  type: string
                trendsPeriod:
                  type: object
                  properties:
                    start:
                      type: string
                      pattern: ^([01]\d|2[0-3]):([0-5]\d:([0-5]\d))$
                    durationSeconds:
                      type: number
                      minimum: 0
                  required:
                    - start
                    - durationSeconds
          required:
            - resourceType
            - id
            - name
          nullable: true
        childProjects:
          type: array
          items:
            type: object
            properties:
              resourceType:
                type: string
                enum:
                  - Project
              id:
                type: string
              name:
                type: string
              address:
                type: array
                items:
                  type: object
                  properties:
                    use:
                      type: string
                      enum:
                        - work
                        - temp
                        - old
                        - billing
                    type:
                      type: string
                      enum:
                        - postal
                        - physical
                        - both
                    text:
                      type: string
                      minLength: 1
                    line:
                      type: array
                      items:
                        type: string
                        minLength: 1
                    city:
                      type: string
                      minLength: 1
                    district:
                      type: string
                      minLength: 1
                    state:
                      type: string
                      minLength: 1
                    postalCode:
                      type: string
                      minLength: 1
                    country:
                      type: string
                      minLength: 1
              contact:
                type: array
                items:
                  type: object
                  properties:
                    telecom:
                      type: array
                      items:
                        type: object
                        properties:
                          system:
                            type: string
                            enum:
                              - email
                              - phone
                              - fax
                              - pager
                              - url
                              - sms
                              - other
                          use:
                            type: string
                            enum:
                              - work
                              - temp
                              - old
                              - mobile
                          value:
                            type: string
                            minLength: 1
                    name:
                      type: object
                      properties:
                        use:
                          type: string
                          enum:
                            - temp
                            - old
                            - official
                            - usual
                            - nickname
                            - anonymous
                            - maiden
                        prefix:
                          type: array
                          items:
                            type: string
                            minLength: 1
                        given:
                          type: array
                          items:
                            type: string
                            minLength: 1
                        family:
                          type: string
                          minLength: 1
                        suffix:
                          type: array
                          items:
                            type: string
                            minLength: 1
                    address:
                      type: object
                      properties:
                        use:
                          type: string
                          enum:
                            - work
                            - temp
                            - old
                            - billing
                        type:
                          type: string
                          enum:
                            - postal
                            - physical
                            - both
                        text:
                          type: string
                          minLength: 1
                        line:
                          type: array
                          items:
                            type: string
                            minLength: 1
                        city:
                          type: string
                          minLength: 1
                        district:
                          type: string
                          minLength: 1
                        state:
                          type: string
                          minLength: 1
                        postalCode:
                          type: string
                          minLength: 1
                        country:
                          type: string
                          minLength: 1
              settings:
                type: object
                properties:
                  timeZone:
                    type: string
                  trendsPeriod:
                    type: object
                    properties:
                      start:
                        type: string
                        pattern: ^([01]\d|2[0-3]):([0-5]\d:([0-5]\d))$
                      durationSeconds:
                        type: number
                        minimum: 0
                    required:
                      - start
                      - durationSeconds
            required:
              - resourceType
              - id
              - name
      required:
        - currentProject
        - parentProject
        - childProjects
      example:
        currentProject:
          resourceType: Project
          id: f6f4da8d-93e8-8a08-220e-03b7810451d3
          name: Example Project
        parentProject:
          resourceType: Project
          id: f6f4da8d-93e8-8a08-220e-03b7810451d3
          name: Example Project
        subProjects:
          - resourceType: Project
            id: f6f4da8d-93e8-8a08-220e-03b7810451d3
            name: Example Project
    CarehubProjectsV2ResponseDto:
      type: object
      properties:
        currentProject:
          type: object
          properties:
            resourceType:
              type: string
              enum:
                - Project
            id:
              type: string
            name:
              type: string
            address:
              type: array
              items:
                type: object
                properties:
                  use:
                    type: string
                    enum:
                      - work
                      - temp
                      - old
                      - billing
                  type:
                    type: string
                    enum:
                      - postal
                      - physical
                      - both
                  text:
                    type: string
                    minLength: 1
                  line:
                    type: array
                    items:
                      type: string
                      minLength: 1
                  city:
                    type: string
                    minLength: 1
                  district:
                    type: string
                    minLength: 1
                  state:
                    type: string
                    minLength: 1
                  postalCode:
                    type: string
                    minLength: 1
                  country:
                    type: string
                    minLength: 1
            contact:
              type: array
              items:
                type: object
                properties:
                  telecom:
                    type: array
                    items:
                      type: object
                      properties:
                        system:
                          type: string
                          enum:
                            - email
                            - phone
                            - fax
                            - pager
                            - url
                            - sms
                            - other
                        use:
                          type: string
                          enum:
                            - work
                            - temp
                            - old
                            - mobile
                        value:
                          type: string
                          minLength: 1
                  name:
                    type: object
                    properties:
                      use:
                        type: string
                        enum:
                          - temp
                          - old
                          - official
                          - usual
                          - nickname
                          - anonymous
                          - maiden
                      prefix:
                        type: array
                        items:
                          type: string
                          minLength: 1
                      given:
                        type: array
                        items:
                          type: string
                          minLength: 1
                      family:
                        type: string
                        minLength: 1
                      suffix:
                        type: array
                        items:
                          type: string
                          minLength: 1
                  address:
                    type: object
                    properties:
                      use:
                        type: string
                        enum:
                          - work
                          - temp
                          - old
                          - billing
                      type:
                        type: string
                        enum:
                          - postal
                          - physical
                          - both
                      text:
                        type: string
                        minLength: 1
                      line:
                        type: array
                        items:
                          type: string
                          minLength: 1
                      city:
                        type: string
                        minLength: 1
                      district:
                        type: string
                        minLength: 1
                      state:
                        type: string
                        minLength: 1
                      postalCode:
                        type: string
                        minLength: 1
                      country:
                        type: string
                        minLength: 1
            settings:
              type: object
              properties:
                timeZone:
                  type: string
                trendsPeriod:
                  type: object
                  properties:
                    start:
                      type: string
                      pattern: ^([01]\d|2[0-3]):([0-5]\d:([0-5]\d))$
                    durationSeconds:
                      type: number
                      minimum: 0
                  required:
                    - start
                    - durationSeconds
            deviceCount:
              type: number
          required:
            - resourceType
            - id
            - name
            - deviceCount
        parentProject:
          type: object
          properties:
            resourceType:
              type: string
              enum:
                - Project
            id:
              type: string
            name:
              type: string
            address:
              type: array
              items:
                type: object
                properties:
                  use:
                    type: string
                    enum:
                      - work
                      - temp
                      - old
                      - billing
                  type:
                    type: string
                    enum:
                      - postal
                      - physical
                      - both
                  text:
                    type: string
                    minLength: 1
                  line:
                    type: array
                    items:
                      type: string
                      minLength: 1
                  city:
                    type: string
                    minLength: 1
                  district:
                    type: string
                    minLength: 1
                  state:
                    type: string
                    minLength: 1
                  postalCode:
                    type: string
                    minLength: 1
                  country:
                    type: string
                    minLength: 1
            contact:
              type: array
              items:
                type: object
                properties:
                  telecom:
                    type: array
                    items:
                      type: object
                      properties:
                        system:
                          type: string
                          enum:
                            - email
                            - phone
                            - fax
                            - pager
                            - url
                            - sms
                            - other
                        use:
                          type: string
                          enum:
                            - work
                            - temp
                            - old
                            - mobile
                        value:
                          type: string
                          minLength: 1
                  name:
                    type: object
                    properties:
                      use:
                        type: string
                        enum:
                          - temp
                          - old
                          - official
                          - usual
                          - nickname
                          - anonymous
                          - maiden
                      prefix:
                        type: array
                        items:
                          type: string
                          minLength: 1
                      given:
                        type: array
                        items:
                          type: string
                          minLength: 1
                      family:
                        type: string
                        minLength: 1
                      suffix:
                        type: array
                        items:
                          type: string
                          minLength: 1
                  address:
                    type: object
                    properties:
                      use:
                        type: string
                        enum:
                          - work
                          - temp
                          - old
                          - billing
                      type:
                        type: string
                        enum:
                          - postal
                          - physical
                          - both
                      text:
                        type: string
                        minLength: 1
                      line:
                        type: array
                        items:
                          type: string
                          minLength: 1
                      city:
                        type: string
                        minLength: 1
                      district:
                        type: string
                        minLength: 1
                      state:
                        type: string
                        minLength: 1
                      postalCode:
                        type: string
                        minLength: 1
                      country:
                        type: string
                        minLength: 1
            settings:
              type: object
              properties:
                timeZone:
                  type: string
                trendsPeriod:
                  type: object
                  properties:
                    start:
                      type: string
                      pattern: ^([01]\d|2[0-3]):([0-5]\d:([0-5]\d))$
                    durationSeconds:
                      type: number
                      minimum: 0
                  required:
                    - start
                    - durationSeconds
            deviceCount:
              type: number
          required:
            - resourceType
            - id
            - name
            - deviceCount
          nullable: true
        childProjects:
          type: array
          items:
            type: object
            properties:
              resourceType:
                type: string
                enum:
                  - Project
              id:
                type: string
              name:
                type: string
              address:
                type: array
                items:
                  type: object
                  properties:
                    use:
                      type: string
                      enum:
                        - work
                        - temp
                        - old
                        - billing
                    type:
                      type: string
                      enum:
                        - postal
                        - physical
                        - both
                    text:
                      type: string
                      minLength: 1
                    line:
                      type: array
                      items:
                        type: string
                        minLength: 1
                    city:
                      type: string
                      minLength: 1
                    district:
                      type: string
                      minLength: 1
                    state:
                      type: string
                      minLength: 1
                    postalCode:
                      type: string
                      minLength: 1
                    country:
                      type: string
                      minLength: 1
              contact:
                type: array
                items:
                  type: object
                  properties:
                    telecom:
                      type: array
                      items:
                        type: object
                        properties:
                          system:
                            type: string
                            enum:
                              - email
                              - phone
                              - fax
                              - pager
                              - url
                              - sms
                              - other
                          use:
                            type: string
                            enum:
                              - work
                              - temp
                              - old
                              - mobile
                          value:
                            type: string
                            minLength: 1
                    name:
                      type: object
                      properties:
                        use:
                          type: string
                          enum:
                            - temp
                            - old
                            - official
                            - usual
                            - nickname
                            - anonymous
                            - maiden
                        prefix:
                          type: array
                          items:
                            type: string
                            minLength: 1
                        given:
                          type: array
                          items:
                            type: string
                            minLength: 1
                        family:
                          type: string
                          minLength: 1
                        suffix:
                          type: array
                          items:
                            type: string
                            minLength: 1
                    address:
                      type: object
                      properties:
                        use:
                          type: string
                          enum:
                            - work
                            - temp
                            - old
                            - billing
                        type:
                          type: string
                          enum:
                            - postal
                            - physical
                            - both
                        text:
                          type: string
                          minLength: 1
                        line:
                          type: array
                          items:
                            type: string
                            minLength: 1
                        city:
                          type: string
                          minLength: 1
                        district:
                          type: string
                          minLength: 1
                        state:
                          type: string
                          minLength: 1
                        postalCode:
                          type: string
                          minLength: 1
                        country:
                          type: string
                          minLength: 1
              settings:
                type: object
                properties:
                  timeZone:
                    type: string
                  trendsPeriod:
                    type: object
                    properties:
                      start:
                        type: string
                        pattern: ^([01]\d|2[0-3]):([0-5]\d:([0-5]\d))$
                      durationSeconds:
                        type: number
                        minimum: 0
                    required:
                      - start
                      - durationSeconds
              deviceCount:
                type: number
            required:
              - resourceType
              - id
              - name
              - deviceCount
      required:
        - currentProject
        - parentProject
        - childProjects
      example:
        currentProject:
          resourceType: Project
          id: f6f4da8d-93e8-8a08-220e-03b7810451d3
          name: Example Project
          deviceCount: 0
        parentProject:
          resourceType: Project
          id: f6f4da8d-93e8-8a08-220e-03b7810451d3
          name: Example Project
          deviceCount: 0
        subProjects:
          - resourceType: Project
            id: f6f4da8d-93e8-8a08-220e-03b7810451d3
            name: Example Project
            deviceCount: 0
    CarehubProjectDeviceCountsResponseDto:
      type: object
      properties:
        projectId:
          type: string
        totalDeviceCount:
          type: number
          minimum: 0
        assignedResidentDeviceCount:
          type: number
          minimum: 0
        unassignedDeviceCount:
          type: number
          minimum: 0
        activeDeviceCount:
          type: number
          minimum: 0
        inactiveDeviceCount:
          type: number
          minimum: 0
        radarDeviceCount:
          type: number
          minimum: 0
        withingsDeviceCount:
          type: number
          minimum: 0
      required:
        - projectId
        - totalDeviceCount
        - assignedResidentDeviceCount
        - unassignedDeviceCount
        - activeDeviceCount
        - inactiveDeviceCount
        - radarDeviceCount
        - withingsDeviceCount
      example:
        projectId: f6f4da8d-93e8-8a08-220e-03b7810451d3
        totalDeviceCount: 14
        assignedResidentDeviceCount: 11
        unassignedDeviceCount: 3
        activeDeviceCount: 12
        inactiveDeviceCount: 2
        radarDeviceCount: 10
        withingsDeviceCount: 4
    CarehubProjectPatientCountsResponseDto:
      type: object
      properties:
        projectId:
          type: string
        totalPatientCount:
          type: number
          minimum: 0
        activePatientCount:
          type: number
          minimum: 0
        dischargedRecentPatientCount:
          type: number
          minimum: 0
        dischargedPatientCount:
          type: number
          minimum: 0
        archivedPatientCount:
          type: number
          minimum: 0
      required:
        - projectId
        - totalPatientCount
        - activePatientCount
        - dischargedRecentPatientCount
        - dischargedPatientCount
        - archivedPatientCount
      example:
        projectId: f6f4da8d-93e8-8a08-220e-03b7810451d3
        totalPatientCount: 36
        activePatientCount: 34
        dischargedRecentPatientCount: 2
        dischargedPatientCount: 0
        archivedPatientCount: 0
    CarehubProjectResponseDto:
      type: object
      properties:
        resourceType:
          type: string
          enum:
            - Project
        id:
          type: string
        name:
          type: string
        address:
          type: array
          items:
            type: object
            properties:
              use:
                type: string
                enum:
                  - work
                  - temp
                  - old
                  - billing
              type:
                type: string
                enum:
                  - postal
                  - physical
                  - both
              text:
                type: string
                minLength: 1
              line:
                type: array
                items:
                  type: string
                  minLength: 1
              city:
                type: string
                minLength: 1
              district:
                type: string
                minLength: 1
              state:
                type: string
                minLength: 1
              postalCode:
                type: string
                minLength: 1
              country:
                type: string
                minLength: 1
        contact:
          type: array
          items:
            type: object
            properties:
              telecom:
                type: array
                items:
                  type: object
                  properties:
                    system:
                      type: string
                      enum:
                        - email
                        - phone
                        - fax
                        - pager
                        - url
                        - sms
                        - other
                    use:
                      type: string
                      enum:
                        - work
                        - temp
                        - old
                        - mobile
                    value:
                      type: string
                      minLength: 1
              name:
                type: object
                properties:
                  use:
                    type: string
                    enum:
                      - temp
                      - old
                      - official
                      - usual
                      - nickname
                      - anonymous
                      - maiden
                  prefix:
                    type: array
                    items:
                      type: string
                      minLength: 1
                  given:
                    type: array
                    items:
                      type: string
                      minLength: 1
                  family:
                    type: string
                    minLength: 1
                  suffix:
                    type: array
                    items:
                      type: string
                      minLength: 1
              address:
                type: object
                properties:
                  use:
                    type: string
                    enum:
                      - work
                      - temp
                      - old
                      - billing
                  type:
                    type: string
                    enum:
                      - postal
                      - physical
                      - both
                  text:
                    type: string
                    minLength: 1
                  line:
                    type: array
                    items:
                      type: string
                      minLength: 1
                  city:
                    type: string
                    minLength: 1
                  district:
                    type: string
                    minLength: 1
                  state:
                    type: string
                    minLength: 1
                  postalCode:
                    type: string
                    minLength: 1
                  country:
                    type: string
                    minLength: 1
        settings:
          type: object
          properties:
            timeZone:
              type: string
            trendsPeriod:
              type: object
              properties:
                start:
                  type: string
                  pattern: ^([01]\d|2[0-3]):([0-5]\d:([0-5]\d))$
                durationSeconds:
                  type: number
                  minimum: 0
              required:
                - start
                - durationSeconds
      required:
        - resourceType
        - id
        - name
      example:
        resourceType: Project
        id: f6f4da8d-93e8-8a08-220e-03b7810451d3
        name: Example Project
    CarehubThresholdResponseDto:
      type: object
      properties:
        id:
          type: string
        projectId:
          type: string
        status:
          type: string
          enum:
            - active
            - retired
        date:
          type: string
          format: date-time
        settings:
          type: object
          properties:
            heartRate:
              type: object
              properties:
                mode:
                  type: string
                  enum:
                    - organization
                enabled:
                  type: boolean
                absolute:
                  type: object
                  properties:
                    enabled:
                      type: boolean
                    min:
                      type: number
                      minimum: 0
                    max:
                      type: number
                      maximum: 1000
                  required:
                    - enabled
                    - min
                    - max
              required:
                - mode
                - enabled
                - absolute
            meanHeartRate:
              type: object
              properties:
                mode:
                  type: string
                  enum:
                    - organization
                enabled:
                  type: boolean
                relative:
                  type: object
                  properties:
                    enabled:
                      type: boolean
                    min:
                      type: number
                      minimum: 0
                    max:
                      type: number
                      maximum: 1000
                  required:
                    - enabled
                    - min
                    - max
              required:
                - mode
                - enabled
                - relative
            respiratoryRate:
              type: object
              properties:
                mode:
                  type: string
                  enum:
                    - organization
                enabled:
                  type: boolean
                absolute:
                  type: object
                  properties:
                    enabled:
                      type: boolean
                    min:
                      type: number
                      minimum: 0
                    max:
                      type: number
                      maximum: 1000
                  required:
                    - enabled
                    - min
                    - max
              required:
                - mode
                - enabled
                - absolute
            meanRespiratoryRate:
              type: object
              properties:
                mode:
                  type: string
                  enum:
                    - organization
                enabled:
                  type: boolean
                relative:
                  type: object
                  properties:
                    enabled:
                      type: boolean
                    min:
                      type: number
                      minimum: 0
                    max:
                      type: number
                      maximum: 1000
                  required:
                    - enabled
                    - min
                    - max
              required:
                - mode
                - enabled
                - relative
            durationOfOutOfBed:
              type: object
              properties:
                mode:
                  type: string
                  enum:
                    - organization
                enabled:
                  type: boolean
                period:
                  type: object
                  properties:
                    mode:
                      type: string
                      enum:
                        - organization
                        - patient
                    start:
                      type: string
                    end:
                      type: string
                    timezone:
                      type: string
                      nullable: true
                  required:
                    - start
                    - end
                absolute:
                  type: object
                  properties:
                    enabled:
                      type: boolean
                    max:
                      type: number
                      maximum: 1000000
                  required:
                    - enabled
                    - max
                relative:
                  type: object
                  properties:
                    enabled:
                      type: boolean
                    max:
                      type: number
                      maximum: 100
                  required:
                    - enabled
                    - max
              required:
                - mode
                - enabled
            sleepDuration:
              type: object
              properties:
                mode:
                  type: string
                  enum:
                    - organization
                enabled:
                  type: boolean
                absolute:
                  type: object
                  properties:
                    enabled:
                      type: boolean
                    min:
                      type: number
                      minimum: 0
                    max:
                      type: number
                      maximum: 1000
                  required:
                    - enabled
                    - min
                    - max
              required:
                - mode
                - enabled
                - absolute
            numberOfTimesGettingOutOfBed:
              type: object
              properties:
                mode:
                  type: string
                  enum:
                    - organization
                enabled:
                  type: boolean
                absolute:
                  type: object
                  properties:
                    enabled:
                      type: boolean
                    max:
                      type: number
                      maximum: 1000
                  required:
                    - enabled
                    - max
              required:
                - mode
                - enabled
                - absolute
      required:
        - status
        - settings
      example:
        id: c51f7b72-279e-26fd-7cf6-6d9d61e7f720
        projectId: f6f4da8d-93e8-8a08-220e-03b7810451d3
        status: active
        date: 2026-08-16T17:06:17.445Z
        settings:
          heartRate:
            mode: organization
            enabled: true
            absolute:
              enabled: true
              min: 60
              max: 100
          meanHeartRate:
            mode: organization
            enabled: false
            relative:
              enabled: false
              min: 0.8
              max: 1.2
          respiratoryRate:
            mode: organization
            enabled: true
            absolute:
              enabled: true
              min: 12
              max: 20
          meanRespiratoryRate:
            mode: organization
            enabled: false
            relative:
              enabled: false
              min: 0.8
              max: 1.2
          durationOfOutOfBed:
            mode: organization
            enabled: true
            period:
              start: 09:00:00
              end: 09:00:00
            absolute:
              enabled: true
              max: 600
          sleepDuration:
            mode: organization
            enabled: true
            absolute:
              enabled: true
              min: 7
              max: 10
          numberOfTimesGettingOutOfBed:
            mode: organization
            enabled: true
            absolute:
              enabled: true
              max: 0
    ThresholdBodyDto:
      type: object
      properties:
        id:
          type: string
        projectId:
          type: string
        status:
          type: string
          enum:
            - active
            - retired
        date:
          type: string
          format: date-time
        settings:
          type: object
          properties:
            heartRate:
              default:
                enabled: false
                absolute:
                  enabled: false
                  min: 0
                  max: 0
              type: object
              properties:
                mode:
                  default: organization
                  type: string
                  enum:
                    - organization
                enabled:
                  type: boolean
                absolute:
                  type: object
                  properties:
                    enabled:
                      type: boolean
                    min:
                      type: number
                      minimum: 0
                    max:
                      type: number
                      maximum: 1000
                  required:
                    - enabled
                    - min
                    - max
              required:
                - enabled
                - absolute
            meanHeartRate:
              default:
                enabled: false
                relative:
                  enabled: false
                  min: 0
                  max: 0
              type: object
              properties:
                mode:
                  default: organization
                  type: string
                  enum:
                    - organization
                enabled:
                  type: boolean
                relative:
                  type: object
                  properties:
                    enabled:
                      type: boolean
                    min:
                      type: number
                      minimum: 0
                    max:
                      type: number
                      maximum: 1000
                  required:
                    - enabled
                    - min
                    - max
              required:
                - enabled
                - relative
            respiratoryRate:
              default:
                enabled: false
                absolute:
                  enabled: false
                  min: 0
                  max: 0
              type: object
              properties:
                mode:
                  default: organization
                  type: string
                  enum:
                    - organization
                enabled:
                  type: boolean
                absolute:
                  type: object
                  properties:
                    enabled:
                      type: boolean
                    min:
                      type: number
                      minimum: 0
                    max:
                      type: number
                      maximum: 1000
                  required:
                    - enabled
                    - min
                    - max
              required:
                - enabled
                - absolute
            meanRespiratoryRate:
              default:
                enabled: false
                relative:
                  enabled: false
                  min: 0
                  max: 0
              type: object
              properties:
                mode:
                  default: organization
                  type: string
                  enum:
                    - organization
                enabled:
                  type: boolean
                relative:
                  type: object
                  properties:
                    enabled:
                      type: boolean
                    min:
                      type: number
                      minimum: 0
                    max:
                      type: number
                      maximum: 1000
                  required:
                    - enabled
                    - min
                    - max
              required:
                - enabled
                - relative
            durationOfOutOfBed:
              default:
                enabled: false
                absolute:
                  enabled: false
                  max: 0
              type: object
              properties:
                mode:
                  default: organization
                  type: string
                  enum:
                    - organization
                enabled:
                  type: boolean
                period:
                  default:
                    start: 09:00:00
                    end: 09:00:00
                  type: object
                  properties:
                    mode:
                      type: string
                      enum:
                        - organization
                        - patient
                    start:
                      type: string
                      pattern: ^([01]\d|2[0-3]):([0-5]\d:([0-5]\d))$
                    end:
                      type: string
                      pattern: ^([01]\d|2[0-3]):([0-5]\d:([0-5]\d))$
                      nullable: true
                    timezone:
                      type: string
                      nullable: true
                    durationSeconds:
                      type: number
                      minimum: 0
                      maximum: 86400
                  required:
                    - start
                absolute:
                  type: object
                  properties:
                    enabled:
                      type: boolean
                    max:
                      type: number
                      maximum: 1000000
                  required:
                    - enabled
                    - max
                relative:
                  type: object
                  properties:
                    enabled:
                      type: boolean
                    max:
                      type: number
                      maximum: 100
                  required:
                    - enabled
                    - max
              required:
                - enabled
            sleepDuration:
              default:
                enabled: false
                absolute:
                  enabled: false
                  min: 0
                  max: 0
              type: object
              properties:
                mode:
                  default: organization
                  type: string
                  enum:
                    - organization
                enabled:
                  type: boolean
                absolute:
                  type: object
                  properties:
                    enabled:
                      type: boolean
                    min:
                      type: number
                      minimum: 0
                    max:
                      type: number
                      maximum: 1000
                  required:
                    - enabled
                    - min
                    - max
              required:
                - enabled
                - absolute
            numberOfTimesGettingOutOfBed:
              default:
                enabled: false
                absolute:
                  enabled: false
                  max: 0
              type: object
              properties:
                mode:
                  default: organization
                  type: string
                  enum:
                    - organization
                enabled:
                  type: boolean
                absolute:
                  type: object
                  properties:
                    enabled:
                      type: boolean
                    max:
                      type: number
                      maximum: 1000
                  required:
                    - enabled
                    - max
              required:
                - enabled
                - absolute
      required:
        - status
        - settings
      example:
        id: "123"
        date: 2021-01-01T00:00:00.000Z
        metrics:
          heartRate:
            unit: bpm
            thresholds:
              type: relative
              values:
                min: 60
                max: 100
          respiratoryRate:
            unit: bpm
            thresholds:
              type: absolute
              values:
                min: 60
                max: 100
          durationOfOutOfBed:
            unit: min
            thresholds:
              type: absolute
              values:
                min: 60
                max: 100
    PatientThresholdDto:
      type: object
      properties:
        id:
          type: string
        patientId:
          type: string
        projectId:
          type: string
        status:
          type: string
          enum:
            - active
            - revoked
        date:
          type: string
          format: date-time
        period:
          type: object
          properties:
            start:
              type: string
              format: date-time
            end:
              type: string
              format: date-time
        settings:
          type: object
          properties:
            heartRate:
              type: object
              properties:
                period:
                  default: &a68
                    start: 09:00:00
                    end: 09:00:00
                  type: object
                  properties:
                    mode:
                      type: string
                      enum:
                        - organization
                        - patient
                    start:
                      type: string
                      pattern: ^([01]\d|2[0-3]):([0-5]\d:([0-5]\d))$
                    end:
                      type: string
                      pattern: ^([01]\d|2[0-3]):([0-5]\d:([0-5]\d))$
                      nullable: true
                    timezone:
                      type: string
                      nullable: true
                    durationSeconds:
                      type: number
                      minimum: 0
                      maximum: 86400
                  required:
                    - start
                average:
                  type: number
                averageRange:
                  type: object
                  properties:
                    min:
                      type: number
                    max:
                      type: number
                mode:
                  type: string
                  enum:
                    - organization
                    - patient
                    - patient-auto
                enabled:
                  type: boolean
                absolute:
                  type: object
                  properties:
                    enabled:
                      type: boolean
                    min:
                      type: number
                      minimum: 0
                    max:
                      type: number
                      maximum: 1000
                  required:
                    - enabled
                    - min
                    - max
              required:
                - mode
                - enabled
            meanHeartRate:
              type: object
              properties:
                period:
                  default: *a68
                  type: object
                  properties:
                    mode:
                      type: string
                      enum:
                        - organization
                        - patient
                    start:
                      type: string
                      pattern: ^([01]\d|2[0-3]):([0-5]\d:([0-5]\d))$
                    end:
                      type: string
                      pattern: ^([01]\d|2[0-3]):([0-5]\d:([0-5]\d))$
                      nullable: true
                    timezone:
                      type: string
                      nullable: true
                    durationSeconds:
                      type: number
                      minimum: 0
                      maximum: 86400
                  required:
                    - start
                average:
                  type: number
                averageRange:
                  type: object
                  properties:
                    min:
                      type: number
                    max:
                      type: number
                mode:
                  type: string
                  enum:
                    - organization
                    - patient
                    - patient-auto
                enabled:
                  type: boolean
                relative:
                  type: object
                  properties:
                    enabled:
                      type: boolean
                    min:
                      type: number
                      minimum: 0
                    max:
                      type: number
                      maximum: 1000
                  required:
                    - enabled
                    - min
                    - max
              required:
                - mode
                - enabled
                - relative
            respiratoryRate:
              type: object
              properties:
                period:
                  default: *a68
                  type: object
                  properties:
                    mode:
                      type: string
                      enum:
                        - organization
                        - patient
                    start:
                      type: string
                      pattern: ^([01]\d|2[0-3]):([0-5]\d:([0-5]\d))$
                    end:
                      type: string
                      pattern: ^([01]\d|2[0-3]):([0-5]\d:([0-5]\d))$
                      nullable: true
                    timezone:
                      type: string
                      nullable: true
                    durationSeconds:
                      type: number
                      minimum: 0
                      maximum: 86400
                  required:
                    - start
                average:
                  type: number
                averageRange:
                  type: object
                  properties:
                    min:
                      type: number
                    max:
                      type: number
                mode:
                  type: string
                  enum:
                    - organization
                    - patient
                    - patient-auto
                enabled:
                  type: boolean
                absolute:
                  type: object
                  properties:
                    enabled:
                      type: boolean
                    min:
                      type: number
                      minimum: 0
                    max:
                      type: number
                      maximum: 1000
                  required:
                    - enabled
                    - min
                    - max
              required:
                - mode
                - enabled
                - absolute
            meanRespiratoryRate:
              type: object
              properties:
                period:
                  default: *a68
                  type: object
                  properties:
                    mode:
                      type: string
                      enum:
                        - organization
                        - patient
                    start:
                      type: string
                      pattern: ^([01]\d|2[0-3]):([0-5]\d:([0-5]\d))$
                    end:
                      type: string
                      pattern: ^([01]\d|2[0-3]):([0-5]\d:([0-5]\d))$
                      nullable: true
                    timezone:
                      type: string
                      nullable: true
                    durationSeconds:
                      type: number
                      minimum: 0
                      maximum: 86400
                  required:
                    - start
                average:
                  type: number
                averageRange:
                  type: object
                  properties:
                    min:
                      type: number
                    max:
                      type: number
                mode:
                  type: string
                  enum:
                    - organization
                    - patient
                    - patient-auto
                enabled:
                  type: boolean
                relative:
                  type: object
                  properties:
                    enabled:
                      type: boolean
                    min:
                      type: number
                      minimum: 0
                    max:
                      type: number
                      maximum: 1000
                  required:
                    - enabled
                    - min
                    - max
              required:
                - mode
                - enabled
                - relative
            durationOfOutOfBed:
              type: object
              properties:
                period:
                  default: *a68
                  type: object
                  properties:
                    mode:
                      type: string
                      enum:
                        - organization
                        - patient
                    start:
                      type: string
                      pattern: ^([01]\d|2[0-3]):([0-5]\d:([0-5]\d))$
                    end:
                      type: string
                      pattern: ^([01]\d|2[0-3]):([0-5]\d:([0-5]\d))$
                      nullable: true
                    timezone:
                      type: string
                      nullable: true
                    durationSeconds:
                      type: number
                      minimum: 0
                      maximum: 86400
                  required:
                    - start
                average:
                  type: number
                averageRange:
                  type: object
                  properties:
                    min:
                      type: number
                    max:
                      type: number
                mode:
                  type: string
                  enum:
                    - organization
                    - patient
                    - patient-auto
                enabled:
                  type: boolean
                absolute:
                  type: object
                  properties:
                    enabled:
                      type: boolean
                    max:
                      type: number
                      maximum: 1000000
                  required:
                    - enabled
                    - max
                relative:
                  type: object
                  properties:
                    enabled:
                      type: boolean
                    max:
                      type: number
                      maximum: 100
                  required:
                    - enabled
                    - max
              required:
                - mode
                - enabled
            sleepDuration:
              type: object
              properties:
                period:
                  default: *a68
                  type: object
                  properties:
                    mode:
                      type: string
                      enum:
                        - organization
                        - patient
                    start:
                      type: string
                      pattern: ^([01]\d|2[0-3]):([0-5]\d:([0-5]\d))$
                    end:
                      type: string
                      pattern: ^([01]\d|2[0-3]):([0-5]\d:([0-5]\d))$
                      nullable: true
                    timezone:
                      type: string
                      nullable: true
                    durationSeconds:
                      type: number
                      minimum: 0
                      maximum: 86400
                  required:
                    - start
                average:
                  type: number
                averageRange:
                  type: object
                  properties:
                    min:
                      type: number
                    max:
                      type: number
                mode:
                  type: string
                  enum:
                    - organization
                    - patient
                    - patient-auto
                enabled:
                  type: boolean
                absolute:
                  type: object
                  properties:
                    enabled:
                      type: boolean
                    min:
                      type: number
                      minimum: 0
                    max:
                      type: number
                      maximum: 1000
                  required:
                    - enabled
                    - min
                    - max
              required:
                - mode
                - enabled
                - absolute
            numberOfTimesGettingOutOfBed:
              type: object
              properties:
                period:
                  default: *a68
                  type: object
                  properties:
                    mode:
                      type: string
                      enum:
                        - organization
                        - patient
                    start:
                      type: string
                      pattern: ^([01]\d|2[0-3]):([0-5]\d:([0-5]\d))$
                    end:
                      type: string
                      pattern: ^([01]\d|2[0-3]):([0-5]\d:([0-5]\d))$
                      nullable: true
                    timezone:
                      type: string
                      nullable: true
                    durationSeconds:
                      type: number
                      minimum: 0
                      maximum: 86400
                  required:
                    - start
                average:
                  type: number
                averageRange:
                  type: object
                  properties:
                    min:
                      type: number
                    max:
                      type: number
                mode:
                  type: string
                  enum:
                    - organization
                    - patient
                    - patient-auto
                enabled:
                  type: boolean
                absolute:
                  type: object
                  properties:
                    enabled:
                      type: boolean
                    max:
                      type: number
                      maximum: 1000
                  required:
                    - enabled
                    - max
              required:
                - mode
                - enabled
                - absolute
      required:
        - patientId
        - status
        - settings
      example:
        id: "123"
        patientId: patient-123
        date: 2021-01-01T00:00:00.000Z
        settings:
          heartRate:
            mode: patient
            enabled: true
            absolute:
              enabled: true
              min: 60
              max: 100
          meanHeartRate:
            mode: organization
            enabled: true
            relative:
              enabled: true
              min: 0.8
              max: 1.2
            average: 65.5
    PatientThresholdBodyDto:
      type: object
      properties:
        id:
          type: string
        patientId:
          type: string
        projectId:
          type: string
        status:
          type: string
          enum:
            - active
            - revoked
        date:
          type: string
          format: date-time
        settings:
          type: object
          properties:
            heartRate:
              default:
                mode: organization
                enabled: false
                absolute:
                  enabled: false
                  min: 0
                  max: 0
              type: object
              properties:
                period:
                  default: *a68
                  type: object
                  properties:
                    mode:
                      type: string
                      enum:
                        - organization
                        - patient
                    start:
                      type: string
                      pattern: ^([01]\d|2[0-3]):([0-5]\d:([0-5]\d))$
                    end:
                      type: string
                      pattern: ^([01]\d|2[0-3]):([0-5]\d:([0-5]\d))$
                      nullable: true
                    timezone:
                      type: string
                      nullable: true
                    durationSeconds:
                      type: number
                      minimum: 0
                      maximum: 86400
                  required:
                    - start
                average:
                  type: number
                averageRange:
                  type: object
                  properties:
                    min:
                      type: number
                    max:
                      type: number
                mode:
                  type: string
                  enum:
                    - organization
                    - patient
                    - patient-auto
                enabled:
                  type: boolean
                absolute:
                  type: object
                  properties:
                    enabled:
                      type: boolean
                    min:
                      type: number
                      minimum: 0
                    max:
                      type: number
                      maximum: 1000
                  required:
                    - enabled
                    - min
                    - max
              required:
                - mode
                - enabled
            meanHeartRate:
              default:
                mode: organization
                enabled: false
                relative:
                  enabled: false
                  min: 0
                  max: 0
              type: object
              properties:
                period:
                  default: *a68
                  type: object
                  properties:
                    mode:
                      type: string
                      enum:
                        - organization
                        - patient
                    start:
                      type: string
                      pattern: ^([01]\d|2[0-3]):([0-5]\d:([0-5]\d))$
                    end:
                      type: string
                      pattern: ^([01]\d|2[0-3]):([0-5]\d:([0-5]\d))$
                      nullable: true
                    timezone:
                      type: string
                      nullable: true
                    durationSeconds:
                      type: number
                      minimum: 0
                      maximum: 86400
                  required:
                    - start
                average:
                  type: number
                averageRange:
                  type: object
                  properties:
                    min:
                      type: number
                    max:
                      type: number
                mode:
                  type: string
                  enum:
                    - organization
                    - patient
                    - patient-auto
                enabled:
                  type: boolean
                relative:
                  type: object
                  properties:
                    enabled:
                      type: boolean
                    min:
                      type: number
                      minimum: 0
                    max:
                      type: number
                      maximum: 1000
                  required:
                    - enabled
                    - min
                    - max
              required:
                - mode
                - enabled
                - relative
            respiratoryRate:
              default:
                mode: organization
                enabled: false
                absolute:
                  enabled: false
                  min: 0
                  max: 0
              type: object
              properties:
                period:
                  default: *a68
                  type: object
                  properties:
                    mode:
                      type: string
                      enum:
                        - organization
                        - patient
                    start:
                      type: string
                      pattern: ^([01]\d|2[0-3]):([0-5]\d:([0-5]\d))$
                    end:
                      type: string
                      pattern: ^([01]\d|2[0-3]):([0-5]\d:([0-5]\d))$
                      nullable: true
                    timezone:
                      type: string
                      nullable: true
                    durationSeconds:
                      type: number
                      minimum: 0
                      maximum: 86400
                  required:
                    - start
                average:
                  type: number
                averageRange:
                  type: object
                  properties:
                    min:
                      type: number
                    max:
                      type: number
                mode:
                  type: string
                  enum:
                    - organization
                    - patient
                    - patient-auto
                enabled:
                  type: boolean
                absolute:
                  type: object
                  properties:
                    enabled:
                      type: boolean
                    min:
                      type: number
                      minimum: 0
                    max:
                      type: number
                      maximum: 1000
                  required:
                    - enabled
                    - min
                    - max
              required:
                - mode
                - enabled
                - absolute
            meanRespiratoryRate:
              default:
                mode: organization
                enabled: false
                relative:
                  enabled: false
                  min: 0
                  max: 0
              type: object
              properties:
                period:
                  default: *a68
                  type: object
                  properties:
                    mode:
                      type: string
                      enum:
                        - organization
                        - patient
                    start:
                      type: string
                      pattern: ^([01]\d|2[0-3]):([0-5]\d:([0-5]\d))$
                    end:
                      type: string
                      pattern: ^([01]\d|2[0-3]):([0-5]\d:([0-5]\d))$
                      nullable: true
                    timezone:
                      type: string
                      nullable: true
                    durationSeconds:
                      type: number
                      minimum: 0
                      maximum: 86400
                  required:
                    - start
                average:
                  type: number
                averageRange:
                  type: object
                  properties:
                    min:
                      type: number
                    max:
                      type: number
                mode:
                  type: string
                  enum:
                    - organization
                    - patient
                    - patient-auto
                enabled:
                  type: boolean
                relative:
                  type: object
                  properties:
                    enabled:
                      type: boolean
                    min:
                      type: number
                      minimum: 0
                    max:
                      type: number
                      maximum: 1000
                  required:
                    - enabled
                    - min
                    - max
              required:
                - mode
                - enabled
                - relative
            durationOfOutOfBed:
              default:
                mode: organization
                enabled: false
                absolute:
                  enabled: false
                  max: 0
              type: object
              properties:
                period:
                  default: *a68
                  type: object
                  properties:
                    mode:
                      type: string
                      enum:
                        - organization
                        - patient
                    start:
                      type: string
                      pattern: ^([01]\d|2[0-3]):([0-5]\d:([0-5]\d))$
                    end:
                      type: string
                      pattern: ^([01]\d|2[0-3]):([0-5]\d:([0-5]\d))$
                      nullable: true
                    timezone:
                      type: string
                      nullable: true
                    durationSeconds:
                      type: number
                      minimum: 0
                      maximum: 86400
                  required:
                    - start
                average:
                  type: number
                averageRange:
                  type: object
                  properties:
                    min:
                      type: number
                    max:
                      type: number
                mode:
                  type: string
                  enum:
                    - organization
                    - patient
                    - patient-auto
                enabled:
                  type: boolean
                absolute:
                  type: object
                  properties:
                    enabled:
                      type: boolean
                    max:
                      type: number
                      maximum: 1000000
                  required:
                    - enabled
                    - max
                relative:
                  type: object
                  properties:
                    enabled:
                      type: boolean
                    max:
                      type: number
                      maximum: 100
                  required:
                    - enabled
                    - max
              required:
                - mode
                - enabled
            sleepDuration:
              default:
                mode: organization
                enabled: false
                absolute:
                  enabled: false
                  min: 0
                  max: 0
              type: object
              properties:
                period:
                  default: *a68
                  type: object
                  properties:
                    mode:
                      type: string
                      enum:
                        - organization
                        - patient
                    start:
                      type: string
                      pattern: ^([01]\d|2[0-3]):([0-5]\d:([0-5]\d))$
                    end:
                      type: string
                      pattern: ^([01]\d|2[0-3]):([0-5]\d:([0-5]\d))$
                      nullable: true
                    timezone:
                      type: string
                      nullable: true
                    durationSeconds:
                      type: number
                      minimum: 0
                      maximum: 86400
                  required:
                    - start
                average:
                  type: number
                averageRange:
                  type: object
                  properties:
                    min:
                      type: number
                    max:
                      type: number
                mode:
                  type: string
                  enum:
                    - organization
                    - patient
                    - patient-auto
                enabled:
                  type: boolean
                absolute:
                  type: object
                  properties:
                    enabled:
                      type: boolean
                    min:
                      type: number
                      minimum: 0
                    max:
                      type: number
                      maximum: 1000
                  required:
                    - enabled
                    - min
                    - max
              required:
                - mode
                - enabled
                - absolute
            numberOfTimesGettingOutOfBed:
              default:
                mode: organization
                enabled: false
                absolute:
                  enabled: false
                  max: 0
              type: object
              properties:
                period:
                  default: *a68
                  type: object
                  properties:
                    mode:
                      type: string
                      enum:
                        - organization
                        - patient
                    start:
                      type: string
                      pattern: ^([01]\d|2[0-3]):([0-5]\d:([0-5]\d))$
                    end:
                      type: string
                      pattern: ^([01]\d|2[0-3]):([0-5]\d:([0-5]\d))$
                      nullable: true
                    timezone:
                      type: string
                      nullable: true
                    durationSeconds:
                      type: number
                      minimum: 0
                      maximum: 86400
                  required:
                    - start
                average:
                  type: number
                averageRange:
                  type: object
                  properties:
                    min:
                      type: number
                    max:
                      type: number
                mode:
                  type: string
                  enum:
                    - organization
                    - patient
                    - patient-auto
                enabled:
                  type: boolean
                absolute:
                  type: object
                  properties:
                    enabled:
                      type: boolean
                    max:
                      type: number
                      maximum: 1000
                  required:
                    - enabled
                    - max
              required:
                - mode
                - enabled
                - absolute
      required:
        - patientId
        - status
        - settings
      example:
        id: "123"
        patientId: patient-123
        date: 2021-01-01T00:00:00.000Z
        settings:
          heartRate:
            mode: patient
            enabled: true
            absolute:
              enabled: true
              min: 60
              max: 100
          respiratoryRate:
            mode: organization
            enabled: false
            absolute:
              enabled: false
              min: 0
              max: 0
    OrgThresholdV2ResponseDto:
      type: object
      properties:
        id:
          type: string
          nullable: true
        projectId:
          type: string
        updatedAt:
          type: string
          nullable: true
        settings:
          type: object
          properties:
            heartRate:
              oneOf:
                - type: object
                  properties:
                    mode:
                      type: string
                      enum:
                        - organization
                        - patient
                    enabled:
                      type: boolean
                    min:
                      type: number
                    max:
                      type: number
                  required:
                    - mode
                    - enabled
                    - min
                    - max
                - type: object
                  properties:
                    mode:
                      type: string
                      enum:
                        - organization
                        - baseline
                    enabled:
                      type: boolean
                    deviationPercent:
                      type: number
                    baselineAverage:
                      type: number
                      nullable: true
                    effectiveBand:
                      type: object
                      properties:
                        min:
                          type: number
                        max:
                          type: number
                      required:
                        - min
                        - max
                      nullable: true
                  required:
                    - mode
                    - enabled
                    - deviationPercent
                    - baselineAverage
                    - effectiveBand
            respiratoryRate:
              oneOf:
                - type: object
                  properties:
                    mode:
                      type: string
                      enum:
                        - organization
                        - patient
                    enabled:
                      type: boolean
                    min:
                      type: number
                    max:
                      type: number
                  required:
                    - mode
                    - enabled
                    - min
                    - max
                - type: object
                  properties:
                    mode:
                      type: string
                      enum:
                        - organization
                        - baseline
                    enabled:
                      type: boolean
                    deviationPercent:
                      type: number
                    baselineAverage:
                      type: number
                      nullable: true
                    effectiveBand:
                      type: object
                      properties:
                        min:
                          type: number
                        max:
                          type: number
                      required:
                        - min
                        - max
                      nullable: true
                  required:
                    - mode
                    - enabled
                    - deviationPercent
                    - baselineAverage
                    - effectiveBand
            outOfBed:
              type: object
              properties:
                mode:
                  type: string
                  enum:
                    - organization
                    - patient
                enabled:
                  type: boolean
                maxDurationSeconds:
                  type: number
              required:
                - mode
                - enabled
                - maxDurationSeconds
            bedTimePeriod:
              type: object
              properties:
                mode:
                  type: string
                  enum:
                    - organization
                    - patient
                start:
                  type: string
                end:
                  type: string
                timezone:
                  type: string
                  nullable: true
              required:
                - mode
                - start
                - end
                - timezone
          required:
            - heartRate
            - respiratoryRate
            - outOfBed
            - bedTimePeriod
      required:
        - id
        - projectId
        - updatedAt
        - settings
      example:
        id: plan-def-uuid
        projectId: project-1
        updatedAt: 2026-07-20T10:00:00.000Z
        settings:
          heartRate:
            mode: organization
            enabled: true
            min: 55
            max: 110
          respiratoryRate:
            mode: baseline
            enabled: true
            deviationPercent: 20
          outOfBed:
            mode: organization
            enabled: true
            maxDurationSeconds: 900
          bedTimePeriod:
            mode: organization
            start: 22:00:00
            end: 06:00:00
            timezone: Europe/Berlin
    OrgThresholdV2BodyDto:
      type: object
      properties:
        settings:
          type: object
          properties:
            heartRate:
              discriminator:
                propertyName: mode
              oneOf:
                - type: object
                  properties:
                    mode:
                      type: string
                      enum:
                        - organization
                    enabled:
                      type: boolean
                    min:
                      type: number
                      minimum: 40
                      maximum: 120
                    max:
                      type: number
                      minimum: 40
                      maximum: 120
                  required:
                    - mode
                    - enabled
                    - min
                    - max
                  additionalProperties: false
                - type: object
                  properties:
                    mode:
                      type: string
                      enum:
                        - baseline
                    enabled:
                      type: boolean
                    deviationPercent:
                      type: integer
                      minimum: 5
                      maximum: 60
                    baselineAverage:
                      type: number
                      nullable: true
                    effectiveBand:
                      type: object
                      properties:
                        min:
                          type: number
                        max:
                          type: number
                      required:
                        - min
                        - max
                      nullable: true
                  required:
                    - mode
                    - enabled
                    - deviationPercent
                  additionalProperties: false
            respiratoryRate:
              discriminator:
                propertyName: mode
              oneOf:
                - type: object
                  properties:
                    mode:
                      type: string
                      enum:
                        - organization
                    enabled:
                      type: boolean
                    min:
                      type: number
                      minimum: 4
                      maximum: 60
                    max:
                      type: number
                      minimum: 4
                      maximum: 60
                  required:
                    - mode
                    - enabled
                    - min
                    - max
                  additionalProperties: false
                - type: object
                  properties:
                    mode:
                      type: string
                      enum:
                        - baseline
                    enabled:
                      type: boolean
                    deviationPercent:
                      type: integer
                      minimum: 5
                      maximum: 60
                    baselineAverage:
                      type: number
                      nullable: true
                    effectiveBand:
                      type: object
                      properties:
                        min:
                          type: number
                        max:
                          type: number
                      required:
                        - min
                        - max
                      nullable: true
                  required:
                    - mode
                    - enabled
                    - deviationPercent
                  additionalProperties: false
            outOfBed:
              type: object
              properties:
                mode:
                  type: string
                  enum:
                    - organization
                enabled:
                  type: boolean
                maxDurationSeconds:
                  type: integer
                  minimum: 0
                  maximum: 86400
              required:
                - mode
                - enabled
                - maxDurationSeconds
              additionalProperties: false
            bedTimePeriod:
              type: object
              properties:
                mode:
                  type: string
                  enum:
                    - organization
                start:
                  type: string
                  pattern: ^([01]\d|2[0-3]):[0-5]\d:[0-5]\d$
                end:
                  type: string
                  pattern: ^([01]\d|2[0-3]):[0-5]\d:[0-5]\d$
                timezone:
                  type: string
                  nullable: true
              required:
                - mode
                - start
                - end
              additionalProperties: false
          required:
            - heartRate
            - respiratoryRate
            - outOfBed
            - bedTimePeriod
      required:
        - settings
      example:
        settings:
          heartRate:
            mode: organization
            enabled: true
            min: 55
            max: 110
          respiratoryRate:
            mode: baseline
            enabled: true
            deviationPercent: 20
          outOfBed:
            mode: organization
            enabled: true
            maxDurationSeconds: 900
          bedTimePeriod:
            mode: organization
            start: 22:00:00
            end: 06:00:00
    PatientThresholdV2ResponseDto:
      type: object
      properties:
        id:
          type: string
          nullable: true
        patientId:
          type: string
        projectId:
          type: string
        updatedAt:
          type: string
          nullable: true
        settings:
          type: object
          properties:
            heartRate:
              oneOf:
                - type: object
                  properties:
                    mode:
                      type: string
                      enum:
                        - organization
                        - patient
                    enabled:
                      type: boolean
                    min:
                      type: number
                    max:
                      type: number
                  required:
                    - mode
                    - enabled
                    - min
                    - max
                - type: object
                  properties:
                    mode:
                      type: string
                      enum:
                        - organization
                        - baseline
                    enabled:
                      type: boolean
                    deviationPercent:
                      type: number
                    baselineAverage:
                      type: number
                      nullable: true
                    effectiveBand:
                      type: object
                      properties:
                        min:
                          type: number
                        max:
                          type: number
                      required:
                        - min
                        - max
                      nullable: true
                  required:
                    - mode
                    - enabled
                    - deviationPercent
                    - baselineAverage
                    - effectiveBand
            respiratoryRate:
              oneOf:
                - type: object
                  properties:
                    mode:
                      type: string
                      enum:
                        - organization
                        - patient
                    enabled:
                      type: boolean
                    min:
                      type: number
                    max:
                      type: number
                  required:
                    - mode
                    - enabled
                    - min
                    - max
                - type: object
                  properties:
                    mode:
                      type: string
                      enum:
                        - organization
                        - baseline
                    enabled:
                      type: boolean
                    deviationPercent:
                      type: number
                    baselineAverage:
                      type: number
                      nullable: true
                    effectiveBand:
                      type: object
                      properties:
                        min:
                          type: number
                        max:
                          type: number
                      required:
                        - min
                        - max
                      nullable: true
                  required:
                    - mode
                    - enabled
                    - deviationPercent
                    - baselineAverage
                    - effectiveBand
            outOfBed:
              type: object
              properties:
                mode:
                  type: string
                  enum:
                    - organization
                    - patient
                enabled:
                  type: boolean
                maxDurationSeconds:
                  type: number
              required:
                - mode
                - enabled
                - maxDurationSeconds
            bedTimePeriod:
              type: object
              properties:
                mode:
                  type: string
                  enum:
                    - organization
                    - patient
                start:
                  type: string
                end:
                  type: string
                timezone:
                  type: string
                  nullable: true
              required:
                - mode
                - start
                - end
                - timezone
          required:
            - heartRate
            - respiratoryRate
            - outOfBed
            - bedTimePeriod
        signalsSync:
          oneOf:
            - type: object
              properties:
                status:
                  type: string
                  enum:
                    - ok
              required:
                - status
            - type: object
              properties:
                status:
                  type: string
                  enum:
                    - pending
                reason:
                  type: string
              required:
                - status
                - reason
          nullable: true
      required:
        - id
        - patientId
        - projectId
        - updatedAt
        - settings
        - signalsSync
      example:
        id: care-plan-uuid
        patientId: patient-123
        projectId: project-1
        updatedAt: 2026-07-20T10:00:00.000Z
        settings:
          heartRate:
            mode: patient
            enabled: true
            min: 60
            max: 100
          respiratoryRate:
            mode: organization
            enabled: true
            min: 12
            max: 20
          outOfBed:
            mode: patient
            enabled: true
            maxDurationSeconds: 1200
          bedTimePeriod:
            mode: organization
            start: 22:00:00
            end: 06:00:00
            timezone: Europe/Berlin
        signalsSync: null
    PatientThresholdV2BodyDto:
      type: object
      properties:
        settings:
          type: object
          properties:
            heartRate:
              discriminator:
                propertyName: mode
              oneOf:
                - type: object
                  properties:
                    mode:
                      type: string
                      enum:
                        - organization
                  required:
                    - mode
                  additionalProperties: false
                - type: object
                  properties:
                    mode:
                      type: string
                      enum:
                        - patient
                    enabled:
                      type: boolean
                    min:
                      type: number
                      minimum: 40
                      maximum: 120
                    max:
                      type: number
                      minimum: 40
                      maximum: 120
                  required:
                    - mode
                    - enabled
                    - min
                    - max
                  additionalProperties: false
                - type: object
                  properties:
                    mode:
                      type: string
                      enum:
                        - baseline
                    enabled:
                      type: boolean
                    deviationPercent:
                      type: integer
                      minimum: 5
                      maximum: 60
                    baselineAverage:
                      type: number
                      nullable: true
                    effectiveBand:
                      type: object
                      properties:
                        min:
                          type: number
                        max:
                          type: number
                      required:
                        - min
                        - max
                      nullable: true
                  required:
                    - mode
                    - enabled
                    - deviationPercent
                  additionalProperties: false
            respiratoryRate:
              discriminator:
                propertyName: mode
              oneOf:
                - type: object
                  properties:
                    mode:
                      type: string
                      enum:
                        - organization
                  required:
                    - mode
                  additionalProperties: false
                - type: object
                  properties:
                    mode:
                      type: string
                      enum:
                        - patient
                    enabled:
                      type: boolean
                    min:
                      type: number
                      minimum: 4
                      maximum: 60
                    max:
                      type: number
                      minimum: 4
                      maximum: 60
                  required:
                    - mode
                    - enabled
                    - min
                    - max
                  additionalProperties: false
                - type: object
                  properties:
                    mode:
                      type: string
                      enum:
                        - baseline
                    enabled:
                      type: boolean
                    deviationPercent:
                      type: integer
                      minimum: 5
                      maximum: 60
                    baselineAverage:
                      type: number
                      nullable: true
                    effectiveBand:
                      type: object
                      properties:
                        min:
                          type: number
                        max:
                          type: number
                      required:
                        - min
                        - max
                      nullable: true
                  required:
                    - mode
                    - enabled
                    - deviationPercent
                  additionalProperties: false
            outOfBed:
              discriminator:
                propertyName: mode
              oneOf:
                - type: object
                  properties:
                    mode:
                      type: string
                      enum:
                        - organization
                  required:
                    - mode
                  additionalProperties: false
                - type: object
                  properties:
                    mode:
                      type: string
                      enum:
                        - patient
                    enabled:
                      type: boolean
                    maxDurationSeconds:
                      type: integer
                      minimum: 0
                      maximum: 86400
                  required:
                    - mode
                    - enabled
                    - maxDurationSeconds
                  additionalProperties: false
            bedTimePeriod:
              discriminator:
                propertyName: mode
              oneOf:
                - type: object
                  properties:
                    mode:
                      type: string
                      enum:
                        - organization
                  required:
                    - mode
                  additionalProperties: false
                - type: object
                  properties:
                    mode:
                      type: string
                      enum:
                        - patient
                    start:
                      type: string
                      pattern: ^([01]\d|2[0-3]):[0-5]\d:[0-5]\d$
                    end:
                      type: string
                      pattern: ^([01]\d|2[0-3]):[0-5]\d:[0-5]\d$
                    timezone:
                      type: string
                      nullable: true
                  required:
                    - mode
                    - start
                    - end
                  additionalProperties: false
          required:
            - heartRate
            - respiratoryRate
            - outOfBed
            - bedTimePeriod
      required:
        - settings
      example:
        settings:
          heartRate:
            mode: patient
            enabled: true
            min: 60
            max: 100
          respiratoryRate:
            mode: organization
          outOfBed:
            mode: patient
            enabled: true
            maxDurationSeconds: 1200
          bedTimePeriod:
            mode: organization
    CarehubChangeHistoryResponseDto:
      type: object
      properties:
        total:
          type: number
          description: Total number of matching rows across all pages.
        page:
          type: number
          description: Zero-based page index returned.
        count:
          type: number
          description: Number of rows returned in this page.
        resources:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
                description: Stable identifier for this audit row — the Medplum Provenance id.
              type:
                type: string
                enum:
                  - Threshold
                  - Location
                  - Zone
                  - Device
                  - Resident
              user:
                type: string
                description: Actor's display name. Empty string if the Provenance has no
                  display.
              residentId:
                type: string
                description: Resident (patient) id affected by the change, or empty when not
                  applicable.
              deviceId:
                type: string
                description: Device id affected by the change, or empty when not applicable.
              time:
                type: string
                format: date-time
                description: ISO timestamp when the change was recorded.
              details:
                type: object
                properties:
                  key:
                    type: string
                  values:
                    type: object
                    additionalProperties:
                      oneOf:
                        - type: string
                        - type: number
                      nullable: true
                required:
                  - key
                description: i18n key + interpolation values. Frontend resolves `key` against
                  its translation catalogue.
            required:
              - id
              - type
              - user
              - residentId
              - deviceId
              - time
              - details
            example:
              id: 88fc0a0a-e653-43c9-aba9-b4eaa47a002f
              type: Threshold
              user: Sarwagya Singh
              residentId: ""
              deviceId: ""
              time: 2026-05-18T11:51:37.195Z
              details:
                key: orgThresholdMetricUpdated
                values:
                  metric: Heart rate
      required:
        - total
        - page
        - count
        - resources
      example:
        total: 0
        page: 0
        count: 50
        resources: []
    CarehubQueryResponseDto:
      type: object
      properties:
        total:
          type: number
        resources:
          type: array
          items: {}
      required:
        - total
        - resources
      example:
        total: 25
        resources:
          - device:
              resourceType: Device
              id: a5a74a6d-f092-78b8-8cb6-ea23b7d7f257
              deviceName:
                - type: user-friendly-name
                  name: "Patient Monitor #ugs2LsGM2e"
            patient:
              resourceType: Patient
              id: de5c57ff-7257-57b0-13ab-aab6f5f91498
              name:
                - given:
                    - Max
                  family: Mustermann
            location:
              resourceType: Location
              id: d219c681-01f5-32de-10ad-d2cf42fb9dbe
              name: Room 201
            organization:
              resourceType: Organization
              id: 519255ae-1f74-ffc5-ddd2-9979295c7572
              name: My Medical Project
    CarehubQueryTelemetryResponseDto:
      type: object
      properties:
        telemetry:
          type: object
          additionalProperties: {}
        alerts:
          type: object
          additionalProperties: {}
      required:
        - telemetry
        - alerts
      example:
        telemetry:
          11111111-1111-4111-8111-111111111111:
            effectiveHeartRate:
              value: 61
              ts: 1710843420000
        alerts:
          11111111-1111-4111-8111-111111111111:
            heartRate:
              alert: false
              state: normal
              color: null
    CarehubOrganizationCountResponseDto:
      type: object
      properties:
        total:
          type: number
        totalDeviceCount:
          type: number
        totalAssignedResidentDeviceCount:
          type: number
        totalActiveDeviceCount:
          type: number
        totalInactiveDeviceCount:
          type: number
        resources:
          type: array
          items:
            type: object
            properties:
              organization:
                type: object
                properties:
                  resourceType:
                    type: string
                    enum:
                      - Organization
                  id:
                    type: string
                  name:
                    type: string
                  meta:
                    type: object
                    properties:
                      project:
                        type: string
                      lastUpdated:
                        type: string
                required:
                  - resourceType
                  - id
                  - name
              deviceCount:
                type: number
              assignedResidentDeviceCount:
                type: number
              activeDeviceCount:
                type: number
              inactiveDeviceCount:
                type: number
            required:
              - deviceCount
              - assignedResidentDeviceCount
              - activeDeviceCount
              - inactiveDeviceCount
      required:
        - total
        - totalDeviceCount
        - totalAssignedResidentDeviceCount
        - totalActiveDeviceCount
        - totalInactiveDeviceCount
        - resources
      example:
        total: 2
        totalDeviceCount: 18
        totalAssignedResidentDeviceCount: 18
        totalActiveDeviceCount: 16
        totalInactiveDeviceCount: 2
        resources:
          - organization:
              resourceType: Organization
              id: 519255ae-1f74-ffc5-ddd2-9979295c7572
              name: My Medical Project
              meta:
                project: f6f4da8d-93e8-8a08-220e-03b7810451d3
                lastUpdated: 2026-08-16T17:06:17.445Z
            deviceCount: 12
            assignedResidentDeviceCount: 12
            activeDeviceCount: 11
            inactiveDeviceCount: 1
          - organization:
              resourceType: Organization
              id: fa48d626-f96b-dbe0-056b-48a353dbd2ed
              name: My Medical Project - Branch
              meta:
                project: f6f4da8d-93e8-8a08-220e-03b7810451d3
                lastUpdated: 2026-08-16T17:06:17.445Z
            deviceCount: 6
            assignedResidentDeviceCount: 6
            activeDeviceCount: 5
            inactiveDeviceCount: 1
    CarehubUserQueryResponseDto:
      type: object
      properties:
        total:
          type: number
        resources:
          type: array
          items:
            type: object
            properties:
              user:
                type: object
                properties:
                  resourceType:
                    type: string
                    enum:
                      - User
                  id:
                    type: string
                  firstName:
                    type: string
                  lastName:
                    type: string
                  email:
                    type: string
                    format: email
                  project:
                    type: string
                  meta:
                    type: object
                    properties:
                      project:
                        type: string
                      lastUpdated:
                        type: string
                required:
                  - resourceType
                  - id
                  - email
              profile:
                type: object
                properties:
                  resourceType:
                    type: string
                    enum:
                      - Practitioner
                  id:
                    type: string
                  name:
                    type: array
                    items: {}
                  meta:
                    type: object
                    properties:
                      project:
                        type: string
                      lastUpdated:
                        type: string
                required:
                  - resourceType
                  - id
              membership:
                type: object
                properties:
                  resourceType:
                    type: string
                    enum:
                      - ProjectMembership
                  id:
                    type: string
                  project:
                    type: string
                  user:
                    type: object
                    properties:
                      reference:
                        type: string
                    required:
                      - reference
                  profile:
                    type: object
                    properties:
                      reference:
                        type: string
                    required:
                      - reference
                  accessPolicy:
                    type: object
                    properties:
                      reference:
                        type: string
                    required:
                      - reference
                  meta:
                    type: object
                    properties:
                      project:
                        type: string
                      lastUpdated:
                        type: string
                required:
                  - resourceType
                  - id
              status:
                type: string
                enum:
                  - Active
                  - Pending
              accessPolicy:
                type: object
                properties:
                  resourceType:
                    type: string
                    enum:
                      - AccessPolicy
                  id:
                    type: string
                  name:
                    type: string
                  resource:
                    type: array
                    items:
                      type: string
                  meta:
                    type: object
                    properties:
                      project:
                        type: string
                      lastUpdated:
                        type: string
                required:
                  - resourceType
                  - id
                  - name
            required:
              - user
              - profile
              - membership
              - status
      required:
        - total
        - resources
      example:
        total: 1
        resources:
          - user:
              resourceType: User
              id: 9f8a2389-a20c-a075-2aa9-e95093515517
              firstName: Max
              lastName: Mustermann
              email: max.mustermann@example.com
              project: f6f4da8d-93e8-8a08-220e-03b7810451d3
              meta:
                project: f6f4da8d-93e8-8a08-220e-03b7810451d3
                lastUpdated: 2026-08-16T17:06:17.445Z
            profile:
              resourceType: Practitioner
              id: cd495e76-8385-ecb1-00a6-7e0381de4e42
              name:
                - given:
                    - Max
                  family: Mustermann
              meta:
                project: f6f4da8d-93e8-8a08-220e-03b7810451d3
                lastUpdated: 2026-08-16T17:06:17.445Z
            membership:
              resourceType: ProjectMembership
              id: d7f418aa-467d-d1ea-f0fc-d2dd841733e6
              project: f6f4da8d-93e8-8a08-220e-03b7810451d3
              user:
                reference: User/9f8a2389-a20c-a075-2aa9-e95093515517
              profile:
                reference: Practitioner/cd495e76-8385-ecb1-00a6-7e0381de4e42
              accessPolicy:
                reference: AccessPolicy/cca28116-f888-97bf-c336-5b992bd02672
              meta:
                project: f6f4da8d-93e8-8a08-220e-03b7810451d3
                lastUpdated: 2026-08-16T17:06:17.445Z
            status: Active
            accessPolicy:
              resourceType: AccessPolicy
              id: cca28116-f888-97bf-c336-5b992bd02672
              name: Practitioner Access Policy
              resource:
                - Patient
                - Device
              meta:
                project: f6f4da8d-93e8-8a08-220e-03b7810451d3
                lastUpdated: 2026-08-16T17:06:17.445Z
    SignalsAlertDto:
      type: object
      properties:
        _id:
          type: string
          description: The id of the alert (mongo-style; some producers send `id`).
        id:
          type: string
          description: The id of the alert (arctic-flattened alias for `_id`).
        event:
          type: string
          description: The reason of the alert.
        patient:
          type: string
          description: The patient of the alert.
        observation:
          type: string
          description: The observation of the alert.
        observationRefId:
          type: string
          description: The observation ref id of the alert.
        observationObservedAt:
          type: string
          format: date-time
          description: The observation observed at of the alert.
        observationDevice:
          type: object
          properties:
            reference:
              type: string
              description: The reference of the device.
            display:
              type: string
              description: The display of the device.
          required:
            - reference
        observationEffectivePeriod:
          type: object
          properties:
            start:
              type: string
              format: date-time
              description: The observation effective period start of the alert.
            end:
              type: string
              format: date-time
              description: The observation effective period end of the alert.
          description: The observation effective period of the alert.
        component:
          type: object
          properties:
            code:
              type: object
              properties:
                coding:
                  type: array
                  items:
                    type: object
                    properties:
                      code:
                        type: string
                        description: The code of the code.
                      system:
                        type: string
                        description: The system of the code.
                      display:
                        type: string
                        description: The display of the code.
                      version:
                        type: string
                        description: The version of the code.
                      userSelected:
                        type: boolean
                        description: Whether the code is user selected.
                    required:
                      - code
              required:
                - coding
            valueInteger:
              type: integer
              description: The value of the observation.
            valueQuantity:
              type: object
              properties:
                value:
                  type: number
                  description: The value of the observation.
                unit:
                  type: string
                  description: The unit of the observation.
              required:
                - value
            valueString:
              type: string
              description: The value of the observation.
            valueBoolean:
              type: boolean
              description: The value of the observation.
            valueDateTime:
              type: string
              format: date-time
              description: The value of the observation.
            dataAbsentReason:
              type: string
              description: The data absent reason of the observation.
          required:
            - code
          description: The component of the alert.
        trigger:
          type: object
          properties:
            code:
              type: string
              description: The code of the trigger.
            display:
              type: string
              description: The display of the trigger.
            valueKey:
              type: string
              description: The value key of the trigger.
            logic:
              description: The logic of the trigger.
          description: The trigger of the alert.
        value:
          description: The value of the alert.
        message:
          description: The message of the alert.
        createdAt:
          type: string
          format: date-time
          description: The created at of the alert.
        updatedAt:
          type: string
          format: date-time
          description: The updated at of the alert.
        resolved:
          type: boolean
          description: True when this webhook is fanning out a resolve, not a create.
        resolvedAt:
          type: string
          format: date-time
          description: When the alert was resolved (ISO 8601).
        effectiveTS:
          type: string
          description: Effective timestamp of the observation behind this specific
            delivery (ISO 8601).
        refire:
          type: boolean
          description: True when this re-announces an already-active alert (no lifecycle
            transition occurred).
      required:
        - event
        - patient
        - component
    SignalsProjectConfigResponseDto:
      type: object
      properties:
        baseUrl:
          type: string
          nullable: true
        tenantId:
          type: string
          nullable: true
        submitterId:
          type: string
          nullable: true
        managerId:
          type: string
          nullable: true
        subscriberId:
          type: string
          nullable: true
        ovokSubscriberId:
          type: string
          nullable: true
        events:
          type: array
          items:
            type: string
          nullable: true
        hasWebhookSecret:
          type: boolean
        source:
          type: string
          enum:
            - project
            - global
      required:
        - baseUrl
        - tenantId
        - submitterId
        - managerId
        - subscriberId
        - ovokSubscriberId
        - events
        - hasWebhookSecret
        - source
    ProvisionSignalsProjectRequestDto:
      type: object
      properties:
        baseUrl:
          type: string
          minLength: 1
          maxLength: 2048
        tenantId:
          type: string
          minLength: 1
          maxLength: 256
        submitterId:
          type: string
          minLength: 1
          maxLength: 256
        managerId:
          type: string
          minLength: 1
          maxLength: 256
        subscriberId:
          type: string
          minLength: 1
          maxLength: 256
        events:
          type: array
          items:
            type: string
            minLength: 1
            maxLength: 128
          maxItems: 64
          nullable: true
      required:
        - baseUrl
        - tenantId
        - submitterId
        - managerId
        - subscriberId
        - events
    ProvisionSignalsProjectResponseDto:
      type: object
      properties:
        subscriberId:
          type: string
        webhookSecret:
          type: string
      required:
        - subscriberId
        - webhookSecret
    RotateWebhookSecretResponseDto:
      type: object
      properties:
        webhookSecret:
          type: string
      required:
        - webhookSecret
    TestConnectionResponseDto:
      type: object
      properties:
        ok:
          type: boolean
        authOk:
          type: boolean
        subscriberOk:
          type: boolean
        source:
          type: string
          enum:
            - project
            - global
      required:
        - ok
        - authOk
        - subscriberOk
        - source
    BatchPatientsConfigDto:
      type: object
      properties: {}
    MedicalSettingsNotificationsConsentResponseDto:
      type: object
      properties:
        medicalSettingsNotificationsConsent:
          type: boolean
        termsAndConditionsConsent:
          type: boolean
      required:
        - medicalSettingsNotificationsConsent
        - termsAndConditionsConsent
      example:
        medicalSettingsNotificationsConsent: true
        termsAndConditionsConsent: true
    MedicalSettingsNotificationsConsentDto:
      type: object
      properties:
        medicalSettingsNotificationsConsent:
          type: boolean
        termsAndConditionsConsent:
          type: boolean
      example:
        medicalSettingsNotificationsConsent: true
        termsAndConditionsConsent: true
    SupportEmailRequestDto:
      type: object
      properties:
        message:
          type: string
          minLength: 1
        version:
          type: string
          minLength: 1
        environment:
          type: string
          minLength: 1
      required:
        - message
        - version
        - environment
    CarehubUserDeleteResponseDto:
      type: object
      properties:
        success:
          type: boolean
      required:
        - success
      example:
        success: true
    BinaryDto:
      type: object
      properties:
        file:
          type: string
          format: binary
          description: File to upload.
      required:
        - file
    IdentifierDto:
      type: object
      properties:
        system:
          type: string
          example: www.example.com
          description: Namespace (URL) of the identifier value.
        value:
          type: string
          example: externalId
          description: Identifier value.
    DocumentReferenceMetaDto:
      type: object
      properties:
        versionId:
          type: string
          description: The version ID of the document reference.
        publicResourceToken:
          type: string
          description: The public resource token of the document reference.
    AttachmentDto:
      type: object
      properties:
        contentType:
          type: string
          example: image/jpeg
          description: Mime type.
        url:
          type: string
          example: www.example.com
          description: URL pointing to the file location.
        title:
          type: string
          example: my_image.jpeg
          description: Name of the file.
      required:
        - contentType
        - url
    DocumentReferenceSubjectDto:
      type: object
      properties:
        type:
          type: string
          enum:
            - Patient
            - Practitioner
            - Group
            - Device
          description: Type of subject.
        id:
          type: string
          example: 12345-12345-12345
          description: ID of subject.
      required:
        - id
    DocumentReferenceAuthorDto:
      type: object
      properties:
        type:
          type: string
          enum:
            - Practitioner
            - PractitionerRole
            - Organization
            - Device
            - Patient
            - RelatedPerson
          description: Type of author.
        id:
          type: string
          example: 12345-12345-12345
          description: ID of author.
      required:
        - type
        - id
    DocumentReferenceEncounterDto:
      type: object
      properties:
        type:
          type: string
          enum:
            - Encounter
            - EpisodeOfCare
          description: Type of encounter.
        id:
          type: string
          example: 12345-12345-12345
          description: ID of encounter.
      required:
        - type
        - id
    PeriodDto:
      type: object
      properties:
        start:
          type: string
          format: date-time
          example: 2000-01-30T23:59:59Z
          description: Start date.
        end:
          type: string
          format: date-time
          example: 2000-01-30T23:59:59Z
          description: End date.
    ReferenceDto:
      type: object
      properties:
        type:
          type: string
          enum:
            - Account
            - ActivityDefinition
            - ActorDefinition
            - AdministrableProductDefinition
            - AdverseEvent
            - AllergyIntolerance
            - Appointment
            - AppointmentResponse
            - ArtifactAssessment
            - AuditEvent
            - Basic
            - Binary
            - BiologicallyDerivedProduct
            - BiologicallyDerivedProductDispense
            - BodyStructure
            - Bundle
            - CapabilityStatement
            - CarePlan
            - CareTeam
            - ChargeItem
            - ChargeItemDefinition
            - Citation
            - Claim
            - ClaimResponse
            - ClientApplication
            - ClinicalImpression
            - ClinicalUseDefinition
            - CodeSystem
            - Communication
            - CommunicationRequest
            - CompartmentDefinition
            - Composition
            - ConceptMap
            - Condition
            - ConditionDefinition
            - Consent
            - Contract
            - Coverage
            - CoverageEligibilityRequest
            - CoverageEligibilityResponse
            - DetectedIssue
            - Device
            - DeviceAssociation
            - DeviceDefinition
            - DeviceDispense
            - DeviceMetric
            - DeviceRequest
            - DeviceUsage
            - DiagnosticReport
            - DocumentReference
            - Encounter
            - EncounterHistory
            - Endpoint
            - EnrollmentRequest
            - EnrollmentResponse
            - EpisodeOfCare
            - EventDefinition
            - Evidence
            - EvidenceReport
            - EvidenceVariable
            - ExampleScenario
            - ExplanationOfBenefit
            - FamilyMemberHistory
            - Flag
            - FormularyItem
            - GenomicStudy
            - Goal
            - GraphDefinition
            - Group
            - GuidanceResponse
            - HealthcareService
            - ImagingSelection
            - ImagingStudy
            - Immunization
            - ImmunizationEvaluation
            - ImmunizationRecommendation
            - ImplementationGuide
            - Ingredient
            - InsurancePlan
            - InventoryItem
            - InventoryReport
            - Invoice
            - Library
            - Linkage
            - List
            - Location
            - ManufacturedItemDefinition
            - Measure
            - MeasureReport
            - Media
            - Medication
            - MedicationAdministration
            - MedicationDispense
            - MedicationKnowledge
            - MedicationRequest
            - MedicationStatement
            - MedicinalProductDefinition
            - MessageDefinition
            - MessageHeader
            - MolecularSequence
            - NamingSystem
            - NutritionIntake
            - NutritionOrder
            - NutritionProduct
            - Observation
            - ObservationDefinition
            - OperationDefinition
            - OperationOutcome
            - Organization
            - OrganizationAffiliation
            - PackagedProductDefinition
            - Parameters
            - Patient
            - PaymentNotice
            - PaymentReconciliation
            - Permission
            - Person
            - PlanDefinition
            - Practitioner
            - PractitionerRole
            - Procedure
            - ProjectMembership
            - Provenance
            - Questionnaire
            - QuestionnaireResponse
            - RegulatedAuthorization
            - RelatedPerson
            - RequestGroup
            - RequestOrchestration
            - Requirements
            - ResearchStudy
            - ResearchSubject
            - RiskAssessment
            - Schedule
            - SearchParameter
            - ServiceRequest
            - Slot
            - Specimen
            - SpecimenDefinition
            - StructureDefinition
            - StructureMap
            - Subscription
            - SubscriptionStatus
            - SubscriptionTopic
            - Substance
            - SubstanceDefinition
            - SubstanceNucleicAcid
            - SubstancePolymer
            - SubstanceProtein
            - SubstanceReferenceInformation
            - SubstanceSourceMaterial
            - SupplyDelivery
            - SupplyRequest
            - Task
            - TerminologyCapabilities
            - TestPlan
            - TestReport
            - TestScript
            - Transport
            - User
            - ValueSet
            - VerificationResult
            - VisionPrescription
          description: Type of reference.
        id:
          type: string
          example: 12345-12345-12345
          description: ID of reference.
        display:
          type: string
          example: abc123
          description: Alternative text of reference.
    DocumentReferenceContextDto:
      type: object
      properties:
        encounter:
          description: Encounter context of the document.
          type: array
          items:
            $ref: "#/components/schemas/DocumentReferenceEncounterDto"
        period:
          description: Time period being documented.
          allOf:
            - $ref: "#/components/schemas/PeriodDto"
        related:
          description: Resource/s that the document reference is related to.
          type: array
          items:
            $ref: "#/components/schemas/ReferenceDto"
    DocumentReferenceDto:
      type: object
      properties:
        identifier:
          description: Additional identifier/s for the resource.
          type: array
          items:
            $ref: "#/components/schemas/IdentifierDto"
        meta:
          description: The meta information of the document reference.
          allOf:
            - $ref: "#/components/schemas/DocumentReferenceMetaDto"
        status:
          type: string
          enum: &a86
            - current
            - superseded
            - entered-in-error
          description: The status of the document reference.
        content:
          description: Attachment data.
          type: array
          items:
            $ref: "#/components/schemas/AttachmentDto"
        type:
          type: string
          example: 11111-1
          description: Type of the document reference.
        category:
          example: &a87
            - imagingreport
          description: A category assigned to the document reference.
          type: array
          items:
            type: string
        subject:
          description: Subject of the document.
          allOf:
            - $ref: "#/components/schemas/DocumentReferenceSubjectDto"
        date:
          type: string
          format: date-time
          example: 2000-01-30T23:59:59Z
          description: Creation date of the document.
        author:
          description: Author of the document.
          type: array
          items:
            $ref: "#/components/schemas/DocumentReferenceAuthorDto"
        custodian:
          type: string
          example: 12345-12345-12345
          description: Organisation that maintains the document.
        context:
          description: Context of the document.
          allOf:
            - $ref: "#/components/schemas/DocumentReferenceContextDto"
        resourceType:
          type: string
          example: DocumentReference
          description: DocumentReference resource type.
          enum:
            - DocumentReference
        id:
          type: string
          example: 12345-12345-12345
          description: DocumentReference resource ID.
      required:
        - status
        - content
        - resourceType
        - id
    BinariesDto:
      type: object
      properties:
        files:
          description: Files to upload.
          type: array
          items:
            type: string
            format: binary
      required:
        - files
    ResponseDocumentReferenceDto:
      type: object
      properties:
        data:
          description: List of DocumentReference resources
          type: array
          items:
            $ref: "#/components/schemas/DocumentReferenceDto"
            format: array
        total:
          type: number
          example: 50
          format: number
          description: The total amount of resources.
      required:
        - data
        - total
    StreamableFile:
      type: object
      properties: {}
    PostFileUploadDto:
      type: object
      properties:
        fileName:
          type: string
          minLength: 1
          description: The name of the file.
        contentType:
          description: The MIME type of the file.
          type: string
        isPublic:
          description: Whether the file is public. If true file will be publicly
            accessable with the token defined in the DocumentReference.extension
          default: "false"
          type: string
          enum:
            - "true"
            - "false"
      required:
        - fileName
        - contentType
      example:
        fileName: my-image.png
        contentType: image/png
        isPublic: false
    FileEntryDto:
      type: object
      properties:
        id:
          type: string
          description: The ID of the DocumentReference resource.
        meta:
          type: object
          properties:
            lastUpdated:
              type: string
              description: The last updated date of the document.
          required:
            - lastUpdated
          description: The metadata of the document.
        author:
          type: object
          properties:
            reference:
              type: string
              description: The reference of the author.
            display:
              type: string
              description: The display name of the author.
          description: The author of the document.
        fileName:
          type: string
          description: The name of the document.
        contentType:
          type: string
          description: The content type of the document.
        uploadOptions:
          type: object
          properties:
            url:
              type: string
              description: The upload URL of the document.
            fields:
              type: object
              additionalProperties:
                type: string
              description: The fields of the document.
          required:
            - url
            - fields
          description: The upload options of the document.
        publicToken:
          type: string
          description: The public token of the document.
      required:
        - id
      example: &a69
        id: 87ea5dfc-8b8e-384d-8489-79496e706390
        fileName: test.txt
        contentType: text/plain
        publicToken: example.jwt.eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3ODY4OTk5NzcsImV4cCI6MTc4NjkwMzU3N30.sZTke9fx_gPeoj2v-FL9GhDqY0hh9EzdEc4XywFqb84
        uploadOptions:
          url: https://example.com/upload
          fields:
            key: value
    GetSearchFilesResponseDto:
      type: object
      properties:
        total:
          type: number
          description: Total number of documents in the system.
        resources:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
                description: The ID of the DocumentReference resource.
              meta:
                type: object
                properties:
                  lastUpdated:
                    type: string
                    description: The last updated date of the document.
                required:
                  - lastUpdated
                description: The metadata of the document.
              author:
                type: object
                properties:
                  reference:
                    type: string
                    description: The reference of the author.
                  display:
                    type: string
                    description: The display name of the author.
                description: The author of the document.
              fileName:
                type: string
                description: The name of the document.
              contentType:
                type: string
                description: The content type of the document.
              uploadOptions:
                type: object
                properties:
                  url:
                    type: string
                    description: The upload URL of the document.
                  fields:
                    type: object
                    additionalProperties:
                      type: string
                    description: The fields of the document.
                required:
                  - url
                  - fields
                description: The upload options of the document.
              publicToken:
                type: string
                description: The public token of the document.
            required:
              - id
            example: *a69
      required:
        - total
        - resources
      example:
        total: 100
        resources:
          - id: 87ea5dfc-8b8e-384d-8489-79496e706390
            fileName: test.txt
            contentType: text/plain
            publicToken: example.jwt.eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3ODY4OTk5NzcsImV4cCI6MTc4NjkwMzU3N30.sZTke9fx_gPeoj2v-FL9GhDqY0hh9EzdEc4XywFqb84
    UpdateDocumentMetadataDto:
      type: object
      properties:
        fileName:
          type: string
          minLength: 1
          description: The new name of the file.
        isPublic:
          type: boolean
          description: Whether the file should be public or private.
        contentType:
          description: The MIME type of the file.
          type: string
      example:
        fileName: updated-image.png
        isPublic: false
    ReplaceDocumentFileDto:
      type: object
      properties:
        fileName:
          type: string
          minLength: 1
          description: The filename of the resource to be saved with.
        contentType:
          description: The MIME type of the file.
          type: string
        isPublic:
          type: boolean
          description: Whether the file should be public or private.
      required:
        - fileName
        - contentType
      example:
        fileName: new-cat.png
        contentType: image/png
    BillingSubscriptionDto:
      discriminator:
        propertyName: mode
      oneOf:
        - type: object
          properties:
            mode:
              type: string
              enum:
                - internal
          required:
            - mode
        - type: object
          properties:
            mode:
              type: string
              enum:
                - stripe
            id:
              type: string
              nullable: true
            status:
              type: string
              nullable: true
            currentPeriodStart:
              type: string
              nullable: true
            currentPeriodEnd:
              type: string
              nullable: true
            trialEnd:
              type: string
              nullable: true
            cancelAtPeriodEnd:
              type: boolean
              nullable: true
            items:
              type: array
              items:
                type: object
                properties:
                  id:
                    type: string
                  priceId:
                    type: string
                  productId:
                    type: string
                  productName:
                    type: string
                    nullable: true
                  amount:
                    type: number
                    nullable: true
                  currency:
                    type: string
                    nullable: true
                  interval:
                    type: string
                    nullable: true
                  quantity:
                    type: number
                    nullable: true
                required:
                  - id
                  - priceId
                  - productId
                  - productName
                  - amount
                  - currency
                  - interval
                  - quantity
          required:
            - mode
            - id
            - status
            - currentPeriodStart
            - currentPeriodEnd
            - trialEnd
            - cancelAtPeriodEnd
            - items
      description: "Current Stripe subscription for the caller's project. When
        STRIPE_API_KEY is unset the response is { mode: \"internal\" }; when
        Stripe is configured but no customer/subscription exists the response is
        the empty stripe-mode shape (id=null, items=[])."
    BillingInvoiceListResponseDto:
      discriminator:
        propertyName: mode
      oneOf:
        - type: object
          properties:
            mode:
              type: string
              enum:
                - internal
            hasMore:
              type: boolean
              enum:
                - false
            data:
              type: array
              items:
                readOnly: true
              minItems: 0
              maxItems: 0
          required:
            - mode
            - hasMore
            - data
        - type: object
          properties:
            mode:
              type: string
              enum:
                - stripe
            hasMore:
              type: boolean
            data:
              type: array
              items:
                type: object
                properties:
                  id:
                    type: string
                  number:
                    type: string
                    nullable: true
                  status:
                    type: string
                    nullable: true
                  amountDue:
                    type: number
                  amountPaid:
                    type: number
                  currency:
                    type: string
                  createdAt:
                    type: string
                  periodStart:
                    type: string
                    nullable: true
                  periodEnd:
                    type: string
                    nullable: true
                  hostedInvoiceUrl:
                    type: string
                    nullable: true
                  invoicePdf:
                    type: string
                    nullable: true
                required:
                  - id
                  - number
                  - status
                  - amountDue
                  - amountPaid
                  - currency
                  - createdAt
                  - periodStart
                  - periodEnd
                  - hostedInvoiceUrl
                  - invoicePdf
          required:
            - mode
            - hasMore
            - data
      description: 'Paginated invoice list. When STRIPE_API_KEY is unset or no Stripe
        customer is attached to the project, returns { mode: "internal",
        hasMore: false, data: [] }.'
    BillingPaymentMethodListDto:
      type: array
      items:
        type: object
        properties:
          id:
            type: string
          brand:
            type: string
            nullable: true
          last4:
            type: string
            nullable: true
          expMonth:
            type: number
            nullable: true
          expYear:
            type: number
            nullable: true
          isDefault:
            type: boolean
        required:
          - id
          - brand
          - last4
          - expMonth
          - expYear
          - isDefault
      description: Card payment methods on file for the caller's Stripe customer.
        Empty array when STRIPE_API_KEY is unset or the project has no Stripe
        customer id yet.
    TierStateResponseDto:
      type: object
      properties:
        tiers:
          type: array
          items:
            type: object
            properties:
              name:
                type: string
                enum:
                  - free
                  - startup
                  - growth
                  - enterprise
              label:
                type: string
              description:
                type: string
              monthlyIncludedRequests:
                type: number
              hardCap:
                type: boolean
              selfServe:
                type: boolean
              displayFlatFee:
                type: string
              displayOverage:
                type: string
            required:
              - name
              - label
              - description
              - monthlyIncludedRequests
              - hardCap
              - selfServe
              - displayFlatFee
              - displayOverage
        mode:
          type: string
          enum:
            - stripe
            - internal
        currentTier:
          type: string
          enum:
            - free
            - startup
            - growth
            - enterprise
          nullable: true
        currentUsage:
          type: number
      required:
        - tiers
        - mode
        - currentTier
        - currentUsage
      description: The tier catalog (static, not Stripe-derived) plus the caller's
        current tier (derived from the active subscription's product id) and
        current usage. `mode` is `stripe` iff STRIPE_API_KEY is set.
    AttachPlanRequestDto:
      type: object
      properties:
        tier:
          type: string
          enum:
            - free
            - startup
            - growth
            - enterprise
      required:
        - tier
      description: Attach a plan to the caller's project. Non-free tiers create or
        update the caller's Stripe subscription; the `free` tier cancels the
        existing subscription at period end.
    AttachPlanResponseDto:
      type: object
      properties:
        subscription:
          discriminator:
            propertyName: mode
          oneOf:
            - type: object
              properties:
                mode:
                  type: string
                  enum:
                    - internal
              required:
                - mode
            - type: object
              properties:
                mode:
                  type: string
                  enum:
                    - stripe
                id:
                  type: string
                  nullable: true
                status:
                  type: string
                  nullable: true
                currentPeriodStart:
                  type: string
                  nullable: true
                currentPeriodEnd:
                  type: string
                  nullable: true
                trialEnd:
                  type: string
                  nullable: true
                cancelAtPeriodEnd:
                  type: boolean
                  nullable: true
                items:
                  type: array
                  items:
                    type: object
                    properties:
                      id:
                        type: string
                      priceId:
                        type: string
                      productId:
                        type: string
                      productName:
                        type: string
                        nullable: true
                      amount:
                        type: number
                        nullable: true
                      currency:
                        type: string
                        nullable: true
                      interval:
                        type: string
                        nullable: true
                      quantity:
                        type: number
                        nullable: true
                    required:
                      - id
                      - priceId
                      - productId
                      - productName
                      - amount
                      - currency
                      - interval
                      - quantity
              required:
                - mode
                - id
                - status
                - currentPeriodStart
                - currentPeriodEnd
                - trialEnd
                - cancelAtPeriodEnd
                - items
          description: "Current Stripe subscription for the caller's project. When
            STRIPE_API_KEY is unset the response is { mode: \"internal\" }; when
            Stripe is configured but no customer/subscription exists the
            response is the empty stripe-mode shape (id=null, items=[])."
          nullable: true
      required:
        - subscription
      description: The subscription after the plan change, or `null` when the caller
        had no subscription and requested the free tier (no-op).
    PortalSessionRequestDto:
      type: object
      properties:
        returnUrl:
          type: string
          format: uri
      description: Create a Stripe Billing Portal session. When `returnUrl` is omitted
        the server picks a default (landing-page origin + /billing, or a
        hard-coded fallback).
    PortalSessionResponseDto:
      type: object
      properties:
        url:
          type: string
          format: uri
      required:
        - url
    CarehubPatientListResponseDto:
      type: object
      properties:
        total:
          type: number
          minimum: 0
        page:
          type: number
          minimum: 0
        count:
          type: number
          minimum: 1
        resources:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
              name:
                type: string
              nickname:
                type: string
                nullable: true
              residentState:
                type: string
                enum:
                  - active
                  - discharged-recent
                  - discharged
                  - archived
              admissionDate:
                type: string
                nullable: true
              dischargeDate:
                type: string
                nullable: true
              organizationId:
                type: string
                nullable: true
              organizationName:
                type: string
                nullable: true
              locationId:
                type: string
                nullable: true
              locationName:
                type: string
                nullable: true
              deviceId:
                type: string
                nullable: true
              deviceName:
                type: string
                nullable: true
            required:
              - id
              - name
              - nickname
              - residentState
              - admissionDate
              - dischargeDate
              - organizationId
              - organizationName
              - locationId
              - locationName
              - deviceId
              - deviceName
            example:
              id: de5c57ff-7257-57b0-13ab-aab6f5f91498
              name: Maxi
              nickname: Maxi
              residentState: active
              admissionDate: 2026-08-16T17:06:17.445Z
              dischargeDate: null
              organizationId: 519255ae-1f74-ffc5-ddd2-9979295c7572
              organizationName: My Medical Project
              locationId: d219c681-01f5-32de-10ad-d2cf42fb9dbe
              locationName: Room 201 Bed 1
              deviceId: a5a74a6d-f092-78b8-8cb6-ea23b7d7f257
              deviceName: Sleepiz/3001472
      required:
        - total
        - page
        - count
        - resources
      example:
        total: 1
        page: 0
        count: 20
        resources:
          - id: de5c57ff-7257-57b0-13ab-aab6f5f91498
            name: Maxi
            nickname: Maxi
            residentState: active
            admissionDate: 2026-08-16T17:06:17.445Z
            dischargeDate: null
            organizationId: 519255ae-1f74-ffc5-ddd2-9979295c7572
            organizationName: My Medical Project
            locationId: d219c681-01f5-32de-10ad-d2cf42fb9dbe
            locationName: Room 201 Bed 1
            deviceId: a5a74a6d-f092-78b8-8cb6-ea23b7d7f257
            deviceName: Sleepiz/3001472
    CarehubPatientCurrentVitalsResponseDto:
      type: object
      properties:
        total:
          type: number
          minimum: 0
        resources:
          type: array
          items:
            type: object
            properties:
              device:
                type: object
                properties:
                  id:
                    type: string
                  name:
                    type: string
                required:
                  - id
                  - name
              patient:
                type: object
                properties:
                  id:
                    type: string
                  name:
                    type: string
                  nickname:
                    type: string
                    nullable: true
                required:
                  - id
                  - name
              organization:
                type: object
                properties:
                  id:
                    type: string
                  name:
                    type: string
                required:
                  - id
                  - name
              telemetry:
                type: object
                properties:
                  active:
                    type: object
                    properties:
                      value:
                        oneOf:
                          - type: string
                          - type: number
                          - type: boolean
                        nullable: true
                      ts:
                        type: number
                        nullable: true
                    required:
                      - value
                      - ts
                  effectiveHeartRate:
                    type: object
                    properties:
                      value:
                        oneOf:
                          - type: string
                          - type: number
                          - type: boolean
                        nullable: true
                      ts:
                        type: number
                        nullable: true
                    required:
                      - value
                      - ts
                  effectiveRespiratoryRate:
                    type: object
                    properties:
                      value:
                        oneOf:
                          - type: string
                          - type: number
                          - type: boolean
                        nullable: true
                      ts:
                        type: number
                        nullable: true
                    required:
                      - value
                      - ts
                  effectiveSleepStatus:
                    type: object
                    properties:
                      value:
                        oneOf:
                          - type: string
                          - type: number
                          - type: boolean
                        nullable: true
                      ts:
                        type: number
                        nullable: true
                    required:
                      - value
                      - ts
                  lastMeasurementTime:
                    type: object
                    properties:
                      value:
                        oneOf:
                          - type: string
                          - type: number
                          - type: boolean
                        nullable: true
                      ts:
                        type: number
                        nullable: true
                    required:
                      - value
                      - ts
                  lastActivityTime:
                    type: object
                    properties:
                      value:
                        oneOf:
                          - type: string
                          - type: number
                          - type: boolean
                        nullable: true
                      ts:
                        type: number
                        nullable: true
                    required:
                      - value
                      - ts
                  name:
                    type: object
                    properties:
                      value:
                        oneOf:
                          - type: string
                          - type: number
                          - type: boolean
                        nullable: true
                      ts:
                        type: number
                        nullable: true
                    required:
                      - value
                      - ts
                required:
                  - active
                  - effectiveHeartRate
                  - effectiveRespiratoryRate
                  - effectiveSleepStatus
                  - lastMeasurementTime
                  - lastActivityTime
                  - name
      required:
        - total
        - resources
      example:
        total: 1
        resources:
          - device:
              id: a5a74a6d-f092-78b8-8cb6-ea23b7d7f257
              name: Sleepiz/3001472
            patient:
              id: de5c57ff-7257-57b0-13ab-aab6f5f91498
              name: Maxi
              nickname: Maxi
            organization:
              id: 519255ae-1f74-ffc5-ddd2-9979295c7572
              name: My Medical Project
            telemetry:
              active:
                value: true
                ts: 1786899977445
              effectiveHeartRate:
                value: 74
                ts: 1786899977445
              effectiveRespiratoryRate:
                value: 16
                ts: 1786899977445
              effectiveSleepStatus:
                value: asleep
                ts: 1786899977445
              lastMeasurementTime:
                value: 2026-08-16T17:06:17.445Z
                ts: 1786899977445
              lastActivityTime:
                value: 2026-08-16T17:06:17.445Z
                ts: 1786899977445
              name:
                value: Sleepiz/3001472
                ts: null
    CarehubPatientResponseDto:
      type: object
      properties:
        id:
          type: string
        name:
          type: array
          items:
            type: object
            properties:
              use:
                type: string
                enum:
                  - official
                  - nickname
                  - maiden
              given:
                type: array
                items:
                  type: string
              family:
                type: string
            required:
              - use
              - given
              - family
        gender:
          type: string
          enum:
            - male
            - female
            - other
            - unknown
        birthDate:
          type: string
        deviceId:
          type: array
          items:
            type: string
        organizationId:
          type: string
        locationId:
          type: string
        floor:
          type: string
        room:
          type: string
        bed:
          type: string
        residentState:
          type: string
          enum:
            - active
            - discharged-recent
            - discharged
            - archived
        admissionDate:
          type: string
        dischargeDate:
          type: string
      required:
        - id
        - name
        - residentState
      example:
        id: de5c57ff-7257-57b0-13ab-aab6f5f91498
        name:
          - use: official
            given:
              - Max
            family: Mustermann
        gender: male
        birthDate: 1990-01-01
        deviceId:
          - a5a74a6d-f092-78b8-8cb6-ea23b7d7f257
        organizationId: 519255ae-1f74-ffc5-ddd2-9979295c7572
        locationId: d219c681-01f5-32de-10ad-d2cf42fb9dbe
        floor: "2"
        room: "201"
        bed: A
        residentState: active
        admissionDate: 2025-12-01T12:33:33.162Z
    CarehubCheckNameExistsDto:
      type: object
      properties:
        name:
          type: array
          items:
            type: object
            properties:
              use:
                type: string
                enum:
                  - official
                  - nickname
                  - maiden
              given:
                type: array
                items:
                  type: string
                  minLength: 1
                minItems: 1
              family:
                type: string
                minLength: 1
            required:
              - use
          minItems: 1
        excludePatientId:
          type: string
      required:
        - name
      example:
        name:
          - use: nickname
            given:
              - RW
    CarehubCheckNameExistsResponseDto:
      type: object
      properties:
        exists:
          type: boolean
      required:
        - exists
      example:
        exists: true
    CarehubCreatePatientDto:
      type: object
      properties:
        name:
          type: array
          items:
            type: object
            properties:
              use:
                type: string
                enum:
                  - official
                  - nickname
                  - maiden
              given:
                type: array
                items:
                  type: string
                  minLength: 1
                minItems: 1
              family:
                type: string
                minLength: 1
            required:
              - use
          minItems: 1
        gender:
          type: string
          enum:
            - male
            - female
            - other
            - unknown
        birthDate:
          type: string
          pattern: ^\d{4}-\d{2}-\d{2}$
        deviceId:
          oneOf:
            - type: string
              format: uuid
            - type: array
              items:
                type: string
                format: uuid
          nullable: true
        organizationId:
          type: string
          format: uuid
        locationId:
          type: string
          format: uuid
        admissionDate:
          type: string
          format: date-time
      required:
        - name
      additionalProperties: false
      example:
        name:
          - use: official
            given:
              - John
            family: Doe
        deviceId: "123"
        organizationId: "456"
        locationId: "789"
        admissionDate: 2025-11-28
    CarehubUpdatePatientDto:
      type: object
      properties:
        name:
          type: array
          items:
            type: object
            properties:
              use:
                type: string
                enum:
                  - official
                  - nickname
                  - maiden
              given:
                type: array
                items:
                  type: string
                  minLength: 1
                minItems: 1
              family:
                type: string
                minLength: 1
            required:
              - use
          minItems: 1
        gender:
          type: string
          enum:
            - male
            - female
            - other
            - unknown
        birthDate:
          type: string
          pattern: ^\d{4}-\d{2}-\d{2}$
        deviceId:
          oneOf:
            - type: string
              format: uuid
            - type: array
              items:
                type: string
                format: uuid
          nullable: true
        organizationId:
          type: string
          format: uuid
        locationId:
          type: string
          format: uuid
        residentState:
          type: string
          enum:
            - active
            - discharged
        dischargeDate:
          type: string
          format: date-time
      required:
        - name
      additionalProperties: false
      example:
        name: Patient 1
        gender: male
        birthDate: 1990-01-01
        residentState: discharged
    CarehubAssignDeviceDto:
      type: object
      properties:
        deviceId:
          type: string
          format: uuid
        projectId:
          type: string
          format: uuid
        locationId:
          type: string
          format: uuid
      required:
        - deviceId
        - projectId
      additionalProperties: false
      example:
        deviceId: "123"
        projectId: "456"
        locationId: "789"
    CarehubDeviceListResponseDto:
      type: object
      properties:
        total:
          type: number
          minimum: 0
        page:
          type: number
          minimum: 0
        count:
          type: number
          minimum: 1
        resources:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
              name:
                type: string
              thingsboardId:
                type: string
              status:
                type: string
                enum:
                  - active
                  - inactive
              organizationId:
                type: string
                nullable: true
              organizationName:
                type: string
                nullable: true
              locationId:
                type: string
                nullable: true
              locationName:
                type: string
                nullable: true
              patientId:
                type: string
                nullable: true
              patientName:
                type: string
                nullable: true
              lastActivityTime:
                type: string
                nullable: true
              createdAt:
                type: string
                nullable: true
            required:
              - id
              - name
              - status
              - organizationId
              - organizationName
              - locationId
              - locationName
              - patientId
              - patientName
            example:
              id: a5a74a6d-f092-78b8-8cb6-ea23b7d7f257
              name: Sleepiz/3001472
              thingsboardId: Sleepiz/3001472
              status: active
              organizationId: 519255ae-1f74-ffc5-ddd2-9979295c7572
              organizationName: My Medical Project
              locationId: d219c681-01f5-32de-10ad-d2cf42fb9dbe
              locationName: Room 201 Bed 1
              patientId: de5c57ff-7257-57b0-13ab-aab6f5f91498
              patientName: Maxi
              lastActivityTime: 2026-08-16T17:06:17.445Z
              createdAt: 2026-08-16T17:06:17.445Z
      required:
        - total
        - page
        - count
        - resources
      example:
        total: 1
        page: 0
        count: 20
        resources:
          - id: a5a74a6d-f092-78b8-8cb6-ea23b7d7f257
            name: Sleepiz/3001472
            thingsboardId: Sleepiz/3001472
            status: active
            organizationId: 519255ae-1f74-ffc5-ddd2-9979295c7572
            organizationName: My Medical Project
            locationId: d219c681-01f5-32de-10ad-d2cf42fb9dbe
            locationName: Room 201 Bed 1
            patientId: de5c57ff-7257-57b0-13ab-aab6f5f91498
            patientName: Maxi
    CarehubDeviceLiveResponseDto:
      type: object
      properties:
        total:
          type: number
          minimum: 0
        page:
          type: number
          minimum: 0
        count:
          type: number
          minimum: 1
        resources:
          type: array
          items:
            type: object
            properties:
              device:
                type: object
                properties:
                  resourceType:
                    type: string
                    enum:
                      - Device
                  id:
                    type: string
                required:
                  - resourceType
                additionalProperties: true
              patient:
                type: object
                properties:
                  resourceType:
                    type: string
                    enum:
                      - Patient
                  id:
                    type: string
                required:
                  - resourceType
                additionalProperties: true
              location:
                type: object
                properties:
                  id:
                    type: string
                  name:
                    type: string
                required:
                  - id
                  - name
              organization:
                type: object
                properties:
                  id:
                    type: string
                  name:
                    type: string
                required:
                  - id
                  - name
              telemetry:
                type: object
                properties:
                  active:
                    type: object
                    properties:
                      value:
                        oneOf:
                          - type: string
                          - type: number
                          - type: boolean
                        nullable: true
                      ts:
                        type: number
                        nullable: true
                    required:
                      - value
                      - ts
                  effectiveHeartRate:
                    type: object
                    properties:
                      value:
                        oneOf:
                          - type: string
                          - type: number
                          - type: boolean
                        nullable: true
                      ts:
                        type: number
                        nullable: true
                    required:
                      - value
                      - ts
                  effectiveRespiratoryRate:
                    type: object
                    properties:
                      value:
                        oneOf:
                          - type: string
                          - type: number
                          - type: boolean
                        nullable: true
                      ts:
                        type: number
                        nullable: true
                    required:
                      - value
                      - ts
                  effectiveSleepStatus:
                    type: object
                    properties:
                      value:
                        oneOf:
                          - type: string
                          - type: number
                          - type: boolean
                        nullable: true
                      ts:
                        type: number
                        nullable: true
                    required:
                      - value
                      - ts
                  lastMeasurementTime:
                    type: object
                    properties:
                      value:
                        oneOf:
                          - type: string
                          - type: number
                          - type: boolean
                        nullable: true
                      ts:
                        type: number
                        nullable: true
                    required:
                      - value
                      - ts
                  lastActivityTime:
                    type: object
                    properties:
                      value:
                        oneOf:
                          - type: string
                          - type: number
                          - type: boolean
                        nullable: true
                      ts:
                        type: number
                        nullable: true
                    required:
                      - value
                      - ts
                  name:
                    type: object
                    properties:
                      value:
                        oneOf:
                          - type: string
                          - type: number
                          - type: boolean
                        nullable: true
                      ts:
                        type: number
                        nullable: true
                    required:
                      - value
                      - ts
                required:
                  - active
                  - effectiveHeartRate
                  - effectiveRespiratoryRate
                  - effectiveSleepStatus
                  - lastMeasurementTime
                  - lastActivityTime
                  - name
              alerts:
                type: object
                properties:
                  heartRate:
                    type: object
                    properties:
                      alert:
                        type: boolean
                      value:
                        type: object
                        additionalProperties: {}
                        nullable: true
                      message:
                        type: object
                        additionalProperties: {}
                        nullable: true
                      communicationRequestId:
                        type: string
                        nullable: true
                      observationId:
                        type: string
                        nullable: true
                      color:
                        type: string
                        nullable: true
                      state:
                        type: string
                        enum:
                          - alert
                          - normal
                      updatedAt:
                        type: string
                        nullable: true
                    required:
                      - alert
                  respiratoryRate:
                    type: object
                    properties:
                      alert:
                        type: boolean
                      value:
                        type: object
                        additionalProperties: {}
                        nullable: true
                      message:
                        type: object
                        additionalProperties: {}
                        nullable: true
                      communicationRequestId:
                        type: string
                        nullable: true
                      observationId:
                        type: string
                        nullable: true
                      color:
                        type: string
                        nullable: true
                      state:
                        type: string
                        enum:
                          - alert
                          - normal
                      updatedAt:
                        type: string
                        nullable: true
                    required:
                      - alert
                  outOfBed:
                    type: object
                    properties:
                      outOfBed:
                        type: boolean
                        enum:
                          - true
                      communicationRequestId:
                        type: string
                      sinceTime:
                        type: string
                    required:
                      - outOfBed
                      - communicationRequestId
                      - sinceTime
                    nullable: true
                required:
                  - heartRate
                  - respiratoryRate
                  - outOfBed
              calculatedFields:
                type: object
                properties:
                  deviceName:
                    type: string
                  locationName:
                    type: string
                  patientName:
                    type: string
                  patientNickname:
                    type: string
                  organizationName:
                    type: string
                  residentState:
                    type: string
                    enum:
                      - active
                      - discharged-recent
                      - discharged
                      - archived
                    nullable: true
                  effectiveSleepStatus:
                    type: string
                  active:
                    type: boolean
                  admissionDate:
                    type: string
                    nullable: true
                  dischargeDate:
                    type: string
                    nullable: true
            example:
              device:
                resourceType: Device
                id: a5a74a6d-f092-78b8-8cb6-ea23b7d7f257
                deviceName:
                  - type: user-friendly-name
                    name: Sleepiz/3001472
                status: active
                patient:
                  reference: Patient/de5c57ff-7257-57b0-13ab-aab6f5f91498
                location:
                  reference: Location/d219c681-01f5-32de-10ad-d2cf42fb9dbe
                  display: Room 201 Bed 1
              patient:
                resourceType: Patient
                id: de5c57ff-7257-57b0-13ab-aab6f5f91498
                name:
                  - use: nickname
                    given:
                      - Maxi
                    family: ""
              location:
                id: d219c681-01f5-32de-10ad-d2cf42fb9dbe
                name: Room 201 Bed 1
              organization:
                id: 519255ae-1f74-ffc5-ddd2-9979295c7572
                name: My Medical Project
              telemetry:
                active:
                  value: true
                  ts: 1786899977445
                effectiveHeartRate:
                  value: 74
                  ts: 1786899977445
                effectiveRespiratoryRate:
                  value: 16
                  ts: 1786899977445
                effectiveSleepStatus:
                  value: asleep
                  ts: 1786899977445
                lastMeasurementTime:
                  value: 2026-08-16T17:06:17.445Z
                  ts: 1786899977445
                lastActivityTime:
                  value: 2026-08-16T17:06:17.445Z
                  ts: 1786899977445
                name:
                  value: Sleepiz/3001472
                  ts: null
              alerts:
                heartRate:
                  alert: false
                  value: null
                  message: null
                  communicationRequestId: null
                  observationId: null
                  color: null
                  state: normal
                  updatedAt: null
                respiratoryRate:
                  alert: false
                  value: null
                  message: null
                  communicationRequestId: null
                  observationId: null
                  color: null
                  state: normal
                  updatedAt: null
              calculatedFields:
                deviceName: Sleepiz/3001472
                locationName: Room 201 Bed 1
                patientName: Maxi
                patientNickname: Maxi
                organizationName: My Medical Project
                residentState: active
                effectiveSleepStatus: asleep
                active: true
                admissionDate: 2026-08-16T17:06:17.445Z
                dischargeDate: null
      required:
        - total
        - page
        - count
        - resources
      example:
        total: 1
        page: 0
        count: 20
        resources:
          - device:
              resourceType: Device
              id: a5a74a6d-f092-78b8-8cb6-ea23b7d7f257
              status: active
            patient:
              resourceType: Patient
              id: de5c57ff-7257-57b0-13ab-aab6f5f91498
            location:
              id: d219c681-01f5-32de-10ad-d2cf42fb9dbe
              name: Room 201 Bed 1
            organization:
              id: 519255ae-1f74-ffc5-ddd2-9979295c7572
              name: My Medical Project
    CarehubDeviceSleepStatusResponseDto:
      type: object
      properties:
        deviceId:
          type: string
        status:
          type: string
          enum:
            - disconnected
            - away
            - awake
            - asleep
        presence:
          type: object
          properties:
            value:
              type: number
              nullable: true
            ts:
              type: number
              nullable: true
            observation:
              type: object
              additionalProperties: {}
          required:
            - value
            - ts
            - observation
          nullable: true
        sleep:
          type: object
          properties:
            value:
              type: number
              nullable: true
            ts:
              type: number
              nullable: true
            observation:
              type: object
              additionalProperties: {}
          required:
            - value
            - ts
            - observation
          nullable: true
        statusSince:
          type: number
          nullable: true
        lastSeen:
          type: number
          nullable: true
        comparison:
          type: object
          properties:
            cloudWatchStatus:
              type: string
              enum:
                - disconnected
                - away
                - awake
                - asleep
            telemetryStatus:
              type: string
              nullable: true
            inSync:
              type: boolean
            cloudWatchStatusSince:
              type: number
              nullable: true
            telemetryStatusSince:
              type: number
              nullable: true
            statusChangeLatencyMs:
              type: number
              nullable: true
            stalenessMs:
              type: number
              nullable: true
            telemetryError:
              type: string
              nullable: true
          required:
            - cloudWatchStatus
            - telemetryStatus
            - inSync
            - cloudWatchStatusSince
            - telemetryStatusSince
            - statusChangeLatencyMs
            - stalenessMs
            - telemetryError
      required:
        - deviceId
        - status
        - presence
        - sleep
        - statusSince
        - lastSeen
        - comparison
      example:
        deviceId: "3001518"
        status: asleep
        presence:
          value: 1
          ts: 1782208825000
          observation:
            resourceType: Observation
            code:
              coding:
                - code: presence-detection
                  display: Presence
            effectiveInstant: 2026-06-22T07:38:34+00:00
            valueSampledData:
              data: "1"
            device:
              reference: Device/3001518
        sleep:
          value: 0
          ts: 1782208825000
          observation:
            resourceType: Observation
            code:
              coding:
                - code: 107145-5
                  display: Sleep status
            effectiveInstant: 2026-06-22T07:38:34+00:00
            valueSampledData:
              data: 0 0 0 0
            device:
              reference: Device/3001518
            component:
              - code:
                  coding:
                    - code: 107145-5
                      display: AVERAGE
                valueQuantity:
                  value: 0
                  unit: "1"
                  system: http://unitsofmeasure.org
                  code: "1"
        statusSince: 1782208000000
        lastSeen: 1782208825000
        comparison:
          cloudWatchStatus: asleep
          telemetryStatus: asleep
          inSync: true
          cloudWatchStatusSince: 1782208000000
          telemetryStatusSince: 1782208006000
          statusChangeLatencyMs: 6000
          stalenessMs: null
          telemetryError: null
    CarehubDeviceLiveTelemetryResponseDto:
      type: object
      properties:
        total:
          type: number
          minimum: 0
        page:
          type: number
          minimum: 0
        count:
          type: number
          minimum: 1
        telemetry:
          type: object
          additionalProperties:
            type: object
            properties:
              active:
                type: object
                properties:
                  value:
                    oneOf:
                      - type: string
                      - type: number
                      - type: boolean
                    nullable: true
                  ts:
                    type: number
                    nullable: true
                required:
                  - value
                  - ts
              effectiveHeartRate:
                type: object
                properties:
                  value:
                    oneOf:
                      - type: string
                      - type: number
                      - type: boolean
                    nullable: true
                  ts:
                    type: number
                    nullable: true
                required:
                  - value
                  - ts
              effectiveRespiratoryRate:
                type: object
                properties:
                  value:
                    oneOf:
                      - type: string
                      - type: number
                      - type: boolean
                    nullable: true
                  ts:
                    type: number
                    nullable: true
                required:
                  - value
                  - ts
              effectiveSleepStatus:
                type: object
                properties:
                  value:
                    oneOf:
                      - type: string
                      - type: number
                      - type: boolean
                    nullable: true
                  ts:
                    type: number
                    nullable: true
                required:
                  - value
                  - ts
              lastMeasurementTime:
                type: object
                properties:
                  value:
                    oneOf:
                      - type: string
                      - type: number
                      - type: boolean
                    nullable: true
                  ts:
                    type: number
                    nullable: true
                required:
                  - value
                  - ts
              lastActivityTime:
                type: object
                properties:
                  value:
                    oneOf:
                      - type: string
                      - type: number
                      - type: boolean
                    nullable: true
                  ts:
                    type: number
                    nullable: true
                required:
                  - value
                  - ts
              name:
                type: object
                properties:
                  value:
                    oneOf:
                      - type: string
                      - type: number
                      - type: boolean
                    nullable: true
                  ts:
                    type: number
                    nullable: true
                required:
                  - value
                  - ts
            required:
              - active
              - effectiveHeartRate
              - effectiveRespiratoryRate
              - effectiveSleepStatus
              - lastMeasurementTime
              - lastActivityTime
              - name
        alerts:
          type: object
          additionalProperties:
            type: object
            properties:
              heartRate:
                type: object
                properties:
                  alert:
                    type: boolean
                  value:
                    type: object
                    additionalProperties: {}
                    nullable: true
                  message:
                    type: object
                    additionalProperties: {}
                    nullable: true
                  communicationRequestId:
                    type: string
                    nullable: true
                  observationId:
                    type: string
                    nullable: true
                  color:
                    type: string
                    nullable: true
                  state:
                    type: string
                    enum:
                      - alert
                      - normal
                  updatedAt:
                    type: string
                    nullable: true
                required:
                  - alert
              respiratoryRate:
                type: object
                properties:
                  alert:
                    type: boolean
                  value:
                    type: object
                    additionalProperties: {}
                    nullable: true
                  message:
                    type: object
                    additionalProperties: {}
                    nullable: true
                  communicationRequestId:
                    type: string
                    nullable: true
                  observationId:
                    type: string
                    nullable: true
                  color:
                    type: string
                    nullable: true
                  state:
                    type: string
                    enum:
                      - alert
                      - normal
                  updatedAt:
                    type: string
                    nullable: true
                required:
                  - alert
              outOfBed:
                type: object
                properties:
                  outOfBed:
                    type: boolean
                    enum:
                      - true
                  communicationRequestId:
                    type: string
                  sinceTime:
                    type: string
                required:
                  - outOfBed
                  - communicationRequestId
                  - sinceTime
                nullable: true
            required:
              - heartRate
              - respiratoryRate
              - outOfBed
      required:
        - total
        - page
        - count
        - telemetry
        - alerts
      example:
        total: 1
        page: 0
        count: 20
        telemetry:
          a5a74a6d-f092-78b8-8cb6-ea23b7d7f257:
            active:
              value: true
              ts: 1786899977445
            effectiveHeartRate:
              value: 74
              ts: 1786899977445
            effectiveRespiratoryRate:
              value: 16
              ts: 1786899977445
            effectiveSleepStatus:
              value: asleep
              ts: 1786899977445
            lastMeasurementTime:
              value: 2026-08-16T17:06:17.445Z
              ts: 1786899977445
            lastActivityTime:
              value: 2026-08-16T17:06:17.445Z
              ts: 1786899977445
            name:
              value: Sleepiz/3001472
              ts: null
        alerts:
          a5a74a6d-f092-78b8-8cb6-ea23b7d7f257:
            heartRate:
              alert: false
              value: null
              message: null
              communicationRequestId: null
              observationId: null
              color: null
              state: normal
              updatedAt: null
            respiratoryRate:
              alert: false
              value: null
              message: null
              communicationRequestId: null
              observationId: null
              color: null
              state: normal
              updatedAt: null
    CarehubDeviceResponseDto:
      type: object
      properties:
        name:
          type: string
        status:
          type: string
          enum:
            - active
            - inactive
            - entered-in-error
            - unknown
        thingsboardId:
          type: string
        organizationId:
          type: string
        organizationName:
          type: string
          nullable: true
        locationId:
          type: string
        locationName:
          type: string
          nullable: true
        patientId:
          type: string
        patientName:
          type: string
          nullable: true
        floor:
          type: string
        room:
          type: string
        bed:
          type: string
      required:
        - name
        - organizationName
        - locationName
        - patientName
      example:
        name: "Patient Monitor Device #ugs2LsGM2e"
        status: active
        thingsboardId: TB_DEVICE_ugs2LsGM2e
        organizationId: 519255ae-1f74-ffc5-ddd2-9979295c7572
        organizationName: My Medical Project
        locationId: d219c681-01f5-32de-10ad-d2cf42fb9dbe
        locationName: Room 201 Bed 1
        patientId: de5c57ff-7257-57b0-13ab-aab6f5f91498
        patientName: Maxi
        floor: "2"
        room: "201"
        bed: A
    CarehubCreateDeviceDto:
      type: object
      properties:
        name:
          type: string
          minLength: 1
        thingsboardId:
          type: string
          minLength: 1
        organizationId:
          type: string
          format: uuid
        locationId:
          type: string
          format: uuid
        patientId:
          type: string
          format: uuid
      required:
        - name
      additionalProperties: false
      example:
        name: Device 1
        thingsboardId: "123"
        organizationId: "456"
        locationId: "789"
        patientId: "101"
    CarehubUpdateDeviceDto:
      type: object
      properties:
        name:
          type: string
          minLength: 1
        thingsboardId:
          type: string
          minLength: 1
        organizationId:
          type: string
          format: uuid
          nullable: true
        locationId:
          type: string
          format: uuid
          nullable: true
        patientId:
          type: string
          format: uuid
          nullable: true
      required:
        - name
      additionalProperties: false
      example:
        name: Device 1
        thingsboardId: "123"
        organizationId: "456"
        locationId: "789"
        patientId: "101"
    FhirObservationIngestDto:
      type: object
      properties:
        resourceType:
          type: string
          enum:
            - Observation
          description: Must be "Observation" for FHIR R4.
        id:
          type: string
          description: Payload-source identifier assigned by the device side (e.g. Sleepiz
            UUID suffixed with -heartrate-analytics). Tracked in the per-device
            observation-ids Redis hash so consumers can correlate effective
            vitals back to the originating tick.
        status:
          type: string
        identifier:
          type: array
          items:
            type: object
            properties:
              system:
                type: string
              value:
                type: string
            required:
              - value
          minItems: 1
          description: At least one identifier; used for deduplication (e.g. LOINC +
            effective time).
        effectiveDateTime:
          type: string
          description: ISO 8601 date-time; one of effectiveDateTime, effectivePeriod, or
            effectiveInstant required.
        effectivePeriod:
          type: object
          properties:
            start:
              type: string
            end:
              type: string
          required:
            - start
        effectiveInstant:
          type: string
        code:
          type: object
          properties:
            coding:
              type: array
              items:
                type: object
                properties:
                  system:
                    type: string
                  code:
                    type: string
                  display:
                    type: string
                required:
                  - code
              minItems: 1
          required:
            - coding
          description: LOINC or other observation code (e.g. 8867-4 heart rate).
        category:
          type: array
          items:
            type: object
            properties:
              coding:
                type: array
                items:
                  type: object
                  properties:
                    system:
                      type: string
                    code:
                      type: string
                    display:
                      type: string
                  required:
                    - code
              text:
                type: string
        valueQuantity:
          type: object
          properties:
            value:
              type: number
            unit:
              type: string
            system:
              type: string
            code:
              type: string
        valueInteger:
          type: number
        valueSampledData:
          type: object
          properties:
            origin:
              type: object
              properties:
                value:
                  type: number
                unit:
                  type: string
                system:
                  type: string
                code:
                  type: string
              required:
                - value
            period:
              type: number
            factor:
              type: number
            dimensions:
              type: number
            data:
              type: string
          required:
            - origin
            - period
        valueCodeableConcept:
          type: object
          properties:
            coding:
              type: array
              items:
                type: object
                properties:
                  system:
                    type: string
                  code:
                    type: string
                  display:
                    type: string
                required:
                  - code
            text:
              type: string
        component:
          type: array
          items:
            type: object
            properties:
              code:
                type: object
                properties:
                  coding:
                    type: array
                    items:
                      type: object
                      properties:
                        system:
                          type: string
                        code:
                          type: string
                        display:
                          type: string
                      required:
                        - code
                  text:
                    type: string
              valueQuantity:
                type: object
                properties:
                  value:
                    type: number
                  unit:
                    type: string
                  system:
                    type: string
                  code:
                    type: string
              valueCodeableConcept:
                type: object
                properties:
                  coding:
                    type: array
                    items:
                      type: object
                      properties:
                        system:
                          type: string
                        code:
                          type: string
                        display:
                          type: string
                      required:
                        - code
                  text:
                    type: string
              valueString:
                type: string
              valueDateTime:
                type: string
              valueInteger:
                type: number
        device:
          type: object
          properties:
            reference:
              type: string
          required:
            - reference
          description: Device reference (e.g. Device/3001468); device id is extracted for
            routing.
        subject:
          type: object
          properties:
            reference:
              type: string
          required:
            - reference
      required:
        - resourceType
        - code
        - device
    FhirIngestAckResponseDto:
      type: object
      properties:
        jobId:
          type: string
          description: ID of the enqueued job.
        requestId:
          type: string
          description: Request ID from context when present.
      required:
        - jobId
    FhirBundleIngestDto:
      type: object
      properties:
        resourceType:
          type: string
          enum:
            - Bundle
          description: Must be "Bundle" for FHIR R4.
        type:
          type: string
          description: Bundle type (e.g. collection, transaction).
        entry:
          type: array
          items:
            type: object
            properties:
              resource:
                type: object
                properties:
                  resourceType:
                    type: string
                    enum:
                      - Observation
                    description: Must be "Observation" for FHIR R4.
                  id:
                    type: string
                    description: Payload-source identifier assigned by the device side (e.g. Sleepiz
                      UUID suffixed with -heartrate-analytics). Tracked in the
                      per-device observation-ids Redis hash so consumers can
                      correlate effective vitals back to the originating tick.
                  status:
                    type: string
                  identifier:
                    type: array
                    items:
                      type: object
                      properties:
                        system:
                          type: string
                        value:
                          type: string
                      required:
                        - value
                    minItems: 1
                    description: At least one identifier; used for deduplication (e.g. LOINC +
                      effective time).
                  effectiveDateTime:
                    type: string
                    description: ISO 8601 date-time; one of effectiveDateTime, effectivePeriod, or
                      effectiveInstant required.
                  effectivePeriod:
                    type: object
                    properties:
                      start:
                        type: string
                      end:
                        type: string
                    required:
                      - start
                  effectiveInstant:
                    type: string
                  code:
                    type: object
                    properties:
                      coding:
                        type: array
                        items:
                          type: object
                          properties:
                            system:
                              type: string
                            code:
                              type: string
                            display:
                              type: string
                          required:
                            - code
                        minItems: 1
                    required:
                      - coding
                    description: LOINC or other observation code (e.g. 8867-4 heart rate).
                  category:
                    type: array
                    items:
                      type: object
                      properties:
                        coding:
                          type: array
                          items:
                            type: object
                            properties:
                              system:
                                type: string
                              code:
                                type: string
                              display:
                                type: string
                            required:
                              - code
                        text:
                          type: string
                  valueQuantity:
                    type: object
                    properties:
                      value:
                        type: number
                      unit:
                        type: string
                      system:
                        type: string
                      code:
                        type: string
                  valueInteger:
                    type: number
                  valueSampledData:
                    type: object
                    properties:
                      origin:
                        type: object
                        properties:
                          value:
                            type: number
                          unit:
                            type: string
                          system:
                            type: string
                          code:
                            type: string
                        required:
                          - value
                      period:
                        type: number
                      factor:
                        type: number
                      dimensions:
                        type: number
                      data:
                        type: string
                    required:
                      - origin
                      - period
                  valueCodeableConcept:
                    type: object
                    properties:
                      coding:
                        type: array
                        items:
                          type: object
                          properties:
                            system:
                              type: string
                            code:
                              type: string
                            display:
                              type: string
                          required:
                            - code
                      text:
                        type: string
                  component:
                    type: array
                    items:
                      type: object
                      properties:
                        code:
                          type: object
                          properties:
                            coding:
                              type: array
                              items:
                                type: object
                                properties:
                                  system:
                                    type: string
                                  code:
                                    type: string
                                  display:
                                    type: string
                                required:
                                  - code
                            text:
                              type: string
                        valueQuantity:
                          type: object
                          properties:
                            value:
                              type: number
                            unit:
                              type: string
                            system:
                              type: string
                            code:
                              type: string
                        valueCodeableConcept:
                          type: object
                          properties:
                            coding:
                              type: array
                              items:
                                type: object
                                properties:
                                  system:
                                    type: string
                                  code:
                                    type: string
                                  display:
                                    type: string
                                required:
                                  - code
                            text:
                              type: string
                        valueString:
                          type: string
                        valueDateTime:
                          type: string
                        valueInteger:
                          type: number
                  device:
                    type: object
                    properties:
                      reference:
                        type: string
                    required:
                      - reference
                    description: Device reference (e.g. Device/3001468); device id is extracted for
                      routing.
                  subject:
                    type: object
                    properties:
                      reference:
                        type: string
                    required:
                      - reference
                required:
                  - resourceType
                  - code
                  - device
            required:
              - resource
          minItems: 1
          description: One or more entries; each entry.resource must be a valid Observation.
      required:
        - resourceType
        - entry
    FhirBundleIngestAckResponseDto:
      type: object
      properties:
        jobIds:
          type: array
          items:
            type: string
          description: IDs of enqueued jobs.
        requestId:
          type: string
          description: Request ID from context when present.
      required:
        - jobIds
    FhirCombinedIngestDto:
      type: object
      properties: {}
      additionalProperties: true
      description: Raw combined ingest payload. Accepted as-is with no FHIR
        conversion. Shape is intentionally permissive so producers can evolve
        without requiring middleware or ingest schema changes.
    FhirCombinedIngestAckResponseDto:
      type: object
      properties:
        requestId:
          type: string
          description: Request ID from context when present.
    EnvironmentObservationIngestDto:
      type: object
      properties:
        resourceType:
          type: string
          enum:
            - Observation
          description: Must be "Observation" for FHIR R4.
        id:
          type: string
          description: Payload-source identifier assigned by the device side (e.g. Sleepiz
            UUID suffixed with -heartrate-analytics). Tracked in the per-device
            observation-ids Redis hash so consumers can correlate effective
            vitals back to the originating tick.
        status:
          type: string
        identifier:
          type: array
          items:
            type: object
            properties:
              system:
                type: string
              value:
                type: string
            required:
              - value
          minItems: 1
          description: At least one identifier; used for deduplication (e.g. LOINC +
            effective time).
        effectiveDateTime:
          type: string
          description: ISO 8601 date-time; one of effectiveDateTime, effectivePeriod, or
            effectiveInstant required.
        effectivePeriod:
          type: object
          properties:
            start:
              type: string
            end:
              type: string
          required:
            - start
        effectiveInstant:
          type: string
        code:
          type: object
          properties:
            coding:
              type: array
              items:
                type: object
                properties:
                  system:
                    type: string
                  code:
                    type: string
                  display:
                    type: string
                required:
                  - code
              minItems: 1
          required:
            - coding
          description: LOINC or other observation code (e.g. 8867-4 heart rate).
        category:
          type: array
          items:
            type: object
            properties:
              coding:
                type: array
                items:
                  type: object
                  properties:
                    system:
                      type: string
                    code:
                      type: string
                    display:
                      type: string
                  required:
                    - code
              text:
                type: string
        valueQuantity:
          type: object
          properties:
            value:
              type: number
            unit:
              type: string
            system:
              type: string
            code:
              type: string
        valueInteger:
          type: number
        valueSampledData:
          type: object
          properties:
            origin:
              type: object
              properties:
                value:
                  type: number
                unit:
                  type: string
                system:
                  type: string
                code:
                  type: string
              required:
                - value
            period:
              type: number
            factor:
              type: number
            dimensions:
              type: number
            data:
              type: string
          required:
            - origin
            - period
        valueCodeableConcept:
          type: object
          properties:
            coding:
              type: array
              items:
                type: object
                properties:
                  system:
                    type: string
                  code:
                    type: string
                  display:
                    type: string
                required:
                  - code
            text:
              type: string
        component:
          type: array
          items:
            type: object
            properties:
              code:
                type: object
                properties:
                  coding:
                    type: array
                    items:
                      type: object
                      properties:
                        system:
                          type: string
                        code:
                          type: string
                        display:
                          type: string
                      required:
                        - code
                  text:
                    type: string
              valueQuantity:
                type: object
                properties:
                  value:
                    type: number
                  unit:
                    type: string
                  system:
                    type: string
                  code:
                    type: string
              valueCodeableConcept:
                type: object
                properties:
                  coding:
                    type: array
                    items:
                      type: object
                      properties:
                        system:
                          type: string
                        code:
                          type: string
                        display:
                          type: string
                      required:
                        - code
                  text:
                    type: string
              valueString:
                type: string
              valueDateTime:
                type: string
              valueInteger:
                type: number
        device:
          type: object
          properties:
            reference:
              type: string
          required:
            - reference
          description: Device reference (e.g. Device/3001468); device id is extracted for
            routing.
        subject:
          type: object
          properties:
            reference:
              type: string
          required:
            - reference
      required:
        - resourceType
        - code
        - device
      example:
        resourceType: Observation
        status: final
        code:
          coding:
            - system: https://api.ovok.com/StructuredDefinition
              code: room_temperature
            - system: http://loinc.org
              code: 8310-5
              display: Room temperature
        effectiveInstant: 2026-04-25T09:00:00.000Z
        valueQuantity:
          value: 23.5
          unit: °C
          system: http://unitsofmeasure.org
          code: Cel
        device:
          reference: Device/MC01-demo-device
    ExportPdfBodyDto:
      type: object
      properties:
        code:
          type: string
        mailTo:
          default: []
          type: array
          items:
            type: string
            format: email
        timeZone:
          default: Europe/Berlin
          type: string
        language:
          type: string
          enum:
            - Cy-az-AZ
            - Cy-sr-SP
            - Cy-uz-UZ
            - Lt-az-AZ
            - Lt-sr-SP
            - Lt-uz-UZ
            - aa
            - ab
            - ae
            - af
            - af-ZA
            - ak
            - am
            - an
            - ar
            - ar-AE
            - ar-BH
            - ar-DZ
            - ar-EG
            - ar-IQ
            - ar-JO
            - ar-KW
            - ar-LB
            - ar-LY
            - ar-MA
            - ar-OM
            - ar-QA
            - ar-SA
            - ar-SY
            - ar-TN
            - ar-YE
            - as
            - av
            - ay
            - az
            - ba
            - be
            - be-BY
            - bg
            - bg-BG
            - bh
            - bi
            - bm
            - bn
            - bo
            - br
            - bs
            - ca
            - ca-ES
            - ce
            - ch
            - co
            - cr
            - cs
            - cs-CZ
            - cu
            - cv
            - cy
            - da
            - da-DK
            - de
            - de-AT
            - de-CH
            - de-DE
            - de-LI
            - de-LU
            - div-MV
            - dv
            - dz
            - ee
            - el
            - el-GR
            - en
            - en-AU
            - en-BZ
            - en-CA
            - en-CB
            - en-GB
            - en-IE
            - en-JM
            - en-NZ
            - en-PH
            - en-TT
            - en-US
            - en-ZA
            - en-ZW
            - eo
            - es
            - es-AR
            - es-BO
            - es-CL
            - es-CO
            - es-CR
            - es-DO
            - es-EC
            - es-ES
            - es-GT
            - es-HN
            - es-MX
            - es-NI
            - es-PA
            - es-PE
            - es-PR
            - es-PY
            - es-SV
            - es-UY
            - es-VE
            - et
            - et-EE
            - eu
            - eu-ES
            - fa
            - fa-IR
            - ff
            - fi
            - fi-FI
            - fj
            - fo
            - fo-FO
            - fr
            - fr-BE
            - fr-CA
            - fr-CH
            - fr-FR
            - fr-LU
            - fr-MC
            - fy
            - ga
            - gd
            - gl
            - gl-ES
            - gn
            - gu
            - gu-IN
            - gv
            - ha
            - he
            - he-IL
            - hi
            - hi-IN
            - ho
            - hr
            - hr-HR
            - ht
            - hu
            - hu-HU
            - hy
            - hy-AM
            - hz
            - ia
            - id
            - id-ID
            - ie
            - ig
            - ii
            - ik
            - io
            - is
            - is-IS
            - it
            - it-CH
            - it-IT
            - iu
            - ja
            - ja-JP
            - jv
            - ka
            - ka-GE
            - kg
            - ki
            - kj
            - kk
            - kk-KZ
            - kl
            - km
            - kn
            - kn-IN
            - ko
            - ko-KR
            - kr
            - ks
            - ku
            - kv
            - kw
            - ky
            - ky-KZ
            - la
            - lb
            - lg
            - li
            - ln
            - lo
            - lt
            - lt-LT
            - lu
            - lv
            - lv-LV
            - mg
            - mh
            - mi
            - mk
            - mk-MK
            - ml
            - mn
            - mn-MN
            - mr
            - mr-IN
            - ms
            - ms-BN
            - ms-MY
            - mt
            - my
            - na
            - nb
            - nb-NO
            - nd
            - ne
            - ng
            - nl
            - nl-BE
            - nl-NL
            - nn
            - nn-NO
            - no
            - nr
            - nv
            - ny
            - oc
            - oj
            - om
            - or
            - os
            - pa
            - pa-IN
            - pi
            - pl
            - pl-PL
            - ps
            - pt
            - pt-BR
            - pt-PT
            - qu
            - rm
            - rn
            - ro
            - ro-RO
            - ru
            - ru-RU
            - rw
            - sa
            - sa-IN
            - sc
            - sd
            - se
            - sg
            - si
            - sk
            - sk-SK
            - sl
            - sl-SI
            - sm
            - sn
            - so
            - sq
            - sq-AL
            - sr
            - ss
            - st
            - su
            - sv
            - sv-FI
            - sv-SE
            - sw
            - sw-KE
            - ta
            - ta-IN
            - te
            - te-IN
            - tg
            - th
            - th-TH
            - ti
            - tk
            - tl
            - tn
            - to
            - tr
            - tr-TR
            - ts
            - tt
            - tt-RU
            - tw
            - ty
            - ug
            - uk
            - uk-UA
            - ur
            - ur-PK
            - uz
            - ve
            - vi
            - vi-VN
            - vo
            - wa
            - wo
            - xh
            - yi
            - yo
            - za
            - zh
            - zh-CHS
            - zh-CHT
            - zh-CN
            - zh-HK
            - zh-MO
            - zh-SG
            - zh-TW
            - zu
        patientId:
          type: string
          format: uuid
        period:
          type: object
          properties:
            start:
              type: string
              format: date-time
            end:
              type: string
              format: date-time
          required:
            - start
            - end
      required:
        - code
        - language
        - patientId
        - period
    CarehubExportPdfResponseDto:
      type: object
      properties:
        documentReference:
          type: object
          properties:
            resourceType:
              type: string
              enum:
                - DocumentReference
            id:
              type: string
              format: uuid
            status:
              type: string
              enum:
                - current
                - superseded
                - entered-in-error
            type:
              type: object
              properties:
                coding:
                  type: array
                  items:
                    type: object
                    properties:
                      system:
                        type: string
                      code:
                        type: string
                      display:
                        type: string
                    required:
                      - system
                      - code
                      - display
              required:
                - coding
            subject:
              type: object
              properties:
                reference:
                  type: string
                display:
                  type: string
              required:
                - reference
                - display
            content:
              type: array
              items:
                type: object
                properties:
                  attachment:
                    type: object
                    properties:
                      contentType:
                        type: string
                        enum:
                          - application/pdf
                      url:
                        type: string
                      size:
                        type: number
                      title:
                        type: string
                    required:
                      - contentType
                      - url
                required:
                  - attachment
            created:
              type: string
          required:
            - resourceType
            - id
            - status
            - type
            - subject
            - content
            - created
        binary:
          type: object
          properties:
            resourceType:
              type: string
              enum:
                - Binary
            id:
              type: string
              format: uuid
            contentType:
              type: string
              enum:
                - application/pdf
            data:
              type: string
          required:
            - resourceType
            - id
            - contentType
        downloadUrl:
          type: string
        expiresAt:
          type: string
      required:
        - documentReference
        - binary
        - downloadUrl
      example:
        documentReference:
          resourceType: DocumentReference
          id: a399fd4d-cbed-5726-8f61-3e8fd866d47d
          status: current
          type:
            coding:
              - system: http://loinc.org
                code: 11502-2
                display: Laboratory report
          subject:
            reference: Patient/de5c57ff-7257-57b0-13ab-aab6f5f91498
            display: Max Mustermann
          content:
            - attachment:
                contentType: application/pdf
                url: https://api.example.com/binary/66639f7d-455d-d71f-aa91-47f5d69e5ce8
                size: 1024000
                title: Patient Data Export - Max Mustermann
          created: 2026-08-16T17:06:17.445Z
        binary:
          resourceType: Binary
          id: 66639f7d-455d-d71f-aa91-47f5d69e5ce8
          contentType: application/pdf
        downloadUrl: https://api.example.com/binary/66639f7d-455d-d71f-aa91-47f5d69e5ce8/download
        expiresAt: 2026-08-17T17:06:17Z
    ContentBodyDto:
      type: object
      properties:
        title:
          type: string
        category:
          type: array
          items:
            type: string
        section:
          type: array
          items:
            type: object
            properties:
              title:
                type: string
              text:
                type: string
              extension:
                type: object
                additionalProperties:
                  type: string
              code:
                type: array
                items:
                  type: string
                  minLength: 1
        code:
          type: string
      required:
        - title
      example:
        title: My Blog
        category: "123"
        section:
          - title: My Section
            text: My Text
            code:
              - main-content
          - title: My Section 2
            text: My Text 2
            code:
              - reading-time
          - title: My Section 3
            text: My Text 3
            code:
              - resource-link
    ContentDto:
      type: object
      properties:
        id:
          type: string
        title:
          type: string
        author:
          type: object
          properties:
            reference:
              type: string
            display:
              type: string
          required:
            - reference
        key:
          type: string
          description: A random UUID that is used to identify the content, not ID!
        language:
          type: string
          enum:
            - Cy-az-AZ
            - Cy-sr-SP
            - Cy-uz-UZ
            - Lt-az-AZ
            - Lt-sr-SP
            - Lt-uz-UZ
            - aa
            - ab
            - ae
            - af
            - af-ZA
            - ak
            - am
            - an
            - ar
            - ar-AE
            - ar-BH
            - ar-DZ
            - ar-EG
            - ar-IQ
            - ar-JO
            - ar-KW
            - ar-LB
            - ar-LY
            - ar-MA
            - ar-OM
            - ar-QA
            - ar-SA
            - ar-SY
            - ar-TN
            - ar-YE
            - as
            - av
            - ay
            - az
            - ba
            - be
            - be-BY
            - bg
            - bg-BG
            - bh
            - bi
            - bm
            - bn
            - bo
            - br
            - bs
            - ca
            - ca-ES
            - ce
            - ch
            - co
            - cr
            - cs
            - cs-CZ
            - cu
            - cv
            - cy
            - da
            - da-DK
            - de
            - de-AT
            - de-CH
            - de-DE
            - de-LI
            - de-LU
            - div-MV
            - dv
            - dz
            - ee
            - el
            - el-GR
            - en
            - en-AU
            - en-BZ
            - en-CA
            - en-CB
            - en-GB
            - en-IE
            - en-JM
            - en-NZ
            - en-PH
            - en-TT
            - en-US
            - en-ZA
            - en-ZW
            - eo
            - es
            - es-AR
            - es-BO
            - es-CL
            - es-CO
            - es-CR
            - es-DO
            - es-EC
            - es-ES
            - es-GT
            - es-HN
            - es-MX
            - es-NI
            - es-PA
            - es-PE
            - es-PR
            - es-PY
            - es-SV
            - es-UY
            - es-VE
            - et
            - et-EE
            - eu
            - eu-ES
            - fa
            - fa-IR
            - ff
            - fi
            - fi-FI
            - fj
            - fo
            - fo-FO
            - fr
            - fr-BE
            - fr-CA
            - fr-CH
            - fr-FR
            - fr-LU
            - fr-MC
            - fy
            - ga
            - gd
            - gl
            - gl-ES
            - gn
            - gu
            - gu-IN
            - gv
            - ha
            - he
            - he-IL
            - hi
            - hi-IN
            - ho
            - hr
            - hr-HR
            - ht
            - hu
            - hu-HU
            - hy
            - hy-AM
            - hz
            - ia
            - id
            - id-ID
            - ie
            - ig
            - ii
            - ik
            - io
            - is
            - is-IS
            - it
            - it-CH
            - it-IT
            - iu
            - ja
            - ja-JP
            - jv
            - ka
            - ka-GE
            - kg
            - ki
            - kj
            - kk
            - kk-KZ
            - kl
            - km
            - kn
            - kn-IN
            - ko
            - ko-KR
            - kr
            - ks
            - ku
            - kv
            - kw
            - ky
            - ky-KZ
            - la
            - lb
            - lg
            - li
            - ln
            - lo
            - lt
            - lt-LT
            - lu
            - lv
            - lv-LV
            - mg
            - mh
            - mi
            - mk
            - mk-MK
            - ml
            - mn
            - mn-MN
            - mr
            - mr-IN
            - ms
            - ms-BN
            - ms-MY
            - mt
            - my
            - na
            - nb
            - nb-NO
            - nd
            - ne
            - ng
            - nl
            - nl-BE
            - nl-NL
            - nn
            - nn-NO
            - no
            - nr
            - nv
            - ny
            - oc
            - oj
            - om
            - or
            - os
            - pa
            - pa-IN
            - pi
            - pl
            - pl-PL
            - ps
            - pt
            - pt-BR
            - pt-PT
            - qu
            - rm
            - rn
            - ro
            - ro-RO
            - ru
            - ru-RU
            - rw
            - sa
            - sa-IN
            - sc
            - sd
            - se
            - sg
            - si
            - sk
            - sk-SK
            - sl
            - sl-SI
            - sm
            - sn
            - so
            - sq
            - sq-AL
            - sr
            - ss
            - st
            - su
            - sv
            - sv-FI
            - sv-SE
            - sw
            - sw-KE
            - ta
            - ta-IN
            - te
            - te-IN
            - tg
            - th
            - th-TH
            - ti
            - tk
            - tl
            - tn
            - to
            - tr
            - tr-TR
            - ts
            - tt
            - tt-RU
            - tw
            - ty
            - ug
            - uk
            - uk-UA
            - ur
            - ur-PK
            - uz
            - ve
            - vi
            - vi-VN
            - vo
            - wa
            - wo
            - xh
            - yi
            - yo
            - za
            - zh
            - zh-CHS
            - zh-CHT
            - zh-CN
            - zh-HK
            - zh-MO
            - zh-SG
            - zh-TW
            - zu
        date:
          type: string
        projectId:
          type: string
          format: uuid
        type:
          type: string
          enum:
            - blog
            - video
            - audio
            - template
            - export-template
        code:
          type: string
        category:
          type: array
          items:
            type: string
        section:
          type: array
          items:
            type: object
            properties:
              title:
                type: string
              text:
                type: string
              extension:
                type: object
                additionalProperties:
                  type: string
              code:
                type: array
                items:
                  type: string
                  minLength: 1
      required:
        - title
        - author
        - key
        - language
        - date
        - type
      example:
        id: "123"
        title: My Blog
        author:
          reference: "123"
          display: John Doe
        date: 2021-01-01
        project: "123"
        type: blog
        category:
          - "123"
          - "456"
        section:
          - title: My Blog
            text: My Blog Text
            extension:
              covert-media: http://example.com/extensionValue
    CarehubAssignmentCandidatesResponseDto:
      type: object
      properties:
        total:
          type: number
          minimum: 0
        page:
          type: number
          minimum: 0
        count:
          type: number
          minimum: 1
        resources:
          type: array
          items:
            type: object
            properties:
              locationId:
                type: string
              locationName:
                type: string
              organizationId:
                type: string
                nullable: true
              organizationName:
                type: string
                nullable: true
              deviceId:
                type: string
                nullable: true
              deviceName:
                type: string
                nullable: true
              patientId:
                type: string
                nullable: true
              patientName:
                type: string
                nullable: true
              occupied:
                type: boolean
              assignable:
                type: boolean
              warningCode:
                type: string
                nullable: true
            required:
              - locationId
              - locationName
              - organizationId
              - organizationName
              - deviceId
              - deviceName
              - patientId
              - patientName
              - occupied
              - assignable
              - warningCode
            example:
              locationId: d219c681-01f5-32de-10ad-d2cf42fb9dbe
              locationName: Room 201 Bed 1
              organizationId: 519255ae-1f74-ffc5-ddd2-9979295c7572
              organizationName: My Medical Project
              deviceId: a5a74a6d-f092-78b8-8cb6-ea23b7d7f257
              deviceName: Sleepiz/3001472
              patientId: de5c57ff-7257-57b0-13ab-aab6f5f91498
              patientName: Maxi
              occupied: true
              assignable: true
              warningCode: location_has_existing_resident
      required:
        - total
        - page
        - count
        - resources
      example:
        total: 1
        page: 0
        count: 50
        resources:
          - locationId: d219c681-01f5-32de-10ad-d2cf42fb9dbe
            locationName: Room 201 Bed 1
            organizationId: 519255ae-1f74-ffc5-ddd2-9979295c7572
            organizationName: My Medical Project
            deviceId: a5a74a6d-f092-78b8-8cb6-ea23b7d7f257
            deviceName: Sleepiz/3001472
            patientId: de5c57ff-7257-57b0-13ab-aab6f5f91498
            patientName: Maxi
            occupied: true
            assignable: true
            warningCode: location_has_existing_resident
    CarehubListLocationResponseDto:
      type: object
      properties:
        total:
          type: number
          minimum: 0
        page:
          type: number
          minimum: 0
        count:
          type: number
          minimum: 1
        resources:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
                minLength: 1
              name:
                type: string
              floor:
                type: string
              room:
                type: string
              bed:
                type: string
              organizationId:
                type: string
                minLength: 1
              organizationName:
                type: string
              deviceName:
                type: string
              patientName:
                type: string
              deviceId:
                type: string
                minLength: 1
              patientId:
                type: string
                minLength: 1
            required:
              - id
              - name
            description: A location list item enriched with device, patient, and
              organization data.
            example:
              id: d219c681-01f5-32de-10ad-d2cf42fb9dbe
              name: My Medical Project - Room 201
              floor: "2"
              room: "201"
              bed: A
              organizationId: 519255ae-1f74-ffc5-ddd2-9979295c7572
              organizationName: My Medical Project North Campus
              deviceName: "Patient Monitor Device #ugs2LsGM2e"
              patientName: Maxi
              deviceId: a5a74a6d-f092-78b8-8cb6-ea23b7d7f257
              patientId: de5c57ff-7257-57b0-13ab-aab6f5f91498
      required:
        - total
        - page
        - count
        - resources
      example:
        total: 1
        page: 0
        count: 20
        resources:
          - id: d219c681-01f5-32de-10ad-d2cf42fb9dbe
            name: My Medical Project - Room 201
            floor: "2"
            room: "201"
            bed: A
            organizationId: 519255ae-1f74-ffc5-ddd2-9979295c7572
            organizationName: My Medical Project
            deviceName: Sleepiz/300XXXX
            patientName: Maxi
            deviceId: a5a74a6d-f092-78b8-8cb6-ea23b7d7f257
            patientId: de5c57ff-7257-57b0-13ab-aab6f5f91498
    AdminCreateLocationDto:
      type: object
      properties:
        projectId:
          type: string
          format: uuid
        name:
          type: string
          minLength: 1
        floor:
          type: string
        room:
          type: string
        bed:
          type: string
        organizationId:
          type: string
          format: uuid
      required:
        - projectId
        - name
      additionalProperties: false
      example:
        projectId: 9028484d-1cea-48cb-82b4-27b001c3ba0e
        name: Room 18
        floor: "2"
        room: "18"
        organizationId: 123e4567-e89b-12d3-a456-426614174000
    CarehubLocationResponseDto:
      type: object
      properties:
        name:
          type: string
        floor:
          type: string
        room:
          type: string
        bed:
          type: string
        organizationId:
          type: string
        organizationName:
          type: string
        deviceName:
          type: string
        patientName:
          type: string
      required:
        - name
      example:
        name: My Medical Project - Room 201
        floor: "2"
        room: "201"
        bed: A
        organizationId: 519255ae-1f74-ffc5-ddd2-9979295c7572
        organizationName: My Medical Project North Campus
        deviceName: "Patient Monitor Device #ugs2LsGM2e"
        patientName: Max
    CarehubCreateLocationDto:
      type: object
      properties:
        name:
          type: string
          minLength: 1
        floor:
          type: string
        room:
          type: string
        bed:
          type: string
        organizationId:
          type: string
      required:
        - name
      additionalProperties: false
      example:
        name: Location 1
        floor: "1"
        room: "101"
        bed: "1"
        organizationId: "123"
    CarehubUpdateLocationDto:
      type: object
      properties:
        name:
          type: string
          minLength: 1
        floor:
          type: string
        room:
          type: string
        bed:
          type: string
        organizationId:
          type: string
          nullable: true
        deviceId:
          oneOf:
            - type: string
              format: uuid
            - type: array
              items:
                type: string
                format: uuid
          nullable: true
        patientId:
          type: string
          format: uuid
      required:
        - name
      additionalProperties: false
      example:
        name: Location 1
        floor: "1"
        room: "101"
        bed: "1"
        organizationId: 519255ae-1f74-ffc5-ddd2-9979295c7572
        deviceId: a5a74a6d-f092-78b8-8cb6-ea23b7d7f257
        patientId: de5c57ff-7257-57b0-13ab-aab6f5f91498
    CarehubOrganizationResponseDto:
      type: object
      properties:
        name:
          type: string
        parentOrganizationId:
          type: string
        description:
          type: string
      required:
        - name
      example:
        name: My Medical Project
        parentOrganizationId: 3e20509a-53de-83ad-42ad-73af6f871710
    CarehubCreateOrganizationDto:
      type: object
      properties:
        name:
          type: string
          minLength: 1
        parentOrganizationId:
          type: string
          format: uuid
        description:
          type: string
          nullable: true
      required:
        - name
      additionalProperties: false
      example:
        name: Organization 1
        parentOrganizationId: "123"
        description: Description 1
    CarehubUpdateOrganizationDto:
      type: object
      properties:
        name:
          type: string
          minLength: 1
        parentOrganizationId:
          type: string
          format: uuid
        description:
          type: string
          nullable: true
      required:
        - name
      additionalProperties: false
      example:
        name: Organization 1
        parentOrganizationId: "123"
        description: Description 1
    CarehubZonesListResponseDto:
      type: object
      properties:
        total:
          type: number
          minimum: 0
        page:
          type: number
          minimum: 0
        count:
          type: number
          minimum: 1
        resources:
          type: array
          items:
            type: object
            properties:
              zoneId:
                type: string
              zoneName:
                type: string
              deviceCount:
                type: number
                minimum: 0
              assignedResidentDeviceCount:
                type: number
                minimum: 0
              activeDeviceCount:
                type: number
                minimum: 0
              inactiveDeviceCount:
                type: number
                minimum: 0
            required:
              - zoneId
              - zoneName
              - deviceCount
              - assignedResidentDeviceCount
              - activeDeviceCount
              - inactiveDeviceCount
            example:
              zoneId: 519255ae-1f74-ffc5-ddd2-9979295c7572
              zoneName: Ward A
              deviceCount: 15
              assignedResidentDeviceCount: 12
              activeDeviceCount: 12
              inactiveDeviceCount: 3
      required:
        - total
        - page
        - count
        - resources
      example:
        total: 1
        page: 0
        count: 20
        resources:
          - zoneId: 519255ae-1f74-ffc5-ddd2-9979295c7572
            zoneName: Ward A
            deviceCount: 15
            assignedResidentDeviceCount: 12
            activeDeviceCount: 12
            inactiveDeviceCount: 3
    ZoneDetailResponseDto:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        locations:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
              name:
                type: string
              floor:
                type: string
              room:
                type: string
              bed:
                type: string
              devices:
                type: array
                items:
                  type: object
                  properties:
                    id:
                      type: string
                    name:
                      type: string
                  required:
                    - id
              residents:
                type: array
                items:
                  type: object
                  properties:
                    id:
                      type: string
                    name:
                      type: string
                  required:
                    - id
            required:
              - id
              - name
              - devices
              - residents
      required:
        - id
        - name
        - locations
      description: Zone detail with nested locations, devices and residents per location.
    CreateLocationInZoneDto:
      type: object
      properties:
        name:
          type: string
          minLength: 1
        floor:
          type: string
        room:
          type: string
        bed:
          type: string
      required:
        - name
      additionalProperties: false
      example:
        name: Location 1
        floor: "1"
        room: "101"
        bed: "1"
    UpdateLocationInZoneDto:
      type: object
      properties:
        name:
          type: string
          minLength: 1
        floor:
          type: string
        room:
          type: string
        bed:
          type: string
        deviceId:
          oneOf:
            - type: string
              format: uuid
            - type: array
              items:
                type: string
                format: uuid
          nullable: true
        patientId:
          type: string
          format: uuid
      required:
        - name
      additionalProperties: false
      example:
        name: Location 1
        floor: "1"
        room: "101"
        bed: "1"
        deviceId: a5a74a6d-f092-78b8-8cb6-ea23b7d7f257
        patientId: de5c57ff-7257-57b0-13ab-aab6f5f91498
    DeleteLocationPreviewResponseDto:
      type: object
      properties:
        warning:
          type: string
        affected_devices:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
              name:
                type: string
            required:
              - id
        affected_residents:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
              name:
                type: string
            required:
              - id
      required:
        - affected_devices
        - affected_residents
      description: "Preview of location delete: warning message when devices/residents
        are affected, and lists of affected devices and residents."
    CarehubInviteNewPractitionerDto:
      type: object
      properties:
        email:
          type: string
          format: email
        name:
          type: string
          minLength: 1
        surname:
          type: string
          minLength: 1
        accessPolicyId:
          type: string
          format: uuid
        admin:
          default: false
          type: boolean
        projectId:
          type: string
          format: uuid
      required:
        - email
        - name
        - surname
        - accessPolicyId
      additionalProperties: false
    CarehubInviteResponseDto:
      type: object
      properties:
        membership:
          type: object
          properties:
            resourceType:
              type: string
              enum:
                - ProjectMembership
            id:
              type: string
            project:
              type: string
            user:
              type: object
              properties:
                reference:
                  type: string
              required:
                - reference
            profile:
              type: object
              properties:
                reference:
                  type: string
              required:
                - reference
            accessPolicy:
              type: object
              properties:
                reference:
                  type: string
                display:
                  type: string
              required:
                - reference
                - display
            meta:
              type: object
              properties:
                project:
                  type: string
                author:
                  type: object
                  properties:
                    reference:
                      type: string
                  required:
                    - reference
                lastUpdated:
                  type: string
          required:
            - resourceType
            - id
        profile:
          type: object
          properties:
            resourceType:
              type: string
              enum:
                - Practitioner
            id:
              type: string
            name:
              type: array
              items: {}
            meta:
              type: object
              properties:
                project:
                  type: string
                lastUpdated:
                  type: string
          required:
            - resourceType
            - id
        status:
          type: string
          enum:
            - Pending
      required:
        - membership
        - profile
        - status
      example:
        membership:
          resourceType: ProjectMembership
          id: d7f418aa-467d-d1ea-f0fc-d2dd841733e6
          project: f6f4da8d-93e8-8a08-220e-03b7810451d3
          user:
            reference: User/9f8a2389-a20c-a075-2aa9-e95093515517
          profile:
            reference: Practitioner/cd495e76-8385-ecb1-00a6-7e0381de4e42
          accessPolicy:
            reference: AccessPolicy/cca28116-f888-97bf-c336-5b992bd02672
            display: Practitioner Access Policy
          meta:
            project: f6f4da8d-93e8-8a08-220e-03b7810451d3
            author:
              reference: Practitioner/cd495e76-8385-ecb1-00a6-7e0381de4e42
            lastUpdated: 2026-08-16T17:06:17.445Z
        profile:
          resourceType: Practitioner
          id: cd495e76-8385-ecb1-00a6-7e0381de4e42
          name:
            - given:
                - Max
              family: Mustermann
          meta:
            project: f6f4da8d-93e8-8a08-220e-03b7810451d3
            lastUpdated: 2026-08-16T17:06:17.445Z
        status: Pending
    FindCustomersResponseDto:
      type: object
      properties:
        total:
          type: integer
          minimum: 0
          exclusiveMinimum: true
          description: The total number of customers in the system.
        resources:
          type: array
          items:
            type: object
            properties:
              customerId:
                type: string
                minLength: 1
                maxLength: 1024
                description: The ID of the customer.
              customerName:
                type: string
                minLength: 1
                maxLength: 1024
                description: The name of the customer.
              customerEmail:
                type: string
                format: email
                description: The email of the customer.
            required:
              - customerId
              - customerName
              - customerEmail
      required:
        - total
        - resources
      example:
        total: 1
        resources:
          - customerId: "123"
            customerName: John Doe
            customerEmail: john.doe@example.com
    FindDevicesByCustomerIdResponseDto:
      type: object
      properties:
        total:
          type: integer
          minimum: 0
          exclusiveMinimum: true
          description: The total number of devices in the system for the customer.
        resources:
          type: array
          items:
            type: object
            properties:
              projectId:
                type: string
                format: uuid
                description: The ID of the project the device is assigned to.
              customerId:
                type: string
                description: The ID of the customer the device is assigned to.
              serialNumber:
                type: string
                description: The serial number of the device.
              manufacturer:
                type: string
                description: The manufacturer of the device.
            required:
              - projectId
      required:
        - total
        - resources
      example:
        total: 1
        resources:
          - projectId: "123"
            customerId: "123"
            serialNumber: "1234567890"
            manufacturer: Manufacturer 1
    SapDeviceAndCustomerAssignmentDto:
      type: object
      properties:
        customerId:
          type: string
          minLength: 1
          maxLength: 1024
          description: The ID of the customer to assign. SAP Integration Customer ID.
        customerName:
          type: string
          minLength: 1
          maxLength: 1024
          description: The name of the customer to assign.
        customerEmail:
          type: string
          format: email
          description: The email of the customer to assign.
        devices:
          type: array
          items:
            type: object
            properties:
              serialNumber:
                type: string
                minLength: 1
                maxLength: 1024
                description: The serial number of the device to assign.
              manufacturer:
                type: string
                enum:
                  - Sleepiz
                description: The manufacturer of the device to assign.
            required:
              - serialNumber
              - manufacturer
          minItems: 0
          maxItems: 100
          description: The devices to assign to the customer.
      required:
        - customerId
        - customerName
        - customerEmail
        - devices
      example:
        customerId: "123"
        customerName: John Doe
        customerEmail: john.doe@example.com
        devices:
          - serialNumber: "1234567890"
            manufacturer: Manufacturer 1
          - serialNumber: "1234567891"
            manufacturer: Manufacturer 2
          - serialNumber: "1234567892"
            manufacturer: Manufacturer 1
    SapDeviceAndCustomerAssignmentResponseDto:
      type: object
      properties:
        customerId:
          type: string
          minLength: 1
          maxLength: 1024
          description: The ID of the customer to assign. SAP Integration Customer ID.
        customerName:
          type: string
          minLength: 1
          maxLength: 1024
          description: The name of the customer to assign.
        customerEmail:
          type: string
          format: email
          description: The email of the customer to assign.
      required:
        - customerId
        - customerName
        - customerEmail
      example:
        customerId: "123"
        customerName: John Doe
        customerEmail: john.doe@example.com
    SleepStatisticsResponseDto:
      type: object
      additionalProperties:
        type: object
        properties:
          totalSleepTimeSeconds:
            type: object
            properties:
              current:
                type: number
                nullable: true
              average:
                type: number
                nullable: true
              diff:
                type: number
                nullable: true
            required:
              - current
              - average
              - diff
          sleepEfficiencyPercentage:
            type: object
            properties:
              current:
                type: number
                nullable: true
              average:
                type: number
                nullable: true
              diff:
                type: number
                nullable: true
            required:
              - current
              - average
              - diff
          wakeAfterSleepOnsetSeconds:
            type: object
            properties:
              current:
                type: number
                nullable: true
              average:
                type: number
                nullable: true
              diff:
                type: number
                nullable: true
            required:
              - current
              - average
              - diff
          totalBedTimeSeconds:
            type: object
            properties:
              current:
                type: number
                nullable: true
              average:
                type: number
                nullable: true
              diff:
                type: number
                nullable: true
            required:
              - current
              - average
              - diff
          sleepStartTime:
            type: object
            properties:
              current:
                type: string
                nullable: true
              average:
                type: string
                nullable: true
              diff:
                type: number
                nullable: true
            required:
              - current
              - average
              - diff
          sleepEndTime:
            type: object
            properties:
              current:
                type: string
                nullable: true
              average:
                type: string
                nullable: true
              diff:
                type: number
                nullable: true
            required:
              - current
              - average
              - diff
          sleepOnsetLatencySeconds:
            type: object
            properties:
              current:
                type: number
                nullable: true
              average:
                type: number
                nullable: true
              diff:
                type: number
                nullable: true
            required:
              - current
              - average
              - diff
          outOfBedCount:
            type: object
            properties:
              current:
                type: number
                nullable: true
              average:
                type: number
                nullable: true
              diff:
                type: number
                nullable: true
            required:
              - current
              - average
              - diff
          wakeUpLatencySeconds:
            type: object
            properties:
              current:
                type: number
                nullable: true
              average:
                type: number
                nullable: true
              diff:
                type: number
                nullable: true
            required:
              - current
              - average
              - diff
        required:
          - totalSleepTimeSeconds
          - sleepEfficiencyPercentage
          - wakeAfterSleepOnsetSeconds
          - totalBedTimeSeconds
          - sleepStartTime
          - sleepEndTime
          - sleepOnsetLatencySeconds
          - outOfBedCount
          - wakeUpLatencySeconds
      example:
        device-123:
          totalSleepTimeSeconds:
            current: 28800
            average: 28000
            diff: 800
          sleepEfficiencyPercentage:
            current: 95
            average: 90
            diff: 5
          wakeAfterSleepOnsetSeconds:
            current: 300
            average: 400
            diff: -100
          totalBedTimeSeconds:
            current: 30000
            average: 30000
            diff: 0
          sleepStartTime:
            current: 2023-10-27T22:00:00.000Z
            average: 2023-10-27T22:10:00.000Z
            diff: -600
          sleepEndTime:
            current: 2023-10-28T06:00:00.000Z
            average: 2023-10-28T06:05:00.000Z
            diff: -300
          sleepOnsetLatencySeconds:
            current: 600
            average: 900
            diff: -300
          outOfBedCount:
            current: 1
            average: 1
            diff: 0
          wakeUpLatencySeconds:
            current: 300
            average: 300
            diff: 0
    CarehubEffectiveIdsMapResponseDto:
      type: object
      additionalProperties:
        type: object
        properties:
          heartRate:
            type: string
            nullable: true
          respiratoryRate:
            type: string
            nullable: true
          sleepStatus:
            type: string
            nullable: true
          presenceStatus:
            type: string
            nullable: true
        required:
          - heartRate
          - respiratoryRate
          - sleepStatus
          - presenceStatus
    CarehubLastSentIdsMapResponseDto:
      type: object
      additionalProperties:
        type: object
        properties:
          heartRate:
            type: string
            nullable: true
          respiratoryRate:
            type: string
            nullable: true
          sleepStatus:
            type: string
            nullable: true
          presenceStatus:
            type: string
            nullable: true
          batch:
            type: string
            nullable: true
        required:
          - heartRate
          - respiratoryRate
          - sleepStatus
          - presenceStatus
          - batch
    CarehubEffectiveIdsResponseDto:
      type: object
      properties:
        heartRate:
          type: string
          nullable: true
        respiratoryRate:
          type: string
          nullable: true
        sleepStatus:
          type: string
          nullable: true
        presenceStatus:
          type: string
          nullable: true
      required:
        - heartRate
        - respiratoryRate
        - sleepStatus
        - presenceStatus
    CarehubLastSentIdsResponseDto:
      type: object
      properties:
        heartRate:
          type: string
          nullable: true
        respiratoryRate:
          type: string
          nullable: true
        sleepStatus:
          type: string
          nullable: true
        presenceStatus:
          type: string
          nullable: true
        batch:
          type: string
          nullable: true
      required:
        - heartRate
        - respiratoryRate
        - sleepStatus
        - presenceStatus
        - batch
    CarehubDeviceTelemetryResponseDto:
      type: object
      properties:
        deviceId:
          type: string
        telemetry:
          type: object
          properties:
            active:
              type: object
              properties:
                value:
                  oneOf:
                    - type: string
                    - type: number
                    - type: boolean
                  nullable: true
                ts:
                  type: number
                  nullable: true
              required:
                - value
                - ts
            effectiveHeartRate:
              type: object
              properties:
                value:
                  oneOf:
                    - type: string
                    - type: number
                    - type: boolean
                  nullable: true
                ts:
                  type: number
                  nullable: true
              required:
                - value
                - ts
            effectiveRespiratoryRate:
              type: object
              properties:
                value:
                  oneOf:
                    - type: string
                    - type: number
                    - type: boolean
                  nullable: true
                ts:
                  type: number
                  nullable: true
              required:
                - value
                - ts
            effectiveSleepStatus:
              type: object
              properties:
                value:
                  oneOf:
                    - type: string
                    - type: number
                    - type: boolean
                  nullable: true
                ts:
                  type: number
                  nullable: true
              required:
                - value
                - ts
            lastMeasurementTime:
              type: object
              properties:
                value:
                  oneOf:
                    - type: string
                    - type: number
                    - type: boolean
                  nullable: true
                ts:
                  type: number
                  nullable: true
              required:
                - value
                - ts
            lastActivityTime:
              type: object
              properties:
                value:
                  oneOf:
                    - type: string
                    - type: number
                    - type: boolean
                  nullable: true
                ts:
                  type: number
                  nullable: true
              required:
                - value
                - ts
            name:
              type: object
              properties:
                value:
                  oneOf:
                    - type: string
                    - type: number
                    - type: boolean
                  nullable: true
                ts:
                  type: number
                  nullable: true
              required:
                - value
                - ts
          required:
            - active
            - effectiveHeartRate
            - effectiveRespiratoryRate
            - effectiveSleepStatus
            - lastMeasurementTime
            - lastActivityTime
            - name
        alerts:
          type: object
          properties:
            heartRate:
              type: object
              properties:
                alert:
                  type: boolean
                value:
                  type: object
                  additionalProperties: {}
                  nullable: true
                message:
                  type: object
                  additionalProperties: {}
                  nullable: true
                communicationRequestId:
                  type: string
                  nullable: true
                observationId:
                  type: string
                  nullable: true
                color:
                  type: string
                  nullable: true
                state:
                  type: string
                  enum:
                    - alert
                    - normal
                updatedAt:
                  type: string
                  nullable: true
              required:
                - alert
            respiratoryRate:
              type: object
              properties:
                alert:
                  type: boolean
                value:
                  type: object
                  additionalProperties: {}
                  nullable: true
                message:
                  type: object
                  additionalProperties: {}
                  nullable: true
                communicationRequestId:
                  type: string
                  nullable: true
                observationId:
                  type: string
                  nullable: true
                color:
                  type: string
                  nullable: true
                state:
                  type: string
                  enum:
                    - alert
                    - normal
                updatedAt:
                  type: string
                  nullable: true
              required:
                - alert
            outOfBed:
              type: object
              properties:
                outOfBed:
                  type: boolean
                  enum:
                    - true
                communicationRequestId:
                  type: string
                sinceTime:
                  type: string
              required:
                - outOfBed
                - communicationRequestId
                - sinceTime
              nullable: true
          required:
            - heartRate
            - respiratoryRate
            - outOfBed
      required:
        - deviceId
    CarehubPractitionerDto:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        surname:
          type: string
        email:
          type: string
          format: email
        phone:
          type: string
        address:
          type: object
          properties:
            line:
              type: string
            city:
              type: string
            state:
              type: string
            postalCode:
              type: string
            country:
              type: string
        photo:
          type: string
          format: uri
        meta:
          type: object
          properties:
            author:
              type: string
              pattern: ^[A-Za-z]+\/[A-Za-z0-9-]+$
      example:
        name: John
        surname: Doe
        email: john.doe@example.com
        phone: "+491234567890"
        address:
          line: 123 Main St
          city: Anytown
          state: NY
          postalCode: "12345"
          country: USA
    CarehubNotificationsResponseDto:
      type: object
      properties:
        total:
          type: number
        page:
          type: number
        count:
          type: number
        resources:
          type: array
          items:
            type: object
            properties:
              commId:
                type: string
              patientId:
                type: string
              patientName:
                type: string
              deviceId:
                type: string
              deviceName:
                type: string
              deviceStatus:
                type: string
              locationId:
                type: string
              locationName:
                type: string
              color:
                type: string
              trigger:
                type: string
                enum:
                  - above
                  - below
              type:
                type: string
                enum:
                  - hr
                  - br
                  - outOfBed
              status:
                type: string
                enum:
                  - draft
                  - active
                  - on-hold
                  - revoked
                  - completed
                  - entered-in-error
                  - unknown
              details:
                type: object
                properties:
                  threshold:
                    type: number
                  value:
                    type: number
                  level:
                    type: string
              authoredOn:
                type: string
                format: date-time
              alertCount:
                type: integer
                minimum: 0
                exclusiveMinimum: true
              occurrenceDateTime:
                type: string
                format: date-time
              episodeEndedAt:
                type: string
                format: date-time
              effectiveTimestamp:
                type: string
                format: date-time
              latestObservationTimestamp:
                type: string
                format: date-time
            required:
              - commId
            example: &a70
              commId: 2adae28d-6664-74a9-3f4c-cad5f551ce1e
              patientId: de5c57ff-7257-57b0-13ab-aab6f5f91498
              patientName: Jane Doe
              deviceId: a5a74a6d-f092-78b8-8cb6-ea23b7d7f257
              deviceName: Sleepiz/300SM06
              deviceStatus: active
              locationId: d219c681-01f5-32de-10ad-d2cf42fb9dbe
              locationName: Room 401
              color: "#E5254B"
              trigger: above
              type: outOfBed
              status: active
              details:
                threshold: 600
                value: 602
                level: high
              authoredOn: 2026-08-16T17:06:17.445Z
              alertCount: 5
              occurrenceDateTime: 2026-08-16T17:06:17.445Z
              effectiveTimestamp: 2026-08-16T17:06:17.445Z
              latestObservationTimestamp: 2026-08-16T17:06:17.445Z
      required:
        - total
        - page
        - count
        - resources
      example:
        total: 2
        page: 0
        count: 20
        resources:
          - commId: 2adae28d-6664-74a9-3f4c-cad5f551ce1e
            status: active
            authoredOn: 2026-08-16T17:06:17.445Z
            type: hr
    CarehubNotificationsRecentResponseDto:
      type: object
      properties:
        recent:
          type: array
          items:
            type: object
            properties:
              commId:
                type: string
              patientId:
                type: string
              patientName:
                type: string
              deviceId:
                type: string
              deviceName:
                type: string
              deviceStatus:
                type: string
              locationId:
                type: string
              locationName:
                type: string
              color:
                type: string
              trigger:
                type: string
                enum:
                  - above
                  - below
              type:
                type: string
                enum:
                  - hr
                  - br
                  - outOfBed
              status:
                type: string
                enum:
                  - draft
                  - active
                  - on-hold
                  - revoked
                  - completed
                  - entered-in-error
                  - unknown
              details:
                type: object
                properties:
                  threshold:
                    type: number
                  value:
                    type: number
                  level:
                    type: string
              authoredOn:
                type: string
                format: date-time
              alertCount:
                type: integer
                minimum: 0
                exclusiveMinimum: true
              occurrenceDateTime:
                type: string
                format: date-time
              episodeEndedAt:
                type: string
                format: date-time
              effectiveTimestamp:
                type: string
                format: date-time
              latestObservationTimestamp:
                type: string
                format: date-time
            required:
              - commId
            example: *a70
        total:
          type: integer
          minimum: 0
        warm:
          type: boolean
        source:
          type: string
          enum:
            - redis
            - medplum
      required:
        - recent
        - total
        - warm
        - source
      example:
        recent: []
        total: 0
        warm: true
        source: redis
    CarehubNotificationResponseDto:
      type: object
      properties:
        commId:
          type: string
        patientId:
          type: string
        patientName:
          type: string
        deviceId:
          type: string
        deviceName:
          type: string
        deviceStatus:
          type: string
        locationId:
          type: string
        locationName:
          type: string
        color:
          type: string
        trigger:
          type: string
          enum:
            - above
            - below
        type:
          type: string
          enum:
            - hr
            - br
            - outOfBed
        status:
          type: string
          enum:
            - draft
            - active
            - on-hold
            - revoked
            - completed
            - entered-in-error
            - unknown
        details:
          type: object
          properties:
            threshold:
              type: number
            value:
              type: number
            level:
              type: string
        authoredOn:
          type: string
          format: date-time
        alertCount:
          type: integer
          minimum: 0
          exclusiveMinimum: true
        occurrenceDateTime:
          type: string
          format: date-time
        episodeEndedAt:
          type: string
          format: date-time
        effectiveTimestamp:
          type: string
          format: date-time
        latestObservationTimestamp:
          type: string
          format: date-time
      required:
        - commId
      example: *a70
    GetGraphsDataResponseDto:
      type: object
      additionalProperties:
        type: object
        additionalProperties:
          type: object
          properties:
            dataPoints:
              type: array
              items:
                type: object
                properties:
                  timestamp:
                    type: string
                  timestampMs:
                    type: number
                  data:
                    type: number
                    nullable: true
                  maxThreshold:
                    type: number
                  minThreshold:
                    type: number
                  maxBaseLine:
                    type: number
                  minBaseLine:
                    type: number
                  pointTimestamp:
                    type: string
                  pointTimestampRange:
                    type: object
                    properties:
                      start:
                        type: string
                      end:
                        type: string
                required:
                  - timestamp
                  - timestampMs
                  - data
            stats:
              type: object
              properties:
                average:
                  type: number
                max:
                  type: number
                min:
                  type: number
                total:
                  type: number
              required:
                - average
                - max
                - min
                - total
          required:
            - dataPoints
            - stats
      description: Trends data grouped by graph type and device ID
    DocumensoDocumentStatusDto:
      type: object
      properties:
        event:
          type: string
          enum:
            - DOCUMENT_COMPLETED
            - DOCUMENT_REJECTED
        payload:
          type: object
          properties:
            externalId:
              type: string
              description: The external ID of the document, we use it to identify the resource
                in our system! ie. ResourceType/ResourceId
          required:
            - externalId
      required:
        - event
        - payload
      additionalProperties: true
    DocportChangePatientDto:
      type: object
      properties:
        serialNumber:
          type: string
          minLength: 1
          description: Device serial number
        patientNumber:
          type: string
          minLength: 1
          description: Unique patient number
        patientName:
          type: object
          properties:
            suffix:
              type: string
              minLength: 1
              description: Name suffix
            firstName:
              type: string
              minLength: 1
              description: First name
            surname:
              type: string
              minLength: 1
              description: Surname
          required:
            - suffix
            - firstName
            - surname
        dateOfBirth:
          type: string
          minLength: 1
          description: Date of birth
        gender:
          type: string
          enum:
            - male
            - female
            - other
            - unknown
          description: Gender
        examinationDateTime:
          type: string
          minLength: 1
          format: date-time
          description: Examination datetime
        examinationLocation:
          type: string
          minLength: 1
          description: Examination location
        examinationRoom:
          type: string
          minLength: 1
          description: Examination room
        scheduledMeasurement:
          type: array
          items:
            type: string
            enum:
              - ECG
              - WEIGHT
              - BP
              - SPO2
          minItems: 1
          description: Scheduled measurement
      required:
        - serialNumber
        - patientNumber
        - patientName
        - dateOfBirth
        - gender
        - examinationDateTime
        - examinationLocation
        - examinationRoom
        - scheduledMeasurement
      example:
        serialNumber: HGR4NJW8
        patientNumber: "12345"
        patientName:
          suffix: Dr.
          firstName: John
          surname: Doe
        dateOfBirth: 1980-01-01
        gender: male
        examinationDateTime: 2025-09-23T10:00:00Z
        examinationLocation: Hospital A
        examinationRoom: Room 101
        scheduledMeasurement:
          - ECG
          - WEIGHT
          - BP
    ChangePatientResponseDto:
      type: object
      properties:
        patient:
          type: object
          properties:
            resourceType:
              type: string
              enum:
                - Patient
            id:
              type: string
              description: Resource ID
            meta:
              type: object
              properties: {}
              description: Resource metadata
            name:
              type: array
              items:
                type: object
                properties:
                  suffix:
                    type: array
                    items:
                      type: string
                  given:
                    type: array
                    items:
                      type: string
                  family:
                    type: string
                  text:
                    type: string
              description: Patient names
            gender:
              type: string
              enum:
                - male
                - female
                - other
                - unknown
              description: Patient gender
            birthDate:
              type: string
              description: Date of birth
            identifier:
              type: array
              items:
                type: object
                properties:
                  system:
                    type: string
                  value:
                    type: string
              description: Patient identifiers
          required:
            - resourceType
          additionalProperties: true
          description: The created or updated patient resource
        serviceRequest:
          type: object
          properties:
            resourceType:
              type: string
              enum:
                - ServiceRequest
            id:
              type: string
              description: Resource ID
            meta:
              type: object
              properties: {}
              description: Resource metadata
            status:
              type: string
              description: Request status
            intent:
              type: string
              description: Request intent
            subject:
              type: object
              properties:
                reference:
                  type: string
              required:
                - reference
              description: Subject reference
            occurrenceDateTime:
              type: string
              description: Occurrence date and time
          required:
            - resourceType
            - status
            - intent
            - subject
          additionalProperties: true
          description: The created or updated service request for measurements
        device:
          type: object
          properties:
            resourceType:
              type: string
              enum:
                - Device
            id:
              type: string
              description: Resource ID
            meta:
              type: object
              properties: {}
              description: Resource metadata
            patient:
              type: object
              properties:
                reference:
                  type: string
              required:
                - reference
              description: Associated patient reference
            identifier:
              type: array
              items:
                type: object
                properties:
                  system:
                    type: string
                  value:
                    type: string
              description: Device identifiers
          required:
            - resourceType
          additionalProperties: true
          description: The updated device resource associated with the patient
      required:
        - patient
        - serviceRequest
        - device
      example:
        patient:
          resourceType: Patient
          id: patient-123
          name:
            - suffix:
                - Dr.
              given:
                - John
              family: Doe
              text: Dr. John Doe
          gender: male
          birthDate: 1980-01-01
          identifier:
            - system: https://actimi.com/patient-number
              value: "12345"
        serviceRequest:
          resourceType: ServiceRequest
          id: service-request-456
          status: active
          intent: order
          subject:
            reference: Patient/patient-123
          occurrenceDateTime: 2025-09-23T10:00:00Z
        device:
          resourceType: Device
          id: device-789
          patient:
            reference: Patient/patient-123
          identifier:
            - system: https://actimi.com/device-serial
              value: HGR4NJW8
    DocportGetPatientPDFDto:
      type: object
      properties:
        patientNumber:
          type: string
          minLength: 1
          description: Unique patient number
        dateRange:
          type: object
          properties:
            start:
              type: string
              minLength: 1
              format: date-time
              description: Start date
            end:
              type: string
              minLength: 1
              format: date-time
              description: End date
          required:
            - start
            - end
      required:
        - patientNumber
        - dateRange
      example:
        patientNumber: "12"
        dateRange:
          start: 2025-01-01T00:00:00Z
          end: 2025-01-01T00:00:00Z
    CreatePatientPDFResponseDto:
      type: object
      properties:
        pdfUrl:
          type: string
          format: uri
          description: Public URL to access the generated ECG PDF report
      required:
        - pdfUrl
      example:
        pdfUrl: https://api.example.com/document/public/abc123-def456-ghi789
    DocportCreateClinicDto:
      type: object
      properties:
        clinic:
          type: object
          properties:
            name:
              type: string
              minLength: 1
          required:
            - name
        devices:
          type: array
          items:
            type: object
            properties:
              name:
                type: string
                minLength: 1
              serialNumber:
                type: string
                minLength: 1
            required:
              - name
              - serialNumber
        userAccount:
          type: object
          properties:
            email:
              type: string
              format: email
            password:
              type: string
              minLength: 8
            firstName:
              type: string
              minLength: 1
            lastName:
              type: string
              minLength: 1
          required:
            - email
            - password
            - firstName
            - lastName
      required:
        - clinic
        - userAccount
      example:
        clinic:
          name: Medical Center Alpha
        userAccount:
          email: admin@medicalcenter.com
          password: SecurePassword123!
          firstName: John
          lastName: Smith
        devices:
          - name: ECG Monitor Station 1
            serialNumber: HGR4NJW8
          - name: Blood Pressure Monitor
            serialNumber: BP001234
    CreateClinicResponseDto:
      type: object
      properties:
        clientId:
          type: string
          description: OAuth2 client ID for the created clinic
        clientSecret:
          type: string
          description: OAuth2 client secret for the created clinic
      required:
        - clientId
        - clientSecret
      example:
        clientId: cl_1234567890abcdef
        clientSecret: cs_abcdef1234567890fedcba0987654321
    PatientObservationResponseDto:
      type: object
      properties:
        resourceType:
          type: string
          enum:
            - Bundle
        type:
          type: string
          enum:
            - searchset
        entry:
          type: array
          items:
            type: object
            properties:
              resource:
                type: object
                properties:
                  id:
                    default: 87ea5dfc-8b8e-384d-8489-79496e706390
                    type: string
                  resourceType:
                    type: string
                    enum:
                      - Observation
                required:
                  - resourceType
                example:
                  id: 87ea5dfc-8b8e-384d-8489-79496e706390
                  resourceType: Observation
              fullUrl:
                type: string
            required:
              - resource
              - fullUrl
      required:
        - resourceType
        - type
        - entry
      example:
        resourceType: Bundle
        type: searchset
        entry:
          - resource:
              id: 87ea5dfc-8b8e-384d-8489-79496e706390
              resourceType: Observation
            fullUrl: https://fhir.ovok.com/fhir/R4/Observation/87ea5dfc-8b8e-384d-8489-79496e706390
    DeviceTelemetryResponseDto:
      type: object
      properties:
        resourceType:
          type: string
          enum:
            - Bundle
        type:
          type: string
          enum:
            - searchset
        total:
          type: number
        entry:
          type: array
          items:
            type: object
            properties:
              resource:
                type: object
                properties:
                  resourceType:
                    type: string
                    enum:
                      - Observation
                  id:
                    type: string
                  status:
                    type: string
                required:
                  - resourceType
                  - id
                  - status
                additionalProperties: true
                example:
                  resourceType: Observation
                  id: heartRate
                  status: final
                  code:
                    coding:
                      - system: http://loinc.org
                        code: 8867-4
                        display: Heart rate
                  subject:
                    reference: Device/87ea5dfc-8b8e-384d-8489-79496e706390
                  effectiveInstant: 2026-04-22T10:00:00.000Z
                  valueQuantity:
                    value: 72
                    unit: beats/min
                    system: http://unitsofmeasure.org
                    code: /min
              fullUrl:
                type: string
            required:
              - resource
      required:
        - resourceType
        - type
        - entry
      example:
        resourceType: Bundle
        type: searchset
        total: 4
        entry:
          - resource:
              resourceType: Observation
              id: presence
              status: final
              code:
                coding:
                  - system: https://sleepiz.com/fhir/CodeSystem/observation-codes
                    code: presence-detection
                    display: Presence detection
              subject:
                reference: Device/87ea5dfc-8b8e-384d-8489-79496e706390
              effectiveInstant: 2026-04-22T10:00:00.000Z
              valueBoolean: true
          - resource:
              resourceType: Observation
              id: heartRate
              status: final
              code:
                coding:
                  - system: http://loinc.org
                    code: 8867-4
                    display: Heart rate
              subject:
                reference: Device/87ea5dfc-8b8e-384d-8489-79496e706390
              effectiveInstant: 2026-04-22T10:00:00.000Z
              valueQuantity:
                value: 72
                unit: beats/min
                system: http://unitsofmeasure.org
                code: /min
          - resource:
              resourceType: Observation
              id: respiratoryRate
              status: final
              code:
                coding:
                  - system: http://loinc.org
                    code: 9279-1
                    display: Respiratory rate
              subject:
                reference: Device/87ea5dfc-8b8e-384d-8489-79496e706390
              effectiveInstant: 2026-04-22T10:00:00.000Z
              valueQuantity:
                value: 14
                unit: breaths/min
                system: http://unitsofmeasure.org
                code: /min
          - resource:
              resourceType: Observation
              id: sleep
              status: final
              code:
                coding:
                  - system: http://loinc.org
                    code: 107145-5
                    display: Sleep status
              subject:
                reference: Device/87ea5dfc-8b8e-384d-8489-79496e706390
              effectiveInstant: 2026-04-22T10:00:00.000Z
              valueCodeableConcept:
                text: asleep
    PopulateBodyRequestDto:
      type: object
      properties:
        resourceType:
          type: string
          enum:
            - Parameters
        parameter:
          type: array
          items:
            oneOf:
              - type: object
                properties:
                  name:
                    type: string
                    enum:
                      - context
                  part:
                    type: array
                    items:
                      oneOf:
                        - type: object
                          properties:
                            name:
                              type: string
                              enum:
                                - name
                            valueString:
                              type: string
                              minLength: 1
                          required:
                            - name
                            - valueString
                        - type: object
                          properties:
                            name:
                              type: string
                              enum:
                                - content
                            resource:
                              type: object
                              properties: {}
                              additionalProperties: true
                          required:
                            - name
                            - resource
                    minItems: 2
                    maxItems: 2
                required:
                  - name
                  - part
              - type: object
                properties:
                  name:
                    type: string
                    enum:
                      - response
                  resource:
                    type: object
                    properties: {}
                    additionalProperties: true
                required:
                  - name
                  - resource
      required:
        - resourceType
        - parameter
      additionalProperties: true
      example:
        resourceType: Parameters
        parameter:
          - name: context
            part:
              - name: name
                valueString: patientWeight
              - name: content
                resource:
                  valueDecimal: 66.5
    PopulateBodyResponseDto:
      type: object
      properties:
        resourceType:
          type: string
          enum:
            - QuestionnaireResponse
        questionnaire:
          type: string
        subject:
          type: object
          properties: {}
        item:
          type: array
          items:
            type: object
            properties: {}
      required:
        - resourceType
        - questionnaire
        - subject
        - item
      additionalProperties: true
      example:
        resourceType: Parameters
        parameter:
          - name: response
            resource:
              resourceType: QuestionnaireResponse
              status: in-progress
              questionnaire: https://fhir.ovok.com/fhir/Questionnaire/59d9a1ce-008c-4e4f-97fb-ef598d3f2c34|0.1.0
              item:
                - linkId: bmi-calculation
                  text: BMI Calculation
                  item:
                    - linkId: bmi-result
                      answer:
                        - valueDecimal: 32.7
                      text: Value
                    - linkId: patient-height
                      text: Height
                      answer:
                        - valueDecimal: 175
                    - linkId: patient-weight
                      text: Weight
                      answer:
                        - valueDecimal: 100
              subject:
                type: Patient
                reference: Patient/1684f841-953a-41c2-a298-64af08945349
              meta:
                profile:
                  - http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaireresponse
    ExtractBodyResponseDto:
      type: object
      properties:
        resourceType:
          type: string
          enum:
            - Observation
        id:
          type: string
      required:
        - resourceType
        - id
      additionalProperties: true
      example:
        resourceType: Parameters
        parameter:
          - name: response
            resource:
              resourceType: Bundle
              type: transaction
              entry:
                - request:
                    method: POST
                    url: Observation
                  resource:
                    resourceType: Observation
                    status: final
                    code:
                      coding:
                        - system: http://snomed.info/sct
                          code: "60621009"
                          display: Body mass index
                    subject:
                      type: Patient
                      reference: Patient/1684f841-953a-41c2-a298-64af08945349
                    derivedFrom:
                      - reference: QuestionnaireResponse/26073103-8a48-4fed-8f38-b1b1e39f4083
                    valueQuantity:
                      value: 32.7
    RuleChainListResponseDto:
      type: object
      properties:
        total:
          type: number
        resources:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
              name:
                type: string
              status:
                type: string
                enum:
                  - draft
                  - published
              version:
                type: number
              graph:
                type: object
                properties:
                  nodes:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                          minLength: 1
                        type:
                          type: string
                          enum:
                            - trigger.telemetry
                            - trigger.signal
                            - condition.threshold
                            - condition.exists
                            - action.fetch-resource
                            - action.lua
                            - action.bot
                            - action.webhook
                            - action.store-fhir
                            - action.raise-cr
                            - action.enrich
                            - action.dedup
                            - action.send-to-signals
                            - action.set-live-key
                            - action.switch
                        config:
                          type: object
                          additionalProperties: {}
                          nullable: true
                        position:
                          type: object
                          properties:
                            x:
                              type: number
                            y:
                              type: number
                          required:
                            - x
                            - y
                          nullable: true
                      required:
                        - id
                        - type
                        - config
                        - position
                  edges:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                          minLength: 1
                        source:
                          type: string
                          minLength: 1
                        target:
                          type: string
                          minLength: 1
                        sourceHandle:
                          type: string
                          nullable: true
                      required:
                        - id
                        - source
                        - target
                        - sourceHandle
                required:
                  - nodes
                  - edges
              publishedGraph:
                type: object
                properties:
                  nodes:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                          minLength: 1
                        type:
                          type: string
                          enum:
                            - trigger.telemetry
                            - trigger.signal
                            - condition.threshold
                            - condition.exists
                            - action.fetch-resource
                            - action.lua
                            - action.bot
                            - action.webhook
                            - action.store-fhir
                            - action.raise-cr
                            - action.enrich
                            - action.dedup
                            - action.send-to-signals
                            - action.set-live-key
                            - action.switch
                        config:
                          type: object
                          additionalProperties: {}
                          nullable: true
                        position:
                          type: object
                          properties:
                            x:
                              type: number
                            y:
                              type: number
                          required:
                            - x
                            - y
                          nullable: true
                      required:
                        - id
                        - type
                        - config
                        - position
                  edges:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                          minLength: 1
                        source:
                          type: string
                          minLength: 1
                        target:
                          type: string
                          minLength: 1
                        sourceHandle:
                          type: string
                          nullable: true
                      required:
                        - id
                        - source
                        - target
                        - sourceHandle
                required:
                  - nodes
                  - edges
                nullable: true
              updatedAt:
                type: string
                nullable: true
            required:
              - id
              - name
              - status
              - version
              - graph
              - publishedGraph
              - updatedAt
      required:
        - total
        - resources
    CreateRuleChainDto:
      type: object
      properties:
        name:
          type: string
          minLength: 1
          maxLength: 200
        graph:
          type: object
          properties:
            nodes:
              type: array
              items:
                type: object
                properties:
                  id:
                    type: string
                    minLength: 1
                  type:
                    type: string
                    enum:
                      - trigger.telemetry
                      - trigger.signal
                      - condition.threshold
                      - condition.exists
                      - action.fetch-resource
                      - action.lua
                      - action.bot
                      - action.webhook
                      - action.store-fhir
                      - action.raise-cr
                      - action.enrich
                      - action.dedup
                      - action.send-to-signals
                      - action.set-live-key
                      - action.switch
                  config:
                    type: object
                    additionalProperties: {}
                    nullable: true
                  position:
                    type: object
                    properties:
                      x:
                        type: number
                      y:
                        type: number
                    required:
                      - x
                      - y
                    nullable: true
                required:
                  - id
                  - type
                  - config
                  - position
            edges:
              type: array
              items:
                type: object
                properties:
                  id:
                    type: string
                    minLength: 1
                  source:
                    type: string
                    minLength: 1
                  target:
                    type: string
                    minLength: 1
                  sourceHandle:
                    type: string
                    nullable: true
                required:
                  - id
                  - source
                  - target
                  - sourceHandle
          required:
            - nodes
            - edges
      required:
        - name
        - graph
    RuleChainResponseDto:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        status:
          type: string
          enum:
            - draft
            - published
        version:
          type: number
        graph:
          type: object
          properties:
            nodes:
              type: array
              items:
                type: object
                properties:
                  id:
                    type: string
                    minLength: 1
                  type:
                    type: string
                    enum:
                      - trigger.telemetry
                      - trigger.signal
                      - condition.threshold
                      - condition.exists
                      - action.fetch-resource
                      - action.lua
                      - action.bot
                      - action.webhook
                      - action.store-fhir
                      - action.raise-cr
                      - action.enrich
                      - action.dedup
                      - action.send-to-signals
                      - action.set-live-key
                      - action.switch
                  config:
                    type: object
                    additionalProperties: {}
                    nullable: true
                  position:
                    type: object
                    properties:
                      x:
                        type: number
                      y:
                        type: number
                    required:
                      - x
                      - y
                    nullable: true
                required:
                  - id
                  - type
                  - config
                  - position
            edges:
              type: array
              items:
                type: object
                properties:
                  id:
                    type: string
                    minLength: 1
                  source:
                    type: string
                    minLength: 1
                  target:
                    type: string
                    minLength: 1
                  sourceHandle:
                    type: string
                    nullable: true
                required:
                  - id
                  - source
                  - target
                  - sourceHandle
          required:
            - nodes
            - edges
        publishedGraph:
          type: object
          properties:
            nodes:
              type: array
              items:
                type: object
                properties:
                  id:
                    type: string
                    minLength: 1
                  type:
                    type: string
                    enum:
                      - trigger.telemetry
                      - trigger.signal
                      - condition.threshold
                      - condition.exists
                      - action.fetch-resource
                      - action.lua
                      - action.bot
                      - action.webhook
                      - action.store-fhir
                      - action.raise-cr
                      - action.enrich
                      - action.dedup
                      - action.send-to-signals
                      - action.set-live-key
                      - action.switch
                  config:
                    type: object
                    additionalProperties: {}
                    nullable: true
                  position:
                    type: object
                    properties:
                      x:
                        type: number
                      y:
                        type: number
                    required:
                      - x
                      - y
                    nullable: true
                required:
                  - id
                  - type
                  - config
                  - position
            edges:
              type: array
              items:
                type: object
                properties:
                  id:
                    type: string
                    minLength: 1
                  source:
                    type: string
                    minLength: 1
                  target:
                    type: string
                    minLength: 1
                  sourceHandle:
                    type: string
                    nullable: true
                required:
                  - id
                  - source
                  - target
                  - sourceHandle
          required:
            - nodes
            - edges
          nullable: true
        updatedAt:
          type: string
          nullable: true
      required:
        - id
        - name
        - status
        - version
        - graph
        - publishedGraph
        - updatedAt
    NodeCatalogResponseDto:
      type: object
      properties:
        resources:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
              label:
                type: string
              category:
                type: string
                enum:
                  - trigger
                  - condition
                  - action
              description:
                type: string
              inputs:
                type: number
              outputs:
                oneOf:
                  - type: number
                  - type: string
                    enum:
                      - branch
              configSchema:
                type: object
                additionalProperties: {}
              capabilityClass:
                type: string
                nullable: true
            required:
              - id
              - label
              - category
              - description
              - inputs
              - outputs
              - configSchema
              - capabilityClass
      required:
        - resources
    UpdateRuleChainDto:
      type: object
      properties:
        name:
          type: string
          minLength: 1
          maxLength: 200
          nullable: true
        graph:
          type: object
          properties:
            nodes:
              type: array
              items:
                type: object
                properties:
                  id:
                    type: string
                    minLength: 1
                  type:
                    type: string
                    enum:
                      - trigger.telemetry
                      - trigger.signal
                      - condition.threshold
                      - condition.exists
                      - action.fetch-resource
                      - action.lua
                      - action.bot
                      - action.webhook
                      - action.store-fhir
                      - action.raise-cr
                      - action.enrich
                      - action.dedup
                      - action.send-to-signals
                      - action.set-live-key
                      - action.switch
                  config:
                    type: object
                    additionalProperties: {}
                    nullable: true
                  position:
                    type: object
                    properties:
                      x:
                        type: number
                      y:
                        type: number
                    required:
                      - x
                      - y
                    nullable: true
                required:
                  - id
                  - type
                  - config
                  - position
            edges:
              type: array
              items:
                type: object
                properties:
                  id:
                    type: string
                    minLength: 1
                  source:
                    type: string
                    minLength: 1
                  target:
                    type: string
                    minLength: 1
                  sourceHandle:
                    type: string
                    nullable: true
                required:
                  - id
                  - source
                  - target
                  - sourceHandle
          required:
            - nodes
            - edges
          nullable: true
      required:
        - name
        - graph
    RuleChainValidationResponseDto:
      type: object
      properties:
        valid:
          type: boolean
        issues:
          type: array
          items:
            type: object
            properties:
              code:
                type: string
                enum:
                  - cycle
                  - orphan-node
                  - unknown-node-type
                  - invalid-config
                  - lua-syntax
                  - lua-sast
                  - dangling-edge
                  - no-trigger
                  - duplicate-node-id
                  - capability-denied
              nodeId:
                type: string
                nullable: true
              message:
                type: string
            required:
              - code
              - nodeId
              - message
      required:
        - valid
        - issues
    RuleChainExecutionsResponseDto:
      type: object
      properties:
        total:
          type: number
        resources:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
              chainId:
                type: string
              startedAt:
                type: string
                nullable: true
              finishedAt:
                type: string
                nullable: true
              status:
                type: string
                enum:
                  - succeeded
                  - failed
                  - timeout
            required:
              - id
              - chainId
              - startedAt
              - finishedAt
              - status
      required:
        - total
        - resources
    i18nGetDto:
      type: object
      properties:
        key:
          type: string
          pattern: ^[a-zA-Z0-9_-]+$
          description: Alphabetic key
        language:
          type: string
      required:
        - key
        - language
      example:
        page:
          about: about
          contact: contact
          home:
            title: home
    i18nPatchDto:
      type: object
      additionalProperties:
        oneOf:
          - type: string
            minLength: 1
            maxLength: 4096
          - {}
        description: Either a string value or a nested object that can only contain
          alphabetic keys (or nested objects...)
      example:
        page:
          about: about
          contact: contact
          phone: null
          home:
            title: home
    PaginatedMapSearchResponseDto:
      type: object
      properties:
        total:
          type: number
        resources:
          type: array
          items:
            type: object
            properties:
              source:
                type: object
                properties:
                  id:
                    type: string
                  key:
                    type: string
                    pattern: ^[a-zA-Z0-9_-][a-zA-Z0-9_\-.]*$
                    example: home.screen.title
                  language:
                    type: string
                    enum:
                      - Cy-az-AZ
                      - Cy-sr-SP
                      - Cy-uz-UZ
                      - Lt-az-AZ
                      - Lt-sr-SP
                      - Lt-uz-UZ
                      - aa
                      - ab
                      - ae
                      - af
                      - af-ZA
                      - ak
                      - am
                      - an
                      - ar
                      - ar-AE
                      - ar-BH
                      - ar-DZ
                      - ar-EG
                      - ar-IQ
                      - ar-JO
                      - ar-KW
                      - ar-LB
                      - ar-LY
                      - ar-MA
                      - ar-OM
                      - ar-QA
                      - ar-SA
                      - ar-SY
                      - ar-TN
                      - ar-YE
                      - as
                      - av
                      - ay
                      - az
                      - ba
                      - be
                      - be-BY
                      - bg
                      - bg-BG
                      - bh
                      - bi
                      - bm
                      - bn
                      - bo
                      - br
                      - bs
                      - ca
                      - ca-ES
                      - ce
                      - ch
                      - co
                      - cr
                      - cs
                      - cs-CZ
                      - cu
                      - cv
                      - cy
                      - da
                      - da-DK
                      - de
                      - de-AT
                      - de-CH
                      - de-DE
                      - de-LI
                      - de-LU
                      - div-MV
                      - dv
                      - dz
                      - ee
                      - el
                      - el-GR
                      - en
                      - en-AU
                      - en-BZ
                      - en-CA
                      - en-CB
                      - en-GB
                      - en-IE
                      - en-JM
                      - en-NZ
                      - en-PH
                      - en-TT
                      - en-US
                      - en-ZA
                      - en-ZW
                      - eo
                      - es
                      - es-AR
                      - es-BO
                      - es-CL
                      - es-CO
                      - es-CR
                      - es-DO
                      - es-EC
                      - es-ES
                      - es-GT
                      - es-HN
                      - es-MX
                      - es-NI
                      - es-PA
                      - es-PE
                      - es-PR
                      - es-PY
                      - es-SV
                      - es-UY
                      - es-VE
                      - et
                      - et-EE
                      - eu
                      - eu-ES
                      - fa
                      - fa-IR
                      - ff
                      - fi
                      - fi-FI
                      - fj
                      - fo
                      - fo-FO
                      - fr
                      - fr-BE
                      - fr-CA
                      - fr-CH
                      - fr-FR
                      - fr-LU
                      - fr-MC
                      - fy
                      - ga
                      - gd
                      - gl
                      - gl-ES
                      - gn
                      - gu
                      - gu-IN
                      - gv
                      - ha
                      - he
                      - he-IL
                      - hi
                      - hi-IN
                      - ho
                      - hr
                      - hr-HR
                      - ht
                      - hu
                      - hu-HU
                      - hy
                      - hy-AM
                      - hz
                      - ia
                      - id
                      - id-ID
                      - ie
                      - ig
                      - ii
                      - ik
                      - io
                      - is
                      - is-IS
                      - it
                      - it-CH
                      - it-IT
                      - iu
                      - ja
                      - ja-JP
                      - jv
                      - ka
                      - ka-GE
                      - kg
                      - ki
                      - kj
                      - kk
                      - kk-KZ
                      - kl
                      - km
                      - kn
                      - kn-IN
                      - ko
                      - ko-KR
                      - kr
                      - ks
                      - ku
                      - kv
                      - kw
                      - ky
                      - ky-KZ
                      - la
                      - lb
                      - lg
                      - li
                      - ln
                      - lo
                      - lt
                      - lt-LT
                      - lu
                      - lv
                      - lv-LV
                      - mg
                      - mh
                      - mi
                      - mk
                      - mk-MK
                      - ml
                      - mn
                      - mn-MN
                      - mr
                      - mr-IN
                      - ms
                      - ms-BN
                      - ms-MY
                      - mt
                      - my
                      - na
                      - nb
                      - nb-NO
                      - nd
                      - ne
                      - ng
                      - nl
                      - nl-BE
                      - nl-NL
                      - nn
                      - nn-NO
                      - no
                      - nr
                      - nv
                      - ny
                      - oc
                      - oj
                      - om
                      - or
                      - os
                      - pa
                      - pa-IN
                      - pi
                      - pl
                      - pl-PL
                      - ps
                      - pt
                      - pt-BR
                      - pt-PT
                      - qu
                      - rm
                      - rn
                      - ro
                      - ro-RO
                      - ru
                      - ru-RU
                      - rw
                      - sa
                      - sa-IN
                      - sc
                      - sd
                      - se
                      - sg
                      - si
                      - sk
                      - sk-SK
                      - sl
                      - sl-SI
                      - sm
                      - sn
                      - so
                      - sq
                      - sq-AL
                      - sr
                      - ss
                      - st
                      - su
                      - sv
                      - sv-FI
                      - sv-SE
                      - sw
                      - sw-KE
                      - ta
                      - ta-IN
                      - te
                      - te-IN
                      - tg
                      - th
                      - th-TH
                      - ti
                      - tk
                      - tl
                      - tn
                      - to
                      - tr
                      - tr-TR
                      - ts
                      - tt
                      - tt-RU
                      - tw
                      - ty
                      - ug
                      - uk
                      - uk-UA
                      - ur
                      - ur-PK
                      - uz
                      - ve
                      - vi
                      - vi-VN
                      - vo
                      - wa
                      - wo
                      - xh
                      - yi
                      - yo
                      - za
                      - zh
                      - zh-CHS
                      - zh-CHT
                      - zh-CN
                      - zh-HK
                      - zh-MO
                      - zh-SG
                      - zh-TW
                      - zu
                  value:
                    type: string
                  author:
                    type: object
                    properties:
                      reference:
                        type: string
                      display:
                        type: string
                    required:
                      - reference
                  date:
                    type: string
                  projectId:
                    type: string
                required:
                  - key
                  - language
                  - value
                  - author
                example: &a71
                  key: home.title
                  language: en
                  value: Home
                  author:
                    reference: Practitioner/123
                    display: John Doe
                  date: 2020-01-01T00:00:00.000Z
              target:
                type: object
                properties:
                  id:
                    type: string
                  key:
                    type: string
                    pattern: ^[a-zA-Z0-9_-][a-zA-Z0-9_\-.]*$
                    example: home.screen.title
                  language:
                    type: string
                    enum:
                      - Cy-az-AZ
                      - Cy-sr-SP
                      - Cy-uz-UZ
                      - Lt-az-AZ
                      - Lt-sr-SP
                      - Lt-uz-UZ
                      - aa
                      - ab
                      - ae
                      - af
                      - af-ZA
                      - ak
                      - am
                      - an
                      - ar
                      - ar-AE
                      - ar-BH
                      - ar-DZ
                      - ar-EG
                      - ar-IQ
                      - ar-JO
                      - ar-KW
                      - ar-LB
                      - ar-LY
                      - ar-MA
                      - ar-OM
                      - ar-QA
                      - ar-SA
                      - ar-SY
                      - ar-TN
                      - ar-YE
                      - as
                      - av
                      - ay
                      - az
                      - ba
                      - be
                      - be-BY
                      - bg
                      - bg-BG
                      - bh
                      - bi
                      - bm
                      - bn
                      - bo
                      - br
                      - bs
                      - ca
                      - ca-ES
                      - ce
                      - ch
                      - co
                      - cr
                      - cs
                      - cs-CZ
                      - cu
                      - cv
                      - cy
                      - da
                      - da-DK
                      - de
                      - de-AT
                      - de-CH
                      - de-DE
                      - de-LI
                      - de-LU
                      - div-MV
                      - dv
                      - dz
                      - ee
                      - el
                      - el-GR
                      - en
                      - en-AU
                      - en-BZ
                      - en-CA
                      - en-CB
                      - en-GB
                      - en-IE
                      - en-JM
                      - en-NZ
                      - en-PH
                      - en-TT
                      - en-US
                      - en-ZA
                      - en-ZW
                      - eo
                      - es
                      - es-AR
                      - es-BO
                      - es-CL
                      - es-CO
                      - es-CR
                      - es-DO
                      - es-EC
                      - es-ES
                      - es-GT
                      - es-HN
                      - es-MX
                      - es-NI
                      - es-PA
                      - es-PE
                      - es-PR
                      - es-PY
                      - es-SV
                      - es-UY
                      - es-VE
                      - et
                      - et-EE
                      - eu
                      - eu-ES
                      - fa
                      - fa-IR
                      - ff
                      - fi
                      - fi-FI
                      - fj
                      - fo
                      - fo-FO
                      - fr
                      - fr-BE
                      - fr-CA
                      - fr-CH
                      - fr-FR
                      - fr-LU
                      - fr-MC
                      - fy
                      - ga
                      - gd
                      - gl
                      - gl-ES
                      - gn
                      - gu
                      - gu-IN
                      - gv
                      - ha
                      - he
                      - he-IL
                      - hi
                      - hi-IN
                      - ho
                      - hr
                      - hr-HR
                      - ht
                      - hu
                      - hu-HU
                      - hy
                      - hy-AM
                      - hz
                      - ia
                      - id
                      - id-ID
                      - ie
                      - ig
                      - ii
                      - ik
                      - io
                      - is
                      - is-IS
                      - it
                      - it-CH
                      - it-IT
                      - iu
                      - ja
                      - ja-JP
                      - jv
                      - ka
                      - ka-GE
                      - kg
                      - ki
                      - kj
                      - kk
                      - kk-KZ
                      - kl
                      - km
                      - kn
                      - kn-IN
                      - ko
                      - ko-KR
                      - kr
                      - ks
                      - ku
                      - kv
                      - kw
                      - ky
                      - ky-KZ
                      - la
                      - lb
                      - lg
                      - li
                      - ln
                      - lo
                      - lt
                      - lt-LT
                      - lu
                      - lv
                      - lv-LV
                      - mg
                      - mh
                      - mi
                      - mk
                      - mk-MK
                      - ml
                      - mn
                      - mn-MN
                      - mr
                      - mr-IN
                      - ms
                      - ms-BN
                      - ms-MY
                      - mt
                      - my
                      - na
                      - nb
                      - nb-NO
                      - nd
                      - ne
                      - ng
                      - nl
                      - nl-BE
                      - nl-NL
                      - nn
                      - nn-NO
                      - no
                      - nr
                      - nv
                      - ny
                      - oc
                      - oj
                      - om
                      - or
                      - os
                      - pa
                      - pa-IN
                      - pi
                      - pl
                      - pl-PL
                      - ps
                      - pt
                      - pt-BR
                      - pt-PT
                      - qu
                      - rm
                      - rn
                      - ro
                      - ro-RO
                      - ru
                      - ru-RU
                      - rw
                      - sa
                      - sa-IN
                      - sc
                      - sd
                      - se
                      - sg
                      - si
                      - sk
                      - sk-SK
                      - sl
                      - sl-SI
                      - sm
                      - sn
                      - so
                      - sq
                      - sq-AL
                      - sr
                      - ss
                      - st
                      - su
                      - sv
                      - sv-FI
                      - sv-SE
                      - sw
                      - sw-KE
                      - ta
                      - ta-IN
                      - te
                      - te-IN
                      - tg
                      - th
                      - th-TH
                      - ti
                      - tk
                      - tl
                      - tn
                      - to
                      - tr
                      - tr-TR
                      - ts
                      - tt
                      - tt-RU
                      - tw
                      - ty
                      - ug
                      - uk
                      - uk-UA
                      - ur
                      - ur-PK
                      - uz
                      - ve
                      - vi
                      - vi-VN
                      - vo
                      - wa
                      - wo
                      - xh
                      - yi
                      - yo
                      - za
                      - zh
                      - zh-CHS
                      - zh-CHT
                      - zh-CN
                      - zh-HK
                      - zh-MO
                      - zh-SG
                      - zh-TW
                      - zu
                  value:
                    type: string
                  author:
                    type: object
                    properties:
                      reference:
                        type: string
                      display:
                        type: string
                    required:
                      - reference
                  date:
                    type: string
                  projectId:
                    type: string
                required:
                  - key
                  - language
                  - value
                  - author
                example: *a71
            required:
              - source
      required:
        - total
        - resources
    PaginatedSearchResponseDto:
      type: object
      properties:
        total:
          type: number
        resources:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
              key:
                type: string
                pattern: ^[a-zA-Z0-9_-][a-zA-Z0-9_\-.]*$
                example: home.screen.title
              language:
                type: string
                enum:
                  - Cy-az-AZ
                  - Cy-sr-SP
                  - Cy-uz-UZ
                  - Lt-az-AZ
                  - Lt-sr-SP
                  - Lt-uz-UZ
                  - aa
                  - ab
                  - ae
                  - af
                  - af-ZA
                  - ak
                  - am
                  - an
                  - ar
                  - ar-AE
                  - ar-BH
                  - ar-DZ
                  - ar-EG
                  - ar-IQ
                  - ar-JO
                  - ar-KW
                  - ar-LB
                  - ar-LY
                  - ar-MA
                  - ar-OM
                  - ar-QA
                  - ar-SA
                  - ar-SY
                  - ar-TN
                  - ar-YE
                  - as
                  - av
                  - ay
                  - az
                  - ba
                  - be
                  - be-BY
                  - bg
                  - bg-BG
                  - bh
                  - bi
                  - bm
                  - bn
                  - bo
                  - br
                  - bs
                  - ca
                  - ca-ES
                  - ce
                  - ch
                  - co
                  - cr
                  - cs
                  - cs-CZ
                  - cu
                  - cv
                  - cy
                  - da
                  - da-DK
                  - de
                  - de-AT
                  - de-CH
                  - de-DE
                  - de-LI
                  - de-LU
                  - div-MV
                  - dv
                  - dz
                  - ee
                  - el
                  - el-GR
                  - en
                  - en-AU
                  - en-BZ
                  - en-CA
                  - en-CB
                  - en-GB
                  - en-IE
                  - en-JM
                  - en-NZ
                  - en-PH
                  - en-TT
                  - en-US
                  - en-ZA
                  - en-ZW
                  - eo
                  - es
                  - es-AR
                  - es-BO
                  - es-CL
                  - es-CO
                  - es-CR
                  - es-DO
                  - es-EC
                  - es-ES
                  - es-GT
                  - es-HN
                  - es-MX
                  - es-NI
                  - es-PA
                  - es-PE
                  - es-PR
                  - es-PY
                  - es-SV
                  - es-UY
                  - es-VE
                  - et
                  - et-EE
                  - eu
                  - eu-ES
                  - fa
                  - fa-IR
                  - ff
                  - fi
                  - fi-FI
                  - fj
                  - fo
                  - fo-FO
                  - fr
                  - fr-BE
                  - fr-CA
                  - fr-CH
                  - fr-FR
                  - fr-LU
                  - fr-MC
                  - fy
                  - ga
                  - gd
                  - gl
                  - gl-ES
                  - gn
                  - gu
                  - gu-IN
                  - gv
                  - ha
                  - he
                  - he-IL
                  - hi
                  - hi-IN
                  - ho
                  - hr
                  - hr-HR
                  - ht
                  - hu
                  - hu-HU
                  - hy
                  - hy-AM
                  - hz
                  - ia
                  - id
                  - id-ID
                  - ie
                  - ig
                  - ii
                  - ik
                  - io
                  - is
                  - is-IS
                  - it
                  - it-CH
                  - it-IT
                  - iu
                  - ja
                  - ja-JP
                  - jv
                  - ka
                  - ka-GE
                  - kg
                  - ki
                  - kj
                  - kk
                  - kk-KZ
                  - kl
                  - km
                  - kn
                  - kn-IN
                  - ko
                  - ko-KR
                  - kr
                  - ks
                  - ku
                  - kv
                  - kw
                  - ky
                  - ky-KZ
                  - la
                  - lb
                  - lg
                  - li
                  - ln
                  - lo
                  - lt
                  - lt-LT
                  - lu
                  - lv
                  - lv-LV
                  - mg
                  - mh
                  - mi
                  - mk
                  - mk-MK
                  - ml
                  - mn
                  - mn-MN
                  - mr
                  - mr-IN
                  - ms
                  - ms-BN
                  - ms-MY
                  - mt
                  - my
                  - na
                  - nb
                  - nb-NO
                  - nd
                  - ne
                  - ng
                  - nl
                  - nl-BE
                  - nl-NL
                  - nn
                  - nn-NO
                  - no
                  - nr
                  - nv
                  - ny
                  - oc
                  - oj
                  - om
                  - or
                  - os
                  - pa
                  - pa-IN
                  - pi
                  - pl
                  - pl-PL
                  - ps
                  - pt
                  - pt-BR
                  - pt-PT
                  - qu
                  - rm
                  - rn
                  - ro
                  - ro-RO
                  - ru
                  - ru-RU
                  - rw
                  - sa
                  - sa-IN
                  - sc
                  - sd
                  - se
                  - sg
                  - si
                  - sk
                  - sk-SK
                  - sl
                  - sl-SI
                  - sm
                  - sn
                  - so
                  - sq
                  - sq-AL
                  - sr
                  - ss
                  - st
                  - su
                  - sv
                  - sv-FI
                  - sv-SE
                  - sw
                  - sw-KE
                  - ta
                  - ta-IN
                  - te
                  - te-IN
                  - tg
                  - th
                  - th-TH
                  - ti
                  - tk
                  - tl
                  - tn
                  - to
                  - tr
                  - tr-TR
                  - ts
                  - tt
                  - tt-RU
                  - tw
                  - ty
                  - ug
                  - uk
                  - uk-UA
                  - ur
                  - ur-PK
                  - uz
                  - ve
                  - vi
                  - vi-VN
                  - vo
                  - wa
                  - wo
                  - xh
                  - yi
                  - yo
                  - za
                  - zh
                  - zh-CHS
                  - zh-CHT
                  - zh-CN
                  - zh-HK
                  - zh-MO
                  - zh-SG
                  - zh-TW
                  - zu
              value:
                type: string
              author:
                type: object
                properties:
                  reference:
                    type: string
                  display:
                    type: string
                required:
                  - reference
              date:
                type: string
              projectId:
                type: string
            required:
              - key
              - language
              - value
              - author
            example: *a71
      required:
        - total
        - resources
    LocalizationDto:
      type: object
      properties:
        id:
          type: string
        key:
          type: string
          pattern: ^[a-zA-Z0-9_-][a-zA-Z0-9_\-.]*$
          example: home.screen.title
        language:
          type: string
          enum:
            - Cy-az-AZ
            - Cy-sr-SP
            - Cy-uz-UZ
            - Lt-az-AZ
            - Lt-sr-SP
            - Lt-uz-UZ
            - aa
            - ab
            - ae
            - af
            - af-ZA
            - ak
            - am
            - an
            - ar
            - ar-AE
            - ar-BH
            - ar-DZ
            - ar-EG
            - ar-IQ
            - ar-JO
            - ar-KW
            - ar-LB
            - ar-LY
            - ar-MA
            - ar-OM
            - ar-QA
            - ar-SA
            - ar-SY
            - ar-TN
            - ar-YE
            - as
            - av
            - ay
            - az
            - ba
            - be
            - be-BY
            - bg
            - bg-BG
            - bh
            - bi
            - bm
            - bn
            - bo
            - br
            - bs
            - ca
            - ca-ES
            - ce
            - ch
            - co
            - cr
            - cs
            - cs-CZ
            - cu
            - cv
            - cy
            - da
            - da-DK
            - de
            - de-AT
            - de-CH
            - de-DE
            - de-LI
            - de-LU
            - div-MV
            - dv
            - dz
            - ee
            - el
            - el-GR
            - en
            - en-AU
            - en-BZ
            - en-CA
            - en-CB
            - en-GB
            - en-IE
            - en-JM
            - en-NZ
            - en-PH
            - en-TT
            - en-US
            - en-ZA
            - en-ZW
            - eo
            - es
            - es-AR
            - es-BO
            - es-CL
            - es-CO
            - es-CR
            - es-DO
            - es-EC
            - es-ES
            - es-GT
            - es-HN
            - es-MX
            - es-NI
            - es-PA
            - es-PE
            - es-PR
            - es-PY
            - es-SV
            - es-UY
            - es-VE
            - et
            - et-EE
            - eu
            - eu-ES
            - fa
            - fa-IR
            - ff
            - fi
            - fi-FI
            - fj
            - fo
            - fo-FO
            - fr
            - fr-BE
            - fr-CA
            - fr-CH
            - fr-FR
            - fr-LU
            - fr-MC
            - fy
            - ga
            - gd
            - gl
            - gl-ES
            - gn
            - gu
            - gu-IN
            - gv
            - ha
            - he
            - he-IL
            - hi
            - hi-IN
            - ho
            - hr
            - hr-HR
            - ht
            - hu
            - hu-HU
            - hy
            - hy-AM
            - hz
            - ia
            - id
            - id-ID
            - ie
            - ig
            - ii
            - ik
            - io
            - is
            - is-IS
            - it
            - it-CH
            - it-IT
            - iu
            - ja
            - ja-JP
            - jv
            - ka
            - ka-GE
            - kg
            - ki
            - kj
            - kk
            - kk-KZ
            - kl
            - km
            - kn
            - kn-IN
            - ko
            - ko-KR
            - kr
            - ks
            - ku
            - kv
            - kw
            - ky
            - ky-KZ
            - la
            - lb
            - lg
            - li
            - ln
            - lo
            - lt
            - lt-LT
            - lu
            - lv
            - lv-LV
            - mg
            - mh
            - mi
            - mk
            - mk-MK
            - ml
            - mn
            - mn-MN
            - mr
            - mr-IN
            - ms
            - ms-BN
            - ms-MY
            - mt
            - my
            - na
            - nb
            - nb-NO
            - nd
            - ne
            - ng
            - nl
            - nl-BE
            - nl-NL
            - nn
            - nn-NO
            - no
            - nr
            - nv
            - ny
            - oc
            - oj
            - om
            - or
            - os
            - pa
            - pa-IN
            - pi
            - pl
            - pl-PL
            - ps
            - pt
            - pt-BR
            - pt-PT
            - qu
            - rm
            - rn
            - ro
            - ro-RO
            - ru
            - ru-RU
            - rw
            - sa
            - sa-IN
            - sc
            - sd
            - se
            - sg
            - si
            - sk
            - sk-SK
            - sl
            - sl-SI
            - sm
            - sn
            - so
            - sq
            - sq-AL
            - sr
            - ss
            - st
            - su
            - sv
            - sv-FI
            - sv-SE
            - sw
            - sw-KE
            - ta
            - ta-IN
            - te
            - te-IN
            - tg
            - th
            - th-TH
            - ti
            - tk
            - tl
            - tn
            - to
            - tr
            - tr-TR
            - ts
            - tt
            - tt-RU
            - tw
            - ty
            - ug
            - uk
            - uk-UA
            - ur
            - ur-PK
            - uz
            - ve
            - vi
            - vi-VN
            - vo
            - wa
            - wo
            - xh
            - yi
            - yo
            - za
            - zh
            - zh-CHS
            - zh-CHT
            - zh-CN
            - zh-HK
            - zh-MO
            - zh-SG
            - zh-TW
            - zu
        value:
          type: string
        author:
          type: object
          properties:
            reference:
              type: string
            display:
              type: string
          required:
            - reference
        date:
          type: string
        projectId:
          type: string
      required:
        - key
        - language
        - value
        - author
      example: *a71
    LocalizationRequestBodyDto:
      type: object
      properties:
        value:
          type: string
      required:
        - value
      example:
        value: Home
    RequestSetupStripeProjectDTO:
      type: object
      properties:
        name:
          type: string
          minLength: 1
          description: User name.
        email:
          type: string
          format: email
          description: User email.
        password:
          type: string
          minLength: 8
          description: User password.
        productId:
          type: string
          description: Stripe product ID.
        projectPurpose:
          type: string
          minLength: 1
          description: Project purpose.
        organizationName:
          type: string
          minLength: 1
          description: Organization name.
      required:
        - name
        - email
        - password
        - productId
        - projectPurpose
        - organizationName
      example:
        name: Dr. Max John Mustermann
        email: max.mustermann@example.com
        password: p}mz%#iqsHnP]=I9
        productId: prod_ugs2LsGM2e
        projectPurpose: ""
        organizationName: My Organization
    StripeProductsDto:
      type: array
      items:
        type: object
        properties:
          id:
            type: string
          name:
            type: string
          description:
            type: string
          images:
            type: array
            items:
              type: string
          currency:
            type: string
          amount:
            type: number
          interval:
            type: string
        required:
          - id
          - name
          - description
          - images
          - currency
          - amount
          - interval
      example:
        - id: prod_....
          name: Professional
          description: Jetzt anfragen
          images:
            - https://files.stripe.com/links/M...
          currency: eur
          amount: 195000
          interval: month
    ProjectFeaturesResponseDto:
      type: object
      properties:
        features:
          type: array
          items:
            type: string
      required:
        - features
      example:
        features:
          - bots
          - cron
          - websocket-subscriptions
    ProjectFeaturesUpdateDto:
      type: object
      properties:
        features:
          type: array
          items:
            type: string
            enum:
              - ai
              - aws-comprehend
              - aws-textract
              - bots
              - cron
              - email
              - google-auth-required
              - graphql-introspection
              - websocket-subscriptions
              - transaction-bundles
              - validate-terminology
      required:
        - features
      example:
        features:
          - bots
          - cron
          - websocket-subscriptions
    ProjectSettingsResponseDto:
      type: object
      properties:
        projectId:
          type: string
        settings:
          type: object
          properties:
            CONTENT_ENABLED:
              type: boolean
            MAILING_ENABLED:
              type: boolean
            PATIENT_INVITATION_ENABLED:
              type: boolean
            PATIENT_REGISTRATION_ENABLED:
              type: boolean
            PATIENT_LOGIN_ENABLED:
              type: boolean
            PRACTITIONER_INVITATION_ENABLED:
              type: boolean
            PRACTITIONER_REGISTRATION_ENABLED:
              type: boolean
            PRACTITIONER_LOGIN_ENABLED:
              type: boolean
            IOT_ENABLED:
              type: boolean
          required:
            - CONTENT_ENABLED
            - MAILING_ENABLED
            - PATIENT_INVITATION_ENABLED
            - PATIENT_REGISTRATION_ENABLED
            - PATIENT_LOGIN_ENABLED
            - PRACTITIONER_INVITATION_ENABLED
            - PRACTITIONER_REGISTRATION_ENABLED
            - PRACTITIONER_LOGIN_ENABLED
            - IOT_ENABLED
      required:
        - projectId
        - settings
      example:
        projectId: project-abc
        settings:
          CONTENT_ENABLED: false
          MAILING_ENABLED: false
          PATIENT_INVITATION_ENABLED: false
          PATIENT_REGISTRATION_ENABLED: false
          PATIENT_LOGIN_ENABLED: false
          PRACTITIONER_INVITATION_ENABLED: true
          PRACTITIONER_REGISTRATION_ENABLED: false
          PRACTITIONER_LOGIN_ENABLED: true
    ProjectSettingUpdateDto:
      type: object
      properties:
        enabled:
          type: boolean
      required:
        - enabled
      example:
        enabled: true
    ProjectMembersResponseDto:
      type: object
      properties:
        total:
          type: number
          minimum: 0
        page:
          type: number
          minimum: 0
        count:
          type: number
          minimum: 1
        resources:
          type: array
          items:
            type: object
            properties:
              membershipId:
                type: string
              userId:
                type: string
              profile:
                type: object
                properties:
                  reference:
                    type: string
                  display:
                    type: string
                additionalProperties: true
              accessPolicy:
                type: object
                properties:
                  reference:
                    type: string
                  display:
                    type: string
                additionalProperties: true
              admin:
                type: boolean
            required:
              - membershipId
            example:
              membershipId: d7f418aa-467d-d1ea-f0fc-d2dd841733e6
              userId: 9f8a2389-a20c-a075-2aa9-e95093515517
              profile:
                reference: Practitioner/cd495e76-8385-ecb1-00a6-7e0381de4e42
              accessPolicy:
                reference: AccessPolicy/cca28116-f888-97bf-c336-5b992bd02672
                display: Practitioner access
              admin: false
      required:
        - total
        - page
        - count
        - resources
      example:
        total: 1
        page: 0
        count: 20
        resources:
          - membershipId: d7f418aa-467d-d1ea-f0fc-d2dd841733e6
            userId: 9f8a2389-a20c-a075-2aa9-e95093515517
            profile:
              reference: Practitioner/cd495e76-8385-ecb1-00a6-7e0381de4e42
            accessPolicy:
              reference: AccessPolicy/cca28116-f888-97bf-c336-5b992bd02672
              display: Practitioner access
    InviteProjectMemberDto:
      type: object
      properties:
        email:
          type: string
          format: email
          minLength: 1
        firstName:
          type: string
          minLength: 1
          nullable: true
        lastName:
          type: string
          minLength: 1
          nullable: true
        admin:
          type: boolean
          nullable: true
      required:
        - email
        - firstName
        - lastName
        - admin
      example:
        email: alex@acme.com
        firstName: Alex
        lastName: Lee
        admin: false
    ProjectMemberResponseDto:
      type: object
      properties:
        id:
          type: string
        email:
          type: string
          nullable: true
        displayName:
          type: string
          nullable: true
        firstName:
          type: string
          nullable: true
        lastName:
          type: string
          nullable: true
        admin:
          type: boolean
        profileType:
          type: string
          enum:
            - Practitioner
            - Patient
            - RelatedPerson
          nullable: true
        profileId:
          type: string
          nullable: true
        pending:
          type: boolean
        invitedAt:
          type: string
          nullable: true
      required:
        - id
        - email
        - displayName
        - firstName
        - lastName
        - admin
        - profileType
        - profileId
        - pending
        - invitedAt
    UpdateProjectMemberDto:
      type: object
      properties:
        admin:
          type: boolean
          nullable: true
      required:
        - admin
      example:
        admin: true
    RemoveMemberResponseDto:
      type: object
      properties:
        success:
          type: boolean
          enum:
            - true
      required:
        - success
    SetupIotDeviceDto:
      type: object
      properties:
        serialNumber:
          type: string
          minLength: 1
          description: The unique serial number of the device
          example: SN123456789
        apiKey:
          type: string
          minLength: 1
          description: The API key for authentication
          example: wahjeeviyahr8ohL1ooshee2Zah9Ied5
      required:
        - serialNumber
        - apiKey
    SetupIotDeviceResponseDto:
      type: object
      properties:
        mqtt:
          type: object
          properties:
            clientId:
              type: string
            username:
              type: string
            password:
              type: string
            url:
              type: string
          required:
            - clientId
            - username
            - password
            - url
        wifi:
          type: object
          properties:
            SSID:
              type: string
            password:
              type: string
            method:
              type: string
          required:
            - SSID
            - password
            - method
        pairing:
          type: object
          properties:
            method:
              type: string
            H10Address:
              type: string
            O2RingAddress:
              type: string
          required:
            - method
            - H10Address
            - O2RingAddress
      required:
        - mqtt
    IotTelemetryIngestDto:
      type: object
      properties:
        payload:
          nullable: true
        reportedAt:
          type: string
          nullable: true
        schemaVersion:
          type: string
          nullable: true
      required:
        - reportedAt
        - schemaVersion
      additionalProperties: true
    IotTelemetryIngestAckResponseDto:
      type: object
      properties:
        jobId:
          type: string
          nullable: true
      required:
        - jobId
    ProvisionDeviceRequestDto:
      type: object
      properties:
        serialNumber:
          type: string
          minLength: 1
          maxLength: 200
        deviceName:
          type: string
          minLength: 1
          maxLength: 200
          nullable: true
        patientRef:
          type: string
          minLength: 1
          maxLength: 256
          nullable: true
      required:
        - serialNumber
        - deviceName
        - patientRef
    IotDeviceSummaryDto:
      type: object
      properties:
        id:
          type: string
        identifiers:
          type: array
          items:
            type: object
            properties:
              system:
                type: string
                nullable: true
              value:
                type: string
                nullable: true
            required:
              - system
              - value
        displayName:
          type: string
          nullable: true
        patientRef:
          type: string
          nullable: true
        hasToken:
          type: boolean
        updatedAt:
          type: string
          nullable: true
      required:
        - id
        - identifiers
        - displayName
        - patientRef
        - hasToken
        - updatedAt
    IotDeviceListResponseDto:
      type: object
      properties:
        total:
          type: number
        resources:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
              identifiers:
                type: array
                items:
                  type: object
                  properties:
                    system:
                      type: string
                      nullable: true
                    value:
                      type: string
                      nullable: true
                  required:
                    - system
                    - value
              displayName:
                type: string
                nullable: true
              patientRef:
                type: string
                nullable: true
              hasToken:
                type: boolean
              updatedAt:
                type: string
                nullable: true
            required:
              - id
              - identifiers
              - displayName
              - patientRef
              - hasToken
              - updatedAt
      required:
        - total
        - resources
    TransportConfigResponseDto:
      type: object
      properties:
        http:
          type: object
          properties:
            url:
              type: string
              nullable: true
            maxBodyBytes:
              type: number
              nullable: true
          required:
            - url
            - maxBodyBytes
        mqtt:
          type: object
          properties:
            brokerUrl:
              type: string
              nullable: true
            topicPattern:
              type: string
              nullable: true
            userPropertyKey:
              type: string
              nullable: true
            qos:
              type: number
              nullable: true
          required:
            - brokerUrl
            - topicPattern
            - userPropertyKey
            - qos
        ws:
          type: object
          properties:
            url:
              type: string
              nullable: true
            namespace:
              type: string
              nullable: true
            eventName:
              type: string
              nullable: true
          required:
            - url
            - namespace
            - eventName
      required:
        - http
        - mqtt
        - ws
    MintTokenResponseDto:
      type: object
      properties:
        token:
          type: string
      required:
        - token
    DeviceObservabilityResponseDto:
      type: object
      properties:
        deviceId:
          type: string
        hasToken:
          type: boolean
        lastTelemetryAt:
          type: string
          nullable: true
        projectKillswitchEngaged:
          type: boolean
      required:
        - deviceId
        - hasToken
        - lastTelemetryAt
        - projectKillswitchEngaged
    ChainObservabilityResponseDto:
      type: object
      properties:
        chainId:
          type: string
        breakerTripped:
          type: boolean
        consecutiveFailures:
          type: number
        projectKillswitchEngaged:
          type: boolean
        chainKillswitchEngaged:
          type: boolean
      required:
        - chainId
        - breakerTripped
        - consecutiveFailures
        - projectKillswitchEngaged
        - chainKillswitchEngaged
    IotCapabilitiesResponseDto:
      type: object
      properties:
        granted:
          type: array
          items:
            type: string
            enum:
              - external-webhook
              - execute-bot
              - store-fhir
              - raise-cr
              - fetch-resource
      required:
        - granted
    KillswitchStatusResponseDto:
      type: object
      properties:
        scope:
          type: string
          enum:
            - global
            - project
            - chain
        chainId:
          type: string
          nullable: true
        enabled:
          type: boolean
      required:
        - scope
        - chainId
        - enabled
    SetKillswitchRequestDto:
      type: object
      properties:
        enabled:
          type: boolean
        chainId:
          type: string
          minLength: 1
          nullable: true
      required:
        - enabled
        - chainId
    RevokeTokenResponseDto:
      type: object
      properties:
        revoked:
          type: boolean
          enum:
            - true
      required:
        - revoked
    SimplifiedPatientDto:
      type: object
      properties:
        id:
          type: string
        deceased:
          type: boolean
        name:
          type: string
        surname:
          type: string
        dateOfBirth:
          type: string
          pattern: ^\d{4}-\d{2}-\d{2}$
        gender:
          type: string
          enum:
            - male
            - female
            - unknown
            - other
        email:
          type: string
          format: email
        phone:
          type: string
        organization:
          type: string
        practitioner:
          type: string
        photo:
          type: string
          format: uri
        address:
          type: object
          properties:
            line:
              type: string
            city:
              type: string
            state:
              type: string
            postalCode:
              type: string
            country:
              type: string
        contact:
          type: object
          properties:
            name:
              type: string
            email:
              type: string
              format: email
            phone:
              type: string
            address:
              type: object
              properties:
                line:
                  type: string
                city:
                  type: string
                state:
                  type: string
                postalCode:
                  type: string
                country:
                  type: string
      example: &a72
        name: John
        surname: Doe
        dateOfBirth: 1990-01-01
        gender: male
        email: john.doe@example.com
        phone: "+491234567890"
        address:
          line: 123 Main St
          city: Anytown
          state: NY
          postalCode: "12345"
          country: USA
        organization: Organization/123
    SimplifiedPatientsDto:
      type: object
      properties:
        total:
          type: number
        resources:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
              deceased:
                type: boolean
              name:
                type: string
              surname:
                type: string
              dateOfBirth:
                type: string
                pattern: ^\d{4}-\d{2}-\d{2}$
              gender:
                type: string
                enum:
                  - male
                  - female
                  - unknown
                  - other
              email:
                type: string
                format: email
              phone:
                type: string
              organization:
                type: string
              practitioner:
                type: string
              photo:
                type: string
                format: uri
              address:
                type: object
                properties:
                  line:
                    type: string
                  city:
                    type: string
                  state:
                    type: string
                  postalCode:
                    type: string
                  country:
                    type: string
              contact:
                type: object
                properties:
                  name:
                    type: string
                  email:
                    type: string
                    format: email
                  phone:
                    type: string
                  address:
                    type: object
                    properties:
                      line:
                        type: string
                      city:
                        type: string
                      state:
                        type: string
                      postalCode:
                        type: string
                      country:
                        type: string
            example: *a72
      required:
        - total
        - resources
      example:
        total: 2
        resources:
          - name: John
            surname: Doe
            dateOfBirth: 1990-01-01
            gender: male
            email: john.doe@example.com
            phone: "+491234567890"
            organization: Organization/123
    SimplifiedPractitionerDto:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        surname:
          type: string
        email:
          type: string
          format: email
        phone:
          type: string
        address:
          type: object
          properties:
            line:
              type: string
            city:
              type: string
            state:
              type: string
            postalCode:
              type: string
            country:
              type: string
        photo:
          type: string
          format: uri
      example: &a73
        name: John
        surname: Doe
        email: john.doe@example.com
        phone: "+491234567890"
        address:
          line: 123 Main St
          city: Anytown
          state: NY
          postalCode: "12345"
          country: USA
    SimplifiedPractitionersDto:
      type: object
      properties:
        total:
          type: number
        resources:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
              name:
                type: string
              surname:
                type: string
              email:
                type: string
                format: email
              phone:
                type: string
              address:
                type: object
                properties:
                  line:
                    type: string
                  city:
                    type: string
                  state:
                    type: string
                  postalCode:
                    type: string
                  country:
                    type: string
              photo:
                type: string
                format: uri
            example: *a73
      required:
        - total
        - resources
      example:
        total: 2
        resources:
          - name: John
            surname: Doe
            email: john.doe@example.com
            phone: "+491234567890"
          - name: Jane
            surname: Doe
            email: jane.doe@example.com
            phone: "+491234567890"
    SimplifiedOrganizationDto:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        email:
          type: string
          format: email
        phone:
          type: string
        address:
          type: object
          properties:
            line:
              type: string
            city:
              type: string
            state:
              type: string
            postalCode:
              type: string
            country:
              type: string
        contact:
          type: object
          properties:
            name:
              type: string
            email:
              type: string
              format: email
            phone:
              type: string
            address:
              type: object
              properties:
                line:
                  type: string
                city:
                  type: string
                state:
                  type: string
                postalCode:
                  type: string
                country:
                  type: string
      example: &a74
        name: Organization 1
        email: organization1@example.com
        phone: "+491234567890"
        address:
          line: 123 Main St
          city: Anytown
          state: NY
          postalCode: "12345"
          country: USA
    SimplifiedOrganizationsDto:
      type: object
      properties:
        total:
          type: number
        resources:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
              name:
                type: string
              email:
                type: string
                format: email
              phone:
                type: string
              address:
                type: object
                properties:
                  line:
                    type: string
                  city:
                    type: string
                  state:
                    type: string
                  postalCode:
                    type: string
                  country:
                    type: string
              contact:
                type: object
                properties:
                  name:
                    type: string
                  email:
                    type: string
                    format: email
                  phone:
                    type: string
                  address:
                    type: object
                    properties:
                      line:
                        type: string
                      city:
                        type: string
                      state:
                        type: string
                      postalCode:
                        type: string
                      country:
                        type: string
            example: *a74
      required:
        - total
        - resources
      example:
        total: 2
        resources:
          - name: Organization 1
            email: organization1@example.com
            phone: "+491234567890"
            address: 123 Main St, Anytown, USA
          - name: Organization 2
            email: organization2@example.com
            phone: "+491234567890"
            address: 456 Main St, Anytown, USA
    SimplifiedObservationDto:
      type: object
      properties:
        id:
          type: string
        subject:
          type: string
        code:
          type: string
        system:
          default: http://loinc.org
          type: string
        data:
          type: object
          properties:
            value:
              oneOf:
                - type: string
                - type: number
                - type: boolean
                - type: array
                  items:
                    type: number
                  minItems: 1
            code:
              type: string
            system:
              default: http://ucum.org
              type: string
            unit:
              type: string
        date:
          type: string
          format: date-time
        performer:
          type: string
        device:
          type: string
      examples: &a75
        - subject: Patient/123
          code: 8867-4
          data:
            value: 120
            code: mg/dL
            system: http://ucum.org
          date: 2021-01-01T00:00:00.000Z
          performer: Practitioner/123
        - subject: Patient/123
          code: "131328"
          data:
            value:
              - 1
              - 2
              - 3
            code: mg/dL
            system: http://ucum.org
          date: 2021-01-01T00:00:00.000Z
          performer: Practitioner/123
    SimplifiedObservationsDto:
      type: object
      properties:
        total:
          type: number
        resources:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
              subject:
                type: string
              code:
                type: string
              system:
                default: http://loinc.org
                type: string
              data:
                type: object
                properties:
                  value:
                    oneOf:
                      - type: string
                      - type: number
                      - type: boolean
                      - type: array
                        items:
                          type: number
                        minItems: 1
                  code:
                    type: string
                  system:
                    default: http://ucum.org
                    type: string
                  unit:
                    type: string
              date:
                type: string
                format: date-time
              performer:
                type: string
              device:
                type: string
            examples: *a75
      required:
        - total
        - resources
      example:
        total: 2
        resources:
          - subject: Patient/123
            code: 8867-4
            data:
              value: 120
              code: mg/dL
              system: http://ucum.org
            date: 2021-01-01T00:00:00.000Z
            performer: Practitioner/123
          - subject: Patient/123
            code: "131328"
            data:
              value:
                - 1
                - 2
                - 3
              code: mV
              system: http://ucum.org
            date: 2021-01-01T00:00:00.000Z
            performer: Practitioner/123
            device: Device/123
    SimplifiedTaskDto:
      type: object
      properties:
        id:
          type: string
        status:
          default: draft
          type: string
          enum:
            - draft
            - requested
            - received
            - accepted
            - rejected
            - ready
            - cancelled
            - in-progress
            - on-hold
            - completed
            - failed
            - entered-in-error
        priority:
          type: string
          enum:
            - routine
            - urgent
            - asap
            - stat
        description:
          type: string
        for:
          type: string
        focus:
          type: string
        owner:
          description: A reference to a Practitioner, Organization, or Patient
          type: string
        requester:
          description: A reference to a Practitioner, Organization, or Patient
          type: string
        input:
          type: array
          items:
            oneOf:
              - type: string
              - type: object
                properties:
                  reference:
                    type: string
        output:
          type: array
          items:
            oneOf:
              - type: string
              - type: object
                properties:
                  reference:
                    type: string
    SimplifiedTasksDto:
      type: object
      properties:
        total:
          type: number
        resources:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
              status:
                default: draft
                type: string
                enum:
                  - draft
                  - requested
                  - received
                  - accepted
                  - rejected
                  - ready
                  - cancelled
                  - in-progress
                  - on-hold
                  - completed
                  - failed
                  - entered-in-error
              priority:
                type: string
                enum:
                  - routine
                  - urgent
                  - asap
                  - stat
              description:
                type: string
              for:
                type: string
              focus:
                type: string
              owner:
                description: A reference to a Practitioner, Organization, or Patient
                type: string
              requester:
                description: A reference to a Practitioner, Organization, or Patient
                type: string
              input:
                type: array
                items:
                  oneOf:
                    - type: string
                    - type: object
                      properties:
                        reference:
                          type: string
              output:
                type: array
                items:
                  oneOf:
                    - type: string
                    - type: object
                      properties:
                        reference:
                          type: string
      required:
        - total
        - resources
    HeartRateRequestDto:
      type: object
      properties:
        heartRateValue:
          type: number
        personExist:
          default: true
          type: boolean
        radarId:
          type: string
        respiratoryValue:
          type: number
      required:
        - heartRateValue
        - radarId
        - respiratoryValue
      example:
        heartRateValue: 72
        personExists: true
        radarId: "123"
        respiratoryValue: 12
    ConnectionStatusDto:
      type: object
      properties:
        timestamp:
          type: number
          minimum: 0
          description: Unix timestamp in milliseconds
        deviceId:
          type: string
          description: The device ID
        eventType:
          type: string
          enum:
            - connection-status
        eventValue:
          type: boolean
      required:
        - timestamp
        - deviceId
        - eventType
        - eventValue
    OccupancyValueDto:
      type: object
      properties:
        timestamp:
          type: number
          minimum: 0
          description: Unix timestamp in milliseconds
        deviceId:
          type: string
          description: The device ID
        eventType:
          type: string
          enum:
            - occupancy-status
        eventValue:
          type: boolean
      required:
        - timestamp
        - deviceId
        - eventType
        - eventValue
    SleepStatusDto:
      type: object
      properties:
        timestamp:
          type: number
          minimum: 0
          description: Unix timestamp in milliseconds
        deviceId:
          type: string
          description: The device ID
        eventType:
          type: string
          enum:
            - sleep-status
        eventValue:
          oneOf:
            - type: string
              enum:
                - deep-sleep
                - light-sleep
                - awake-in-bed
                - left-bed
                - none
            - type: string
      required:
        - timestamp
        - deviceId
        - eventType
        - eventValue
    HeartRateValueDto:
      type: object
      properties:
        timestamp:
          type: number
          minimum: 0
          description: Unix timestamp in milliseconds
        deviceId:
          type: string
          description: The device ID
        eventType:
          type: string
          enum:
            - heart-rate
        eventValue:
          type: number
          minimum: 0
      required:
        - timestamp
        - deviceId
        - eventType
        - eventValue
    BreathRateValueDto:
      type: object
      properties:
        timestamp:
          type: number
          minimum: 0
          description: Unix timestamp in milliseconds
        deviceId:
          type: string
          description: The device ID
        eventType:
          type: string
          enum:
            - breath-rate
        eventValue:
          type: number
          minimum: 0
      required:
        - timestamp
        - deviceId
        - eventType
        - eventValue
    ResponseLivekitVideoCallAccessPermissionDto:
      type: object
      properties:
        resourceType:
          default: CommunicationRequest
          type: string
          description: Resource Type.
        id:
          type: string
          description: Resource ID.
        identifier:
          type: array
          items:
            type: object
            properties:
              system:
                default: https://api.ovok.com/fhir/StructureDefinition/communication-request-type
                type: string
                description: Communication request unique identifier system.
              value:
                default: video-call-access
                type: string
                description: Communication request unique identifier value.
        basedOn:
          type: string
          description: ID of Appointment to which the video call access permission applies
            to.
        status:
          type: string
          description: Status of the video call access permission.
        recipient:
          type: array
          items:
            type: object
            properties:
              reference:
                type: string
                description: Reference of the video call participant.
              display:
                type: string
                description: Name of the video call participant.
              identifier:
                type: object
                properties:
                  system:
                    default: https://api.ovok.com/fhir/StructureDefinition/user-email
                    type: string
                    description: Email identifier of video call participant.
                  value:
                    type: string
                    description: Email of video call participant.
                required:
                  - value
            required:
              - reference
              - display
              - identifier
      required:
        - id
        - identifier
        - basedOn
        - status
        - recipient
      example:
        resourceType: CommunicationRequest
        id: 2adae28d-6664-74a9-3f4c-cad5f551ce1e
        basedOn: 2d05c593-246b-cb2d-aa32-1d075024c362
        status: active
        identifier:
          - system: https://api.ovok.com/fhir/StructureDefinition/communication-request-type
            value: video-call-access
        recipient:
          - reference: Patient/de5c57ff-7257-57b0-13ab-aab6f5f91498
            display: Max Mustermann
            identifier:
              system: https://api.ovok.com/fhir/StructureDefinition/user-email
              value: max.mustermann@example.com
    RequestLivekitVideoCallGuestAccessDto:
      type: object
      properties:
        guestEmail:
          type: string
          format: email
          description: Guest email.
      required:
        - guestEmail
      example:
        guestEmail: max.mustermann@example.com
    ResponseVideoCallAccessDto:
      type: object
      properties:
        videoCallUrl:
          type: string
          example: https://call.ovok.online/room?token=abc123#def456
          description: Video call URL.
        livekitJwt:
          type: string
          example: abc123
          description: LiveKit JWT.
        passphrase:
          type: string
          example: def456
          description: Passphrase for e2e encryption.
      required:
        - videoCallUrl
        - livekitJwt
        - passphrase
    ResponseLivekitVideoCallAccessDto:
      type: object
      properties:
        videoCallUrl:
          type: string
          description: URL to join video call.
        livekitJwt:
          type: string
          description: LiveKit JWT.
        passphrase:
          type: string
          description: Passphrase for video call.
      required:
        - videoCallUrl
        - livekitJwt
        - passphrase
      example:
        videoCallUrl: https://call.ovok.online/room?token=example.jwt.eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3ODY4OTk5NzcsImV4cCI6MTc4NjkwMzU3N30.sZTke9fx_gPeoj2v-FL9GhDqY0hh9EzdEc4XywFqb84#m_pmt6dt0fLWkVeBj8X6
        livekitJwt: example.jwt.eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3ODY4OTk5NzcsImV4cCI6MTc4NjkwMzU3N30.sZTke9fx_gPeoj2v-FL9GhDqY0hh9EzdEc4XywFqb84
        passphrase: m_pmt6dt0fLWkVeBj8X6
    RequestBodyLivekitVideoCallAppointmentDto:
      type: object
      properties:
        id:
          type: string
          description: Appointment ID.
        start:
          type: string
          format: date-time
          description: |-
            Start date-time of the video call appointment.
                ATTENTION: Start date must be provided in UTC+0 (GMT+0) time.
        end:
          type: string
          format: date-time
          description: |-
            End date-time of the video call appointment.
                ATTENTION: End date must be provided in UTC+0 (GMT+0) time.
        comment:
          type: string
          minLength: 1
          description: Title of the video call appointment.
        description:
          type: string
          description: Brief description of the video call appointment.
        videoCallParticipants:
          type: array
          items:
            type: object
            properties:
              email:
                type: string
                format: email
                description: Participant email.
            required:
              - email
          minItems: 1
          description: Video call participants.
      required:
        - start
        - end
        - comment
        - videoCallParticipants
      example:
        start: 2025-01-01T14:00:00Z
        end: 2025-01-01T15:00:00Z
        comment: Appointment on 31.01.2025
        description: Check-up appointment
        videoCallParticipants:
          - email: max.mustermann@example.com
    ResponseBodyLivekitVideoCallAppointmentDto:
      type: object
      properties:
        id:
          type: string
          description: Appointment ID.
        resourceType:
          default: Appointment
          type: string
          description: Appointment resource type.
        status:
          type: string
          enum:
            - proposed
            - pending
            - booked
            - arrived
            - fulfilled
            - cancelled
            - noshow
            - entered-in-error
            - checked-in
            - waitlist
          description: Appointment status.
        start:
          type: string
          format: date-time
          description: |-
            Start date-time of the video call appointment.
                ATTENTION: Start date is provided in UTC+0 (GMT+0) time.
        end:
          type: string
          format: date-time
          description: |-
            End date-time of the video call appointment.
                ATTENTION: End date is provided in UTC+0 (GMT+0) time.
        comment:
          type: string
          minLength: 1
          description: Title of the video call appointment.
        description:
          type: string
          description: Brief description of the video call appointment.
        videoCallParticipants:
          type: array
          items:
            type: object
            properties:
              email:
                type: string
                format: email
                description: Participant email.
              status:
                type: string
                enum:
                  - accepted
                  - declined
                  - tentative
                  - needs-action
              profileRef:
                type: string
                description: Practitioner or patient resource reference.
            required:
              - email
              - status
              - profileRef
        passphrase:
          type: string
          description: Passphrase for the video call appointment.
      required:
        - id
        - status
        - start
        - end
        - comment
        - videoCallParticipants
        - passphrase
      example: &a76
        status: booked
        start: 2026-08-16T17:06:17Z
        end: 2026-08-17T17:06:17Z
        comment: Appointment on 31.01.2025
        description: Check-up appointment
        videoCallParticipants:
          - email: max.mustermann@example.com
            status: accepted
            profileRef: Practitioner/cd495e76-8385-ecb1-00a6-7e0381de4e42
        passphrase: ugs2LsGM2e
    ResponseBodyLivekitVideoCallAppointmentArrayDto:
      type: array
      items:
        type: object
        properties:
          id:
            type: string
            description: Appointment ID.
          resourceType:
            default: Appointment
            type: string
            description: Appointment resource type.
          status:
            type: string
            enum:
              - proposed
              - pending
              - booked
              - arrived
              - fulfilled
              - cancelled
              - noshow
              - entered-in-error
              - checked-in
              - waitlist
            description: Appointment status.
          start:
            type: string
            format: date-time
            description: |-
              Start date-time of the video call appointment.
                  ATTENTION: Start date is provided in UTC+0 (GMT+0) time.
          end:
            type: string
            format: date-time
            description: |-
              End date-time of the video call appointment.
                  ATTENTION: End date is provided in UTC+0 (GMT+0) time.
          comment:
            type: string
            minLength: 1
            description: Title of the video call appointment.
          description:
            type: string
            description: Brief description of the video call appointment.
          videoCallParticipants:
            type: array
            items:
              type: object
              properties:
                email:
                  type: string
                  format: email
                  description: Participant email.
                status:
                  type: string
                  enum:
                    - accepted
                    - declined
                    - tentative
                    - needs-action
                profileRef:
                  type: string
                  description: Practitioner or patient resource reference.
              required:
                - email
                - status
                - profileRef
          passphrase:
            type: string
            description: Passphrase for the video call appointment.
        required:
          - id
          - status
          - start
          - end
          - comment
          - videoCallParticipants
          - passphrase
        example: *a76
      example:
        - status: booked
          start: 2026-08-16T17:06:17Z
          end: 2026-08-17T17:06:17Z
          description: Check-up appointment
          videoCallParticipants:
            - email: max.mustermann@example.com
              name: Max Mustermann
              status: accepted
              profileRef: Practitioner/cd495e76-8385-ecb1-00a6-7e0381de4e42
          passphrase: ugs2LsGM2e
    RequestBodyLivekitVideoCallMailDto:
      type: object
      properties:
        appointmentId:
          type: string
          minLength: 1
          description: Video call Appointment ID.
        emailRecipients:
          type: array
          items:
            type: object
            properties:
              email:
                type: string
                format: email
                description: Participant email.
              profileRef:
                description: Reference to participant resource.
                type: string
            required:
              - email
              - profileRef
          minItems: 1
          maxItems: 20
          description: List of email recipients.
      required:
        - appointmentId
        - emailRecipients
      example:
        appointmentId: 87ea5dfc-8b8e-384d-8489-79496e706390
        emailRecipients:
          - email: max.mustermann@example.com
            profileRef: Patient/de5c57ff-7257-57b0-13ab-aab6f5f91498
    ResponseBodyLivekitVideoCallMailDto:
      type: object
      properties:
        appointmentId:
          type: string
          minLength: 1
          description: Video call Appointment ID.
        emailRecipientsResult:
          type: array
          items:
            type: object
            properties:
              email:
                type: string
                format: email
                description: Participant email.
              profileRef:
                description: Reference to participant resource.
                type: string
              isEmailSent:
                type: boolean
                description: Email sent status.
            required:
              - email
              - profileRef
              - isEmailSent
      required:
        - appointmentId
        - emailRecipientsResult
      example:
        appointmentId: 87ea5dfc-8b8e-384d-8489-79496e706390
        emailRecipientsResult:
          - email: max.mustermann@example.com
            profileRef: Patient/de5c57ff-7257-57b0-13ab-aab6f5f91498
            isEmailSent: true
    AppointmentActorDto:
      type: object
      properties:
        type:
          type: string
          enum:
            - Patient
            - Practitioner
            - PractitionerRole
            - RelatedPerson
            - Device
            - HealthcareService
            - Location
          description: Type of actor.
        id:
          type: string
          example: 12345-12345-12345
          description: ID of actor.
        display:
          type: string
          example: John Doe
          description: Display name of actor.
      required:
        - id
    AppointmentParticipantDto:
      type: object
      properties:
        status:
          type: string
          enum:
            - accepted
            - declined
            - tentative
            - needs-action
          description: Status of the participant.
        type:
          example:
            - abc123
          description: Role of participant in the appointment.
          type: array
          items:
            type: string
        actor:
          description: Actor participating in the appointment.
          allOf:
            - $ref: "#/components/schemas/AppointmentActorDto"
      required:
        - status
    CreateAppointmentVideoCallDto:
      type: object
      properties:
        identifier:
          description: Additional identifier/s for the resource.
          type: array
          items:
            $ref: "#/components/schemas/IdentifierDto"
        status:
          type: string
          enum:
            - proposed
            - pending
            - booked
            - arrived
            - fulfilled
            - cancelled
            - noshow
            - entered-in-error
            - checked-in
            - waitlist
          description: Status of the video call appointment.
        participant:
          description: Participants of the video call appointment.
          type: array
          items:
            $ref: "#/components/schemas/AppointmentParticipantDto"
        startDate:
          type: string
          format: date-time
          example: 2000-01-30T23:59:59Z
          description: |-
            Start date of the video call appointment.
                ATTENTION: Start date must be provided in UTC+0 (GMT+0) time.
        endDate:
          type: string
          format: date-time
          example: 2000-01-30T23:59:59Z
          description: |-
            End date of the video call appointment.
                ATTENTION: End date must be provided in UTC+0 (GMT+0) time.
        description:
          type: string
          example: abc123
          description: Description of the video call appointment.
        serviceType:
          example:
            - CONSULTATION
          description: The service that is performed during the video call appointment.
          type: array
          items:
            type: string
        appointmentType:
          type: string
          example: 11111-1
          description: Type of the booked video call appointment.
      required:
        - status
        - participant
        - startDate
        - endDate
    AppointmentDto:
      type: object
      properties:
        identifier:
          description: Additional identifier/s for the resource.
          type: array
          items:
            $ref: "#/components/schemas/IdentifierDto"
        status:
          type: string
          enum: &a79
            - proposed
            - pending
            - booked
            - arrived
            - fulfilled
            - cancelled
            - noshow
            - entered-in-error
            - checked-in
            - waitlist
          description: Status of the appointment.
        participant:
          description: The participants of the appointment.
          type: array
          items:
            $ref: "#/components/schemas/AppointmentParticipantDto"
        description:
          type: string
          example: abc123
          description: Description of the appointment.
        startDate:
          type: string
          format: date-time
          example: 2000-01-30T23:59:59Z
          description: Start date of the appointment.
        endDate:
          type: string
          format: date-time
          example: 2000-01-30T23:59:59Z
          description: End date of the appointment.
        serviceType:
          example: &a80
            - CONSULTATION
          description: The service that is performed during the appointment.
          type: array
          items:
            type: string
        appointmentType:
          type: string
          example: 11111-1
          description: Type of the booked appointment.
        resourceType:
          type: Appointment
          example: Appointment
          description: Appointment resource type.
        id:
          type: string
          example: 12345-12345-12345
          description: Appointment resource ID.
      required:
        - status
        - participant
        - resourceType
        - id
    ResponseAppointmentVideoCallDto:
      type: object
      properties:
        identifier:
          description: Additional identifier/s for the resource.
          type: array
          items:
            $ref: "#/components/schemas/IdentifierDto"
        resourceType:
          type: string
          example: Appointment
          description: Video call appointment resource type.
          enum:
            - Appointment
        id:
          type: string
          example: 12345-12345-12345
          description: Video call appointment resource ID.
        status:
          type: string
          enum:
            - proposed
            - pending
            - booked
            - arrived
            - fulfilled
            - cancelled
            - noshow
            - entered-in-error
            - checked-in
            - waitlist
          description: Status of the video call appointment.
        participant:
          description: Participants of the video call appointment.
          type: array
          items:
            $ref: "#/components/schemas/AppointmentParticipantDto"
        startDate:
          type: string
          format: date-time
          example: 2000-01-30T23:59:59Z
          description: |-
            Start date of the video call appointment.
                ATTENTION: Start date must be provided in UTC+0 (GMT+0) time.
        endDate:
          type: string
          format: date-time
          example: 2000-01-30T23:59:59Z
          description: |-
            End date of the video call appointment.
                ATTENTION: End date must be provided in UTC+0 (GMT+0) time.
        videoCallJoinUrl:
          type: string
          example: https://call.ovok.online/join?room=abc123&client=def456
          description: Video call join URL.
        videoCallPassphrase:
          type: string
          example: abc123
          description: Video call room passphrase.
        description:
          type: string
          example: abc123
          description: Description of the video call appointment.
        serviceType:
          example:
            - CONSULTATION
          description: The service that is performed during the video call appointment.
          type: array
          items:
            type: string
        appointmentType:
          type: string
          example: 11111-1
          description: Type of the booked video call appointment.
      required:
        - resourceType
        - id
        - status
        - participant
        - startDate
        - endDate
        - videoCallJoinUrl
    CreateUserAccessVideoCallDto:
      type: object
      properties:
        roomId:
          type: string
          example: 12345-12345-12345
          description: Room ID, which is also an Appointment ID.
      required:
        - roomId
    CreateGuestAccessVideoCallDto:
      type: object
      properties:
        roomId:
          type: string
          example: 12345-12345-12345
          description: Room ID, which is also an Appointment ID.
        guestName:
          type: string
          example: John Doe
          description: Guest name.
      required:
        - roomId
    PatchOperationDto:
      type: object
      properties:
        op:
          type: string
          enum:
            - add
            - remove
            - replace
            - copy
            - move
            - test
          description: Operation to be performed on the parameter.
        path:
          type: string
          description: Path of the parameter on the resource.
        value:
          type: object
          description: Value that should be added/removed/replaced.
      required:
        - op
        - path
    AccountSubjectDto:
      type: object
      properties:
        type:
          type: string
          enum:
            - Patient
            - Device
            - Practitioner
            - PractitionerRole
            - Location
            - HealthcareService
            - Organization
          description: Type of the account subject.
        id:
          type: string
          example: 12345-12345-12345
          description: ID of the account subject.
      required:
        - type
        - id
    AccountCoverageDto:
      type: object
      properties:
        coverage:
          type: string
          example: 12345-12345-12345
          description: ID of the coverage.
        priority:
          type: number
          example: 1
          description: The priority of the coverage in the context of this account.
      required:
        - coverage
    CreateAccountDto:
      type: object
      properties:
        identifier:
          description: Additional identifier/s for the resource.
          type: array
          items:
            $ref: "#/components/schemas/IdentifierDto"
        status:
          type: string
          enum: &a77
            - active
            - inactive
            - on-hold
            - unknown
            - entered-in-error
          description: Status of the account.
        type:
          type: string
          enum: &a78
            - _ActAccountCode
            - ACCTRECEIVABLE
            - CASH
            - CC
            - AE
            - DN
            - DV
            - MC
            - V
            - PBILLACCT
          description: Type of the account. See
            https://hl7.org/fhir/valueset-account-type.html
        name:
          type: string
          example: "Patient: John Doe"
          description: Name of the account.
        subject:
          description: The entity that caused the expenses. E.g. Patient, Practitioner,
            Organization, Device, etc.
          type: array
          items:
            $ref: "#/components/schemas/AccountSubjectDto"
        description:
          type: string
          example: Patient deposit
          description: Description of the account.
        coverage:
          description: The party(s) such as insurances, that may contribute to the payment
            of this account.
          type: array
          items:
            $ref: "#/components/schemas/AccountCoverageDto"
      required:
        - status
    AccountDto:
      type: object
      properties:
        identifier:
          description: Additional identifier/s for the resource.
          type: array
          items:
            $ref: "#/components/schemas/IdentifierDto"
        status:
          type: string
          enum: *a77
          description: Status of the account.
        type:
          type: string
          enum: *a78
          description: Type of the account. See
            https://hl7.org/fhir/valueset-account-type.html
        name:
          type: string
          example: "Patient: John Doe"
          description: Name of the account.
        subject:
          description: The entity that caused the expenses. E.g. Patient, Practitioner,
            Organization, Device, etc.
          type: array
          items:
            $ref: "#/components/schemas/AccountSubjectDto"
        description:
          type: string
          example: Patient deposit
          description: Description of the account.
        coverage:
          description: The party(s) such as insurances, that may contribute to the payment
            of this account.
          type: array
          items:
            $ref: "#/components/schemas/AccountCoverageDto"
        resourceType:
          type: Account
          example: Account
          description: Account resource type.
        id:
          type: string
          example: 12345-12345-12345
          description: Account resource ID.
      required:
        - status
        - resourceType
        - id
    Object:
      type: object
      properties: {}
    ResponseAccountDto:
      type: object
      properties:
        data:
          description: List of Account resources.
          type: array
          items:
            $ref: "#/components/schemas/AccountDto"
            format: array
        total:
          type: number
          example: 50
          format: number
          description: The total amount of resources.
      required:
        - data
        - total
    CodeableConceptDto:
      type: object
      properties:
        text:
          type: string
          example: All OK
          description: Text representation.
    OperationOutcomeIssueDto:
      type: object
      properties:
        severity:
          type: string
          enum:
            - fatal
            - error
            - warning
            - information
          example: information
          description: Severity of the issue.
        code:
          type: string
          example: informational
          description: Type of the issue.
        details:
          description: Additional details about the issue.
          allOf:
            - $ref: "#/components/schemas/CodeableConceptDto"
      required:
        - severity
        - code
    OperationOutcomeDto:
      type: object
      properties:
        resourceType:
          type: OperationOutcome
          example: OperationOutcome
          description: Resource type.
        id:
          type: string
          example: ok
          description: Logical ID of the resource.
        issue:
          description: "Single issue associated with the action: error, warning or
            information message."
          type: array
          items:
            $ref: "#/components/schemas/OperationOutcomeIssueDto"
      required:
        - resourceType
        - id
        - issue
    CreateAppointmentDto:
      type: object
      properties:
        identifier:
          description: Additional identifier/s for the resource.
          type: array
          items:
            $ref: "#/components/schemas/IdentifierDto"
        status:
          type: string
          enum: *a79
          description: Status of the appointment.
        participant:
          description: The participants of the appointment.
          type: array
          items:
            $ref: "#/components/schemas/AppointmentParticipantDto"
        description:
          type: string
          example: abc123
          description: Description of the appointment.
        startDate:
          type: string
          format: date-time
          example: 2000-01-30T23:59:59Z
          description: Start date of the appointment.
        endDate:
          type: string
          format: date-time
          example: 2000-01-30T23:59:59Z
          description: End date of the appointment.
        serviceType:
          example: *a80
          description: The service that is performed during the appointment.
          type: array
          items:
            type: string
        appointmentType:
          type: string
          example: 11111-1
          description: Type of the booked appointment.
      required:
        - status
        - participant
    ResponseAppointmentDto:
      type: object
      properties:
        data:
          description: The requested data.
          type: array
          items:
            $ref: "#/components/schemas/AppointmentDto"
            format: array
        total:
          type: number
          example: 50
          format: number
          description: The total amount of resources.
      required:
        - data
        - total
    DeviceUdiCarrierDto:
      type: object
      properties:
        deviceIdentifier:
          type: string
          example: abc123
          description: "Device identifier: portion of the UDI identifying the labeler and
            the version of the device model."
        carrierHRF:
          type: string
          example: abc123
          description: Human Readable Form (HRF) of the barcode.
    DeviceDeviceNameDto:
      type: object
      properties:
        name:
          type: string
          example: Digital Scale
          description: Name of the device.
        type:
          type: string
          enum:
            - udi-label-name
            - user-friendly-name
            - patient-reported-name
            - manufacturer-name
            - model-name
            - other
          description: Type of the device name.
      required:
        - name
    CreateDeviceDto:
      type: object
      properties:
        identifier:
          description: Additional identifier/s for the resource.
          type: array
          items:
            $ref: "#/components/schemas/IdentifierDto"
        udiCarrier:
          description: Unique Device Identifier (UDI) of the barcode.
          type: array
          items:
            $ref: "#/components/schemas/DeviceUdiCarrierDto"
        status:
          type: string
          enum: &a81
            - active
            - inactive
            - entered-in-error
            - unknown
          description: Status of the device availability.
        distinctIdentifier:
          type: string
          example: abc123
          description: Distinct identification of the device.
        manufacturer:
          type: string
          example: Medtronic
          description: Name of the device manufacturer.
        manufactureDate:
          type: string
          format: date-time
          example: 2000-01-30T23:59:59Z
          description: Date when the device was manufactured.
        expirationDate:
          type: string
          format: date-time
          example: 2000-01-30T23:59:59Z
          description: Expiration date of the device.
        lotNumber:
          type: string
          example: "12345"
          description: Lot number assigned by the manufacturer.
        serialNumber:
          type: string
          example: "12345"
          description: Serial number of the device.
        deviceName:
          description: Device name as given by the manufacturer.
          type: array
          items:
            $ref: "#/components/schemas/DeviceDeviceNameDto"
        modelNumber:
          type: string
          example: "12345"
          description: Model number of the device.
        type:
          type: string
          example: 11111-1
          description: Type of the device.
        patient:
          type: string
          example: 12345-12345-12345
          description: ID of the patient to whom the device is affixed.
        location:
          type: string
          example: 12345-12345-12345
          description: ID of the location where the device can be found.
    DeviceDto:
      type: object
      properties:
        identifier:
          description: Additional identifier/s for the resource.
          type: array
          items:
            $ref: "#/components/schemas/IdentifierDto"
        udiCarrier:
          description: Unique Device Identifier (UDI) of the barcode.
          type: array
          items:
            $ref: "#/components/schemas/DeviceUdiCarrierDto"
        status:
          type: string
          enum: *a81
          description: Status of the device availability.
        distinctIdentifier:
          type: string
          example: abc123
          description: Distinct identification of the device.
        manufacturer:
          type: string
          example: Medtronic
          description: Name of the device manufacturer.
        manufactureDate:
          type: string
          format: date-time
          example: 2000-01-30T23:59:59Z
          description: Date when the device was manufactured.
        expirationDate:
          type: string
          format: date-time
          example: 2000-01-30T23:59:59Z
          description: Expiration date of the device.
        lotNumber:
          type: string
          example: "12345"
          description: Lot number assigned by the manufacturer.
        serialNumber:
          type: string
          example: "12345"
          description: Serial number of the device.
        deviceName:
          description: Device name as given by the manufacturer.
          type: array
          items:
            $ref: "#/components/schemas/DeviceDeviceNameDto"
        modelNumber:
          type: string
          example: "12345"
          description: Model number of the device.
        type:
          type: string
          example: 11111-1
          description: Type of the device.
        patient:
          type: string
          example: 12345-12345-12345
          description: ID of the patient to whom the device is affixed.
        location:
          type: string
          example: 12345-12345-12345
          description: ID of the location where the device can be found.
        resourceType:
          type: Device
          example: Device
          description: Device resource type.
        id:
          type: string
          example: 12345-12345-12345
          description: Device resource ID.
      required:
        - resourceType
        - id
    ResponseDeviceDto:
      type: object
      properties:
        data:
          description: List of Device resources
          type: array
          items:
            $ref: "#/components/schemas/DeviceDto"
            format: array
        total:
          type: number
          example: 50
          format: number
          description: The total amount of resources.
      required:
        - data
        - total
    LocationPositionDto:
      type: object
      properties:
        latitude:
          type: number
          example: 48.783333
          description: Latitude.
        longitude:
          type: number
          example: 9.183333
          description: Longitude.
      required:
        - latitude
        - longitude
    CreateLocationDto:
      type: object
      properties:
        identifier:
          description: Additional identifier/s for the resource.
          type: array
          items:
            $ref: "#/components/schemas/IdentifierDto"
        status:
          type: string
          enum: &a82
            - active
            - suspended
            - inactive
          description: Status of the location.
        name:
          type: string
          example: Hospital ABC
          description: Name of the location.
        position:
          description: The absolute geographic position of the location.
          allOf:
            - $ref: "#/components/schemas/LocationPositionDto"
        managingOrganization:
          type: string
          example: 12345-12345-12345
          description: ID of the organization responsible for provisioning/upkeep of the
            location.
    LocationDto:
      type: object
      properties:
        identifier:
          description: Additional identifier/s for the resource.
          type: array
          items:
            $ref: "#/components/schemas/IdentifierDto"
        status:
          type: string
          enum: *a82
          description: Status of the location.
        name:
          type: string
          example: Hospital ABC
          description: Name of the location.
        position:
          description: The absolute geographic position of the location.
          allOf:
            - $ref: "#/components/schemas/LocationPositionDto"
        managingOrganization:
          type: string
          example: 12345-12345-12345
          description: ID of the organization responsible for provisioning/upkeep of the
            location.
        resourceType:
          type: Location
          example: Location
          description: Location resource type.
        id:
          type: string
          example: 12345-12345-12345
          description: Location resource ID.
      required:
        - resourceType
        - id
    ResponseLocationDto:
      type: object
      properties:
        data:
          description: List of Location resources
          type: array
          items:
            $ref: "#/components/schemas/LocationDto"
            format: array
        total:
          type: number
          example: 50
          format: number
          description: The total amount of resources.
      required:
        - data
        - total
    ScheduleActorDto:
      type: object
      properties:
        type:
          type: string
          enum:
            - Patient
            - Practitioner
            - PractitionerRole
            - RelatedPerson
            - Device
            - HealthcareService
            - Location
          description: Type of actor.
        id:
          type: string
          example: 12345-12345-12345
          description: ID of actor.
      required:
        - type
        - id
    LocationScheduleDto:
      type: object
      properties:
        identifier:
          description: Additional identifier/s for the resource.
          type: array
          items:
            $ref: "#/components/schemas/IdentifierDto"
        actor:
          description: Resource for which the schedule is provided.
          type: array
          items:
            $ref: "#/components/schemas/ScheduleActorDto"
        serviceType:
          example: &a83
            - 11111-1
          description: Specific service to be performed during the appointment.
          type: array
          items:
            type: string
        comment:
          type: string
          example: available in the morning
          description: Comments on availability.
        id:
          type: string
          description: The id of the schedule
      required:
        - actor
        - id
    LocationDataWithScheduleDto:
      type: object
      properties:
        identifier:
          description: Additional identifier/s for the resource.
          type: array
          items:
            $ref: "#/components/schemas/IdentifierDto"
        status:
          type: string
          enum: *a82
          description: Status of the location.
        name:
          type: string
          example: Hospital ABC
          description: Name of the location.
        position:
          description: The absolute geographic position of the location.
          allOf:
            - $ref: "#/components/schemas/LocationPositionDto"
        managingOrganization:
          type: string
          example: 12345-12345-12345
          description: ID of the organization responsible for provisioning/upkeep of the
            location.
        resourceType:
          type: Location
          example: Location
          description: Location resource type.
        id:
          type: string
          example: 12345-12345-12345
          description: Location resource ID.
        schedules:
          type: array
          items:
            $ref: "#/components/schemas/LocationScheduleDto"
      required:
        - resourceType
        - id
        - schedules
    ResponseLocationWithScheduleDto:
      type: object
      properties:
        data:
          description: List of Location resources
          type: array
          items:
            $ref: "#/components/schemas/LocationDataWithScheduleDto"
            format: array
        total:
          type: number
          example: 50
          format: number
          description: The total amount of resources.
      required:
        - data
        - total
    CreateScheduleDto:
      type: object
      properties:
        identifier:
          description: Additional identifier/s for the resource.
          type: array
          items:
            $ref: "#/components/schemas/IdentifierDto"
        actor:
          description: Resource for which the schedule is provided.
          type: array
          items:
            $ref: "#/components/schemas/ScheduleActorDto"
        serviceType:
          example: *a83
          description: Specific service to be performed during the appointment.
          type: array
          items:
            type: string
        comment:
          type: string
          example: available in the morning
          description: Comments on availability.
      required:
        - actor
    ScheduleDto:
      type: object
      properties:
        identifier:
          description: Additional identifier/s for the resource.
          type: array
          items:
            $ref: "#/components/schemas/IdentifierDto"
        actor:
          description: Resource for which the schedule is provided.
          type: array
          items:
            $ref: "#/components/schemas/ScheduleActorDto"
        serviceType:
          example: *a83
          description: Specific service to be performed during the appointment.
          type: array
          items:
            type: string
        comment:
          type: string
          example: available in the morning
          description: Comments on availability.
        resourceType:
          type: Schedule
          example: Schedule
          description: Schedule resource type.
        id:
          type: string
          example: 12345-12345-12345
          description: Schedule resource ID.
      required:
        - actor
        - resourceType
        - id
    ResponseScheduleDto:
      type: object
      properties:
        data:
          description: List of Schedule resources
          type: array
          items:
            $ref: "#/components/schemas/ScheduleDto"
            format: array
        total:
          type: number
          example: 50
          format: number
          description: The total amount of resources.
      required:
        - data
        - total
    HumanNameDto:
      type: object
      properties:
        use:
          type: string
          enum:
            - anonymous
            - maiden
            - nickname
            - official
            - old
            - temp
            - usual
          description: Purpose of the name.
        firstName:
          example:
            - John
          description: First name/s.
          type: array
          items:
            type: string
        lastName:
          type: string
          example: Doe
          description: Last name.
    TelecomDto:
      type: object
      properties:
        system:
          type: string
          description: Telecom system.
          example: phone
          enum:
            - email
            - phone
            - fax
            - sms
            - pager
            - url
            - other
        use:
          type: string
          description: Telecom use.
          example: mobile
          enum:
            - home
            - work
            - temp
            - old
            - mobile
        value:
          type: string
          example: "+1234567890"
          description: Telecom value.
    AddressDto:
      type: object
      properties:
        use:
          type: string
          enum:
            - home
            - work
            - temp
            - old
            - billing
          description: Address use.
        type:
          type: string
          enum:
            - postal
            - physical
            - both
          description: Address type.
        country:
          type: string
          example: United States
          description: Country name.
        state:
          type: string
          example: California
          description: State name.
        city:
          type: string
          example: Los Angeles
          description: City name.
        postalCode:
          type: string
          example: "12345"
          description: Postal code.
        streetAddress:
          type: string
          example: 123 Main St
          description: Street address.
    CreatePatientDto:
      type: object
      properties:
        identifier:
          description: Additional identifier/s for the resource.
          type: array
          items:
            $ref: "#/components/schemas/IdentifierDto"
        name:
          description: Name of the patient.
          type: array
          items:
            $ref: "#/components/schemas/HumanNameDto"
        telecom:
          description: Contact details of the patient.
          type: array
          items:
            $ref: "#/components/schemas/TelecomDto"
        gender:
          type: string
          enum: &a84
            - male
            - female
            - other
            - unknown
          description: Gender of the patient.
        birthDate:
          type: string
          format: date-time
          example: 2000-01-30
          description: Birth date of the patient.
        address:
          description: Address of the patient.
          type: array
          items:
            $ref: "#/components/schemas/AddressDto"
        photo:
          description: Attachment data.
          type: array
          items:
            $ref: "#/components/schemas/AttachmentDto"
        communicationLanguage:
          type: array
          description: Language to be used to communicate with the patient.
          items: &a85
            type: string
            enum:
              - en
              - de
              - tr
        managingOrganization:
          type: string
          example: abc123
          description: Organization managing the patient record.
        active:
          type: boolean
          example: false
          description: Active status of the patient.
    PatientDto:
      type: object
      properties:
        identifier:
          description: Additional identifier/s for the resource.
          type: array
          items:
            $ref: "#/components/schemas/IdentifierDto"
        name:
          description: Name of the patient.
          type: array
          items:
            $ref: "#/components/schemas/HumanNameDto"
        telecom:
          description: Contact details of the patient.
          type: array
          items:
            $ref: "#/components/schemas/TelecomDto"
        gender:
          type: string
          enum: *a84
          description: Gender of the patient.
        birthDate:
          type: string
          format: date-time
          example: 2000-01-30
          description: Birth date of the patient.
        address:
          description: Address of the patient.
          type: array
          items:
            $ref: "#/components/schemas/AddressDto"
        photo:
          description: Attachment data.
          type: array
          items:
            $ref: "#/components/schemas/AttachmentDto"
        communicationLanguage:
          type: array
          description: Language to be used to communicate with the patient.
          items: *a85
        managingOrganization:
          type: string
          example: abc123
          description: Organization managing the patient record.
        active:
          type: boolean
          example: false
          description: Active status of the patient.
        resourceType:
          type: Patient
          example: Patient
          description: Patient resource type.
        id:
          type: string
          example: 12345-12345-12345
          description: Patient resource ID.
      required:
        - resourceType
        - id
    ResponsePatientDto:
      type: object
      properties:
        data:
          description: List of Patient resources
          type: array
          items:
            $ref: "#/components/schemas/PatientDto"
            format: array
        total:
          type: number
          example: 50
          format: number
          description: The total amount of resources.
      required:
        - data
        - total
    PatchPatientDto:
      type: object
      properties:
        identifier:
          description: Additional identifier/s for the resource.
          type: array
          items:
            $ref: "#/components/schemas/IdentifierDto"
        name:
          description: Name of the patient.
          type: array
          items:
            $ref: "#/components/schemas/HumanNameDto"
        telecom:
          description: Contact details of the patient.
          type: array
          items:
            $ref: "#/components/schemas/TelecomDto"
        gender:
          type: string
          enum: *a84
          description: Gender of the patient.
        birthDate:
          type: string
          format: date-time
          example: 2000-01-30
          description: Birth date of the patient.
        address:
          description: Address of the patient.
          type: array
          items:
            $ref: "#/components/schemas/AddressDto"
        photo:
          description: Attachment data.
          type: array
          items:
            $ref: "#/components/schemas/AttachmentDto"
        communicationLanguage:
          type: array
          description: Language to be used to communicate with the patient.
          items: *a85
        managingOrganization:
          type: string
          example: abc123
          description: Organization managing the patient record.
        active:
          type: boolean
          example: false
          description: Active status of the patient.
    CreateDocumentReferenceDto:
      type: object
      properties:
        identifier:
          description: Additional identifier/s for the resource.
          type: array
          items:
            $ref: "#/components/schemas/IdentifierDto"
        meta:
          description: The meta information of the document reference.
          allOf:
            - $ref: "#/components/schemas/DocumentReferenceMetaDto"
        status:
          type: string
          enum: *a86
          description: The status of the document reference.
        content:
          description: Attachment data.
          type: array
          items:
            $ref: "#/components/schemas/AttachmentDto"
        type:
          type: string
          example: 11111-1
          description: Type of the document reference.
        category:
          example: *a87
          description: A category assigned to the document reference.
          type: array
          items:
            type: string
        subject:
          description: Subject of the document.
          allOf:
            - $ref: "#/components/schemas/DocumentReferenceSubjectDto"
        date:
          type: string
          format: date-time
          example: 2000-01-30T23:59:59Z
          description: Creation date of the document.
        author:
          description: Author of the document.
          type: array
          items:
            $ref: "#/components/schemas/DocumentReferenceAuthorDto"
        custodian:
          type: string
          example: 12345-12345-12345
          description: Organisation that maintains the document.
        context:
          description: Context of the document.
          allOf:
            - $ref: "#/components/schemas/DocumentReferenceContextDto"
      required:
        - status
        - content
    PatchDocumentReferenceDto:
      type: object
      properties:
        identifier:
          description: Additional identifier/s for the resource.
          type: array
          items:
            $ref: "#/components/schemas/IdentifierDto"
        status:
          type: string
          enum:
            - current
            - superseded
            - entered-in-error
          description: The status of the document reference.
        type:
          type: string
          example: 11111-1
          description: Type of the document reference.
        category:
          example:
            - imagingreport
          description: A category assigned to the document reference.
          type: array
          items:
            type: string
        subject:
          description: Subject of the document.
          allOf:
            - $ref: "#/components/schemas/DocumentReferenceSubjectDto"
        date:
          type: string
          format: date-time
          example: 2000-01-30T23:59:59Z
          description: Creation date of the document.
        author:
          description: Author of the document.
          type: array
          items:
            $ref: "#/components/schemas/DocumentReferenceAuthorDto"
        custodian:
          type: string
          example: 12345-12345-12345
          description: Organisation that maintains the document.
        context:
          description: Context of the document.
          allOf:
            - $ref: "#/components/schemas/DocumentReferenceContextDto"
    ObservationSubjectDto:
      type: object
      properties:
        type:
          type: string
          enum:
            - Patient
            - Group
            - Device
            - Location
          description: Type of subject.
        id:
          type: string
          example: 12345-12345-12345
          description: ID of subject.
      required:
        - id
    ObservationPerformerDto:
      type: object
      properties:
        type:
          type: string
          enum:
            - Practitioner
            - PractitionerRole
            - Organization
            - CareTeam
            - Patient
            - RelatedPerson
          description: Type of performer.
        id:
          type: string
          example: 12345-12345-12345
          description: ID of performer.
      required:
        - type
        - id
    ObservationMeasurementDto:
      type: object
      properties:
        type:
          type: string
          enum:
            - Attachment
            - Boolean
            - CodeableConcept
            - DateTime
            - Integer
            - Period
            - Quantity
            - Range
            - Ratio
            - Reference
            - SampledData
            - String
            - Time
          description: Measurement type.
        value:
          type: string
          example: "100"
          description: Measurement value.
      required:
        - value
    ObservationDeviceDto:
      type: object
      properties:
        type:
          type: string
          enum:
            - Device
            - DeviceMetric
          description: Device type.
        id:
          type: string
          example: 12345-12345-12345
          description: ID of device.
      required:
        - id
    ObservationComponentDto:
      type: object
      properties:
        code:
          type: string
          example: 11111-1
          description: Observation component code.
        measurement:
          description: Observation measurement object.
          allOf:
            - $ref: "#/components/schemas/ObservationMeasurementDto"
      required:
        - code
    CreateObservationDto:
      type: object
      properties:
        identifier:
          description: Additional identifier/s for the resource.
          type: array
          items:
            $ref: "#/components/schemas/IdentifierDto"
        status:
          type: string
          enum: &a88
            - registered
            - preliminary
            - final
            - amended
            - corrected
            - cancelled
            - entered-in-error
            - unknown
          description: Status of the observation.
        code:
          type: string
          example: 2340-8
          description: Observation code.
        codeName:
          type: string
          example: Body Height
          description: Observation code system name.
        category:
          type: array
          description: Observation category.
          items: &a89
            type: string
            enum:
              - activity
              - exam
              - imaging
              - laboratory
              - procedure
              - social-history
              - survey
              - therapy
              - vital-signs
        subject:
          description: Who the observation is about.
          allOf:
            - $ref: "#/components/schemas/ObservationSubjectDto"
        effectiveDateTime:
          type: string
          format: date-time
          example: 2000-01-30T23:59:59Z
          description: The date the observed value is asserted as being true
        performer:
          description: Who performs the observation.
          type: array
          items:
            $ref: "#/components/schemas/ObservationPerformerDto"
        measurement:
          description: Observation measurement object.
          allOf:
            - $ref: "#/components/schemas/ObservationMeasurementDto"
        interpretation:
          type: array
          description: Observation interpretation.
          items: &a90
            type: string
            enum:
              - low
              - normal
              - high
        note:
          example: &a91
            - Patient is doing well.
          description: Observation note.
          type: array
          items:
            type: string
        method:
          type: string
          example: Measured by device
          description: Observation method.
        device:
          description: Device used to generate observation data.
          allOf:
            - $ref: "#/components/schemas/ObservationDeviceDto"
        component:
          description: Observation measurement object.
          type: array
          items:
            $ref: "#/components/schemas/ObservationComponentDto"
      required:
        - status
        - code
    ObservationDto:
      type: object
      properties:
        identifier:
          description: Additional identifier/s for the resource.
          type: array
          items:
            $ref: "#/components/schemas/IdentifierDto"
        status:
          type: string
          enum: *a88
          description: Status of the observation.
        code:
          type: string
          example: 2340-8
          description: Observation code.
        codeName:
          type: string
          example: Body Height
          description: Observation code system name.
        category:
          type: array
          description: Observation category.
          items: *a89
        subject:
          description: Who the observation is about.
          allOf:
            - $ref: "#/components/schemas/ObservationSubjectDto"
        effectiveDateTime:
          type: string
          format: date-time
          example: 2000-01-30T23:59:59Z
          description: The date the observed value is asserted as being true
        performer:
          description: Who performs the observation.
          type: array
          items:
            $ref: "#/components/schemas/ObservationPerformerDto"
        measurement:
          description: Observation measurement object.
          allOf:
            - $ref: "#/components/schemas/ObservationMeasurementDto"
        interpretation:
          type: array
          description: Observation interpretation.
          items: *a90
        note:
          example: *a91
          description: Observation note.
          type: array
          items:
            type: string
        method:
          type: string
          example: Measured by device
          description: Observation method.
        device:
          description: Device used to generate observation data.
          allOf:
            - $ref: "#/components/schemas/ObservationDeviceDto"
        component:
          description: Observation measurement object.
          type: array
          items:
            $ref: "#/components/schemas/ObservationComponentDto"
        resourceType:
          type: Observation
          example: Observation
          description: Observation resource type.
        id:
          type: string
          example: 12345-12345-12345
          description: Observation resource ID.
      required:
        - status
        - code
        - resourceType
        - id
    ResponseObservationDto:
      type: object
      properties:
        data:
          description: List of Observation resources
          type: array
          items:
            $ref: "#/components/schemas/ObservationDto"
            format: array
        total:
          type: number
          example: 50
          format: number
          description: The total amount of resources.
      required:
        - data
        - total
    QuestionnaireAnswerOptionDto:
      type: object
      properties:
        valueInteger:
          type: number
          example: 123
          description: Answer value as a number.
        valueDate:
          type: string
          format: date-time
          example: 2000-01-30T23:59:59Z
          description: Answer value as a date.
        valueString:
          type: string
          example: abc
          description: Answer value as a string.
        valueCoding:
          type: string
          example: 11111-1
          description: Answer value as a code.
    QuestionnaireItemDto:
      type: object
      properties:
        linkId:
          type: string
          example: abc123
          description: Question identifier, unique within the Questionnaire.
        type:
          type: string
          enum:
            - choice
            - group
            - open-choice
          description: |-
            Type of question.
                Attention:
                - "Group" item type must have nested items.
        code:
          example:
            - 11111-1
          description: "Code which corresponds to this question and uses the LOINC
            terminology: http://loinc.org"
          type: array
          items:
            type: string
        text:
          type: string
          example: abc123
          description: Question text.
        repeats:
          type: boolean
          example: true
          description: Indicates whether the question may occur multiple times.
        answerOption:
          description: >-
            Permitted answers.
                Attention:
                - Only "Choice"/"Open-Choice" item type can use the "answerOption" parameter.
          type: array
          items:
            $ref: "#/components/schemas/QuestionnaireAnswerOptionDto"
        item:
          description: Questions and sections within the questionnaire.
          type: array
          items:
            $ref: "#/components/schemas/QuestionnaireItemDto"
      required:
        - linkId
        - type
    CreateQuestionnaireDto:
      type: object
      properties:
        identifier:
          description: Additional identifier/s for the resource.
          type: array
          items:
            $ref: "#/components/schemas/IdentifierDto"
        status:
          type: string
          enum: &a92
            - active
            - draft
            - retired
            - unknown
          description: Status of the Questionnaire.
        name:
          type: string
          example: questionnaire ABC
          description: Natural language name to identify the Questionnaire.
        description:
          type: string
          example: abc123
          description: Description of the Questionnaire from the consumer's perspective.
        code:
          example: &a93
            - 11111-1
          description: "Identifier for questions/s using the LOINC terminology:
            http://loinc.org"
          type: array
          items:
            type: string
        item:
          description: Questions and sections within the questionnaire.
          type: array
          items:
            $ref: "#/components/schemas/QuestionnaireItemDto"
      required:
        - status
    QuestionnaireDto:
      type: object
      properties:
        identifier:
          description: Additional identifier/s for the resource.
          type: array
          items:
            $ref: "#/components/schemas/IdentifierDto"
        status:
          type: string
          enum: *a92
          description: Status of the Questionnaire.
        name:
          type: string
          example: questionnaire ABC
          description: Natural language name to identify the Questionnaire.
        description:
          type: string
          example: abc123
          description: Description of the Questionnaire from the consumer's perspective.
        code:
          example: *a93
          description: "Identifier for questions/s using the LOINC terminology:
            http://loinc.org"
          type: array
          items:
            type: string
        item:
          description: Questions and sections within the questionnaire.
          type: array
          items:
            $ref: "#/components/schemas/QuestionnaireItemDto"
        resourceType:
          type: Questionnaire
          example: Questionnaire
          description: Questionnaire resource type.
        id:
          type: string
          example: 12345-12345-12345
          description: Questionnaire resource ID.
      required:
        - status
        - resourceType
        - id
    ResponseQuestionnaireDto:
      type: object
      properties:
        data:
          description: List of Questionnaire resources
          type: array
          items:
            $ref: "#/components/schemas/QuestionnaireDto"
            format: array
        total:
          type: number
          example: 50
          format: number
          description: The total amount of resources.
      required:
        - data
        - total
    OvokHealthcheckResponseDto:
      type: object
      properties:
        ok:
          type: boolean
          example: true
          description: Ovok state.
        version:
          type: object
          example: 0.0.1
        buildEnv:
          type: object
          example: development
        commitHash:
          type: object
          example: abc123
        buildDate:
          type: object
          example: 2026-04-12T17:00:00.000Z
          nullable: true
        runningSince:
          type: object
          example: 2026-04-12T17:21:21.410Z
          nullable: true
      required:
        - ok
