diff --git a/.github/workflows/lint-python.yml b/.github/workflows/lint-python.yml index 8054ab1..083162a 100644 --- a/.github/workflows/lint-python.yml +++ b/.github/workflows/lint-python.yml @@ -31,7 +31,7 @@ jobs: run: pip install flake8 - name: Run flake8 on backend - run: flake8 backend --ignore=E501,W503 --exclude=venv,__pycache__,migrations + run: flake8 backend --ignore=E501,W503 --exclude=venv,test_venv,test_env,__pycache__,migrations - name: Run flake8 on simulator run: flake8 simulator --ignore=E501,W503 --exclude=venv,__pycache__ diff --git a/web/api/gql/generated.ts b/web/api/gql/generated.ts index 7e36469..ca1f138 100644 --- a/web/api/gql/generated.ts +++ b/web/api/gql/generated.ts @@ -882,7 +882,7 @@ export type GetOverviewDataQueryVariables = Exact<{ }>; -export type GetOverviewDataQuery = { __typename?: 'Query', recentPatientsTotal: number, recentTasksTotal: number, recentPatients: Array<{ __typename?: 'PatientType', id: string, name: string, sex: Sex, birthdate: any, position?: { __typename?: 'LocationNodeType', id: string, title: string, kind: LocationType, parent?: { __typename?: 'LocationNodeType', id: string, title: string } | null } | null, tasks: Array<{ __typename?: 'TaskType', 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, updateDate?: any | null, priority?: 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 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 GetPatientQueryVariables = Exact<{ id: Scalars['ID']['input']; @@ -1218,7 +1218,7 @@ 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":"sex"}},{"kind":"Field","name":{"kind":"Name","value":"birthdate"}},{"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":"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":"updateDate"}},{"kind":"Field","name":{"kind":"Name","value":"priority"}},{"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 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; diff --git a/web/api/graphql/GetOverviewData.graphql b/web/api/graphql/GetOverviewData.graphql index fb48f79..a91b751 100644 --- a/web/api/graphql/GetOverviewData.graphql +++ b/web/api/graphql/GetOverviewData.graphql @@ -2,8 +2,11 @@ query GetOverviewData($rootLocationIds: [ID!], $recentPatientsFilters: [QueryFil recentPatients(rootLocationIds: $rootLocationIds, filters: $recentPatientsFilters, sorts: $recentPatientsSorts, pagination: $recentPatientsPagination, search: $recentPatientsSearch) { id name + firstname + lastname sex birthdate + state position { id title @@ -14,6 +17,8 @@ query GetOverviewData($rootLocationIds: [ID!], $recentPatientsFilters: [QueryFil } } tasks { + id + done updateDate } properties { @@ -56,8 +61,10 @@ query GetOverviewData($rootLocationIds: [ID!], $recentPatientsFilters: [QueryFil description done dueDate + creationDate updateDate priority + estimatedTime assignees { id name diff --git a/web/components/layout/Page.tsx b/web/components/layout/Page.tsx index 44c2d71..c0c7d1a 100644 --- a/web/components/layout/Page.tsx +++ b/web/components/layout/Page.tsx @@ -1,7 +1,7 @@ 'use client' import type { AnchorHTMLAttributes, ComponentProps, HTMLAttributes, PropsWithChildren } from 'react' -import { useEffect, useMemo, useState } from 'react' +import { useEffect, useMemo, useRef, useState } from 'react' import Head from 'next/head' import titleWrapper from '@/utils/titleWrapper' import Link from 'next/link' @@ -35,6 +35,7 @@ import { Rabbit } from 'lucide-react' import { TasksLogo } from '@/components/TasksLogo' +import { usePathname } from 'next/navigation' import { useRouter } from 'next/router' import { useTasksContext } from '@/hooks/useTasksContext' import { useLocations, useMySavedViews } from '@/data' @@ -497,9 +498,14 @@ export const Sidebar = ({ isOpen, onClose, ...props }: SidebarProps) => { const translation = useTasksTranslation() const locationRoute = '/location' const context = useTasksContext() - const { data: savedViewsData } = useMySavedViews() - const savedViews = savedViewsData?.mySavedViews ?? [] - const [isSavedViewsOpen, setIsSavedViewsOpen] = useState(true) + const { data: savedViewsData, loading: savedViewsLoading } = useMySavedViews() + const savedViews = (savedViewsData?.mySavedViews ?? []) as MySavedViewsQuery['mySavedViews'] + const pathname = usePathname() ?? '' + const quickAccessNavRef = useRef(null) + + useEffect(() => { + quickAccessNavRef.current?.scrollIntoView({ block: 'nearest' }) + }, [pathname]) return ( <> @@ -556,11 +562,17 @@ export const Sidebar = ({ isOpen, onClose, ...props }: SidebarProps) => { {translation('patients')} {context?.totalPatientsCount !== undefined && ({context.totalPatientsCount})} - {savedViews.length > 0 && ( +
context.update(prevState => ({ + ...prevState, + sidebar: { + ...prevState.sidebar, + isShowingSavedViews: isExpanded, + }, + }))} >
@@ -569,14 +581,30 @@ export const Sidebar = ({ isOpen, onClose, ...props }: SidebarProps) => {
- {savedViews.map((v: MySavedViewsQuery['mySavedViews'][number]) => ( - - {v.name} - - ))} + {savedViews.length > 0 + ? savedViews.map((v: MySavedViewsQuery['mySavedViews'][number]) => ( + + {v.name} + + )) + : savedViewsLoading + ? ( +
+ {translation('loading')} +
+ ) + : ( + + {translation('viewSettings')} + + )}
- )} +
{(context?.teams?.length ?? 0) > 0 && ( void, onPatientUpdated?: () => void, + embedded?: boolean, + embeddedPatients?: PatientViewModel[], + embeddedOnRefetch?: () => void, } -export const PatientList = forwardRef(({ initialPatientId, onInitialPatientOpened, acceptedStates: _acceptedStates, rootLocationIds, locationId, viewDefaultFilters, viewDefaultSorting, viewDefaultSearchQuery, viewDefaultColumnVisibility, viewDefaultColumnOrder, readOnly: _readOnly, hideSaveView, savedViewId, onSavedViewCreated, onPatientUpdated }, ref) => { +export const PatientList = forwardRef(({ initialPatientId, onInitialPatientOpened, acceptedStates: _acceptedStates, rootLocationIds, locationId, viewDefaultFilters, viewDefaultSorting, viewDefaultSearchQuery, viewDefaultColumnVisibility, viewDefaultColumnOrder, readOnly: _readOnly, hideSaveView, savedViewId, onSavedViewCreated, onPatientUpdated, embedded = false, embeddedPatients, embeddedOnRefetch }, ref) => { const translation = useTasksTranslation() const { locale } = useLocale() const { selectedRootLocationIds } = useTasksContext() @@ -143,6 +147,12 @@ export const PatientList = forwardRef(({ initi const [listLayout, setListLayout] = useState<'table' | 'card'>(() => ( typeof window !== 'undefined' && window.matchMedia('(max-width: 768px)').matches ? 'card' : 'table' )) + + useEffect(() => { + if (embedded) { + setListLayout('table') + } + }, [embedded]) const [sorting, setSorting] = useState(() => viewDefaultSorting ?? []) const [filters, setFilters] = useState(() => viewDefaultFilters ?? []) const [columnVisibility, setColumnVisibilityRaw] = useState(() => viewDefaultColumnVisibility ?? {}) @@ -328,6 +338,7 @@ export const PatientList = forwardRef(({ initi sorts: apiSorting.length > 0 ? apiSorting : undefined, filters: apiFilters.length > 0 ? apiFilters : undefined, search: searchInput, + skip: embedded && embeddedPatients !== undefined, } ) if (totalCount != null) lastTotalCountRef.current = totalCount @@ -361,9 +372,10 @@ export const PatientList = forwardRef(({ initi }, []) const patients: PatientViewModel[] = useMemo(() => { + if (embedded && embeddedPatients !== undefined) return embeddedPatients if (!accumulatedPatientsRaw || accumulatedPatientsRaw.length === 0) return [] return accumulatedPatientsRaw.map(mapPatientRow) - }, [accumulatedPatientsRaw, mapPatientRow]) + }, [embedded, embeddedPatients, accumulatedPatientsRaw, mapPatientRow]) const showBlockingLoadingOverlay = patientsLoading && patients.length === 0 @@ -589,6 +601,33 @@ export const PatientList = forwardRef(({ initi size: 150, maxSize: 200, }, + { + id: 'updateDate', + header: translation('updated'), + accessorFn: (row) => { + const taskList = row.tasks || [] + const updateDates = taskList + .map(t => t.updateDate ? new Date(t.updateDate) : null) + .filter((d): d is Date => d !== null) + .sort((a, b) => b.getTime() - a.getTime()) + return updateDates[0] + }, + cell: ({ row }) => { + if (refreshingPatientIds.has(row.original.id)) return rowLoadingCell + const taskList = row.original.tasks || [] + const updateDates = taskList + .map(t => t.updateDate ? new Date(t.updateDate) : null) + .filter((d): d is Date => d !== null) + .sort((a, b) => b.getTime() - a.getTime()) + const d = updateDates[0] + if (!d) return + return + }, + minSize: 220, + size: 220, + maxSize: 220, + filterFn: 'date', + }, ...patientPropertyColumns.map((col) => ({ ...col, cell: col.cell @@ -747,6 +786,20 @@ export const PatientList = forwardRef(({ initi [columns] ) + const embeddedDashboardColumnVisibility = useMemo((): VisibilityState | null => { + if (!embedded) return null + const visible = new Set(['name', 'position', 'updateDate']) + const vis: VisibilityState = {} + for (const id of knownColumnIdsOrdered) { + vis[id] = visible.has(id) + } + return vis + }, [embedded, knownColumnIdsOrdered]) + + const tableColumnVisibility = embedded && embeddedDashboardColumnVisibility != null + ? embeddedDashboardColumnVisibility + : columnVisibility + const sanitizedColumnOrder = useMemo( () => sanitizeColumnOrderForKnownColumns(columnOrder, knownColumnIdsOrdered), [columnOrder, knownColumnIdsOrdered] @@ -789,6 +842,8 @@ export const PatientList = forwardRef(({ initi const deferSetColumnOrder = useDeferredColumnOrderChange(setColumnOrder) + const embeddedTableStateNoop = useCallback(() => {}, []) + const onRowClick = useCallback((row: Row) => handleEdit(row.original), [handleEdit]) const fillerRowCell = useCallback(() => (), []) @@ -805,15 +860,15 @@ export const PatientList = forwardRef(({ initi } }} state={{ - columnVisibility, + columnVisibility: tableColumnVisibility, columnOrder: sanitizedColumnOrder, pagination: tablePagination, } as Partial as TableState} - onColumnVisibilityChange={setColumnVisibility} - onColumnOrderChange={deferSetColumnOrder} + onColumnVisibilityChange={embedded ? embeddedTableStateNoop : setColumnVisibility} + onColumnOrderChange={embedded ? embeddedTableStateNoop : deferSetColumnOrder} onPaginationChange={() => {}} - onSortingChange={setSorting} - onColumnFiltersChange={setFilters} + onSortingChange={embedded ? embeddedTableStateNoop : setSorting} + onColumnFiltersChange={embedded ? embeddedTableStateNoop : setFilters} enableMultiSort={true} enablePinning={false} pageCount={1} @@ -827,93 +882,95 @@ export const PatientList = forwardRef(({ initi enableColumnPinning={false} >
-
-
-
- setSearchQuery(e.target.value)} - onSearch={() => null} - containerProps={{ className: 'w-full max-w-full min-w-0 sm:max-w-80' }} - /> - -
- + +
+ + setIsSaveViewDialogOpen(true)} + onDiscard={handleDiscardViewChanges} + /> + +
+
+ setListLayout('table')} + color={listLayout === 'table' ? 'primary' : 'neutral'} > - {translation('filter') + ` (${filters.length})`} - - - + + + { + setSelectedPatient(undefined) + setIsPanelOpen(true) + }} + color="primary" + > + +
- - setIsSaveViewDialogOpen(true)} - onDiscard={handleDiscardViewChanges} - /> - -
-
- setListLayout('table')} - color={listLayout === 'table' ? 'primary' : 'neutral'} - > - - - setListLayout('card')} - color={listLayout === 'card' ? 'primary' : 'neutral'} - > - - - { - setSelectedPatient(undefined) - setIsPanelOpen(true) - }} - color="primary" - > - -
+ {isShowFilters && ( + + )} + {isShowSorting && ( + + )}
- {isShowFilters && ( - - )} - {isShowSorting && ( - - )} -
+ )}
{showBlockingLoadingOverlay && (
@@ -935,7 +992,7 @@ export const PatientList = forwardRef(({ initi ))}
)} - {stableTotalCount != null && hasMore && ( + {stableTotalCount != null && hasMore && !embedded && ( @@ -952,7 +1009,8 @@ export const PatientList = forwardRef(({ initi patientId={selectedPatient?.id ?? openedPatientId ?? undefined} onClose={handleClose} onSuccess={() => { - refetch() + embeddedOnRefetch?.() + void refetch() onPatientUpdated?.() }} /> diff --git a/web/components/tables/RecentPatientsTable.tsx b/web/components/tables/RecentPatientsTable.tsx deleted file mode 100644 index ffbdde1..0000000 --- a/web/components/tables/RecentPatientsTable.tsx +++ /dev/null @@ -1,132 +0,0 @@ -import { useTasksTranslation } from '@/i18n/useTasksTranslation' -import type { ColumnDef, ColumnFiltersState, PaginationState, Row, SortingState, TableState, VisibilityState } from '@tanstack/react-table' -import type { GetOverviewDataQuery } from '@/api/gql/generated' -import { useCallback, useMemo, useState } from 'react' -import type { TableProps } from '@helpwave/hightide' -import { FillerCell, TableDisplay, TableProvider, Tooltip } from '@helpwave/hightide' -import { DateDisplay } from '@/components/Date/DateDisplay' -import { LocationChipsBySetting } from '@/components/patients/LocationChipsBySetting' - -type PatientViewModel = GetOverviewDataQuery['recentPatients'][0] - -export interface RecentPatientsTableProps extends Omit, 'table'> { - patients: PatientViewModel[], - onSelectPatient: (id: string) => void, -} - -export const RecentPatientsTable = ({ - patients, - onSelectPatient, - ...props -}: RecentPatientsTableProps) => { - const translation = useTasksTranslation() - - const [pagination, setPagination] = useState({ pageSize: 10, pageIndex: 0 }) - const [sorting, setSorting] = useState([]) - const [filters, setFilters] = useState([]) - const [columnVisibility, setColumnVisibility] = useState({}) - - const patientColumns = useMemo[]>(() => [ - { - id: 'name', - header: translation('name'), - accessorKey: 'name', - cell: ({ row }) => { - return ( - - {row.original.name} - - ) - }, - minSize: 160, - filterFn: 'text', - }, - { - id: 'location', - header: translation('location'), - accessorKey: 'position', - cell: ({ row }: { row: Row }) => ( - - ), - minSize: 200, - size: 260, - maxSize: 320, - filterFn: 'text' as const, - }, - { - id: 'updated', - header: translation('updated'), - accessorFn: (value) => { - const tasks = value.tasks || [] - const updateDates = tasks - .map(t => t.updateDate ? new Date(t.updateDate) : null) - .filter((d): d is Date => d !== null) - .sort((a, b) => b.getTime() - a.getTime()) - return updateDates[0] - }, - cell: ({ getValue }) => { - const date = getValue() as Date | undefined - if (!date) return - return ( - - ) - }, - minSize: 200, - size: 200, - maxSize: 200, - filterFn: 'date', - }, - ], [translation]) - - const fillerRowCell = useCallback(() => , []) - const onRowClick = useCallback((row: Row) => onSelectPatient(row.original.id), [onSelectPatient]) - - const fixedPagination = useMemo(() => ({ - ...pagination, - pageSize: 5 - }), [pagination]) - - return ( -
- as TableState} - onColumnVisibilityChange={setColumnVisibility} - onPaginationChange={setPagination} - onSortingChange={setSorting} - onColumnFiltersChange={setFilters} - enableMultiSort={true} - enableSorting={false} - enableColumnFilters={false} - > -
-
- {translation('recentPatients')} - {translation('patientsUpdatedRecently')} -
-
- -
-
-
-
- ) -} diff --git a/web/components/tables/RecentTasksTable.tsx b/web/components/tables/RecentTasksTable.tsx deleted file mode 100644 index 2b75753..0000000 --- a/web/components/tables/RecentTasksTable.tsx +++ /dev/null @@ -1,277 +0,0 @@ -import { useTasksTranslation } from '@/i18n/useTasksTranslation' -import type { ColumnDef, ColumnFiltersState, PaginationState, Row, SortingState, TableState, VisibilityState } from '@tanstack/react-table' -import type { GetOverviewDataQuery, TaskPriority } from '@/api/gql/generated' -import { useCallback, useMemo, useState } from 'react' -import clsx from 'clsx' -import type { TableProps } from '@helpwave/hightide' -import { Button, Checkbox, FillerCell, TableDisplay, TableProvider, Tooltip } from '@helpwave/hightide' -import { DateDisplay } from '@/components/Date/DateDisplay' -import { AvatarStatusComponent } from '@/components/AvatarStatusComponent' -import { UserInfoPopup } from '@/components/UserInfoPopup' -import { DueDateUtils } from '@/utils/dueDate' -import { PriorityUtils } from '@/utils/priority' -import { Users } from 'lucide-react' - -type TaskViewModel = GetOverviewDataQuery['recentTasks'][0] - -export interface RecentTasksTableProps extends Omit, 'table'> { - tasks: TaskViewModel[], - completeTask: (id: string) => void, - reopenTask: (id: string) => void, - onSelectPatient: (id: string) => void, - onSelectTask: (id: string) => void, -} - - -export const RecentTasksTable = ({ - tasks, - completeTask, - reopenTask, - onSelectPatient, - onSelectTask, - ...props -}: RecentTasksTableProps) => { - const translation = useTasksTranslation() - const [selectedUserId, setSelectedUserId] = useState(null) - - const [pagination, setPagination] = useState({ pageSize: 10, pageIndex: 0 }) - const [sorting, setSorting] = useState([]) - const [filters, setFilters] = useState([]) - const [columnVisibility, setColumnVisibility] = useState({}) - - const taskColumns = useMemo[]>(() => [ - { - id: 'done', - header: translation('done'), - accessorKey: 'done', - cell: ({ row }) => ( - { - if (checked) { - completeTask(row.original.id) - } else { - reopenTask(row.original.id) - } - }} - onClick={(e) => e.stopPropagation()} - className={clsx('rounded-full', PriorityUtils.toCheckboxColor(row.original.priority as TaskPriority | null | undefined))} - /> - ), - minSize: 60, - size: 60, - maxSize: 60, - enableResizing: false, - enableHiding: false, - }, - { - id: 'title', - header: translation('task'), - accessorKey: 'title', - cell: ({ row }) => { - return ( - -
- {row.original.priority && ( -
- )} - {row.original.title} -
- - ) - }, - minSize: 200, - filterFn: 'text', - }, - { - id: 'patient', - header: translation('patient'), - accessorFn: (value) => value.patient?.name, - cell: ({ row }) => { - const patient = row.original.patient - if (!patient) return - - return ( - - - - ) - }, - minSize: 200, - maxSize: 400, - filterFn: 'text', - }, - { - id: 'dueDate', - header: translation('dueDate'), - accessorKey: 'dueDate', - cell: ({ row }) => { - if (!row.original.dueDate) return - - const overdue = DueDateUtils.isOverdue(row.original.dueDate, row.original.done) - const closeToDue = DueDateUtils.isCloseToDueDate(row.original.dueDate, row.original.done) - let colorClass = '' - if (overdue) { - colorClass = '!text-red-500' - } else if (closeToDue) { - colorClass = '!text-orange-500' - } - return ( - - ) - }, - minSize: 220, - size: 220, - maxSize: 220, - enableResizing: false, - filterFn: 'date', - }, - { - id: 'assignee', - header: translation('assignedTo'), - accessorFn: (row) => { - if (row.assigneeTeam) return row.assigneeTeam.title - return row.assignees[0]?.name ?? '' - }, - cell: ({ row }) => { - const team = row.original.assigneeTeam - if (team) { - return ( -
e.stopPropagation()} - role="presentation" - > - - {team.title} -
- ) - } - const assignees = row.original.assignees ?? [] - const first = assignees[0] - if (!first) { - return {translation('notAssigned')} - } - const extra = assignees.length > 1 ? assignees.length - 1 : 0 - return ( -
e.stopPropagation()} - role="presentation" - > - - {extra > 0 && ( - - {translation('additionalAssigneesCount', { count: extra })} - - )} -
- ) - }, - minSize: 180, - size: 220, - maxSize: 320, - filterFn: 'text', - }, - { - id: 'date', - header: translation('updated'), - accessorFn: (value) => value.updateDate ? new Date(value.updateDate) : undefined, - cell: ({ getValue }) => { - const date = getValue() as Date | undefined - if (!date) return - return ( - - ) - }, - minSize: 220, - size: 220, - maxSize: 220, - enableResizing: false, - filterFn: 'date', - }, - ], [translation, completeTask, reopenTask, onSelectPatient]) - - const fillerRowCell = useCallback(() => , []) - const onRowClick = useCallback((row: Row) => onSelectTask(row.original.id), [onSelectTask]) - - const fixedPagination = useMemo(() => ({ - ...pagination, - pageSize: 5 - }), [pagination]) - - return ( -
- as TableState} - onColumnVisibilityChange={setColumnVisibility} - onPaginationChange={setPagination} - onSortingChange={setSorting} - onColumnFiltersChange={setFilters} - enableMultiSort={true} - isUsingFillerRows={true} - enableSorting={false} - enableColumnFilters={false} - > -
-
- {translation('recentTasks')} - {translation('tasksUpdatedRecently')} -
-
- -
-
-
- setSelectedUserId(null)} - /> -
- ) -} diff --git a/web/components/tables/TaskList.tsx b/web/components/tables/TaskList.tsx index 1589c41..d9d6cee 100644 --- a/web/components/tables/TaskList.tsx +++ b/web/components/tables/TaskList.tsx @@ -148,9 +148,10 @@ type TaskListProps = { onSearchQueryChange?: (value: string) => void, loadMore?: () => void, hasMore?: boolean, + embedded?: boolean, } -export const TaskList = forwardRef(({ tasks: initialTasks, onRefetch, showAssignee = false, initialTaskId, onInitialTaskOpened, headerActions, saveViewSlot, totalCount, loading = false, tableState: controlledTableState, searchQuery: searchQueryProp, onSearchQueryChange, loadMore: loadMoreProp, hasMore: hasMoreProp }, ref) => { +export const TaskList = forwardRef(({ tasks: initialTasks, onRefetch, showAssignee = false, initialTaskId, onInitialTaskOpened, headerActions, saveViewSlot, totalCount, loading = false, tableState: controlledTableState, searchQuery: searchQueryProp, onSearchQueryChange, loadMore: loadMoreProp, hasMore: hasMoreProp, embedded = false }, ref) => { const translation = useTasksTranslation() const { data: propertyDefinitionsData } = usePropertyDefinitions() const { data: queryableFieldsData } = useQueryableFields('Task') @@ -252,6 +253,12 @@ export const TaskList = forwardRef(({ tasks: initial } }, [initialTaskId, initialTaskPresent, openedTaskId, onInitialTaskOpened]) + useEffect(() => { + if (embedded) { + setListLayout('table') + } + }, [embedded]) + useEffect(() => { if (typeof window === 'undefined') return const mediaQuery = window.matchMedia('(max-width: 768px)') @@ -567,7 +574,7 @@ export const TaskList = forwardRef(({ tasks: initial }, { id: 'title', - header: translation('title'), + header: embedded ? translation('task') : translation('title'), accessorKey: 'name', cell: ({ row }) => ( @@ -722,6 +729,22 @@ export const TaskList = forwardRef(({ tasks: initial }) } + cols.push({ + id: 'updateDate', + header: translation('updated'), + accessorFn: (row) => row.updateDate, + cell: ({ row }) => ( + + + + ), + minSize: 220, + size: 220, + maxSize: 220, + enableResizing: false, + filterFn: 'date', + }) + const colsWithRefreshing = [ ...cols, ...taskPropertyColumns.map((col) => ({ @@ -737,7 +760,7 @@ export const TaskList = forwardRef(({ tasks: initial ] return colsWithRefreshing }, - [translation, completeTask, reopenTask, showAssignee, taskPropertyColumns]) + [translation, completeTask, reopenTask, showAssignee, taskPropertyColumns, embedded]) const taskCardPrimaryColumnIds = useMemo(() => { const s = new Set(['done', 'title', 'dueDate', 'patient']) @@ -780,12 +803,27 @@ export const TaskList = forwardRef(({ tasks: initial [columns] ) + const embeddedDashboardColumnVisibility = useMemo((): VisibilityState | null => { + if (!embedded) return null + const visible = new Set(['done', 'title', 'patient', 'dueDate', 'assignee', 'updateDate']) + const vis: VisibilityState = {} + for (const id of knownColumnIdsOrdered) { + vis[id] = visible.has(id) + } + return vis + }, [embedded, knownColumnIdsOrdered]) + + const tableColumnVisibility = embedded && embeddedDashboardColumnVisibility != null + ? embeddedDashboardColumnVisibility + : columnVisibility + const sanitizedColumnOrder = useMemo( () => sanitizeColumnOrderForKnownColumns(columnOrder, knownColumnIdsOrdered), [columnOrder, knownColumnIdsOrdered] ) const deferSetColumnOrder = useDeferredColumnOrderChange(setColumnOrder) + const embeddedTableStateNoop = useCallback(() => {}, []) const hasOpenDrawer = taskDialogState.isOpen || selectedPatientId != null const hasFilterPanelOpen = isShowFilters || isShowSorting @@ -814,15 +852,15 @@ export const TaskList = forwardRef(({ tasks: initial } }} state={{ - columnVisibility, + columnVisibility: tableColumnVisibility, columnOrder: sanitizedColumnOrder, pagination: tablePagination, } as Partial as TableState} - onColumnVisibilityChange={setColumnVisibilityMerged} - onColumnOrderChange={deferSetColumnOrder} + onColumnVisibilityChange={embedded ? embeddedTableStateNoop : setColumnVisibilityMerged} + onColumnOrderChange={embedded ? embeddedTableStateNoop : deferSetColumnOrder} onPaginationChange={() => {}} - onSortingChange={setSorting} - onColumnFiltersChange={setFilters} + onSortingChange={embedded ? embeddedTableStateNoop : setSorting} + onColumnFiltersChange={embedded ? embeddedTableStateNoop : setFilters} enableMultiSort={true} enablePinning={false} onRowClick={row => setTaskDialogState({ isOpen: true, taskId: row.original.id })} @@ -835,104 +873,107 @@ export const TaskList = forwardRef(({ tasks: initial enableColumnPinning={false} >
-
-
-
- setSearchQuery(e.target.value)} - onSearch={() => null} - containerProps={{ className: 'w-full max-w-full min-w-0 sm:max-w-80' }} - /> - -
- + +
+ {saveViewSlot} +
+
+ {headerActions} + {canHandover && ( + + )} + setListLayout('table')} + color={listLayout === 'table' ? 'primary' : 'neutral'} > - {translation('filter') + ` (${filters.length})`} - - - -
- {saveViewSlot} -
-
- {headerActions} - {canHandover && ( - - )} - setListLayout('table')} - color={listLayout === 'table' ? 'primary' : 'neutral'} - > - - - setListLayout('card')} - color={listLayout === 'card' ? 'primary' : 'neutral'} - > - - - setTaskDialogState({ isOpen: true })} - disabled={!hasPatients} - > - - + + +
+ {isShowFilters && ( +
+ +
+ )} + {isShowSorting && ( +
+ +
+ )}
- {isShowFilters && ( -
- -
- )} - {isShowSorting && ( -
- -
- )} -
+ )}
{showBlockingLoadingOverlay && (
)} - + )}
@@ -957,7 +999,7 @@ export const TaskList = forwardRef(({ tasks: initial ))}
)} - {effectiveHasMore && ( + {effectiveHasMore && !embedded && ( diff --git a/web/data/hooks/usePaginatedEntityQuery.ts b/web/data/hooks/usePaginatedEntityQuery.ts index bbdb148..363ed77 100644 --- a/web/data/hooks/usePaginatedEntityQuery.ts +++ b/web/data/hooks/usePaginatedEntityQuery.ts @@ -1,4 +1,4 @@ -import { useCallback, useMemo } from 'react' +import { useCallback, useMemo, useRef } from 'react' import { useQueryWhenReady } from './queryHelpers' import type { QueryFilterClauseInput, QuerySearchInput, QuerySortClauseInput } from '@/api/gql/generated' @@ -8,6 +8,7 @@ export type UsePaginatedEntityQueryOptions = { filters?: QueryFilterClauseInput[], search?: QuerySearchInput, getPageDataKey?: (data: TQueryData | undefined) => string, + skip?: boolean, } export type UsePaginatedEntityQueryResult = { @@ -36,7 +37,7 @@ export function usePaginatedEntityQuery< extractItems: (data: TQueryData | undefined) => TItem[], extractTotal: (data: TQueryData | undefined) => number | undefined ): UsePaginatedEntityQueryResult { - const { pagination, sorts, filters, search } = options + const { pagination, sorts, filters, search, skip: skipQuery } = options const variablesWithPagination = useMemo(() => ({ ...(variables ?? {}), pagination: { pageIndex: pagination.pageIndex, pageSize: pagination.pageSize }, @@ -48,12 +49,16 @@ export function usePaginatedEntityQuery< const result = useQueryWhenReady( document, variablesTyped, - { fetchPolicy: 'cache-and-network' } + { fetchPolicy: 'cache-and-network', skip: skipQuery === true } ) - const totalCount = extractTotal(result.data) + const extractItemsRef = useRef(extractItems) + extractItemsRef.current = extractItems + const extractTotalRef = useRef(extractTotal) + extractTotalRef.current = extractTotal + const totalCount = extractTotalRef.current(result.data) const data = useMemo( - () => extractItems(result.data), - [result.data, extractItems] + () => extractItemsRef.current(result.data), + [result.data] ) const refetch = useCallback(() => { result.refetch() diff --git a/web/data/hooks/usePatientsPaginated.ts b/web/data/hooks/usePatientsPaginated.ts index 2258866..2db97c8 100644 --- a/web/data/hooks/usePatientsPaginated.ts +++ b/web/data/hooks/usePatientsPaginated.ts @@ -11,6 +11,7 @@ export type UsePatientsPaginatedOptions = { sorts?: QuerySortClauseInput[], filters?: QueryFilterClauseInput[], search?: QuerySearchInput, + skip?: boolean, } export type UsePatientsPaginatedResult = { @@ -50,6 +51,7 @@ export function usePatientsPaginated( filters: options.filters, search: options.search, getPageDataKey, + skip: options.skip, }, (data) => data?.patients ?? [], (data) => data?.patientsTotal diff --git a/web/data/hooks/useSavedViews.ts b/web/data/hooks/useSavedViews.ts index 58bda13..192617e 100644 --- a/web/data/hooks/useSavedViews.ts +++ b/web/data/hooks/useSavedViews.ts @@ -1,3 +1,5 @@ +import { useApolloClient, useQuery } from '@apollo/client/react' +import { useEffect, useMemo } from 'react' import { MySavedViewsDocument, SavedViewDocument, @@ -6,7 +8,8 @@ import { type SavedViewQuery, type SavedViewQueryVariables } from '@/api/gql/generated' -import { useQueryWhenReady } from './queryHelpers' +import { schedulePersistCache } from '../cache/persist' +import { getParsedDocument, useQueryWhenReady } from './queryHelpers' type MySavedViewsHookOptions = { skip?: boolean, @@ -14,14 +17,23 @@ type MySavedViewsHookOptions = { } export function useMySavedViews(options?: MySavedViewsHookOptions) { - return useQueryWhenReady( - MySavedViewsDocument, - {}, - { - skip: options?.skip, - fetchPolicy: options?.fetchPolicy ?? 'cache-and-network', - } - ) + const client = useApolloClient() + const doc = useMemo(() => getParsedDocument(MySavedViewsDocument), []) + const result = useQuery(doc, { + variables: {}, + skip: options?.skip, + fetchPolicy: options?.fetchPolicy ?? 'cache-first', + }) + useEffect(() => { + if (!result.data?.mySavedViews || typeof window === 'undefined') return + schedulePersistCache(client.cache) + }, [result.data, client]) + return { + data: result.data, + loading: result.loading, + error: result.error as Error | undefined, + refetch: result.refetch, + } } export function useSavedView(id: string | undefined, options?: { skip?: boolean }) { diff --git a/web/hooks/useTasksContext.tsx b/web/hooks/useTasksContext.tsx index 098e449..20fc9b2 100644 --- a/web/hooks/useTasksContext.tsx +++ b/web/hooks/useTasksContext.tsx @@ -78,6 +78,7 @@ type SidebarContextType = { isShowingTeams: boolean, isShowingWards: boolean, isShowingClinics: boolean, + isShowingSavedViews: boolean, } export type TasksContextState = { @@ -132,6 +133,7 @@ export const TasksContextProvider = ({ children }: PropsWithChildren) => { isShowingTeams: false, isShowingWards: false, isShowingClinics: false, + isShowingSavedViews: false, }, selectedRootLocationIds: storedSelectedRootLocationIds.length > 0 ? storedSelectedRootLocationIds : undefined, isRootLocationReinitializing: false, diff --git a/web/package-lock.json b/web/package-lock.json index d4fee78..cc1069f 100644 --- a/web/package-lock.json +++ b/web/package-lock.json @@ -154,7 +154,6 @@ "integrity": "sha512-CGOfOJqWjg2qW/Mb6zNsDm+u5vFQ8DxXfbM09z69p5Z6+mE1ikP2jUXw+j42Pf1XTYED2Rni5f95npYeuwMDQA==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@babel/code-frame": "^7.29.0", "@babel/generator": "^7.29.0", @@ -417,7 +416,6 @@ "resolved": "https://registry.npmjs.org/@dnd-kit/core/-/core-6.3.1.tgz", "integrity": "sha512-xkGBRQQab4RLwgXxoqETICr6S5JlogafbhNsidmrkVv2YRs5MLwpjoF2qpiGjQt8S9AoxtIV603s0GIUpY5eYQ==", "license": "MIT", - "peer": true, "dependencies": { "@dnd-kit/accessibility": "^3.1.1", "@dnd-kit/utilities": "^3.2.2", @@ -3611,7 +3609,6 @@ "integrity": "sha512-6TyEnHgd6SArQO8UO2OMTxshln3QMWBtPGrOCgs3wVEmQmwyuNtB10IZMfmYDE0riwNR1cu4q+pPcxMVtaG3TA==", "devOptional": true, "license": "Apache-2.0", - "peer": true, "dependencies": { "playwright": "1.57.0" }, @@ -4446,7 +4443,6 @@ "resolved": "https://registry.npmjs.org/@tanstack/react-query/-/react-query-5.90.16.tgz", "integrity": "sha512-bpMGOmV4OPmif7TNMteU/Ehf/hoC0Kf98PDc0F4BZkFrEapRMEqI/V6YS0lyzwSV6PQpY1y4xxArUIfBW5LVxQ==", "license": "MIT", - "peer": true, "dependencies": { "@tanstack/query-core": "5.90.16" }, @@ -4565,7 +4561,6 @@ "integrity": "sha512-MWtvHrGZLFttgeEj28VXHxpmwYbor/ATPYbBfSFZEIRK0ecCFLl2Qo55z52Hss+UV9CRN7trSeq1zbgx7YDWWg==", "devOptional": true, "license": "MIT", - "peer": true, "dependencies": { "csstype": "^3.2.2" } @@ -4635,7 +4630,6 @@ "integrity": "sha512-4z2nCSBfVIMnbuu8uinj+f0o4qOeggYJLbjpPHka3KH1om7e+H9yLKTYgksTaHcGco+NClhhY2vyO3HsMH1RGw==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@typescript-eslint/scope-manager": "8.55.0", "@typescript-eslint/types": "8.55.0", @@ -4945,7 +4939,6 @@ "integrity": "sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==", "dev": true, "license": "MIT", - "peer": true, "bin": { "acorn": "bin/acorn" }, @@ -5321,7 +5314,6 @@ } ], "license": "MIT", - "peer": true, "dependencies": { "baseline-browser-mapping": "^2.9.0", "caniuse-lite": "^1.0.30001759", @@ -6291,7 +6283,6 @@ "integrity": "sha512-BhHmn2yNOFA9H9JmmIVKJmd288g9hrVRDkdoIgRCRuSySRUHH7r/DI6aAXW9T1WwUuY3DFgrcaqB+deURBLR5g==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@eslint-community/eslint-utils": "^4.8.0", "@eslint-community/regexpp": "^4.12.1", @@ -6785,7 +6776,6 @@ "version": "2.3.2", "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", - "dev": true, "hasInstallScript": true, "license": "MIT", "optional": true, @@ -7025,7 +7015,6 @@ "resolved": "https://registry.npmjs.org/graphql/-/graphql-16.12.0.tgz", "integrity": "sha512-DKKrynuQRne0PNpEbzuEdHlYOMksHSUI8Zc9Unei5gTsMNA2/vMpoMz/yKba50pejK56qj98qM0SjYxAKi13gQ==", "license": "MIT", - "peer": true, "engines": { "node": "^12.22.0 || ^14.16.0 || ^16.0.0 || >=17.0.0" } @@ -7336,7 +7325,6 @@ "resolved": "https://registry.npmjs.org/graphql-ws/-/graphql-ws-6.0.6.tgz", "integrity": "sha512-zgfER9s+ftkGKUZgc0xbx8T7/HMO4AV5/YuYiFc+AtgcO5T0v8AxYYNQ+ltzuzDZgNkYJaFspm5MMYLjQzrkmw==", "license": "MIT", - "peer": true, "engines": { "node": ">=20" }, @@ -9557,7 +9545,6 @@ } ], "license": "MIT", - "peer": true, "dependencies": { "nanoid": "^3.3.8", "picocolors": "^1.1.1", @@ -9642,7 +9629,6 @@ "resolved": "https://registry.npmjs.org/react/-/react-19.2.3.tgz", "integrity": "sha512-Ku/hhYbVjOQnXDZFv2+RibmLFGwFdeeKHFcOTlrt7xplBnya5OGn/hIRDsqDiSUcfORsDC7MPxwork8jBwsIWA==", "license": "MIT", - "peer": true, "engines": { "node": ">=0.10.0" } @@ -9652,7 +9638,6 @@ "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-19.2.3.tgz", "integrity": "sha512-yELu4WmLPw5Mr/lmeEpox5rw3RETacE++JgHqQzd2dg+YbJuat3jH4ingc+WPZhxaoFzdv9y33G+F7Nl5O0GBg==", "license": "MIT", - "peer": true, "dependencies": { "scheduler": "^0.27.0" }, @@ -10681,7 +10666,6 @@ "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.7.2.tgz", "integrity": "sha512-i5t66RHxDvVN40HfDd1PsEThGNnlMCMT3jMUuoh9/0TaqWevNontacunWyN02LA9/fIbEWlcHZcgTKb9QoaLfg==", "license": "Apache-2.0", - "peer": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" @@ -11040,7 +11024,6 @@ "integrity": "sha512-blAT2mjOEIi0ZzruJfIhb3nps74PRWTCz1IjglWEEpQl5XS/UNama6u2/rjFkDDouqr4L67ry+1aGIALViWjDg==", "devOptional": true, "license": "MIT", - "peer": true, "engines": { "node": ">=10.0.0" }, diff --git a/web/pages/index.tsx b/web/pages/index.tsx index 5a98751..b0986fa 100644 --- a/web/pages/index.tsx +++ b/web/pages/index.tsx @@ -5,15 +5,14 @@ import { useTasksTranslation } from '@/i18n/useTasksTranslation' import { Avatar } from '@helpwave/hightide' import { CurrentTime } from '@/components/Date/CurrentTime' import { ClockIcon, ListCheckIcon, UsersIcon } from 'lucide-react' -import { useCallback, useMemo, useState, type ReactNode } from 'react' +import { useMemo, type ReactNode } from 'react' import { useTasksContext } from '@/hooks/useTasksContext' import Link from 'next/link' -import { Drawer } from '@helpwave/hightide' -import { PatientDetailView } from '@/components/patients/PatientDetailView' -import { TaskDetailView } from '@/components/tasks/TaskDetailView' -import { useOverviewData, useCompleteTask, useReopenTask } from '@/data' -import { RecentTasksTable } from '@/components/tables/RecentTasksTable' -import { RecentPatientsTable } from '@/components/tables/RecentPatientsTable' +import { useOverviewData } from '@/data' +import { TaskList } from '@/components/tables/TaskList' +import { PatientList } from '@/components/tables/PatientList' +import { overviewRecentTaskToTaskViewModel } from '@/utils/overviewRecentTaskToTaskViewModel' +import { overviewRecentPatientToPatientViewModel } from '@/utils/overviewRecentPatientToPatientViewModel' import clsx from 'clsx' @@ -79,15 +78,16 @@ const Dashboard: NextPage = () => { recentPatientsPagination: { pageSize: 5, pageIndex: 0 }, }), [selectedRootLocationIds]) const { data, refetch } = useOverviewData(overviewVariables) - const [completeTask] = useCompleteTask() - const [reopenTask] = useReopenTask() - const [selectedPatientId, setSelectedPatientId] = useState(null) - const [selectedTaskId, setSelectedTaskId] = useState(null) - - const recentPatients = useMemo(() => data?.recentPatients ?? [], [data]) - const recentTasks = useMemo(() => data?.recentTasks ?? [], [data]) + const taskListTasks = useMemo( + () => (data?.recentTasks ?? []).map(overviewRecentTaskToTaskViewModel), + [data?.recentTasks] + ) + const patientListPatients = useMemo( + () => (data?.recentPatients ?? []).map(overviewRecentPatientToPatientViewModel), + [data?.recentPatients] + ) return ( @@ -124,52 +124,32 @@ const Dashboard: NextPage = () => {
- completeTask({ variables: { id }, onCompleted: () => refetch() }), [completeTask, refetch])} - reopenTask={useCallback((id) => reopenTask({ variables: { id }, onCompleted: () => refetch() }), [reopenTask, refetch])} - onSelectPatient={setSelectedPatientId} - onSelectTask={setSelectedTaskId} - className="w-full min-w-0" - /> - - -
- - setSelectedPatientId(null)} - > - {selectedPatientId && ( - setSelectedPatientId(null)} - onSuccess={() => {}} +
+
+ {translation('recentTasks')} + {translation('tasksUpdatedRecently')} +
+ void refetch()} + showAssignee={true} + totalCount={data?.recentTasksTotal ?? undefined} /> - )} - - - setSelectedTaskId(null)} - > - {selectedTaskId && ( - setSelectedTaskId(null)} +
+ +
+
+ {translation('recentPatients')} + {translation('patientsUpdatedRecently')} +
+ void refetch()} /> - )} - +
+ diff --git a/web/pages/settings/views.tsx b/web/pages/settings/views.tsx index 50c6fad..0550b84 100644 --- a/web/pages/settings/views.tsx +++ b/web/pages/settings/views.tsx @@ -46,9 +46,9 @@ type SavedViewRow = { const ViewsSettingsPage: NextPage = () => { const translation = useTasksTranslation() const router = useRouter() - const { data, loading } = useMySavedViews() + const { data, loading } = useMySavedViews({ fetchPolicy: 'cache-and-network' }) const rows: SavedViewRow[] = useMemo(() => { - return (data?.mySavedViews ?? []).map((v: SavedViewRowGql) => ({ + return ((data?.mySavedViews ?? []) as SavedViewRowGql[]).map((v: SavedViewRowGql) => ({ id: v.id, name: v.name, baseEntityType: v.baseEntityType, diff --git a/web/providers/ApolloProviderWithData.tsx b/web/providers/ApolloProviderWithData.tsx index df01a46..b67cb9f 100644 --- a/web/providers/ApolloProviderWithData.tsx +++ b/web/providers/ApolloProviderWithData.tsx @@ -7,8 +7,11 @@ import { getUser } from '@/api/auth/authService' import { createApolloClient, rehydrateCache, - replayPendingMutations + replayPendingMutations, + schedulePersistCache } from '@/data' +import { MySavedViewsDocument } from '@/api/gql/generated' +import { getParsedDocument } from '@/data/hooks/queryHelpers' const ApolloClientContext = createContext(null) @@ -26,20 +29,25 @@ export function ApolloProviderWithData({ children }: { children: React.ReactNode const [isReady, setIsReady] = useState(false) useEffect(() => { - const navEntry = typeof performance !== 'undefined' && performance.getEntriesByType?.('navigation')?.[0] - const isPageReload = navEntry && 'type' in navEntry && (navEntry as { type: string }).type === 'reload' - - if (isPageReload) { - client.clearStore().then(() => setIsReady(true)) - return - } - rehydrateCache(client.cache) .then(() => replayPendingMutations(client.cache)) .then(() => setIsReady(true)) .catch(() => setIsReady(true)) }, [client]) + useEffect(() => { + if (!isReady) return + void client + .query({ + query: getParsedDocument(MySavedViewsDocument), + fetchPolicy: 'cache-first', + }) + .then(() => { + schedulePersistCache(client.cache) + }) + .catch(() => {}) + }, [client, isReady]) + return ( diff --git a/web/utils/overviewRecentPatientToPatientViewModel.ts b/web/utils/overviewRecentPatientToPatientViewModel.ts new file mode 100644 index 0000000..374aadf --- /dev/null +++ b/web/utils/overviewRecentPatientToPatientViewModel.ts @@ -0,0 +1,26 @@ +import type { PatientViewModel } from '@/components/tables/PatientList' +import type { GetOverviewDataQuery, TaskType } from '@/api/gql/generated' +import { PatientState } from '@/api/gql/generated' + +type OverviewRecentPatient = GetOverviewDataQuery['recentPatients'][0] + +const ADMITTED_OR_WAITING: PatientState[] = [PatientState.Admitted, PatientState.Wait] + +export function overviewRecentPatientToPatientViewModel(p: OverviewRecentPatient): PatientViewModel { + const tasks = (p.tasks ?? []) as TaskType[] + const countForAggregate = ADMITTED_OR_WAITING.includes(p.state) + return { + id: p.id, + name: p.name, + firstname: p.firstname, + lastname: p.lastname, + birthdate: new Date(p.birthdate), + sex: p.sex, + state: p.state, + position: p.position as PatientViewModel['position'], + openTasksCount: countForAggregate ? tasks.filter(t => !t.done).length : 0, + closedTasksCount: countForAggregate ? tasks.filter(t => t.done).length : 0, + tasks, + properties: p.properties ?? [], + } +} diff --git a/web/utils/overviewRecentTaskToTaskViewModel.ts b/web/utils/overviewRecentTaskToTaskViewModel.ts new file mode 100644 index 0000000..4beead4 --- /dev/null +++ b/web/utils/overviewRecentTaskToTaskViewModel.ts @@ -0,0 +1,50 @@ +import type { TaskViewModel } from '@/components/tables/TaskList' +import type { GetOverviewDataQuery } from '@/api/gql/generated' + +type OverviewRecentTask = GetOverviewDataQuery['recentTasks'][0] + +export function overviewRecentTaskToTaskViewModel(task: OverviewRecentTask): TaskViewModel { + return { + id: task.id, + name: task.title, + description: task.description ?? undefined, + updateDate: task.updateDate ? new Date(task.updateDate) : new Date(task.creationDate), + dueDate: task.dueDate ? new Date(task.dueDate) : undefined, + priority: task.priority ?? null, + estimatedTime: task.estimatedTime ?? null, + done: task.done, + patient: task.patient + ? { + id: task.patient.id, + name: task.patient.name, + locations: task.patient.position + ? [{ + id: task.patient.position.id, + title: task.patient.position.title, + parent: task.patient.position.parent + ? { + id: task.patient.position.parent.id, + title: task.patient.position.parent.title, + parent: null, + } + : undefined, + }] + : [], + } + : undefined, + assignee: task.assignees[0] + ? { + id: task.assignees[0].id, + name: task.assignees[0].name, + avatarURL: task.assignees[0].avatarUrl, + isOnline: task.assignees[0].isOnline ?? null, + } + : undefined, + assigneeTeam: task.assigneeTeam + ? { id: task.assigneeTeam.id, title: task.assigneeTeam.title } + : undefined, + additionalAssigneeCount: + !task.assigneeTeam && task.assignees.length > 1 ? task.assignees.length - 1 : 0, + properties: task.properties ?? [], + } +}