diff --git a/backend/api/inputs.py b/backend/api/inputs.py index 566c9d2c..098a715e 100644 --- a/backend/api/inputs.py +++ b/backend/api/inputs.py @@ -222,3 +222,53 @@ class UpdateSavedViewInput: related_sort_definition: str | None = None related_parameters: str | None = None visibility: SavedViewVisibility | None = None + + +@strawberry.enum +class TaskPresetScope(Enum): + PERSONAL = "PERSONAL" + GLOBAL = "GLOBAL" + + +@strawberry.input +class TaskGraphNodeInput: + node_id: str + title: str + description: str | None = None + priority: TaskPriority | None = None + estimated_time: int | None = None + + +@strawberry.input +class TaskGraphEdgeInput: + from_node_id: str + to_node_id: str + + +@strawberry.input +class TaskGraphInput: + nodes: list[TaskGraphNodeInput] + edges: list[TaskGraphEdgeInput] + + +@strawberry.input +class CreateTaskPresetInput: + name: str + key: str | None = None + scope: TaskPresetScope + graph: TaskGraphInput + + +@strawberry.input +class UpdateTaskPresetInput: + name: str | None = None + key: str | None = None + graph: TaskGraphInput | None = None + + +@strawberry.input +class ApplyTaskGraphInput: + patient_id: strawberry.ID + preset_id: strawberry.ID | None = None + graph: TaskGraphInput | None = None + assign_to_current_user: bool = False diff --git a/backend/api/resolvers/__init__.py b/backend/api/resolvers/__init__.py index 45d127cc..8a050e1b 100644 --- a/backend/api/resolvers/__init__.py +++ b/backend/api/resolvers/__init__.py @@ -7,6 +7,7 @@ from .query_metadata import QueryMetadataQuery from .saved_view import SavedViewMutation, SavedViewQuery from .task import TaskMutation, TaskQuery, TaskSubscription +from .task_preset import TaskPresetMutation, TaskPresetQuery from .user import UserMutation, UserQuery @@ -14,6 +15,7 @@ class Query( PatientQuery, TaskQuery, + TaskPresetQuery, LocationQuery, PropertyDefinitionQuery, UserQuery, @@ -28,6 +30,7 @@ class Query( class Mutation( PatientMutation, TaskMutation, + TaskPresetMutation, PropertyDefinitionMutation, LocationMutation, UserMutation, diff --git a/backend/api/resolvers/task.py b/backend/api/resolvers/task.py index fe8e8717..ae7a4616 100644 --- a/backend/api/resolvers/task.py +++ b/backend/api/resolvers/task.py @@ -1,10 +1,18 @@ from collections.abc import AsyncGenerator +from typing import Any import strawberry from api.audit import audit_log from api.context import Info from api.errors import raise_forbidden -from api.inputs import CreateTaskInput, PaginationInput, PatientState, SortDirection, UpdateTaskInput +from api.inputs import ( + ApplyTaskGraphInput, + CreateTaskInput, + PaginationInput, + PatientState, + SortDirection, + UpdateTaskInput, +) from api.query.execute import count_unified_query, is_unset, unified_list_query from api.query.inputs import ( QueryFilterClauseInput, @@ -17,8 +25,16 @@ from api.services.checksum import validate_checksum from api.services.datetime import normalize_datetime_to_utc from api.services.property import PropertyService +from api.services.task_graph import ( + apply_task_graph_to_patient, + graph_dict_from_preset_inputs, + insert_task_dependencies, + replace_incoming_task_dependencies, + validate_task_graph_dict, +) from api.types.task import TaskType from database import models +from database.models.task_preset import TaskPresetScope as DbTaskPresetScope from graphql import GraphQLError from sqlalchemy import and_, exists, or_, select from sqlalchemy.orm import aliased, selectinload @@ -751,6 +767,14 @@ async def create_task(self, info: Info, data: CreateTaskInput) -> TaskType: "payload": {"task_id": task.id, "task_title": task.title}, }, ) + if data.previous_task_ids: + await insert_task_dependencies( + info.context.db, + task.id, + [str(x) for x in data.previous_task_ids], + str(task.patient_id), + ) + await info.context.db.commit() return task @strawberry.mutation @@ -845,7 +869,7 @@ async def update_task( "task", ) - return await BaseMutationResolver.update_and_notify( + result = await BaseMutationResolver.update_and_notify( info, task, models.Task, @@ -853,6 +877,15 @@ async def update_task( "patient", task.patient_id, ) + if data.previous_task_ids is not None: + await replace_incoming_task_dependencies( + info.context.db, + str(id), + [str(x) for x in data.previous_task_ids], + str(task.patient_id), + ) + await info.context.db.commit() + return result @staticmethod async def _update_task_field( @@ -1005,6 +1038,68 @@ async def reopen_task(self, info: Info, id: strawberry.ID) -> TaskType: lambda task: setattr(task, "done", False), ) + @strawberry.mutation + @audit_log("apply_task_graph") + async def apply_task_graph( + self, + info: Info, + data: ApplyTaskGraphInput, + ) -> list[TaskType]: + user = info.context.user + if not user: + raise GraphQLError( + "Not authenticated", + extensions={"code": "UNAUTHENTICATED"}, + ) + auth_service = AuthorizationService(info.context.db) + if not await auth_service.can_access_patient_id( + user, + data.patient_id, + info.context, + ): + raise_forbidden() + has_preset = data.preset_id is not None + has_graph = data.graph is not None + if has_preset == has_graph: + raise GraphQLError( + "Provide exactly one of presetId or graph", + extensions={"code": "BAD_REQUEST"}, + ) + graph_dict: dict[str, Any] + if data.preset_id: + pr = await info.context.db.execute( + select(models.TaskPreset).where( + models.TaskPreset.id == data.preset_id, + ), + ) + preset = pr.scalars().first() + if not preset: + raise GraphQLError( + "Preset not found", + extensions={"code": "NOT_FOUND"}, + ) + if ( + preset.scope == DbTaskPresetScope.PERSONAL.value + and preset.owner_user_id != user.id + ): + raise_forbidden() + graph_dict = preset.graph_json + else: + graph_dict = graph_dict_from_preset_inputs( + data.graph.nodes, + data.graph.edges, + ) + validate_task_graph_dict(graph_dict) + assignee_id = user.id if data.assign_to_current_user else None + source_preset_id = str(data.preset_id) if data.preset_id else None + return await apply_task_graph_to_patient( + info.context.db, + str(data.patient_id), + graph_dict, + assignee_id, + source_preset_id, + ) + @strawberry.mutation @audit_log("delete_task") async def delete_task(self, info: Info, id: strawberry.ID) -> bool: diff --git a/backend/api/resolvers/task_preset.py b/backend/api/resolvers/task_preset.py new file mode 100644 index 00000000..eb606573 --- /dev/null +++ b/backend/api/resolvers/task_preset.py @@ -0,0 +1,248 @@ +import re +import uuid + +import strawberry +from api.context import Info +from api.errors import raise_forbidden +from api.inputs import CreateTaskPresetInput, UpdateTaskPresetInput +from api.services.task_graph import ( + graph_dict_from_preset_inputs, + validate_task_graph_dict, +) +from api.types.task_preset import TaskPresetType, task_preset_type_from_model +from database import models +from database.models.task_preset import TaskPresetScope as DbTaskPresetScope +from graphql import GraphQLError +from sqlalchemy import and_, or_, select + + +def _slugify(name: str) -> str: + s = re.sub(r"[^a-zA-Z0-9]+", "-", name.strip()).lower().strip("-") + return s or "preset" + + +async def _key_is_available( + db, + key: str, + exclude_id: str | None = None, +) -> bool: + q = select(models.TaskPreset).where(models.TaskPreset.key == key) + if exclude_id: + q = q.where(models.TaskPreset.id != exclude_id) + r = await db.execute(q) + return r.scalars().first() is None + + +async def _generate_unique_key(db, name: str) -> str: + base = f"{_slugify(name)}-{uuid.uuid4().hex[:8]}" + if await _key_is_available(db, base): + return base + for _ in range(20): + candidate = f"{_slugify(name)}-{uuid.uuid4().hex[:8]}" + if await _key_is_available(db, candidate): + return candidate + raise GraphQLError( + "Could not allocate a unique preset key", + extensions={"code": "BAD_REQUEST"}, + ) + + +def _can_edit_preset( + preset: models.TaskPreset, + user_id: str, +) -> bool: + if preset.scope == DbTaskPresetScope.PERSONAL.value: + return preset.owner_user_id == user_id + return True + + +def _can_delete_preset( + preset: models.TaskPreset, + user_id: str, +) -> bool: + if preset.scope == DbTaskPresetScope.PERSONAL.value: + return preset.owner_user_id == user_id + return True + + +@strawberry.type +class TaskPresetQuery: + @strawberry.field + async def task_presets(self, info: Info) -> list[TaskPresetType]: + user = info.context.user + if not user: + raise GraphQLError( + "Not authenticated", + extensions={"code": "UNAUTHENTICATED"}, + ) + q = ( + select(models.TaskPreset) + .where( + or_( + models.TaskPreset.scope == DbTaskPresetScope.GLOBAL.value, + and_( + models.TaskPreset.scope == DbTaskPresetScope.PERSONAL.value, + models.TaskPreset.owner_user_id == user.id, + ), + ), + ) + .order_by(models.TaskPreset.name) + ) + r = await info.context.db.execute(q) + rows = r.scalars().all() + return [task_preset_type_from_model(p) for p in rows] + + @strawberry.field + async def task_preset( + self, + info: Info, + id: strawberry.ID, + ) -> TaskPresetType | None: + user = info.context.user + if not user: + raise GraphQLError( + "Not authenticated", + extensions={"code": "UNAUTHENTICATED"}, + ) + r = await info.context.db.execute( + select(models.TaskPreset).where(models.TaskPreset.id == id), + ) + preset = r.scalars().first() + if not preset: + return None + if preset.scope == DbTaskPresetScope.PERSONAL.value and preset.owner_user_id != user.id: + raise_forbidden() + return task_preset_type_from_model(preset) + + @strawberry.field + async def task_preset_by_key( + self, + info: Info, + key: str, + ) -> TaskPresetType | None: + user = info.context.user + if not user: + raise GraphQLError( + "Not authenticated", + extensions={"code": "UNAUTHENTICATED"}, + ) + r = await info.context.db.execute( + select(models.TaskPreset).where(models.TaskPreset.key == key), + ) + preset = r.scalars().first() + if not preset: + return None + if preset.scope == DbTaskPresetScope.PERSONAL.value and preset.owner_user_id != user.id: + raise_forbidden() + return task_preset_type_from_model(preset) + + +@strawberry.type +class TaskPresetMutation: + @strawberry.mutation + async def create_task_preset( + self, + info: Info, + data: CreateTaskPresetInput, + ) -> TaskPresetType: + user = info.context.user + if not user: + raise GraphQLError( + "Not authenticated", + extensions={"code": "UNAUTHENTICATED"}, + ) + graph_dict = graph_dict_from_preset_inputs(data.graph.nodes, data.graph.edges) + validate_task_graph_dict(graph_dict) + scope_val = data.scope.value + if scope_val == DbTaskPresetScope.PERSONAL.value: + owner_id = user.id + else: + owner_id = None + if data.key: + if not await _key_is_available(info.context.db, data.key): + raise GraphQLError( + "Preset key already exists", + extensions={"code": "BAD_REQUEST"}, + ) + key = data.key + else: + key = await _generate_unique_key(info.context.db, data.name) + preset = models.TaskPreset( + name=data.name, + key=key, + scope=scope_val, + owner_user_id=owner_id, + graph_json=graph_dict, + ) + info.context.db.add(preset) + await info.context.db.commit() + await info.context.db.refresh(preset) + return task_preset_type_from_model(preset) + + @strawberry.mutation + async def update_task_preset( + self, + info: Info, + id: strawberry.ID, + data: UpdateTaskPresetInput, + ) -> TaskPresetType: + user = info.context.user + if not user: + raise GraphQLError( + "Not authenticated", + extensions={"code": "UNAUTHENTICATED"}, + ) + r = await info.context.db.execute( + select(models.TaskPreset).where(models.TaskPreset.id == id), + ) + preset = r.scalars().first() + if not preset: + raise GraphQLError( + "Preset not found", + extensions={"code": "NOT_FOUND"}, + ) + if not _can_edit_preset(preset, user.id): + raise_forbidden() + if data.key is not None: + if not await _key_is_available(info.context.db, data.key, str(id)): + raise GraphQLError( + "Preset key already exists", + extensions={"code": "BAD_REQUEST"}, + ) + preset.key = data.key + if data.name is not None: + preset.name = data.name + if data.graph is not None: + graph_dict = graph_dict_from_preset_inputs(data.graph.nodes, data.graph.edges) + validate_task_graph_dict(graph_dict) + preset.graph_json = graph_dict + await info.context.db.commit() + await info.context.db.refresh(preset) + return task_preset_type_from_model(preset) + + @strawberry.mutation + async def delete_task_preset( + self, + info: Info, + id: strawberry.ID, + ) -> bool: + user = info.context.user + if not user: + raise GraphQLError( + "Not authenticated", + extensions={"code": "UNAUTHENTICATED"}, + ) + r = await info.context.db.execute( + select(models.TaskPreset).where(models.TaskPreset.id == id), + ) + preset = r.scalars().first() + if not preset: + raise GraphQLError( + "Preset not found", + extensions={"code": "NOT_FOUND"}, + ) + if not _can_delete_preset(preset, user.id): + raise_forbidden() + await info.context.db.delete(preset) + await info.context.db.commit() + return True diff --git a/backend/api/services/task_graph.py b/backend/api/services/task_graph.py new file mode 100644 index 00000000..fa5d7d2a --- /dev/null +++ b/backend/api/services/task_graph.py @@ -0,0 +1,255 @@ +from __future__ import annotations + +from collections import defaultdict, deque +from typing import Any + +from api.services.notifications import notify_entity_created, notify_entity_update +from database import models +from graphql import GraphQLError +from sqlalchemy import delete, insert, select +from sqlalchemy.ext.asyncio import AsyncSession + + +def validate_task_graph_dict(graph: dict[str, Any]) -> None: + nodes_raw = graph.get("nodes") + edges_raw = graph.get("edges") + if not isinstance(nodes_raw, list) or len(nodes_raw) == 0: + raise GraphQLError( + "Task graph must contain at least one node", + extensions={"code": "BAD_REQUEST"}, + ) + if not isinstance(edges_raw, list): + raise GraphQLError( + "Task graph edges must be a list", + extensions={"code": "BAD_REQUEST"}, + ) + node_ids: set[str] = set() + for i, n in enumerate(nodes_raw): + if not isinstance(n, dict): + raise GraphQLError( + f"Invalid node at index {i}", + extensions={"code": "BAD_REQUEST"}, + ) + nid = n.get("id") + if not nid or not isinstance(nid, str): + raise GraphQLError( + "Each node requires a string id", + extensions={"code": "BAD_REQUEST"}, + ) + if nid in node_ids: + raise GraphQLError( + f"Duplicate node id: {nid}", + extensions={"code": "BAD_REQUEST"}, + ) + node_ids.add(nid) + title = n.get("title") + if not title or not isinstance(title, str): + raise GraphQLError( + f"Node {nid} requires a non-empty title", + extensions={"code": "BAD_REQUEST"}, + ) + for i, e in enumerate(edges_raw): + if not isinstance(e, dict): + raise GraphQLError( + f"Invalid edge at index {i}", + extensions={"code": "BAD_REQUEST"}, + ) + f_id = e.get("from") + t_id = e.get("to") + if not f_id or not t_id: + raise GraphQLError( + "Each edge requires from and to node ids", + extensions={"code": "BAD_REQUEST"}, + ) + if f_id not in node_ids or t_id not in node_ids: + raise GraphQLError( + "Edge references unknown node id", + extensions={"code": "BAD_REQUEST"}, + ) + if f_id == t_id: + raise GraphQLError( + "Self-referential task dependency is not allowed", + extensions={"code": "BAD_REQUEST"}, + ) + _assert_acyclic(node_ids, edges_raw) + + +def _assert_acyclic(node_ids: set[str], edges_raw: list[dict[str, Any]]) -> None: + adj: dict[str, list[str]] = defaultdict(list) + indeg: dict[str, int] = {nid: 0 for nid in node_ids} + for e in edges_raw: + f_id = e["from"] + t_id = e["to"] + adj[f_id].append(t_id) + indeg[t_id] += 1 + q = deque([nid for nid in node_ids if indeg[nid] == 0]) + visited = 0 + while q: + u = q.popleft() + visited += 1 + for v in adj[u]: + indeg[v] -= 1 + if indeg[v] == 0: + q.append(v) + if visited != len(node_ids): + raise GraphQLError( + "Task graph contains a cycle", + extensions={"code": "BAD_REQUEST"}, + ) + + +async def insert_task_dependencies( + db: AsyncSession, + next_task_id: str, + previous_task_ids: list[str], + patient_id: str, +) -> None: + if not previous_task_ids: + return + seen: list[str] = [] + dup: set[str] = set() + for pid in previous_task_ids: + if pid in dup: + continue + dup.add(pid) + seen.append(pid) + if pid == next_task_id: + raise GraphQLError( + "Task cannot depend on itself", + extensions={"code": "BAD_REQUEST"}, + ) + res_prev = await db.execute( + select(models.Task).where(models.Task.id == pid), + ) + prev = res_prev.scalars().first() + if not prev: + raise GraphQLError( + "Previous task not found", + extensions={"code": "BAD_REQUEST"}, + ) + if prev.patient_id != patient_id: + raise GraphQLError( + "Previous task must belong to the same patient", + extensions={"code": "BAD_REQUEST"}, + ) + for pid in seen: + await db.execute( + insert(models.task_dependencies).values( + previous_task_id=pid, + next_task_id=next_task_id, + ), + ) + + +async def replace_incoming_task_dependencies( + db: AsyncSession, + next_task_id: str, + previous_task_ids: list[str] | None, + patient_id: str, +) -> None: + if previous_task_ids is None: + return + await db.execute( + delete(models.task_dependencies).where( + models.task_dependencies.c.next_task_id == next_task_id, + ), + ) + await insert_task_dependencies(db, next_task_id, previous_task_ids, patient_id) + + +def graph_dict_from_preset_inputs( + nodes: list[Any], + edges: list[Any], +) -> dict[str, Any]: + return { + "nodes": [ + { + "id": n.node_id, + "title": n.title, + "description": n.description, + "priority": n.priority.value if getattr(n, "priority", None) else None, + "estimated_time": getattr(n, "estimated_time", None), + } + for n in nodes + ], + "edges": [ + {"from": e.from_node_id, "to": e.to_node_id} for e in edges + ], + } + + +async def apply_task_graph_to_patient( + db: AsyncSession, + patient_id: str, + graph: dict[str, Any], + assignee_id: str | None, + source_task_preset_id: str | None = None, +) -> list[models.Task]: + validate_task_graph_dict(graph) + nodes_raw = graph["nodes"] + edges_raw = graph["edges"] + assignees: list[models.User] = [] + if assignee_id: + ur = await db.execute( + select(models.User).where(models.User.id == assignee_id), + ) + assignee_user = ur.scalars().first() + if assignee_user: + assignees = [assignee_user] + temp_to_task: dict[str, str] = {} + created: list[models.Task] = [] + for n in nodes_raw: + nid = n["id"] + title = n["title"] + description = n.get("description") + priority = n.get("priority") + estimated_time = n.get("estimated_time") + task = models.Task( + title=title, + description=description if isinstance(description, str) else None, + patient_id=patient_id, + source_task_preset_id=source_task_preset_id, + assignees=assignees, + assignee_team_id=None, + due_date=None, + priority=priority if isinstance(priority, str) else None, + estimated_time=estimated_time if isinstance(estimated_time, int) else None, + ) + db.add(task) + created.append(task) + await db.flush() + for n, task in zip(nodes_raw, created, strict=True): + nid = n["id"] + tid = task.id + if not tid: + raise GraphQLError( + "Task id was not assigned after insert", + extensions={"code": "INTERNAL_ERROR"}, + ) + temp_to_task[nid] = tid + dep_key: set[tuple[str, str]] = set() + dep_rows: list[dict[str, str]] = [] + for e in edges_raw: + prev_real = temp_to_task[e["from"]] + next_real = temp_to_task[e["to"]] + key = (prev_real, next_real) + if key in dep_key: + continue + dep_key.add(key) + dep_rows.append( + {"previous_task_id": prev_real, "next_task_id": next_real}, + ) + for row in dep_rows: + await db.execute(insert(models.task_dependencies).values(row)) + await db.commit() + task_ids = [t.id for t in created] + res = await db.execute( + select(models.Task).where(models.Task.id.in_(task_ids)), + ) + tasks = list(res.scalars().all()) + order = {tid: i for i, tid in enumerate(task_ids)} + tasks.sort(key=lambda t: order.get(t.id, 0)) + for task in tasks: + await notify_entity_created("task", task.id) + await notify_entity_update("patient", patient_id) + return tasks diff --git a/backend/api/types/task.py b/backend/api/types/task.py index 929aa1c3..a99c20bf 100644 --- a/backend/api/types/task.py +++ b/backend/api/types/task.py @@ -28,6 +28,7 @@ class TaskType: update_date: datetime | None assignee_team_id: strawberry.ID | None patient_id: strawberry.ID | None + source_task_preset_id: strawberry.ID | None priority: str | None estimated_time: int | None diff --git a/backend/api/types/task_preset.py b/backend/api/types/task_preset.py new file mode 100644 index 00000000..6c5d37be --- /dev/null +++ b/backend/api/types/task_preset.py @@ -0,0 +1,78 @@ +from typing import Any + +import strawberry + + +@strawberry.type +class TaskGraphNodeType: + id: str + title: str + description: str | None + priority: str | None + estimated_time: int | None + + +@strawberry.type +class TaskGraphEdgeType: + from_id: str + to_id: str + + +@strawberry.type +class TaskGraphType: + nodes: list[TaskGraphNodeType] + edges: list[TaskGraphEdgeType] + + +def task_graph_type_from_dict(graph: dict[str, Any]) -> TaskGraphType: + nodes_raw = graph.get("nodes") or [] + edges_raw = graph.get("edges") or [] + nodes: list[TaskGraphNodeType] = [] + for n in nodes_raw: + if not isinstance(n, dict): + continue + nodes.append( + TaskGraphNodeType( + id=str(n.get("id", "")), + title=str(n.get("title", "")), + description=n.get("description") if isinstance(n.get("description"), str) else None, + priority=n.get("priority") if isinstance(n.get("priority"), str) else None, + estimated_time=n.get("estimated_time") if isinstance(n.get("estimated_time"), int) else None, + ), + ) + edges: list[TaskGraphEdgeType] = [] + for e in edges_raw: + if not isinstance(e, dict): + continue + edges.append( + TaskGraphEdgeType( + from_id=str(e.get("from", "")), + to_id=str(e.get("to", "")), + ), + ) + return TaskGraphType(nodes=nodes, edges=edges) + + +@strawberry.type +class TaskPresetType: + id: strawberry.ID + name: str + key: str + scope: str + owner_user_id: strawberry.ID | None + _graph_json: strawberry.Private[dict[str, Any]] + + @strawberry.field + def graph(self) -> TaskGraphType: + return task_graph_type_from_dict(self._graph_json) + + +def task_preset_type_from_model(p: Any) -> TaskPresetType: + return TaskPresetType( + id=p.id, + name=p.name, + key=p.key, + scope=p.scope, + owner_user_id=p.owner_user_id, + _graph_json=p.graph_json, + ) diff --git a/backend/database/migrations/versions/add_task_presets_table.py b/backend/database/migrations/versions/add_task_presets_table.py new file mode 100644 index 00000000..5d66be4f --- /dev/null +++ b/backend/database/migrations/versions/add_task_presets_table.py @@ -0,0 +1,51 @@ +"""Add task_presets table. + +Revision ID: add_task_presets +Revises: add_saved_view_related_columns +Create Date: 2026-04-07 00:00:00.000000 +""" + +from typing import Sequence, Union + +import sqlalchemy as sa +from alembic import op +from sqlalchemy.dialects import postgresql + +revision: str = "add_task_presets" +down_revision: Union[str, Sequence[str], None] = "add_saved_view_related_columns" +branch_labels: Union[str, Sequence[str], None] = None +depends_on: Union[str, Sequence[str], None] = None + + +def upgrade() -> None: + op.create_table( + "task_presets", + sa.Column("id", sa.String(), nullable=False), + sa.Column("name", sa.String(), nullable=False), + sa.Column("key", sa.String(), nullable=False), + sa.Column("scope", sa.String(length=32), nullable=False), + sa.Column("owner_user_id", sa.String(), nullable=True), + sa.Column( + "graph_json", + postgresql.JSON(astext_type=sa.Text()), + nullable=False, + ), + sa.Column("creation_date", sa.DateTime(), nullable=False), + sa.Column("update_date", sa.DateTime(), nullable=True), + sa.ForeignKeyConstraint( + ["owner_user_id"], + ["users.id"], + ), + sa.PrimaryKeyConstraint("id"), + ) + op.create_index( + op.f("ix_task_presets_key"), + "task_presets", + ["key"], + unique=True, + ) + + +def downgrade() -> None: + op.drop_index(op.f("ix_task_presets_key"), table_name="task_presets") + op.drop_table("task_presets") diff --git a/backend/database/migrations/versions/add_task_source_task_preset.py b/backend/database/migrations/versions/add_task_source_task_preset.py new file mode 100644 index 00000000..e9d8ccd9 --- /dev/null +++ b/backend/database/migrations/versions/add_task_source_task_preset.py @@ -0,0 +1,40 @@ +"""Add source_task_preset_id to tasks. + +Revision ID: add_task_source_preset +Revises: add_task_presets +Create Date: 2026-04-07 +""" + +from typing import Sequence, Union + +import sqlalchemy as sa +from alembic import op + +revision: str = "add_task_source_preset" +down_revision: Union[str, Sequence[str], None] = "add_task_presets" +branch_labels: Union[str, Sequence[str], None] = None +depends_on: Union[str, Sequence[str], None] = None + + +def upgrade() -> None: + op.add_column( + "tasks", + sa.Column("source_task_preset_id", sa.String(), nullable=True), + ) + op.create_foreign_key( + "fk_tasks_source_task_preset_id", + "tasks", + "task_presets", + ["source_task_preset_id"], + ["id"], + ondelete="SET NULL", + ) + + +def downgrade() -> None: + op.drop_constraint( + "fk_tasks_source_task_preset_id", + "tasks", + type_="foreignkey", + ) + op.drop_column("tasks", "source_task_preset_id") diff --git a/backend/database/models/__init__.py b/backend/database/models/__init__.py index 5332f16c..9fee6038 100644 --- a/backend/database/models/__init__.py +++ b/backend/database/models/__init__.py @@ -5,3 +5,4 @@ from .property import PropertyDefinition, PropertyValue # noqa: F401 from .scaffold import ScaffoldImportState # noqa: F401 from .saved_view import SavedView # noqa: F401 +from .task_preset import TaskPreset, TaskPresetScope # noqa: F401 diff --git a/backend/database/models/task.py b/backend/database/models/task.py index e0888144..0d631b18 100644 --- a/backend/database/models/task.py +++ b/backend/database/models/task.py @@ -12,6 +12,7 @@ from .location import LocationNode from .patient import Patient from .property import PropertyValue + from .task_preset import TaskPreset from .user import User task_dependencies = Table( @@ -52,6 +53,10 @@ class Task(Base): nullable=True, ) patient_id: Mapped[str | None] = mapped_column(ForeignKey("patients.id"), nullable=True) + source_task_preset_id: Mapped[str | None] = mapped_column( + ForeignKey("task_presets.id", ondelete="SET NULL"), + nullable=True, + ) priority: Mapped[str | None] = mapped_column(String, nullable=True) estimated_time: Mapped[int | None] = mapped_column(Integer, nullable=True) @@ -65,6 +70,11 @@ class Task(Base): foreign_keys=[assignee_team_id], ) patient: Mapped[Patient | None] = relationship("Patient", back_populates="tasks") + source_task_preset: Mapped["TaskPreset | None"] = relationship( + "TaskPreset", + foreign_keys=[source_task_preset_id], + back_populates="tasks", + ) properties: Mapped[list[PropertyValue]] = relationship( "PropertyValue", back_populates="task", diff --git a/backend/database/models/task_preset.py b/backend/database/models/task_preset.py new file mode 100644 index 00000000..a0e0e699 --- /dev/null +++ b/backend/database/models/task_preset.py @@ -0,0 +1,50 @@ +from __future__ import annotations + +import enum +import uuid +from datetime import datetime +from typing import TYPE_CHECKING, Any + +from database.models.base import Base +from sqlalchemy import ForeignKey, String +from sqlalchemy.dialects.postgresql import JSON +from sqlalchemy.orm import Mapped, mapped_column, relationship + +if TYPE_CHECKING: + from database.models.task import Task + from database.models.user import User + + +class TaskPresetScope(str, enum.Enum): + PERSONAL = "PERSONAL" + GLOBAL = "GLOBAL" + + +class TaskPreset(Base): + __tablename__ = "task_presets" + + id: Mapped[str] = mapped_column( + String, + primary_key=True, + default=lambda: str(uuid.uuid4()), + ) + name: Mapped[str] = mapped_column(String) + key: Mapped[str] = mapped_column(String, unique=True, index=True) + scope: Mapped[str] = mapped_column(String(32)) + owner_user_id: Mapped[str | None] = mapped_column( + ForeignKey("users.id"), + nullable=True, + ) + graph_json: Mapped[dict[str, Any]] = mapped_column(JSON) + creation_date: Mapped[datetime] = mapped_column(default=datetime.now) + update_date: Mapped[datetime | None] = mapped_column( + nullable=True, + default=datetime.now, + onupdate=datetime.now, + ) + + owner: Mapped[User | None] = relationship("User") + tasks: Mapped[list["Task"]] = relationship( + "Task", + back_populates="source_task_preset", + ) diff --git a/backend/schema.graphql b/backend/schema.graphql new file mode 100644 index 00000000..3ca3375f --- /dev/null +++ b/backend/schema.graphql @@ -0,0 +1,568 @@ +input ApplyTaskGraphInput { + patientId: ID! + presetId: ID = null + graph: TaskGraphInput = null + assignToCurrentUser: Boolean! = false +} + +type AuditLogType { + caseId: String! + activity: String! + userId: String + timestamp: DateTime! + context: String +} + +input CreateLocationNodeInput { + title: String! + kind: LocationType! + parentId: ID = null +} + +input CreatePatientInput { + firstname: String! + lastname: String! + birthdate: Date! + sex: Sex! + assignedLocationId: ID = null + assignedLocationIds: [ID!] = null + clinicId: ID! + positionId: ID = null + teamIds: [ID!] = null + properties: [PropertyValueInput!] = null + state: PatientState = null + description: String = null +} + +input CreatePropertyDefinitionInput { + name: String! + fieldType: FieldType! + allowedEntities: [PropertyEntity!]! + description: String = null + options: [String!] = null + isActive: Boolean! = true +} + +input CreateSavedViewInput { + name: String! + baseEntityType: SavedViewEntityType! + filterDefinition: String! + sortDefinition: String! + parameters: String! + relatedFilterDefinition: String! = "{}" + relatedSortDefinition: String! = "{}" + relatedParameters: String! = "{}" + visibility: SavedViewVisibility! = LINK_SHARED +} + +input CreateTaskInput { + title: String! + patientId: ID = null + description: String = null + dueDate: DateTime = null + assigneeIds: [ID!] = null + assigneeTeamId: ID = null + previousTaskIds: [ID!] = null + properties: [PropertyValueInput!] = null + priority: TaskPriority = null + estimatedTime: Int = null +} + +input CreateTaskPresetInput { + name: String! + key: String = null + scope: TaskPresetScope! + graph: TaskGraphInput! +} + +"""Date (isoformat)""" +scalar Date + +"""Date with time (isoformat)""" +scalar DateTime + +enum FieldType { + FIELD_TYPE_UNSPECIFIED + FIELD_TYPE_TEXT + FIELD_TYPE_NUMBER + FIELD_TYPE_CHECKBOX + FIELD_TYPE_DATE + FIELD_TYPE_DATE_TIME + FIELD_TYPE_SELECT + FIELD_TYPE_MULTI_SELECT + FIELD_TYPE_USER +} + +type LocationNodeType { + id: ID! + title: String! + kind: LocationType! + parentId: ID + parent: LocationNodeType + children: [LocationNodeType!]! + patients: [PatientType!]! + organizationIds: [String!]! +} + +enum LocationType { + HOSPITAL + PRACTICE + CLINIC + TEAM + WARD + ROOM + BED + OTHER +} + +type Mutation { + createPatient(data: CreatePatientInput!): PatientType! + updatePatient(id: ID!, data: UpdatePatientInput!): PatientType! + deletePatient(id: ID!): Boolean! + admitPatient(id: ID!): PatientType! + dischargePatient(id: ID!): PatientType! + markPatientDead(id: ID!): PatientType! + waitPatient(id: ID!): PatientType! + createTask(data: CreateTaskInput!): TaskType! + updateTask(id: ID!, data: UpdateTaskInput!): TaskType! + addTaskAssignee(id: ID!, userId: ID!): TaskType! + removeTaskAssignee(id: ID!, userId: ID!): TaskType! + assignTaskToTeam(id: ID!, teamId: ID!): TaskType! + unassignTaskFromTeam(id: ID!): TaskType! + completeTask(id: ID!): TaskType! + reopenTask(id: ID!): TaskType! + applyTaskGraph(data: ApplyTaskGraphInput!): [TaskType!]! + deleteTask(id: ID!): Boolean! + createTaskPreset(data: CreateTaskPresetInput!): TaskPresetType! + updateTaskPreset(id: ID!, data: UpdateTaskPresetInput!): TaskPresetType! + deleteTaskPreset(id: ID!): Boolean! + createPropertyDefinition(data: CreatePropertyDefinitionInput!): PropertyDefinitionType! + updatePropertyDefinition(id: ID!, data: UpdatePropertyDefinitionInput!): PropertyDefinitionType! + deletePropertyDefinition(id: ID!): Boolean! + createLocationNode(data: CreateLocationNodeInput!): LocationNodeType! + updateLocationNode(id: ID!, data: UpdateLocationNodeInput!): LocationNodeType! + deleteLocationNode(id: ID!): Boolean! + updateProfilePicture(data: UpdateProfilePictureInput!): UserType! + createSavedView(data: CreateSavedViewInput!): SavedView! + updateSavedView(id: ID!, data: UpdateSavedViewInput!): SavedView! + deleteSavedView(id: ID!): Boolean! + duplicateSavedView(id: ID!, name: String!): SavedView! +} + +input PaginationInput { + pageIndex: Int! = 0 + pageSize: Int = null +} + +enum PatientState { + WAIT + ADMITTED + DISCHARGED + DEAD +} + +type PatientType { + id: ID! + firstname: String! + lastname: String! + birthdate: Date! + sex: Sex! + state: PatientState! + assignedLocationId: ID + clinicId: ID! + positionId: ID + description: String + name: String! + age: Int! + assignedLocation: LocationNodeType + assignedLocations: [LocationNodeType!]! + clinic: LocationNodeType! + position: LocationNodeType + teams: [LocationNodeType!]! + tasks(done: Boolean = null): [TaskType!]! + properties: [PropertyValueType!]! + checksum: String! +} + +type PropertyDefinitionType { + id: ID! + name: String! + description: String + fieldType: FieldType! + isActive: Boolean! + options: [String!]! + allowedEntities: [PropertyEntity!]! +} + +enum PropertyEntity { + PATIENT + TASK +} + +input PropertyValueInput { + definitionId: ID! + textValue: String = null + numberValue: Float = null + booleanValue: Boolean = null + dateValue: Date = null + dateTimeValue: DateTime = null + selectValue: String = null + multiSelectValues: [String!] = null + userValue: String = null +} + +type PropertyValueType { + id: ID! + definition: PropertyDefinitionType! + textValue: String + numberValue: Float + booleanValue: Boolean + dateValue: Date + dateTimeValue: DateTime + selectValue: String + userValue: String + multiSelectValues: [String!] + user: UserType + team: LocationNodeType +} + +type Query { + patient(id: ID!): PatientType + patients(locationNodeId: ID = null, rootLocationIds: [ID!] = null, states: [PatientState!] = null, filters: [QueryFilterClauseInput!] = null, sorts: [QuerySortClauseInput!] = null, pagination: PaginationInput = null, search: QuerySearchInput = null): [PatientType!]! + patientsTotal(locationNodeId: ID = null, rootLocationIds: [ID!] = null, states: [PatientState!] = null, filters: [QueryFilterClauseInput!] = null, sorts: [QuerySortClauseInput!] = null, search: QuerySearchInput = null): Int! + recentPatients(rootLocationIds: [ID!] = null, filters: [QueryFilterClauseInput!] = null, sorts: [QuerySortClauseInput!] = null, pagination: PaginationInput = null, search: QuerySearchInput = null): [PatientType!]! + recentPatientsTotal(rootLocationIds: [ID!] = null, filters: [QueryFilterClauseInput!] = null, sorts: [QuerySortClauseInput!] = null, search: QuerySearchInput = null): Int! + task(id: ID!): TaskType + tasks(patientId: ID = null, assigneeId: ID = null, assigneeTeamId: ID = null, rootLocationIds: [ID!] = null, filters: [QueryFilterClauseInput!] = null, sorts: [QuerySortClauseInput!] = null, pagination: PaginationInput = null, search: QuerySearchInput = null): [TaskType!]! + tasksTotal(patientId: ID = null, assigneeId: ID = null, assigneeTeamId: ID = null, rootLocationIds: [ID!] = null, filters: [QueryFilterClauseInput!] = null, sorts: [QuerySortClauseInput!] = null, search: QuerySearchInput = null): Int! + recentTasks(rootLocationIds: [ID!] = null, filters: [QueryFilterClauseInput!] = null, sorts: [QuerySortClauseInput!] = null, pagination: PaginationInput = null, search: QuerySearchInput = null): [TaskType!]! + recentTasksTotal(rootLocationIds: [ID!] = null, filters: [QueryFilterClauseInput!] = null, sorts: [QuerySortClauseInput!] = null, search: QuerySearchInput = null): Int! + taskPresets: [TaskPresetType!]! + taskPreset(id: ID!): TaskPresetType + taskPresetByKey(key: String!): TaskPresetType + locationRoots: [LocationNodeType!]! + locationNode(id: ID!): LocationNodeType + locationNodes(kind: LocationType = null, search: String = null, parentId: ID = null, recursive: Boolean! = false, orderByName: Boolean! = false, limit: Int = null, offset: Int = null): [LocationNodeType!]! + propertyDefinitions: [PropertyDefinitionType!]! + user(id: ID!): UserType + users(filters: [QueryFilterClauseInput!] = null, sorts: [QuerySortClauseInput!] = null, pagination: PaginationInput = null, search: QuerySearchInput = null): [UserType!]! + me: UserType + auditLogs(caseId: ID!, limit: Int = null, offset: Int = null): [AuditLogType!]! + queryableFields(entity: String!): [QueryableField!]! + savedView(id: ID!): SavedView + mySavedViews: [SavedView!]! +} + +input QueryFilterClauseInput { + fieldKey: String! + operator: QueryOperator! + value: QueryFilterValueInput = null +} + +input QueryFilterValueInput { + stringValue: String = null + stringValues: [String!] = null + floatValue: Float = null + floatMin: Float = null + floatMax: Float = null + boolValue: Boolean = null + dateValue: DateTime = null + dateMin: Date = null + dateMax: Date = null + uuidValue: String = null + uuidValues: [String!] = null +} + +enum QueryOperator { + EQ + NEQ + GT + GTE + LT + LTE + BETWEEN + IN + NOT_IN + CONTAINS + STARTS_WITH + ENDS_WITH + IS_NULL + IS_NOT_NULL + ANY_EQ + ANY_IN + ALL_IN + NONE_IN + IS_EMPTY + IS_NOT_EMPTY +} + +input QuerySearchInput { + searchText: String = null + includeProperties: Boolean! = false +} + +input QuerySortClauseInput { + fieldKey: String! + direction: SortDirection! +} + +type QueryableChoiceMeta { + optionKeys: [String!]! + optionLabels: [String!]! +} + +type QueryableField { + key: String! + label: String! + kind: QueryableFieldKind! + valueType: QueryableValueType! + allowedOperators: [QueryOperator!]! + sortable: Boolean! + sortDirections: [SortDirection!]! + searchable: Boolean! + relation: QueryableRelationMeta + choice: QueryableChoiceMeta + propertyDefinitionId: String + filterable: Boolean! +} + +enum QueryableFieldKind { + SCALAR + PROPERTY + REFERENCE + REFERENCE_LIST + CHOICE + CHOICE_LIST +} + +type QueryableRelationMeta { + targetEntity: String! + idFieldKey: String! + labelFieldKey: String! + allowedFilterModes: [ReferenceFilterMode!]! +} + +enum QueryableValueType { + STRING + NUMBER + BOOLEAN + DATE + DATETIME + UUID + STRING_LIST + UUID_LIST +} + +enum ReferenceFilterMode { + ID + LABEL +} + +type SavedView { + id: ID! + name: String! + baseEntityType: SavedViewEntityType! + filterDefinition: String! + sortDefinition: String! + parameters: String! + relatedFilterDefinition: String! + relatedSortDefinition: String! + relatedParameters: String! + ownerUserId: ID! + visibility: SavedViewVisibility! + createdAt: String! + updatedAt: String! + isOwner: Boolean! +} + +enum SavedViewEntityType { + TASK + PATIENT +} + +enum SavedViewVisibility { + PRIVATE + LINK_SHARED +} + +enum Sex { + MALE + FEMALE + UNKNOWN +} + +enum SortDirection { + ASC + DESC +} + +type Subscription { + patientCreated(rootLocationIds: [ID!] = null): ID! + patientUpdated(patientId: ID = null, rootLocationIds: [ID!] = null): ID! + patientStateChanged(patientId: ID = null, rootLocationIds: [ID!] = null): ID! + patientDeleted(rootLocationIds: [ID!] = null): ID! + taskCreated(rootLocationIds: [ID!] = null): ID! + taskUpdated(taskId: ID = null, rootLocationIds: [ID!] = null): ID! + taskDeleted(rootLocationIds: [ID!] = null): ID! + locationNodeCreated: ID! + locationNodeUpdated(locationId: ID = null): ID! + locationNodeDeleted: ID! +} + +input TaskGraphEdgeInput { + fromNodeId: String! + toNodeId: String! +} + +type TaskGraphEdgeType { + fromId: String! + toId: String! +} + +input TaskGraphInput { + nodes: [TaskGraphNodeInput!]! + edges: [TaskGraphEdgeInput!]! +} + +input TaskGraphNodeInput { + nodeId: String! + title: String! + description: String = null + priority: TaskPriority = null + estimatedTime: Int = null +} + +type TaskGraphNodeType { + id: String! + title: String! + description: String + priority: String + estimatedTime: Int +} + +type TaskGraphType { + nodes: [TaskGraphNodeType!]! + edges: [TaskGraphEdgeType!]! +} + +enum TaskPresetScope { + PERSONAL + GLOBAL +} + +type TaskPresetType { + id: ID! + name: String! + key: String! + scope: String! + ownerUserId: ID + graph: TaskGraphType! +} + +enum TaskPriority { + P1 + P2 + P3 + P4 +} + +type TaskType { + id: ID! + title: String! + description: String + done: Boolean! + dueDate: DateTime + creationDate: DateTime! + updateDate: DateTime + assigneeTeamId: ID + patientId: ID + sourceTaskPresetId: ID + priority: String + estimatedTime: Int + assignees: [UserType!]! + assigneeTeam: LocationNodeType + patient: PatientType + properties: [PropertyValueType!]! + checksum: String! +} + +input UpdateLocationNodeInput { + title: String = null + kind: LocationType = null + parentId: ID = null +} + +input UpdatePatientInput { + firstname: String = null + lastname: String = null + birthdate: Date = null + sex: Sex = null + assignedLocationId: ID = null + assignedLocationIds: [ID!] = null + clinicId: ID = null + positionId: ID + teamIds: [ID!] + properties: [PropertyValueInput!] = null + checksum: String = null + description: String = null +} + +input UpdateProfilePictureInput { + avatarUrl: String! +} + +input UpdatePropertyDefinitionInput { + name: String = null + description: String = null + options: [String!] = null + isActive: Boolean = null + allowedEntities: [PropertyEntity!] = null +} + +input UpdateSavedViewInput { + name: String = null + filterDefinition: String = null + sortDefinition: String = null + parameters: String = null + relatedFilterDefinition: String = null + relatedSortDefinition: String = null + relatedParameters: String = null + visibility: SavedViewVisibility = null +} + +input UpdateTaskInput { + title: String = null + patientId: ID + description: String = null + done: Boolean = null + dueDate: DateTime + assigneeIds: [ID!] + assigneeTeamId: ID + previousTaskIds: [ID!] = null + properties: [PropertyValueInput!] = null + checksum: String = null + priority: TaskPriority + estimatedTime: Int +} + +input UpdateTaskPresetInput { + name: String = null + key: String = null + graph: TaskGraphInput = null +} + +type UserType { + id: ID! + username: String! + email: String + firstname: String + lastname: String + title: String + avatarUrl: String + lastOnline: DateTime + name: String! + isOnline: Boolean! + organizations: String + tasks(rootLocationIds: [ID!] = null): [TaskType!]! + rootLocations: [LocationNodeType!]! +} \ No newline at end of file diff --git a/backend/tests/unit/test_task_graph.py b/backend/tests/unit/test_task_graph.py new file mode 100644 index 00000000..3f751bed --- /dev/null +++ b/backend/tests/unit/test_task_graph.py @@ -0,0 +1,48 @@ +import pytest +from graphql import GraphQLError + +from api.services.task_graph import validate_task_graph_dict + + +def test_validate_empty_nodes_raises() -> None: + with pytest.raises(GraphQLError): + validate_task_graph_dict({"nodes": [], "edges": []}) + + +def test_validate_cycle_raises() -> None: + with pytest.raises(GraphQLError) as exc: + validate_task_graph_dict( + { + "nodes": [ + {"id": "a", "title": "A"}, + {"id": "b", "title": "B"}, + ], + "edges": [ + {"from": "a", "to": "b"}, + {"from": "b", "to": "a"}, + ], + }, + ) + assert "cycle" in str(exc.value).lower() + + +def test_validate_self_edge_raises() -> None: + with pytest.raises(GraphQLError): + validate_task_graph_dict( + { + "nodes": [{"id": "a", "title": "A"}], + "edges": [{"from": "a", "to": "a"}], + }, + ) + + +def test_validate_linear_ok() -> None: + validate_task_graph_dict( + { + "nodes": [ + {"id": "a", "title": "A"}, + {"id": "b", "title": "B"}, + ], + "edges": [{"from": "a", "to": "b"}], + }, + ) diff --git a/web/api/gql/generated.ts b/web/api/gql/generated.ts index bbac9141..f6d0d5a6 100644 --- a/web/api/gql/generated.ts +++ b/web/api/gql/generated.ts @@ -19,6 +19,13 @@ export type Scalars = { DateTime: { input: any; output: any; } }; +export type ApplyTaskGraphInput = { + assignToCurrentUser?: Scalars['Boolean']['input']; + graph?: InputMaybe; + patientId: Scalars['ID']['input']; + presetId?: InputMaybe; +}; + export type AuditLogType = { __typename?: 'AuditLogType'; activity: Scalars['String']['output']; @@ -63,9 +70,9 @@ export type CreateSavedViewInput = { filterDefinition: Scalars['String']['input']; name: Scalars['String']['input']; parameters: Scalars['String']['input']; - relatedFilterDefinition?: InputMaybe; - relatedParameters?: InputMaybe; - relatedSortDefinition?: InputMaybe; + relatedFilterDefinition?: Scalars['String']['input']; + relatedParameters?: Scalars['String']['input']; + relatedSortDefinition?: Scalars['String']['input']; sortDefinition: Scalars['String']['input']; visibility?: SavedViewVisibility; }; @@ -83,6 +90,13 @@ export type CreateTaskInput = { title: Scalars['String']['input']; }; +export type CreateTaskPresetInput = { + graph: TaskGraphInput; + key?: InputMaybe; + name: Scalars['String']['input']; + scope: TaskPresetScope; +}; + export enum FieldType { FieldTypeCheckbox = 'FIELD_TYPE_CHECKBOX', FieldTypeDate = 'FIELD_TYPE_DATE', @@ -122,6 +136,7 @@ export type Mutation = { __typename?: 'Mutation'; addTaskAssignee: TaskType; admitPatient: PatientType; + applyTaskGraph: Array; assignTaskToTeam: TaskType; completeTask: TaskType; createLocationNode: LocationNodeType; @@ -129,11 +144,13 @@ export type Mutation = { createPropertyDefinition: PropertyDefinitionType; createSavedView: SavedView; createTask: TaskType; + createTaskPreset: TaskPresetType; deleteLocationNode: Scalars['Boolean']['output']; deletePatient: Scalars['Boolean']['output']; deletePropertyDefinition: Scalars['Boolean']['output']; deleteSavedView: Scalars['Boolean']['output']; deleteTask: Scalars['Boolean']['output']; + deleteTaskPreset: Scalars['Boolean']['output']; dischargePatient: PatientType; duplicateSavedView: SavedView; markPatientDead: PatientType; @@ -146,6 +163,7 @@ export type Mutation = { updatePropertyDefinition: PropertyDefinitionType; updateSavedView: SavedView; updateTask: TaskType; + updateTaskPreset: TaskPresetType; waitPatient: PatientType; }; @@ -161,6 +179,11 @@ export type MutationAdmitPatientArgs = { }; +export type MutationApplyTaskGraphArgs = { + data: ApplyTaskGraphInput; +}; + + export type MutationAssignTaskToTeamArgs = { id: Scalars['ID']['input']; teamId: Scalars['ID']['input']; @@ -197,6 +220,11 @@ export type MutationCreateTaskArgs = { }; +export type MutationCreateTaskPresetArgs = { + data: CreateTaskPresetInput; +}; + + export type MutationDeleteLocationNodeArgs = { id: Scalars['ID']['input']; }; @@ -222,6 +250,11 @@ export type MutationDeleteTaskArgs = { }; +export type MutationDeleteTaskPresetArgs = { + id: Scalars['ID']['input']; +}; + + export type MutationDischargePatientArgs = { id: Scalars['ID']['input']; }; @@ -289,6 +322,12 @@ export type MutationUpdateTaskArgs = { }; +export type MutationUpdateTaskPresetArgs = { + data: UpdateTaskPresetInput; + id: Scalars['ID']['input']; +}; + + export type MutationWaitPatientArgs = { id: Scalars['ID']['input']; }; @@ -397,6 +436,9 @@ export type Query = { recentTasksTotal: Scalars['Int']['output']; savedView?: Maybe; task?: Maybe; + taskPreset?: Maybe; + taskPresetByKey?: Maybe; + taskPresets: Array; tasks: Array; tasksTotal: Scalars['Int']['output']; user?: Maybe; @@ -502,6 +544,16 @@ export type QueryTaskArgs = { }; +export type QueryTaskPresetArgs = { + id: Scalars['ID']['input']; +}; + + +export type QueryTaskPresetByKeyArgs = { + key: Scalars['String']['input']; +}; + + export type QueryTasksArgs = { assigneeId?: InputMaybe; assigneeTeamId?: InputMaybe; @@ -741,6 +793,60 @@ export type SubscriptionTaskUpdatedArgs = { taskId?: InputMaybe; }; +export type TaskGraphEdgeInput = { + fromNodeId: Scalars['String']['input']; + toNodeId: Scalars['String']['input']; +}; + +export type TaskGraphEdgeType = { + __typename?: 'TaskGraphEdgeType'; + fromId: Scalars['String']['output']; + toId: Scalars['String']['output']; +}; + +export type TaskGraphInput = { + edges: Array; + nodes: Array; +}; + +export type TaskGraphNodeInput = { + description?: InputMaybe; + estimatedTime?: InputMaybe; + nodeId: Scalars['String']['input']; + priority?: InputMaybe; + title: Scalars['String']['input']; +}; + +export type TaskGraphNodeType = { + __typename?: 'TaskGraphNodeType'; + description?: Maybe; + estimatedTime?: Maybe; + id: Scalars['String']['output']; + priority?: Maybe; + title: Scalars['String']['output']; +}; + +export type TaskGraphType = { + __typename?: 'TaskGraphType'; + edges: Array; + nodes: Array; +}; + +export enum TaskPresetScope { + Global = 'GLOBAL', + Personal = 'PERSONAL' +} + +export type TaskPresetType = { + __typename?: 'TaskPresetType'; + graph: TaskGraphType; + id: Scalars['ID']['output']; + key: Scalars['String']['output']; + name: Scalars['String']['output']; + ownerUserId?: Maybe; + scope: Scalars['String']['output']; +}; + export enum TaskPriority { P1 = 'P1', P2 = 'P2', @@ -764,6 +870,7 @@ export type TaskType = { patientId?: Maybe; priority?: Maybe; properties: Array; + sourceTaskPresetId?: Maybe; title: Scalars['String']['output']; updateDate?: Maybe; }; @@ -827,6 +934,12 @@ export type UpdateTaskInput = { title?: InputMaybe; }; +export type UpdateTaskPresetInput = { + graph?: InputMaybe; + key?: InputMaybe; + name?: InputMaybe; +}; + export type UserType = { __typename?: 'UserType'; avatarUrl?: Maybe; @@ -891,14 +1004,14 @@ export type GetOverviewDataQueryVariables = Exact<{ }>; -export type GetOverviewDataQuery = { __typename?: 'Query', recentPatientsTotal: number, recentTasksTotal: number, recentPatients: Array<{ __typename?: 'PatientType', id: string, name: string, firstname: string, lastname: string, sex: Sex, birthdate: any, state: PatientState, position?: { __typename?: 'LocationNodeType', id: string, title: string, kind: LocationType, parent?: { __typename?: 'LocationNodeType', id: string, title: string } | null } | null, tasks: Array<{ __typename?: 'TaskType', id: string, done: boolean, updateDate?: any | null }>, properties: Array<{ __typename?: 'PropertyValueType', id: string, textValue?: string | null, numberValue?: number | null, booleanValue?: boolean | null, dateValue?: any | null, dateTimeValue?: any | null, selectValue?: string | null, multiSelectValues?: Array | null, userValue?: string | null, definition: { __typename?: 'PropertyDefinitionType', id: string, name: string, description?: string | null, fieldType: FieldType, isActive: boolean, allowedEntities: Array, options: Array }, user?: { __typename?: 'UserType', id: string, name: string, avatarUrl?: string | null, lastOnline?: any | null, isOnline: boolean } | null, team?: { __typename?: 'LocationNodeType', id: string, title: string, kind: LocationType } | null }> }>, recentTasks: Array<{ __typename?: 'TaskType', id: string, title: string, description?: string | null, done: boolean, dueDate?: any | null, creationDate: any, updateDate?: any | null, priority?: string | null, estimatedTime?: number | null, assignees: Array<{ __typename?: 'UserType', id: string, name: string, avatarUrl?: string | null, lastOnline?: any | null, isOnline: boolean }>, assigneeTeam?: { __typename?: 'LocationNodeType', id: string, title: string, kind: LocationType } | null, patient?: { __typename?: 'PatientType', id: string, name: string, position?: { __typename?: 'LocationNodeType', id: string, title: string, kind: LocationType, parent?: { __typename?: 'LocationNodeType', id: string, title: string } | null } | null } | null, properties: Array<{ __typename?: 'PropertyValueType', id: string, textValue?: string | null, numberValue?: number | null, booleanValue?: boolean | null, dateValue?: any | null, dateTimeValue?: any | null, selectValue?: string | null, multiSelectValues?: Array | null, userValue?: string | null, definition: { __typename?: 'PropertyDefinitionType', id: string, name: string, description?: string | null, fieldType: FieldType, isActive: boolean, allowedEntities: Array, options: Array }, user?: { __typename?: 'UserType', id: string, name: string, avatarUrl?: string | null, lastOnline?: any | null, isOnline: boolean } | null, team?: { __typename?: 'LocationNodeType', id: string, title: string, kind: LocationType } | null }> }> }; +export type GetOverviewDataQuery = { __typename?: 'Query', recentPatientsTotal: number, recentTasksTotal: number, recentPatients: Array<{ __typename?: 'PatientType', id: string, name: string, firstname: string, lastname: string, sex: Sex, birthdate: any, state: PatientState, position?: { __typename?: 'LocationNodeType', id: string, title: string, kind: LocationType, parent?: { __typename?: 'LocationNodeType', id: string, title: string } | null } | null, tasks: Array<{ __typename?: 'TaskType', id: string, done: boolean, updateDate?: any | null }>, properties: Array<{ __typename?: 'PropertyValueType', id: string, textValue?: string | null, numberValue?: number | null, booleanValue?: boolean | null, dateValue?: any | null, dateTimeValue?: any | null, selectValue?: string | null, multiSelectValues?: Array | null, userValue?: string | null, definition: { __typename?: 'PropertyDefinitionType', id: string, name: string, description?: string | null, fieldType: FieldType, isActive: boolean, allowedEntities: Array, options: Array }, user?: { __typename?: 'UserType', id: string, name: string, avatarUrl?: string | null, lastOnline?: any | null, isOnline: boolean } | null, team?: { __typename?: 'LocationNodeType', id: string, title: string, kind: LocationType } | null }> }>, recentTasks: Array<{ __typename?: 'TaskType', id: string, title: string, description?: string | null, done: boolean, dueDate?: any | null, creationDate: any, updateDate?: any | null, priority?: string | null, estimatedTime?: number | null, sourceTaskPresetId?: string | null, assignees: Array<{ __typename?: 'UserType', id: string, name: string, avatarUrl?: string | null, lastOnline?: any | null, isOnline: boolean }>, assigneeTeam?: { __typename?: 'LocationNodeType', id: string, title: string, kind: LocationType } | null, patient?: { __typename?: 'PatientType', id: string, name: string, position?: { __typename?: 'LocationNodeType', id: string, title: string, kind: LocationType, parent?: { __typename?: 'LocationNodeType', id: string, title: string } | null } | null } | null, properties: Array<{ __typename?: 'PropertyValueType', id: string, textValue?: string | null, numberValue?: number | null, booleanValue?: boolean | null, dateValue?: any | null, dateTimeValue?: any | null, selectValue?: string | null, multiSelectValues?: Array | null, userValue?: string | null, definition: { __typename?: 'PropertyDefinitionType', id: string, name: string, description?: string | null, fieldType: FieldType, isActive: boolean, allowedEntities: Array, options: Array }, user?: { __typename?: 'UserType', id: string, name: string, avatarUrl?: string | null, lastOnline?: any | null, isOnline: boolean } | null, team?: { __typename?: 'LocationNodeType', id: string, title: string, kind: LocationType } | null }> }> }; export type GetPatientQueryVariables = Exact<{ id: Scalars['ID']['input']; }>; -export type GetPatientQuery = { __typename?: 'Query', patient?: { __typename?: 'PatientType', id: string, firstname: string, lastname: string, birthdate: any, sex: Sex, state: PatientState, description?: string | null, checksum: string, assignedLocation?: { __typename?: 'LocationNodeType', id: string, title: string } | null, assignedLocations: Array<{ __typename?: 'LocationNodeType', id: string, title: string }>, clinic: { __typename?: 'LocationNodeType', id: string, title: string, kind: LocationType, parent?: { __typename?: 'LocationNodeType', id: string, title: string, parent?: { __typename?: 'LocationNodeType', id: string, title: string, parent?: { __typename?: 'LocationNodeType', id: string, title: string, parent?: { __typename?: 'LocationNodeType', id: string, title: string } | null } | null } | null } | null }, position?: { __typename?: 'LocationNodeType', id: string, title: string, kind: LocationType, parent?: { __typename?: 'LocationNodeType', id: string, title: string, parent?: { __typename?: 'LocationNodeType', id: string, title: string, parent?: { __typename?: 'LocationNodeType', id: string, title: string, parent?: { __typename?: 'LocationNodeType', id: string, title: string } | null } | null } | null } | null } | null, teams: Array<{ __typename?: 'LocationNodeType', id: string, title: string, kind: LocationType, parent?: { __typename?: 'LocationNodeType', id: string, title: string, parent?: { __typename?: 'LocationNodeType', id: string, title: string, parent?: { __typename?: 'LocationNodeType', id: string, title: string, parent?: { __typename?: 'LocationNodeType', id: string, title: string } | null } | null } | null } | null }>, tasks: Array<{ __typename?: 'TaskType', id: string, title: string, description?: string | null, done: boolean, dueDate?: any | null, priority?: string | null, estimatedTime?: number | null, updateDate?: any | null, assignees: Array<{ __typename?: 'UserType', id: string, name: string, avatarUrl?: string | null, lastOnline?: any | null, isOnline: boolean }>, assigneeTeam?: { __typename?: 'LocationNodeType', id: string, title: string, kind: LocationType } | null }>, properties: Array<{ __typename?: 'PropertyValueType', id: string, textValue?: string | null, numberValue?: number | null, booleanValue?: boolean | null, dateValue?: any | null, dateTimeValue?: any | null, selectValue?: string | null, multiSelectValues?: Array | null, userValue?: string | null, definition: { __typename?: 'PropertyDefinitionType', id: string, name: string, description?: string | null, fieldType: FieldType, isActive: boolean, allowedEntities: Array, options: Array }, user?: { __typename?: 'UserType', id: string, name: string, avatarUrl?: string | null, lastOnline?: any | null, isOnline: boolean } | null, team?: { __typename?: 'LocationNodeType', id: string, title: string, kind: LocationType } | null }> } | null }; +export type GetPatientQuery = { __typename?: 'Query', patient?: { __typename?: 'PatientType', id: string, firstname: string, lastname: string, birthdate: any, sex: Sex, state: PatientState, description?: string | null, checksum: string, assignedLocation?: { __typename?: 'LocationNodeType', id: string, title: string } | null, assignedLocations: Array<{ __typename?: 'LocationNodeType', id: string, title: string }>, clinic: { __typename?: 'LocationNodeType', id: string, title: string, kind: LocationType, parent?: { __typename?: 'LocationNodeType', id: string, title: string, parent?: { __typename?: 'LocationNodeType', id: string, title: string, parent?: { __typename?: 'LocationNodeType', id: string, title: string, parent?: { __typename?: 'LocationNodeType', id: string, title: string } | null } | null } | null } | null }, position?: { __typename?: 'LocationNodeType', id: string, title: string, kind: LocationType, parent?: { __typename?: 'LocationNodeType', id: string, title: string, parent?: { __typename?: 'LocationNodeType', id: string, title: string, parent?: { __typename?: 'LocationNodeType', id: string, title: string, parent?: { __typename?: 'LocationNodeType', id: string, title: string } | null } | null } | null } | null } | null, teams: Array<{ __typename?: 'LocationNodeType', id: string, title: string, kind: LocationType, parent?: { __typename?: 'LocationNodeType', id: string, title: string, parent?: { __typename?: 'LocationNodeType', id: string, title: string, parent?: { __typename?: 'LocationNodeType', id: string, title: string, parent?: { __typename?: 'LocationNodeType', id: string, title: string } | null } | null } | null } | null }>, tasks: Array<{ __typename?: 'TaskType', id: string, title: string, description?: string | null, done: boolean, dueDate?: any | null, priority?: string | null, estimatedTime?: number | null, updateDate?: any | null, sourceTaskPresetId?: string | null, assignees: Array<{ __typename?: 'UserType', id: string, name: string, avatarUrl?: string | null, lastOnline?: any | null, isOnline: boolean }>, assigneeTeam?: { __typename?: 'LocationNodeType', id: string, title: string, kind: LocationType } | null }>, properties: Array<{ __typename?: 'PropertyValueType', id: string, textValue?: string | null, numberValue?: number | null, booleanValue?: boolean | null, dateValue?: any | null, dateTimeValue?: any | null, selectValue?: string | null, multiSelectValues?: Array | null, userValue?: string | null, definition: { __typename?: 'PropertyDefinitionType', id: string, name: string, description?: string | null, fieldType: FieldType, isActive: boolean, allowedEntities: Array, options: Array }, user?: { __typename?: 'UserType', id: string, name: string, avatarUrl?: string | null, lastOnline?: any | null, isOnline: boolean } | null, team?: { __typename?: 'LocationNodeType', id: string, title: string, kind: LocationType } | null }> } | null }; export type GetPatientsQueryVariables = Exact<{ locationId?: InputMaybe; @@ -911,14 +1024,14 @@ export type GetPatientsQueryVariables = Exact<{ }>; -export type GetPatientsQuery = { __typename?: 'Query', patientsTotal: number, patients: Array<{ __typename?: 'PatientType', id: string, name: string, firstname: string, lastname: string, birthdate: any, sex: Sex, state: PatientState, assignedLocation?: { __typename?: 'LocationNodeType', id: string, title: string, parent?: { __typename?: 'LocationNodeType', id: string, title: string } | null } | null, assignedLocations: Array<{ __typename?: 'LocationNodeType', id: string, title: string, kind: LocationType, parent?: { __typename?: 'LocationNodeType', id: string, title: string, parent?: { __typename?: 'LocationNodeType', id: string, title: string, parent?: { __typename?: 'LocationNodeType', id: string, title: string } | null } | null } | null }>, clinic: { __typename?: 'LocationNodeType', id: string, title: string, kind: LocationType, parent?: { __typename?: 'LocationNodeType', id: string, title: string, parent?: { __typename?: 'LocationNodeType', id: string, title: string, parent?: { __typename?: 'LocationNodeType', id: string, title: string, parent?: { __typename?: 'LocationNodeType', id: string, title: string } | null } | null } | null } | null }, position?: { __typename?: 'LocationNodeType', id: string, title: string, kind: LocationType, parent?: { __typename?: 'LocationNodeType', id: string, title: string, kind: LocationType, parent?: { __typename?: 'LocationNodeType', id: string, title: string, kind: LocationType, parent?: { __typename?: 'LocationNodeType', id: string, title: string, kind: LocationType, parent?: { __typename?: 'LocationNodeType', id: string, title: string, kind: LocationType } | null } | null } | null } | null } | null, teams: Array<{ __typename?: 'LocationNodeType', id: string, title: string, kind: LocationType, parent?: { __typename?: 'LocationNodeType', id: string, title: string, parent?: { __typename?: 'LocationNodeType', id: string, title: string, parent?: { __typename?: 'LocationNodeType', id: string, title: string, parent?: { __typename?: 'LocationNodeType', id: string, title: string } | null } | null } | null } | null }>, tasks: Array<{ __typename?: 'TaskType', id: string, title: string, description?: string | null, done: boolean, dueDate?: any | null, priority?: string | null, estimatedTime?: number | null, creationDate: any, updateDate?: any | null, assignees: Array<{ __typename?: 'UserType', id: string, name: string, avatarUrl?: string | null, lastOnline?: any | null, isOnline: boolean }>, assigneeTeam?: { __typename?: 'LocationNodeType', id: string, title: string, kind: LocationType } | null }>, properties: Array<{ __typename?: 'PropertyValueType', id: string, textValue?: string | null, numberValue?: number | null, booleanValue?: boolean | null, dateValue?: any | null, dateTimeValue?: any | null, selectValue?: string | null, multiSelectValues?: Array | null, userValue?: string | null, definition: { __typename?: 'PropertyDefinitionType', id: string, name: string, description?: string | null, fieldType: FieldType, isActive: boolean, allowedEntities: Array, options: Array }, user?: { __typename?: 'UserType', id: string, name: string, avatarUrl?: string | null, lastOnline?: any | null, isOnline: boolean } | null, team?: { __typename?: 'LocationNodeType', id: string, title: string, kind: LocationType } | null }> }> }; +export type GetPatientsQuery = { __typename?: 'Query', patientsTotal: number, patients: Array<{ __typename?: 'PatientType', id: string, name: string, firstname: string, lastname: string, birthdate: any, sex: Sex, state: PatientState, assignedLocation?: { __typename?: 'LocationNodeType', id: string, title: string, parent?: { __typename?: 'LocationNodeType', id: string, title: string } | null } | null, assignedLocations: Array<{ __typename?: 'LocationNodeType', id: string, title: string, kind: LocationType, parent?: { __typename?: 'LocationNodeType', id: string, title: string, parent?: { __typename?: 'LocationNodeType', id: string, title: string, parent?: { __typename?: 'LocationNodeType', id: string, title: string } | null } | null } | null }>, clinic: { __typename?: 'LocationNodeType', id: string, title: string, kind: LocationType, parent?: { __typename?: 'LocationNodeType', id: string, title: string, parent?: { __typename?: 'LocationNodeType', id: string, title: string, parent?: { __typename?: 'LocationNodeType', id: string, title: string, parent?: { __typename?: 'LocationNodeType', id: string, title: string } | null } | null } | null } | null }, position?: { __typename?: 'LocationNodeType', id: string, title: string, kind: LocationType, parent?: { __typename?: 'LocationNodeType', id: string, title: string, kind: LocationType, parent?: { __typename?: 'LocationNodeType', id: string, title: string, kind: LocationType, parent?: { __typename?: 'LocationNodeType', id: string, title: string, kind: LocationType, parent?: { __typename?: 'LocationNodeType', id: string, title: string, kind: LocationType } | null } | null } | null } | null } | null, teams: Array<{ __typename?: 'LocationNodeType', id: string, title: string, kind: LocationType, parent?: { __typename?: 'LocationNodeType', id: string, title: string, parent?: { __typename?: 'LocationNodeType', id: string, title: string, parent?: { __typename?: 'LocationNodeType', id: string, title: string, parent?: { __typename?: 'LocationNodeType', id: string, title: string } | null } | null } | null } | null }>, tasks: Array<{ __typename?: 'TaskType', id: string, title: string, description?: string | null, done: boolean, dueDate?: any | null, priority?: string | null, estimatedTime?: number | null, creationDate: any, updateDate?: any | null, sourceTaskPresetId?: string | null, assignees: Array<{ __typename?: 'UserType', id: string, name: string, avatarUrl?: string | null, lastOnline?: any | null, isOnline: boolean }>, assigneeTeam?: { __typename?: 'LocationNodeType', id: string, title: string, kind: LocationType } | null }>, properties: Array<{ __typename?: 'PropertyValueType', id: string, textValue?: string | null, numberValue?: number | null, booleanValue?: boolean | null, dateValue?: any | null, dateTimeValue?: any | null, selectValue?: string | null, multiSelectValues?: Array | null, userValue?: string | null, definition: { __typename?: 'PropertyDefinitionType', id: string, name: string, description?: string | null, fieldType: FieldType, isActive: boolean, allowedEntities: Array, options: Array }, user?: { __typename?: 'UserType', id: string, name: string, avatarUrl?: string | null, lastOnline?: any | null, isOnline: boolean } | null, team?: { __typename?: 'LocationNodeType', id: string, title: string, kind: LocationType } | null }> }> }; export type GetTaskQueryVariables = Exact<{ id: Scalars['ID']['input']; }>; -export type GetTaskQuery = { __typename?: 'Query', task?: { __typename?: 'TaskType', id: string, title: string, description?: string | null, done: boolean, dueDate?: any | null, priority?: string | null, estimatedTime?: number | null, checksum: string, updateDate?: any | null, patient?: { __typename?: 'PatientType', id: string, name: string } | null, assignees: Array<{ __typename?: 'UserType', id: string, name: string, avatarUrl?: string | null, lastOnline?: any | null, isOnline: boolean }>, assigneeTeam?: { __typename?: 'LocationNodeType', id: string, title: string, kind: LocationType } | null, properties: Array<{ __typename?: 'PropertyValueType', id: string, textValue?: string | null, numberValue?: number | null, booleanValue?: boolean | null, dateValue?: any | null, dateTimeValue?: any | null, selectValue?: string | null, multiSelectValues?: Array | null, userValue?: string | null, definition: { __typename?: 'PropertyDefinitionType', id: string, name: string, description?: string | null, fieldType: FieldType, isActive: boolean, allowedEntities: Array, options: Array }, user?: { __typename?: 'UserType', id: string, name: string, avatarUrl?: string | null, lastOnline?: any | null, isOnline: boolean } | null, team?: { __typename?: 'LocationNodeType', id: string, title: string, kind: LocationType } | null }> } | null }; +export type GetTaskQuery = { __typename?: 'Query', task?: { __typename?: 'TaskType', id: string, title: string, description?: string | null, done: boolean, dueDate?: any | null, priority?: string | null, estimatedTime?: number | null, checksum: string, updateDate?: any | null, sourceTaskPresetId?: string | null, patient?: { __typename?: 'PatientType', id: string, name: string } | null, assignees: Array<{ __typename?: 'UserType', id: string, name: string, avatarUrl?: string | null, lastOnline?: any | null, isOnline: boolean }>, assigneeTeam?: { __typename?: 'LocationNodeType', id: string, title: string, kind: LocationType } | null, properties: Array<{ __typename?: 'PropertyValueType', id: string, textValue?: string | null, numberValue?: number | null, booleanValue?: boolean | null, dateValue?: any | null, dateTimeValue?: any | null, selectValue?: string | null, multiSelectValues?: Array | null, userValue?: string | null, definition: { __typename?: 'PropertyDefinitionType', id: string, name: string, description?: string | null, fieldType: FieldType, isActive: boolean, allowedEntities: Array, options: Array }, user?: { __typename?: 'UserType', id: string, name: string, avatarUrl?: string | null, lastOnline?: any | null, isOnline: boolean } | null, team?: { __typename?: 'LocationNodeType', id: string, title: string, kind: LocationType } | null }> } | null }; export type GetTasksQueryVariables = Exact<{ rootLocationIds?: InputMaybe | Scalars['ID']['input']>; @@ -931,7 +1044,7 @@ export type GetTasksQueryVariables = Exact<{ }>; -export type GetTasksQuery = { __typename?: 'Query', tasksTotal: number, tasks: Array<{ __typename?: 'TaskType', id: string, title: string, description?: string | null, done: boolean, dueDate?: any | null, priority?: string | null, estimatedTime?: number | null, creationDate: any, updateDate?: any | null, patient?: { __typename?: 'PatientType', id: string, name: string, firstname: string, lastname: string, birthdate: any, sex: Sex, state: PatientState, assignedLocation?: { __typename?: 'LocationNodeType', id: string, title: string, parent?: { __typename?: 'LocationNodeType', id: string, title: string } | null } | null, assignedLocations: Array<{ __typename?: 'LocationNodeType', id: string, title: string, kind: LocationType, parent?: { __typename?: 'LocationNodeType', id: string, title: string, parent?: { __typename?: 'LocationNodeType', id: string, title: string, parent?: { __typename?: 'LocationNodeType', id: string, title: string } | null } | null } | null }>, clinic: { __typename?: 'LocationNodeType', id: string, title: string, kind: LocationType, parent?: { __typename?: 'LocationNodeType', id: string, title: string, parent?: { __typename?: 'LocationNodeType', id: string, title: string, parent?: { __typename?: 'LocationNodeType', id: string, title: string, parent?: { __typename?: 'LocationNodeType', id: string, title: string } | null } | null } | null } | null }, position?: { __typename?: 'LocationNodeType', id: string, title: string, kind: LocationType, parent?: { __typename?: 'LocationNodeType', id: string, title: string, kind: LocationType, parent?: { __typename?: 'LocationNodeType', id: string, title: string, kind: LocationType, parent?: { __typename?: 'LocationNodeType', id: string, title: string, kind: LocationType } | null } | null } | null } | null, teams: Array<{ __typename?: 'LocationNodeType', id: string, title: string, kind: LocationType, parent?: { __typename?: 'LocationNodeType', id: string, title: string, parent?: { __typename?: 'LocationNodeType', id: string, title: string, parent?: { __typename?: 'LocationNodeType', id: string, title: string, parent?: { __typename?: 'LocationNodeType', id: string, title: string } | null } | null } | null } | null }>, properties: Array<{ __typename?: 'PropertyValueType', id: string, textValue?: string | null, numberValue?: number | null, booleanValue?: boolean | null, dateValue?: any | null, dateTimeValue?: any | null, selectValue?: string | null, multiSelectValues?: Array | null, userValue?: string | null, definition: { __typename?: 'PropertyDefinitionType', id: string, name: string, description?: string | null, fieldType: FieldType, isActive: boolean, allowedEntities: Array, options: Array }, user?: { __typename?: 'UserType', id: string, name: string, avatarUrl?: string | null, lastOnline?: any | null, isOnline: boolean } | null, team?: { __typename?: 'LocationNodeType', id: string, title: string, kind: LocationType } | null }> } | null, assignees: Array<{ __typename?: 'UserType', id: string, name: string, avatarUrl?: string | null, lastOnline?: any | null, isOnline: boolean }>, assigneeTeam?: { __typename?: 'LocationNodeType', id: string, title: string, kind: LocationType } | null, properties: Array<{ __typename?: 'PropertyValueType', id: string, textValue?: string | null, numberValue?: number | null, booleanValue?: boolean | null, dateValue?: any | null, dateTimeValue?: any | null, selectValue?: string | null, multiSelectValues?: Array | null, userValue?: string | null, definition: { __typename?: 'PropertyDefinitionType', id: string, name: string, description?: string | null, fieldType: FieldType, isActive: boolean, allowedEntities: Array, options: Array }, user?: { __typename?: 'UserType', id: string, name: string, avatarUrl?: string | null, lastOnline?: any | null, isOnline: boolean } | null, team?: { __typename?: 'LocationNodeType', id: string, title: string, kind: LocationType } | null }> }> }; +export type GetTasksQuery = { __typename?: 'Query', tasksTotal: number, tasks: Array<{ __typename?: 'TaskType', id: string, title: string, description?: string | null, done: boolean, dueDate?: any | null, priority?: string | null, estimatedTime?: number | null, creationDate: any, updateDate?: any | null, sourceTaskPresetId?: string | null, patient?: { __typename?: 'PatientType', id: string, name: string, firstname: string, lastname: string, birthdate: any, sex: Sex, state: PatientState, assignedLocation?: { __typename?: 'LocationNodeType', id: string, title: string, parent?: { __typename?: 'LocationNodeType', id: string, title: string } | null } | null, assignedLocations: Array<{ __typename?: 'LocationNodeType', id: string, title: string, kind: LocationType, parent?: { __typename?: 'LocationNodeType', id: string, title: string, parent?: { __typename?: 'LocationNodeType', id: string, title: string, parent?: { __typename?: 'LocationNodeType', id: string, title: string } | null } | null } | null }>, clinic: { __typename?: 'LocationNodeType', id: string, title: string, kind: LocationType, parent?: { __typename?: 'LocationNodeType', id: string, title: string, parent?: { __typename?: 'LocationNodeType', id: string, title: string, parent?: { __typename?: 'LocationNodeType', id: string, title: string, parent?: { __typename?: 'LocationNodeType', id: string, title: string } | null } | null } | null } | null }, position?: { __typename?: 'LocationNodeType', id: string, title: string, kind: LocationType, parent?: { __typename?: 'LocationNodeType', id: string, title: string, kind: LocationType, parent?: { __typename?: 'LocationNodeType', id: string, title: string, kind: LocationType, parent?: { __typename?: 'LocationNodeType', id: string, title: string, kind: LocationType } | null } | null } | null } | null, teams: Array<{ __typename?: 'LocationNodeType', id: string, title: string, kind: LocationType, parent?: { __typename?: 'LocationNodeType', id: string, title: string, parent?: { __typename?: 'LocationNodeType', id: string, title: string, parent?: { __typename?: 'LocationNodeType', id: string, title: string, parent?: { __typename?: 'LocationNodeType', id: string, title: string } | null } | null } | null } | null }>, properties: Array<{ __typename?: 'PropertyValueType', id: string, textValue?: string | null, numberValue?: number | null, booleanValue?: boolean | null, dateValue?: any | null, dateTimeValue?: any | null, selectValue?: string | null, multiSelectValues?: Array | null, userValue?: string | null, definition: { __typename?: 'PropertyDefinitionType', id: string, name: string, description?: string | null, fieldType: FieldType, isActive: boolean, allowedEntities: Array, options: Array }, user?: { __typename?: 'UserType', id: string, name: string, avatarUrl?: string | null, lastOnline?: any | null, isOnline: boolean } | null, team?: { __typename?: 'LocationNodeType', id: string, title: string, kind: LocationType } | null }> } | null, assignees: Array<{ __typename?: 'UserType', id: string, name: string, avatarUrl?: string | null, lastOnline?: any | null, isOnline: boolean }>, assigneeTeam?: { __typename?: 'LocationNodeType', id: string, title: string, kind: LocationType } | null, properties: Array<{ __typename?: 'PropertyValueType', id: string, textValue?: string | null, numberValue?: number | null, booleanValue?: boolean | null, dateValue?: any | null, dateTimeValue?: any | null, selectValue?: string | null, multiSelectValues?: Array | null, userValue?: string | null, definition: { __typename?: 'PropertyDefinitionType', id: string, name: string, description?: string | null, fieldType: FieldType, isActive: boolean, allowedEntities: Array, options: Array }, user?: { __typename?: 'UserType', id: string, name: string, avatarUrl?: string | null, lastOnline?: any | null, isOnline: boolean } | null, team?: { __typename?: 'LocationNodeType', id: string, title: string, kind: LocationType } | null }> }> }; export type GetUserQueryVariables = Exact<{ id: Scalars['ID']['input']; @@ -1215,6 +1328,47 @@ export type UnassignTaskFromTeamMutationVariables = Exact<{ export type UnassignTaskFromTeamMutation = { __typename?: 'Mutation', unassignTaskFromTeam: { __typename?: 'TaskType', id: string, assigneeTeam?: { __typename?: 'LocationNodeType', id: string, title: string, kind: LocationType } | null } }; +export type ApplyTaskGraphMutationVariables = Exact<{ + data: ApplyTaskGraphInput; +}>; + + +export type ApplyTaskGraphMutation = { __typename?: 'Mutation', applyTaskGraph: Array<{ __typename?: 'TaskType', id: string, title: string, description?: string | null, done: boolean, dueDate?: any | null, updateDate?: any | null, sourceTaskPresetId?: string | null, assignees: Array<{ __typename?: 'UserType', id: string, name: string, avatarUrl?: string | null, lastOnline?: any | null, isOnline: boolean }>, patient?: { __typename?: 'PatientType', id: string, name: string } | null }> }; + +export type CreateTaskPresetMutationVariables = Exact<{ + data: CreateTaskPresetInput; +}>; + + +export type CreateTaskPresetMutation = { __typename?: 'Mutation', createTaskPreset: { __typename?: 'TaskPresetType', id: string, name: string, key: string, scope: string, ownerUserId?: string | null, graph: { __typename?: 'TaskGraphType', nodes: Array<{ __typename?: 'TaskGraphNodeType', id: string, title: string, description?: string | null, priority?: string | null, estimatedTime?: number | null }>, edges: Array<{ __typename?: 'TaskGraphEdgeType', fromId: string, toId: string }> } } }; + +export type UpdateTaskPresetMutationVariables = Exact<{ + id: Scalars['ID']['input']; + data: UpdateTaskPresetInput; +}>; + + +export type UpdateTaskPresetMutation = { __typename?: 'Mutation', updateTaskPreset: { __typename?: 'TaskPresetType', id: string, name: string, key: string, scope: string, ownerUserId?: string | null, graph: { __typename?: 'TaskGraphType', nodes: Array<{ __typename?: 'TaskGraphNodeType', id: string, title: string, description?: string | null, priority?: string | null, estimatedTime?: number | null }>, edges: Array<{ __typename?: 'TaskGraphEdgeType', fromId: string, toId: string }> } } }; + +export type DeleteTaskPresetMutationVariables = Exact<{ + id: Scalars['ID']['input']; +}>; + + +export type DeleteTaskPresetMutation = { __typename?: 'Mutation', deleteTaskPreset: boolean }; + +export type TaskPresetsQueryVariables = Exact<{ [key: string]: never; }>; + + +export type TaskPresetsQuery = { __typename?: 'Query', taskPresets: Array<{ __typename?: 'TaskPresetType', id: string, name: string, key: string, scope: string, ownerUserId?: string | null, graph: { __typename?: 'TaskGraphType', nodes: Array<{ __typename?: 'TaskGraphNodeType', id: string, title: string, description?: string | null, priority?: string | null, estimatedTime?: number | null }>, edges: Array<{ __typename?: 'TaskGraphEdgeType', fromId: string, toId: string }> } }> }; + +export type TaskPresetQueryVariables = Exact<{ + id: Scalars['ID']['input']; +}>; + + +export type TaskPresetQuery = { __typename?: 'Query', taskPreset?: { __typename?: 'TaskPresetType', id: string, name: string, key: string, scope: string, ownerUserId?: string | null, graph: { __typename?: 'TaskGraphType', nodes: Array<{ __typename?: 'TaskGraphNodeType', id: string, title: string, description?: string | null, priority?: string | null, estimatedTime?: number | null }>, edges: Array<{ __typename?: 'TaskGraphEdgeType', fromId: string, toId: string }> } } | null }; + export type UpdateProfilePictureMutationVariables = Exact<{ data: UpdateProfilePictureInput; }>; @@ -1227,11 +1381,11 @@ export const GetAuditLogsDocument = {"kind":"Document","definitions":[{"kind":"O export const GetLocationNodeDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetLocationNode"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"locationNode"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"id"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"kind"}},{"kind":"Field","name":{"kind":"Name","value":"parentId"}},{"kind":"Field","name":{"kind":"Name","value":"parent"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"kind"}},{"kind":"Field","name":{"kind":"Name","value":"parentId"}},{"kind":"Field","name":{"kind":"Name","value":"parent"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"kind"}},{"kind":"Field","name":{"kind":"Name","value":"parentId"}},{"kind":"Field","name":{"kind":"Name","value":"parent"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"kind"}},{"kind":"Field","name":{"kind":"Name","value":"parentId"}},{"kind":"Field","name":{"kind":"Name","value":"parent"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"kind"}},{"kind":"Field","name":{"kind":"Name","value":"parentId"}}]}}]}}]}}]}}]}}]}}]} as unknown as DocumentNode; export const GetLocationsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetLocations"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"limit"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"offset"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"locationNodes"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"limit"},"value":{"kind":"Variable","name":{"kind":"Name","value":"limit"}}},{"kind":"Argument","name":{"kind":"Name","value":"offset"},"value":{"kind":"Variable","name":{"kind":"Name","value":"offset"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"kind"}},{"kind":"Field","name":{"kind":"Name","value":"parentId"}}]}}]}}]} as unknown as DocumentNode; export const GetMyTasksDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetMyTasks"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"me"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"tasks"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"done"}},{"kind":"Field","name":{"kind":"Name","value":"dueDate"}},{"kind":"Field","name":{"kind":"Name","value":"priority"}},{"kind":"Field","name":{"kind":"Name","value":"estimatedTime"}},{"kind":"Field","name":{"kind":"Name","value":"creationDate"}},{"kind":"Field","name":{"kind":"Name","value":"updateDate"}},{"kind":"Field","name":{"kind":"Name","value":"patient"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"assignedLocation"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"parent"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"assignedLocations"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"kind"}},{"kind":"Field","name":{"kind":"Name","value":"parent"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"parent"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}}]}}]}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"assignees"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"avatarUrl"}},{"kind":"Field","name":{"kind":"Name","value":"lastOnline"}},{"kind":"Field","name":{"kind":"Name","value":"isOnline"}}]}}]}}]}}]}}]} as unknown as DocumentNode; -export const GetOverviewDataDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetOverviewData"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"rootLocationIds"}},"type":{"kind":"ListType","type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"recentPatientsFilters"}},"type":{"kind":"ListType","type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"QueryFilterClauseInput"}}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"recentPatientsSorts"}},"type":{"kind":"ListType","type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"QuerySortClauseInput"}}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"recentPatientsPagination"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"PaginationInput"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"recentPatientsSearch"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"QuerySearchInput"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"recentTasksFilters"}},"type":{"kind":"ListType","type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"QueryFilterClauseInput"}}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"recentTasksSorts"}},"type":{"kind":"ListType","type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"QuerySortClauseInput"}}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"recentTasksPagination"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"PaginationInput"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"recentTasksSearch"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"QuerySearchInput"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"recentPatients"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"rootLocationIds"},"value":{"kind":"Variable","name":{"kind":"Name","value":"rootLocationIds"}}},{"kind":"Argument","name":{"kind":"Name","value":"filters"},"value":{"kind":"Variable","name":{"kind":"Name","value":"recentPatientsFilters"}}},{"kind":"Argument","name":{"kind":"Name","value":"sorts"},"value":{"kind":"Variable","name":{"kind":"Name","value":"recentPatientsSorts"}}},{"kind":"Argument","name":{"kind":"Name","value":"pagination"},"value":{"kind":"Variable","name":{"kind":"Name","value":"recentPatientsPagination"}}},{"kind":"Argument","name":{"kind":"Name","value":"search"},"value":{"kind":"Variable","name":{"kind":"Name","value":"recentPatientsSearch"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"firstname"}},{"kind":"Field","name":{"kind":"Name","value":"lastname"}},{"kind":"Field","name":{"kind":"Name","value":"sex"}},{"kind":"Field","name":{"kind":"Name","value":"birthdate"}},{"kind":"Field","name":{"kind":"Name","value":"state"}},{"kind":"Field","name":{"kind":"Name","value":"position"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"kind"}},{"kind":"Field","name":{"kind":"Name","value":"parent"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"tasks"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"done"}},{"kind":"Field","name":{"kind":"Name","value":"updateDate"}}]}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"definition"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"fieldType"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}},{"kind":"Field","name":{"kind":"Name","value":"allowedEntities"}},{"kind":"Field","name":{"kind":"Name","value":"options"}}]}},{"kind":"Field","name":{"kind":"Name","value":"textValue"}},{"kind":"Field","name":{"kind":"Name","value":"numberValue"}},{"kind":"Field","name":{"kind":"Name","value":"booleanValue"}},{"kind":"Field","name":{"kind":"Name","value":"dateValue"}},{"kind":"Field","name":{"kind":"Name","value":"dateTimeValue"}},{"kind":"Field","name":{"kind":"Name","value":"selectValue"}},{"kind":"Field","name":{"kind":"Name","value":"multiSelectValues"}},{"kind":"Field","name":{"kind":"Name","value":"userValue"}},{"kind":"Field","name":{"kind":"Name","value":"user"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"avatarUrl"}},{"kind":"Field","name":{"kind":"Name","value":"lastOnline"}},{"kind":"Field","name":{"kind":"Name","value":"isOnline"}}]}},{"kind":"Field","name":{"kind":"Name","value":"team"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"kind"}}]}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"recentPatientsTotal"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"rootLocationIds"},"value":{"kind":"Variable","name":{"kind":"Name","value":"rootLocationIds"}}},{"kind":"Argument","name":{"kind":"Name","value":"filters"},"value":{"kind":"Variable","name":{"kind":"Name","value":"recentPatientsFilters"}}},{"kind":"Argument","name":{"kind":"Name","value":"sorts"},"value":{"kind":"Variable","name":{"kind":"Name","value":"recentPatientsSorts"}}},{"kind":"Argument","name":{"kind":"Name","value":"search"},"value":{"kind":"Variable","name":{"kind":"Name","value":"recentPatientsSearch"}}}]},{"kind":"Field","name":{"kind":"Name","value":"recentTasks"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"rootLocationIds"},"value":{"kind":"Variable","name":{"kind":"Name","value":"rootLocationIds"}}},{"kind":"Argument","name":{"kind":"Name","value":"filters"},"value":{"kind":"Variable","name":{"kind":"Name","value":"recentTasksFilters"}}},{"kind":"Argument","name":{"kind":"Name","value":"sorts"},"value":{"kind":"Variable","name":{"kind":"Name","value":"recentTasksSorts"}}},{"kind":"Argument","name":{"kind":"Name","value":"pagination"},"value":{"kind":"Variable","name":{"kind":"Name","value":"recentTasksPagination"}}},{"kind":"Argument","name":{"kind":"Name","value":"search"},"value":{"kind":"Variable","name":{"kind":"Name","value":"recentTasksSearch"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"done"}},{"kind":"Field","name":{"kind":"Name","value":"dueDate"}},{"kind":"Field","name":{"kind":"Name","value":"creationDate"}},{"kind":"Field","name":{"kind":"Name","value":"updateDate"}},{"kind":"Field","name":{"kind":"Name","value":"priority"}},{"kind":"Field","name":{"kind":"Name","value":"estimatedTime"}},{"kind":"Field","name":{"kind":"Name","value":"assignees"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"avatarUrl"}},{"kind":"Field","name":{"kind":"Name","value":"lastOnline"}},{"kind":"Field","name":{"kind":"Name","value":"isOnline"}}]}},{"kind":"Field","name":{"kind":"Name","value":"assigneeTeam"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"kind"}}]}},{"kind":"Field","name":{"kind":"Name","value":"patient"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"position"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"kind"}},{"kind":"Field","name":{"kind":"Name","value":"parent"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}}]}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"definition"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"fieldType"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}},{"kind":"Field","name":{"kind":"Name","value":"allowedEntities"}},{"kind":"Field","name":{"kind":"Name","value":"options"}}]}},{"kind":"Field","name":{"kind":"Name","value":"textValue"}},{"kind":"Field","name":{"kind":"Name","value":"numberValue"}},{"kind":"Field","name":{"kind":"Name","value":"booleanValue"}},{"kind":"Field","name":{"kind":"Name","value":"dateValue"}},{"kind":"Field","name":{"kind":"Name","value":"dateTimeValue"}},{"kind":"Field","name":{"kind":"Name","value":"selectValue"}},{"kind":"Field","name":{"kind":"Name","value":"multiSelectValues"}},{"kind":"Field","name":{"kind":"Name","value":"userValue"}},{"kind":"Field","name":{"kind":"Name","value":"user"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"avatarUrl"}},{"kind":"Field","name":{"kind":"Name","value":"lastOnline"}},{"kind":"Field","name":{"kind":"Name","value":"isOnline"}}]}},{"kind":"Field","name":{"kind":"Name","value":"team"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"kind"}}]}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"recentTasksTotal"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"rootLocationIds"},"value":{"kind":"Variable","name":{"kind":"Name","value":"rootLocationIds"}}},{"kind":"Argument","name":{"kind":"Name","value":"filters"},"value":{"kind":"Variable","name":{"kind":"Name","value":"recentTasksFilters"}}},{"kind":"Argument","name":{"kind":"Name","value":"sorts"},"value":{"kind":"Variable","name":{"kind":"Name","value":"recentTasksSorts"}}},{"kind":"Argument","name":{"kind":"Name","value":"search"},"value":{"kind":"Variable","name":{"kind":"Name","value":"recentTasksSearch"}}}]}]}}]} as unknown as DocumentNode; -export const GetPatientDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetPatient"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"patient"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"id"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"firstname"}},{"kind":"Field","name":{"kind":"Name","value":"lastname"}},{"kind":"Field","name":{"kind":"Name","value":"birthdate"}},{"kind":"Field","name":{"kind":"Name","value":"sex"}},{"kind":"Field","name":{"kind":"Name","value":"state"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"checksum"}},{"kind":"Field","name":{"kind":"Name","value":"assignedLocation"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}}]}},{"kind":"Field","name":{"kind":"Name","value":"assignedLocations"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}}]}},{"kind":"Field","name":{"kind":"Name","value":"clinic"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"kind"}},{"kind":"Field","name":{"kind":"Name","value":"parent"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"parent"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"parent"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"parent"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}}]}}]}}]}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"position"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"kind"}},{"kind":"Field","name":{"kind":"Name","value":"parent"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"parent"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"parent"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"parent"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}}]}}]}}]}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"teams"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"kind"}},{"kind":"Field","name":{"kind":"Name","value":"parent"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"parent"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"parent"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"parent"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}}]}}]}}]}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"tasks"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"done"}},{"kind":"Field","name":{"kind":"Name","value":"dueDate"}},{"kind":"Field","name":{"kind":"Name","value":"priority"}},{"kind":"Field","name":{"kind":"Name","value":"estimatedTime"}},{"kind":"Field","name":{"kind":"Name","value":"updateDate"}},{"kind":"Field","name":{"kind":"Name","value":"assignees"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"avatarUrl"}},{"kind":"Field","name":{"kind":"Name","value":"lastOnline"}},{"kind":"Field","name":{"kind":"Name","value":"isOnline"}}]}},{"kind":"Field","name":{"kind":"Name","value":"assigneeTeam"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"kind"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"definition"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"fieldType"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}},{"kind":"Field","name":{"kind":"Name","value":"allowedEntities"}},{"kind":"Field","name":{"kind":"Name","value":"options"}}]}},{"kind":"Field","name":{"kind":"Name","value":"textValue"}},{"kind":"Field","name":{"kind":"Name","value":"numberValue"}},{"kind":"Field","name":{"kind":"Name","value":"booleanValue"}},{"kind":"Field","name":{"kind":"Name","value":"dateValue"}},{"kind":"Field","name":{"kind":"Name","value":"dateTimeValue"}},{"kind":"Field","name":{"kind":"Name","value":"selectValue"}},{"kind":"Field","name":{"kind":"Name","value":"multiSelectValues"}},{"kind":"Field","name":{"kind":"Name","value":"userValue"}},{"kind":"Field","name":{"kind":"Name","value":"user"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"avatarUrl"}},{"kind":"Field","name":{"kind":"Name","value":"lastOnline"}},{"kind":"Field","name":{"kind":"Name","value":"isOnline"}}]}},{"kind":"Field","name":{"kind":"Name","value":"team"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"kind"}}]}}]}}]}}]}}]} as unknown as DocumentNode; -export const GetPatientsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetPatients"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"locationId"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"rootLocationIds"}},"type":{"kind":"ListType","type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"states"}},"type":{"kind":"ListType","type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"PatientState"}}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"filters"}},"type":{"kind":"ListType","type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"QueryFilterClauseInput"}}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"sorts"}},"type":{"kind":"ListType","type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"QuerySortClauseInput"}}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"pagination"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"PaginationInput"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"search"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"QuerySearchInput"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"patients"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"locationNodeId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"locationId"}}},{"kind":"Argument","name":{"kind":"Name","value":"rootLocationIds"},"value":{"kind":"Variable","name":{"kind":"Name","value":"rootLocationIds"}}},{"kind":"Argument","name":{"kind":"Name","value":"states"},"value":{"kind":"Variable","name":{"kind":"Name","value":"states"}}},{"kind":"Argument","name":{"kind":"Name","value":"filters"},"value":{"kind":"Variable","name":{"kind":"Name","value":"filters"}}},{"kind":"Argument","name":{"kind":"Name","value":"sorts"},"value":{"kind":"Variable","name":{"kind":"Name","value":"sorts"}}},{"kind":"Argument","name":{"kind":"Name","value":"pagination"},"value":{"kind":"Variable","name":{"kind":"Name","value":"pagination"}}},{"kind":"Argument","name":{"kind":"Name","value":"search"},"value":{"kind":"Variable","name":{"kind":"Name","value":"search"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"firstname"}},{"kind":"Field","name":{"kind":"Name","value":"lastname"}},{"kind":"Field","name":{"kind":"Name","value":"birthdate"}},{"kind":"Field","name":{"kind":"Name","value":"sex"}},{"kind":"Field","name":{"kind":"Name","value":"state"}},{"kind":"Field","name":{"kind":"Name","value":"assignedLocation"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"parent"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"assignedLocations"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"kind"}},{"kind":"Field","name":{"kind":"Name","value":"parent"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"parent"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"parent"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}}]}}]}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"clinic"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"kind"}},{"kind":"Field","name":{"kind":"Name","value":"parent"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"parent"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"parent"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"parent"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}}]}}]}}]}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"position"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"kind"}},{"kind":"Field","name":{"kind":"Name","value":"parent"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"kind"}},{"kind":"Field","name":{"kind":"Name","value":"parent"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"kind"}},{"kind":"Field","name":{"kind":"Name","value":"parent"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"kind"}},{"kind":"Field","name":{"kind":"Name","value":"parent"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"kind"}}]}}]}}]}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"teams"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"kind"}},{"kind":"Field","name":{"kind":"Name","value":"parent"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"parent"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"parent"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"parent"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}}]}}]}}]}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"tasks"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"done"}},{"kind":"Field","name":{"kind":"Name","value":"dueDate"}},{"kind":"Field","name":{"kind":"Name","value":"priority"}},{"kind":"Field","name":{"kind":"Name","value":"estimatedTime"}},{"kind":"Field","name":{"kind":"Name","value":"creationDate"}},{"kind":"Field","name":{"kind":"Name","value":"updateDate"}},{"kind":"Field","name":{"kind":"Name","value":"assignees"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"avatarUrl"}},{"kind":"Field","name":{"kind":"Name","value":"lastOnline"}},{"kind":"Field","name":{"kind":"Name","value":"isOnline"}}]}},{"kind":"Field","name":{"kind":"Name","value":"assigneeTeam"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"kind"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"definition"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"fieldType"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}},{"kind":"Field","name":{"kind":"Name","value":"allowedEntities"}},{"kind":"Field","name":{"kind":"Name","value":"options"}}]}},{"kind":"Field","name":{"kind":"Name","value":"textValue"}},{"kind":"Field","name":{"kind":"Name","value":"numberValue"}},{"kind":"Field","name":{"kind":"Name","value":"booleanValue"}},{"kind":"Field","name":{"kind":"Name","value":"dateValue"}},{"kind":"Field","name":{"kind":"Name","value":"dateTimeValue"}},{"kind":"Field","name":{"kind":"Name","value":"selectValue"}},{"kind":"Field","name":{"kind":"Name","value":"multiSelectValues"}},{"kind":"Field","name":{"kind":"Name","value":"userValue"}},{"kind":"Field","name":{"kind":"Name","value":"user"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"avatarUrl"}},{"kind":"Field","name":{"kind":"Name","value":"lastOnline"}},{"kind":"Field","name":{"kind":"Name","value":"isOnline"}}]}},{"kind":"Field","name":{"kind":"Name","value":"team"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"kind"}}]}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"patientsTotal"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"locationNodeId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"locationId"}}},{"kind":"Argument","name":{"kind":"Name","value":"rootLocationIds"},"value":{"kind":"Variable","name":{"kind":"Name","value":"rootLocationIds"}}},{"kind":"Argument","name":{"kind":"Name","value":"states"},"value":{"kind":"Variable","name":{"kind":"Name","value":"states"}}},{"kind":"Argument","name":{"kind":"Name","value":"filters"},"value":{"kind":"Variable","name":{"kind":"Name","value":"filters"}}},{"kind":"Argument","name":{"kind":"Name","value":"sorts"},"value":{"kind":"Variable","name":{"kind":"Name","value":"sorts"}}},{"kind":"Argument","name":{"kind":"Name","value":"search"},"value":{"kind":"Variable","name":{"kind":"Name","value":"search"}}}]}]}}]} as unknown as DocumentNode; -export const GetTaskDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetTask"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"task"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"id"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"done"}},{"kind":"Field","name":{"kind":"Name","value":"dueDate"}},{"kind":"Field","name":{"kind":"Name","value":"priority"}},{"kind":"Field","name":{"kind":"Name","value":"estimatedTime"}},{"kind":"Field","name":{"kind":"Name","value":"checksum"}},{"kind":"Field","name":{"kind":"Name","value":"updateDate"}},{"kind":"Field","name":{"kind":"Name","value":"patient"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}},{"kind":"Field","name":{"kind":"Name","value":"assignees"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"avatarUrl"}},{"kind":"Field","name":{"kind":"Name","value":"lastOnline"}},{"kind":"Field","name":{"kind":"Name","value":"isOnline"}}]}},{"kind":"Field","name":{"kind":"Name","value":"assigneeTeam"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"kind"}}]}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"definition"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"fieldType"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}},{"kind":"Field","name":{"kind":"Name","value":"allowedEntities"}},{"kind":"Field","name":{"kind":"Name","value":"options"}}]}},{"kind":"Field","name":{"kind":"Name","value":"textValue"}},{"kind":"Field","name":{"kind":"Name","value":"numberValue"}},{"kind":"Field","name":{"kind":"Name","value":"booleanValue"}},{"kind":"Field","name":{"kind":"Name","value":"dateValue"}},{"kind":"Field","name":{"kind":"Name","value":"dateTimeValue"}},{"kind":"Field","name":{"kind":"Name","value":"selectValue"}},{"kind":"Field","name":{"kind":"Name","value":"multiSelectValues"}},{"kind":"Field","name":{"kind":"Name","value":"userValue"}},{"kind":"Field","name":{"kind":"Name","value":"user"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"avatarUrl"}},{"kind":"Field","name":{"kind":"Name","value":"lastOnline"}},{"kind":"Field","name":{"kind":"Name","value":"isOnline"}}]}},{"kind":"Field","name":{"kind":"Name","value":"team"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"kind"}}]}}]}}]}}]}}]} as unknown as DocumentNode; -export const GetTasksDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetTasks"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"rootLocationIds"}},"type":{"kind":"ListType","type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"assigneeId"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"assigneeTeamId"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"filters"}},"type":{"kind":"ListType","type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"QueryFilterClauseInput"}}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"sorts"}},"type":{"kind":"ListType","type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"QuerySortClauseInput"}}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"pagination"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"PaginationInput"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"search"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"QuerySearchInput"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"tasks"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"rootLocationIds"},"value":{"kind":"Variable","name":{"kind":"Name","value":"rootLocationIds"}}},{"kind":"Argument","name":{"kind":"Name","value":"assigneeId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"assigneeId"}}},{"kind":"Argument","name":{"kind":"Name","value":"assigneeTeamId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"assigneeTeamId"}}},{"kind":"Argument","name":{"kind":"Name","value":"filters"},"value":{"kind":"Variable","name":{"kind":"Name","value":"filters"}}},{"kind":"Argument","name":{"kind":"Name","value":"sorts"},"value":{"kind":"Variable","name":{"kind":"Name","value":"sorts"}}},{"kind":"Argument","name":{"kind":"Name","value":"pagination"},"value":{"kind":"Variable","name":{"kind":"Name","value":"pagination"}}},{"kind":"Argument","name":{"kind":"Name","value":"search"},"value":{"kind":"Variable","name":{"kind":"Name","value":"search"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"done"}},{"kind":"Field","name":{"kind":"Name","value":"dueDate"}},{"kind":"Field","name":{"kind":"Name","value":"priority"}},{"kind":"Field","name":{"kind":"Name","value":"estimatedTime"}},{"kind":"Field","name":{"kind":"Name","value":"creationDate"}},{"kind":"Field","name":{"kind":"Name","value":"updateDate"}},{"kind":"Field","name":{"kind":"Name","value":"patient"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"firstname"}},{"kind":"Field","name":{"kind":"Name","value":"lastname"}},{"kind":"Field","name":{"kind":"Name","value":"birthdate"}},{"kind":"Field","name":{"kind":"Name","value":"sex"}},{"kind":"Field","name":{"kind":"Name","value":"state"}},{"kind":"Field","name":{"kind":"Name","value":"assignedLocation"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"parent"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"assignedLocations"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"kind"}},{"kind":"Field","name":{"kind":"Name","value":"parent"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"parent"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"parent"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}}]}}]}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"clinic"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"kind"}},{"kind":"Field","name":{"kind":"Name","value":"parent"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"parent"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"parent"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"parent"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}}]}}]}}]}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"position"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"kind"}},{"kind":"Field","name":{"kind":"Name","value":"parent"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"kind"}},{"kind":"Field","name":{"kind":"Name","value":"parent"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"kind"}},{"kind":"Field","name":{"kind":"Name","value":"parent"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"kind"}}]}}]}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"teams"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"kind"}},{"kind":"Field","name":{"kind":"Name","value":"parent"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"parent"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"parent"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"parent"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}}]}}]}}]}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"definition"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"fieldType"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}},{"kind":"Field","name":{"kind":"Name","value":"allowedEntities"}},{"kind":"Field","name":{"kind":"Name","value":"options"}}]}},{"kind":"Field","name":{"kind":"Name","value":"textValue"}},{"kind":"Field","name":{"kind":"Name","value":"numberValue"}},{"kind":"Field","name":{"kind":"Name","value":"booleanValue"}},{"kind":"Field","name":{"kind":"Name","value":"dateValue"}},{"kind":"Field","name":{"kind":"Name","value":"dateTimeValue"}},{"kind":"Field","name":{"kind":"Name","value":"selectValue"}},{"kind":"Field","name":{"kind":"Name","value":"multiSelectValues"}},{"kind":"Field","name":{"kind":"Name","value":"userValue"}},{"kind":"Field","name":{"kind":"Name","value":"user"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"avatarUrl"}},{"kind":"Field","name":{"kind":"Name","value":"lastOnline"}},{"kind":"Field","name":{"kind":"Name","value":"isOnline"}}]}},{"kind":"Field","name":{"kind":"Name","value":"team"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"kind"}}]}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"assignees"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"avatarUrl"}},{"kind":"Field","name":{"kind":"Name","value":"lastOnline"}},{"kind":"Field","name":{"kind":"Name","value":"isOnline"}}]}},{"kind":"Field","name":{"kind":"Name","value":"assigneeTeam"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"kind"}}]}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"definition"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"fieldType"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}},{"kind":"Field","name":{"kind":"Name","value":"allowedEntities"}},{"kind":"Field","name":{"kind":"Name","value":"options"}}]}},{"kind":"Field","name":{"kind":"Name","value":"textValue"}},{"kind":"Field","name":{"kind":"Name","value":"numberValue"}},{"kind":"Field","name":{"kind":"Name","value":"booleanValue"}},{"kind":"Field","name":{"kind":"Name","value":"dateValue"}},{"kind":"Field","name":{"kind":"Name","value":"dateTimeValue"}},{"kind":"Field","name":{"kind":"Name","value":"selectValue"}},{"kind":"Field","name":{"kind":"Name","value":"multiSelectValues"}},{"kind":"Field","name":{"kind":"Name","value":"userValue"}},{"kind":"Field","name":{"kind":"Name","value":"user"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"avatarUrl"}},{"kind":"Field","name":{"kind":"Name","value":"lastOnline"}},{"kind":"Field","name":{"kind":"Name","value":"isOnline"}}]}},{"kind":"Field","name":{"kind":"Name","value":"team"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"kind"}}]}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"tasksTotal"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"rootLocationIds"},"value":{"kind":"Variable","name":{"kind":"Name","value":"rootLocationIds"}}},{"kind":"Argument","name":{"kind":"Name","value":"assigneeId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"assigneeId"}}},{"kind":"Argument","name":{"kind":"Name","value":"assigneeTeamId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"assigneeTeamId"}}},{"kind":"Argument","name":{"kind":"Name","value":"filters"},"value":{"kind":"Variable","name":{"kind":"Name","value":"filters"}}},{"kind":"Argument","name":{"kind":"Name","value":"sorts"},"value":{"kind":"Variable","name":{"kind":"Name","value":"sorts"}}},{"kind":"Argument","name":{"kind":"Name","value":"search"},"value":{"kind":"Variable","name":{"kind":"Name","value":"search"}}}]}]}}]} as unknown as DocumentNode; +export const GetOverviewDataDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetOverviewData"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"rootLocationIds"}},"type":{"kind":"ListType","type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"recentPatientsFilters"}},"type":{"kind":"ListType","type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"QueryFilterClauseInput"}}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"recentPatientsSorts"}},"type":{"kind":"ListType","type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"QuerySortClauseInput"}}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"recentPatientsPagination"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"PaginationInput"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"recentPatientsSearch"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"QuerySearchInput"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"recentTasksFilters"}},"type":{"kind":"ListType","type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"QueryFilterClauseInput"}}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"recentTasksSorts"}},"type":{"kind":"ListType","type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"QuerySortClauseInput"}}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"recentTasksPagination"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"PaginationInput"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"recentTasksSearch"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"QuerySearchInput"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"recentPatients"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"rootLocationIds"},"value":{"kind":"Variable","name":{"kind":"Name","value":"rootLocationIds"}}},{"kind":"Argument","name":{"kind":"Name","value":"filters"},"value":{"kind":"Variable","name":{"kind":"Name","value":"recentPatientsFilters"}}},{"kind":"Argument","name":{"kind":"Name","value":"sorts"},"value":{"kind":"Variable","name":{"kind":"Name","value":"recentPatientsSorts"}}},{"kind":"Argument","name":{"kind":"Name","value":"pagination"},"value":{"kind":"Variable","name":{"kind":"Name","value":"recentPatientsPagination"}}},{"kind":"Argument","name":{"kind":"Name","value":"search"},"value":{"kind":"Variable","name":{"kind":"Name","value":"recentPatientsSearch"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"firstname"}},{"kind":"Field","name":{"kind":"Name","value":"lastname"}},{"kind":"Field","name":{"kind":"Name","value":"sex"}},{"kind":"Field","name":{"kind":"Name","value":"birthdate"}},{"kind":"Field","name":{"kind":"Name","value":"state"}},{"kind":"Field","name":{"kind":"Name","value":"position"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"kind"}},{"kind":"Field","name":{"kind":"Name","value":"parent"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"tasks"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"done"}},{"kind":"Field","name":{"kind":"Name","value":"updateDate"}}]}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"definition"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"fieldType"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}},{"kind":"Field","name":{"kind":"Name","value":"allowedEntities"}},{"kind":"Field","name":{"kind":"Name","value":"options"}}]}},{"kind":"Field","name":{"kind":"Name","value":"textValue"}},{"kind":"Field","name":{"kind":"Name","value":"numberValue"}},{"kind":"Field","name":{"kind":"Name","value":"booleanValue"}},{"kind":"Field","name":{"kind":"Name","value":"dateValue"}},{"kind":"Field","name":{"kind":"Name","value":"dateTimeValue"}},{"kind":"Field","name":{"kind":"Name","value":"selectValue"}},{"kind":"Field","name":{"kind":"Name","value":"multiSelectValues"}},{"kind":"Field","name":{"kind":"Name","value":"userValue"}},{"kind":"Field","name":{"kind":"Name","value":"user"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"avatarUrl"}},{"kind":"Field","name":{"kind":"Name","value":"lastOnline"}},{"kind":"Field","name":{"kind":"Name","value":"isOnline"}}]}},{"kind":"Field","name":{"kind":"Name","value":"team"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"kind"}}]}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"recentPatientsTotal"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"rootLocationIds"},"value":{"kind":"Variable","name":{"kind":"Name","value":"rootLocationIds"}}},{"kind":"Argument","name":{"kind":"Name","value":"filters"},"value":{"kind":"Variable","name":{"kind":"Name","value":"recentPatientsFilters"}}},{"kind":"Argument","name":{"kind":"Name","value":"sorts"},"value":{"kind":"Variable","name":{"kind":"Name","value":"recentPatientsSorts"}}},{"kind":"Argument","name":{"kind":"Name","value":"search"},"value":{"kind":"Variable","name":{"kind":"Name","value":"recentPatientsSearch"}}}]},{"kind":"Field","name":{"kind":"Name","value":"recentTasks"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"rootLocationIds"},"value":{"kind":"Variable","name":{"kind":"Name","value":"rootLocationIds"}}},{"kind":"Argument","name":{"kind":"Name","value":"filters"},"value":{"kind":"Variable","name":{"kind":"Name","value":"recentTasksFilters"}}},{"kind":"Argument","name":{"kind":"Name","value":"sorts"},"value":{"kind":"Variable","name":{"kind":"Name","value":"recentTasksSorts"}}},{"kind":"Argument","name":{"kind":"Name","value":"pagination"},"value":{"kind":"Variable","name":{"kind":"Name","value":"recentTasksPagination"}}},{"kind":"Argument","name":{"kind":"Name","value":"search"},"value":{"kind":"Variable","name":{"kind":"Name","value":"recentTasksSearch"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"done"}},{"kind":"Field","name":{"kind":"Name","value":"dueDate"}},{"kind":"Field","name":{"kind":"Name","value":"creationDate"}},{"kind":"Field","name":{"kind":"Name","value":"updateDate"}},{"kind":"Field","name":{"kind":"Name","value":"priority"}},{"kind":"Field","name":{"kind":"Name","value":"estimatedTime"}},{"kind":"Field","name":{"kind":"Name","value":"sourceTaskPresetId"}},{"kind":"Field","name":{"kind":"Name","value":"assignees"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"avatarUrl"}},{"kind":"Field","name":{"kind":"Name","value":"lastOnline"}},{"kind":"Field","name":{"kind":"Name","value":"isOnline"}}]}},{"kind":"Field","name":{"kind":"Name","value":"assigneeTeam"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"kind"}}]}},{"kind":"Field","name":{"kind":"Name","value":"patient"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"position"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"kind"}},{"kind":"Field","name":{"kind":"Name","value":"parent"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}}]}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"definition"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"fieldType"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}},{"kind":"Field","name":{"kind":"Name","value":"allowedEntities"}},{"kind":"Field","name":{"kind":"Name","value":"options"}}]}},{"kind":"Field","name":{"kind":"Name","value":"textValue"}},{"kind":"Field","name":{"kind":"Name","value":"numberValue"}},{"kind":"Field","name":{"kind":"Name","value":"booleanValue"}},{"kind":"Field","name":{"kind":"Name","value":"dateValue"}},{"kind":"Field","name":{"kind":"Name","value":"dateTimeValue"}},{"kind":"Field","name":{"kind":"Name","value":"selectValue"}},{"kind":"Field","name":{"kind":"Name","value":"multiSelectValues"}},{"kind":"Field","name":{"kind":"Name","value":"userValue"}},{"kind":"Field","name":{"kind":"Name","value":"user"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"avatarUrl"}},{"kind":"Field","name":{"kind":"Name","value":"lastOnline"}},{"kind":"Field","name":{"kind":"Name","value":"isOnline"}}]}},{"kind":"Field","name":{"kind":"Name","value":"team"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"kind"}}]}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"recentTasksTotal"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"rootLocationIds"},"value":{"kind":"Variable","name":{"kind":"Name","value":"rootLocationIds"}}},{"kind":"Argument","name":{"kind":"Name","value":"filters"},"value":{"kind":"Variable","name":{"kind":"Name","value":"recentTasksFilters"}}},{"kind":"Argument","name":{"kind":"Name","value":"sorts"},"value":{"kind":"Variable","name":{"kind":"Name","value":"recentTasksSorts"}}},{"kind":"Argument","name":{"kind":"Name","value":"search"},"value":{"kind":"Variable","name":{"kind":"Name","value":"recentTasksSearch"}}}]}]}}]} as unknown as DocumentNode; +export const GetPatientDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetPatient"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"patient"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"id"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"firstname"}},{"kind":"Field","name":{"kind":"Name","value":"lastname"}},{"kind":"Field","name":{"kind":"Name","value":"birthdate"}},{"kind":"Field","name":{"kind":"Name","value":"sex"}},{"kind":"Field","name":{"kind":"Name","value":"state"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"checksum"}},{"kind":"Field","name":{"kind":"Name","value":"assignedLocation"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}}]}},{"kind":"Field","name":{"kind":"Name","value":"assignedLocations"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}}]}},{"kind":"Field","name":{"kind":"Name","value":"clinic"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"kind"}},{"kind":"Field","name":{"kind":"Name","value":"parent"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"parent"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"parent"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"parent"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}}]}}]}}]}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"position"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"kind"}},{"kind":"Field","name":{"kind":"Name","value":"parent"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"parent"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"parent"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"parent"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}}]}}]}}]}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"teams"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"kind"}},{"kind":"Field","name":{"kind":"Name","value":"parent"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"parent"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"parent"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"parent"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}}]}}]}}]}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"tasks"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"done"}},{"kind":"Field","name":{"kind":"Name","value":"dueDate"}},{"kind":"Field","name":{"kind":"Name","value":"priority"}},{"kind":"Field","name":{"kind":"Name","value":"estimatedTime"}},{"kind":"Field","name":{"kind":"Name","value":"updateDate"}},{"kind":"Field","name":{"kind":"Name","value":"sourceTaskPresetId"}},{"kind":"Field","name":{"kind":"Name","value":"assignees"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"avatarUrl"}},{"kind":"Field","name":{"kind":"Name","value":"lastOnline"}},{"kind":"Field","name":{"kind":"Name","value":"isOnline"}}]}},{"kind":"Field","name":{"kind":"Name","value":"assigneeTeam"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"kind"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"definition"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"fieldType"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}},{"kind":"Field","name":{"kind":"Name","value":"allowedEntities"}},{"kind":"Field","name":{"kind":"Name","value":"options"}}]}},{"kind":"Field","name":{"kind":"Name","value":"textValue"}},{"kind":"Field","name":{"kind":"Name","value":"numberValue"}},{"kind":"Field","name":{"kind":"Name","value":"booleanValue"}},{"kind":"Field","name":{"kind":"Name","value":"dateValue"}},{"kind":"Field","name":{"kind":"Name","value":"dateTimeValue"}},{"kind":"Field","name":{"kind":"Name","value":"selectValue"}},{"kind":"Field","name":{"kind":"Name","value":"multiSelectValues"}},{"kind":"Field","name":{"kind":"Name","value":"userValue"}},{"kind":"Field","name":{"kind":"Name","value":"user"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"avatarUrl"}},{"kind":"Field","name":{"kind":"Name","value":"lastOnline"}},{"kind":"Field","name":{"kind":"Name","value":"isOnline"}}]}},{"kind":"Field","name":{"kind":"Name","value":"team"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"kind"}}]}}]}}]}}]}}]} as unknown as DocumentNode; +export const GetPatientsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetPatients"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"locationId"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"rootLocationIds"}},"type":{"kind":"ListType","type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"states"}},"type":{"kind":"ListType","type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"PatientState"}}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"filters"}},"type":{"kind":"ListType","type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"QueryFilterClauseInput"}}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"sorts"}},"type":{"kind":"ListType","type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"QuerySortClauseInput"}}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"pagination"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"PaginationInput"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"search"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"QuerySearchInput"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"patients"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"locationNodeId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"locationId"}}},{"kind":"Argument","name":{"kind":"Name","value":"rootLocationIds"},"value":{"kind":"Variable","name":{"kind":"Name","value":"rootLocationIds"}}},{"kind":"Argument","name":{"kind":"Name","value":"states"},"value":{"kind":"Variable","name":{"kind":"Name","value":"states"}}},{"kind":"Argument","name":{"kind":"Name","value":"filters"},"value":{"kind":"Variable","name":{"kind":"Name","value":"filters"}}},{"kind":"Argument","name":{"kind":"Name","value":"sorts"},"value":{"kind":"Variable","name":{"kind":"Name","value":"sorts"}}},{"kind":"Argument","name":{"kind":"Name","value":"pagination"},"value":{"kind":"Variable","name":{"kind":"Name","value":"pagination"}}},{"kind":"Argument","name":{"kind":"Name","value":"search"},"value":{"kind":"Variable","name":{"kind":"Name","value":"search"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"firstname"}},{"kind":"Field","name":{"kind":"Name","value":"lastname"}},{"kind":"Field","name":{"kind":"Name","value":"birthdate"}},{"kind":"Field","name":{"kind":"Name","value":"sex"}},{"kind":"Field","name":{"kind":"Name","value":"state"}},{"kind":"Field","name":{"kind":"Name","value":"assignedLocation"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"parent"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"assignedLocations"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"kind"}},{"kind":"Field","name":{"kind":"Name","value":"parent"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"parent"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"parent"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}}]}}]}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"clinic"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"kind"}},{"kind":"Field","name":{"kind":"Name","value":"parent"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"parent"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"parent"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"parent"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}}]}}]}}]}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"position"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"kind"}},{"kind":"Field","name":{"kind":"Name","value":"parent"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"kind"}},{"kind":"Field","name":{"kind":"Name","value":"parent"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"kind"}},{"kind":"Field","name":{"kind":"Name","value":"parent"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"kind"}},{"kind":"Field","name":{"kind":"Name","value":"parent"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"kind"}}]}}]}}]}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"teams"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"kind"}},{"kind":"Field","name":{"kind":"Name","value":"parent"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"parent"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"parent"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"parent"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}}]}}]}}]}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"tasks"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"done"}},{"kind":"Field","name":{"kind":"Name","value":"dueDate"}},{"kind":"Field","name":{"kind":"Name","value":"priority"}},{"kind":"Field","name":{"kind":"Name","value":"estimatedTime"}},{"kind":"Field","name":{"kind":"Name","value":"creationDate"}},{"kind":"Field","name":{"kind":"Name","value":"updateDate"}},{"kind":"Field","name":{"kind":"Name","value":"sourceTaskPresetId"}},{"kind":"Field","name":{"kind":"Name","value":"assignees"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"avatarUrl"}},{"kind":"Field","name":{"kind":"Name","value":"lastOnline"}},{"kind":"Field","name":{"kind":"Name","value":"isOnline"}}]}},{"kind":"Field","name":{"kind":"Name","value":"assigneeTeam"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"kind"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"definition"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"fieldType"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}},{"kind":"Field","name":{"kind":"Name","value":"allowedEntities"}},{"kind":"Field","name":{"kind":"Name","value":"options"}}]}},{"kind":"Field","name":{"kind":"Name","value":"textValue"}},{"kind":"Field","name":{"kind":"Name","value":"numberValue"}},{"kind":"Field","name":{"kind":"Name","value":"booleanValue"}},{"kind":"Field","name":{"kind":"Name","value":"dateValue"}},{"kind":"Field","name":{"kind":"Name","value":"dateTimeValue"}},{"kind":"Field","name":{"kind":"Name","value":"selectValue"}},{"kind":"Field","name":{"kind":"Name","value":"multiSelectValues"}},{"kind":"Field","name":{"kind":"Name","value":"userValue"}},{"kind":"Field","name":{"kind":"Name","value":"user"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"avatarUrl"}},{"kind":"Field","name":{"kind":"Name","value":"lastOnline"}},{"kind":"Field","name":{"kind":"Name","value":"isOnline"}}]}},{"kind":"Field","name":{"kind":"Name","value":"team"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"kind"}}]}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"patientsTotal"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"locationNodeId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"locationId"}}},{"kind":"Argument","name":{"kind":"Name","value":"rootLocationIds"},"value":{"kind":"Variable","name":{"kind":"Name","value":"rootLocationIds"}}},{"kind":"Argument","name":{"kind":"Name","value":"states"},"value":{"kind":"Variable","name":{"kind":"Name","value":"states"}}},{"kind":"Argument","name":{"kind":"Name","value":"filters"},"value":{"kind":"Variable","name":{"kind":"Name","value":"filters"}}},{"kind":"Argument","name":{"kind":"Name","value":"sorts"},"value":{"kind":"Variable","name":{"kind":"Name","value":"sorts"}}},{"kind":"Argument","name":{"kind":"Name","value":"search"},"value":{"kind":"Variable","name":{"kind":"Name","value":"search"}}}]}]}}]} as unknown as DocumentNode; +export const GetTaskDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetTask"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"task"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"id"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"done"}},{"kind":"Field","name":{"kind":"Name","value":"dueDate"}},{"kind":"Field","name":{"kind":"Name","value":"priority"}},{"kind":"Field","name":{"kind":"Name","value":"estimatedTime"}},{"kind":"Field","name":{"kind":"Name","value":"checksum"}},{"kind":"Field","name":{"kind":"Name","value":"updateDate"}},{"kind":"Field","name":{"kind":"Name","value":"sourceTaskPresetId"}},{"kind":"Field","name":{"kind":"Name","value":"patient"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}},{"kind":"Field","name":{"kind":"Name","value":"assignees"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"avatarUrl"}},{"kind":"Field","name":{"kind":"Name","value":"lastOnline"}},{"kind":"Field","name":{"kind":"Name","value":"isOnline"}}]}},{"kind":"Field","name":{"kind":"Name","value":"assigneeTeam"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"kind"}}]}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"definition"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"fieldType"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}},{"kind":"Field","name":{"kind":"Name","value":"allowedEntities"}},{"kind":"Field","name":{"kind":"Name","value":"options"}}]}},{"kind":"Field","name":{"kind":"Name","value":"textValue"}},{"kind":"Field","name":{"kind":"Name","value":"numberValue"}},{"kind":"Field","name":{"kind":"Name","value":"booleanValue"}},{"kind":"Field","name":{"kind":"Name","value":"dateValue"}},{"kind":"Field","name":{"kind":"Name","value":"dateTimeValue"}},{"kind":"Field","name":{"kind":"Name","value":"selectValue"}},{"kind":"Field","name":{"kind":"Name","value":"multiSelectValues"}},{"kind":"Field","name":{"kind":"Name","value":"userValue"}},{"kind":"Field","name":{"kind":"Name","value":"user"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"avatarUrl"}},{"kind":"Field","name":{"kind":"Name","value":"lastOnline"}},{"kind":"Field","name":{"kind":"Name","value":"isOnline"}}]}},{"kind":"Field","name":{"kind":"Name","value":"team"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"kind"}}]}}]}}]}}]}}]} as unknown as DocumentNode; +export const GetTasksDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetTasks"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"rootLocationIds"}},"type":{"kind":"ListType","type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"assigneeId"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"assigneeTeamId"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"filters"}},"type":{"kind":"ListType","type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"QueryFilterClauseInput"}}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"sorts"}},"type":{"kind":"ListType","type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"QuerySortClauseInput"}}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"pagination"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"PaginationInput"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"search"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"QuerySearchInput"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"tasks"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"rootLocationIds"},"value":{"kind":"Variable","name":{"kind":"Name","value":"rootLocationIds"}}},{"kind":"Argument","name":{"kind":"Name","value":"assigneeId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"assigneeId"}}},{"kind":"Argument","name":{"kind":"Name","value":"assigneeTeamId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"assigneeTeamId"}}},{"kind":"Argument","name":{"kind":"Name","value":"filters"},"value":{"kind":"Variable","name":{"kind":"Name","value":"filters"}}},{"kind":"Argument","name":{"kind":"Name","value":"sorts"},"value":{"kind":"Variable","name":{"kind":"Name","value":"sorts"}}},{"kind":"Argument","name":{"kind":"Name","value":"pagination"},"value":{"kind":"Variable","name":{"kind":"Name","value":"pagination"}}},{"kind":"Argument","name":{"kind":"Name","value":"search"},"value":{"kind":"Variable","name":{"kind":"Name","value":"search"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"done"}},{"kind":"Field","name":{"kind":"Name","value":"dueDate"}},{"kind":"Field","name":{"kind":"Name","value":"priority"}},{"kind":"Field","name":{"kind":"Name","value":"estimatedTime"}},{"kind":"Field","name":{"kind":"Name","value":"creationDate"}},{"kind":"Field","name":{"kind":"Name","value":"updateDate"}},{"kind":"Field","name":{"kind":"Name","value":"sourceTaskPresetId"}},{"kind":"Field","name":{"kind":"Name","value":"patient"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"firstname"}},{"kind":"Field","name":{"kind":"Name","value":"lastname"}},{"kind":"Field","name":{"kind":"Name","value":"birthdate"}},{"kind":"Field","name":{"kind":"Name","value":"sex"}},{"kind":"Field","name":{"kind":"Name","value":"state"}},{"kind":"Field","name":{"kind":"Name","value":"assignedLocation"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"parent"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"assignedLocations"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"kind"}},{"kind":"Field","name":{"kind":"Name","value":"parent"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"parent"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"parent"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}}]}}]}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"clinic"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"kind"}},{"kind":"Field","name":{"kind":"Name","value":"parent"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"parent"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"parent"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"parent"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}}]}}]}}]}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"position"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"kind"}},{"kind":"Field","name":{"kind":"Name","value":"parent"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"kind"}},{"kind":"Field","name":{"kind":"Name","value":"parent"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"kind"}},{"kind":"Field","name":{"kind":"Name","value":"parent"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"kind"}}]}}]}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"teams"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"kind"}},{"kind":"Field","name":{"kind":"Name","value":"parent"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"parent"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"parent"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"parent"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}}]}}]}}]}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"definition"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"fieldType"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}},{"kind":"Field","name":{"kind":"Name","value":"allowedEntities"}},{"kind":"Field","name":{"kind":"Name","value":"options"}}]}},{"kind":"Field","name":{"kind":"Name","value":"textValue"}},{"kind":"Field","name":{"kind":"Name","value":"numberValue"}},{"kind":"Field","name":{"kind":"Name","value":"booleanValue"}},{"kind":"Field","name":{"kind":"Name","value":"dateValue"}},{"kind":"Field","name":{"kind":"Name","value":"dateTimeValue"}},{"kind":"Field","name":{"kind":"Name","value":"selectValue"}},{"kind":"Field","name":{"kind":"Name","value":"multiSelectValues"}},{"kind":"Field","name":{"kind":"Name","value":"userValue"}},{"kind":"Field","name":{"kind":"Name","value":"user"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"avatarUrl"}},{"kind":"Field","name":{"kind":"Name","value":"lastOnline"}},{"kind":"Field","name":{"kind":"Name","value":"isOnline"}}]}},{"kind":"Field","name":{"kind":"Name","value":"team"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"kind"}}]}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"assignees"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"avatarUrl"}},{"kind":"Field","name":{"kind":"Name","value":"lastOnline"}},{"kind":"Field","name":{"kind":"Name","value":"isOnline"}}]}},{"kind":"Field","name":{"kind":"Name","value":"assigneeTeam"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"kind"}}]}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"definition"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"fieldType"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}},{"kind":"Field","name":{"kind":"Name","value":"allowedEntities"}},{"kind":"Field","name":{"kind":"Name","value":"options"}}]}},{"kind":"Field","name":{"kind":"Name","value":"textValue"}},{"kind":"Field","name":{"kind":"Name","value":"numberValue"}},{"kind":"Field","name":{"kind":"Name","value":"booleanValue"}},{"kind":"Field","name":{"kind":"Name","value":"dateValue"}},{"kind":"Field","name":{"kind":"Name","value":"dateTimeValue"}},{"kind":"Field","name":{"kind":"Name","value":"selectValue"}},{"kind":"Field","name":{"kind":"Name","value":"multiSelectValues"}},{"kind":"Field","name":{"kind":"Name","value":"userValue"}},{"kind":"Field","name":{"kind":"Name","value":"user"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"avatarUrl"}},{"kind":"Field","name":{"kind":"Name","value":"lastOnline"}},{"kind":"Field","name":{"kind":"Name","value":"isOnline"}}]}},{"kind":"Field","name":{"kind":"Name","value":"team"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"kind"}}]}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"tasksTotal"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"rootLocationIds"},"value":{"kind":"Variable","name":{"kind":"Name","value":"rootLocationIds"}}},{"kind":"Argument","name":{"kind":"Name","value":"assigneeId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"assigneeId"}}},{"kind":"Argument","name":{"kind":"Name","value":"assigneeTeamId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"assigneeTeamId"}}},{"kind":"Argument","name":{"kind":"Name","value":"filters"},"value":{"kind":"Variable","name":{"kind":"Name","value":"filters"}}},{"kind":"Argument","name":{"kind":"Name","value":"sorts"},"value":{"kind":"Variable","name":{"kind":"Name","value":"sorts"}}},{"kind":"Argument","name":{"kind":"Name","value":"search"},"value":{"kind":"Variable","name":{"kind":"Name","value":"search"}}}]}]}}]} as unknown as DocumentNode; export const GetUserDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetUser"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"user"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"id"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"username"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"email"}},{"kind":"Field","name":{"kind":"Name","value":"firstname"}},{"kind":"Field","name":{"kind":"Name","value":"lastname"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"avatarUrl"}},{"kind":"Field","name":{"kind":"Name","value":"lastOnline"}},{"kind":"Field","name":{"kind":"Name","value":"isOnline"}}]}}]}}]} as unknown as DocumentNode; export const GetUsersDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetUsers"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"users"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"avatarUrl"}},{"kind":"Field","name":{"kind":"Name","value":"lastOnline"}},{"kind":"Field","name":{"kind":"Name","value":"isOnline"}}]}}]}}]} as unknown as DocumentNode; export const GetGlobalDataDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetGlobalData"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"rootLocationIds"}},"type":{"kind":"ListType","type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"me"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"username"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"firstname"}},{"kind":"Field","name":{"kind":"Name","value":"lastname"}},{"kind":"Field","name":{"kind":"Name","value":"avatarUrl"}},{"kind":"Field","name":{"kind":"Name","value":"lastOnline"}},{"kind":"Field","name":{"kind":"Name","value":"isOnline"}},{"kind":"Field","name":{"kind":"Name","value":"organizations"}},{"kind":"Field","name":{"kind":"Name","value":"rootLocations"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"kind"}}]}},{"kind":"Field","name":{"kind":"Name","value":"tasks"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"rootLocationIds"},"value":{"kind":"Variable","name":{"kind":"Name","value":"rootLocationIds"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"done"}}]}}]}},{"kind":"Field","alias":{"kind":"Name","value":"wards"},"name":{"kind":"Name","value":"locationNodes"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"kind"},"value":{"kind":"EnumValue","value":"WARD"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"parentId"}}]}},{"kind":"Field","alias":{"kind":"Name","value":"teams"},"name":{"kind":"Name","value":"locationNodes"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"kind"},"value":{"kind":"EnumValue","value":"TEAM"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"parentId"}}]}},{"kind":"Field","alias":{"kind":"Name","value":"clinics"},"name":{"kind":"Name","value":"locationNodes"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"kind"},"value":{"kind":"EnumValue","value":"CLINIC"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"parentId"}}]}},{"kind":"Field","name":{"kind":"Name","value":"patients"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"rootLocationIds"},"value":{"kind":"Variable","name":{"kind":"Name","value":"rootLocationIds"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"state"}},{"kind":"Field","name":{"kind":"Name","value":"assignedLocation"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}}]}}]}},{"kind":"Field","alias":{"kind":"Name","value":"waitingPatients"},"name":{"kind":"Name","value":"patients"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"states"},"value":{"kind":"ListValue","values":[{"kind":"EnumValue","value":"WAIT"}]}},{"kind":"Argument","name":{"kind":"Name","value":"rootLocationIds"},"value":{"kind":"Variable","name":{"kind":"Name","value":"rootLocationIds"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"state"}}]}}]}}]} as unknown as DocumentNode; @@ -1272,4 +1426,10 @@ export const CompleteTaskDocument = {"kind":"Document","definitions":[{"kind":"O export const ReopenTaskDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"ReopenTask"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"reopenTask"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"id"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"done"}},{"kind":"Field","name":{"kind":"Name","value":"updateDate"}}]}}]}}]} as unknown as DocumentNode; export const AssignTaskToTeamDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"AssignTaskToTeam"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"teamId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"assignTaskToTeam"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"id"}}},{"kind":"Argument","name":{"kind":"Name","value":"teamId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"teamId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"assigneeTeam"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"kind"}}]}}]}}]}}]} as unknown as DocumentNode; export const UnassignTaskFromTeamDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"UnassignTaskFromTeam"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"unassignTaskFromTeam"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"id"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"assigneeTeam"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"kind"}}]}}]}}]}}]} as unknown as DocumentNode; +export const ApplyTaskGraphDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"ApplyTaskGraph"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"data"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ApplyTaskGraphInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"applyTaskGraph"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"data"},"value":{"kind":"Variable","name":{"kind":"Name","value":"data"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"done"}},{"kind":"Field","name":{"kind":"Name","value":"dueDate"}},{"kind":"Field","name":{"kind":"Name","value":"updateDate"}},{"kind":"Field","name":{"kind":"Name","value":"sourceTaskPresetId"}},{"kind":"Field","name":{"kind":"Name","value":"assignees"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"avatarUrl"}},{"kind":"Field","name":{"kind":"Name","value":"lastOnline"}},{"kind":"Field","name":{"kind":"Name","value":"isOnline"}}]}},{"kind":"Field","name":{"kind":"Name","value":"patient"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}}]}}]}}]} as unknown as DocumentNode; +export const CreateTaskPresetDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"CreateTaskPreset"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"data"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"CreateTaskPresetInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"createTaskPreset"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"data"},"value":{"kind":"Variable","name":{"kind":"Name","value":"data"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"key"}},{"kind":"Field","name":{"kind":"Name","value":"scope"}},{"kind":"Field","name":{"kind":"Name","value":"ownerUserId"}},{"kind":"Field","name":{"kind":"Name","value":"graph"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"nodes"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"priority"}},{"kind":"Field","name":{"kind":"Name","value":"estimatedTime"}}]}},{"kind":"Field","name":{"kind":"Name","value":"edges"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"fromId"}},{"kind":"Field","name":{"kind":"Name","value":"toId"}}]}}]}}]}}]}}]} as unknown as DocumentNode; +export const UpdateTaskPresetDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"UpdateTaskPreset"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"data"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"UpdateTaskPresetInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"updateTaskPreset"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"id"}}},{"kind":"Argument","name":{"kind":"Name","value":"data"},"value":{"kind":"Variable","name":{"kind":"Name","value":"data"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"key"}},{"kind":"Field","name":{"kind":"Name","value":"scope"}},{"kind":"Field","name":{"kind":"Name","value":"ownerUserId"}},{"kind":"Field","name":{"kind":"Name","value":"graph"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"nodes"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"priority"}},{"kind":"Field","name":{"kind":"Name","value":"estimatedTime"}}]}},{"kind":"Field","name":{"kind":"Name","value":"edges"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"fromId"}},{"kind":"Field","name":{"kind":"Name","value":"toId"}}]}}]}}]}}]}}]} as unknown as DocumentNode; +export const DeleteTaskPresetDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"DeleteTaskPreset"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"deleteTaskPreset"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"id"}}}]}]}}]} as unknown as DocumentNode; +export const TaskPresetsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"TaskPresets"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"taskPresets"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"key"}},{"kind":"Field","name":{"kind":"Name","value":"scope"}},{"kind":"Field","name":{"kind":"Name","value":"ownerUserId"}},{"kind":"Field","name":{"kind":"Name","value":"graph"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"nodes"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"priority"}},{"kind":"Field","name":{"kind":"Name","value":"estimatedTime"}}]}},{"kind":"Field","name":{"kind":"Name","value":"edges"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"fromId"}},{"kind":"Field","name":{"kind":"Name","value":"toId"}}]}}]}}]}}]}}]} as unknown as DocumentNode; +export const TaskPresetDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"TaskPreset"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"taskPreset"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"id"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"key"}},{"kind":"Field","name":{"kind":"Name","value":"scope"}},{"kind":"Field","name":{"kind":"Name","value":"ownerUserId"}},{"kind":"Field","name":{"kind":"Name","value":"graph"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"nodes"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"priority"}},{"kind":"Field","name":{"kind":"Name","value":"estimatedTime"}}]}},{"kind":"Field","name":{"kind":"Name","value":"edges"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"fromId"}},{"kind":"Field","name":{"kind":"Name","value":"toId"}}]}}]}}]}}]}}]} as unknown as DocumentNode; export const UpdateProfilePictureDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"UpdateProfilePicture"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"data"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"UpdateProfilePictureInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"updateProfilePicture"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"data"},"value":{"kind":"Variable","name":{"kind":"Name","value":"data"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"username"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"email"}},{"kind":"Field","name":{"kind":"Name","value":"firstname"}},{"kind":"Field","name":{"kind":"Name","value":"lastname"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"avatarUrl"}},{"kind":"Field","name":{"kind":"Name","value":"lastOnline"}},{"kind":"Field","name":{"kind":"Name","value":"isOnline"}}]}}]}}]} as unknown as DocumentNode; \ No newline at end of file diff --git a/web/api/graphql/GetOverviewData.graphql b/web/api/graphql/GetOverviewData.graphql index a91b7512..953c2aac 100644 --- a/web/api/graphql/GetOverviewData.graphql +++ b/web/api/graphql/GetOverviewData.graphql @@ -65,6 +65,7 @@ query GetOverviewData($rootLocationIds: [ID!], $recentPatientsFilters: [QueryFil updateDate priority estimatedTime + sourceTaskPresetId assignees { id name diff --git a/web/api/graphql/GetPatient.graphql b/web/api/graphql/GetPatient.graphql index 36263f17..2143484e 100644 --- a/web/api/graphql/GetPatient.graphql +++ b/web/api/graphql/GetPatient.graphql @@ -88,6 +88,7 @@ query GetPatient($id: ID!) { priority estimatedTime updateDate + sourceTaskPresetId assignees { id name diff --git a/web/api/graphql/GetPatients.graphql b/web/api/graphql/GetPatients.graphql index 810a89f0..ec9a6ca3 100644 --- a/web/api/graphql/GetPatients.graphql +++ b/web/api/graphql/GetPatients.graphql @@ -109,6 +109,7 @@ query GetPatients($locationId: ID, $rootLocationIds: [ID!], $states: [PatientSta estimatedTime creationDate updateDate + sourceTaskPresetId assignees { id name diff --git a/web/api/graphql/GetTask.graphql b/web/api/graphql/GetTask.graphql index 322c7f54..7d7594d0 100644 --- a/web/api/graphql/GetTask.graphql +++ b/web/api/graphql/GetTask.graphql @@ -9,6 +9,7 @@ query GetTask($id: ID!) { estimatedTime checksum updateDate + sourceTaskPresetId patient { id name diff --git a/web/api/graphql/GetTasks.graphql b/web/api/graphql/GetTasks.graphql index 3235b72c..6758413a 100644 --- a/web/api/graphql/GetTasks.graphql +++ b/web/api/graphql/GetTasks.graphql @@ -9,6 +9,7 @@ query GetTasks($rootLocationIds: [ID!], $assigneeId: ID, $assigneeTeamId: ID, $f estimatedTime creationDate updateDate + sourceTaskPresetId patient { id name diff --git a/web/api/graphql/TaskMutations.graphql b/web/api/graphql/TaskMutations.graphql index 07040d82..89e4fa5c 100644 --- a/web/api/graphql/TaskMutations.graphql +++ b/web/api/graphql/TaskMutations.graphql @@ -144,3 +144,26 @@ mutation UnassignTaskFromTeam($id: ID!) { } } } + +mutation ApplyTaskGraph($data: ApplyTaskGraphInput!) { + applyTaskGraph(data: $data) { + id + title + description + done + dueDate + updateDate + sourceTaskPresetId + assignees { + id + name + avatarUrl + lastOnline + isOnline + } + patient { + id + name + } + } +} diff --git a/web/api/graphql/TaskPresetMutations.graphql b/web/api/graphql/TaskPresetMutations.graphql new file mode 100644 index 00000000..5dde5848 --- /dev/null +++ b/web/api/graphql/TaskPresetMutations.graphql @@ -0,0 +1,49 @@ +mutation CreateTaskPreset($data: CreateTaskPresetInput!) { + createTaskPreset(data: $data) { + id + name + key + scope + ownerUserId + graph { + nodes { + id + title + description + priority + estimatedTime + } + edges { + fromId + toId + } + } + } +} + +mutation UpdateTaskPreset($id: ID!, $data: UpdateTaskPresetInput!) { + updateTaskPreset(id: $id, data: $data) { + id + name + key + scope + ownerUserId + graph { + nodes { + id + title + description + priority + estimatedTime + } + edges { + fromId + toId + } + } + } +} + +mutation DeleteTaskPreset($id: ID!) { + deleteTaskPreset(id: $id) +} diff --git a/web/api/graphql/TaskPresetQueries.graphql b/web/api/graphql/TaskPresetQueries.graphql new file mode 100644 index 00000000..6deadd50 --- /dev/null +++ b/web/api/graphql/TaskPresetQueries.graphql @@ -0,0 +1,45 @@ +query TaskPresets { + taskPresets { + id + name + key + scope + ownerUserId + graph { + nodes { + id + title + description + priority + estimatedTime + } + edges { + fromId + toId + } + } + } +} + +query TaskPreset($id: ID!) { + taskPreset(id: $id) { + id + name + key + scope + ownerUserId + graph { + nodes { + id + title + description + priority + estimatedTime + } + edges { + fromId + toId + } + } + } +} diff --git a/web/codegen.ts b/web/codegen.ts index 806fdff8..625fed4f 100644 --- a/web/codegen.ts +++ b/web/codegen.ts @@ -1,8 +1,19 @@ import type { CodegenConfig } from '@graphql-codegen/cli' +import fs from 'fs' +import path from 'path' import 'dotenv/config' +import { getConfig } from './utils/config' + +const schemaFromBackend = path.join(__dirname, '../backend/schema.graphql') +const schemaFromWeb = path.join(__dirname, 'schema.graphql') +const schema = fs.existsSync(schemaFromBackend) + ? schemaFromBackend + : fs.existsSync(schemaFromWeb) + ? schemaFromWeb + : getConfig().graphqlEndpoint const config: CodegenConfig = { - schema: './schema.graphql', + schema, documents: 'api/graphql/**/*.graphql', generates: { 'api/gql/generated.ts': { diff --git a/web/components/FeedbackToast.tsx b/web/components/FeedbackToast.tsx new file mode 100644 index 00000000..640abe08 --- /dev/null +++ b/web/components/FeedbackToast.tsx @@ -0,0 +1,26 @@ +import { Chip } from '@helpwave/hightide' +import { useSystemSuggestionTasksOptional } from '@/context/SystemSuggestionTasksContext' + +export function FeedbackToast() { + const ctx = useSystemSuggestionTasksOptional() + const toast = ctx?.toast ?? null + + if (!toast) return null + + return ( +
+ + {toast.message} + +
+ ) +} diff --git a/web/components/patients/LoadTaskPresetDialog.tsx b/web/components/patients/LoadTaskPresetDialog.tsx new file mode 100644 index 00000000..4769c735 --- /dev/null +++ b/web/components/patients/LoadTaskPresetDialog.tsx @@ -0,0 +1,158 @@ +import { useCallback, useEffect, useMemo, useState } from 'react' +import { + Button, + Dialog, + FocusTrapWrapper, + Select, + SelectOption +} from '@helpwave/hightide' +import { useTasksTranslation } from '@/i18n/useTasksTranslation' +import { useApplyTaskGraph, useTaskPresets } from '@/data' +import type { TaskPresetsQuery } from '@/api/gql/generated' + +type PresetRow = TaskPresetsQuery['taskPresets'][number] + +type LoadTaskPresetDialogProps = { + isOpen: boolean, + onClose: () => void, + patientId: string, + onSuccess?: () => void, +} + +export function LoadTaskPresetDialog({ + isOpen, + onClose, + patientId, + onSuccess, +}: LoadTaskPresetDialogProps) { + const translation = useTasksTranslation() + const { data, loading } = useTaskPresets() + const [applyTaskGraph, { loading: applying }] = useApplyTaskGraph() + const [selectedId, setSelectedId] = useState(undefined) + const [confirmOpen, setConfirmOpen] = useState(false) + + const presets = useMemo(() => data?.taskPresets ?? [], [data?.taskPresets]) + + useEffect(() => { + if (!isOpen) { + setSelectedId(undefined) + } + }, [isOpen]) + + useEffect(() => { + if (!isOpen || presets.length === 0) return + setSelectedId(prev => { + const first = presets[0] + if (!first) return prev + return prev && presets.some(p => p.id === prev) ? prev : first.id + }) + }, [isOpen, presets]) + + const selected: PresetRow | undefined = useMemo( + () => presets.find(p => p.id === selectedId), + [presets, selectedId] + ) + + const taskCount = selected?.graph.nodes.length ?? 0 + + const handlePrimary = useCallback(() => { + if (!selectedId || taskCount === 0) return + setConfirmOpen(true) + }, [selectedId, taskCount]) + + const handleConfirmApply = useCallback(async () => { + if (!selectedId) return + await applyTaskGraph({ + variables: { + data: { + patientId, + presetId: selectedId, + assignToCurrentUser: false, + }, + }, + }) + setConfirmOpen(false) + onClose() + onSuccess?.() + }, [applyTaskGraph, patientId, selectedId, onClose, onSuccess]) + + return ( + <> + + +
+ {loading &&
{translation('loading')}
} + {!loading && presets.length === 0 && ( +
{translation('taskPresetEmptyList')}
+ )} + {!loading && presets.length > 0 && ( +
+ {translation('taskPresets')} + + {selected && taskCount === 0 && ( +
{translation('taskPresetNoTasks')}
+ )} +
+ )} +
+ + +
+
+
+
+ + setConfirmOpen(false)} + titleElement={translation('confirm')} + description={null} + position="center" + isModal={true} + className="max-w-md w-full" + > +
+

+ {translation('loadTaskPresetConfirm', { count: taskCount })} +

+
+ + +
+
+
+ + ) +} diff --git a/web/components/patients/PatientDetailView.tsx b/web/components/patients/PatientDetailView.tsx index 3fbd1899..0c76e2b7 100644 --- a/web/components/patients/PatientDetailView.tsx +++ b/web/components/patients/PatientDetailView.tsx @@ -3,12 +3,14 @@ import { useTasksTranslation } from '@/i18n/useTasksTranslation' import type { CreatePatientInput, PropertyValueInput } from '@/api/gql/generated' import { usePatient } from '@/data' import { + Button, ProgressIndicator, TabList, TabPanel, TabSwitcher, Tooltip } from '@helpwave/hightide' +import { Sparkles } from 'lucide-react' import { PatientStateChip } from '@/components/patients/PatientStateChip' import { LocationChips } from '@/components/locations/LocationChips' import { PatientTasksView } from './PatientTasksView' @@ -16,6 +18,8 @@ import { PatientDataEditor } from './PatientDataEditor' import { AuditLogTimeline } from '@/components/AuditLogTimeline' import { PropertyList, type PropertyValue } from '../tables/PropertyList' import { useUpdatePatient } from '@/data' +import { getAdherenceByPatientId, getSuggestionByPatientId } from '@/data/mockSystemSuggestions' +import type { SystemSuggestion } from '@/types/systemSuggestion' export const toISODate = (d: Date | string | null | undefined): string | null => { if (!d) return null @@ -48,13 +52,15 @@ interface PatientDetailViewProps { onClose: () => void, onSuccess: () => void, initialCreateData?: Partial, + onOpenSystemSuggestion?: (suggestion: SystemSuggestion, patientName: string) => void, } export const PatientDetailView = ({ patientId, onClose, onSuccess, - initialCreateData = {} + initialCreateData = {}, + onOpenSystemSuggestion, }: PatientDetailViewProps) => { const translation = useTasksTranslation() @@ -142,6 +148,11 @@ export const PatientDetailView = ({ return [] }, [patientData?.position, patientData?.assignedLocations]) + const adherence = patientId ? getAdherenceByPatientId(patientId) : 'unknown' + const systemSuggestion = patientId ? getSuggestionByPatientId(patientId) : null + const adherenceDotClass = adherence === 'adherent' ? 'bg-positive' : adherence === 'non_adherent' ? 'bg-negative' : 'bg-warning' + const adherenceLabel = adherence === 'adherent' ? 'Treatment standard adherent' : adherence === 'non_adherent' ? 'Treatment is not adherent with standards.' : 'In Progress' + const adherenceTooltip = adherenceLabel return (
@@ -177,6 +188,28 @@ export const PatientDetailView = ({ )}
)} + {isEditMode && patientId && ( +
+
+ Analysis + {adherenceLabel} + + + +
+ {systemSuggestion && onOpenSystemSuggestion && ( + + )} +
+ )} diff --git a/web/components/patients/PatientTasksView.tsx b/web/components/patients/PatientTasksView.tsx index b5d37250..92d3c447 100644 --- a/web/components/patients/PatientTasksView.tsx +++ b/web/components/patients/PatientTasksView.tsx @@ -1,12 +1,13 @@ -import { useState, useMemo, useEffect } from 'react' +import { useState, useMemo, useEffect, useCallback } from 'react' import { Button, Drawer, ExpandableContent, ExpandableHeader, ExpandableRoot } from '@helpwave/hightide' import { useTasksTranslation } from '@/i18n/useTasksTranslation' -import { CheckCircle2, ChevronDown, Circle, PlusIcon } from 'lucide-react' +import { CheckCircle2, ChevronDown, Circle, Combine, PlusIcon } from 'lucide-react' import { TaskCardView } from '@/components/tasks/TaskCardView' import clsx from 'clsx' import type { GetPatientQuery } from '@/api/gql/generated' import { TaskDetailView } from '@/components/tasks/TaskDetailView' import { useCompleteTask, useReopenTask } from '@/data' +import { LoadTaskPresetDialog } from '@/components/patients/LoadTaskPresetDialog' interface PatientTasksViewProps { patientId: string, @@ -14,12 +15,14 @@ interface PatientTasksViewProps { onSuccess?: () => void, } -const sortByDueDate = (tasks: T[]): T[] => { +const sortByDueDate = (tasks: T[]): T[] => { return [...tasks].sort((a, b) => { + const aTime = a.dueDate ? new Date(a.dueDate).getTime() : 0 + const bTime = b.dueDate ? new Date(b.dueDate).getTime() : 0 if (!a.dueDate && !b.dueDate) return 0 if (!a.dueDate) return 1 if (!b.dueDate) return -1 - return new Date(a.dueDate).getTime() - new Date(b.dueDate).getTime() + return aTime - bTime }) } @@ -31,13 +34,14 @@ export const PatientTasksView = ({ const translation = useTasksTranslation() const [taskId, setTaskId] = useState(null) const [isCreatingTask, setIsCreatingTask] = useState(false) + const [loadPresetOpen, setLoadPresetOpen] = useState(false) const [optimisticTaskUpdates, setOptimisticTaskUpdates] = useState>(new Map()) const [completeTask] = useCompleteTask() const [reopenTask] = useReopenTask() const initialPatientName = `${patientData?.patient?.firstname ?? ''} ${patientData?.patient?.lastname ?? ''}`.trim() - const tasks = useMemo(() => { + const apiTasksWithOptimistic = useMemo(() => { const baseTasks = patientData?.patient?.tasks || [] return baseTasks.map(task => { const optimisticDone = optimisticTaskUpdates.get(task.id) @@ -48,14 +52,9 @@ export const PatientTasksView = ({ }) }, [patientData?.patient?.tasks, optimisticTaskUpdates]) - const openTasks = useMemo(() => sortByDueDate(tasks.filter(t => !t.done)), [tasks]) - const closedTasks = useMemo(() => sortByDueDate(tasks.filter(t => t.done)), [tasks]) + const tasks = useMemo(() => apiTasksWithOptimistic, [apiTasksWithOptimistic]) - useEffect(() => { - setOptimisticTaskUpdates(new Map()) - }, [patientData?.patient?.tasks]) - - const handleToggleDone = (taskId: string, done: boolean) => { + const handleToggleDone = useCallback((taskId: string, done: boolean) => { setOptimisticTaskUpdates(prev => { const next = new Map(prev) next.set(taskId, done) @@ -86,7 +85,14 @@ export const PatientTasksView = ({ }, }) } - } + }, [completeTask, reopenTask, onSuccess]) + + const openTasks = useMemo(() => sortByDueDate(tasks.filter(t => !t.done)), [tasks]) + const closedTasks = useMemo(() => sortByDueDate(tasks.filter(t => t.done)), [tasks]) + + useEffect(() => { + setOptimisticTaskUpdates(new Map()) + }, [patientData?.patient?.tasks]) return ( <> @@ -144,7 +150,16 @@ export const PatientTasksView = ({ -
+
+
+ setLoadPresetOpen(false)} + patientId={patientId} + onSuccess={onSuccess} + /> { diff --git a/web/components/patients/SystemSuggestionModal.tsx b/web/components/patients/SystemSuggestionModal.tsx new file mode 100644 index 00000000..205c44da --- /dev/null +++ b/web/components/patients/SystemSuggestionModal.tsx @@ -0,0 +1,272 @@ +import { useCallback, useEffect, useMemo, useState } from 'react' +import { + Button, + Checkbox, + Chip, + Dialog, + FocusTrapWrapper, + TabList, + TabPanel, + TabSwitcher +} from '@helpwave/hightide' +import { ArrowRight, BookCheck, Workflow } from 'lucide-react' +import type { GuidelineAdherenceStatus } from '@/types/systemSuggestion' +import type { SystemSuggestion } from '@/types/systemSuggestion' +import { useSystemSuggestionTasks } from '@/context/SystemSuggestionTasksContext' +import { useApplyTaskGraph } from '@/data' +import { GetPatientDocument } from '@/api/gql/generated' +import { suggestionItemsToTaskGraphInput } from '@/utils/taskGraph' +import { useTasksTranslation } from '@/i18n/useTasksTranslation' + +type SystemSuggestionModalProps = { + isOpen: boolean, + onClose: () => void, + suggestion: SystemSuggestion, + patientName?: string, + onApplied?: () => void, +} + +const ADHERENCE_LABEL: Record = { + adherent: 'Adherent', + non_adherent: 'Not adherent', + unknown: 'In Progress', +} + +function adherenceToChipColor(status: GuidelineAdherenceStatus): 'positive' | 'negative' | 'warning' { + switch (status) { + case 'adherent': + return 'positive' + case 'non_adherent': + return 'negative' + default: + return 'warning' + } +} + +export function SystemSuggestionModal({ + isOpen, + onClose, + suggestion, + patientName, + onApplied, +}: SystemSuggestionModalProps) { + const [selectedIds, setSelectedIds] = useState>(() => new Set(suggestion.suggestedTasks.map((t) => t.id))) + const [activeTabId, setActiveTabId] = useState(undefined) + + useEffect(() => { + if (isOpen) { + setSelectedIds(new Set(suggestion.suggestedTasks.map((t) => t.id))) + setActiveTabId(undefined) + } + }, [isOpen, suggestion.suggestedTasks]) + + const { showToast } = useSystemSuggestionTasks() + const translation = useTasksTranslation() + const [applyTaskGraph, { loading: applyLoading }] = useApplyTaskGraph() + + const toggleTask = useCallback((id: string) => { + setSelectedIds((prev) => { + const next = new Set(prev) + if (next.has(id)) next.delete(id) + else next.add(id) + return next + }) + }, []) + + const selectedItems = useMemo( + () => suggestion.suggestedTasks.filter((t) => selectedIds.has(t.id)), + [suggestion.suggestedTasks, selectedIds] + ) + + const handleCreate = useCallback(async () => { + if (selectedItems.length === 0) return + const graph = suggestionItemsToTaskGraphInput(selectedItems) + await applyTaskGraph({ + variables: { + data: { + patientId: suggestion.patientId, + graph, + assignToCurrentUser: false, + }, + }, + refetchQueries: [ + { query: GetPatientDocument, variables: { id: suggestion.patientId } }, + ], + }) + showToast(translation('tasksCreatedFromPreset')) + onApplied?.() + onClose() + }, [ + applyTaskGraph, + selectedItems, + suggestion.patientId, + showToast, + translation, + onApplied, + onClose, + ]) + + const handleCreateAndAssign = useCallback(async () => { + if (selectedItems.length === 0) return + const graph = suggestionItemsToTaskGraphInput(selectedItems) + await applyTaskGraph({ + variables: { + data: { + patientId: suggestion.patientId, + graph, + assignToCurrentUser: true, + }, + }, + refetchQueries: [ + { query: GetPatientDocument, variables: { id: suggestion.patientId } }, + ], + }) + showToast(translation('tasksCreatedFromPreset')) + onApplied?.() + onClose() + }, [ + applyTaskGraph, + selectedItems, + suggestion.patientId, + showToast, + translation, + onApplied, + onClose, + ]) + + return ( + + +
+ setActiveTabId(id ?? undefined)} + initialActiveId="Suggestion" + > + + +
+
+
Guideline adherence
+
+ + {ADHERENCE_LABEL[suggestion.adherenceStatus]} + +
+

{suggestion.reasonSummary}

+
+ +
+
Suggested tasks
+
+ {suggestion.suggestedTasks.map((task) => ( + + ))} +
+
+
+ +
+ + + +
+
+ + +
+
+
Explanation
+

+ {suggestion.explanation.details} +

+
+
+
Model
+
+
+
+ + GIVE_FLUIDS_AFTER_INITIAL_BOLUS + +
+
+ + Response +
+
+
+ + SIGNS_OF_HYPOPERFUSION_PERSIST + +
+
+
+
+
References
+
+ + +
+
+
+
+
+
+
+
+ ) +} diff --git a/web/components/tables/PatientList.tsx b/web/components/tables/PatientList.tsx index 062a4351..8989ee00 100644 --- a/web/components/tables/PatientList.tsx +++ b/web/components/tables/PatientList.tsx @@ -52,6 +52,9 @@ import { } from '@/utils/viewDefinition' import { applyVirtualDerivedPatients } from '@/utils/virtualDerivedTableState' import type { ViewParameters } from '@/utils/viewDefinition' +import { DUMMY_SUGGESTION } from '@/data/mockSystemSuggestions' +import { SystemSuggestionModal } from '@/components/patients/SystemSuggestionModal' +import type { SystemSuggestion } from '@/types/systemSuggestion' export type PatientViewModel = { id: string, @@ -217,6 +220,22 @@ export const PatientList = forwardRef(({ initi const [isSaveViewDialogOpen, setIsSaveViewDialogOpen] = useState(false) + const [suggestionModalOpen, setSuggestionModalOpen] = useState(false) + const [suggestionModalSuggestion, setSuggestionModalSuggestion] = useState(null) + const [suggestionModalPatientName, setSuggestionModalPatientName] = useState('') + + const closeSuggestionModal = useCallback(() => { + setSuggestionModalOpen(false) + setSuggestionModalSuggestion(null) + setSuggestionModalPatientName('') + }, []) + + const openSuggestionModal = useCallback((suggestion: SystemSuggestion, patientName: string) => { + setSuggestionModalSuggestion(suggestion) + setSuggestionModalPatientName(patientName) + setSuggestionModalOpen(true) + }, []) + const [updateSavedView, { loading: overwriteLoading }] = useMutation< UpdateSavedViewMutation, UpdateSavedViewMutationVariables @@ -1061,8 +1080,16 @@ export const PatientList = forwardRef(({ initi void refetch() onPatientUpdated?.() }} + onOpenSystemSuggestion={openSuggestionModal} />
+ void refetch()} + /> {savedViewScope === 'base' && ( { } export const TaskCardView = ({ task, onToggleDone: _onToggleDone, onClick, showAssignee: _showAssignee = false, showPatient = true, className, fullWidth: _fullWidth = false, extraContent }: TaskCardViewProps) => { + const translation = useTasksTranslation() const router = useRouter() + const [presetDialogId, setPresetDialogId] = useState(null) const [selectedUserId, setSelectedUserId] = useState(null) const [optimisticDone, setOptimisticDone] = useState(null) const pendingCheckedRef = useRef(null) @@ -227,6 +232,7 @@ export const TaskCardView = ({ task, onToggleDone: _onToggleDone, onClick, showA )} {!task.assigneeTeam && task.assignee && ( + + )} {(task as FlexibleTask).estimatedTime && (
@@ -305,6 +326,11 @@ export const TaskCardView = ({ task, onToggleDone: _onToggleDone, onClick, showA isOpen={!!selectedUserId} onClose={() => setSelectedUserId(null)} /> + setPresetDialogId(null)} + />
) } diff --git a/web/components/tasks/TaskDataEditor.tsx b/web/components/tasks/TaskDataEditor.tsx index dd6bad54..ca5d8332 100644 --- a/web/components/tasks/TaskDataEditor.tsx +++ b/web/components/tasks/TaskDataEditor.tsx @@ -40,12 +40,29 @@ type TaskFormValues = CreateTaskInput & { assigneeTeamId?: string | null, } +export type PresetRowSavedData = { + title: string, + description: string, + priority: TaskPriority | null, + estimatedTime: number | null, +} + +export type PresetRowEditorConfig = { + formKey: string, + title: string, + description: string, + priority: TaskPriority | null, + estimatedTime: number | null, + onSave: (data: PresetRowSavedData) => void, +} + interface TaskDataEditorProps { id: null | string, initialPatientId?: string, initialPatientName?: string, onListSync?: () => void, onClose?: () => void, + presetRowEditor?: PresetRowEditorConfig | null, } export const TaskDataEditor = ({ @@ -54,6 +71,7 @@ export const TaskDataEditor = ({ initialPatientName, onListSync, onClose, + presetRowEditor, }: TaskDataEditorProps) => { const translation = useTasksTranslation() const { selectedRootLocationIds } = useTasksContext() @@ -61,6 +79,7 @@ export const TaskDataEditor = ({ const [isShowingPatientDialog, setIsShowingPatientDialog] = useState(false) const [assigneeUserPopupId, setAssigneeUserPopupId] = useState(null) + const isPresetRowMode = presetRowEditor != null const isEditMode = id !== null const taskId = id const { refreshingTaskIds } = useRefreshingEntityIds() @@ -75,7 +94,7 @@ export const TaskDataEditor = ({ rootLocationIds: selectedRootLocationIds && selectedRootLocationIds.length > 0 ? selectedRootLocationIds : undefined, states: [PatientState.Admitted, PatientState.Wait], }, - { skip: isEditMode } + { skip: isEditMode || isPresetRowMode } ) const hasRetriedMissingInitialPatientRef = useRef(false) @@ -99,17 +118,27 @@ export const TaskDataEditor = ({ const form = useCreateForm({ initialValues: { - title: '', - description: '', + title: presetRowEditor?.title ?? '', + description: presetRowEditor?.description ?? '', patientId: initialPatientId || '', assigneeIds: [], assigneeTeamId: null, dueDate: null, - priority: null, - estimatedTime: null, + priority: presetRowEditor?.priority ?? null, + estimatedTime: presetRowEditor?.estimatedTime ?? null, done: false, }, onFormSubmit: (values) => { + if (presetRowEditor) { + presetRowEditor.onSave({ + title: values.title.trim(), + description: (values.description ?? '').trim(), + priority: (values.priority as TaskPriority | null) || null, + estimatedTime: values.estimatedTime ?? null, + }) + onClose?.() + return + } createTask({ variables: { data: { @@ -175,6 +204,18 @@ export const TaskDataEditor = ({ const { update: updateForm } = form useEffect(() => { + if (!isPresetRowMode || !presetRowEditor) return + updateForm(prev => ({ + ...prev, + title: presetRowEditor.title, + description: presetRowEditor.description, + priority: presetRowEditor.priority, + estimatedTime: presetRowEditor.estimatedTime, + })) + }, [isPresetRowMode, presetRowEditor, updateForm]) + + useEffect(() => { + if (isPresetRowMode) return if (taskData && isEditMode) { const task = taskData updateForm(prev => ({ @@ -192,7 +233,7 @@ export const TaskDataEditor = ({ } else if (initialPatientId && !taskId) { updateForm(prev => ({ ...prev, patientId: initialPatientId })) } - }, [taskData, isEditMode, initialPatientId, taskId, updateForm]) + }, [taskData, isEditMode, initialPatientId, taskId, updateForm, isPresetRowMode]) useEffect(() => { hasRetriedMissingInitialPatientRef.current = false @@ -267,8 +308,12 @@ export const TaskDataEditor = ({ )} -
{ event.preventDefault(); form.submit() }} className="flex-col-0 overflow-hidden"> -
+ { event.preventDefault(); form.submit() }} + className="flex-col-0 overflow-hidden" + noValidate={isPresetRowMode} + > +
@@ -303,155 +348,161 @@ export const TaskDataEditor = ({
- - name="patientId" - label={translation('patient')} - > - {({ dataProps: { value, onValueChange, onEditComplete }, focusableElementProps, interactionStates }) => { - return (!isEditMode) ? ( - - ) : ( -
- +
+ ) + }} + + )} - - name="assigneeIds" - label={translation('assignedTo')} - > - {() => ( -
- { - updateForm(prev => { - if (!value) { - return { ...prev, assigneeIds: [], assigneeTeamId: null } - } - if (value.startsWith('team:')) { - return { ...prev, assigneeIds: [], assigneeTeamId: value.replace('team:', '') } - } - const currentAssigneeIds = prev.assigneeIds ?? [] - if (currentAssigneeIds.includes(value)) { - return prev - } - return { ...prev, assigneeIds: [...currentAssigneeIds, value], assigneeTeamId: null } - }, isEditMode) - }} - multiUserSelect={true} - onMultiUserIdsSelected={(ids) => { - if (ids.length === 0) return - updateForm(prev => ({ - ...prev, - assigneeIds: [...new Set([...(prev.assigneeIds ?? []), ...ids])], - assigneeTeamId: null, - }), isEditMode) - }} - allowTeams={true} - allowUnassigned={true} - excludeUserIds={assigneeIds ?? []} - /> - {(selectedAssignees.length > 0 || assigneeTeamId) && ( -
- {selectedAssignees.map((assignee) => ( -
-
- + name="assigneeIds" + label={translation('assignedTo')} + > + {() => ( +
+ { + updateForm(prev => { + if (!value) { + return { ...prev, assigneeIds: [], assigneeTeamId: null } + } + if (value.startsWith('team:')) { + return { ...prev, assigneeIds: [], assigneeTeamId: value.replace('team:', '') } + } + const currentAssigneeIds = prev.assigneeIds ?? [] + if (currentAssigneeIds.includes(value)) { + return prev + } + return { ...prev, assigneeIds: [...currentAssigneeIds, value], assigneeTeamId: null } + }, isEditMode) + }} + multiUserSelect={true} + onMultiUserIdsSelected={(ids) => { + if (ids.length === 0) return + updateForm(prev => ({ + ...prev, + assigneeIds: [...new Set([...(prev.assigneeIds ?? []), ...ids])], + assigneeTeamId: null, + }), isEditMode) + }} + allowTeams={true} + allowUnassigned={true} + excludeUserIds={assigneeIds ?? []} + /> + {(selectedAssignees.length > 0 || assigneeTeamId) && ( +
+ {selectedAssignees.map((assignee) => ( +
+
+ + {assignee.name} +
+ setAssigneeUserPopupId(assignee.id)} + > + + + { + updateForm(prev => ({ + ...prev, + assigneeIds: (prev.assigneeIds ?? []).filter((id) => id !== assignee.id), + }), isEditMode) }} - /> - {assignee.name} + > + +
- setAssigneeUserPopupId(assignee.id)} - > - - - { - updateForm(prev => ({ - ...prev, - assigneeIds: (prev.assigneeIds ?? []).filter((id) => id !== assignee.id), - }), isEditMode) - }} - > - - -
- ))} - {assigneeTeamId && ( -
-
- - {selectedTeamTitle ?? translation('locationType', { type: 'TEAM' })} + ))} + {assigneeTeamId && ( +
+
+ + {selectedTeamTitle ?? translation('locationType', { type: 'TEAM' })} +
+ { + updateForm(prev => ({ ...prev, assigneeTeamId: null }), isEditMode) + }} + > + +
- { - updateForm(prev => ({ ...prev, assigneeTeamId: null }), isEditMode) - }} - > - - -
- )} -
- )} -
- )} - + )} +
+ )} +
+ )} + + )} - - name="dueDate" - label={translation('dueDate')} - > - {({ dataProps, focusableElementProps, interactionStates }) => ( - - )} - + {!isPresetRowMode && ( + + name="dueDate" + label={translation('dueDate')} + > + {({ dataProps, focusableElementProps, interactionStates }) => ( + + )} + + )} name="priority" @@ -522,7 +573,7 @@ export const TaskDataEditor = ({ {...dataProps} {...focusableElementProps} {...interactionStates} value={dataProps.value || ''} placeholder={translation('descriptionPlaceholder')} - minLength={4} + minLength={isPresetRowMode ? undefined : 4} /> )} @@ -551,7 +602,7 @@ export const TaskDataEditor = ({ )}
- {!isEditMode && ( + {!isEditMode && !isPresetRowMode && (
)} + {isPresetRowMode && ( +
+ +
+ )} void, + presetId: string | null, +} + +export function TaskPresetSourceDialog({ + isOpen, + onClose, + presetId, +}: TaskPresetSourceDialogProps) { + const translation = useTasksTranslation() + const { data, loading } = useTaskPreset(presetId) + + const preset = data?.taskPreset + + return ( + +
+ {loading && ( +

{translation('loading')}

+ )} + {!loading && !preset && ( +

{translation('taskPresetSourceNotFound')}

+ )} + {!loading && preset && ( + <> +
+ {translation('taskPresetName')} + {preset.name} +
+
+ {translation('taskPresetScope')} + + {preset.scope === TaskPresetScope.Global + ? translation('taskPresetScopeGlobal') + : translation('taskPresetScopePersonal')} + +
+
+ {translation('taskPresetSourceTasksInGraph')} + {preset.graph.nodes.length} +
+ + + + + )} +
+ +
+
+
+ ) +} diff --git a/web/components/views/PatientViewTasksPanel.tsx b/web/components/views/PatientViewTasksPanel.tsx index 433179b7..ebfa98ea 100644 --- a/web/components/views/PatientViewTasksPanel.tsx +++ b/web/components/views/PatientViewTasksPanel.tsx @@ -138,6 +138,7 @@ export function PatientViewTasksPanel({ : undefined, additionalAssigneeCount: !task.assigneeTeam && task.assignees.length > 1 ? task.assignees.length - 1 : 0, + sourceTaskPresetId: task.sourceTaskPresetId ?? null, })) }) }, [patientsData]) diff --git a/web/context/SystemSuggestionTasksContext.tsx b/web/context/SystemSuggestionTasksContext.tsx new file mode 100644 index 00000000..4d9f0977 --- /dev/null +++ b/web/context/SystemSuggestionTasksContext.tsx @@ -0,0 +1,125 @@ +import { + createContext, + useCallback, + useContext, + useEffect, + useMemo, + useState, + type ReactNode +} from 'react' +import type { MachineGeneratedTask } from '@/types/systemSuggestion' +import type { SuggestedTaskItem } from '@/types/systemSuggestion' + +type ToastState = { message: string } | null + +type SystemSuggestionTasksContextValue = { + getCreatedTasksForPatient: (patientId: string) => MachineGeneratedTask[], + addCreatedTasks: ( + patientId: string, + items: SuggestedTaskItem[], + assignToMe?: boolean + ) => void, + setCreatedTaskDone: (patientId: string, taskId: string, done: boolean) => void, + toast: ToastState, + showToast: (message: string) => void, + clearToast: () => void, +} + +const SystemSuggestionTasksContext = createContext(null) + +const TOAST_DURATION_MS = 3000 + +function generateTaskId(): string { + return `suggestion-created-${Date.now()}-${Math.random().toString(36).slice(2, 9)}` +} + +export function SystemSuggestionTasksProvider({ children }: { children: ReactNode }) { + const [createdByPatientId, setCreatedByPatientId] = useState>({}) + const [toast, setToast] = useState(null) + + const getCreatedTasksForPatient = useCallback((patientId: string): MachineGeneratedTask[] => { + return createdByPatientId[patientId] ?? [] + }, [createdByPatientId]) + + const addCreatedTasks = useCallback( + (patientId: string, items: SuggestedTaskItem[], assignToMe?: boolean) => { + const now = new Date() + const newTasks: MachineGeneratedTask[] = items.map((item) => ({ + id: generateTaskId(), + title: item.title, + description: item.description ?? null, + done: false, + patientId, + machineGenerated: true, + source: 'systemSuggestion', + assignedTo: assignToMe ? 'me' : null, + updateDate: now, + dueDate: null, + priority: null, + estimatedTime: null, + })) + setCreatedByPatientId((prev) => { + const existing = prev[patientId] ?? [] + return { ...prev, [patientId]: [...existing, ...newTasks] } + }) + }, + [] + ) + + const setCreatedTaskDone = useCallback((patientId: string, taskId: string, done: boolean) => { + setCreatedByPatientId((prev) => { + const list = prev[patientId] ?? [] + const next = list.map((t) => (t.id === taskId ? { ...t, done } : t)) + return { ...prev, [patientId]: next } + }) + }, []) + + const showToast = useCallback((message: string) => { + setToast({ message }) + }, []) + + const clearToast = useCallback(() => { + setToast(null) + }, []) + + useEffect(() => { + if (!toast) return + const t = setTimeout(() => setToast(null), TOAST_DURATION_MS) + return () => clearTimeout(t) + }, [toast]) + + const value = useMemo( + () => ({ + getCreatedTasksForPatient, + addCreatedTasks, + setCreatedTaskDone, + toast, + showToast, + clearToast, + }), + [getCreatedTasksForPatient, addCreatedTasks, setCreatedTaskDone, toast, showToast, clearToast] + ) + + return ( + + {children} + + ) +} + +export function useSystemSuggestionTasks(): SystemSuggestionTasksContextValue { + const ctx = useContext(SystemSuggestionTasksContext) + if (!ctx) { + throw new Error('useSystemSuggestionTasks must be used within SystemSuggestionTasksProvider') + } + return ctx +} + +export function useSystemSuggestionTasksOptional(): SystemSuggestionTasksContextValue | null { + return useContext(SystemSuggestionTasksContext) +} + +export function useCreatedTasksForPatient(patientId: string): MachineGeneratedTask[] { + const ctx = useSystemSuggestionTasksOptional() + return ctx ? ctx.getCreatedTasksForPatient(patientId) : [] +} diff --git a/web/data/cache/policies.ts b/web/data/cache/policies.ts index ffa573e1..2b0415d0 100644 --- a/web/data/cache/policies.ts +++ b/web/data/cache/policies.ts @@ -84,6 +84,9 @@ export function buildCacheConfig(): InMemoryCacheConfig { PropertyValue: { keyFields: propertyValueKeyFields }, PropertyValueType: { keyFields: propertyValueKeyFields }, PropertyDefinitionType: { keyFields: ['id'] }, + TaskGraphType: { keyFields: false }, + TaskGraphNodeType: { keyFields: false }, + TaskGraphEdgeType: { keyFields: false }, }, } } diff --git a/web/data/hooks/index.ts b/web/data/hooks/index.ts index 3db935fc..39094399 100644 --- a/web/data/hooks/index.ts +++ b/web/data/hooks/index.ts @@ -38,3 +38,9 @@ export { useUpdatePropertyDefinition } from './useUpdatePropertyDefinition' export { useDeletePropertyDefinition } from './useDeletePropertyDefinition' export { useUpdateProfilePicture } from './useUpdateProfilePicture' export { useMySavedViews, useSavedView } from './useSavedViews' +export { useTaskPresets } from './useTaskPresets' +export { useTaskPreset } from './useTaskPreset' +export { useCreateTaskPreset } from './useCreateTaskPreset' +export { useUpdateTaskPreset } from './useUpdateTaskPreset' +export { useDeleteTaskPreset } from './useDeleteTaskPreset' +export { useApplyTaskGraph } from './useApplyTaskGraph' diff --git a/web/data/hooks/useApplyTaskGraph.ts b/web/data/hooks/useApplyTaskGraph.ts new file mode 100644 index 00000000..36d9f865 --- /dev/null +++ b/web/data/hooks/useApplyTaskGraph.ts @@ -0,0 +1,14 @@ +import { useMutation } from '@apollo/client/react' +import { + ApplyTaskGraphDocument, + type ApplyTaskGraphMutation, + type ApplyTaskGraphMutationVariables +} from '@/api/gql/generated' +import { getParsedDocument } from './queryHelpers' + +export function useApplyTaskGraph() { + return useMutation< + ApplyTaskGraphMutation, + ApplyTaskGraphMutationVariables + >(getParsedDocument(ApplyTaskGraphDocument)) +} diff --git a/web/data/hooks/useCreateTaskPreset.ts b/web/data/hooks/useCreateTaskPreset.ts new file mode 100644 index 00000000..8334bb48 --- /dev/null +++ b/web/data/hooks/useCreateTaskPreset.ts @@ -0,0 +1,14 @@ +import { useMutation } from '@apollo/client/react' +import { + CreateTaskPresetDocument, + type CreateTaskPresetMutation, + type CreateTaskPresetMutationVariables +} from '@/api/gql/generated' +import { getParsedDocument } from './queryHelpers' + +export function useCreateTaskPreset() { + return useMutation< + CreateTaskPresetMutation, + CreateTaskPresetMutationVariables + >(getParsedDocument(CreateTaskPresetDocument)) +} diff --git a/web/data/hooks/useDeleteTaskPreset.ts b/web/data/hooks/useDeleteTaskPreset.ts new file mode 100644 index 00000000..1e6ac065 --- /dev/null +++ b/web/data/hooks/useDeleteTaskPreset.ts @@ -0,0 +1,14 @@ +import { useMutation } from '@apollo/client/react' +import { + DeleteTaskPresetDocument, + type DeleteTaskPresetMutation, + type DeleteTaskPresetMutationVariables +} from '@/api/gql/generated' +import { getParsedDocument } from './queryHelpers' + +export function useDeleteTaskPreset() { + return useMutation< + DeleteTaskPresetMutation, + DeleteTaskPresetMutationVariables + >(getParsedDocument(DeleteTaskPresetDocument)) +} diff --git a/web/data/hooks/useTaskPreset.ts b/web/data/hooks/useTaskPreset.ts new file mode 100644 index 00000000..4109510b --- /dev/null +++ b/web/data/hooks/useTaskPreset.ts @@ -0,0 +1,17 @@ +import { useQuery } from '@apollo/client/react' +import { + TaskPresetDocument, + type TaskPresetQuery, + type TaskPresetQueryVariables +} from '@/api/gql/generated' +import { getParsedDocument } from './queryHelpers' + +export function useTaskPreset(id: string | null | undefined) { + return useQuery( + getParsedDocument(TaskPresetDocument), + { + variables: { id: id ?? '' }, + skip: !id, + } + ) +} diff --git a/web/data/hooks/useTaskPresets.ts b/web/data/hooks/useTaskPresets.ts new file mode 100644 index 00000000..2ac62ad5 --- /dev/null +++ b/web/data/hooks/useTaskPresets.ts @@ -0,0 +1,13 @@ +import { useQuery } from '@apollo/client/react' +import { + TaskPresetsDocument, + type TaskPresetsQuery, + type TaskPresetsQueryVariables +} from '@/api/gql/generated' +import { getParsedDocument } from './queryHelpers' + +export function useTaskPresets() { + return useQuery( + getParsedDocument(TaskPresetsDocument) + ) +} diff --git a/web/data/hooks/useUpdateTaskPreset.ts b/web/data/hooks/useUpdateTaskPreset.ts new file mode 100644 index 00000000..aba4cfd9 --- /dev/null +++ b/web/data/hooks/useUpdateTaskPreset.ts @@ -0,0 +1,14 @@ +import { useMutation } from '@apollo/client/react' +import { + UpdateTaskPresetDocument, + type UpdateTaskPresetMutation, + type UpdateTaskPresetMutationVariables +} from '@/api/gql/generated' +import { getParsedDocument } from './queryHelpers' + +export function useUpdateTaskPreset() { + return useMutation< + UpdateTaskPresetMutation, + UpdateTaskPresetMutationVariables + >(getParsedDocument(UpdateTaskPresetDocument)) +} diff --git a/web/data/index.ts b/web/data/index.ts index 97a1701d..2f046790 100644 --- a/web/data/index.ts +++ b/web/data/index.ts @@ -73,6 +73,12 @@ export { useUpdateProfilePicture, useMySavedViews, useSavedView, + useTaskPresets, + useTaskPreset, + useCreateTaskPreset, + useUpdateTaskPreset, + useDeleteTaskPreset, + useApplyTaskGraph, } from './hooks' export type { ClientMutationId, diff --git a/web/data/mockPatients.ts b/web/data/mockPatients.ts new file mode 100644 index 00000000..4971daef --- /dev/null +++ b/web/data/mockPatients.ts @@ -0,0 +1,91 @@ +import { PatientState, Sex } from '@/api/gql/generated' +import type { PatientViewModel } from '@/components/tables/PatientList' + +export const MOCK_PATIENT_A_ID = 'mock-patient-a' +export const MOCK_PATIENT_B_ID = 'mock-patient-b' +export const MOCK_PATIENT_C_ID = 'mock-patient-c' +export const MOCK_PATIENT_D_ID = 'mock-patient-d' +export const MOCK_PATIENT_E_ID = 'mock-patient-e' + +const mockBirthdateA = new Date(1965, 2, 15) +const mockBirthdateB = new Date(1970, 8, 1) +const mockBirthdateC = new Date(1980, 5, 20) +const mockBirthdateD = new Date(1975, 11, 8) +const mockBirthdateE = new Date(1988, 1, 14) + +export const MOCK_PATIENT_A: PatientViewModel = { + id: MOCK_PATIENT_A_ID, + name: 'Patient A', + firstname: 'Patient', + lastname: 'A', + position: null, + openTasksCount: 0, + closedTasksCount: 0, + birthdate: mockBirthdateA, + sex: Sex.Male, + state: PatientState.Admitted, + tasks: [], + properties: [], +} + +export const MOCK_PATIENT_B: PatientViewModel = { + id: MOCK_PATIENT_B_ID, + name: 'Patient B', + firstname: 'Patient', + lastname: 'B', + position: null, + openTasksCount: 0, + closedTasksCount: 0, + birthdate: mockBirthdateB, + sex: Sex.Female, + state: PatientState.Admitted, + tasks: [], + properties: [], +} + +export const MOCK_PATIENT_C: PatientViewModel = { + id: MOCK_PATIENT_C_ID, + name: 'Patient C', + firstname: 'Patient', + lastname: 'C', + position: null, + openTasksCount: 0, + closedTasksCount: 0, + birthdate: mockBirthdateC, + sex: Sex.Female, + state: PatientState.Admitted, + tasks: [], + properties: [], +} + +export const MOCK_PATIENT_D: PatientViewModel = { + id: MOCK_PATIENT_D_ID, + name: 'Patient D', + firstname: 'Patient', + lastname: 'D', + position: null, + openTasksCount: 0, + closedTasksCount: 0, + birthdate: mockBirthdateD, + sex: Sex.Male, + state: PatientState.Admitted, + tasks: [], + properties: [], +} + +export const MOCK_PATIENT_E: PatientViewModel = { + id: MOCK_PATIENT_E_ID, + name: 'Patient E', + firstname: 'Patient', + lastname: 'E', + position: null, + openTasksCount: 0, + closedTasksCount: 0, + birthdate: mockBirthdateE, + sex: Sex.Male, + state: PatientState.Admitted, + tasks: [], + properties: [], +} + +export const MOCK_PATIENTS: PatientViewModel[] = [MOCK_PATIENT_A, MOCK_PATIENT_B, MOCK_PATIENT_C, MOCK_PATIENT_D, MOCK_PATIENT_E] diff --git a/web/data/mockSystemSuggestions.ts b/web/data/mockSystemSuggestions.ts new file mode 100644 index 00000000..867b55a6 --- /dev/null +++ b/web/data/mockSystemSuggestions.ts @@ -0,0 +1,70 @@ +import type { GuidelineAdherenceStatus, SystemSuggestion } from '@/types/systemSuggestion' +import { MOCK_PATIENT_A_ID, MOCK_PATIENT_B_ID, MOCK_PATIENT_C_ID, MOCK_PATIENT_D_ID, MOCK_PATIENT_E_ID } from '@/data/mockPatients' + +export const MOCK_SUGGESTION_FOR_PATIENT_A: SystemSuggestion = { + id: 'mock-suggestion-a', + patientId: MOCK_PATIENT_A_ID, + adherenceStatus: 'non_adherent', + reasonSummary: 'Current treatment plan does not align with guideline recommendations for this condition. Recommended tasks address screening and follow-up intervals that have been missed.', + suggestedTasks: [ + { id: 'sug-1', title: 'Schedule guideline-recommended screening', description: 'Book lab and imaging per protocol.' }, + { id: 'sug-2', title: 'Document treatment rationale', description: 'Record clinical reasoning for any deviation from guidelines.' }, + { id: 'sug-3', title: 'Plan follow-up within 4 weeks', description: 'Set reminder for next review date.' }, + ], + explanation: { + details: 'The recommendation is shown because de-facto treatment of this patient is not adherent with the de-jure models. The suggested tasks are derived from evidence-based protocols to improve adherence and outcomes.', + references: [ + { title: 'Clinical guideline (PDF)', url: 'https://example.com/guideline.pdf' }, + { title: 'Supporting literature', url: 'https://example.com/literature' }, + ], + }, + createdAt: new Date().toISOString(), +} + +export const MOCK_SUGGESTION_FOR_PATIENT_E: SystemSuggestion = { + id: 'mock-suggestion-e', + patientId: MOCK_PATIENT_E_ID, + adherenceStatus: 'adherent', + reasonSummary: 'Guideline targets are met. Optional follow-up tasks may help maintain adherence and document progress.', + suggestedTasks: [ + { id: 'sug-e1', title: 'Optional: Schedule next routine review', description: 'Book follow-up within 6 months.' }, + { id: 'sug-e2', title: 'Optional: Update care plan summary', description: 'Keep documentation in sync with current status.' }, + ], + explanation: { + details: 'The recommendation is shown because de-facto treatment is not fully aligned with de-jure models. The suggested tasks are derived as optional improvements to support ongoing adherence and documentation.', + references: [ + { title: 'Follow-up protocol', url: 'https://example.com/follow-up.pdf' }, + ], + }, + createdAt: new Date().toISOString(), +} + +const adherenceByPatientId: Record = { + [MOCK_PATIENT_A_ID]: 'non_adherent', + [MOCK_PATIENT_B_ID]: 'adherent', + [MOCK_PATIENT_C_ID]: 'adherent', + [MOCK_PATIENT_D_ID]: 'adherent', + [MOCK_PATIENT_E_ID]: 'adherent', +} + +const suggestionByPatientId: Record = { + [MOCK_PATIENT_A_ID]: MOCK_SUGGESTION_FOR_PATIENT_A, + [MOCK_PATIENT_E_ID]: MOCK_SUGGESTION_FOR_PATIENT_E, +} + +export function getAdherenceByPatientId(patientId: string): GuidelineAdherenceStatus { + return adherenceByPatientId[patientId] ?? 'unknown' +} + +export function getSuggestionByPatientId(patientId: string): SystemSuggestion | null { + return suggestionByPatientId[patientId] ?? null +} + +export const DUMMY_SUGGESTION: SystemSuggestion = { + id: 'dummy', + patientId: '', + adherenceStatus: 'unknown', + reasonSummary: '', + suggestedTasks: [], + explanation: { details: '', references: [] }, +} diff --git a/web/i18n/translations.ts b/web/i18n/translations.ts index adb9ab4a..ba0855c1 100644 --- a/web/i18n/translations.ts +++ b/web/i18n/translations.ts @@ -105,6 +105,9 @@ export type TasksTranslationEntries = { 'listViewTable': string, 'loading': string, 'loadMore': string, + 'loadTaskPreset': string, + 'loadTaskPresetConfirm': (values: { count: number }) => string, + 'loadTaskPresetTitle': string, 'location': string, 'locationBed': string, 'locationClinic': string, @@ -226,7 +229,34 @@ export type TasksTranslationEntries = { 'surveyTitle': string, 'system': string, 'task': string, + 'taskFromPresetTooltip': string, + 'taskPresetAddRow': string, + 'taskPresetApplyToRow': string, + 'taskPresetCreate': string, + 'taskPresetDelete': string, + 'taskPresetDeleteConfirm': string, + 'taskPresetEdit': string, + 'taskPresetEditDetails': string, + 'taskPresetEmptyList': string, + 'taskPresetKey': string, + 'taskPresetKeyHint': string, + 'taskPresetName': string, + 'taskPresetNoEstimate': string, + 'taskPresetNoTasks': string, + 'taskPresetRemoveRow': string, + 'taskPresets': string, + 'taskPresetSave': string, + 'taskPresetScope': string, + 'taskPresetScopeGlobal': string, + 'taskPresetScopePersonal': string, + 'taskPresetsDescription': string, + 'taskPresetSelectPlaceholder': string, + 'taskPresetSourceNotFound': string, + 'taskPresetSourceOpenSettings': string, + 'taskPresetSourceTasksInGraph': string, + 'taskPresetSourceTitle': string, 'tasks': string, + 'tasksCreatedFromPreset': string, 'tasksUpdatedRecently': string, 'taskTitlePlaceholder': string, 'teams': string, @@ -373,6 +403,17 @@ export const tasksTranslation: Translation { + let _out: string = '' + _out += TranslationGen.resolvePlural(count, { + '=1': `${count} Aufgabe`, + 'other': `${count} Aufgaben`, + }) + _out += ` für diesen Patienten anlegen?` + return _out + }, + 'loadTaskPresetTitle': `Aufgaben-Vorlage laden`, 'location': `Ort`, 'locationBed': `Bett`, 'locationClinic': `Klinik`, @@ -576,7 +617,34 @@ export const tasksTranslation: Translation { + let _out: string = '' + _out += `Create ` + _out += TranslationGen.resolvePlural(count, { + '=1': `${count} task`, + 'other': `${count} tasks`, + }) + _out += ` for this patient?` + return _out + }, + 'loadTaskPresetTitle': `Load task preset`, 'location': `Location`, 'locationBed': `Bed`, 'locationClinic': `Clinic`, @@ -931,7 +1011,34 @@ export const tasksTranslation: Translation { + let _out: string = '' + _out += `Create ` + _out += TranslationGen.resolvePlural(count, { + '=1': `${count} task`, + 'other': `${count} tasks`, + }) + _out += ` for this patient?` + return _out + }, + 'loadTaskPresetTitle': `Load task preset`, 'location': `Ubicación`, 'locationBed': `Cama`, 'locationClinic': `Clínica`, @@ -1285,7 +1404,34 @@ export const tasksTranslation: Translation { + let _out: string = '' + _out += `Create ` + _out += TranslationGen.resolvePlural(count, { + '=1': `${count} task`, + 'other': `${count} tasks`, + }) + _out += ` for this patient?` + return _out + }, + 'loadTaskPresetTitle': `Load task preset`, 'location': `Emplacement`, 'locationBed': `Lit`, 'locationClinic': `Clinique`, @@ -1639,7 +1797,34 @@ export const tasksTranslation: Translation { + let _out: string = '' + _out += `Create ` + _out += TranslationGen.resolvePlural(count, { + '=1': `${count} task`, + 'other': `${count} tasks`, + }) + _out += ` for this patient?` + return _out + }, + 'loadTaskPresetTitle': `Load task preset`, 'location': `Locatie`, 'locationBed': `Bed`, 'locationClinic': `Kliniek`, @@ -1996,7 +2193,34 @@ export const tasksTranslation: Translation { + let _out: string = '' + _out += `Create ` + _out += TranslationGen.resolvePlural(count, { + '=1': `${count} task`, + 'other': `${count} tasks`, + }) + _out += ` for this patient?` + return _out + }, + 'loadTaskPresetTitle': `Load task preset`, 'location': `Localização`, 'locationBed': `Leito`, 'locationClinic': `Clínica`, @@ -2350,7 +2586,34 @@ export const tasksTranslation: Translation - - - - + + + + + + + diff --git a/web/pages/location/[id].tsx b/web/pages/location/[id].tsx index f82a580d..a74a29c4 100644 --- a/web/pages/location/[id].tsx +++ b/web/pages/location/[id].tsx @@ -96,6 +96,7 @@ const LocationPage: NextPage = () => { : undefined, additionalAssigneeCount: !task.assigneeTeam && task.assignees.length > 1 ? task.assignees.length - 1 : 0, + sourceTaskPresetId: task.sourceTaskPresetId ?? null, })) } @@ -133,6 +134,7 @@ const LocationPage: NextPage = () => { : undefined, additionalAssigneeCount: !task.assigneeTeam && task.assignees.length > 1 ? task.assignees.length - 1 : 0, + sourceTaskPresetId: task.sourceTaskPresetId ?? null, })) }) }, [patientsData, tasksData, isTeamLocation]) diff --git a/web/pages/settings/index.tsx b/web/pages/settings/index.tsx index 80b98a28..70b071aa 100644 --- a/web/pages/settings/index.tsx +++ b/web/pages/settings/index.tsx @@ -17,7 +17,7 @@ import { useStorage } from '@/hooks/useStorage' import type { HightideTranslationLocales, ThemeType } from '@helpwave/hightide' import { useTasksContext } from '@/hooks/useTasksContext' import { useAuth } from '@/hooks/useAuth' -import { LogOut, MonitorCog, MoonIcon, SunIcon, Trash2, ClipboardList, Shield, TableProperties, Building2, MessageSquareText, Upload, X, Rabbit } from 'lucide-react' +import { LogOut, MonitorCog, MoonIcon, SunIcon, Trash2, ClipboardList, Shield, TableProperties, Building2, MessageSquareText, Upload, X, Rabbit, Combine } from 'lucide-react' import { useRouter } from 'next/router' import clsx from 'clsx' import { removeUser } from '@/api/auth/authService' @@ -279,6 +279,20 @@ const SettingsPage: NextPage = () => {
+
diff --git a/web/pages/settings/task-presets.tsx b/web/pages/settings/task-presets.tsx new file mode 100644 index 00000000..4cd45ce9 --- /dev/null +++ b/web/pages/settings/task-presets.tsx @@ -0,0 +1,722 @@ +import type { NextPage } from 'next' +import { useCallback, useEffect, useMemo, useRef, useState } from 'react' +import { useRouter } from 'next/router' +import { + Button, + Chip, + Dialog, + Drawer, + FillerCell, + FocusTrapWrapper, + IconButton, + Input, + LoadingContainer, + Select, + SelectOption, + Table +} from '@helpwave/hightide' +import type { ColumnDef } from '@tanstack/table-core' +import { ArrowLeft, EditIcon, Pencil, PlusIcon, Save, Trash2, X } from 'lucide-react' +import { Page } from '@/components/layout/Page' +import { ContentPanel } from '@/components/layout/ContentPanel' +import titleWrapper from '@/utils/titleWrapper' +import { useTasksTranslation } from '@/i18n/useTasksTranslation' +import { + useCreateTaskPreset, + useDeleteTaskPreset, + useTaskPresets, + useUpdateTaskPreset +} from '@/data' +import { TaskPresetScope } from '@/api/gql/generated' +import { TaskDataEditor } from '@/components/tasks/TaskDataEditor' +import type { TaskPresetListRow } from '@/utils/taskGraph' +import { graphNodesToListRows, listRowsToTaskGraphInput } from '@/utils/taskGraph' +import clsx from 'clsx' +import { PriorityUtils } from '@/utils/priority' + +const isGlobalScope = (scope: string): boolean => scope === TaskPresetScope.Global + +const defaultRow = (): TaskPresetListRow => ({ + title: '', + description: '', + priority: null, + estimatedTime: null, +}) + +const hasEmptyTaskTitle = (rows: TaskPresetListRow[]): boolean => + rows.some(r => r.title.trim() === '') + +type PresetRowDrawerTarget = null | { + section: 'create' | 'edit', + index: number, + session: number, +} + +type PresetTableRow = { + id: string, + name: string, + scope: string, +} + +const TaskPresetsPage: NextPage = () => { + const translation = useTasksTranslation() + const router = useRouter() + + const stripPresetQueryParam = useCallback(() => { + if (router.query['preset'] === undefined) return + const nextQuery = { ...router.query } + delete nextQuery['preset'] + void router.replace({ pathname: router.pathname, query: nextQuery }, undefined, { shallow: true }) + }, [router]) + + const { data, loading, refetch } = useTaskPresets() + + const [createPreset] = useCreateTaskPreset() + const [updatePreset] = useUpdateTaskPreset() + const [deletePreset] = useDeleteTaskPreset() + + const [name, setName] = useState('') + const [scope, setScope] = useState(TaskPresetScope.Personal) + const [rows, setRows] = useState([defaultRow()]) + const [saving, setSaving] = useState(false) + + const [editOpen, setEditOpen] = useState(false) + const [editId, setEditId] = useState(null) + const [editName, setEditName] = useState('') + const [editRows, setEditRows] = useState([defaultRow()]) + const [deleteOpen, setDeleteOpen] = useState(false) + const [deleteId, setDeleteId] = useState(null) + const [presetRowDrawer, setPresetRowDrawer] = useState(null) + const [createDrawerOpen, setCreateDrawerOpen] = useState(false) + + const presets = useMemo(() => data?.taskPresets ?? [], [data?.taskPresets]) + + const presetTableRows = useMemo( + () => + presets.map(p => ({ + id: p.id, + name: p.name, + scope: p.scope, + })), + [presets] + ) + + const fillerRowCell = useCallback(() => , []) + + const openPresetRowDrawer = useCallback((section: 'create' | 'edit', index: number) => { + setPresetRowDrawer(prev => ({ + section, + index, + session: (prev?.session ?? 0) + 1, + })) + }, []) + + useEffect(() => { + if (!editOpen) { + setPresetRowDrawer(null) + } + }, [editOpen]) + + const resetCreateForm = useCallback(() => { + setName('') + setScope(TaskPresetScope.Personal) + setRows([defaultRow()]) + }, []) + + const openCreateDrawer = useCallback(() => { + resetCreateForm() + setCreateDrawerOpen(true) + }, [resetCreateForm]) + + const handleCreate = useCallback(async () => { + const graph = listRowsToTaskGraphInput(rows) + if (graph.nodes.length === 0) { + return + } + setSaving(true) + try { + await createPreset({ + variables: { + data: { + name: name.trim(), + scope, + graph, + }, + }, + }) + await refetch() + resetCreateForm() + setCreateDrawerOpen(false) + stripPresetQueryParam() + } finally { + setSaving(false) + } + }, [createPreset, name, scope, rows, refetch, resetCreateForm, stripPresetQueryParam]) + + const openEdit = useCallback( + (id: string) => { + const p = presets.find(x => x.id === id) + if (!p) return + setPresetRowDrawer(null) + setEditId(id) + setEditName(p.name) + setEditRows(graphNodesToListRows(p.graph)) + setEditOpen(true) + }, + [presets] + ) + + const closeEditDialog = useCallback(() => { + setEditOpen(false) + setEditId(null) + stripPresetQueryParam() + }, [stripPresetQueryParam]) + + const presetIdFromUrl = useMemo(() => { + if (!router.isReady) return undefined + const raw = router.query['preset'] + return typeof raw === 'string' ? raw : Array.isArray(raw) ? raw[0] : undefined + }, [router.isReady, router.query]) + + const consumedPresetQueryRef = useRef(null) + + useEffect(() => { + if (!presetIdFromUrl) { + consumedPresetQueryRef.current = null + } + }, [presetIdFromUrl]) + + useEffect(() => { + if (!router.isReady || loading || !presetIdFromUrl || presets.length === 0) return + if (consumedPresetQueryRef.current === presetIdFromUrl) return + const found = presets.find(p => p.id === presetIdFromUrl) + if (!found) return + consumedPresetQueryRef.current = presetIdFromUrl + openEdit(found.id) + }, [router.isReady, loading, presetIdFromUrl, presets, openEdit]) + + const handleUpdate = useCallback(async () => { + if (!editId) return + const graph = listRowsToTaskGraphInput(editRows) + if (graph.nodes.length === 0) { + return + } + setSaving(true) + try { + await updatePreset({ + variables: { + id: editId, + data: { + name: editName.trim(), + graph, + }, + }, + }) + await refetch() + closeEditDialog() + } finally { + setSaving(false) + } + }, [editId, editName, editRows, updatePreset, refetch, closeEditDialog]) + + const confirmDelete = useCallback(async () => { + if (!deleteId) return + setSaving(true) + try { + await deletePreset({ variables: { id: deleteId } }) + await refetch() + setDeleteOpen(false) + setDeleteId(null) + } finally { + setSaving(false) + } + }, [deleteId, deletePreset, refetch]) + + const presetColumns = useMemo[]>( + () => [ + { + id: 'name', + header: translation('name'), + accessorKey: 'name', + cell: ({ row }) => ( + + {row.original.name} + + ), + minSize: 200, + size: 280, + enableSorting: false, + }, + { + id: 'scope', + header: translation('taskPresetScope'), + cell: ({ row }) => ( + + + {isGlobalScope(row.original.scope) + ? translation('taskPresetScopeGlobal') + : translation('taskPresetScopePersonal')} + + + ), + minSize: 120, + size: 140, + enableSorting: false, + }, + { + id: 'actions', + header: '', + cell: ({ row }) => ( +
+ openEdit(row.original.id)} + > + + + { + setDeleteId(row.original.id) + setDeleteOpen(true) + }} + > + + +
+ ), + size: 100, + minSize: 100, + maxSize: 100, + enableSorting: false, + }, + ], + [openEdit, translation] + ) + + return ( + + +
+ + +
+
+

+ {translation('taskPresets')} +

+ +
+ {loading ? ( + + ) : presetTableRows.length === 0 ? ( +
{translation('taskPresetEmptyList')}
+ ) : ( +
+ + + )} + + + + + { + setCreateDrawerOpen(false) + stripPresetQueryParam() + }} + alignment="right" + titleElement={translation('taskPresetCreate')} + description={undefined} + > +
+
+
+ {translation('taskPresetName')} + setName(e.target.value)} className="w-full" /> +
+
+ {translation('taskPresetScope')} + +
+
+
+ {translation('addTask')} + {rows.map((row, index) => ( +
+
+
+ { + const next = [...rows] + const cur = next[index] ?? defaultRow() + next[index] = { ...cur, title: e.target.value } + setRows(next) + }} + className="w-full" + /> +
+ + + {row.priority + ? translation('priority', { priority: row.priority }) + : translation('priorityNone')} + + + {row.estimatedTime != null && row.estimatedTime > 0 + ? `${translation('estimatedTime')}: ${row.estimatedTime}` + : translation('taskPresetNoEstimate')} + +
+ {row.description.trim() !== '' && ( +

+ {row.description} +

+ )} +
+
+ openPresetRowDrawer('create', index)} + > + + + setRows(rows.filter((_, i) => i !== index))} + disabled={rows.length <= 1} + > + + +
+
+
+ ))} + +
+
+ + +
+
+
+ + setPresetRowDrawer(null)} + alignment="right" + titleElement={translation('createTask')} + description={undefined} + > + {presetRowDrawer != null && (() => { + const row = presetRowDrawer.section === 'create' + ? rows[presetRowDrawer.index] + : editRows[presetRowDrawer.index] + if (!row) { + return null + } + const target = presetRowDrawer + return ( + { + const apply = (r: TaskPresetListRow): TaskPresetListRow => ({ + ...r, + title: data.title, + description: data.description, + priority: data.priority, + estimatedTime: data.estimatedTime, + }) + if (target.section === 'create') { + setRows(prev => { + const next = [...prev] + const cur = next[target.index] + if (cur) next[target.index] = apply(cur) + return next + }) + } else { + setEditRows(prev => { + const next = [...prev] + const cur = next[target.index] + if (cur) next[target.index] = apply(cur) + return next + }) + } + setPresetRowDrawer(null) + }, + }} + onClose={() => setPresetRowDrawer(null)} + /> + ) + })()} + + + + +
+
+ {translation('taskPresetName')} + setEditName(e.target.value)} className="w-full" /> +
+
+ {translation('addTask')} + {editRows.map((row, index) => ( +
+
+
+ { + const next = [...editRows] + const cur = next[index] ?? defaultRow() + next[index] = { ...cur, title: e.target.value } + setEditRows(next) + }} + className="w-full" + /> +
+ + + {row.priority + ? translation('priority', { priority: row.priority }) + : translation('priorityNone')} + + + {row.estimatedTime != null && row.estimatedTime > 0 + ? `${translation('estimatedTime')}: ${row.estimatedTime}` + : translation('taskPresetNoEstimate')} + +
+ {row.description.trim() !== '' && ( +

+ {row.description} +

+ )} +
+
+ openPresetRowDrawer('edit', index)} + > + + + setEditRows(editRows.filter((_, i) => i !== index))} + disabled={editRows.length <= 1} + > + + +
+
+
+ ))} + +
+
+ + +
+
+
+
+ + { + setDeleteOpen(false) + setDeleteId(null) + }} + titleElement={translation('taskPresetDelete')} + description={null} + position="center" + isModal={true} + className="max-w-md" + > +
+

{translation('taskPresetDeleteConfirm')}

+
+ + +
+
+
+ + ) +} + +export default TaskPresetsPage diff --git a/web/pages/tasks/index.tsx b/web/pages/tasks/index.tsx index 5dbfc5c5..50919270 100644 --- a/web/pages/tasks/index.tsx +++ b/web/pages/tasks/index.tsx @@ -157,6 +157,7 @@ const TasksPage: NextPage = () => { : undefined, additionalAssigneeCount: !task.assigneeTeam && task.assignees.length > 1 ? task.assignees.length - 1 : 0, + sourceTaskPresetId: task.sourceTaskPresetId ?? null, properties: task.properties ?? [], })) }, [accumulatedTasksRaw]) diff --git a/web/pages/view/[uid].tsx b/web/pages/view/[uid].tsx index 8eaaf951..5a781c07 100644 --- a/web/pages/view/[uid].tsx +++ b/web/pages/view/[uid].tsx @@ -315,6 +315,7 @@ function SavedTaskViewTab({ : undefined, additionalAssigneeCount: !task.assigneeTeam && task.assignees.length > 1 ? task.assignees.length - 1 : 0, + sourceTaskPresetId: task.sourceTaskPresetId ?? null, properties: task.properties ?? [], })) }, [accumulatedTasksRaw]) diff --git a/web/types/systemSuggestion.ts b/web/types/systemSuggestion.ts new file mode 100644 index 00000000..a855e2d2 --- /dev/null +++ b/web/types/systemSuggestion.ts @@ -0,0 +1,39 @@ +export type GuidelineAdherenceStatus = 'adherent' | 'non_adherent' | 'unknown' + +export type SuggestedTaskItem = { + id: string, + title: string, + description?: string, +} + +export type SystemSuggestionExplanation = { + details: string, + references: Array<{ title: string, url: string }>, +} + +export type SystemSuggestion = { + id: string, + patientId: string, + adherenceStatus: GuidelineAdherenceStatus, + reasonSummary: string, + suggestedTasks: SuggestedTaskItem[], + explanation: SystemSuggestionExplanation, + createdAt?: string, +} + +export type TaskSource = 'manual' | 'systemSuggestion' + +export type MachineGeneratedTask = { + id: string, + title: string, + description?: string | null, + done: boolean, + patientId: string, + machineGenerated: true, + source: 'systemSuggestion', + assignedTo?: 'me' | null, + updateDate: Date, + dueDate?: Date | null, + priority?: string | null, + estimatedTime?: number | null, +} diff --git a/web/utils/overviewRecentTaskToTaskViewModel.ts b/web/utils/overviewRecentTaskToTaskViewModel.ts index 4beead43..a7a886e2 100644 --- a/web/utils/overviewRecentTaskToTaskViewModel.ts +++ b/web/utils/overviewRecentTaskToTaskViewModel.ts @@ -45,6 +45,7 @@ export function overviewRecentTaskToTaskViewModel(task: OverviewRecentTask): Tas : undefined, additionalAssigneeCount: !task.assigneeTeam && task.assignees.length > 1 ? task.assignees.length - 1 : 0, + sourceTaskPresetId: task.sourceTaskPresetId ?? null, properties: task.properties ?? [], } } diff --git a/web/utils/taskGraph.ts b/web/utils/taskGraph.ts new file mode 100644 index 00000000..6c941052 --- /dev/null +++ b/web/utils/taskGraph.ts @@ -0,0 +1,74 @@ +import type { TaskGraphInput, TaskGraphNodeInput, TaskPriority } from '@/api/gql/generated' +import type { SuggestedTaskItem } from '@/types/systemSuggestion' + +export type TaskPresetListRow = { + title: string, + description: string, + priority: TaskPriority | null, + estimatedTime: number | null, +} + +export function listRowsToTaskGraphInput(rows: TaskPresetListRow[]): TaskGraphInput { + const trimmed = rows.map(r => ({ + title: r.title.trim(), + description: r.description.trim(), + priority: r.priority, + estimatedTime: r.estimatedTime, + })).filter(r => r.title.length > 0) + const nodes: TaskGraphNodeInput[] = trimmed.map((r, i) => ({ + nodeId: `n${i + 1}`, + title: r.title, + description: r.description.length > 0 ? r.description : undefined, + priority: r.priority ?? undefined, + estimatedTime: r.estimatedTime ?? undefined, + })) + const edges = [] + for (let i = 0; i < nodes.length - 1; i++) { + const a = nodes[i] + const b = nodes[i + 1] + if (!a || !b) continue + edges.push({ + fromNodeId: a.nodeId, + toNodeId: b.nodeId, + }) + } + return { nodes, edges } +} + +export function graphNodesToListRows(graph: { + nodes: Array<{ + id: string, + title: string, + description?: string | null, + priority?: string | null, + estimatedTime?: number | null, + }>, +}): TaskPresetListRow[] { + return graph.nodes.map(n => ({ + title: n.title, + description: n.description ?? '', + priority: (n.priority as TaskPriority | null) ?? null, + estimatedTime: n.estimatedTime ?? null, + })) +} + +export function suggestionItemsToTaskGraphInput(items: SuggestedTaskItem[]): TaskGraphInput { + const nodes: TaskGraphNodeInput[] = items.map((t, i) => ({ + nodeId: `s-${i}-${t.id}`, + title: t.title, + description: t.description ?? undefined, + priority: undefined, + estimatedTime: undefined, + })) + const edges = [] + for (let i = 0; i < nodes.length - 1; i++) { + const a = nodes[i] + const b = nodes[i + 1] + if (!a || !b) continue + edges.push({ + fromNodeId: a.nodeId, + toNodeId: b.nodeId, + }) + } + return { nodes, edges } +}