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

@@ -22,6 +22,7 @@ import { normalizeTaskTeeth } from './lab-case-task.util';
import { hasEffectivePermission } from '../../common/membership-permissions';
import { LAB_CASES_TAB_ACTIVITY_TYPES } from '../../common/lab-case-activity';
import { LabCaseActivityService } from '../notifications/lab-case-activity.service';
import { LabCaseAccessService } from './lab-case-access.service';
const labCaseListInclude = {
treatment: {
@@ -95,6 +96,7 @@ export class CasesService {
private readonly prosthesisCatalog: ProsthesisCatalogService,
private readonly catalogLabels: CatalogLabelService,
private readonly labCaseActivity: LabCaseActivityService,
private readonly labCaseAccess: LabCaseAccessService,
) {}
getOrganizationIdFromUser(user: { organizationId?: string }) {
@@ -605,6 +607,12 @@ export class CasesService {
locale,
);
const tasksByTooth = this.groupTasks(lc.tasks, prosthesisLabels);
const accessToken = lc.sentAt
? await this.labCaseAccess.ensureAccessToken(lc.id)
: null;
const shareUrl = accessToken
? this.labCaseAccess.buildShareUrl(accessToken, locale)
: null;
return {
id: lc.id,
@@ -612,6 +620,7 @@ export class CasesService {
dueDate: lc.dueDate?.toISOString() ?? null,
isOverdue: isLabCaseOverdue(lc.dueDate, lc.tasks),
isImportant: lc.isImportant,
shareUrl,
clinic: lc.treatment.organization,
patient: lc.treatment.patient,
appointmentStartAt: lc.treatment.appointment?.startAt.toISOString() ?? null,