openapi: 3.0.3
info:
  title: InspectLife
  description: Tak jsem tady zas
  version: 3.1.0
servers:
  - url: https://api.inspectlife.vyvijime.eu
  - url: http://localhost:8000

paths:
  /auth_api/v1/oauth/authorize:
    post:
      summary: OAuth password grant
      tags:
        - OAuth
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                username:
                  type: string
                  example: "pacient@inspectlife.com"
                password:
                  type: string
                  example: "123456qQ"
                client_id:
                  type: string
                  example: "60c1db0c7039c43054191ea2"
                client_secret:
                  type: string
                  example: "ice_wallow_come"
                scope:
                  type: string
                  example: "all"
                grant_type:
                  type: string
                  example: "password"
      responses:
        200:
          description: Úspěšné vygenerování JWT tokenu
          content:
            application/json:
              schema:
                type: object
                properties:
                  token_type:
                    type: string
                    example: Bearer
                  expires_in:
                    type: number
                    example: 86400
                  access_token:
                    type: string
                    example: eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJpc3MiOiJpbnNwZWN0YXV0aCIsImF1ZCI6IjYwYzFkYjBjNzAzOWM0MzA1NDE5MWVhMiIsImp0aSI6IjlmZTQ2OTI5MTE2NWU3MmJhNTYzZTQzNGU2ODRhODMzMTQyNjNkZDlmNTI2YTdlNGI5YzMwMGQ5NmMzY2MxYWI4NGE3NzVlYzc3ZjgzNDZiIiwiaWF0IjoxNjIzNjY4MTMxLjQwODM5OCwibmJmIjoxNjIzNjY4MTMxLjQwODM5OSwiZXhwIjoxNjIzNzU0NTMxLjQwNzM0OCwic3ViIjoiNjBjMWRlNTEyNDlkZTgwNzNmN2I4OTYyIiwic2NvcGVzIjpbbnVsbF19.PYfUCYqOEHrZWvZUZ35Ssn2OxgKskXyp6trlNBdP4MUwUN4bl2y5fsjXIhEMo8KpSWF1n3b8g72hHM9lCKXSqXzbl-8DgW0QM3pwj84CxWHL173gkE_tMlMSTXAUBKjy7MtiFZJ_-MGQxhQ44v_cGUGiW-Iz82oJtnhtqH76h4XlZ0uYQMN4uzavUnUWbk6i9ZAFYvfcx2VIIhZUUZCTq1RtinZAgGCQ7zBT0UvGirUCvMnXCrgKfml6KMe0P9SmYKeH2RCQ2g7h8j_1N_GI11iLVrawWgrlVhfHfrAAIm39jkVWicanYnCkILfuY64f6QIMVfutC10Bimi4l0SQIw

  /base_api/v1/apple-healthkit/{patient_id}/last_updated:
    get:
      summary: Endpoint pro fetch datumu poslední aktualizace dat z apple healthkit
      tags:
        - Healthkit
      security:
        - bearerAuth: [ ]
      parameters:
        - in: path
          name: patient_id
          schema:
            type: string
          required: true
      responses:
        200:
          description: Úspěšný fetch datumu poslední aktualizace dat z apple healthkit
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: ok
                  data:
                    type: object
                    properties:
                      last_update:
                        type: string
                        format: date-time

  /base_api/v1/enums:
    get:
      summary: Endpoint pro fetch hodnot enumů
      tags:
        - Enums
      parameters:
        - in: query
          name: enums[]
          schema:
            type: array
            items:
              type: string
          description: Název enumerátoru (např. SportType nebo FamilyAnamneis\\CnsDiseases)
      responses:
        200:
          description: Úspěšný tech hodnot enumu
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: ok
                  data:
                    type: array
                    items:
                      type: string

  /auth_api/v1/rocketchat/users:
    get:
      summary: Vrátí všechny uživatele pro doktora pro chat
      security:
        - bearerAuth: [ ]
      tags:
        - RocketChat
      parameters:
        - in: header
          name: X-Role-Id
          required: true
          schema:
            type: string
      responses:
        200:
          description: Úspěšný fetch uživatelů
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: ok
                  data:
                    type: object
                    properties:
                      number:
                        type: number
                      count:
                        type: number
                      next:
                        type: number
                      size:
                        type: number
                      total_count:
                        type: number
                      current:
                        type: array
                        items:
                          type: object
                          properties:
                            _id:
                              type: string
                            first_name:
                              type: string
                            last_name:
                              type: string
                            email:
                              type: string
                            roles:
                              type: array
                              items:
                                type: object
                                properties:
                                  id:
                                    type: string
                                  level:
                                    type: string
                                  object_id:
                                    type: string
                            rocketchat_username:
                              type: string
                            rocketchat_id:
                              type: string

  /base_api/v1/patients:
    post:
      summary: Registrace uživatele skrze lékaře
      security:
        - bearerAuth: [ ]
      tags:
        - OnboardingViaDoctor
      parameters:
        - in: header
          name: X-Role-Id
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                first_name:
                  type: string
                last_name:
                  type: string
                email:
                  type: string
                  format: email
                country:
                  type: string
                  example: "cz"
                pin:
                  type: string
                  example: "000000/0000"
                health_insurance_company_code:
                  type: string
                  enum:
                    - vzp
                    - vozp
                    - cpzp
                    - ozp
                    - zps
                    - zpmvcr
                    - rbp
      responses:
        200:
          description: Úspěšná registrace pacienta skrze lékaře
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Success"

  /base_api/v1/patients/{patient_id}:
    put:
      summary: Update pacienta skrze lékaře
      security:
          - bearerAuth: [ ]
      tags:
        - OnboardingViaDoctor
      parameters:
        - in: header
          name: X-Role-Id
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                first_name:
                  type: string
                last_name:
                  type: string
                email:
                  type: string
                  format: email
                country:
                  type: string
                  example: "cz"
                pin:
                  type: string
                  example: "000000/0000"
                health_insurance_company_code:
                  type: string
                  enum:
                    - vzp
                    - vozp
                    - cpzp
                    - ozp
                    - zps
                    - zpmvcr
                    - rbp
      responses:
        200:
          description: Úspěšný update pacienta skrze lékaře
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Success"

  /base_api/v1/patients/verify/{patient_id}:
    put:
      summary: Ověří pacienta
      tags:
        - OnboardingViaDoctor
      parameters:
        - in: path
          name: patient_id
          required: true
          schema:
            type: string
        - in: header
          name: X-Role-Id
          required: true
          schema:
            type: string
      security:
        - bearerAuth: [ ]
      responses:
        200:
          description: Úspěšné ověření pacienta
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Success"

  /base_api/v1/event/users:
    get:
      summary: Hledá uživatele, které můžu pozvat do chatu (pouze pro doktora)
      tags:
        - EventSearch
      parameters:
        - in: header
          name: X-Role-Id
          required: true
          schema:
            type: string
        - in: query
          name: search
          required: false
          schema:
            type: string
      security:
        - bearerAuth: [ ]
      responses:
        200:
          description: Úspěšný fetch
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: ok
                  data:
                    type: object
                    properties:
                      number:
                        type: number
                      count:
                        type: number
                      next:
                        type: number
                      prev:
                        type: number
                      size:
                        type: number
                      total_count:
                        type: number
                      total_filtered_count:
                        type: number
                      current:
                        type: array
                        items:
                          type: object
                          properties:
                            name:
                              type: string
                            _id:
                              type: string
                            type:
                              type: string
                              enum: ["patient", "doctor"]



  /base_api/v1/onboarding:
    post:
      summary: Registrace uživatele
      tags:
        - Onboarding
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                first_name:
                  type: string
                  example: Jan
                middle_name:
                  type: string
                  example: Jakub
                last_name:
                  type: string
                  example: Jonášovic
                degrees_before:
                  type: string
                degrees_after:
                  type: string
                email:
                  type: string
                  format: email
                  example: pacient@inspectlife.com
                phone_number_code:
                  type: string
                  example: +420
                phone_number:
                  type: string
                  format: phone
                  example: 123 456 789
                country:
                  type: string
                  example: cz
                pin:
                  type: string
                  example: 720806/0530
                health_insurance_company_code:
                  type: string
                  example: vzp
                password:
                  type: string
                  example: 123456qQ
                password_match:
                  type: string
                  example: 123456qQ
                permanent_residence_address:
                  type: object
                  properties:
                    street:
                      type: string
                      example: Pernerova
                    street_number:
                      type: string
                      example: 1556
                    city:
                      type: string
                      example: Pardubice
                    postal_code:
                      type: string
                      example: 530 02
                correspondence_address:
                  type: object
                  properties:
                    street:
                      type: string
                      example: Sukova Třída
                    street_number:
                      type: string
                      example: 468
                    city:
                      type: string
                      example: Pardubice
                    postal_code:
                      type: string
                      example: 530 02
                different_correspondence:
                  type: boolean
                  example: true
      responses:
        200:
          description: Úspěšná registrace nového uživatele
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Success"

  /base_api/v1/patient/{patient}:
    get:
      summary: Fetch pacienotvých dat do nastavení
      security:
        - bearerAuth: [ ]
      tags:
        - Patient
      parameters:
        - in: path
          name: patient
          required: true
          schema:
            type: string
          description: ObjectID pacienta v base
        - in: header
          name: X-Role-Id
          schema:
            type: string
          required: true
      responses:
        200:
          description: Úspěšný fetch dat o pacientovi
          content:
            application/json:
              schema:
                type: object
                properties:
                  first_name:
                    type: string
                  last_name:
                    type: string
                  middle_name:
                    type: string
                  degrees_before:
                    type: string
                  degrees_after:
                    type: string
                  email:
                    type: string
                  phone_number:
                    type: string
                  personal_identification_number:
                    type: string
                  country:
                    type: string
                  health_insurance_company_code:
                    type: string
                  rocketchat_username:
                    type: string
                  permanent_residence_address:
                    type: object
                    properties:
                      street:
                        type: string
                      street_number:
                        type: string
                      city:
                        type: string
                      postal_code:
                        type: string
                  correspondence_address:
                    type: object
                    properties:
                      street:
                        type: string
                      street_number:
                        type: string
                      city:
                        type: string
                      postal_code:
                        type: string
                  different_correspondence:
                    type: boolean
    put:
      summary: Update pacienta z nastavení v base serveru
      security:
        - bearerAuth: [ ]
      tags:
        - Patient
      parameters:
        - in: path
          name: patient
          required: true
          schema:
            type: string
        - in: header
          name: X-Role-Id
          schema:
            type: string
          required: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                first_name:
                  type: string
                middle_name:
                  type: string
                last_name:
                  type: string
                degrees_before:
                  type: string
                degrees_after:
                  type: string
                phone_number_code:
                  type: string
                phone_number:
                  type: string
                pin:
                  type: string
                  example: 210101/0010
                health_insurance_company_code:
                  type: string
                  example: vzp
                country:
                  type: string
                  example: cz
                permanent_residence_address:
                  type: object
                  properties:
                    street:
                      type: string
                    street_number:
                      type: string
                    city:
                      type: string
                    postal_code:
                      type: string
                correspondence_address:
                  type: object
                  properties:
                    street:
                      type: string
                    street_number:
                      type: string
                    city:
                      type: string
                    postal_code:
                      type: string
                different_correspondence:
                  type: boolean
      responses:
        200:
          description: Úspěšný update pacienta
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Success"

  /auth_api/v1/user:
    get:
      summary: Whoami
      security:
        - bearerAuth: [ ]
      tags:
        - Whoami
      responses:
        200:
          description: Úspěšné whoami
          content:
            application/json:
              schema:
                allOf:
                  - $ref: "#/components/schemas/Success"
                  - type: object
                    properties:
                      data:
                        type: object
                        properties:
                          first_name:
                            type: string
                          last_name:
                            type: string
                          email:
                            type: string
                            format: email
                          _id:
                            type: string
                            example: 60d5c2e4d4078e75f1129602
                          roles:
                            type: array
                            items:
                              type: object
                              properties:
                                title:
                                  type: string
                                level:
                                  type: string
                                  example: patient
                                patient_access:
                                  type: string
                                  example: owner
                                object_id:
                                  type: string
                                  example: 60d5c2e339c7d94ed034d492
                          role:
                            type: object
                            properties:
                              title:
                                type: string
                              level:
                                type: string
                                example: patient
                              patient_access:
                                type: string
                                example: owner
                              object_id:
                                type: string
                                example: 60d5c2e339c7d94ed034d492


  /auth_api/v1/forgotten_password:
    post:
      summary: Vytvoří požadavek na reset hesla
      tags:
        - ForgottenPassword
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                email:
                  type: string
                  format: email
                  example: pacient@inspectlife.com
      responses:
        200:
          description: Úspěšné vytvoření požadavku na změnu hesla
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Success"

    put:
      summary: Změní heslo po předchozí žádosti o reset hesla
      tags:
        - ForgottenPassword
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                token:
                  type: string
                password:
                  type: string
                password_match:
                  type: string
      responses:
        200:
          description: Úspěšný reset hesla
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Success"

  /cal_api/v1/events:
    post:
      summary: Vytvoření eventu
      security:
        - bearerAuth: [ ]
      tags:
        - Events
      parameters:
        - in: header
          name: X-Role-Id
          schema:
            type: string
          required: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/Event"
      responses:
        200:
          description: Úspěšné vytvoření eventu
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Success"

    get:
      summary: Fetch eventů pro uživatele
      security:
        - bearerAuth: [ ]
      tags:
        - Events
      responses:
        200:
          description: Úspěšný fetch eventů pro uživatele
          content:
            application/json:
              schema:
                allOf:
                  - $ref: "#/components/schemas/Success"
                  - type: object
                    properties:
                      data:
                        type: array
                        items:
                          $ref: "#/components/schemas/EventParsed"

  /cal_api/v1/events/{id}:
    put:
      summary: Update eventu
      security:
        - bearerAuth: [ ]
      parameters:
        - in: path
          name: id
          schema:
            type: string
          required: true
          description: ObjectID
      tags:
        - Events
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/Event"
      responses:
        200:
          description: Úspěšný update eventu
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Success"

    delete:
      summary: Odstranění eventu
      security:
        - bearerAuth: [ ]
      parameters:
        - in: path
          name: id
          schema:
            type: string
          required: true
          description: ObjectID
      tags:
        - Events
      responses:
        200:
          description: Úspěšné smazání eventu
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Success"

  /cal_api/v1//events/{id}/rsvp:
    put:
      summary: Reakce na event
      security:
        - bearerAuth: [ ]
      parameters:
        - in: path
          name: id
          schema:
            type: string
          required: true
          description: ObjectID
      tags:
        - Events
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                rsvp:
                  type: string
                  enum: [yes, no, unknow, tentative]
      responses:
        200:
          description: Úspěšná reakce na event
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Success"

  /order_api/v1/accessories/categories:
    post:
      summary: Vytvoření kategorie příslušenství
      security:
        - bearerAuth: [ ]
      tags:
        - OrderingAccessoryCategory
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/AccessoryCategory"
      responses:
        200:
          description: Úpsěšné vytvoření kategorie příslušenství
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Success"

    get:
      summary: Fetch všech kategorií příslušenství
      security:
        - bearerAuth: [ ]
      tags:
        - OrderingAccessoryCategory
      parameters:
        - in: query
          name: page
          required: false
          schema:
            type: integer
            example: 2
        - in: query
          name: size
          required: false
          schema:
            type: integer
            example: 10
        - in: query
          name: sort
          required: false
          schema:
            type: string
            example: "date_of_execution"
        - in: query
          name: order
          required: false
          schema:
            type: string
            example: "asc"
        - in: query
          name: fromDate
          required: false
          schema:
            type: string
            format: date
            example: "2016-05-09"
        - in: query
          name: toDate
          required: false
          schema:
            type: string
            format: date
            example: "2016-05-12"
      responses:
        200:
          description: Úspěšný fetch všech kategorií příslušenství
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: ok
                  page:
                    type: object
                    properties:
                      number:
                        type: number
                      count:
                        type: number
                      next:
                        type: number
                      size:
                        type: number
                      total_count:
                        type: number
                      current:
                        type: array
                        items:
                          $ref: "#/components/schemas/AccessoryCategoryParsed"

  /order_api/v1/accessories/categories/{id}:
    get:
      summary: Fetch jedné kategorie příslušenství
      security:
        - bearerAuth: [ ]
      parameters:
        - in: path
          name: id
          schema:
            type: string
          required: true
          description: ObjectID
      tags:
        - OrderingAccessoryCategory
      responses:
        200:
          description: Úspěšný fetch jedné kategorie příslušenství
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: ok
                  data:
                    $ref: "#/components/schemas/AccessoryCategoryParsed"
    put:
      summary: Update jedné kategorie příslušenství
      security:
        - bearerAuth: [ ]
      parameters:
        - in: path
          name: id
          schema:
            type: string
          required: true
          description: ObjectID
      tags:
        - OrderingAccessoryCategory
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/AccessoryCategory"
      responses:
        200:
          description: Úspěšný update jedné kategorie příslušenství
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Success"
    delete:
      summary: Odstranění jedné kategorie příslušenství
      security:
        - bearerAuth: [ ]
      parameters:
        - in: path
          name: id
          schema:
            type: string
          required: true
          description: ObjectID
      tags:
        - OrderingAccessoryCategory
      responses:
        200:
          description: Úspěšné odstraněný jedné kategorie příslušenství
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Success"

  /order_api/v1/accessories/categories/{accessory_category_id}/items:
    post:
      summary: Vytvoření příslušenství
      security:
        - bearerAuth: [ ]
      parameters:
        - in: path
          name: accessory_category_id
          schema:
            type: string
          required: true
          description: ObjectID
      tags:
        - OrderingAccessoryCategory
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/Accessory"
      responses:
        200:
          description: Úpsěšné vytvoření příslušenství
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Success"

    get:
      summary: Fetch všech příslušenství
      security:
        - bearerAuth: [ ]
      tags:
        - OrderingAccessoryCategory
      parameters:
        - in: path
          name: accessory_category_id
          schema:
            type: string
          required: true
          description: ObjectID
        - in: query
          name: page
          required: false
          schema:
            type: integer
            example: 2
        - in: query
          name: size
          required: false
          schema:
            type: integer
            example: 10
        - in: query
          name: sort
          required: false
          schema:
            type: string
            example: "date_of_execution"
        - in: query
          name: order
          required: false
          schema:
            type: string
            example: "asc"
        - in: query
          name: fromDate
          required: false
          schema:
            type: string
            format: date
            example: "2016-05-09"
        - in: query
          name: toDate
          required: false
          schema:
            type: string
            format: date
            example: "2016-05-12"
      responses:
        200:
          description: Úspěšný fetch všech příslušenství
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: ok
                  page:
                    type: object
                    properties:
                      number:
                        type: number
                      count:
                        type: number
                      next:
                        type: number
                      size:
                        type: number
                      total_count:
                        type: number
                      current:
                        type: array
                        items:
                          $ref: "#/components/schemas/Accessory"

  /order_api/v1/accessories/categories/{accessory_category_id}/items/{accessory_id}:
    get:
      summary: Fetch jednoho příslušenství
      security:
        - bearerAuth: [ ]
      parameters:
        - in: path
          name: accessory_category_id
          schema:
            type: string
          required: true
          description: ObjectID
        - in: path
          name: acessory_id
          schema:
            type: string
          required: true
          description: ObjectID
      tags:
        - OrderingAccessoryCategory
      responses:
        200:
          description: Úspěšný fetch jednoho příslušenství
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: ok
                  data:
                    $ref: "#/components/schemas/Accessory"
    put:
      summary: Update jednoho příslušenství
      security:
        - bearerAuth: [ ]
      parameters:
        - in: path
          name: accessory_category_id
          schema:
            type: string
          required: true
          description: ObjectID
        - in: path
          name: acessory_id
          schema:
            type: string
          required: true
          description: ObjectID
      tags:
        - OrderingAccessoryCategory
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/Accessory"
      responses:
        200:
          description: Úspěšný update jednoho příslušenství
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Success"
    delete:
      summary: Odstranění jednoho příslušenství
      security:
        - bearerAuth: [ ]
      parameters:
        - in: path
          name: accessory_category_id
          schema:
            type: string
          required: true
          description: ObjectID
        - in: path
          name: acessory_id
          schema:
            type: string
          required: true
          description: ObjectID
      tags:
        - OrderingAccessoryCategory
      responses:
        200:
          description: Úspěšné odstraněný jednoho příslušenství
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Success"

  /order_api/v1/services:
    post:
      summary: Vytvoření služby
      security:
        - bearerAuth: [ ]
      tags:
        - OrderingService
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/Service"
      responses:
        200:
          description: Úpsěšné vytvoření služby
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Success"

    get:
      summary: Fetch všech služeb
      security:
        - bearerAuth: [ ]
      tags:
        - OrderingService
      parameters:
        - in: query
          name: page
          required: false
          schema:
            type: integer
            example: 2
        - in: query
          name: size
          required: false
          schema:
            type: integer
            example: 10
        - in: query
          name: sort
          required: false
          schema:
            type: string
            example: "date_of_execution"
        - in: query
          name: order
          required: false
          schema:
            type: string
            example: "asc"
        - in: query
          name: fromDate
          required: false
          schema:
            type: string
            format: date
            example: "2016-05-09"
        - in: query
          name: toDate
          required: false
          schema:
            type: string
            format: date
            example: "2016-05-12"
      responses:
        200:
          description: Úspěšný fetch všech služeb
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: ok
                  page:
                    type: object
                    properties:
                      number:
                        type: number
                      count:
                        type: number
                      next:
                        type: number
                      size:
                        type: number
                      total_count:
                        type: number
                      current:
                        type: array
                        items:
                          $ref: "#/components/schemas/ServiceParsed"

  /order_api/v1/services/{id}:
    get:
      summary: Fetch jedné služby
      security:
        - bearerAuth: [ ]
      parameters:
        - in: path
          name: id
          schema:
            type: string
          required: true
          description: ObjectID
      tags:
        - OrderingService
      responses:
        200:
          description: Úspěšný fetch jedné služby
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: ok
                  data:
                    $ref: "#/components/schemas/ServiceParsed"
    put:
      summary: Update jedné služby
      security:
        - bearerAuth: [ ]
      parameters:
        - in: path
          name: id
          schema:
            type: string
          required: true
          description: ObjectID
      tags:
        - OrderingService
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/Service"
      responses:
        200:
          description: Úspěšný update jedné služby
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Success"
    delete:
      summary: Odstranění jedné služby
      security:
        - bearerAuth: [ ]
      parameters:
        - in: path
          name: id
          schema:
            type: string
          required: true
          description: ObjectID
      tags:
        - OrderingService
      responses:
        200:
          description: Úspěšné odstraněný jedné služby
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Success"

  /order_api/v1/orders:
    post:
      summary: Vytvoření objednávky
      security:
        - bearerAuth: [ ]
      tags:
        - Order
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/Order"
      responses:
        200:
          description: Úspěšné vytvoření objednávky
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Success"

    get:
      summary: Fetch všech objednávek
      security:
        - bearerAuth: [ ]
      tags:
        - Order
      parameters:
        - in: query
          name: page
          required: false
          schema:
            type: integer
            example: 2
        - in: query
          name: size
          required: false
          schema:
            type: integer
            example: 10
        - in: query
          name: sort
          required: false
          schema:
            type: string
            example: "date_of_execution"
        - in: query
          name: order
          required: false
          schema:
            type: string
            example: "asc"
        - in: query
          name: fromDate
          required: false
          schema:
            type: string
            format: date
            example: "2016-05-09"
        - in: query
          name: toDate
          required: false
          schema:
            type: string
            format: date
            example: "2016-05-12"
      responses:
        200:
          description: Úspěšný fetch všech objednávek
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: ok
                  page:
                    type: object
                    properties:
                      number:
                        type: number
                      count:
                        type: number
                      next:
                        type: number
                      size:
                        type: number
                      total_count:
                        type: number
                      current:
                        type: array
                        items:
                          $ref: "#/components/schemas/OrderParsed"

  /order_api/v1/orders/my:
    get:
      summary: Fetch mých objednávek
      security:
        - bearerAuth: [ ]
      tags:
        - Order
      parameters:
        - in: query
          name: limit
          required: false
          schema:
            type: integer
            example: 10
        - in: query
          name: offset
          required: false
          schema:
            type: integer
            example: 0
      responses:
        200:
          description: Úspěšný fetch všech objednávek
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: ok
                  page:
                    type: object
                    properties:
                      number:
                        type: number
                      count:
                        type: number
                      next:
                        type: number
                      size:
                        type: number
                      total_count:
                        type: number
                      current:
                        type: array
                        items:
                          $ref: "#/components/schemas/OrderParsed"

  /order_api/v1/orders/{id}:
    get:
      summary: Fetch jedné objednávky
      security:
        - bearerAuth: [ ]
      parameters:
        - in: path
          name: id
          schema:
            type: string
          required: true
          description: ObjectID
      tags:
        - Order
      responses:
        200:
          description: Úspěšný fetch jedné objednávky
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: ok
                  data:
                    $ref: "#/components/schemas/OrderParsed"

  /base_api/v1/checkups/{patient_id}:
    post:
      summary: Vytvoření prohlídky
      security:
        - bearerAuth: [ ]
      parameters:
        - in: path
          name: patient_id
          schema:
            type: string
          required: true
          description: ObjectID
        - in: header
          name: X-Role-Id
          schema:
            type: string
            required: true
      tags:
        - Checkup
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CheckupHistoryEntry"
      responses:
        200:
          description: Úspěšné vložení záznamu do DB
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Success"
    get:
      summary: Fetch všech checkups
      security:
        - bearerAuth: [ ]
      tags:
        - Checkup
      parameters:
        - in: path
          name: patient_id
          schema:
            type: string
          required: true
          description: ObjectID
        - in: header
          name: X-Role-Id
          schema:
            type: string
          required: true
        - in: query
          name: page
          required: false
          schema:
            type: integer
            example: 2
        - in: query
          name: size
          required: false
          schema:
            type: integer
            example: 10
        - in: query
          name: sort
          required: false
          schema:
            type: string
            example: "date_of_execution"
        - in: query
          name: order
          required: false
          schema:
            type: string
            example: "asc"
        - in: query
          name: fromDate
          required: false
          schema:
            type: string
            format: date
            example: "2016-05-09"
        - in: query
          name: toDate
          required: false
          schema:
            type: string
            format: date
            example: "2016-05-12"
      responses:
        200:
          description: Úspěšné navrácení všech záznamů
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: ok
                  page:
                    type: object
                    properties:
                      number:
                        type: number
                      count:
                        type: number
                      next:
                        type: number
                      size:
                        type: number
                      total_count:
                        type: number
                      current:
                        type: array
                        items:
                          $ref: "#/components/schemas/CheckupHistoryEntry"

  /base_api/v1/checkups/{patient_id}/{checkup_id}:
    get:
      summary: Fetch jednoho záznamu v checkups
      security:
        - bearerAuth: [ ]
      tags:
        - Checkup
      parameters:
        - in: path
          name: patient_id
          schema:
            type: string
          required: true
          description: ObjectID
        - in: path
          name: checkup_id
          schema:
            type: string
          required: true
          description: ObjectID
        - in: header
          name: X-Role-Id
          schema:
            type: string
          required: true
      responses:
        200:
          description: Úspěšné navrácení záznamu
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: ok
                  data:
                    $ref: "#/components/schemas/CheckupHistoryEntry"
    put:
      summary: Update záznamu checkup
      security:
        - bearerAuth: [ ]
      tags:
        - Checkup
      parameters:
        - in: path
          name: patient_id
          schema:
            type: string
          required: true
          description: ObjectID
        - in: path
          name: checkup_id
          schema:
            type: string
          required: true
          description: ObjectID
        - in: header
          name: X-Role-Id
          schema:
            type: string
          required: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CheckupHistoryEntry"
      responses:
        200:
          description: Úspěšné updatnutí záznamu
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Success"
    delete:
      summary: Odebrání záznamu z měření
      security:
        - bearerAuth: [ ]
      tags:
        - Checkup
      parameters:
        - in: path
          name: patient_id
          schema:
            type: string
          required: true
          description: ObjectID
        - in: path
          name: checkup_id
          schema:
            type: string
          required: true
          description: ObjectID
        - in: header
          name: X-Role-Id
          schema:
            type: string
          required: true
      responses:
        200:
          description: Úspěšné smazání záznamu
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Success"

  /base_api/v1/anamnesis/{patient_id}/addictive_substances:
    get:
      summary: Fetch anamnézy návykových látek
      parameters:
        - in: path
          name: patient_id
          schema:
            type: string
          required: true
          description: ObjectID
        - in: header
          name: X-Role-Id
          schema:
            type: string
          required: true
      security:
        - bearerAuth: [ ]
      tags:
        - AddictiveSubstanceAnamnesis
      responses:
        200:
          description: Úspěšný fetch anamnézy návykových látek
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: ok
                  data:
                    $ref: "#/components/schemas/AddictiveSubstances"

    put:
      summary: Update anamnézy návykových látek
      parameters:
        - in: path
          name: patient_id
          schema:
            type: string
          required: true
          description: ObjectID
        - in: header
          name: X-Role-Id
          schema:
            type: string
          required: true
      security:
        - bearerAuth: [ ]
      tags:
        - AddictiveSubstanceAnamnesis
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/AddictiveSubstances"
      responses:
        200:
          description: Úspěšný update anamnézy návykových látek
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Success"

  /base_api/v1/anamnesis/{patient_id}/personal:
    get:
      summary: Fetch osobní anamnézy
      parameters:
        - in: path
          name: patient_id
          schema:
            type: string
          required: true
          description: ObjectID
        - in: header
          name: X-Role-Id
          schema:
            type: string
          required: true
      security:
        - bearerAuth: [ ]
      tags:
        - PersonalAnamnesis
      responses:
        200:
          description: Úspěšné navrácení osobní anamnézy
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PersonalAnamnesis"
    put:
      summary: Update osobní anamnézy
      parameters:
        - in: path
          name: patient_id
          schema:
            type: string
          required: true
          description: ObjectID
        - in: header
          name: X-Role-Id
          schema:
            type: string
          required: true
      security:
        - bearerAuth: [ ]
      tags:
        - PersonalAnamnesis
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/PersonalAnamnesis"
      responses:
        200:
          description: Úspěšné upravení osobní anamnézy
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Success"

  /base_api/v1/anamnesis/{patient_id}/medications:
    post:
      summary: Vytvoření záznamnu v medikační anamnéze
      parameters:
        - in: path
          name: patient_id
          schema:
            type: string
          required: true
          description: ObjectID
        - in: header
          name: X-Role-Id
          schema:
            type: string
          required: true
      security:
        - bearerAuth: [ ]
      tags:
        - MedicationAnamnesis
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/MedicationAnamnesis"
      responses:
        200:
          description: Úspěšné vytvoření medikace
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Success"
    get:
      summary: Fetch kompletní medikační anamnézy
      security:
        - bearerAuth: [ ]
      tags:
        - MedicationAnamnesis
      parameters:
        - in: path
          name: patient_id
          schema:
            type: string
          required: true
          description: ObjectID
        - in: header
          name: X-Role-Id
          schema:
            type: string
          required: true
        - in: query
          name: page
          required: false
          schema:
            type: integer
            example: 2
        - in: query
          name: size
          required: false
          schema:
            type: integer
            example: 10
        - in: query
          name: sort
          required: false
          schema:
            type: string
            example: "date_of_execution"
        - in: query
          name: order
          required: false
          schema:
            type: string
            example: "asc"
        - in: query
          name: fromDate
          required: false
          schema:
            type: string
            format: date
            example: "2016-05-09"
        - in: query
          name: toDate
          required: false
          schema:
            type: string
            format: date
            example: "2016-05-12"
      responses:
        200:
          description: Úspěšné navrácení všech záznamů
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: ok
                  page:
                    type: object
                    properties:
                      number:
                        type: number
                      count:
                        type: number
                      next:
                        type: number
                      size:
                        type: number
                      total_count:
                        type: number
                      current:
                        type: array
                        items:
                          $ref: "#/components/schemas/MedicationAnamnesis"

  /base_api/v1/anamnesis/{patient_id}/medications/{id}:
    get:
      summary: Fetch záznamu v medikační anamnéze
      parameters:
        - in: path
          name: patient_id
          schema:
            type: string
          required: true
          description: ObjectID
        - in: path
          name: id
          schema:
            type: string
          required: true
          description: ObjectID
        - in: header
          name: X-Role-Id
          schema:
            type: string
          required: true
      security:
        - bearerAuth: [ ]
      tags:
        - MedicationAnamnesis
      responses:
        200:
          description: Úspěšné navrácení záznamu
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: ok
                  data:
                    $ref: "#/components/schemas/MedicationAnamnesis"
    put:
      summary: Update záznamu v medikační anamnéze
      parameters:
        - in: path
          name: patient_id
          schema:
            type: string
          required: true
          description: ObjectID
        - in: path
          name: id
          schema:
            type: string
          required: true
          description: ObjectID
        - in: header
          name: X-Role-Id
          schema:
            type: string
          required: true
      security:
        - bearerAuth: [ ]
      tags:
        - MedicationAnamnesis
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/MedicationAnamnesis"
      responses:
        200:
          description: Úspěšné updatnutí záznamu
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Success"
    delete:
      summary: Odebrání záznamu z medikační anamnézy
      parameters:
        - in: path
          name: patient_id
          schema:
            type: string
          required: true
          description: ObjectID
        - in: path
          name: id
          schema:
            type: string
          required: true
          description: ObjectID
        - in: header
          name: X-Role-Id
          schema:
            type: string
          required: true
      security:
        - bearerAuth: [ ]
      tags:
        - MedicationAnamnesis
      responses:
        200:
          description: Úspěšné smazání záznamu
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Success"

  /base_api/v1/anamnesis/{patient_id}/epidemiology:
    post:
      summary: Vytvoření záznamu v epidemiologické anamnéze
      parameters:
        - in: path
          name: patient_id
          schema:
            type: string
          required: true
          description: ObjectID
        - in: header
          name: X-Role-Id
          schema:
            type: string
          required: true
      security:
        - bearerAuth: [ ]
      tags:
        - EpidemiologyAnamnesis
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/EpidemiologyAnamnesis"
      responses:
        200:
          description: Úspěšné vytvoření záznamu
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Success"
    get:
      summary: Fetch kompletní epidemiologické anamnézy
      security:
        - bearerAuth: [ ]
      tags:
        - EpidemiologyAnamnesis
      parameters:
        - in: path
          name: patient_id
          schema:
            type: string
          required: true
          description: ObjectID
        - in: header
          name: X-Role-Id
          schema:
            type: string
          required: true
        - in: query
          name: page
          required: false
          schema:
            type: integer
            example: 2
        - in: query
          name: size
          required: false
          schema:
            type: integer
            example: 10
        - in: query
          name: sort
          required: false
          schema:
            type: string
            example: "date_of_execution"
        - in: query
          name: order
          required: false
          schema:
            type: string
            example: "asc"
        - in: query
          name: fromDate
          required: false
          schema:
            type: string
            format: date
            example: "2016-05-09"
        - in: query
          name: toDate
          required: false
          schema:
            type: string
            format: date
            example: "2016-05-12"
      responses:
        200:
          description: Úspěšné navrácení epid. anamnézy
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: ok
                  page:
                    type: object
                    properties:
                      number:
                        type: number
                      count:
                        type: number
                      next:
                        type: number
                      size:
                        type: number
                      total_count:
                        type: number
                      current:
                        type: array
                        items:
                          $ref: "#/components/schemas/EpidemiologyAnamnesis"

  /base_api/v1/anamnesis/{patient}/epidemiology/{id}:
    get:
      summary: Fetch jednoho záznamu v epidemiologické anamnéze
      security:
        - bearerAuth: [ ]
      tags:
        - EpidemiologyAnamnesis
      parameters:
        - in: path
          name: patient_id
          schema:
            type: string
          required: true
          description: ObjectID
        - in: header
          name: X-Role-Id
          schema:
            type: string
          required: true
        - in: path
          name: id
          schema:
            type: string
          required: true
          description: ObjectID
      responses:
        200:
          description: Úspěšné navrácení záznamu
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: ok
                  data:
                    $ref: "#/components/schemas/EpidemiologyAnamnesis"
    put:
      summary: Update jednoho záznamu v epidemiologické anamnéze
      security:
        - bearerAuth: [ ]
      tags:
        - EpidemiologyAnamnesis
      parameters:
        - in: path
          name: patient_id
          schema:
            type: string
          required: true
          description: ObjectID
        - in: header
          name: X-Role-Id
          schema:
            type: string
          required: true
        - in: path
          name: id
          schema:
            type: string
          required: true
          description: ObjectID
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/EpidemiologyAnamnesis"
      responses:
        200:
          description: Úspěšné updatnutí záznamu
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Success"
    delete:
      summary: Odebrání záznamu z epidemiologické anamnézy
      security:
        - bearerAuth: [ ]
      tags:
        - EpidemiologyAnamnesis
      parameters:
        - in: path
          name: patient_id
          schema:
            type: string
          required: true
          description: ObjectID
        - in: header
          name: X-Role-Id
          schema:
            type: string
          required: true
        - in: path
          name: id
          schema:
            type: string
          required: true
          description: ObjectID
      responses:
        200:
          description: Úspěšné smazání záznamu
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Success"

  /base_api/v1/anamnesis/{patient_id}/surgeries:
    post:
      summary: Vytvoření záznamu v operační anamnéze
      parameters:
        - in: path
          name: patient_id
          schema:
            type: string
          required: true
          description: ObjectID
        - in: header
          name: X-Role-Id
          schema:
            type: string
          required: true
      security:
        - bearerAuth: [ ]
      tags:
        - SurgeryAnamnesis
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/SurgeryAnamnesis"
      responses:
        200:
          description: Úspěšné vytvoření záznamu
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Success"
    get:
      summary: Fetch kompletní operační anamnézy
      security:
        - bearerAuth: [ ]
      tags:
        - SurgeryAnamnesis
      parameters:
        - in: path
          name: patient_id
          schema:
            type: string
          required: true
          description: ObjectID
        - in: header
          name: X-Role-Id
          schema:
            type: string
          required: true
        - in: query
          name: page
          required: false
          schema:
            type: integer
            example: 2
        - in: query
          name: size
          required: false
          schema:
            type: integer
            example: 10
        - in: query
          name: sort
          required: false
          schema:
            type: string
            example: "date_of_execution"
        - in: query
          name: order
          required: false
          schema:
            type: string
            example: "asc"
        - in: query
          name: fromDate
          required: false
          schema:
            type: string
            format: date
            example: "2016-05-09"
        - in: query
          name: toDate
          required: false
          schema:
            type: string
            format: date
            example: "2016-05-12"
      responses:
        200:
          description: Úspěšné navrácení anamnézy operací
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: ok
                  page:
                    type: object
                    properties:
                      number:
                        type: number
                      count:
                        type: number
                      next:
                        type: number
                      size:
                        type: number
                      total_count:
                        type: number
                      current:
                        type: array
                        items:
                          $ref: "#/components/schemas/SurgeryAnamnesis"

  /base_api/v1/anamnesis/{patient_id}/surgeries/{id}:
    get:
      summary: Fetch jednoho záznamu z oprační anamnézy
      security:
        - bearerAuth: [ ]
      tags:
        - SurgeryAnamnesis
      parameters:
        - in: path
          name: patient_id
          schema:
            type: string
          required: true
          description: ObjectID
        - in: header
          name: X-Role-Id
          schema:
            type: string
          required: true
        - in: path
          name: id
          schema:
            type: string
          required: true
          description: ObjectID
      responses:
        200:
          description: Úspěšné navrácení záznamu
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: ok
                  data:
                    $ref: "#/components/schemas/SurgeryAnamnesis"
    put:
      summary: Update jednoho záznamu v operační anamnéze
      security:
        - bearerAuth: [ ]
      tags:
        - SurgeryAnamnesis
      parameters:
        - in: path
          name: patient_id
          schema:
            type: string
          required: true
          description: ObjectID
        - in: header
          name: X-Role-Id
          schema:
            type: string
          required: true
        - in: path
          name: id
          schema:
            type: string
          required: true
          description: ObjectID
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/SurgeryAnamnesis"
      responses:
        200:
          description: Úspěšné updatnutí záznamu
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Success"
    delete:
      summary: Odebrání záznamu v operační anamnéze
      security:
        - bearerAuth: [ ]
      tags:
        - SurgeryAnamnesis
      parameters:
        - in: path
          name: patient_id
          schema:
            type: string
          required: true
          description: ObjectID
        - in: header
          name: X-Role-Id
          schema:
            type: string
          required: true
        - in: path
          name: id
          schema:
            type: string
          required: true
          description: ObjectID
      responses:
        200:
          description: Úspěšné smazání záznamu
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Success"

  /base_api/v1/anamnesis/{patient_id}/family:
    post:
      summary: Vytvoření záznamu v rodinné anamnéze
      parameters:
        - in: path
          name: patient_id
          schema:
            type: string
          required: true
          description: ObjectID
        - in: header
          name: X-Role-Id
          schema:
            type: string
          required: true
      security:
        - bearerAuth: [ ]
      tags:
        - FamilyMemberAnamnesis
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/FamilyMemberAnamnesis"
      responses:
        200:
          description: Úspěšné vytvoření záznamu
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Success"
    get:
      summary: Fetch kompletní rodinné anamnézy pacienta
      security:
        - bearerAuth: [ ]
      tags:
        - FamilyMemberAnamnesis
      parameters:
        - in: path
          name: patient_id
          schema:
            type: string
          required: true
          description: ObjectID
        - in: header
          name: X-Role-Id
          schema:
            type: string
          required: true
        - in: query
          name: page
          required: false
          schema:
            type: integer
            example: 2
        - in: query
          name: size
          required: false
          schema:
            type: integer
            example: 10
        - in: query
          name: sort
          required: false
          schema:
            type: string
            example: "date_of_execution"
        - in: query
          name: order
          required: false
          schema:
            type: string
            example: "asc"
        - in: query
          name: fromDate
          required: false
          schema:
            type: string
            format: date
            example: "2016-05-09"
        - in: query
          name: toDate
          required: false
          schema:
            type: string
            format: date
            example: "2016-05-12"
      responses:
        200:
          description: Úspěšné navrácení rodinné anamnézy
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: ok
                  page:
                    type: object
                    properties:
                      number:
                        type: number
                      count:
                        type: number
                      next:
                        type: number
                      size:
                        type: number
                      total_count:
                        type: number
                      current:
                        type: array
                        items:
                          $ref: "#/components/schemas/FamilyMemberAnamnesis"

  /base_api/v1/anamnesis/{patient_id}/family/{id}:
    get:
      summary: Fetch jednoho záznamu v rodinné anamnéze
      security:
        - bearerAuth: [ ]
      tags:
        - FamilyMemberAnamnesis
      parameters:
        - in: path
          name: patient_id
          schema:
            type: string
          required: true
          description: ObjectID
        - in: header
          name: X-Role-Id
          schema:
            type: string
          required: true
        - in: path
          name: id
          schema:
            type: string
          required: true
          description: ObjectID
      responses:
        200:
          description: Úspěšné navrácení záznamu
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: ok
                  data:
                    $ref: "#/components/schemas/FamilyMemberAnamnesis"
    put:
      summary: Update záznamu v rodinné anamnéze
      security:
        - bearerAuth: [ ]
      tags:
        - FamilyMemberAnamnesis
      parameters:
        - in: path
          name: patient_id
          schema:
            type: string
          required: true
          description: ObjectID
        - in: header
          name: X-Role-Id
          schema:
            type: string
          required: true
        - in: path
          name: id
          schema:
            type: string
          required: true
          description: ObjectID
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/FamilyMemberAnamnesis"
      responses:
        200:
          description: Úspěšné updatnutí záznamu
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Success"
    delete:
      summary: Odebrání záznamu z rodinné anamnézy pacienta
      security:
        - bearerAuth: [ ]
      tags:
        - FamilyMemberAnamnesis
      parameters:
        - in: path
          name: patient_id
          schema:
            type: string
          required: true
          description: ObjectID
        - in: header
          name: X-Role-Id
          schema:
            type: string
          required: true
        - in: path
          name: id
          schema:
            type: string
          required: true
          description: ObjectID
      responses:
        200:
          description: Úspěšné smazání záznamu
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Success"

  /base_api/v1/anamnesis/{patient_id}/work:
    get:
      summary: Fetch pracovní anamnézy pacienta
      parameters:
        - in: path
          name: patient_id
          schema:
            type: string
          required: true
          description: ObjectID
        - in: header
          name: X-Role-Id
          schema:
            type: string
          required: true
      security:
        - bearerAuth: [ ]
      tags:
        - WorkAnamnesis
      responses:
        200:
          description: Úspěšné navrácení záznamu
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: ok
                  data:
                    $ref: "#/components/schemas/WorkAnamnesis"
    put:
      summary: Update pracovní anamnézy pacienta
      parameters:
        - in: path
          name: patient_id
          schema:
            type: string
          required: true
          description: ObjectID
        - in: header
          name: X-Role-Id
          schema:
            type: string
          required: true
      security:
        - bearerAuth: [ ]
      tags:
        - WorkAnamnesis
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/WorkAnamnesis"
      responses:
        200:
          description: Úspěšné updatnutí prac. anamnézy
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Success"

  /base_api/v1/anamnesis/{patient_id}/social:
    get:
      summary: Fetch sociální anamnézy pacienta
      parameters:
        - in: path
          name: patient_id
          schema:
            type: string
          required: true
          description: ObjectID
        - in: header
          name: X-Role-Id
          schema:
            type: string
          required: true
      security:
        - bearerAuth: [ ]
      tags:
        - SocialAnamnesis
      responses:
        200:
          description: Úspěšné navrácení záznamu
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: ok
                  data:
                    $ref: "#/components/schemas/SocialAnamnesis"
    put:
      summary: Update sociální anamnézy pacienta
      parameters:
        - in: path
          name: patient_id
          schema:
            type: string
          required: true
          description: ObjectID
        - in: header
          name: X-Role-Id
          schema:
            type: string
          required: true
      security:
        - bearerAuth: [ ]
      tags:
        - SocialAnamnesis
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/SocialAnamnesis"
      responses:
        200:
          description: Úspěšné updatnutí prac. anamnézy
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Success"

  /base_api/v1/anamnesis/{patient_id}/sport:
    get:
      summary: Fetchne sportovní anamnézy pacienta
      parameters:
        - in: path
          name: patient_id
          schema:
            type: string
          required: true
          description: ObjectID
        - in: header
          name: X-Role-Id
          schema:
            type: string
          required: true
      security:
        - bearerAuth: [ ]
      tags:
        - SportAnamnesis
      responses:
        200:
          description: Úspěšné navrácení záznamu
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: ok
                  data:
                    $ref: "#/components/schemas/SportAnamnesis"
    put:
      summary: Update sportovní anamnézy pacienta
      parameters:
        - in: path
          name: patient_id
          schema:
            type: string
          required: true
          description: ObjectID
        - in: header
          name: X-Role-Id
          schema:
            type: string
          required: true
      security:
        - bearerAuth: [ ]
      tags:
        - SportAnamnesis
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/SportAnamnesis"
      responses:
        200:
          description: Úspěšné updatnutí prac. anamnézy
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Success"

  /base_api/v1/anamnesis/{patient_id}/allergies:
    get:
      summary: Fetch alergologické anamnézy jednoho pacienta
      parameters:
        - in: path
          name: patient_id
          schema:
            type: string
          required: true
          description: ObjectID
        - in: header
          name: X-Role-Id
          schema:
            type: string
          required: true
      security:
        - bearerAuth: [ ]
      tags:
        - AllergiesAnamnesis
      responses:
        200:
          description: Úspěšné navrácení alergologické anamnézy
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: ok
                  data:
                    type: object
                    properties:
                      allergies:
                        type: array
                        items:
                          type: string
                      other_allergies:
                        type: boolean
                      note:
                        type: string
    put:
      summary: Update alergologické anamnézy pacienta
      parameters:
        - in: path
          name: patient_id
          schema:
            type: string
          required: true
          description: ObjectID
        - in: header
          name: X-Role-Id
          schema:
            type: string
          required: true
      security:
        - bearerAuth: [ ]
      tags:
        - AllergiesAnamnesis
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                allergies:
                  type: array
                  items:
                    type: string
                other_allergies:
                  type: boolean
                note:
                  type: string
      responses:
        200:
          description: Úspěšné upravení alergologické anamnézy
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Success"

  /base_api/v1/anamnesis/{patient_id}/gynaecology:
    get:
      summary: Fetch gynekologické anamnézy pacienta
      parameters:
        - in: path
          name: patient_id
          schema:
            type: string
          required: true
          description: ObjectID
        - in: header
          name: X-Role-Id
          schema:
            type: string
          required: true
      security:
        - bearerAuth: [ ]
      tags:
        - GynaecologyAnamnesis
      responses:
        200:
          description: Úspěšné navrácení záznamu
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: ok
                  data:
                    $ref: "#/components/schemas/GynaecologyAnamnesis"
    put:
      summary: Update gynekologické anamnézy pacienta
      parameters:
        - in: path
          name: patient_id
          schema:
            type: string
          required: true
          description: ObjectID
        - in: header
          name: X-Role-Id
          schema:
            type: string
          required: true
      security:
        - bearerAuth: [ ]
      tags:
        - GynaecologyAnamnesis
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/GynaecologyAnamnesis"
      responses:
        200:
          description: Úspěšné updatnutí gynekologické anamnézy
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Success"

  /base_api/v1/anamnesis/{patient_id}/gynaecology/menstruations:
    get:
      summary: Fetch všech menstruací
      security:
        - bearerAuth: [ ]
      tags:
        - GynaecologyAnamnesis Menstruation
      parameters:
        - in: path
          name: patient_id
          schema:
            type: string
          required: true
          description: ObjectID
        - in: header
          name: X-Role-Id
          schema:
            type: string
          required: true
        - in: query
          name: page
          required: false
          schema:
            type: integer
            example: 2
        - in: query
          name: size
          required: false
          schema:
            type: integer
            example: 10
        - in: query
          name: sort
          required: false
          schema:
            type: string
            example: "date_of_execution"
        - in: query
          name: order
          required: false
          schema:
            type: string
            example: "asc"
        - in: query
          name: fromDate
          required: false
          schema:
            type: string
            format: date
            example: "2016-05-09"
        - in: query
          name: toDate
          required: false
          schema:
            type: string
            format: date
            example: "2016-05-12"
      responses:
        200:
          description: Úspěšný fetch všech menstruací
          content:
            application/json:
              schema:
                allOf:
                  - $ref: "#/components/schemas/Success"
                  - type: object
                    properties:
                      page:
                        type: object
                        properties:
                          number:
                            type: number
                          count:
                            type: number
                          next:
                            type: number
                          size:
                            type: number
                          total_count:
                            type: number
                          current:
                            type: array
                            items:
                              $ref: "#/components/schemas/MenstruationHistoryEntry"
    post:
      parameters:
        - in: path
          name: patient_id
          schema:
            type: string
          required: true
          description: ObjectID
        - in: header
          name: X-Role-Id
          schema:
            type: string
          required: true
      summary: Vytvoří záznam o menstruaci
      security:
        - bearerAuth: [ ]
      tags:
        - GynaecologyAnamnesis Menstruation
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/MenstruationHistoryEntry"
      responses:
        200:
          description: Úpsěšné uložení záznamu o menstruaci
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Success"

  /base_api/v1/anamnesis/{patient_id}/gynaecology/menstruations/{id}:
    get:
      summary: Fetch jedné menstruace
      security:
        - bearerAuth: [ ]
      tags:
        - GynaecologyAnamnesis Menstruation
      parameters:
        - in: path
          name: patient_id
          schema:
            type: string
          required: true
          description: ObjectID
        - in: header
          name: X-Role-Id
          schema:
            type: string
          required: true
        - in: path
          name: id
          schema:
            type: string
          required: true
          description: ObjectID
      responses:
        200:
          description: Úspěšný fetch záznamu
          content:
            application/json:
              schema:
                allOf:
                  - $ref: "#/components/schemas/Success"
                  - type: object
                    properties:
                      data:
                        $ref: "#/components/schemas/MenstruationHistoryEntry"
    put:
      summary: Update jednoho záznamu o menstruaci
      security:
        - bearerAuth: [ ]
      tags:
        - GynaecologyAnamnesis Menstruation
      parameters:
        - in: path
          name: patient_id
          schema:
            type: string
          required: true
          description: ObjectID
        - in: header
          name: X-Role-Id
          schema:
            type: string
          required: true
        - in: path
          name: id
          schema:
            type: string
          required: true
          description: ObjectID
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/MenstruationHistoryEntry"
      responses:
        200:
          description: Úpsěšné uložení záznamu o menstruaci
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Success"

    delete:
      summary: Smazání jednoho záznamu o menstruaci
      security:
        - bearerAuth: [ ]
      tags:
        - GynaecologyAnamnesis Menstruation
      parameters:
        - in: path
          name: patient_id
          schema:
            type: string
          required: true
          description: ObjectID
        - in: header
          name: X-Role-Id
          schema:
            type: string
          required: true
        - in: path
          name: id
          schema:
            type: string
          required: true
          description: ObjectID
      responses:
        200:
          description: Úpsěšné uložení záznamu o menstruaci
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Success"

  /base_api/v1/anamnesis/{patient_id}/gynaecology/pregnancies:
    get:
      summary: Fetch všech těhotenství
      security:
        - bearerAuth: [ ]
      tags:
        - GynaecologyAnamnesis Pregnancy
      parameters:
        - in: path
          name: patient_id
          schema:
            type: string
          required: true
          description: ObjectID
        - in: header
          name: X-Role-Id
          schema:
            type: string
          required: true
        - in: query
          name: page
          required: false
          schema:
            type: integer
            example: 2
        - in: query
          name: size
          required: false
          schema:
            type: integer
            example: 10
        - in: query
          name: sort
          required: false
          schema:
            type: string
            example: "date_of_execution"
        - in: query
          name: order
          required: false
          schema:
            type: string
            example: "asc"
        - in: query
          name: fromDate
          required: false
          schema:
            type: string
            format: date
            example: "2016-05-09"
        - in: query
          name: toDate
          required: false
          schema:
            type: string
            format: date
            example: "2016-05-12"
      responses:
        200:
          description: Úspěšný fetch všech těhotenství
          content:
            application/json:
              schema:
                allOf:
                  - $ref: "#/components/schemas/Success"
                  - type: object
                    properties:
                      page:
                        type: object
                        properties:
                          number:
                            type: number
                          count:
                            type: number
                          next:
                            type: number
                          size:
                            type: number
                          total_count:
                            type: number
                          current:
                            type: array
                            items:
                              $ref: "#/components/schemas/Pregnancy"
    post:
      summary: Vytvoří záznam o těhotenství
      parameters:
        - in: path
          name: patient_id
          schema:
            type: string
          required: true
          description: ObjectID
        - in: header
          name: X-Role-Id
          schema:
            type: string
          required: true
      security:
        - bearerAuth: [ ]
      tags:
        - GynaecologyAnamnesis Pregnancy
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/Pregnancy"
      responses:
        200:
          description: Úpsěšné uložení záznamu o těhotenství
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Success"

  /base_api/v1/anamnesis/{patient_id}/gynaecology/pregnancies/{id}:
    get:
      summary: Fetch jednoho těhotenství
      security:
        - bearerAuth: [ ]
      tags:
        - GynaecologyAnamnesis Pregnancy
      parameters:
        - in: path
          name: patient_id
          schema:
            type: string
          required: true
          description: ObjectID
        - in: header
          name: X-Role-Id
          schema:
            type: string
          required: true
        - in: path
          name: id
          schema:
            type: string
          required: true
          description: ObjectID
      responses:
        200:
          description: Úspěšný fetch záznamu
          content:
            application/json:
              schema:
                allOf:
                  - $ref: "#/components/schemas/Success"
                  - type: object
                    properties:
                      data:
                        $ref: "#/components/schemas/Pregnancy"
    put:
      summary: Update jednoho záznamu o těhotenství
      security:
        - bearerAuth: [ ]
      tags:
        - GynaecologyAnamnesis Pregnancy
      parameters:
        - in: path
          name: patient_id
          schema:
            type: string
          required: true
          description: ObjectID
        - in: header
          name: X-Role-Id
          schema:
            type: string
          required: true
        - in: path
          name: id
          schema:
            type: string
          required: true
          description: ObjectID
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/Pregnancy"
      responses:
        200:
          description: Úpsěšné uložení záznamu o těhotenství
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Success"

    delete:
      summary: Smazání jednoho záznamu o těhotenství
      security:
        - bearerAuth: [ ]
      tags:
        - GynaecologyAnamnesis Pregnancy
      parameters:
        - in: path
          name: patient_id
          schema:
            type: string
          required: true
          description: ObjectID
        - in: header
          name: X-Role-Id
          schema:
            type: string
          required: true
        - in: path
          name: id
          schema:
            type: string
          required: true
          description: ObjectID
      responses:
        200:
          description: Úpsěšné uložení záznamu o těhotenství
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Success"

  /base_api/v1/edg/collect:
    post:
      summary: Endpoint pro data z EDGy
      tags:
        - EDG
      requestBody:
        required: true
        content:
          application/json:
            schema:
              oneOf:
                - $ref: "#/components/schemas/EdgGlycemia"
                - $ref: "#/components/schemas/EdgOxygenSaturation"
                - $ref: "#/components/schemas/EdgTemperature"
                - $ref: "#/components/schemas/EdgEcg"
                - $ref: "#/components/schemas/EdgEndoscopy"
                - $ref: "#/components/schemas/EdgAirPolution"
                - $ref: "#/components/schemas/EdgSleep"
                - $ref: "#/components/schemas/EdgHeight"
                - $ref: "#/components/schemas/EdgWeight"
                - $ref: "#/components/schemas/EdgBloodPressure"
                - $ref: "#/components/schemas/EdgBodyFat"

      responses:
        200:
          description: Úspěšné uložení dat do DB
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Success"
        500:
          description: Chyba při vkládání do DB
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Failure"

  /base_api/v1/measurements/{patient_id}/glycemia/summary:
    get:
      summary: Fetchne přehled měření glykémie pro koláčový graf
      parameters:
        - in: path
          name: patient_id
          schema:
            type: string
          required: true
          description: ObjectID
        - in: header
          name: X-Role-Id
          schema:
            type: string
          required: true
      security:
        - bearerAuth: [ ]
      tags:
        - GlycemiaMeasurement
      responses:
        200:
          description: Úspěšný fetch přehledu měření glykémie
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: ok
                  data:
                    type: object
                    properties:
                      count:
                        type: number
                        description: Celkový počet měření
                      a:
                        type: number
                        description: Počet měření s hodnotami 0 - 2.5
                      b:
                        type: number
                        description: Počet měření s hodnotami 2.5 - 3.5
                      c:
                        type: number
                        description: Počet měření s hodnotami 3.5 - 8
                      d:
                        type: number
                        description: Počet měření s hodnotami 8 - 15
                      e:
                        type: number
                        description: Počet měření s hodnotami 15 - 20


  /base_api/v1/measurements/{patient_id}/glycemia:
    post:
      summary: Vytvoří nový záznam měření glykémie
      parameters:
        - in: path
          name: patient_id
          schema:
            type: string
          required: true
          description: ObjectID
        - in: header
          name: X-Role-Id
          schema:
            type: string
          required: true
      security:
        - bearerAuth: [ ]
      tags:
        - GlycemiaMeasurement
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                value:
                  type: number
                measured_at:
                  type: string
                  format: date-time
                note:
                  type: string
                  required: false
      responses:
        200:
          description: Úspěšné vytvoření záznamu
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Success"
    get:
      summary: Fetchne všechny záznamy měření glykémie
      security:
        - bearerAuth: [ ]
      tags:
        - GlycemiaMeasurement
      parameters:
        - in: path
          name: patient_id
          schema:
            type: string
          required: true
          description: ObjectID
        - in: header
          name: X-Role-Id
          schema:
            type: string
          required: true
        - in: query
          name: page
          required: false
          schema:
            type: integer
            example: 2
        - in: query
          name: size
          required: false
          schema:
            type: integer
            example: 10
        - in: query
          name: sort
          required: false
          schema:
            type: string
            example: "date_of_execution"
        - in: query
          name: order
          required: false
          schema:
            type: string
            example: "asc"
        - in: query
          name: fromDate
          required: false
          schema:
            type: string
            format: date
            example: "2016-05-09"
        - in: query
          name: toDate
          required: false
          schema:
            type: string
            format: date
            example: "2016-05-12"
      responses:
        200:
          description: Úspěčný fetch všech záznamů glykémie
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: ok
                  page:
                    type: object
                    properties:
                      number:
                        type: number
                      count:
                        type: number
                      next:
                        type: number
                      size:
                        type: number
                      total_count:
                        type: number
                      current:
                        type: array
                        items:
                          type: object
                          properties:
                            _id:
                              type: string
                            source:
                              type: number
                            value:
                              type: number
                            measured_at:
                              type: string
                              format: date-time
                            meal:
                              type: string
                              enum: [unkown, before, after]
                            note:
                              type: string

  /base_api/v1/measurements/{patient_id}/glycemia/{id}:
    get:
      summary: Fetchne jeden záznam měření glykémie
      security:
        - bearerAuth: [ ]
      tags:
        - GlycemiaMeasurement
      parameters:
        - in: path
          name: patient_id
          schema:
            type: string
          required: true
          description: ObjectID
        - in: header
          name: X-Role-Id
          schema:
            type: string
          required: true
        - in: path
          name: id
          schema:
            type: string
          required: true
          description: ObjectID
      responses:
        200:
          description: Úspěšný fetch jednoho záznamu
          content:
            application/json:
              schema:
                allOf:
                  - $ref: "#/components/schemas/Success"
                  - type: object
                    properties:
                      data:
                        type: object
                        properties:
                          _id:
                            type: string
                          source:
                            type: number
                          value:
                            type: number
                          measured_at:
                            type: string
                            format: date-time
                          meal:
                            type: string
                            enum: [ unkown, before, after ]
                          note:
                            type: string
    put:
      summary: Updatne jeden záznam měření glykémie
      security:
        - bearerAuth: [ ]
      tags:
        - GlycemiaMeasurement
      parameters:
        - in: path
          name: patient_id
          schema:
            type: string
          required: true
          description: ObjectID
        - in: header
          name: X-Role-Id
          schema:
            type: string
          required: true
        - in: path
          name: id
          schema:
            type: string
          required: true
          description: ObjectID
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/GlycemiaMeasurement"
      responses:
        200:
          description: Úspěšný update jednoho záznamu v měření glykémie
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Success"

    delete:
      summary: Odstraní jeden záznam měření glykémie
      security:
        - bearerAuth: [ ]
      tags:
        - GlycemiaMeasurement
      parameters:
        - in: path
          name: patient_id
          schema:
            type: string
          required: true
          description: ObjectID
        - in: header
          name: X-Role-Id
          schema:
            type: string
          required: true
        - in: path
          name: id
          schema:
            type: string
          required: true
          description: ObjectID
      responses:
        200:
          description: Úspěšné odstranění jednoho záznamu v měření glykémie
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Success"

  /base_api/v1/measurements/{patient_id}/oxygen_saturation:
    post:
      summary: Vytvoří jeden záznam měření saturace kyslíku v krvi
      parameters:
        - in: path
          name: patient_id
          schema:
            type: string
          required: true
          description: ObjectID
        - in: header
          name: X-Role-Id
          schema:
            type: string
          required: true
      security:
        - bearerAuth: [ ]
      tags:
        - OxygenSaturationMeasurement
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/OxygenSaturationMeasurement"
      responses:
        200:
          description: Úspěšné vytvoření záznamu saturace kyslíku v krvi
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Success"
    get:
      summary: Fetchne všechny záznamy měření saturace kyslíku v krvi
      security:
        - bearerAuth: [ ]
      tags:
        - OxygenSaturationMeasurement
      parameters:
        - in: path
          name: patient_id
          schema:
            type: string
          required: true
          description: ObjectID
        - in: header
          name: X-Role-Id
          schema:
            type: string
          required: true
        - in: query
          name: page
          required: false
          schema:
            type: integer
            example: 2
        - in: query
          name: size
          required: false
          schema:
            type: integer
            example: 10
        - in: query
          name: sort
          required: false
          schema:
            type: string
            example: "date_of_execution"
        - in: query
          name: order
          required: false
          schema:
            type: string
            example: "asc"
        - in: query
          name: fromDate
          required: false
          schema:
            type: string
            format: date
            example: "2016-05-09"
        - in: query
          name: toDate
          required: false
          schema:
            type: string
            format: date
            example: "2016-05-12"
      responses:
        200:
          description: Úspěčný fetch všech měření saturace kyslíku v krvi
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: ok
                  page:
                    type: object
                    properties:
                      number:
                        type: number
                      count:
                        type: number
                      next:
                        type: number
                      size:
                        type: number
                      total_count:
                        type: number
                      current:
                        type: array
                        items:
                          $ref: "#/components/schemas/OxygenSaturationMeasurement"

  /base_api/v1/measurements/{patient_id}/oxygen_saturation/{id}:
    get:
      summary: Fetchne jeden záznam měření saturace kyslíku v krvi
      security:
        - bearerAuth: [ ]
      tags:
        - OxygenSaturationMeasurement
      parameters:
        - in: path
          name: patient_id
          schema:
            type: string
          required: true
          description: ObjectID
        - in: header
          name: X-Role-Id
          schema:
            type: string
          required: true
        - in: path
          name: id
          schema:
            type: string
          required: true
          description: ObjectID
      responses:
        200:
          description: Úspěšný fetch jednoho záznamu měření saturace kyslíku v krvi
          content:
            application/json:
              schema:
                allOf:
                  - $ref: "#/components/schemas/Success"
                  - type: object
                    properties:
                      data:
                        $ref: "#/components/schemas/OxygenSaturationMeasurement"

    put:
      summary: Updatne jeden záznam měření saturace kyslíku v krvi
      security:
        - bearerAuth: [ ]
      tags:
        - OxygenSaturationMeasurement
      parameters:
        - in: path
          name: patient_id
          schema:
            type: string
          required: true
          description: ObjectID
        - in: header
          name: X-Role-Id
          schema:
            type: string
          required: true
        - in: path
          name: id
          schema:
            type: string
          required: true
          description: ObjectID
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/OxygenSaturationMeasurement"
      responses:
        200:
          description: Úspěšný update jednoho záznamu v měření saturace kyslíku v krvi
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Success"

    delete:
      summary: Odstraní jeden záznam měření saturace kyslíku v krvi
      security:
        - bearerAuth: [ ]
      tags:
        - OxygenSaturationMeasurement
      parameters:
        - in: path
          name: patient_id
          schema:
            type: string
          required: true
          description: ObjectID
        - in: header
          name: X-Role-Id
          schema:
            type: string
          required: true
        - in: path
          name: id
          schema:
            type: string
          required: true
          description: ObjectID
      responses:
        200:
          description: Úspěšné odstranění jednoho záznamu v měření saturace kyslíku v krvi
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Success"

  /base_api/v1/measurements/{patient_id}/bpm:
    post:
      summary: Vytvoří nový záznam měření BPM
      parameters:
        - in: path
          name: patient_id
          schema:
            type: string
          required: true
          description: ObjectID
        - in: header
          name: X-Role-Id
          schema:
            type: string
          required: true
      security:
        - bearerAuth: [ ]
      tags:
        - BpmMeasurement
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/BpmMeasurement"
      responses:
        200:
          description: Úspěšné vytvoření záznamu BPM
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Success"
    get:
      summary: Fetchne všechny záznamy měření BPM
      security:
        - bearerAuth: [ ]
      tags:
        - BpmMeasurement
      parameters:
        - in: path
          name: patient_id
          schema:
            type: string
          required: true
          description: ObjectID
        - in: header
          name: X-Role-Id
          schema:
            type: string
          required: true
        - in: query
          name: page
          required: false
          schema:
            type: integer
            example: 2
        - in: query
          name: size
          required: false
          schema:
            type: integer
            example: 10
        - in: query
          name: sort
          required: false
          schema:
            type: string
            example: "date_of_execution"
        - in: query
          name: order
          required: false
          schema:
            type: string
            example: "asc"
        - in: query
          name: fromDate
          required: false
          schema:
            type: string
            format: date
            example: "2016-05-09"
        - in: query
          name: toDate
          required: false
          schema:
            type: string
            format: date
            example: "2016-05-12"
      responses:
        200:
          description: Úspěšný fetch všech měření BPM
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: ok
                  page:
                    type: object
                    properties:
                      number:
                        type: number
                      count:
                        type: number
                      next:
                        type: number
                      size:
                        type: number
                      total_count:
                        type: number
                      current:
                        type: array
                        items:
                          $ref: "#/components/schemas/BpmMeasurement"

  /base_api/v1/measurements/{patient_id}/bpm/{id}:
    get:
      summary: Fetchne jeden záznam měření BPM
      security:
        - bearerAuth: [ ]
      tags:
        - BpmMeasurement
      parameters:
        - in: path
          name: patient_id
          schema:
            type: string
          required: true
          description: ObjectID
        - in: header
          name: X-Role-Id
          schema:
            type: string
          required: true
        - in: path
          name: id
          schema:
            type: string
          required: true
          description: ObjectID
      responses:
        200:
          description: Úspěšný fetch jednoho záznamu BPM
          content:
            application/json:
              schema:
                allOf:
                  - $ref: "#/components/schemas/Success"
                  - type: object
                    properties:
                      data:
                        $ref: "#/components/schemas/BpmMeasurement"
    put:
      summary: Updatne jeden záznam měření BPM
      security:
        - bearerAuth: [ ]
      tags:
        - BpmMeasurement
      parameters:
        - in: path
          name: patient_id
          schema:
            type: string
          required: true
          description: ObjectID
        - in: header
          name: X-Role-Id
          schema:
            type: string
          required: true
        - in: path
          name: id
          schema:
            type: string
          required: true
          description: ObjectID
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/BpmMeasurement"
      responses:
        200:
          description: Úspěšný update jednoho záznamu měření EKG
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Success"

    delete:
      summary: Odstraní jeden záznam měření EKG
      security:
        - bearerAuth: [ ]
      tags:
        - BpmMeasurement
      parameters:
        - in: path
          name: patient_id
          schema:
            type: string
          required: true
          description: ObjectID
        - in: header
          name: X-Role-Id
          schema:
            type: string
          required: true
        - in: path
          name: id
          schema:
            type: string
          required: true
          description: ObjectID
      responses:
        200:
          description: Úspěšné odstranění záznamu měření BPM
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Success"

  /base_api/v1/measurements/{patient_id}/sleep:
    post:
      summary: Vytvoří nový záznam měření spánku
      parameters:
        - in: path
          name: patient_id
          schema:
            type: string
          required: true
          description: ObjectID
        - in: header
          name: X-Role-Id
          schema:
            type: string
          required: true
      security:
        - bearerAuth: [ ]
      tags:
        - SleepMeasurement
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/SleepMeasurement"
      responses:
        200:
          description: Úspěšné vytvoření
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Success"
    get:
      summary: Fetchne všechny záznamy měření spánku
      security:
        - bearerAuth: [ ]
      tags:
        - SleepMeasurement
      parameters:
        - in: path
          name: patient_id
          schema:
            type: string
          required: true
          description: ObjectID
        - in: header
          name: X-Role-Id
          schema:
            type: string
          required: true
        - in: query
          name: page
          required: false
          schema:
            type: integer
            example: 2
        - in: query
          name: size
          required: false
          schema:
            type: integer
            example: 10
        - in: query
          name: sort
          required: false
          schema:
            type: string
            example: "date_of_execution"
        - in: query
          name: order
          required: false
          schema:
            type: string
            example: "asc"
        - in: query
          name: fromDate
          required: false
          schema:
            type: string
            format: date
            example: "2016-05-09"
        - in: query
          name: toDate
          required: false
          schema:
            type: string
            format: date
            example: "2016-05-12"
      responses:
        200:
          description: Úspěšný fetch všech měření spánku
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: ok
                  page:
                    type: object
                    properties:
                      number:
                        type: number
                      count:
                        type: number
                      next:
                        type: number
                      size:
                        type: number
                      total_count:
                        type: number
                      current:
                        type: array
                        items:
                          $ref: "#/components/schemas/SleepMeasurement"

  /base_api/v1/measurements/{patient_id}/sleep/{id}:
    get:
      summary: Fetchne jeden záznam měření spánku
      security:
        - bearerAuth: [ ]
      tags:
        - SleepMeasurement
      parameters:
        - in: path
          name: patient_id
          schema:
            type: string
          required: true
          description: ObjectID
        - in: header
          name: X-Role-Id
          schema:
            type: string
          required: true
        - in: path
          name: id
          schema:
            type: string
          required: true
          description: ObjectID
      responses:
        200:
          description: Úspěšné odstranění záznamu měření spánku
          content:
            application/json:
              schema:
                allOf:
                  - $ref: "#/components/schemas/Success"
                  - $ref: "#/components/schemas/SleepMeasurement"

    put:
      summary: Updatne jeden záznam měření spánku
      security:
        - bearerAuth: [ ]
      tags:
        - SleepMeasurement
      parameters:
        - in: path
          name: patient_id
          schema:
            type: string
          required: true
          description: ObjectID
        - in: header
          name: X-Role-Id
          schema:
            type: string
          required: true
        - in: path
          name: id
          schema:
            type: string
          required: true
          description: ObjectID
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/SleepMeasurement"
      responses:
        200:
          description: Úspěšné odstranění záznamu měření spánku
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Success"

    delete:
      summary: Odstraní jeden záznam měření spánku
      security:
        - bearerAuth: [ ]
      tags:
        - SleepMeasurement
      parameters:
        - in: path
          name: patient_id
          schema:
            type: string
          required: true
          description: ObjectID
        - in: header
          name: X-Role-Id
          schema:
            type: string
          required: true
        - in: path
          name: id
          schema:
            type: string
          required: true
          description: ObjectID
      responses:
        200:
          description: Úspěšné odstranění záznamu měření spánku
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Success"

  /base_api/v1/measurements/{patient_id}/air_polution:
    post:
      summary: Vytvoří nový záznam měření AirPolution
      parameters:
        - in: path
          name: patient_id
          schema:
            type: string
          required: true
          description: ObjectID
        - in: header
          name: X-Role-Id
          schema:
            type: string
          required: true
      security:
        - bearerAuth: [ ]
      tags:
        - AirPolutionMeasurement
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/AirPolutionMeasurement"
      responses:
        200:
          description: Úspěšné vytvoření
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Success"
    get:
      summary: Fetchne všechny záznamy měření AirPolution
      security:
        - bearerAuth: [ ]
      tags:
        - AirPolutionMeasurement
      parameters:
        - in: path
          name: patient_id
          schema:
            type: string
          required: true
          description: ObjectID
        - in: header
          name: X-Role-Id
          schema:
            type: string
          required: true
        - in: query
          name: page
          required: false
          schema:
            type: integer
            example: 2
        - in: query
          name: size
          required: false
          schema:
            type: integer
            example: 10
        - in: query
          name: sort
          required: false
          schema:
            type: string
            example: "date_of_execution"
        - in: query
          name: order
          required: false
          schema:
            type: string
            example: "asc"
        - in: query
          name: fromDate
          required: false
          schema:
            type: string
            format: date
            example: "2016-05-09"
        - in: query
          name: toDate
          required: false
          schema:
            type: string
            format: date
            example: "2016-05-12"
      responses:
        200:
          description: Úspěšný fetch všech záznamů měření AirPolution
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: ok
                  page:
                    type: object
                    properties:
                      number:
                        type: number
                      count:
                        type: number
                      next:
                        type: number
                      size:
                        type: number
                      total_count:
                        type: number
                      current:
                        type: array
                        items:
                          $ref: "#/components/schemas/AirPolutionMeasurement"

  /base_api/v1/measurements/{patient_id}/air_polution/{id}:
    get:
      summary: Fetchne jeden záznam měření AirPolution
      security:
        - bearerAuth: [ ]
      tags:
        - AirPolutionMeasurement
      parameters:
        - in: path
          name: patient_id
          schema:
            type: string
          required: true
          description: ObjectID
        - in: header
          name: X-Role-Id
          schema:
            type: string
          required: true
        - in: path
          name: id
          schema:
            type: string
          required: true
          description: ObjectID
      responses:
        200:
          description: Úspěšné odstranění záznamu měření AirPolution
          content:
            application/json:
              schema:
                allOf:
                  - $ref: "#/components/schemas/Success"
                  - $ref: "#/components/schemas/AirPolutionMeasurement"

    put:
      summary: Updatne jeden záznam měření AirPolution
      security:
        - bearerAuth: [ ]
      tags:
        - AirPolutionMeasurement
      parameters:
        - in: path
          name: patient_id
          schema:
            type: string
          required: true
          description: ObjectID
        - in: header
          name: X-Role-Id
          schema:
            type: string
          required: true
        - in: path
          name: id
          schema:
            type: string
          required: true
          description: ObjectID
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/AirPolutionMeasurement"
      responses:
        200:
          description: Úspěšný update záznamu AirPolution
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Success"

    delete:
      summary: Odstraní jeden záznam měření AirPolu
      security:
        - bearerAuth: [ ]
      tags:
        - AirPolutionMeasurement
      parameters:
        - in: path
          name: patient_id
          schema:
            type: string
          required: true
          description: ObjectID
        - in: header
          name: X-Role-Id
          schema:
            type: string
          required: true
        - in: path
          name: id
          schema:
            type: string
          required: true
          description: ObjectID
      responses:
        200:
          description: Úspěšné odstranění záznamu měření AirPolution
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Success"

  /base_api/v1/measurements/{patient_id}/endoscopy:
    post:
      summary: Vytvoří nový záznam měření endoskopie
      parameters:
        - in: path
          name: patient_id
          schema:
            type: string
          required: true
          description: ObjectID
        - in: header
          name: X-Role-Id
          schema:
            type: string
          required: true
      security:
        - bearerAuth: [ ]
      tags:
        - EndoscopyMeasurement
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/EndoscopyMeasurement"
      responses:
        200:
          description: Úspěšné vytvoření
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Success"
    get:
      summary: Fetchne všechny záznamy měření endoskopie
      security:
        - bearerAuth: [ ]
      tags:
        - EndoscopyMeasurement
      parameters:
        - in: path
          name: patient_id
          schema:
            type: string
          required: true
          description: ObjectID
        - in: header
          name: X-Role-Id
          schema:
            type: string
          required: true
        - in: query
          name: page
          required: false
          schema:
            type: integer
            example: 2
        - in: query
          name: size
          required: false
          schema:
            type: integer
            example: 10
        - in: query
          name: sort
          required: false
          schema:
            type: string
            example: "date_of_execution"
        - in: query
          name: order
          required: false
          schema:
            type: string
            example: "asc"
        - in: query
          name: fromDate
          required: false
          schema:
            type: string
            format: date
            example: "2016-05-09"
        - in: query
          name: toDate
          required: false
          schema:
            type: string
            format: date
            example: "2016-05-12"
      responses:
        200:
          description: Úspěšný fetch všech záznamů měření endoskopie
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: ok
                  page:
                    type: object
                    properties:
                      number:
                        type: number
                      count:
                        type: number
                      next:
                        type: number
                      size:
                        type: number
                      total_count:
                        type: number
                      current:
                        type: array
                        items:
                          $ref: "#/components/schemas/EndoscopyMeasurement"

  /base_api/v1/measurements/{patient_id}/endoscopy/{id}:
    get:
      summary: Fetchne jeden záznam měření endoskopie
      security:
        - bearerAuth: [ ]
      tags:
        - EndoscopyMeasurement
      parameters:
        - in: path
          name: patient_id
          schema:
            type: string
          required: true
          description: ObjectID
        - in: header
          name: X-Role-Id
          schema:
            type: string
          required: true
        - in: path
          name: id
          schema:
            type: string
          required: true
          description: ObjectID
      responses:
        200:
          description: Úspěšné odstranění záznamu měření endoskopie
          content:
            application/json:
              schema:
                allOf:
                  - $ref: "#/components/schemas/Success"
                  - $ref: "#/components/schemas/EndoscopyMeasurement"

    put:
      summary: Updatne jeden záznam měření endoskopie
      security:
        - bearerAuth: [ ]
      tags:
        - EndoscopyMeasurement
      parameters:
        - in: path
          name: patient_id
          schema:
            type: string
          required: true
          description: ObjectID
        - in: header
          name: X-Role-Id
          schema:
            type: string
          required: true
        - in: path
          name: id
          schema:
            type: string
          required: true
          description: ObjectID
      responses:
        200:
          description: Úspěšné vytvoření
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Success"

    delete:
      summary: Odstraní jeden záznam měření endoskopie
      security:
        - bearerAuth: [ ]
      tags:
        - EndoscopyMeasurement
      parameters:
        - in: path
          name: patient_id
          schema:
            type: string
          required: true
          description: ObjectID
        - in: header
          name: X-Role-Id
          schema:
            type: string
          required: true
        - in: path
          name: id
          schema:
            type: string
          required: true
          description: ObjectID
      responses:
        200:
          description: Úspěšné odstranění záznamu měření endoskopie
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Success"

  /base_api/v1/measurements/{patient_id}/temperature:
    post:
      summary: Vytvoří nový záznam měření teploty
      parameters:
        - in: path
          name: patient_id
          schema:
            type: string
          required: true
          description: ObjectID
        - in: header
          name: X-Role-Id
          schema:
            type: string
          required: true
      security:
        - bearerAuth: [ ]
      tags:
        - TemperatureMeasurement
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                max:
                  type: number
                note:
                  type: string
                  required: false
                measured_at:
                  type: string
                  format: date-time
      responses:
        200:
          description: Úspěšné vytvoření
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Success"
    get:
      summary: Fetchne všechny záznamy měření teploty
      security:
        - bearerAuth: [ ]
      tags:
        - TemperatureMeasurement
      parameters:
        - in: path
          name: patient_id
          schema:
            type: string
          required: true
          description: ObjectID
        - in: header
          name: X-Role-Id
          schema:
            type: string
          required: true
        - in: query
          name: page
          required: false
          schema:
            type: integer
            example: 2
        - in: query
          name: size
          required: false
          schema:
            type: integer
            example: 10
        - in: query
          name: sort
          required: false
          schema:
            type: string
            example: "date_of_execution"
        - in: query
          name: order
          required: false
          schema:
            type: string
            example: "asc"
        - in: query
          name: fromDate
          required: false
          schema:
            type: string
            format: date
            example: "2016-05-09"
        - in: query
          name: toDate
          required: false
          schema:
            type: string
            format: date
            example: "2016-05-12"
      responses:
        200:
          description: Úspěšný fetch všech záznamů měření teploty
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: ok
                  page:
                    type: object
                    properties:
                      number:
                        type: number
                      count:
                        type: number
                      next:
                        type: number
                      size:
                        type: number
                      total_count:
                        type: number
                      current:
                        type: array
                        items:
                          type: object
                          properties:
                            _id:
                              type: string
                            source:
                              type: number
                            max:
                              type: number
                            min:
                              type: number
                            avg:
                              type: number
                            note:
                              type: string
                            length:
                              type: number
                            measured_at:
                              type: string
                              format: date-time

  /base_api/v1/measurements/{patient_id}/temperature/{id}:
    get:
      summary: Fetchne jeden záznam měření teploty
      security:
        - bearerAuth: [ ]
      tags:
        - TemperatureMeasurement
      parameters:
        - in: path
          name: patient_id
          schema:
            type: string
          required: true
          description: ObjectID
        - in: header
          name: X-Role-Id
          schema:
            type: string
          required: true
        - in: path
          name: id
          schema:
            type: string
          required: true
          description: ObjectID
      responses:
        200:
          description: Úspěšné odstranění záznamu měření teploty
          content:
            application/json:
              schema:
                allOf:
                  - $ref: "#/components/schemas/Success"
                  - $ref: "#/components/schemas/TemperatureMeasurement"

    put:
      summary: Updatne jeden záznam měření teploty
      security:
        - bearerAuth: [ ]
      tags:
        - TemperatureMeasurement
      parameters:
        - in: path
          name: patient_id
          schema:
            type: string
          required: true
          description: ObjectID
        - in: header
          name: X-Role-Id
          schema:
            type: string
          required: true
        - in: path
          name: id
          schema:
            type: string
          required: true
          description: ObjectID
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                max:
                  type: number
                note:
                  type: string
                  required: false
                measured_at:
                  type: string
                  format: date-time
      responses:
        200:
          description: Úspěšný update
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Success"

    delete:
      summary: Odstraní jeden záznam měření teploty
      security:
        - bearerAuth: [ ]
      tags:
        - TemperatureMeasurement
      parameters:
        - in: path
          name: patient_id
          schema:
            type: string
          required: true
          description: ObjectID
        - in: header
          name: X-Role-Id
          schema:
            type: string
          required: true
        - in: path
          name: id
          schema:
            type: string
          required: true
          description: ObjectID
      responses:
        200:
          description: Úspěšné odstranění záznamu měření teploty
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Success"

  /base_api/v1/measurements/{patient_id}/workout:
    post:
      summary: Vytvoří nový záznam měření workoutu
      parameters:
        - in: path
          name: patient_id
          schema:
            type: string
          required: true
          description: ObjectID
        - in: header
          name: X-Role-Id
          schema:
            type: string
          required: true
      security:
        - bearerAuth: [ ]
      tags:
        - WorkoutMeasurement
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/WorkoutMeasurement"
      responses:
        200:
          description: Úspěšné vytvoření
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Success"
    get:
      summary: Fetchne všechny záznamy měření workoutu
      security:
        - bearerAuth: [ ]
      tags:
        - WorkoutMeasurement
      parameters:
        - in: path
          name: patient_id
          schema:
            type: string
          required: true
          description: ObjectID
        - in: header
          name: X-Role-Id
          schema:
            type: string
          required: true
        - in: query
          name: page
          required: false
          schema:
            type: integer
            example: 2
        - in: query
          name: size
          required: false
          schema:
            type: integer
            example: 10
        - in: query
          name: sort
          required: false
          schema:
            type: string
            example: "date_of_execution"
        - in: query
          name: order
          required: false
          schema:
            type: string
            example: "asc"
        - in: query
          name: fromDate
          required: false
          schema:
            type: string
            format: date
            example: "2016-05-09"
        - in: query
          name: toDate
          required: false
          schema:
            type: string
            format: date
            example: "2016-05-12"
      responses:
        200:
          description: Úspěšný fetch všech záznamů měření workoutu
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: ok
                  page:
                    type: object
                    properties:
                      number:
                        type: number
                      count:
                        type: number
                      next:
                        type: number
                      size:
                        type: number
                      total_count:
                        type: number
                      current:
                        type: array
                        items:
                          $ref: "#/components/schemas/WorkoutMeasurement"

  /base_api/v1/measurements/{patient_id}/workout/{id}:
    get:
      summary: Fetchne jeden záznam měření workoutu
      security:
        - bearerAuth: [ ]
      tags:
        - WorkoutMeasurement
      parameters:
        - in: path
          name: patient_id
          schema:
            type: string
          required: true
          description: ObjectID
        - in: header
          name: X-Role-Id
          schema:
            type: string
          required: true
        - in: path
          name: id
          schema:
            type: string
          required: true
          description: ObjectID
      responses:
        200:
          description: Úspěšný fetch workout measurement
          content:
            application/json:
              schema:
                allOf:
                  - $ref: "#/components/schemas/Success"
                  - type: object
                    properties:
                      data:
                        $ref: "#/components/schemas/WorkoutMeasurement"

    put:
      summary: Updatne jeden záznam měření workoutu
      security:
        - bearerAuth: [ ]
      tags:
        - WorkoutMeasurement
      parameters:
        - in: path
          name: patient_id
          schema:
            type: string
          required: true
          description: ObjectID
        - in: header
          name: X-Role-Id
          schema:
            type: string
          required: true
        - in: path
          name: id
          schema:
            type: string
          required: true
          description: ObjectID
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/WorkoutMeasurement"
      responses:
        200:
          description: Úspěšné vytvoření
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Success"

    delete:
      summary: Odstraní jeden záznam měření workoutu
      security:
        - bearerAuth: [ ]
      tags:
        - WorkoutMeasurement
      parameters:
        - in: path
          name: patient_id
          schema:
            type: string
          required: true
          description: ObjectID
        - in: header
          name: X-Role-Id
          schema:
            type: string
          required: true
        - in: path
          name: id
          schema:
            type: string
          required: true
          description: ObjectID
      responses:
        200:
          description: Úspěšné odstranění záznamu měření workoutu
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Success"

  /base_api/v1/measurements/{patient_id}/height:
    post:
      summary: Vytvoří nový záznam měření výšky
      parameters:
        - in: path
          name: patient_id
          schema:
            type: string
          required: true
          description: ObjectID
        - in: header
          name: X-Role-Id
          schema:
            type: string
          required: true
      security:
        - bearerAuth: [ ]
      tags:
        - HeightMeasurement
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/HeightMeasurement"
      responses:
        200:
          description: Úspěšné vytvoření
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Success"
    get:
      summary: Fetchne všechny záznamy měření výšky
      security:
        - bearerAuth: [ ]
      tags:
        - HeightMeasurement
      parameters:
        - in: path
          name: patient_id
          schema:
            type: string
          required: true
          description: ObjectID
        - in: header
          name: X-Role-Id
          schema:
            type: string
          required: true
        - in: query
          name: page
          required: false
          schema:
            type: integer
            example: 2
        - in: query
          name: size
          required: false
          schema:
            type: integer
            example: 10
        - in: query
          name: sort
          required: false
          schema:
            type: string
            example: "date_of_execution"
        - in: query
          name: order
          required: false
          schema:
            type: string
            example: "asc"
        - in: query
          name: fromDate
          required: false
          schema:
            type: string
            format: date
            example: "2016-05-09"
        - in: query
          name: toDate
          required: false
          schema:
            type: string
            format: date
            example: "2016-05-12"
      responses:
        200:
          description: Úspěšný fetch všech záznamů měření výšky
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: ok
                  page:
                    type: object
                    properties:
                      number:
                        type: number
                      count:
                        type: number
                      next:
                        type: number
                      size:
                        type: number
                      total_count:
                        type: number
                      current:
                        type: array
                        items:
                          $ref: "#/components/schemas/HeightMeasurement"

  /base_api/v1/measurements/{patient_id}/height/{id}:
    get:
      summary: Fetchne jeden záznam měření výšky
      security:
        - bearerAuth: [ ]
      tags:
        - HeightMeasurement
      parameters:
        - in: path
          name: patient_id
          schema:
            type: string
          required: true
          description: ObjectID
        - in: header
          name: X-Role-Id
          schema:
            type: string
          required: true
        - in: path
          name: id
          schema:
            type: string
          required: true
          description: ObjectID
      responses:
        200:
          description: Úspěšné odstranění záznamu měření výšky
          content:
            application/json:
              schema:
                allOf:
                  - $ref: "#/components/schemas/Success"
                  - $ref: "#/components/schemas/HeightMeasurement"

    put:
      summary: Updatne jeden záznam měření výšky
      security:
        - bearerAuth: [ ]
      tags:
        - HeightMeasurement
      parameters:
        - in: path
          name: patient_id
          schema:
            type: string
          required: true
          description: ObjectID
        - in: header
          name: X-Role-Id
          schema:
            type: string
          required: true
        - in: path
          name: id
          schema:
            type: string
          required: true
          description: ObjectID
      responses:
        200:
          description: Úspěšné vytvoření
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Success"

    delete:
      summary: Odstraní jeden záznam měření výšky
      security:
        - bearerAuth: [ ]
      tags:
        - HeightMeasurement
      parameters:
        - in: path
          name: patient_id
          schema:
            type: string
          required: true
          description: ObjectID
        - in: header
          name: X-Role-Id
          schema:
            type: string
          required: true
        - in: path
          name: id
          schema:
            type: string
          required: true
          description: ObjectID
      responses:
        200:
          description: Úspěšné odstranění záznamu měření výšky
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Success"

  /base_api/v1/measurements/{patient/id}/weight:
    post:
      summary: Vytvoří nový záznam měření váhy
      parameters:
        - in: path
          name: patient_id
          schema:
            type: string
          required: true
          description: ObjectID
        - in: header
          name: X-Role-Id
          schema:
            type: string
          required: true
      security:
        - bearerAuth: [ ]
      tags:
        - WeightMeasurement
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/WeightMeasurement"
      responses:
        200:
          description: Úspěšné vytvoření
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Success"
    get:
      summary: Fetchne všechny záznamy měření váhy
      security:
        - bearerAuth: [ ]
      tags:
        - WeightMeasurement
      parameters:
        - in: path
          name: patient_id
          schema:
            type: string
          required: true
          description: ObjectID
        - in: header
          name: X-Role-Id
          schema:
            type: string
          required: true
        - in: query
          name: page
          required: false
          schema:
            type: integer
            example: 2
        - in: query
          name: size
          required: false
          schema:
            type: integer
            example: 10
        - in: query
          name: sort
          required: false
          schema:
            type: string
            example: "date_of_execution"
        - in: query
          name: order
          required: false
          schema:
            type: string
            example: "asc"
        - in: query
          name: fromDate
          required: false
          schema:
            type: string
            format: date
            example: "2016-05-09"
        - in: query
          name: toDate
          required: false
          schema:
            type: string
            format: date
            example: "2016-05-12"
      responses:
        200:
          description: Úspěšný fetch všech záznamů měření váhy
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: ok
                  page:
                    type: object
                    properties:
                      number:
                        type: number
                      count:
                        type: number
                      next:
                        type: number
                      size:
                        type: number
                      total_count:
                        type: number
                      current:
                        type: array
                        items:
                          $ref: "#/components/schemas/WeightMeasurement"

  /base_api/v1/measurements/{patient/id}/weight/{id}:
    get:
      summary: Fetchne jeden záznam měření váhy
      security:
        - bearerAuth: [ ]
      tags:
        - WeightMeasurement
      parameters:
        - in: path
          name: patient_id
          schema:
            type: string
          required: true
          description: ObjectID
        - in: header
          name: X-Role-Id
          schema:
            type: string
          required: true
        - in: path
          name: id
          schema:
            type: string
          required: true
          description: ObjectID
      responses:
        200:
          description: Úspěšné odstranění záznamu měření váhy
          content:
            application/json:
              schema:
                allOf:
                  - $ref: "#/components/schemas/Success"
                  - $ref: "#/components/schemas/WeightMeasurement"

    put:
      summary: Updatne jeden záznam měření váhy
      security:
        - bearerAuth: [ ]
      tags:
        - WeightMeasurement
      parameters:
        - in: path
          name: patient_id
          schema:
            type: string
          required: true
          description: ObjectID
        - in: header
          name: X-Role-Id
          schema:
            type: string
          required: true
        - in: path
          name: id
          schema:
            type: string
          required: true
          description: ObjectID
      responses:
        200:
          description: Úspěšné vytvoření
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Success"

    delete:
      summary: Odstraní jeden záznam měření váhy
      security:
        - bearerAuth: [ ]
      tags:
        - WeightMeasurement
      parameters:
        - in: path
          name: patient_id
          schema:
            type: string
          required: true
          description: ObjectID
        - in: header
          name: X-Role-Id
          schema:
            type: string
          required: true
        - in: path
          name: id
          schema:
            type: string
          required: true
          description: ObjectID
      responses:
        200:
          description: Úspěšné odstranění záznamu měření váhy
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Success"

  /base_api/v1/measurements/{patient_id}/cholesterol:
    post:
      summary: Vytvoří nový záznam měření cholesterolu
      parameters:
        - in: path
          name: patient_id
          schema:
            type: string
          required: true
          description: ObjectID
        - in: header
          name: X-Role-Id
          schema:
            type: string
          required: true
      security:
        - bearerAuth: [ ]
      tags:
        - CholesterolMeasurement
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CholesterolMeasurement"
      responses:
        200:
          description: Úspěšné vytvoření
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Success"
    get:
      summary: Fetchne všechny záznamy měření cholesterolu
      security:
        - bearerAuth: [ ]
      tags:
        - CholesterolMeasurement
      parameters:
        - in: path
          name: patient_id
          schema:
            type: string
          required: true
          description: ObjectID
        - in: header
          name: X-Role-Id
          schema:
            type: string
          required: true
        - in: query
          name: page
          required: false
          schema:
            type: integer
            example: 2
        - in: query
          name: size
          required: false
          schema:
            type: integer
            example: 10
        - in: query
          name: sort
          required: false
          schema:
            type: string
            example: "date_of_execution"
        - in: query
          name: order
          required: false
          schema:
            type: string
            example: "asc"
        - in: query
          name: fromDate
          required: false
          schema:
            type: string
            format: date
            example: "2016-05-09"
        - in: query
          name: toDate
          required: false
          schema:
            type: string
            format: date
            example: "2016-05-12"
      responses:
        200:
          description: Úspěšný fetch všech záznamů měření cholesterolu
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: ok
                  page:
                    type: object
                    properties:
                      number:
                        type: number
                      count:
                        type: number
                      next:
                        type: number
                      size:
                        type: number
                      total_count:
                        type: number
                      current:
                        type: array
                        items:
                          $ref: "#/components/schemas/CholesterolMeasurement"

  /base_api/v1/measurements/{patient_id}/cholesterol/{id}:
    get:
      summary: Fetchne jeden záznam měření cholesterolu
      security:
        - bearerAuth: [ ]
      tags:
        - CholesterolMeasurement
      parameters:
        - in: path
          name: patient_id
          schema:
            type: string
          required: true
          description: ObjectID
        - in: header
          name: X-Role-Id
          schema:
            type: string
          required: true
        - in: path
          name: id
          schema:
            type: string
          required: true
          description: ObjectID
      responses:
        200:
          description: Úspěšné odstranění záznamu měření cholesterolu
          content:
            application/json:
              schema:
                allOf:
                  - $ref: "#/components/schemas/Success"
                  - $ref: "#/components/schemas/CholesterolMeasurement"

    put:
      summary: Updatne jeden záznam měření cholesterolu
      security:
        - bearerAuth: [ ]
      tags:
        - CholesterolMeasurement
      parameters:
        - in: path
          name: patient_id
          schema:
            type: string
          required: true
          description: ObjectID
        - in: header
          name: X-Role-Id
          schema:
            type: string
          required: true
        - in: path
          name: id
          schema:
            type: string
          required: true
          description: ObjectID
      responses:
        200:
          description: Úspěšné vytvoření
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Success"

    delete:
      summary: Odstraní jeden záznam měření cholesterolu
      security:
        - bearerAuth: [ ]
      tags:
        - CholesterolMeasurement
      parameters:
        - in: path
          name: patient_id
          schema:
            type: string
          required: true
          description: ObjectID
        - in: header
          name: X-Role-Id
          schema:
            type: string
          required: true
        - in: path
          name: id
          schema:
            type: string
          required: true
          description: ObjectID
      responses:
        200:
          description: Úspěšné odstranění záznamu měření cholesterolu
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Success"

  /base_api/v1/measurements/{patient_id}/blood_pressure:
    post:
      summary: Vytvoří nový záznam měření tlaku
      parameters:
        - in: path
          name: patient_id
          schema:
            type: string
          required: true
          description: ObjectID
        - in: header
          name: X-Role-Id
          schema:
            type: string
          required: true
      security:
        - bearerAuth: [ ]
      tags:
        - BloodPressureMeasurement
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/BloodPressureMeasurement"
      responses:
        200:
          description: Úspěšné vytvoření
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Success"
    get:
      summary: Fetchne všechny záznamy měření tlaku
      security:
        - bearerAuth: [ ]
      tags:
        - BloodPressureMeasurement
      parameters:
        - in: path
          name: patient_id
          schema:
            type: string
          required: true
          description: ObjectID
        - in: header
          name: X-Role-Id
          schema:
            type: string
          required: true
        - in: query
          name: page
          required: false
          schema:
            type: integer
            example: 2
        - in: query
          name: size
          required: false
          schema:
            type: integer
            example: 10
        - in: query
          name: sort
          required: false
          schema:
            type: string
            example: "date_of_execution"
        - in: query
          name: order
          required: false
          schema:
            type: string
            example: "asc"
        - in: query
          name: fromDate
          required: false
          schema:
            type: string
            format: date
            example: "2016-05-09"
        - in: query
          name: toDate
          required: false
          schema:
            type: string
            format: date
            example: "2016-05-12"
      responses:
        200:
          description: Úspěšný fetch všech záznamů měření tlaku
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: ok
                  page:
                    type: object
                    properties:
                      number:
                        type: number
                      count:
                        type: number
                      next:
                        type: number
                      size:
                        type: number
                      total_count:
                        type: number
                      current:
                        type: array
                        items:
                          $ref: "#/components/schemas/BloodPressureMeasurement"

  /base_api/v1/measurements/{patient_id}/blood_pressure/{id}:
    get:
      summary: Fetchne jeden záznam měření tlaku
      security:
        - bearerAuth: [ ]
      tags:
        - BloodPressureMeasurement
      parameters:
        - in: path
          name: patient_id
          schema:
            type: string
          required: true
          description: ObjectID
        - in: header
          name: X-Role-Id
          schema:
            type: string
          required: true
        - in: path
          name: id
          schema:
            type: string
          required: true
          description: ObjectID
      responses:
        200:
          description: Úspěšné odstranění záznamu měření tlaku
          content:
            application/json:
              schema:
                allOf:
                  - $ref: "#/components/schemas/Success"
                  - $ref: "#/components/schemas/BloodPressureMeasurement"

    put:
      summary: Updatne jeden záznam měření tlaku
      security:
        - bearerAuth: [ ]
      tags:
        - BloodPressureMeasurement
      parameters:
        - in: path
          name: patient_id
          schema:
            type: string
          required: true
          description: ObjectID
        - in: header
          name: X-Role-Id
          schema:
            type: string
          required: true
        - in: path
          name: id
          schema:
            type: string
          required: true
          description: ObjectID
      responses:
        200:
          description: Úspěšné vytvoření
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Success"

    delete:
      summary: Odstraní jeden záznam měření tlaku
      security:
        - bearerAuth: [ ]
      tags:
        - BloodPressureMeasurement
      parameters:
        - in: path
          name: patient_id
          schema:
            type: string
          required: true
          description: ObjectID
        - in: header
          name: X-Role-Id
          schema:
            type: string
          required: true
        - in: path
          name: id
          schema:
            type: string
          required: true
          description: ObjectID
      responses:
        200:
          description: Úspěšné odstranění záznamu měření tlaku
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Success"

  /base_api/v1/attachments/{patient_id}:
    post:
      summary: Přidá attachment do pacientovy karty
      security:
          - bearerAuth: [ ]
      tags:
        - Attachments
      parameters:
        - in: path
          name: patient_id
          schema:
            type: string
          required: true
          description: ObjectID
        - in: header
          name: X-Role-Id
          schema:
            type: string
          required: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                uuid:
                  type: string
                  format: uuid
                size:
                  type: number
                mimetype:
                  type: string
                  example: image/jpeg
                filename:
                  type: string
                type:
                  type: string
                  enum: [ laboratory, radiology, attachment ]
      responses:
        200:
          description: Úspěšné odstranění záznamu měření tlaku
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Success"

    get:
      summary: Fetchne pacienty přílohy
      security:
        - bearerAuth: [ ]
      tags:
        - Attachments
      parameters:
        - in: path
          name: patient_id
          schema:
            type: string
          required: true
          description: ObjectID
        - in: header
          name: X-Role-Id
          schema:
            type: string
          required: true
        - in: query
          name: page
          required: false
          schema:
            type: integer
            example: 2
        - in: query
          name: size
          required: false
          schema:
            type: integer
            example: 10
        - in: query
          name: sort
          required: false
          schema:
            type: string
            example: "date_of_execution"
        - in: query
          name: order
          required: false
          schema:
            type: string
            example: "asc"
        - in: query
          name: fromDate
          required: false
          schema:
            type: string
            format: date
            example: "2016-05-09"
        - in: query
          name: toDate
          required: false
          schema:
            type: string
            format: date
            example: "2016-05-12"
      responses:
        200:
          description: Úpěšný fetch pacientových příloh
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: ok
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        uuid:
                          type: string
                          format: uuid
                        size:
                          type: number
                        mimetype:
                          type: string
                          example: image/jpeg
                        filename:
                          type: string
                        type:
                          type: string
                          enum: [ laboratory, radiology, attachment ]

  /base_api/v1/attachments/{patient_id}/attachment/{id}:
    get:
      summary: Fetchne pacientovu přílohu
      security:
          - bearerAuth: [ ]
      tags:
        - Attachments
      parameters:
        - in: path
          name: id
          schema:
            type: string
          required: true
          description: ObjectID
        - in: path
          name: patient_id
          schema:
            type: string
          required: true
          description: ObjectID
        - in: header
          name: X-Role-Id
          schema:
            type: string
          required: true
      responses:
        200:
          description: Úpěšný fetch jedné přílohy
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: ok
                  data:
                    type: object
                    properties:
                      uuid:
                        type: string
                        format: uuid
                      size:
                        type: number
                      mimetype:
                        type: string
                        example: image/jpeg
                      filename:
                        type: string
                      type:
                        type: string
                        enum: [ laboratory, radiology, attachment ]

    put:
      summary: Rename souboru
      security:
          - bearerAuth: [ ]
      tags:
        - Attachments
      parameters:
        - in: path
          name: id
          schema:
            type: string
          required: true
          description: ObjectID
        - in: path
          name: patient_id
          schema:
            type: string
          required: true
          description: ObjectID
        - in: header
          name: X-Role-Id
          schema:
            type: string
          required: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                filename:
                  type: string
      responses:
        200:
          description: Úspěšný rename souboru
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: ok

    delete:
      summary: Delete přílohy
      security:
          - bearerAuth: [ ]
      tags:
        - Attachments
      parameters:
        - in: path
          name: id
          schema:
            type: string
          required: true
          description: ObjectID
        - in: path
          name: patient_id
          schema:
            type: string
          required: true
          description: ObjectID
        - in: header
          name: X-Role-Id
          schema:
            type: string
          required: true
      responses:
        200:
          description: Úspěšné smazání přílohy (i souboru na S3)
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: ok

  /file_proxy/v1/files:
    post:
      summary: Upload souboru do file proxy
      security:
        - bearerAuth: [ ]
      tags:
        - File Proxy
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                file:
                  type: string
                  format: binary
      responses:
        200:
          description: Úspěšné nahrání soubor na S3
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Success"

  /file_proxy/v1/files/{id_or_uuid}/link:
    get:
      summary: Vrací temporary link na soubor (požuívá se pouze pro PrivateApi)
      parameters:
        - in: header
          name: Authorization
          required: true
          schema:
            type: string
            example: Lor3mFuck!ng1psum
      tags:
        - PrivateApi
      responses:
        200:
          description: Úspěšné vygenerování temporary linku
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: ok
                  data:
                    type: object
                    properties:
                      link:
                        type: string
                        example: https://media.wired.com/photos/598e35fb99d76447c4eb1f28/master/pass/phonepicutres-TA.jpg

  /telerehab_api/v1/exercise_presets:
    get:
      summary: Fetch presetů cvičení
      security:
        - bearerAuth: [ ]
      tags:
        - Telerehab
      responses:
        200:
          description: Úspěšný fetch presetů cvičení
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example:
                      ok
                  data:
                    type: object
                    properties:
                      number:
                        type: number
                      count:
                        type: number
                      next:
                        type: number
                      prev:
                        type: number
                      size:
                        type: number
                      total_count:
                        type: number
                      current:
                        type: array
                        items:
                          type: object
                          properties:
                            _id:
                              type: string
                            title:
                              type: string
                            description:
                              type: string
                            length:
                              type: number
                            reference_video_uuid:
                              type: string
                              format: uuid
                            graphs:
                              type: array
                              items:
                                type: object
                                properties:
                                  x_labels:
                                    type: array
                                    items:
                                      type: string
                                  y_labels:
                                    type: array
                                    items:
                                      type: string
                                  points:
                                    type: object
                                    properties:
                                      a:
                                        type: array
                                        items:
                                          type: string
                                      b:
                                        type: array
                                        items:
                                          type: string
                                      c:
                                        type: array
                                        items:
                                          type: string
    post:
      summary: Vytvoří preset cvičení
      security:
        - bearerAuth: [ ]
      tags:
        - Telerehab
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                title:
                  type: string
                description:
                  type: string
                length:
                  type: number
                reference_video_uuid:
                  type: string
                  format: uuid
                graphs:
                  type: array
                  items:
                    type: string
      responses:
        200:
          description: Úspěšné vytvoření presetu cvičení
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: ok

  /telerehab_api/v1/exercise_presets/{preset_id}:
    get:
      summary: Detail presetu cvičení
      tags:
        - Telerehab
      security:
        - bearerAuth: [ ]
      parameters:
        - in: header
          name: X-Role-Id
          required: true
          schema:
            type: string
        - in: path
          name: preset_id
          required: true
          schema:
            type: string
      responses:
        200:
          description: Úspěšný fetch detailu presetu
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: ok
                  data:
                    type: object
                    properties:
                      title:
                        type: string
                      description:
                        type: string
                      length:
                        type: number
                      reference_video_uuid:
                        type: string
                        format: uuid
                      graphs:
                        type: array
                        items:
                          type: object
                          properties:
                            _id:
                              type: string
                            title:
                              type: string
                            x_labels:
                              type: array
                              items:
                                type: string
                            y_labels:
                              type: array
                              items:
                                type: string
                            points:
                              type: object
                              properties:
                                a:
                                  type: array
                                  items:
                                    type: string
                                b:
                                  type: array
                                  items:
                                    type: string
                                c:
                                  type: array
                                  items:
                                    type: string

    put:
      summary: Update presetu cvičení
      tags:
        - Telerehab
      security:
        - bearerAuth: [ ]
      parameters:
        - in: header
          name: X-Role-Id
          required: true
          schema:
            type: string
        - in: path
          name: preset_id
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                title:
                  type: string
                description:
                  type: string
                length:
                  type: number
                reference_video_uuid:
                  type: string
                  format: uuid
                graphs:
                  type: array
                  items:
                    type: string
      responses:
        200:
          description: Úspěšný update presetu
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Success"

    delete:
      summary: Delete presetu cvičení
      tags:
        - Telerehab
      security:
        - bearerAuth: [ ]
      parameters:
        - in: header
          name: X-Role-Id
          required: true
          schema:
            type: string
        - in: path
          name: preset_id
          required: true
          schema:
            type: string
      responses:
        200:
          description: Úspěšný delete presetu
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Success"

  /telerehab_api/v1/exercise_presets/graphs:
    post:
      summary: Vytvoření grafu
      tags:
        - Telerehab
      security:
        - bearerAuth: [ ]
      parameters:
        - in: header
          name: X-Role-Id
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                x_labels:
                  type: array
                  items:
                    type: string
                y_labels:
                  type: array
                  items:
                    type: string
                points:
                  type: object
                  properties:
                    a:
                      type: array
                      items:
                        type: string
                    b:
                      type: array
                      items:
                        type: string
                    c:
                      type: array
                      items:
                        type: string

      responses:
        200:
          description: Úspěšné vytvoření grafu
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Success"

    get:
      summary: Fetch všech grafů
      tags:
        - Telerehab
      security:
        - bearerAuth: [ ]
      parameters:
        - in: header
          name: X-Role-Id
          required: true
          schema:
            type: string
      responses:
        200:
          description: Úspěšný fetch grafů
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: ok
                  data:
                    type: object
                    properties:
                      number:
                        type: number
                      count:
                        type: number
                      next:
                        type: number
                      prev:
                        type: number
                      size:
                        type: number
                      total_count:
                        type: number
                      current:
                        type: array
                        items:
                          type: object
                          properties:
                            _id:
                              type: string
                            title:
                              type: string
                            x_labels:
                              type: array
                              items:
                                type: string
                            y_labels:
                              type: array
                              items:
                                type: string
                            points:
                              type: object
                              properties:
                                a:
                                  type: array
                                  items:
                                    type: string
                                b:
                                  type: array
                                  items:
                                    type: string
                                c:
                                  type: array
                                  items:
                                    type: string

  /telerehab_api/v1/exercise_presets/graphs/{graph_id}:
    get:
      summary: Fetch detailu grafu
      tags:
        - Telerehab
      security:
        - bearerAuth: [ ]
      parameters:
        - in: header
          name: X-Role-Id
          required: true
          schema:
            type: string
        - in: path
          name: graph_id
          required: true
          schema:
            type: string
      responses:
        200:
          description: Úspěšný fetch detailu grafu
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: ok
                  data:
                    type: object
                    properties:
                      _id:
                        type: string
                      title:
                        type: string
                      x_labels:
                        type: array
                        items:
                          type: string
                      y_labels:
                        type: array
                        items:
                          type: string
                      points:
                        type: object
                        properties:
                          a:
                            type: array
                            items:
                              type: string
                          b:
                            type: array
                            items:
                              type: string
                          c:
                            type: array
                            items:
                              type: string

    put:
      summary: Update grafu
      tags:
        - Telerehab
      security:
        - bearerAuth: [ ]
      parameters:
        - in: header
          name: X-Role-Id
          required: true
          schema:
            type: string
        - in: path
          name: graph_id
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                _id:
                  type: string
                title:
                  type: string
                x_labels:
                  type: array
                  items:
                    type: string
                y_labels:
                  type: array
                  items:
                    type: string
                points:
                  type: object
                  properties:
                    a:
                      type: array
                      items:
                        type: string
                    b:
                      type: array
                      items:
                        type: string
                    c:
                      type: array
                      items:
                        type: string
      responses:
        200:
          description: Úspěšný update grafu
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Success"

    delete:
      summary: Delete grafu
      tags:
        - Telerehab
      security:
        - bearerAuth: [ ]
      parameters:
        - in: header
          name: X-Role-Id
          required: true
          schema:
            type: string
        - in: path
          name: graph_id
          required: true
          schema:
            type: string
      responses:
        200:
          description: Úspěšné smazání grafu
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Success"

  /telerehab_api/v1/exercises/clone/check:
    post:
      security:
        - bearerAuth: [ ]
      tags:
        - Telerehab
      summary: Zkontroluje, jestli pacient, ke kterému kopírujeme exercise plan už nějaký plán má
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                target_patient_id:
                  type: string
      responses:
        200:
          description: Navrácení requires_override = true|false
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example:
                      ok
                  data:
                    type: object
                    properties:
                      requires_override:
                        type: boolean

  /telerehab_api/v1/exercises/{patient_id}:
    get:
      summary: Fetchne pacientův cvičební plán
      security:
        - bearerAuth: [ ]
      tags:
        - Telerehab
      parameters:
        - in: path
          name: patient_id
          schema:
            type: string
          required: true
          description: ObjectID
        - in: header
          name: X-Role-Id
          schema:
            type: string
          required: true
        - in: query
          name: page
          required: false
          schema:
            type: integer
            example: 2
        - in: query
          name: size
          required: false
          schema:
            type: integer
            example: 10
        - in: query
          name: sort
          required: false
          schema:
            type: string
            example: "date_of_execution"
        - in: query
          name: order
          required: false
          schema:
            type: string
            example: "asc"
        - in: query
          name: fromDate
          required: false
          schema:
            type: string
            format: date
            example: "2016-05-09"
        - in: query
          name: toDate
          required: false
          schema:
            type: string
            format: date
            example: "2016-05-12"
      responses:
        200:
          description: Úspěšný fetch cvičebního plánu pacienta
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: ok
                  data:
                    type: object
                    properties:
                      number:
                        type: number
                      count:
                        type: number
                      next:
                        type: number
                      prev:
                        type: number
                      size:
                        type: number
                      total_count:
                        type: number
                      current:
                        type: array
                        items:
                          type: object
                          properties:
                            _id:
                              type: string
                            date:
                              type: string
                              format: date
                            title:
                              type: array
                              items:
                                type: string
                            length:
                              type: number
                            count:
                              type: number
                            status:
                              type: string
                              enum:
                                - toBeDone
                                - started
                                - completed


    post:
      summary: Přidá cvik do pacientova cvičebního plánu
      security:
        - bearerAuth: [ ]
      tags:
        - Telerehab
      parameters:
        - in: path
          name: patient_id
          schema:
            type: string
          required: true
          description: ObjectID
        - in: header
          name: X-Role-Id
          schema:
            type: string
          required: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                preset_id:
                  type: string
                date:
                  type: string
                  format: date
                title:
                  type: string
                  required: false
                description:
                  type: string
                  required: false
                length:
                  type: string
                  required: false
      responses:
        200:
          description: Úspěšné vytvoření cviku v pacientově cvičebním plánu
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Success"

  /telerehab_api/v1/exercises/{patient_id}/day/{day_id}:
    get:
      summary: Detail jednoho dne ze cvičebního plánu
      security:
        - bearerAuth: [ ]
      tags:
        - Telerehab
      parameters:
        - in: path
          name: day_id
          schema:
            type: string
          required: true
          description: ObjectID
        - in: path
          name: patient_id
          schema:
            type: string
          required: true
          description: ObjectID
        - in: header
          name: X-Role-Id
          schema:
            type: string
          required: true
      responses:
        200:
          description: Úspěšný fetch dne z pacientova cvičebního plánu
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: ok
                  data:
                    $ref: "#/components/schemas/ExerciseDay"

  /telerehab_api/v1/exercies/{patient_id}/day/{day_id}/exercise/{exercise_id}:
    get:
      summary: Fetchne detail jednoho cviku z pacientova cvičebního plánu
      tags:
        - Telerehab
      security:
        - bearerAuth: [ ]
      parameters:
        - in: path
          name: exercise_id
          schema:
            type: string
          required: true
          description: ObjectID
        - in: path
          name: day_id
          schema:
            type: string
          required: true
          description: ObjectID
        - in: path
          name: patient_id
          schema:
            type: string
          required: true
          description: ObjectID
        - in: header
          name: X-Role-Id
          schema:
            type: string
          required: true
      responses:
        200:
          description: Úspěšný fetch detailu jednoho cviku
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: ok
                  data:
                    $ref: "#/components/schemas/Exercise"
    put:
      summary: Assignne natočené video k cviku
      tags:
        - Telerehab
      security:
        - bearerAuth: [ ]
      parameters:
        - in: path
          name: exercise_id
          schema:
            type: string
          required: true
          description: ObjectID
        - in: path
          name: day_id
          schema:
            type: string
          required: true
          description: ObjectID
        - in: path
          name: patient_id
          schema:
            type: string
          required: true
          description: ObjectID
        - in: header
          name: X-Role-Id
          schema:
            type: string
          required: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                input_video_uuid:
                  type: string
                  format: uuid
      responses:
        200:
          description: Úspěšný assign videa k cviku
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: ok

  /telerehab_api/v1/exercies/{patient_id}/day/{day_id}/exercise/{exercise_id}/upload_token:
    get:
      summary: Vygeneruje upload token pro nahrání videa do file proxy a následné přiřazení nahraného videa ke cviku v telerehab service
      tags:
        - Telerehab
      security:
        - bearerAuth: [ ]
      parameters:
        - in: header
          name: X-Role-Id
          required: true
          schema:
            type: string
      responses:
        200:
          description: Úspěšné vygenerování upload tokenu
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: ok
                  data:
                    type: object
                    properties:
                      upload_token:
                        type: string

  /telerehab_api/v1/exercise/assign:
    put:
      summary: Přiřadí video nahrané do file proxy ke cviku pomocí upload tokenu
      tags:
        - Telerehab
      parameters:
        - in: query
          required: true
          name: upload_token
          schema:
            type: string
      responses:
        200:
          description: Úspěšné přiřazení videa ke cviku
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Success"

  /file_proxy/v1/exercise/upload:
    post:
      summary: Uploadne video do file proxy pomocí upload tokenu
      tags:
        - Telerehab
      parameters:
        - in: query
          required: true
          name: upload_token
          schema:
            type: string
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                file:
                  type: string
                  format: binary
      responses:
        200:
          description: Úspěšné nahrání soubor na file proxy
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: ok
                  data:
                    type: object
                    properties:
                      uuid:
                        type: string
                        format: uuid
                      size:
                        type: number
                      mimetype:
                        type: string
                        example: image/jpeg
                      filename:
                        type: string

  /telerehab_api/v1/private_api/pending_exercises:
    get:
      summary: Fetchne všechny nezpracované cviky
      tags:
        - PrivateApi
      parameters:
        - in: header
          name: Authorization
          required: true
          schema:
            type: string
            example: Lor3mFuck!ng1psum
      responses:
        200:
          description: Úspěšný fetch všech nezpracovaných cviků
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: ok
                  data:
                    type: array
                    items:
                      $ref: "#/components/schemas/Exercise"

  /telerehab_api/v1/private_api/exercises/{patient_id}/day/{day_id}/exercise/{exercise_id}/edg:
    put:
      summary: Assignne výstupní video a grafy k cviku
      tags:
        - PrivateApi
      parameters:
        - in: header
          name: Authorization
          required: true
          schema:
            type: string
            example: Lor3mFuck!ng1psum
        - in: path
          name: day_id
          schema:
            type: string
          required: true
          description: ObjectID
        - in: path
          name: exercise_id
          schema:
            type: string
          required: true
          description: ObjectID
        - in: path
          name: patient_id
          schema:
            type: string
          required: true
          description: ObjectID
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                output_video_uuid:
                  type: string
                graphs:
                  type: array
                  items:
                    type: object
                    properties:
                      graph_id:
                        type: string
                        description: _id z graphs
                      graph_uuid:
                        type: string
                        description: uuid souboru
      responses:
        200:
          description: Úspěšný assign výstupů k cviku
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Success"

  /telerehab_api/v1/private_api/pending_presets:
    get:
      summary: Fetchne všechny nezpracované presety
      tags:
        - PrivateApi
      parameters:
        - in: header
          name: Authorization
          required: true
          schema:
            type: string
            example: Lor3mFuck!ng1psum
      responses:
        200:
          description: Úspěšný fetch všech nezpracovaných presetů
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: ok
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        _id:
                          type: string
                        title:
                          type: string
                        description:
                          type: string
                        length:
                          type: number
                        reference_video_uuid:
                          type: string
                          format: uuid
                        parsed:
                          type: boolean
                        graphs:
                          type: array
                          items:
                            type: object
                            properties:
                              _id:
                                type: string
                              title:
                                type: string
                              x_labels:
                                type: array
                                items:
                                  type: string
                              y_labels:
                                type: array
                                items:
                                  type: string
                              graph_uuid:
                                type: string
                                format: uuid
                              points:
                                type: object
                                properties:
                                  a:
                                    type: array
                                    items:
                                      type: string
                                  b:
                                    type: array
                                    items:
                                      type: string
                                  c:
                                    type: array
                                    items:
                                      type: string

  /telerehab_api/v1/private_api/pending_presets/{preset}:
    put:
      summary: Assignne výstupní video a grafy k presetu
      tags:
        - PrivateApi
      parameters:
        - in: header
          name: Authorization
          required: true
          schema:
            type: string
            example: Lor3mFuck!ng1psum
        - in: path
          name: preset
          schema:
            type: string
          required: true
          description: ObjectID
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                parsed_reference_video_uuid:
                  type: string
                graphs:
                  type: array
                  items:
                    type: object
                    properties:
                      graph_id:
                        type: string
                        description: _id z graphs
                      graph_uuid:
                        type: string
                        description: uuid souboru
      responses:
        200:
          description: Úspěšná assign výstupního videa a grafů k presetu
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Success"

  /base_api/v1/family-members:
    get:
      summary: Listing všech family memberů (včetně ownera)
      security:
        - bearerAuth: [ ]
      tags:
        - FamilyMembers
      responses:
        200:
          description: Úspěšný fetch všech family memberů
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: ok
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        first_name:
                          type: string
                        last_name:
                          type: string
                        email:
                          type: string
                          format: email
                        date_of_birth:
                          type: string
                          format: date
                        role_id:
                          type: string

  /base_api/v1/family-members/new:
    post:
      summary: Vytvoří a přiřadí účet family membera
      tags:
        - FamilyMembers
      security:
        - bearerAuth: [ ]
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                first_name:
                  type: string
                  example: Jan
                middle_name:
                  type: string
                  example: Jakub
                last_name:
                  type: string
                  example: Jonášovic
                degrees_before:
                  type: string
                degrees_after:
                  type: string
                email:
                  type: string
                  format: email
                  example: pacient@inspectlife.com
                phone_number_code:
                  type: string
                  example: +420
                phone_number:
                  type: string
                  format: phone
                  example: 123 456 789
                country:
                  type: string
                  example: cz
                pin:
                  type: string
                  example: 720806/0530
                health_insurance_company_code:
                  type: string
                  example: vzp
                permanent_residence_address:
                  type: object
                  properties:
                    street:
                      type: string
                      example: Pernerova
                    street_number:
                      type: string
                      example: 1556
                    city:
                      type: string
                      example: Pardubice
                    postal_code:
                      type: string
                      example: 530 02
                correspondence_address:
                  type: object
                  properties:
                    street:
                      type: string
                      example: Sukova Třída
                    street_number:
                      type: string
                      example: 468
                    city:
                      type: string
                      example: Pardubice
                    postal_code:
                      type: string
                      example: 530 02
                different_correspondence:
                  type: boolean
                  example: true
      responses:
        200:
          description: Úspěšné založení family membera
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: ok
                  data:
                    type: object
                    properties:
                      message:
                        type: string
                        example: "User Jméno Příjmení úspěšně založen!"

  /base_api/v1/family-members/{family_member_role_id}:
    delete:
      security:
        - bearerAuth: [ ]
      summary: Odstraní vybraného člena z rodiny
      tags:
        - FamilyMembers
      parameters:
        - in: path
          name: family_member_role_id
          required: true
          schema:
            type: string
      responses:
        200:
          description: Úspěšné odebrání člena z rodiny
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Success"

  /base_api/v1/doctors:
    get:
      summary: Fetch všech doktorů v systému
      tags:
        - Doctors
      security:
        - bearerAuth: [ ]
      responses:
        200:
          description: Úspěšný fetch všech doktorů
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: ok
                  page:
                    type: object
                    properties:
                      number:
                        type: number
                      count:
                        type: number
                      next:
                        type: number
                      size:
                        type: number
                      total_count:
                        type: number
                      current:
                        type: array
                        items:
                          type: string
                          example: TODO nevím jak vypadá response, budu muset vyzkoušet - Vojtěch Morávek

  /base_api/v1/doctors/my:
    get:
      summary: Fetch mých ošetřujících doktorů
      tags:
        - Doctors
      security:
        - bearerAuth: [ ]
      parameters:
        - in: header
          name: X-Role-Id
          schema:
            type: string
          required: true
      responses:
        200:
          description: Úspěšný fetch mých doktorů
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: ok
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        first_name:
                          type: string
                        last_name:
                          type: string
                        email:
                          type: string
                        phone_number:
                          type: string

  /base_api/v1/doctors/requests:
    get:
      summary: Vrátí seznam žádostí, které různí doktoři udělali pro přístup do karty přihlášeného pacienta (nejspíše bude nahrazeno notification serverem)
      tags:
        - Doctors
      security:
        - bearerAuth: [ ]
      parameters:
        - in: header
          name: X-Role-Id
          schema:
            type: string
          required: true
      responses:
        200:
          description: Úspěšný fetch žádostí
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: ok
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        _id:
                          type: string
                        first_name:
                          type: string
                        last_name:
                          type: string
                        email:
                          type: string
                          format: email
                        phone_number:
                          type: string

  /base_api/v1/doctors/requests/{request_id}/{state}:
    put:
      summary: Zakáže nebo povolí žádost doktora o přístup ke kartě pacienta (podle state = grant|deny)
      tags:
        - Doctors
      security:
        - bearerAuth: [ ]
      parameters:
        - in: header
          name: X-Role-Id
          schema:
            type: string
          required: true
        - in: path
          name: request_id
          schema:
            type: string
          required: true
          description: ObjectID
        - in: path
          name: state
          schema:
            type: string
            enum:
              - grant
              - deny
          required: true
          description: Zákaz/povolení žádosti
      responses:
        200:
          description: Úspěšný update žádosti (povolení nebo zákaz)
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Success"

  /base_api/v1/doctors/{doctor_id}:
    post:
      summary: Přímé udělení přístupu doktorovi (vyvolává pacient)
      tags:
        - Doctors
      security:
        - bearerAuth: [ ]
      parameters:
        - in: header
          name: X-Role-Id
          schema:
            type: string
          required: true
        - in: path
          name: doctor_id
          schema:
            type: string
          required: true
          description: ObjectID
      responses:
        200:
          description: Úspěšné přidělení přístupu doktorovi
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: ok

  /notification_api/v1/mark:
    post:
      summary: Označí vybrané notifikace jako přečtené
      security:
        - bearerAuth: [ ]
      tags:
        - Notification
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                ids:
                  type: array
                  items:
                    type: string
                new_state:
                  type: string
                  example: read
      responses:
        200:
          description: Úspěšné označení vybraných notifkackí jako přečtěné
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Success"

  /notification_api/v1/unread:
    get:
      summary: Vrátí paginované nepřečtené notifikace
      security:
        - bearerAuth: [ ]
      tags:
        - Notification
      parameters:
        - in: header
          name: X-Role-Id
          required: true
          schema:
            type: string
        - in: query
          name: limit
          required: false
          schema:
            type: number
        - in: query
          name: offset
          required: false
          schema:
            type: number
      responses:
        200:
          description: Úspěšný fetch nepřečtených notifikací
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: ok
                  data:
                    type: object
                    properties:
                      number:
                        type: number
                      count:
                        type: number
                      next:
                        type: number
                      size:
                        type: number
                      total_count:
                        type: number
                      current:
                        type: array
                        items:
                          type: object
                          properties:
                            id:
                              type: string
                            state:
                              type: string
                              enum:
                                - read
                                - unread
                            time:
                              type: string
                              format: date-time
                            type:
                              type: string
                            text:
                              type: string
                            callbacks:
                              type: object
                              properties:
                                accept:
                                  type: object
                                  properties:
                                    title:
                                      type: string
                                    icon:
                                      type: string
                                    color:
                                      type: string
                                decline:
                                  type: object
                                  properties:
                                    title:
                                      type: string
                                    icon:
                                      type: string
                                    color:
                                      type: string
                                tentative:
                                  type: object
                                  properties:
                                    title:
                                      type: string
                                    icon:
                                      type: string
                                    color:
                                      type: string

  /notification_api/v1/callback:
    post:
      summary: Vykoná vybranou akci pro specifikovaný event
      security:
          - bearerAuth: [ ]
      tags:
        - Notification
      parameters:
        - in: header
          name: X-Role-Id
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                action:
                  type: string
                  enum:
                    - accept
                    - decline
                    - tentative
                id:
                  type: string
                  description: ID notifikace
      responses:
        200:
          description: Úspěšné vykonání callbacku
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Success"

  /notification_api/v1/settings:
    get:
      summary: Fetchne současné nastavení notifikací
      security:
        - bearerAuth: [ ]
      parameters:
        - in: header
          name: X-Role-Id
          schema:
            type: string
          required: true
      tags:
        - Notification
      responses:
        200:
          description: Úspěšný fetch nastavení
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: ok
                  data:
                    type: object
                    properties:
                      desktop:
                        type: boolean
                      mail:
                        type: boolean
    put:
      summary: Update nastavení notifikací uživatele
      security:
        - bearerAuth: [ ]
      parameters:
        - in: header
          name: X-Role-Id
          schema:
            type: string
          required: true
      tags:
        - Notification
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                desktop:
                  type: boolean
                mail:
                  type: boolean
      responses:
        200:
          description: Úspěšný update nastavení notifikací
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Success"

  /edg_api/v1/services:
    get:
      summary: Fetchne dostupné 3rd party aplikace
      parameters:
        - in: header
          name: X-Role-Id
          schema:
            type: string
          required: true
      tags:
        - EdgyConfig
      security:
        - bearerAuth: [ ]
      responses:
        200:
          description: Úspěšný fetech dostupných 3rd party appek
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: ok
                  data:
                    type: array
                    items:
                      $ref: "#/components/schemas/EdgyService"

  /edg_api/v1/services/my:
    get:
      summary: Fetchne moje připojené 3rd party aplikace
      parameters:
        - in: header
          name: X-Role-Id
          schema:
            type: string
          required: true
      tags:
        - EdgyConfig
      security:
        - bearerAuth: [ ]
      responses:
        200:
          description: Úspěšný fetech mých připojených 3rd party appek
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: ok
                  data:
                    type: array
                    items:
                      $ref: "#/components/schemas/EdgyService"

  /edg_api/v1/services/available:
    get:
      summary: Fetchne nepřipojených 3rd party aplikace
      parameters:
        - in: header
          name: X-Role-Id
          schema:
            type: string
          required: true
      tags:
        - EdgyConfig
      security:
        - bearerAuth: [ ]
      responses:
        200:
          description: Úspěšný fetech nepřipojených 3rd party appek
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: ok
                  data:
                    type: array
                    items:
                      $ref: "#/components/schemas/EdgyService"

  /base_api/v1/icd/whisper:
    get:
      summary: Našeptávač nemocí MKN-10
      security:
        - bearerAuth: [ ]
      tags:
        - MKN-10
      parameters:
        - in: query
          name: query
          required: true
          schema:
            type: string
            minimum: 3
      responses:
        200:
          description: Úspěšné navrácení výsledků z našeptávače
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: ok
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        code:
                          type: string
                          example: T31-0
                        title:
                          type: string
                          example: Popáleniny postihující méně než 10 % povrchu těla


  /base_api/v1/medications/whisper:
    get:
      summary: Whisper pro léky ze SUKL
      tags:
        - SUKL
      security:
        - bearerAuth: [ ]
      parameters:
        - in: query
          name: query
          required: true
          schema:
            type: string
            minLength: 3
      responses:
        200:
          description: Úspěšný fetch prvních 20 výsledků
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: ok
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                        title:
                          type: string
                        info:
                          type: string

  /base_api/v1/medications:
    post:
      summary: Vytvoření nového custom léku
      tags:
        - SUKL
      security:
        - bearerAuth: [ ]
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                atc_code:
                  type: string
                name:
                  type: string
                method_of_administration:
                  type: string
                form:
                  type: string
                strength:
                  type: string
                packaging_type:
                  type: string
                active_substance:
                  type: string
      responses:
        200:
          description: Úspěšné vytvoření custom léku
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Success"
    get:
      summary: Fetch doktorových custom léků
      tags:
        - SUKL
      security:
        - bearerAuth: [ ]
      responses:
        200:
          description: Úspěšný fetch doktorových custom léků
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: ok
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                        title:
                          type: string
                        form:
                          type: string
                        method_of_administration:
                          type: string
                        active_substance:
                          type: string
                        info:
                          type: string


  /base_api/v1/medications/{medication_id}:
    get:
      summary: Detail jednoho custom léku
      tags:
        - SUKL
      security:
        - bearerAuth: [ ]
      parameters:
        - in: path
          name: medication_id
          required: true
          schema:
            type: string
      responses:
        200:
          description: Úspěšný fetch detailu jednoho custom léku
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: ok
                  data:
                    type: object
                    properties:
                      id:
                        type: string
                      title:
                        type: string
                      form:
                        type: string
                      method_of_administration:
                        type: string
                      active_substance:
                        type: string
                      info:
                        type: string

    put:
      summary: Update jednoho custom léku
      tags:
        - SUKL
      security:
        - bearerAuth: [ ]
      parameters:
        - in: path
          name: medication_id
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                atc_code:
                  type: string
                name:
                  type: string
                issue_type:
                  type: string
                strength:
                  type: string
                packaging_type:
                  type: string
                active_substance:
                  type: string
      responses:
        200:
          description: Úspěšný update custom léku
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Success"

    delete:
      summary: Odstranění jednoho custom léku
      tags:
        - SUKL
      security:
        - bearerAuth: [ ]
      parameters:
        - in: path
          name: medication_id
          required: true
          schema:
            type: string
      responses:
        200:
          description: Úspěšné odstranění custom léku
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Success"

  /base_api/v1/access:
    post:
      summary: Přidělí přístup k pacientovi
      tags:
        - Admin
      security:
        - bearerAuth: [ ]
      parameters:
        - in: header
          name: X-Role-Id
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                patient_id:
                  type: string
                doctor_id:
                  type: string
      responses:
        200:
          description: Úspěšné přiřazení pacienta k doktorovi
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Success"

    delete:
      summary: Odebere přístup k pacientovi
      tags:
        - Admin
      security:
        - bearerAuth: [ ]
      parameters:
        - in: header
          name: X-Role-Id
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                patient_id:
                  type: string
                doctor_id:
                  type: string
      responses:
        200:
          description: Úspěšné odebrání pacienta od doktorovi
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Success"

components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

  schemas:
    EdgyService:
      type: object
      properties:
        title:
          type: string
          example: Fitbit
        logo_url:
          type: string
          example: https://logos-world.net/wp-content/uploads/2021/02/Fitbit-Emblem.png
        is_enabled:
          type: boolean
        type:
          type: string
          enum:
            - fitbit
            - withings
            - atmotube
            - googlefit
            - rightest

    ExerciseDay:
      type: object
      properties:
        _id:
          type: string
        date:
          type: string
          format: date
        length:
          type: number
        count:
          type: number
        exercies:
          type: array
          items:
            $ref: "#/components/schemas/Exercise"

    Exercise:
      type: object
      properties:
        _id:
          type: string
        title:
          type: string
        description:
          type: string
        length:
          type: number
        reference_video_uuid:
          type: string
          format: uuid
        input_video_uuid:
          type: string
        graphs:
          type: array
          items:
            type: object
            properties:
              _id:
                type: string
              x_labels:
                type: array
                items:
                  type: string
              y_labels:
                type: array
                items:
                  type: string
              graph_uuid:
                type: string
              points:
                type: object
                properties:
                  a:
                    type: array
                    items:
                      type: string
                  b:
                    type: array
                    items:
                      type: string
                  c:
                    type: array
                    items:
                      type: string

    AddictiveSubstances:
      type: object
      properties:
        cigarettes:
          type: string
          enum: [ uknown, never, sometimes, daily, haveTried ]
        alcohol:
          type: string
          enum: [ uknown, never, sometimes, daily, haveTried ]
        cofee:
          type: string
          enum: [ uknown, never, sometimes, daily, haveTried ]
        soft_drugs:
          type: string
          enum: [ uknown, never, sometimes, daily, haveTried ]
        hard_drugs:
          type: string
          enum: [ uknown, never, sometimes, daily, haveTried ]

    Event:
      type: object
      properties:
        title:
          type: string
        description:
          type: string
        from:
          type: string
          format: date-time
        to:
          type: string
          format: date-time
        attendees:
          type: array
          items:
            type: string

    EventParsed:
      type: object
      properties:
        title:
          type: string
        description:
          type: string
        from:
          type: string
          format: date-time
        to:
          type: string
          format: date-time
        organizer:
          type: object
          properties:
            user_id:
              type: string
            full_name:
              type: string
            email:
              type: string
        attendees:
          type: array
          items:
            $ref: "#/components/schemas/Attendee"
        meet_id:
          type: string
          format: uuid

    Attendee:
      type: object
      properties:
        user_id:
          type: string
        full_name:
          type: string
        email:
          type: string
        rsvp:
          type: string
          enum: [yes, no, unknows, tentative]

    Accessory:
      type: object
      properties:
        title:
          type: string
        description:
          type: string
        price:
          type: number
        vat_rate:
          type: number
        is_enabled:
          type: boolean

    AccessoryCategory:
      type: object
      properties:
        title:
          type: string
        description:
          type: string
        accessories:
          type: array
          items:
            type: string
        is_enabled:
          type: boolean

    AccessoryCategoryParsed:
      type: object
      properties:
        title:
          type: string
        description:
          type: string
        accessories:
          type: array
          items:
            $ref: "#/components/schemas/Accessory"
        is_enabled:
          type: boolean

    Service:
      type: object
      properties:
        title:
          type: string
        description:
          type: string
        price:
          type: number
        vat_rate:
          type: number
        accessory_categories:
          type: array
          items:
            type: string
        is_enabled:
          type: boolean

    ServiceParsed:
      type: object
      properties:
        title:
          type: string
        description:
          type: string
        price:
          type: number
        vat_rate:
          type: number
        accessory_categories:
          type: array
          items:
            $ref: "#/components/schemas/AccessoryCategoryParsed"
        is_enabled:
          type: boolean

    Order:
      type: object
      properties:
        invoicing_information:
          type: object
          properties:
            first_name:
              type: string
            last_name:
              type: string
            email:
              type: string
            phone_number:
              type: string
            address:
              type: object
              properties:
                street:
                  type: string
                street_number:
                  type: string
                city:
                  type: string
                postal_code:
                  type: string
        doctor_id:
          type: string
        recipient_id:
          type: string
        service_id:
          type: string
        accessories:
          type: array
          items:
            type: string

    Doctor:
      type: object
      properties:
        _id:
          type: string
        full_name:
          type: string
        email:
          type: string
        phone_number:
          type: string
        organization_name:
          type: string
        organization_address:
          type: string

    Recipient:
      type: object
      properties:
        _id:
          type: string
        full_name:
          type: string
        email:
          type: string
        phone_number:
          type: string

    OrderItem:
      type: object
      properties:
        type:
          type: string
          enum: [service, accessory]
        title:
          type: string
        description:
          type: string
        price:
          type: number
        vat_rate:
          type: number

    OrderParsed:
      type: object
      properties:
        price:
          type: number
        price_no_vat:
          type: number
        currency:
          type: string
          enum: [CZK, EUR, USD]
        status:
          type: string
          enum: [created, in_progress, done, canceled]
        invoicing_information:
          type: object
          properties:
            first_name:
              type: string
            last_name:
              type: string
            email:
              type: string
            phone_number:
              type: string
            address:
              type: object
              properties:
                street:
                  type: string
                street_number:
                  type: string
                city:
                  type: string
                postal_code:
                  type: string
        doctor:
          $ref: "#/components/schemas/Doctor"
        recipient_id:
          $ref: "#/components/schemas/Recipient"
        items:
          type: array
          items:
            $ref: "#/components/schemas/OrderItem"

    FileMetadata:
      type: object
      properties:
        uuid:
          type: string
        original_filename:
          type: string
        custom_filename:
          type: string
        size:
          type: number
        extension:
          type: string
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
        user_id:
          type: string

    EdgGlycemia:
      allOf:
        - $ref: "#/components/schemas/EdgEnvelope"
        - type: object
          properties:
            data:
              type: object
              properties:
                value:
                  type: number

    EdgTemperature:
      allOf:
        - $ref: "#/components/schemas/EdgEnvelope"
        - type: object
          properties:
            data:
              type: object
              properties:
                value:
                  type: number
                timeline:
                  type: array
                  items:
                    $ref: "#/components/schemas/Timeline"

    EdgOxygenSaturation:
      allOf:
        - $ref: "#/components/schemas/EdgEnvelope"
        - type: object
          properties:
            data:
              type: object
              properties:
                value:
                  type: number
                timeline:
                  type: array
                  items:
                    $ref: "#/components/schemas/Timeline"

    EdgEcg:
      allOf:
        - $ref: "#/components/schemas/EdgEnvelope"
        - type: object
          properties:
            data:
              type: object
              properties:
                file_dcm_uuid:
                  type: string
                file_pdf_uuid:
                  type: string

    EdgEndoscopy:
      allOf:
        - $ref: "#/components/schemas/EdgEnvelope"
        - type: object
          properties:
            data:
              type: object
              properties:
                file_uuid:
                  type: string

    EdgAirPolution:
      allOf:
        - $ref: "#/components/schemas/EdgEnvelope"
        - type: object
          properties:
            data:
              type: object
              properties:
                humidity:
                  type: object
                  properties:
                    avg:
                      type: number
                    min:
                      type: number
                    max:
                      type: number
                pressure:
                  type: object
                  properties:
                    avg:
                      type: number
                    min:
                      type: number
                    max:
                      type: number
                temperature:
                  type: object
                  properties:
                    avg:
                      type: number
                    min:
                      type: number
                    max:
                      type: number
                voc:
                  type: object
                  properties:
                    avg:
                      type: number
                    min:
                      type: number
                    max:
                      type: number

    EdgSleep:
      type: object
      properties:
        edg_type:
          type: string
          example: glycemia
        edg_source:
          type: string
        patient_id:
          type: string
        measurement_start:
          type: string
          format: date-time
        measurement_end:
          type: string
          format: date-time
        data:
          type: object
          properties:
            breathing_disturbances_intensity:
              type: number
            deep_sleep_duration:
              type: number
            duration_to_sleep:
              type: number
            duration_to_wake_up:
              type: number
            light_sleep_duration:
              type: number
            rem_sleep_duration:
              type: number
            sleep_score:
              type: number
            snoring:
              type: number
            snoring_episode_count:
              type: number
            wake_up_count:
              type: number
            wake_up_duration:
              type: number
            heart_rate:
              type: object
              properties:
                avg:
                  type: number
                min:
                  type: number
                max:
                  type: number
            respiration_rate:
              type: object
              properties:
                avg:
                  type: number
                min:
                  type: number
                max:
                  type: number
            heart_rate_timeline:
              type: array
              items:
                type: object
                properties:
                  time:
                    type: number
                  value:
                    type: number
            respiration_rate_timeline:
              type: array
              items:
                type: object
                properties:
                  time:
                    type: number
                  value:
                    type: number
            sleep_phases_timeline:
              type: array
              items:
                type: object
                properties:
                  time:
                    type: number
                  value:
                    type: number

    EdgHeight:
      allOf:
        - $ref: "#/components/schemas/EdgEnvelope"
        - type: object
          properties:
            data:
              type: object
              properties:
                value:
                  type: number

    EdgWeight:
      allOf:
        - $ref: "#/components/schemas/EdgEnvelope"
        - type: object
          properties:
            data:
              type: object
              properties:
                value:
                  type: number

    EdgBloodPressure:
      allOf:
        - $ref: "#/components/schemas/EdgEnvelope"
        - type: object
          properties:
            data:
              type: object
              properties:
                systolic_pressure:
                  type: number
                diastolic_pressure:
                  type: number

    EdgBodyFat:
      allOf:
        - $ref: "#/components/schemas/EdgEnvelope"
        - type: object
          properties:
            data:
              type: object
              properties:
                value:
                  type: number

    EdgEnvelope:
      type: object
      properties:
        edg_type:
          type: string
          example: glycemia
        edg_source:
          type: string
        patient_id:
          type: string
        measured_at:
          type: string
          format: date-time

    Timeline:
      type: object
      properties:
        time:
          type: number
        value:
          type: number

    Anamnesis:
      type: object
      properties:
        personal:
          $ref: "#/components/schemas/PersonalAnamnesis"
        medications:
          type: array
          items:
            $ref: "#/components/schemas/EpidemiologyAnamnesis"
        allergies:
          type: array
          items:
            $ref: "#/components/schemas/Allergen"
        gynaecology:
          $ref: "#/components/schemas/GynaecologyAnamnesis"
        surgeries:
          type: array
          items:
            $ref: "#/components/schemas/SurgeryAnamnesis"
        epidemiology:
          type: array
          items:
            $ref: "#/components/schemas/EpidemiologyAnamnesis"
        family:
          type: array
          items:
            $ref: "#/components/schemas/FamilyMemberAnamnesis"
        work:
          $ref: "#/components/schemas/WorkAnamnesis"
        social:
          $ref: "#/components/schemas/SocialAnamnesis"
        sport:
          $ref: "#/components/schemas/SportAnamnesis"
        generic:
          type: array
          items:
            type: string

    PersonalAnamnesis:
      type: object
      properties:
        date_of_birth:
          type: string
          format: date-time
        sex:
          type: string
        blood_type:
          type: string
        movement_diseases:
          type: array
          items:
            type: string
        movement:
          type: array
          items:
            type: string
        cardiovascular:
          type: array
          items:
            type: string
        immunity:
          type: array
          items:
            type: string
        respiratory:
          type: array
          items:
            type: string
        endocrine:
          type: array
          items:
            type: string
        gastrointestinal:
          type: array
          items:
            type: string
        urogenital:
          type: array
          items:
            type: string
        central_nervous_system:
          type: array
          items:
            type: string
        doctors_note:
          type: string
        patients_complaints:
          type: string

    CheckupHistoryEntry:
      type: object
      properties:
        height:
          type: number
        weight:
          type: number
        systolic_pressure:
          type: number
        diastolic_pressure:
          type: number
        bpm:
          type: number
        cholesterol:
          type: number
        glucose_level:
          type: number
        note:
          type: string
        complaints:
          type: string

    MedicationAnamnesis:
      type: object
      properties:
        medication_id:
          type: string
        dosage:
          type: string
          example: "1-0-1"
        medication_start:
          type: string
          format: date
        medication_end:
          type: string
          format: date
        long_term:
          type: boolean

    Allergen:
      type: array
      items:
        type: string

    GynaecologyAnamnesis:
      type: object
      properties:
        contraception:
          type: string
          example: none
        cervix_cancer_vaccination:
          type: boolean
        last_mammography:
          type: string
          format: date
        other:
          type: string

    MenstruationHistoryEntry:
      type: object
      properties:
        date_from:
          type: string
          format: date
        date_to:
          type: string
          format: date
        issues:
          type: boolean

    Pregnancy:
      type: object
      properties:
        birth_type:
          type: string
        abortion:
          type: boolean
        interruptions:
          type: boolean

    SurgeryAnamnesis:
      type: object
      properties:
        type:
          type: string
        description:
          type: string
        date:
          type: string
          format: date
        note:
          type: string

    EpidemiologyAnamnesis:
      type: object
      properties:
        disease_code:
          type: string
        date:
          type: string
          format: date

    FamilyMemberAnamnesis:
      type: object
      properties:
        date_of_birth:
          type: string
          format: date
        relation:
          type: string
        movement:
          type: array
          items:
            type: string
        cardiovascular:
          type: array
          items:
            type: string
        immunity:
          type: array
          items:
            type: string
        respiratory:
          type: array
          items:
            type: string
        endocrine:
          type: array
          items:
            type: string
        gastrointestinal:
          type: array
          items:
            type: string
        urogenital:
          type: array
          items:
            type: string
        central_nervous_system:
          type: array
          items:
            type: string
        implants:
          type: array
          items:
            type: string
        mental_illnesses:
          type: array
          items:
            type: string
        other:
          type: array
          items:
            type: string

    WorkAnamnesis:
      type: object
      properties:
        status:
          type: string
        type:
          type: string
        is_stressful:
          type: boolean
        field:
          type: string

    SocialAnamnesis:
      type: object
      properties:
        city_size:
          type: string
        house_type:
          type: string
        marital_status:
          type: string
        children_count:
          type: integer
        house_members_count:
          type: integer
        sport_frequency:
          type: string
        sport_difficulty:
          type: string
        sport_level:
          type: string
        rehabilitation:
          type: string
        diet:
          type: string
        pc_usage_frequency:
          type: string

    SportAnamnesis:
      type: object
      properties:
        sport:
          type: string
        discipline:
          type: string
        level:
          type: string
        top_resort:
          type: string
        trainings_per_week:
          type: integer
        personal_record:
          type: string
        this_years_best:
          type: string
        started_sporting_at:
          type: integer

    GlycemiaMeasurement:
      type: object
      properties:
        measured_at:
          type: string
          format: date-time
        value:
          type: number

    OxygenSaturationMeasurement:
      type: object
      properties:
        measured_at:
          type: string
          format: date-time
        value:
          type: number

    EcgMeasurement:
      type: object
      properties:
        measured_at:
          type: string
          format: date-time
        value:
          type: number

    BpmMeasurement:
      type: object
      properties:
        measured_at:
          type: string
          format: date-time
        max:
          type: number
        note:
          type: string

    AirPolutionMeasurement:
      type: object
      properties:
        measured_at:
          type: string
          format: date-time
        humidity:
          type: number
        pressure:
          type: number
        temperature:
          type: number
        voc:
          type: number
        # TODO - asi nemá smysl vkládat ručně, maximálně třeba avg hodnotu pro každou měřenou věc 😔

    TemperatureMeasurement:
      type: object
      properties:
        measured_at:
          type: string
          format: date-time
        value:
          type: number

    WorkoutMeasurement:
      type: object
      properties:
        measurement_start:
          type: string
          format: date-time
        measurement_end:
          type: string
          format: date-time
        value:
          type: number
        exercise:
          type: string
          example: cardio

    EndoscopyMeasurement:
      type: object
      properties:
        measured_at:
          type: string
          format: date-time
        file:
          type: string
          format: binary

    SleepMeasurement:
      type: object
      properties:
        measurement_start:
          type: string
          format: date-time
        measurement_end:
          type: string
          format: date-time
        # TODO - tady asi bude uživatel opisovat data z appky, co všechno může opsat?
        # TODO - teoreticky by mohl zadávat by očko hodnoty jako duration_to_sleep, wakeup_duration ale to asi nemá moc smysl

    CholesterolMeasurement:
      type: object
      properties:
        measured_at:
          type: string
          format: date-time
        value:
          type: number

    HeightMeasurement:
      type: object
      properties:
        measured_at:
          type: string
          format: date-time
        value:
          type: number

    WeightMeasurement:
      type: object
      properties:
        measured_at:
          type: string
          format: date-time
        value:
          type: number

    BloodPressureMeasurement:
      type: object
      properties:
        measured_at:
          type: string
          format: date-time
        systolic_pressure:
          type: number
        diastolic_pressure:
          type: number


    Success:
      type: object
      properties:
        status:
          type: string
          default: ok

    Failure:
      type: object
      properties:
        status:
          type: string
          default: failed
