{ "openapi": "3.1.1", "info": { "title": "Api | helseapi", "version": "1.0.0" }, "servers": [ { "url": "http://localhost:5059/" } ], "paths": { "/api/auth": { "post": { "tags": [ "AuthLogic" ], "description": "Get a connection token", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Connection" } } }, "required": true }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TokenResponse" } } } }, "401": { "description": "Unauthorized" } } } }, "/api/status": { "get": { "tags": [ "AuthLogic" ], "description": "Check if the server install is ready", "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Status" } } } } } } }, "/api/person": { "post": { "tags": [ "PersonLogic" ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PersonCreation" } } }, "required": true }, "responses": { "204": { "description": "No Content" }, "401": { "description": "Unauthorized" } } }, "get": { "tags": [ "PersonLogic" ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/Person" } } } } }, "401": { "description": "Unauthorized" } } }, "put": { "tags": [ "PersonLogic" ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdatePerson" } } }, "required": true }, "responses": { "401": { "description": "Unauthorized" }, "204": { "description": "No Content" } } } }, "/api/person/{personId}": { "delete": { "tags": [ "PersonLogic" ], "parameters": [ { "name": "userId", "in": "query", "required": true, "schema": { "pattern": "^-?(?:0|[1-9]\\d*)$", "type": [ "integer", "string" ], "format": "int64" } } ], "responses": { "204": { "description": "No Content" }, "401": { "description": "Unauthorized" } } } }, "/api/person/caregiver": { "get": { "tags": [ "PersonLogic" ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/Person" } } } } }, "401": { "description": "Unauthorized" } } } }, "/api/person/rights/{personId}": { "post": { "tags": [ "PersonLogic" ], "parameters": [ { "name": "personId", "in": "path", "required": true, "schema": { "pattern": "^-?(?:0|[1-9]\\d*)$", "type": [ "integer", "string" ], "format": "int64" } } ], "requestBody": { "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/Right" } } } }, "required": true }, "responses": { "204": { "description": "No Content" }, "401": { "description": "Unauthorized" } } } }, "/api/patients": { "get": { "tags": [ "PatientsLogic" ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/Person" } } } } }, "401": { "description": "Unauthorized" } } }, "put": { "tags": [ "PatientsLogic" ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdatePatient" } } }, "required": true }, "responses": { "204": { "description": "No Content" }, "401": { "description": "Unauthorized" } } } }, "/api/patients/agenda": { "get": { "tags": [ "PatientsLogic" ], "parameters": [ { "name": "start", "in": "query", "required": true, "schema": { "type": "string", "format": "date-time" } }, { "name": "end", "in": "query", "required": true, "schema": { "type": "string", "format": "date-time" } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/Event" } } } } }, "401": { "description": "Unauthorized" } } } }, "/api/patients/share": { "get": { "tags": [ "PatientsLogic" ], "parameters": [ { "name": "patient", "in": "query", "required": true, "schema": { "pattern": "^-?(?:0|[1-9]\\d*)$", "type": [ "integer", "string" ], "format": "int32" } }, { "name": "caregiver", "in": "query", "required": true, "schema": { "pattern": "^-?(?:0|[1-9]\\d*)$", "type": [ "integer", "string" ], "format": "int32" } }, { "name": "edit", "in": "query", "required": true, "schema": { "type": "boolean" } } ], "responses": { "204": { "description": "No Content" }, "401": { "description": "Unauthorized" } } } }, "/api/metrics/summary": { "get": { "tags": [ "MetricsLogic" ], "parameters": [ { "name": "tile", "in": "query", "required": true, "schema": { "pattern": "^-?(?:0|[1-9]\\d*)$", "type": [ "integer", "string" ], "format": "int32" } }, { "name": "type", "in": "query", "required": true, "schema": { "pattern": "^-?(?:0|[1-9]\\d*)$", "type": [ "integer", "string" ], "format": "int32" } }, { "name": "start", "in": "query", "required": true, "schema": { "type": "string", "format": "date-time" } }, { "name": "end", "in": "query", "required": true, "schema": { "type": "string", "format": "date-time" } }, { "name": "personId", "in": "query", "schema": { "pattern": "^-?(?:0|[1-9]\\d*)$", "type": [ "integer", "string" ], "format": "int64" } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/Metric" } } } } }, "401": { "description": "Unauthorized" } } } }, "/api/metrics": { "get": { "tags": [ "MetricsLogic" ], "parameters": [ { "name": "type", "in": "query", "required": true, "schema": { "pattern": "^-?(?:0|[1-9]\\d*)$", "type": [ "integer", "string" ], "format": "int32" } }, { "name": "start", "in": "query", "required": true, "schema": { "type": "string", "format": "date-time" } }, { "name": "end", "in": "query", "required": true, "schema": { "type": "string", "format": "date-time" } }, { "name": "personId", "in": "query", "schema": { "pattern": "^-?(?:0|[1-9]\\d*)$", "type": [ "integer", "string" ], "format": "int64" } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/Metric" } } } } }, "401": { "description": "Unauthorized" } } }, "post": { "tags": [ "MetricsLogic" ], "parameters": [ { "name": "personId", "in": "query", "schema": { "pattern": "^-?(?:0|[1-9]\\d*)$", "type": [ "integer", "string" ], "format": "int64" } } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateMetric" } } }, "required": true }, "responses": { "204": { "description": "No Content" }, "401": { "description": "Unauthorized" } } }, "put": { "tags": [ "MetricsLogic" ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateMetric" } } }, "required": true }, "responses": { "204": { "description": "No Content" }, "401": { "description": "Unauthorized" } } } }, "/api/metrics/{id}": { "delete": { "tags": [ "MetricsLogic" ], "parameters": [ { "name": "id", "in": "path", "required": true, "schema": { "pattern": "^-?(?:0|[1-9]\\d*)$", "type": [ "integer", "string" ], "format": "int64" } } ], "responses": { "204": { "description": "No Content" }, "401": { "description": "Unauthorized" } } } }, "/api/metrics/type": { "post": { "tags": [ "MetricsLogic" ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MetricType" } } }, "required": true }, "responses": { "204": { "description": "No Content" }, "401": { "description": "Unauthorized" } } }, "put": { "tags": [ "MetricsLogic" ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MetricType" } } }, "required": true }, "responses": { "204": { "description": "No Content" }, "401": { "description": "Unauthorized" } } }, "get": { "tags": [ "MetricsLogic" ], "parameters": [ { "name": "all", "in": "query", "schema": { "type": "boolean" } }, { "name": "group", "in": "query", "schema": { "pattern": "^-?(?:0|[1-9]\\d*)$", "type": [ "integer", "string" ], "format": "int64" } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/MetricType" } } } } }, "401": { "description": "Unauthorized" } } } }, "/api/metrics/type/{id}": { "delete": { "tags": [ "MetricsLogic" ], "parameters": [ { "name": "id", "in": "path", "required": true, "schema": { "pattern": "^-?(?:0|[1-9]\\d*)$", "type": [ "integer", "string" ], "format": "int64" } } ], "responses": { "204": { "description": "No Content" }, "401": { "description": "Unauthorized" } } } }, "/api/metrics/type/groups": { "post": { "tags": [ "MetricsLogic" ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MetricGroup" } } }, "required": true }, "responses": { "204": { "description": "No Content" }, "401": { "description": "Unauthorized" } } }, "put": { "tags": [ "MetricsLogic" ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MetricGroup" } } }, "required": true }, "responses": { "204": { "description": "No Content" }, "401": { "description": "Unauthorized" } } }, "get": { "tags": [ "MetricsLogic" ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/MetricGroup" } } } } }, "401": { "description": "Unauthorized" } } } }, "/api/metrics/type/groups/{id}": { "delete": { "tags": [ "MetricsLogic" ], "parameters": [ { "name": "id", "in": "path", "required": true, "schema": { "pattern": "^-?(?:0|[1-9]\\d*)$", "type": [ "integer", "string" ], "format": "int64" } } ], "responses": { "204": { "description": "No Content" }, "401": { "description": "Unauthorized" } } } }, "/api/events/summary": { "get": { "tags": [ "EventsLogic" ], "parameters": [ { "name": "type", "in": "query", "required": true, "schema": { "pattern": "^-?(?:0|[1-9]\\d*)$", "type": [ "integer", "string" ], "format": "int32" } }, { "name": "start", "in": "query", "required": true, "schema": { "type": "string", "format": "date-time" } }, { "name": "end", "in": "query", "required": true, "schema": { "type": "string", "format": "date-time" } }, { "name": "personId", "in": "query", "schema": { "pattern": "^-?(?:0|[1-9]\\d*)$", "type": [ "integer", "string" ], "format": "int64" } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/EventSummary" } } } } }, "401": { "description": "Unauthorized" } } } }, "/api/events": { "get": { "tags": [ "EventsLogic" ], "parameters": [ { "name": "type", "in": "query", "required": true, "schema": { "pattern": "^-?(?:0|[1-9]\\d*)$", "type": [ "integer", "string" ], "format": "int32" } }, { "name": "start", "in": "query", "required": true, "schema": { "type": "string", "format": "date-time" } }, { "name": "end", "in": "query", "required": true, "schema": { "type": "string", "format": "date-time" } }, { "name": "personId", "in": "query", "schema": { "pattern": "^-?(?:0|[1-9]\\d*)$", "type": [ "integer", "string" ], "format": "int64" } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/Event" } } } } }, "401": { "description": "Unauthorized" } } }, "post": { "tags": [ "EventsLogic" ], "parameters": [ { "name": "personId", "in": "query", "schema": { "pattern": "^-?(?:0|[1-9]\\d*)$", "type": [ "integer", "string" ], "format": "int64" } } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateEvent" } } }, "required": true }, "responses": { "204": { "description": "No Content" }, "401": { "description": "Unauthorized" } } }, "put": { "tags": [ "EventsLogic" ], "parameters": [ { "name": "personId", "in": "query", "schema": { "pattern": "^-?(?:0|[1-9]\\d*)$", "type": [ "integer", "string" ], "format": "int64" } } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateEvent" } } }, "required": true }, "responses": { "204": { "description": "No Content" }, "401": { "description": "Unauthorized" } } } }, "/api/events/{id}": { "delete": { "tags": [ "EventsLogic" ], "parameters": [ { "name": "id", "in": "path", "required": true, "schema": { "pattern": "^-?(?:0|[1-9]\\d*)$", "type": [ "integer", "string" ], "format": "int64" } } ], "responses": { "204": { "description": "No Content" }, "401": { "description": "Unauthorized" } } } }, "/api/events/type": { "post": { "tags": [ "EventsLogic" ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/EventType" } } }, "required": true }, "responses": { "204": { "description": "No Content" }, "401": { "description": "Unauthorized" } } }, "put": { "tags": [ "EventsLogic" ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/EventType" } } }, "required": true }, "responses": { "204": { "description": "No Content" }, "401": { "description": "Unauthorized" } } }, "get": { "tags": [ "EventsLogic" ], "parameters": [ { "name": "all", "in": "query", "schema": { "type": "boolean" } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/EventType" } } } } }, "401": { "description": "Unauthorized" } } } }, "/api/events/type/{id}": { "delete": { "tags": [ "EventsLogic" ], "parameters": [ { "name": "id", "in": "path", "required": true, "schema": { "pattern": "^-?(?:0|[1-9]\\d*)$", "type": [ "integer", "string" ], "format": "int64" } } ], "responses": { "204": { "description": "No Content" }, "401": { "description": "Unauthorized" } } } }, "/api/treatment": { "post": { "tags": [ "TreatmentLogic" ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateTreatment" } } }, "required": true }, "responses": { "204": { "description": "No Content" }, "401": { "description": "Unauthorized" } } }, "get": { "tags": [ "TreatmentLogic" ], "parameters": [ { "name": "start", "in": "query", "required": true, "schema": { "type": "string", "format": "date-time" } }, { "name": "end", "in": "query", "required": true, "schema": { "type": "string", "format": "date-time" } }, { "name": "personId", "in": "query", "schema": { "pattern": "^-?(?:0|[1-9]\\d*)$", "type": [ "integer", "string" ], "format": "int64" } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/Treatment" } } } } }, "401": { "description": "Unauthorized" } } } }, "/api/treatment/type": { "get": { "tags": [ "TreatmentLogic" ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/EventType" } } } } }, "401": { "description": "Unauthorized" } } } }, "/api/admin/settings/oauth": { "post": { "tags": [ "SettingsLogic" ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Oauth" } } }, "required": true }, "responses": { "204": { "description": "No Content" }, "401": { "description": "Unauthorized" } } }, "get": { "tags": [ "SettingsLogic" ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Oauth" } } } }, "401": { "description": "Unauthorized" } } } }, "/api/admin/settings/proxy": { "post": { "tags": [ "SettingsLogic" ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Proxy" } } }, "required": true }, "responses": { "204": { "description": "No Content" }, "401": { "description": "Unauthorized" } } }, "get": { "tags": [ "SettingsLogic" ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Proxy" } } } }, "401": { "description": "Unauthorized" } } } }, "/api/admin/settings/smtp": { "post": { "tags": [ "SettingsLogic" ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Smtp" } } }, "required": true }, "responses": { "204": { "description": "No Content" }, "401": { "description": "Unauthorized" } } }, "get": { "tags": [ "SettingsLogic" ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Smtp" } } } }, "401": { "description": "Unauthorized" } } } }, "/api/admin/settings/gotify": { "get": { "tags": [ "SettingsLogic" ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Gotify" } } } }, "401": { "description": "Unauthorized" } } }, "post": { "tags": [ "SettingsLogic" ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Gotify" } } }, "required": true }, "responses": { "204": { "description": "No Content" }, "401": { "description": "Unauthorized" } } } }, "/api/admin/stats/users": { "get": { "tags": [ "AdminLogic" ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UserStats" } } } }, "401": { "description": "Unauthorized" } } } }, "/api/admin/stats/events": { "get": { "tags": [ "AdminLogic" ], "parameters": [ { "name": "start", "in": "query", "required": true, "schema": { "type": "string", "format": "date-time" } }, { "name": "end", "in": "query", "required": true, "schema": { "type": "string", "format": "date-time" } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/EventStats" } } } }, "401": { "description": "Unauthorized" } } } }, "/api/admin/stats/metrics": { "get": { "tags": [ "AdminLogic" ], "parameters": [ { "name": "start", "in": "query", "required": true, "schema": { "type": "string", "format": "date-time" } }, { "name": "end", "in": "query", "required": true, "schema": { "type": "string", "format": "date-time" } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/EventStats" } } } }, "401": { "description": "Unauthorized" } } } }, "/api/import/types": { "get": { "tags": [ "ImportLogic" ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/FileType" } } } } }, "401": { "description": "Unauthorized" } } } }, "/api/import/{type}": { "post": { "tags": [ "ImportLogic" ], "parameters": [ { "name": "type", "in": "path", "required": true, "schema": { "pattern": "^-?(?:0|[1-9]\\d*)$", "type": [ "integer", "string" ], "format": "int32" } } ], "requestBody": { "content": { "multipart/form-data": { "schema": { "required": [ "file" ], "type": "object", "properties": { "file": { "$ref": "#/components/schemas/IFormFile" } } } } }, "required": true }, "responses": { "204": { "description": "No Content" }, "401": { "description": "Unauthorized" } } } }, "/api/import": { "post": { "tags": [ "ImportLogic" ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ImportData" } } }, "required": true }, "responses": { "204": { "description": "No Content" }, "401": { "description": "Unauthorized" } } } } }, "components": { "schemas": { "Connection": { "required": [ "user", "password", "issuer", "redirect" ], "type": "object", "properties": { "user": { "type": "string" }, "password": { "type": "string" }, "issuer": { "type": [ "null", "string" ] }, "redirect": { "type": [ "null", "string" ] } } }, "CountByDate": { "required": [ "date", "count" ], "type": "object", "properties": { "date": { "type": "string", "format": "date-time" }, "count": { "pattern": "^-?(?:0|[1-9]\\d*)$", "type": [ "integer", "string" ], "format": "int32" } } }, "CountRecord": { "required": [ "id", "count" ], "type": "object", "properties": { "id": { "type": "string" }, "count": { "pattern": "^-?(?:0|[1-9]\\d*)$", "type": [ "integer", "string" ], "format": "int32" } } }, "CreateEvent": { "type": "object", "properties": { "type": { "pattern": "^-?(?:0|[1-9]\\d*)$", "type": [ "integer", "string" ], "format": "int32" }, "description": { "type": [ "null", "string" ] }, "start": { "type": "string", "format": "date-time" }, "stop": { "type": "string", "format": "date-time" }, "tag": { "type": [ "null", "string" ] }, "notificationTime": { "type": [ "null", "string" ], "format": "date-time" } } }, "CreateMetric": { "required": [ "value" ], "type": "object", "properties": { "date": { "type": "string", "format": "date-time" }, "value": { "type": "string" }, "tag": { "type": [ "null", "string" ] }, "type": { "pattern": "^-?(?:0|[1-9]\\d*)$", "type": [ "integer", "string" ], "format": "int64" }, "source": { "$ref": "#/components/schemas/FileTypes" } } }, "CreateTreatment": { "type": "object", "properties": { "events": { "type": "array", "items": { "$ref": "#/components/schemas/CreateEvent" } }, "personId": { "pattern": "^-?(?:0|[1-9]\\d*)$", "type": [ "null", "integer", "string" ], "format": "int64" } } }, "Event": { "type": "object", "properties": { "user": { "pattern": "^-?(?:0|[1-9]\\d*)$", "type": [ "integer", "string" ], "format": "int64" }, "file": { "pattern": "^-?(?:0|[1-9]\\d*)$", "type": [ "null", "integer", "string" ], "format": "int64" }, "treatment": { "pattern": "^-?(?:0|[1-9]\\d*)$", "type": [ "null", "integer", "string" ], "format": "int64" }, "id": { "pattern": "^-?(?:0|[1-9]\\d*)$", "type": [ "integer", "string" ], "format": "int64" }, "person": { "pattern": "^-?(?:0|[1-9]\\d*)$", "type": [ "integer", "string" ], "format": "int64" }, "valid": { "type": "boolean" }, "address": { "pattern": "^-?(?:0|[1-9]\\d*)$", "type": [ "null", "integer", "string" ], "format": "int64" }, "type": { "pattern": "^-?(?:0|[1-9]\\d*)$", "type": [ "integer", "string" ], "format": "int32" }, "description": { "type": [ "null", "string" ] }, "start": { "type": "string", "format": "date-time" }, "stop": { "type": "string", "format": "date-time" }, "tag": { "type": [ "null", "string" ] }, "notificationTime": { "type": [ "null", "string" ], "format": "date-time" } } }, "EventStats": { "required": [ "events", "eventCounts" ], "type": "object", "properties": { "events": { "type": "array", "items": { "$ref": "#/components/schemas/CountByDate" } }, "eventCounts": { "type": "array", "items": { "$ref": "#/components/schemas/CountRecord" } } } }, "EventSummary": { "required": [ "data" ], "type": "object", "properties": { "data": { "type": "object", "additionalProperties": { "pattern": "^-?(?:0|[1-9]\\d*)$", "type": [ "integer", "string" ], "format": "int32" } } } }, "EventType": { "required": [ "name" ], "type": "object", "properties": { "id": { "pattern": "^-?(?:0|[1-9]\\d*)$", "type": [ "integer", "string" ], "format": "int64" }, "name": { "type": "string" }, "description": { "type": [ "null", "string" ] }, "standAlone": { "type": "boolean" }, "userEditable": { "type": "boolean" }, "visible": { "type": "boolean" } } }, "FileType": { "required": [ "type", "name" ], "type": "object", "properties": { "type": { "pattern": "^-?(?:0|[1-9]\\d*)$", "type": [ "integer", "string" ], "format": "int32" }, "name": { "type": [ "null", "string" ] } } }, "FileTypes": { "enum": [ "None", "RedmiWatch", "GoogleHealthConnect", "Clue" ] }, "Gotify": { "type": "object", "properties": { "enabled": { "type": "boolean" }, "url": { "type": [ "null", "string" ] }, "token": { "type": [ "null", "string" ] } } }, "IFormFile": { "type": "string", "format": "binary" }, "ImportData": { "type": "object", "properties": { "metrics": { "type": "array", "items": { "$ref": "#/components/schemas/CreateMetric" } }, "events": { "type": "array", "items": { "$ref": "#/components/schemas/CreateEvent" } } } }, "Metric": { "required": [ "value" ], "type": "object", "properties": { "id": { "pattern": "^-?(?:0|[1-9]\\d*)$", "type": [ "integer", "string" ], "format": "int64" }, "person": { "pattern": "^-?(?:0|[1-9]\\d*)$", "type": [ "integer", "string" ], "format": "int64" }, "user": { "pattern": "^-?(?:0|[1-9]\\d*)$", "type": [ "integer", "string" ], "format": "int64" }, "date": { "type": "string", "format": "date-time" }, "value": { "type": "string" }, "tag": { "type": [ "null", "string" ] }, "type": { "pattern": "^-?(?:0|[1-9]\\d*)$", "type": [ "integer", "string" ], "format": "int64" }, "source": { "$ref": "#/components/schemas/FileTypes" } } }, "MetricDataType": { "enum": [ "Text", "Number" ] }, "MetricGroup": { "required": [ "name", "description" ], "type": "object", "properties": { "name": { "type": "string" }, "description": { "type": "string" }, "showOnDashboard": { "type": "boolean" }, "showTitle": { "type": "boolean" }, "id": { "pattern": "^-?(?:0|[1-9]\\d*)$", "type": [ "integer", "string" ], "format": "int64" } } }, "MetricSummary": { "enum": [ "Latest", "Sum", "Mean" ] }, "MetricType": { "required": [ "name" ], "type": "object", "properties": { "name": { "type": "string" }, "unit": { "type": [ "null", "string" ] }, "summaryType": { "$ref": "#/components/schemas/MetricSummary" }, "description": { "type": [ "null", "string" ] }, "type": { "$ref": "#/components/schemas/MetricDataType" }, "id": { "pattern": "^-?(?:0|[1-9]\\d*)$", "type": [ "integer", "string" ], "format": "int64" }, "userEditable": { "type": "boolean" }, "visible": { "type": "boolean" }, "showOnDashboard": { "type": "boolean" }, "groupId": { "pattern": "^-?(?:0|[1-9]\\d*)$", "type": [ "integer", "string" ], "format": "int64" } } }, "Oauth": { "type": "object", "properties": { "enabled": { "type": "boolean" }, "providers": { "type": "array", "items": { "$ref": "#/components/schemas/OauthProvider" } } } }, "OauthConnection": { "required": [ "name", "url", "clientId", "autoLogin" ], "type": "object", "properties": { "name": { "type": "string" }, "url": { "type": "string" }, "clientId": { "type": "string" }, "autoLogin": { "type": "boolean" } } }, "OauthProvider": { "required": [ "name", "clientId", "clientSecret", "url", "tokenurl", "claimsUrl" ], "type": "object", "properties": { "name": { "type": "string" }, "autoRegister": { "type": "boolean" }, "autoLogin": { "type": "boolean" }, "clientId": { "type": "string" }, "clientSecret": { "type": "string" }, "url": { "type": "string" }, "tokenurl": { "type": "string" }, "claimsUrl": { "type": "string" } } }, "Person": { "type": "object", "properties": { "id": { "pattern": "^-?(?:0|[1-9]\\d*)$", "type": [ "integer", "string" ], "format": "int64" }, "userName": { "type": [ "null", "string" ] }, "rights": { "type": "array", "items": { "$ref": "#/components/schemas/Right" } }, "types": { "type": "array", "items": { "$ref": "#/components/schemas/UserType" } }, "created": { "type": "string", "format": "date-time" }, "name": { "type": [ "null", "string" ] }, "surname": { "type": [ "null", "string" ] }, "identifier": { "type": [ "null", "string" ] }, "birth": { "type": [ "null", "string" ], "format": "date-time" }, "profilePicture": { "type": [ "null", "string" ], "format": "byte" }, "email": { "type": [ "null", "string" ] }, "phone": { "type": [ "null", "string" ] } } }, "PersonCreation": { "type": "object", "properties": { "userName": { "type": [ "null", "string" ] }, "password": { "type": [ "null", "string" ] }, "types": { "type": "array", "items": { "$ref": "#/components/schemas/UserType" } }, "name": { "type": [ "null", "string" ] }, "surname": { "type": [ "null", "string" ] }, "identifier": { "type": [ "null", "string" ] }, "birth": { "type": [ "null", "string" ], "format": "date-time" }, "profilePicture": { "type": [ "null", "string" ], "format": "byte" }, "email": { "type": [ "null", "string" ] }, "phone": { "type": [ "null", "string" ] } } }, "Proxy": { "type": "object", "properties": { "proxyAuth": { "type": "boolean" }, "autoRegister": { "type": "boolean" }, "header": { "type": [ "null", "string" ] } } }, "Right": { "type": "object", "properties": { "personId": { "pattern": "^-?(?:0|[1-9]\\d*)$", "type": [ "null", "integer", "string" ], "format": "int64" }, "userId": { "pattern": "^-?(?:0|[1-9]\\d*)$", "type": [ "integer", "string" ], "format": "int64" }, "start": { "type": "string", "format": "date-time" }, "stop": { "type": [ "null", "string" ], "format": "date-time" }, "type": { "$ref": "#/components/schemas/RightType" } } }, "RightType": { "enum": [ "View", "Edit" ] }, "Smtp": { "type": "object", "properties": { "enabled": { "type": "boolean" }, "smtpHost": { "type": "string" }, "smtpPort": { "pattern": "^-?(?:0|[1-9]\\d*)$", "type": [ "integer", "string" ], "format": "int32" }, "enableSsl": { "type": "boolean" }, "fromEmail": { "type": "string" }, "userName": { "type": [ "null", "string" ] }, "password": { "type": [ "null", "string" ] } } }, "Status": { "required": [ "init", "externalAuth", "error", "oauths" ], "type": "object", "properties": { "init": { "type": "boolean" }, "externalAuth": { "type": "boolean" }, "error": { "type": [ "null", "string" ] }, "oauths": { "type": "array", "items": { "$ref": "#/components/schemas/OauthConnection" } } } }, "TokenResponse": { "required": [ "accessToken", "refreshToken" ], "type": "object", "properties": { "accessToken": { "type": "string" }, "refreshToken": { "type": "string" } } }, "Treatment": { "type": "object", "properties": { "events": { "type": "array", "items": { "$ref": "#/components/schemas/Event" } }, "type": { "$ref": "#/components/schemas/TreatmentType" } } }, "TreatmentType": { "enum": [ "Care" ] }, "UpdateEvent": { "type": "object", "properties": { "id": { "pattern": "^-?(?:0|[1-9]\\d*)$", "type": [ "integer", "string" ], "format": "int64" }, "type": { "pattern": "^-?(?:0|[1-9]\\d*)$", "type": [ "integer", "string" ], "format": "int32" }, "description": { "type": [ "null", "string" ] }, "start": { "type": "string", "format": "date-time" }, "stop": { "type": "string", "format": "date-time" }, "tag": { "type": [ "null", "string" ] }, "notificationTime": { "type": [ "null", "string" ], "format": "date-time" } } }, "UpdateMetric": { "required": [ "value" ], "type": "object", "properties": { "id": { "pattern": "^-?(?:0|[1-9]\\d*)$", "type": [ "integer", "string" ], "format": "int64" }, "date": { "type": "string", "format": "date-time" }, "value": { "type": "string" }, "tag": { "type": [ "null", "string" ] }, "type": { "pattern": "^-?(?:0|[1-9]\\d*)$", "type": [ "integer", "string" ], "format": "int64" }, "source": { "$ref": "#/components/schemas/FileTypes" } } }, "UpdatePatient": { "type": "object", "properties": { "id": { "pattern": "^-?(?:0|[1-9]\\d*)$", "type": [ "integer", "string" ], "format": "int64" }, "birth": { "type": [ "null", "string" ], "format": "date-time" }, "profilePicture": { "type": [ "null", "string" ], "format": "byte" }, "name": { "type": [ "null", "string" ] }, "surname": { "type": [ "null", "string" ] }, "identifier": { "type": [ "null", "string" ] } } }, "UpdatePerson": { "type": "object", "properties": { "id": { "pattern": "^-?(?:0|[1-9]\\d*)$", "type": [ "integer", "string" ], "format": "int64" }, "types": { "type": [ "null", "array" ], "items": { "$ref": "#/components/schemas/UserType" } }, "name": { "type": [ "null", "string" ] }, "surname": { "type": [ "null", "string" ] }, "identifier": { "type": [ "null", "string" ] }, "birth": { "type": [ "null", "string" ], "format": "date-time" }, "profilePicture": { "type": [ "null", "string" ], "format": "byte" }, "email": { "type": [ "null", "string" ] }, "phone": { "type": [ "null", "string" ] } } }, "UserStats": { "required": [ "userCount" ], "type": "object", "properties": { "userCount": { "type": "array", "items": { "$ref": "#/components/schemas/CountRecord" } } } }, "UserType": { "enum": [ "Admin", "Caregiver", "User" ] } } }, "tags": [ { "name": "AuthLogic" }, { "name": "PersonLogic" }, { "name": "PatientsLogic" }, { "name": "MetricsLogic" }, { "name": "EventsLogic" }, { "name": "TreatmentLogic" }, { "name": "SettingsLogic" }, { "name": "AdminLogic" }, { "name": "ImportLogic" } ] }