@blackcode_sa/metaestetics-api 1.7.20 → 1.7.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/admin/index.d.mts +0 -1
- package/dist/admin/index.d.ts +0 -1
- package/dist/admin/index.js +12 -23
- package/dist/admin/index.mjs +12 -23
- package/dist/index.d.mts +39 -19
- package/dist/index.d.ts +39 -19
- package/dist/index.js +1116 -951
- package/dist/index.mjs +1132 -965
- package/package.json +1 -1
- package/src/admin/aggregation/forms/filled-forms.aggregation.service.ts +18 -32
- package/src/services/patient/patient.service.ts +162 -10
- package/src/services/patient/utils/profile.utils.ts +124 -135
- package/src/services/patient/utils/sensitive.utils.ts +76 -2
- package/src/types/patient/index.ts +25 -23
- package/src/validations/patient.schema.ts +4 -4
package/dist/admin/index.d.mts
CHANGED
package/dist/admin/index.d.ts
CHANGED
package/dist/admin/index.js
CHANGED
|
@@ -4468,32 +4468,21 @@ var FilledFormsAggregationService = class {
|
|
|
4468
4468
|
);
|
|
4469
4469
|
}
|
|
4470
4470
|
let updateData = {};
|
|
4471
|
-
let
|
|
4471
|
+
let updatedLinkedForms = [];
|
|
4472
4472
|
if (appointment.linkedForms && appointment.linkedForms.length > 0) {
|
|
4473
|
-
|
|
4474
|
-
(form) => form.formId
|
|
4473
|
+
updatedLinkedForms = appointment.linkedForms.filter(
|
|
4474
|
+
(form) => form.formId !== filledDocument.id
|
|
4475
4475
|
);
|
|
4476
4476
|
}
|
|
4477
|
-
|
|
4478
|
-
|
|
4479
|
-
|
|
4480
|
-
|
|
4481
|
-
|
|
4482
|
-
|
|
4483
|
-
|
|
4484
|
-
|
|
4485
|
-
updateData =
|
|
4486
|
-
linkedForms: admin11.firestore.FieldValue.arrayUnion(linkedFormInfo),
|
|
4487
|
-
updatedAt: admin11.firestore.FieldValue.serverTimestamp()
|
|
4488
|
-
};
|
|
4489
|
-
} else {
|
|
4490
|
-
updateData = {
|
|
4491
|
-
linkedForms: appointment.linkedForms ? admin11.firestore.FieldValue.arrayUnion(linkedFormInfo) : [linkedFormInfo],
|
|
4492
|
-
// If linkedForms doesn't exist, create a new array
|
|
4493
|
-
linkedFormIds: appointment.linkedFormIds ? admin11.firestore.FieldValue.arrayUnion(filledDocument.id) : [filledDocument.id],
|
|
4494
|
-
// If linkedFormIds doesn't exist, create a new array
|
|
4495
|
-
updatedAt: admin11.firestore.FieldValue.serverTimestamp()
|
|
4496
|
-
};
|
|
4477
|
+
updatedLinkedForms.push(linkedFormInfo);
|
|
4478
|
+
updateData = {
|
|
4479
|
+
linkedForms: updatedLinkedForms,
|
|
4480
|
+
updatedAt: admin11.firestore.FieldValue.serverTimestamp()
|
|
4481
|
+
};
|
|
4482
|
+
let updatedLinkedFormIds = appointment.linkedFormIds || [];
|
|
4483
|
+
if (!updatedLinkedFormIds.includes(filledDocument.id)) {
|
|
4484
|
+
updatedLinkedFormIds.push(filledDocument.id);
|
|
4485
|
+
updateData.linkedFormIds = updatedLinkedFormIds;
|
|
4497
4486
|
}
|
|
4498
4487
|
if (filledDocument.isUserForm && filledDocument.isRequired && (filledDocument.status === "completed" /* COMPLETED */ || filledDocument.status === "signed" /* SIGNED */)) {
|
|
4499
4488
|
if (appointment.pendingUserFormsIds && appointment.pendingUserFormsIds.includes(filledDocument.id)) {
|
package/dist/admin/index.mjs
CHANGED
|
@@ -4411,32 +4411,21 @@ var FilledFormsAggregationService = class {
|
|
|
4411
4411
|
);
|
|
4412
4412
|
}
|
|
4413
4413
|
let updateData = {};
|
|
4414
|
-
let
|
|
4414
|
+
let updatedLinkedForms = [];
|
|
4415
4415
|
if (appointment.linkedForms && appointment.linkedForms.length > 0) {
|
|
4416
|
-
|
|
4417
|
-
(form) => form.formId
|
|
4416
|
+
updatedLinkedForms = appointment.linkedForms.filter(
|
|
4417
|
+
(form) => form.formId !== filledDocument.id
|
|
4418
4418
|
);
|
|
4419
4419
|
}
|
|
4420
|
-
|
|
4421
|
-
|
|
4422
|
-
|
|
4423
|
-
|
|
4424
|
-
|
|
4425
|
-
|
|
4426
|
-
|
|
4427
|
-
|
|
4428
|
-
updateData =
|
|
4429
|
-
linkedForms: admin11.firestore.FieldValue.arrayUnion(linkedFormInfo),
|
|
4430
|
-
updatedAt: admin11.firestore.FieldValue.serverTimestamp()
|
|
4431
|
-
};
|
|
4432
|
-
} else {
|
|
4433
|
-
updateData = {
|
|
4434
|
-
linkedForms: appointment.linkedForms ? admin11.firestore.FieldValue.arrayUnion(linkedFormInfo) : [linkedFormInfo],
|
|
4435
|
-
// If linkedForms doesn't exist, create a new array
|
|
4436
|
-
linkedFormIds: appointment.linkedFormIds ? admin11.firestore.FieldValue.arrayUnion(filledDocument.id) : [filledDocument.id],
|
|
4437
|
-
// If linkedFormIds doesn't exist, create a new array
|
|
4438
|
-
updatedAt: admin11.firestore.FieldValue.serverTimestamp()
|
|
4439
|
-
};
|
|
4420
|
+
updatedLinkedForms.push(linkedFormInfo);
|
|
4421
|
+
updateData = {
|
|
4422
|
+
linkedForms: updatedLinkedForms,
|
|
4423
|
+
updatedAt: admin11.firestore.FieldValue.serverTimestamp()
|
|
4424
|
+
};
|
|
4425
|
+
let updatedLinkedFormIds = appointment.linkedFormIds || [];
|
|
4426
|
+
if (!updatedLinkedFormIds.includes(filledDocument.id)) {
|
|
4427
|
+
updatedLinkedFormIds.push(filledDocument.id);
|
|
4428
|
+
updateData.linkedFormIds = updatedLinkedFormIds;
|
|
4440
4429
|
}
|
|
4441
4430
|
if (filledDocument.isUserForm && filledDocument.isRequired && (filledDocument.status === "completed" /* COMPLETED */ || filledDocument.status === "signed" /* SIGNED */)) {
|
|
4442
4431
|
if (appointment.pendingUserFormsIds && appointment.pendingUserFormsIds.includes(filledDocument.id)) {
|
package/dist/index.d.mts
CHANGED
|
@@ -1683,7 +1683,7 @@ interface UpdatePatientLocationInfoData extends Partial<CreatePatientLocationInf
|
|
|
1683
1683
|
interface PatientSensitiveInfo {
|
|
1684
1684
|
patientId: string;
|
|
1685
1685
|
userRef: string;
|
|
1686
|
-
photoUrl?: string;
|
|
1686
|
+
photoUrl?: string | null;
|
|
1687
1687
|
firstName: string;
|
|
1688
1688
|
lastName: string;
|
|
1689
1689
|
dateOfBirth: Timestamp | null;
|
|
@@ -1702,7 +1702,7 @@ interface PatientSensitiveInfo {
|
|
|
1702
1702
|
interface CreatePatientSensitiveInfoData {
|
|
1703
1703
|
patientId: string;
|
|
1704
1704
|
userRef: string;
|
|
1705
|
-
photoUrl?:
|
|
1705
|
+
photoUrl?: MediaResource | null;
|
|
1706
1706
|
firstName: string;
|
|
1707
1707
|
lastName: string;
|
|
1708
1708
|
dateOfBirth: Timestamp | null;
|
|
@@ -1746,7 +1746,6 @@ interface PatientProfile {
|
|
|
1746
1746
|
id: string;
|
|
1747
1747
|
userRef: string;
|
|
1748
1748
|
displayName: string;
|
|
1749
|
-
profilePhoto: string | null;
|
|
1750
1749
|
gamification: GamificationInfo;
|
|
1751
1750
|
expoTokens: string[];
|
|
1752
1751
|
isActive: boolean;
|
|
@@ -1778,7 +1777,7 @@ interface CreatePatientProfileData {
|
|
|
1778
1777
|
/**
|
|
1779
1778
|
* Tip za ažuriranje Patient profila
|
|
1780
1779
|
*/
|
|
1781
|
-
interface UpdatePatientProfileData extends Partial<Omit<PatientProfile,
|
|
1780
|
+
interface UpdatePatientProfileData extends Partial<Omit<PatientProfile, "id" | "createdAt" | "updatedAt">> {
|
|
1782
1781
|
updatedAt?: FieldValue;
|
|
1783
1782
|
}
|
|
1784
1783
|
/**
|
|
@@ -1797,7 +1796,7 @@ interface RequesterInfo {
|
|
|
1797
1796
|
/** ID of the clinic admin user or practitioner user making the request. */
|
|
1798
1797
|
id: string;
|
|
1799
1798
|
/** Role of the requester, determining the search context. */
|
|
1800
|
-
role:
|
|
1799
|
+
role: "clinic_admin" | "practitioner";
|
|
1801
1800
|
/** If role is 'clinic_admin', this is the associated clinic ID. */
|
|
1802
1801
|
associatedClinicId?: string;
|
|
1803
1802
|
/** If role is 'practitioner', this is the associated practitioner profile ID. */
|
|
@@ -5475,6 +5474,7 @@ interface CreateUserData {
|
|
|
5475
5474
|
type FirebaseUser = User$1;
|
|
5476
5475
|
|
|
5477
5476
|
declare class PatientService extends BaseService {
|
|
5477
|
+
private mediaService;
|
|
5478
5478
|
constructor(db: Firestore, auth: Auth, app: FirebaseApp);
|
|
5479
5479
|
createPatientProfile(data: CreatePatientProfileData): Promise<PatientProfile>;
|
|
5480
5480
|
getPatientProfile(patientId: string): Promise<PatientProfile | null>;
|
|
@@ -5520,9 +5520,32 @@ declare class PatientService extends BaseService {
|
|
|
5520
5520
|
removeDoctor(patientId: string, doctorRef: string): Promise<void>;
|
|
5521
5521
|
addClinic(patientId: string, clinicId: string): Promise<void>;
|
|
5522
5522
|
removeClinic(patientId: string, clinicId: string): Promise<void>;
|
|
5523
|
-
|
|
5524
|
-
|
|
5523
|
+
/**
|
|
5524
|
+
* Uploads a profile photo for a patient
|
|
5525
|
+
* @param patientId - ID of the patient
|
|
5526
|
+
* @param file - File or Blob to upload
|
|
5527
|
+
* @returns URL of the uploaded photo
|
|
5528
|
+
*/
|
|
5529
|
+
uploadProfilePhoto(patientId: string, file: File | Blob): Promise<string>;
|
|
5530
|
+
/**
|
|
5531
|
+
* Updates a patient's profile photo (replaces existing one)
|
|
5532
|
+
* @param patientId - ID of the patient
|
|
5533
|
+
* @param file - New file or Blob to upload
|
|
5534
|
+
* @returns URL of the new uploaded photo
|
|
5535
|
+
*/
|
|
5536
|
+
updateProfilePhoto(patientId: string, file: File | Blob): Promise<string>;
|
|
5537
|
+
/**
|
|
5538
|
+
* Deletes a patient's profile photo
|
|
5539
|
+
* @param patientId - ID of the patient
|
|
5540
|
+
*/
|
|
5525
5541
|
deleteProfilePhoto(patientId: string): Promise<void>;
|
|
5542
|
+
/**
|
|
5543
|
+
* Handles profile photo upload for patients (supports MediaResource)
|
|
5544
|
+
* @param photoUrl - MediaResource (File, Blob, or URL string) from CreatePatientSensitiveInfoData
|
|
5545
|
+
* @param patientId - ID of the patient
|
|
5546
|
+
* @returns URL string of the uploaded or existing photo
|
|
5547
|
+
*/
|
|
5548
|
+
private handleProfilePhotoUpload;
|
|
5526
5549
|
updatePatientProfile(patientId: string, data: Partial<Omit<PatientProfile, "id" | "createdAt" | "updatedAt">>): Promise<PatientProfile>;
|
|
5527
5550
|
updatePatientProfileByUserRef(userRef: string, data: Partial<Omit<PatientProfile, "id" | "createdAt" | "updatedAt">>): Promise<PatientProfile>;
|
|
5528
5551
|
/**
|
|
@@ -10303,7 +10326,6 @@ declare const createPatientLocationInfoSchema: z.ZodObject<{
|
|
|
10303
10326
|
declare const patientSensitiveInfoSchema: z.ZodObject<{
|
|
10304
10327
|
patientId: z.ZodString;
|
|
10305
10328
|
userRef: z.ZodString;
|
|
10306
|
-
photoUrl: z.ZodOptional<z.ZodString>;
|
|
10307
10329
|
firstName: z.ZodString;
|
|
10308
10330
|
lastName: z.ZodString;
|
|
10309
10331
|
dateOfBirth: z.ZodNullable<z.ZodType<Timestamp, z.ZodTypeDef, Timestamp>>;
|
|
@@ -10354,7 +10376,6 @@ declare const patientSensitiveInfoSchema: z.ZodObject<{
|
|
|
10354
10376
|
lastName: string;
|
|
10355
10377
|
dateOfBirth: Timestamp | null;
|
|
10356
10378
|
gender: Gender;
|
|
10357
|
-
photoUrl?: string | undefined;
|
|
10358
10379
|
email?: string | undefined;
|
|
10359
10380
|
phoneNumber?: string | undefined;
|
|
10360
10381
|
alternativePhoneNumber?: string | undefined;
|
|
@@ -10379,7 +10400,6 @@ declare const patientSensitiveInfoSchema: z.ZodObject<{
|
|
|
10379
10400
|
lastName: string;
|
|
10380
10401
|
dateOfBirth: Timestamp | null;
|
|
10381
10402
|
gender: Gender;
|
|
10382
|
-
photoUrl?: string | undefined;
|
|
10383
10403
|
email?: string | undefined;
|
|
10384
10404
|
phoneNumber?: string | undefined;
|
|
10385
10405
|
alternativePhoneNumber?: string | undefined;
|
|
@@ -10447,7 +10467,6 @@ declare const patientProfileSchema: z.ZodObject<{
|
|
|
10447
10467
|
id: z.ZodString;
|
|
10448
10468
|
userRef: z.ZodString;
|
|
10449
10469
|
displayName: z.ZodString;
|
|
10450
|
-
profilePhoto: z.ZodNullable<z.ZodString>;
|
|
10451
10470
|
gamification: z.ZodObject<{
|
|
10452
10471
|
level: z.ZodNumber;
|
|
10453
10472
|
points: z.ZodNumber;
|
|
@@ -10461,6 +10480,8 @@ declare const patientProfileSchema: z.ZodObject<{
|
|
|
10461
10480
|
expoTokens: z.ZodArray<z.ZodString, "many">;
|
|
10462
10481
|
isActive: z.ZodBoolean;
|
|
10463
10482
|
isVerified: z.ZodBoolean;
|
|
10483
|
+
phoneNumber: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
10484
|
+
dateOfBirth: z.ZodOptional<z.ZodNullable<z.ZodType<Timestamp, z.ZodTypeDef, Timestamp>>>;
|
|
10464
10485
|
doctors: z.ZodArray<z.ZodObject<{
|
|
10465
10486
|
userRef: z.ZodString;
|
|
10466
10487
|
assignedAt: z.ZodType<Timestamp, z.ZodTypeDef, Timestamp>;
|
|
@@ -10518,7 +10539,6 @@ declare const patientProfileSchema: z.ZodObject<{
|
|
|
10518
10539
|
}[];
|
|
10519
10540
|
isVerified: boolean;
|
|
10520
10541
|
displayName: string;
|
|
10521
|
-
profilePhoto: string | null;
|
|
10522
10542
|
gamification: {
|
|
10523
10543
|
level: number;
|
|
10524
10544
|
points: number;
|
|
@@ -10533,6 +10553,8 @@ declare const patientProfileSchema: z.ZodObject<{
|
|
|
10533
10553
|
}[];
|
|
10534
10554
|
doctorIds: string[];
|
|
10535
10555
|
clinicIds: string[];
|
|
10556
|
+
dateOfBirth?: Timestamp | null | undefined;
|
|
10557
|
+
phoneNumber?: string | null | undefined;
|
|
10536
10558
|
}, {
|
|
10537
10559
|
id: string;
|
|
10538
10560
|
createdAt: Timestamp;
|
|
@@ -10548,7 +10570,6 @@ declare const patientProfileSchema: z.ZodObject<{
|
|
|
10548
10570
|
}[];
|
|
10549
10571
|
isVerified: boolean;
|
|
10550
10572
|
displayName: string;
|
|
10551
|
-
profilePhoto: string | null;
|
|
10552
10573
|
gamification: {
|
|
10553
10574
|
level: number;
|
|
10554
10575
|
points: number;
|
|
@@ -10563,6 +10584,8 @@ declare const patientProfileSchema: z.ZodObject<{
|
|
|
10563
10584
|
}[];
|
|
10564
10585
|
doctorIds: string[];
|
|
10565
10586
|
clinicIds: string[];
|
|
10587
|
+
dateOfBirth?: Timestamp | null | undefined;
|
|
10588
|
+
phoneNumber?: string | null | undefined;
|
|
10566
10589
|
}>;
|
|
10567
10590
|
/**
|
|
10568
10591
|
* Šema za validaciju podataka pri kreiranju profila
|
|
@@ -10570,7 +10593,6 @@ declare const patientProfileSchema: z.ZodObject<{
|
|
|
10570
10593
|
declare const createPatientProfileSchema: z.ZodObject<{
|
|
10571
10594
|
userRef: z.ZodString;
|
|
10572
10595
|
displayName: z.ZodString;
|
|
10573
|
-
profilePhoto: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
10574
10596
|
expoTokens: z.ZodArray<z.ZodString, "many">;
|
|
10575
10597
|
gamification: z.ZodOptional<z.ZodObject<{
|
|
10576
10598
|
level: z.ZodNumber;
|
|
@@ -10637,7 +10659,6 @@ declare const createPatientProfileSchema: z.ZodObject<{
|
|
|
10637
10659
|
notes?: string | undefined;
|
|
10638
10660
|
assignedBy?: string | undefined;
|
|
10639
10661
|
}[] | undefined;
|
|
10640
|
-
profilePhoto?: string | null | undefined;
|
|
10641
10662
|
gamification?: {
|
|
10642
10663
|
level: number;
|
|
10643
10664
|
points: number;
|
|
@@ -10664,7 +10685,6 @@ declare const createPatientProfileSchema: z.ZodObject<{
|
|
|
10664
10685
|
notes?: string | undefined;
|
|
10665
10686
|
assignedBy?: string | undefined;
|
|
10666
10687
|
}[] | undefined;
|
|
10667
|
-
profilePhoto?: string | null | undefined;
|
|
10668
10688
|
gamification?: {
|
|
10669
10689
|
level: number;
|
|
10670
10690
|
points: number;
|
|
@@ -10685,7 +10705,7 @@ declare const createPatientProfileSchema: z.ZodObject<{
|
|
|
10685
10705
|
declare const createPatientSensitiveInfoSchema: z.ZodObject<{
|
|
10686
10706
|
patientId: z.ZodString;
|
|
10687
10707
|
userRef: z.ZodString;
|
|
10688
|
-
photoUrl: z.ZodOptional<z.ZodString
|
|
10708
|
+
photoUrl: z.ZodOptional<z.ZodNullable<z.ZodUnion<[z.ZodString, z.ZodType<File, z.ZodTypeDef, File>, z.ZodType<Blob, z.ZodTypeDef, Blob>]>>>;
|
|
10689
10709
|
firstName: z.ZodString;
|
|
10690
10710
|
lastName: z.ZodString;
|
|
10691
10711
|
dateOfBirth: z.ZodNullable<z.ZodType<Timestamp, z.ZodTypeDef, Timestamp>>;
|
|
@@ -10732,7 +10752,7 @@ declare const createPatientSensitiveInfoSchema: z.ZodObject<{
|
|
|
10732
10752
|
lastName: string;
|
|
10733
10753
|
dateOfBirth: Timestamp | null;
|
|
10734
10754
|
gender: Gender;
|
|
10735
|
-
photoUrl?: string | undefined;
|
|
10755
|
+
photoUrl?: string | File | Blob | null | undefined;
|
|
10736
10756
|
email?: string | undefined;
|
|
10737
10757
|
phoneNumber?: string | undefined;
|
|
10738
10758
|
alternativePhoneNumber?: string | undefined;
|
|
@@ -10755,7 +10775,7 @@ declare const createPatientSensitiveInfoSchema: z.ZodObject<{
|
|
|
10755
10775
|
lastName: string;
|
|
10756
10776
|
dateOfBirth: Timestamp | null;
|
|
10757
10777
|
gender: Gender;
|
|
10758
|
-
photoUrl?: string | undefined;
|
|
10778
|
+
photoUrl?: string | File | Blob | null | undefined;
|
|
10759
10779
|
email?: string | undefined;
|
|
10760
10780
|
phoneNumber?: string | undefined;
|
|
10761
10781
|
alternativePhoneNumber?: string | undefined;
|
package/dist/index.d.ts
CHANGED
|
@@ -1683,7 +1683,7 @@ interface UpdatePatientLocationInfoData extends Partial<CreatePatientLocationInf
|
|
|
1683
1683
|
interface PatientSensitiveInfo {
|
|
1684
1684
|
patientId: string;
|
|
1685
1685
|
userRef: string;
|
|
1686
|
-
photoUrl?: string;
|
|
1686
|
+
photoUrl?: string | null;
|
|
1687
1687
|
firstName: string;
|
|
1688
1688
|
lastName: string;
|
|
1689
1689
|
dateOfBirth: Timestamp | null;
|
|
@@ -1702,7 +1702,7 @@ interface PatientSensitiveInfo {
|
|
|
1702
1702
|
interface CreatePatientSensitiveInfoData {
|
|
1703
1703
|
patientId: string;
|
|
1704
1704
|
userRef: string;
|
|
1705
|
-
photoUrl?:
|
|
1705
|
+
photoUrl?: MediaResource | null;
|
|
1706
1706
|
firstName: string;
|
|
1707
1707
|
lastName: string;
|
|
1708
1708
|
dateOfBirth: Timestamp | null;
|
|
@@ -1746,7 +1746,6 @@ interface PatientProfile {
|
|
|
1746
1746
|
id: string;
|
|
1747
1747
|
userRef: string;
|
|
1748
1748
|
displayName: string;
|
|
1749
|
-
profilePhoto: string | null;
|
|
1750
1749
|
gamification: GamificationInfo;
|
|
1751
1750
|
expoTokens: string[];
|
|
1752
1751
|
isActive: boolean;
|
|
@@ -1778,7 +1777,7 @@ interface CreatePatientProfileData {
|
|
|
1778
1777
|
/**
|
|
1779
1778
|
* Tip za ažuriranje Patient profila
|
|
1780
1779
|
*/
|
|
1781
|
-
interface UpdatePatientProfileData extends Partial<Omit<PatientProfile,
|
|
1780
|
+
interface UpdatePatientProfileData extends Partial<Omit<PatientProfile, "id" | "createdAt" | "updatedAt">> {
|
|
1782
1781
|
updatedAt?: FieldValue;
|
|
1783
1782
|
}
|
|
1784
1783
|
/**
|
|
@@ -1797,7 +1796,7 @@ interface RequesterInfo {
|
|
|
1797
1796
|
/** ID of the clinic admin user or practitioner user making the request. */
|
|
1798
1797
|
id: string;
|
|
1799
1798
|
/** Role of the requester, determining the search context. */
|
|
1800
|
-
role:
|
|
1799
|
+
role: "clinic_admin" | "practitioner";
|
|
1801
1800
|
/** If role is 'clinic_admin', this is the associated clinic ID. */
|
|
1802
1801
|
associatedClinicId?: string;
|
|
1803
1802
|
/** If role is 'practitioner', this is the associated practitioner profile ID. */
|
|
@@ -5475,6 +5474,7 @@ interface CreateUserData {
|
|
|
5475
5474
|
type FirebaseUser = User$1;
|
|
5476
5475
|
|
|
5477
5476
|
declare class PatientService extends BaseService {
|
|
5477
|
+
private mediaService;
|
|
5478
5478
|
constructor(db: Firestore, auth: Auth, app: FirebaseApp);
|
|
5479
5479
|
createPatientProfile(data: CreatePatientProfileData): Promise<PatientProfile>;
|
|
5480
5480
|
getPatientProfile(patientId: string): Promise<PatientProfile | null>;
|
|
@@ -5520,9 +5520,32 @@ declare class PatientService extends BaseService {
|
|
|
5520
5520
|
removeDoctor(patientId: string, doctorRef: string): Promise<void>;
|
|
5521
5521
|
addClinic(patientId: string, clinicId: string): Promise<void>;
|
|
5522
5522
|
removeClinic(patientId: string, clinicId: string): Promise<void>;
|
|
5523
|
-
|
|
5524
|
-
|
|
5523
|
+
/**
|
|
5524
|
+
* Uploads a profile photo for a patient
|
|
5525
|
+
* @param patientId - ID of the patient
|
|
5526
|
+
* @param file - File or Blob to upload
|
|
5527
|
+
* @returns URL of the uploaded photo
|
|
5528
|
+
*/
|
|
5529
|
+
uploadProfilePhoto(patientId: string, file: File | Blob): Promise<string>;
|
|
5530
|
+
/**
|
|
5531
|
+
* Updates a patient's profile photo (replaces existing one)
|
|
5532
|
+
* @param patientId - ID of the patient
|
|
5533
|
+
* @param file - New file or Blob to upload
|
|
5534
|
+
* @returns URL of the new uploaded photo
|
|
5535
|
+
*/
|
|
5536
|
+
updateProfilePhoto(patientId: string, file: File | Blob): Promise<string>;
|
|
5537
|
+
/**
|
|
5538
|
+
* Deletes a patient's profile photo
|
|
5539
|
+
* @param patientId - ID of the patient
|
|
5540
|
+
*/
|
|
5525
5541
|
deleteProfilePhoto(patientId: string): Promise<void>;
|
|
5542
|
+
/**
|
|
5543
|
+
* Handles profile photo upload for patients (supports MediaResource)
|
|
5544
|
+
* @param photoUrl - MediaResource (File, Blob, or URL string) from CreatePatientSensitiveInfoData
|
|
5545
|
+
* @param patientId - ID of the patient
|
|
5546
|
+
* @returns URL string of the uploaded or existing photo
|
|
5547
|
+
*/
|
|
5548
|
+
private handleProfilePhotoUpload;
|
|
5526
5549
|
updatePatientProfile(patientId: string, data: Partial<Omit<PatientProfile, "id" | "createdAt" | "updatedAt">>): Promise<PatientProfile>;
|
|
5527
5550
|
updatePatientProfileByUserRef(userRef: string, data: Partial<Omit<PatientProfile, "id" | "createdAt" | "updatedAt">>): Promise<PatientProfile>;
|
|
5528
5551
|
/**
|
|
@@ -10303,7 +10326,6 @@ declare const createPatientLocationInfoSchema: z.ZodObject<{
|
|
|
10303
10326
|
declare const patientSensitiveInfoSchema: z.ZodObject<{
|
|
10304
10327
|
patientId: z.ZodString;
|
|
10305
10328
|
userRef: z.ZodString;
|
|
10306
|
-
photoUrl: z.ZodOptional<z.ZodString>;
|
|
10307
10329
|
firstName: z.ZodString;
|
|
10308
10330
|
lastName: z.ZodString;
|
|
10309
10331
|
dateOfBirth: z.ZodNullable<z.ZodType<Timestamp, z.ZodTypeDef, Timestamp>>;
|
|
@@ -10354,7 +10376,6 @@ declare const patientSensitiveInfoSchema: z.ZodObject<{
|
|
|
10354
10376
|
lastName: string;
|
|
10355
10377
|
dateOfBirth: Timestamp | null;
|
|
10356
10378
|
gender: Gender;
|
|
10357
|
-
photoUrl?: string | undefined;
|
|
10358
10379
|
email?: string | undefined;
|
|
10359
10380
|
phoneNumber?: string | undefined;
|
|
10360
10381
|
alternativePhoneNumber?: string | undefined;
|
|
@@ -10379,7 +10400,6 @@ declare const patientSensitiveInfoSchema: z.ZodObject<{
|
|
|
10379
10400
|
lastName: string;
|
|
10380
10401
|
dateOfBirth: Timestamp | null;
|
|
10381
10402
|
gender: Gender;
|
|
10382
|
-
photoUrl?: string | undefined;
|
|
10383
10403
|
email?: string | undefined;
|
|
10384
10404
|
phoneNumber?: string | undefined;
|
|
10385
10405
|
alternativePhoneNumber?: string | undefined;
|
|
@@ -10447,7 +10467,6 @@ declare const patientProfileSchema: z.ZodObject<{
|
|
|
10447
10467
|
id: z.ZodString;
|
|
10448
10468
|
userRef: z.ZodString;
|
|
10449
10469
|
displayName: z.ZodString;
|
|
10450
|
-
profilePhoto: z.ZodNullable<z.ZodString>;
|
|
10451
10470
|
gamification: z.ZodObject<{
|
|
10452
10471
|
level: z.ZodNumber;
|
|
10453
10472
|
points: z.ZodNumber;
|
|
@@ -10461,6 +10480,8 @@ declare const patientProfileSchema: z.ZodObject<{
|
|
|
10461
10480
|
expoTokens: z.ZodArray<z.ZodString, "many">;
|
|
10462
10481
|
isActive: z.ZodBoolean;
|
|
10463
10482
|
isVerified: z.ZodBoolean;
|
|
10483
|
+
phoneNumber: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
10484
|
+
dateOfBirth: z.ZodOptional<z.ZodNullable<z.ZodType<Timestamp, z.ZodTypeDef, Timestamp>>>;
|
|
10464
10485
|
doctors: z.ZodArray<z.ZodObject<{
|
|
10465
10486
|
userRef: z.ZodString;
|
|
10466
10487
|
assignedAt: z.ZodType<Timestamp, z.ZodTypeDef, Timestamp>;
|
|
@@ -10518,7 +10539,6 @@ declare const patientProfileSchema: z.ZodObject<{
|
|
|
10518
10539
|
}[];
|
|
10519
10540
|
isVerified: boolean;
|
|
10520
10541
|
displayName: string;
|
|
10521
|
-
profilePhoto: string | null;
|
|
10522
10542
|
gamification: {
|
|
10523
10543
|
level: number;
|
|
10524
10544
|
points: number;
|
|
@@ -10533,6 +10553,8 @@ declare const patientProfileSchema: z.ZodObject<{
|
|
|
10533
10553
|
}[];
|
|
10534
10554
|
doctorIds: string[];
|
|
10535
10555
|
clinicIds: string[];
|
|
10556
|
+
dateOfBirth?: Timestamp | null | undefined;
|
|
10557
|
+
phoneNumber?: string | null | undefined;
|
|
10536
10558
|
}, {
|
|
10537
10559
|
id: string;
|
|
10538
10560
|
createdAt: Timestamp;
|
|
@@ -10548,7 +10570,6 @@ declare const patientProfileSchema: z.ZodObject<{
|
|
|
10548
10570
|
}[];
|
|
10549
10571
|
isVerified: boolean;
|
|
10550
10572
|
displayName: string;
|
|
10551
|
-
profilePhoto: string | null;
|
|
10552
10573
|
gamification: {
|
|
10553
10574
|
level: number;
|
|
10554
10575
|
points: number;
|
|
@@ -10563,6 +10584,8 @@ declare const patientProfileSchema: z.ZodObject<{
|
|
|
10563
10584
|
}[];
|
|
10564
10585
|
doctorIds: string[];
|
|
10565
10586
|
clinicIds: string[];
|
|
10587
|
+
dateOfBirth?: Timestamp | null | undefined;
|
|
10588
|
+
phoneNumber?: string | null | undefined;
|
|
10566
10589
|
}>;
|
|
10567
10590
|
/**
|
|
10568
10591
|
* Šema za validaciju podataka pri kreiranju profila
|
|
@@ -10570,7 +10593,6 @@ declare const patientProfileSchema: z.ZodObject<{
|
|
|
10570
10593
|
declare const createPatientProfileSchema: z.ZodObject<{
|
|
10571
10594
|
userRef: z.ZodString;
|
|
10572
10595
|
displayName: z.ZodString;
|
|
10573
|
-
profilePhoto: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
10574
10596
|
expoTokens: z.ZodArray<z.ZodString, "many">;
|
|
10575
10597
|
gamification: z.ZodOptional<z.ZodObject<{
|
|
10576
10598
|
level: z.ZodNumber;
|
|
@@ -10637,7 +10659,6 @@ declare const createPatientProfileSchema: z.ZodObject<{
|
|
|
10637
10659
|
notes?: string | undefined;
|
|
10638
10660
|
assignedBy?: string | undefined;
|
|
10639
10661
|
}[] | undefined;
|
|
10640
|
-
profilePhoto?: string | null | undefined;
|
|
10641
10662
|
gamification?: {
|
|
10642
10663
|
level: number;
|
|
10643
10664
|
points: number;
|
|
@@ -10664,7 +10685,6 @@ declare const createPatientProfileSchema: z.ZodObject<{
|
|
|
10664
10685
|
notes?: string | undefined;
|
|
10665
10686
|
assignedBy?: string | undefined;
|
|
10666
10687
|
}[] | undefined;
|
|
10667
|
-
profilePhoto?: string | null | undefined;
|
|
10668
10688
|
gamification?: {
|
|
10669
10689
|
level: number;
|
|
10670
10690
|
points: number;
|
|
@@ -10685,7 +10705,7 @@ declare const createPatientProfileSchema: z.ZodObject<{
|
|
|
10685
10705
|
declare const createPatientSensitiveInfoSchema: z.ZodObject<{
|
|
10686
10706
|
patientId: z.ZodString;
|
|
10687
10707
|
userRef: z.ZodString;
|
|
10688
|
-
photoUrl: z.ZodOptional<z.ZodString
|
|
10708
|
+
photoUrl: z.ZodOptional<z.ZodNullable<z.ZodUnion<[z.ZodString, z.ZodType<File, z.ZodTypeDef, File>, z.ZodType<Blob, z.ZodTypeDef, Blob>]>>>;
|
|
10689
10709
|
firstName: z.ZodString;
|
|
10690
10710
|
lastName: z.ZodString;
|
|
10691
10711
|
dateOfBirth: z.ZodNullable<z.ZodType<Timestamp, z.ZodTypeDef, Timestamp>>;
|
|
@@ -10732,7 +10752,7 @@ declare const createPatientSensitiveInfoSchema: z.ZodObject<{
|
|
|
10732
10752
|
lastName: string;
|
|
10733
10753
|
dateOfBirth: Timestamp | null;
|
|
10734
10754
|
gender: Gender;
|
|
10735
|
-
photoUrl?: string | undefined;
|
|
10755
|
+
photoUrl?: string | File | Blob | null | undefined;
|
|
10736
10756
|
email?: string | undefined;
|
|
10737
10757
|
phoneNumber?: string | undefined;
|
|
10738
10758
|
alternativePhoneNumber?: string | undefined;
|
|
@@ -10755,7 +10775,7 @@ declare const createPatientSensitiveInfoSchema: z.ZodObject<{
|
|
|
10755
10775
|
lastName: string;
|
|
10756
10776
|
dateOfBirth: Timestamp | null;
|
|
10757
10777
|
gender: Gender;
|
|
10758
|
-
photoUrl?: string | undefined;
|
|
10778
|
+
photoUrl?: string | File | Blob | null | undefined;
|
|
10759
10779
|
email?: string | undefined;
|
|
10760
10780
|
phoneNumber?: string | undefined;
|
|
10761
10781
|
alternativePhoneNumber?: string | undefined;
|