improvement: QRcode and shared link added to cases inorder to make it possible for staff users to share a case info with other staffs or other clinics.

This commit is contained in:
2026-07-14 21:07:05 +03:30
parent 953e609fb8
commit 08df2f71ea
41 changed files with 1535 additions and 83 deletions

View File

@@ -8,5 +8,6 @@ import { TasksService } from './tasks.service';
imports: [CatalogModule, NotificationsModule],
controllers: [TasksController],
providers: [TasksService],
exports: [TasksService],
})
export class TasksModule {}

View File

@@ -95,6 +95,58 @@ export class TasksService {
};
}
async listForLabCase(
labCaseId: string,
organizationId: string,
actorUserId: string,
localeInput?: string | null,
) {
await this.assertCanReadTasks(actorUserId, organizationId);
const labCase = await this.prisma.labCase.findFirst({
where: {
id: labCaseId,
sentAt: { not: null },
sends: { some: { organizationId } },
},
select: { id: true },
});
if (!labCase) {
throw new NotFoundException('Case not found');
}
return this.listTasksForLabCaseId(labCaseId, localeInput);
}
async listTasksForLabCaseId(labCaseId: string, localeInput?: string | null) {
const items = await this.prisma.labCaseTask.findMany({
where: { labCaseId },
include: taskListInclude,
orderBy: [
{ treatmentDetailId: 'asc' },
{ prosthesisTypeCode: 'asc' },
{ stepOrder: 'asc' },
{ id: 'asc' },
],
});
const locale = normalizeCatalogLocale(localeInput);
const prosthesisCodes = [...new Set(items.map((t) => t.prosthesisTypeCode).filter(Boolean))];
const prosthesisLabels = await this.catalogLabels.resolveLabels(
CatalogEntityKind.PROSTHESIS_TYPE,
prosthesisCodes,
locale,
);
return {
success: true,
data: {
items: items.map((task) => this.mapTaskListItem(task, prosthesisLabels)),
},
};
}
async locateTaskPage(
labOrganizationId: string,
actorUserId: string,