@iveri/contracts 0.47.0 → 0.48.0
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/api/clinic/clinic-consent-form.type.d.ts +14 -0
- package/dist/api/clinic/clinic-consent-form.type.js +1 -0
- package/dist/api/clinic/clinic-my-appointment.type.d.ts +12 -0
- package/dist/api/clinic/clinic-public.type.d.ts +20 -0
- package/dist/api/clinic/clinic-record-access-action.enum.d.ts +5 -0
- package/dist/api/clinic/clinic-record-access-action.enum.js +6 -0
- package/dist/api/clinic/clinic-record-method.enum.d.ts +5 -0
- package/dist/api/clinic/clinic-record-method.enum.js +6 -0
- package/dist/api/clinic/clinic-record.type.d.ts +129 -0
- package/dist/api/clinic/clinic-record.type.js +1 -0
- package/dist/api/clinic/clinic-screening-question.type.d.ts +24 -0
- package/dist/api/clinic/clinic-screening-question.type.js +1 -0
- package/dist/api/clinic/index.d.ts +5 -0
- package/dist/api/clinic/index.js +5 -0
- package/dist/enum/user-permission.enum.d.ts +7 -1
- package/dist/enum/user-permission.enum.js +6 -0
- package/package.json +1 -1
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { IsoDateTime } from '../../type/iso-date-time.type.js';
|
|
2
|
+
import type { UUID } from '../../type/uuid.type.js';
|
|
3
|
+
import type { LocalizedText } from './localized-text.type.js';
|
|
4
|
+
/** One version of what a client agrees to before a treatment. A change is a new version. */
|
|
5
|
+
export interface ClinicConsentForm {
|
|
6
|
+
id: UUID;
|
|
7
|
+
treatmentId: UUID;
|
|
8
|
+
version: number;
|
|
9
|
+
body: LocalizedText;
|
|
10
|
+
createdAt: IsoDateTime;
|
|
11
|
+
}
|
|
12
|
+
export interface PublishClinicConsentFormRequest {
|
|
13
|
+
body: LocalizedText;
|
|
14
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -3,6 +3,7 @@ import type { Nullable } from '../../type/nil.type.js';
|
|
|
3
3
|
import type { UUID } from '../../type/uuid.type.js';
|
|
4
4
|
import type { ClinicAppointmentStatus } from './clinic-appointment-status.enum.js';
|
|
5
5
|
import type { ClinicAppointmentLine } from './clinic-appointment.type.js';
|
|
6
|
+
import type { ClinicScreeningAnswerRequest, SignClinicConsentRequest } from './clinic-record.type.js';
|
|
6
7
|
import type { LocalizedText } from './localized-text.type.js';
|
|
7
8
|
/** A client's own view of a booking, without the room and machine the clinic assigned. */
|
|
8
9
|
export interface MyClinicAppointment {
|
|
@@ -32,6 +33,17 @@ export interface BookMyClinicAppointmentRequest {
|
|
|
32
33
|
staffMemberId: UUID;
|
|
33
34
|
startsAt: IsoDateTime;
|
|
34
35
|
note?: Nullable<string>;
|
|
36
|
+
/** One answer for each of the treatment's questions. Required when it has any. */
|
|
37
|
+
screening?: ClinicScreeningAnswerRequest[];
|
|
38
|
+
/** Required when the treatment has a consent form this client has not signed yet. */
|
|
39
|
+
consent?: SignClinicConsentRequest;
|
|
40
|
+
}
|
|
41
|
+
/** What one client still has to do before booking one treatment. */
|
|
42
|
+
export interface MyClinicBookingStatus {
|
|
43
|
+
/** Whether the booking has to carry a signature, which it does until the current form is signed. */
|
|
44
|
+
needsConsent: boolean;
|
|
45
|
+
/** When this client's next session may start, or `null` when nothing they have booked limits it. */
|
|
46
|
+
nextSessionFrom: Nullable<IsoDateTime>;
|
|
35
47
|
}
|
|
36
48
|
export interface SaveMyClinicClientRequest {
|
|
37
49
|
firstName: string;
|
|
@@ -94,3 +94,23 @@ export interface PublicReviewList {
|
|
|
94
94
|
count: number;
|
|
95
95
|
items: PublicReview[];
|
|
96
96
|
}
|
|
97
|
+
export interface PublicScreeningQuestion {
|
|
98
|
+
id: UUID;
|
|
99
|
+
text: LocalizedText;
|
|
100
|
+
/** The answer that rules the treatment out, or `null` when it is only for the specialist to read. */
|
|
101
|
+
stopsBookingOn: Nullable<boolean>;
|
|
102
|
+
}
|
|
103
|
+
export interface PublicConsentForm {
|
|
104
|
+
version: number;
|
|
105
|
+
body: LocalizedText;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* What a treatment asks of somebody before it can be booked.
|
|
109
|
+
*
|
|
110
|
+
* The rule travels with the question so a client can stop at the answer that rules it out, without
|
|
111
|
+
* sending somebody's health information anywhere when no booking is going to follow.
|
|
112
|
+
*/
|
|
113
|
+
export interface PublicBookingForm {
|
|
114
|
+
questions: PublicScreeningQuestion[];
|
|
115
|
+
consent: Nullable<PublicConsentForm>;
|
|
116
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/** What somebody opened: one visit's record, or a client's whole history. */
|
|
2
|
+
export var ClinicRecordAccessAction;
|
|
3
|
+
(function (ClinicRecordAccessAction) {
|
|
4
|
+
ClinicRecordAccessAction["VISIT"] = "visit";
|
|
5
|
+
ClinicRecordAccessAction["CLIENT"] = "client";
|
|
6
|
+
})(ClinicRecordAccessAction || (ClinicRecordAccessAction = {}));
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/** Whether the client entered it themselves, or a member of staff recorded it with them there. */
|
|
2
|
+
export var ClinicRecordMethod;
|
|
3
|
+
(function (ClinicRecordMethod) {
|
|
4
|
+
ClinicRecordMethod["ONLINE"] = "online";
|
|
5
|
+
ClinicRecordMethod["IN_CLINIC"] = "in-clinic";
|
|
6
|
+
})(ClinicRecordMethod || (ClinicRecordMethod = {}));
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import type { IsoDateTime } from '../../type/iso-date-time.type.js';
|
|
2
|
+
import type { Nullable } from '../../type/nil.type.js';
|
|
3
|
+
import type { UUID } from '../../type/uuid.type.js';
|
|
4
|
+
import type { ClinicAppointmentStatus } from './clinic-appointment-status.enum.js';
|
|
5
|
+
import type { ClinicConsentForm } from './clinic-consent-form.type.js';
|
|
6
|
+
import type { ClinicRecordAccessAction } from './clinic-record-access-action.enum.js';
|
|
7
|
+
import type { ClinicRecordMethod } from './clinic-record-method.enum.js';
|
|
8
|
+
import type { ClinicScreeningQuestion } from './clinic-screening-question.type.js';
|
|
9
|
+
import type { LocalizedText } from './localized-text.type.js';
|
|
10
|
+
export interface ClinicScreeningAnswerRequest {
|
|
11
|
+
questionId: UUID;
|
|
12
|
+
answer: boolean;
|
|
13
|
+
}
|
|
14
|
+
/** An answer beside the question as it read when it was asked, which is what gives it meaning. */
|
|
15
|
+
export interface ClinicScreeningAnswer {
|
|
16
|
+
questionId: UUID;
|
|
17
|
+
question: LocalizedText;
|
|
18
|
+
answer: boolean;
|
|
19
|
+
/** Whether this answer is the one that rules the treatment out. */
|
|
20
|
+
isFlagged: boolean;
|
|
21
|
+
}
|
|
22
|
+
export interface ClinicScreening {
|
|
23
|
+
id: UUID;
|
|
24
|
+
appointmentId: UUID;
|
|
25
|
+
treatmentId: UUID;
|
|
26
|
+
treatmentName: LocalizedText;
|
|
27
|
+
answers: ClinicScreeningAnswer[];
|
|
28
|
+
hasFlaggedAnswer: boolean;
|
|
29
|
+
method: ClinicRecordMethod;
|
|
30
|
+
recordedByName: Nullable<string>;
|
|
31
|
+
createdAt: IsoDateTime;
|
|
32
|
+
}
|
|
33
|
+
export interface RecordClinicScreeningRequest {
|
|
34
|
+
answers: ClinicScreeningAnswerRequest[];
|
|
35
|
+
}
|
|
36
|
+
export interface SignClinicConsentRequest {
|
|
37
|
+
/** The version that was on screen, so nobody signs one they have not read. */
|
|
38
|
+
version: number;
|
|
39
|
+
/** The language of the text that was on screen. The form must be written in it. */
|
|
40
|
+
locale: string;
|
|
41
|
+
signedName: string;
|
|
42
|
+
}
|
|
43
|
+
/** The exact text somebody agreed to, kept whatever later happens to the form. */
|
|
44
|
+
export interface ClinicConsentSignature {
|
|
45
|
+
id: UUID;
|
|
46
|
+
appointmentId: UUID;
|
|
47
|
+
treatmentId: UUID;
|
|
48
|
+
treatmentName: LocalizedText;
|
|
49
|
+
version: number;
|
|
50
|
+
locale: string;
|
|
51
|
+
text: string;
|
|
52
|
+
signedName: string;
|
|
53
|
+
method: ClinicRecordMethod;
|
|
54
|
+
recordedByName: Nullable<string>;
|
|
55
|
+
signedAt: IsoDateTime;
|
|
56
|
+
}
|
|
57
|
+
/** A setting used for the session, such as a fluence or a needle depth, as the specialist wrote it. */
|
|
58
|
+
export interface ClinicTreatmentParameter {
|
|
59
|
+
name: string;
|
|
60
|
+
value: string;
|
|
61
|
+
}
|
|
62
|
+
/** What was done at one session. It is never edited: a correction is a new entry pointing at it. */
|
|
63
|
+
export interface ClinicTreatmentLogEntry {
|
|
64
|
+
id: UUID;
|
|
65
|
+
appointmentId: UUID;
|
|
66
|
+
treatmentId: UUID;
|
|
67
|
+
treatmentName: LocalizedText;
|
|
68
|
+
specialistName: string;
|
|
69
|
+
parameters: ClinicTreatmentParameter[];
|
|
70
|
+
reaction: Nullable<string>;
|
|
71
|
+
notes: Nullable<string>;
|
|
72
|
+
/** Why the session went ahead despite a flagged screening answer. */
|
|
73
|
+
overrideReason: Nullable<string>;
|
|
74
|
+
correctsEntryId: Nullable<UUID>;
|
|
75
|
+
correctionReason: Nullable<string>;
|
|
76
|
+
/** The entry that replaced this one, or `null` while this is the one that stands. */
|
|
77
|
+
correctedByEntryId: Nullable<UUID>;
|
|
78
|
+
recordedByName: Nullable<string>;
|
|
79
|
+
createdAt: IsoDateTime;
|
|
80
|
+
}
|
|
81
|
+
export interface CreateClinicTreatmentLogEntryRequest {
|
|
82
|
+
parameters: ClinicTreatmentParameter[];
|
|
83
|
+
reaction?: Nullable<string>;
|
|
84
|
+
notes?: Nullable<string>;
|
|
85
|
+
/** Required when the latest screening has a flagged answer, and refused when it has none. */
|
|
86
|
+
overrideReason?: Nullable<string>;
|
|
87
|
+
}
|
|
88
|
+
export interface CorrectClinicTreatmentLogEntryRequest {
|
|
89
|
+
parameters: ClinicTreatmentParameter[];
|
|
90
|
+
reaction?: Nullable<string>;
|
|
91
|
+
notes?: Nullable<string>;
|
|
92
|
+
reason: string;
|
|
93
|
+
}
|
|
94
|
+
/** Everything a specialist needs in the room for one visit. */
|
|
95
|
+
export interface ClinicVisitRecord {
|
|
96
|
+
appointmentId: UUID;
|
|
97
|
+
clientId: UUID;
|
|
98
|
+
clientName: string;
|
|
99
|
+
treatmentId: UUID;
|
|
100
|
+
treatmentName: LocalizedText;
|
|
101
|
+
specialistName: string;
|
|
102
|
+
status: ClinicAppointmentStatus;
|
|
103
|
+
startsAt: IsoDateTime;
|
|
104
|
+
questions: ClinicScreeningQuestion[];
|
|
105
|
+
screening: Nullable<ClinicScreening>;
|
|
106
|
+
/** The form's current version, or `null` when this treatment has none. */
|
|
107
|
+
consentForm: Nullable<ClinicConsentForm>;
|
|
108
|
+
/** The signature of that version, or `null` when it has not been signed. */
|
|
109
|
+
consent: Nullable<ClinicConsentSignature>;
|
|
110
|
+
/** The session's entry and its corrections, oldest first. */
|
|
111
|
+
entries: ClinicTreatmentLogEntry[];
|
|
112
|
+
}
|
|
113
|
+
/** A client's whole history at this clinic, newest first. */
|
|
114
|
+
export interface ClinicClientRecord {
|
|
115
|
+
clientId: UUID;
|
|
116
|
+
clientName: string;
|
|
117
|
+
consents: ClinicConsentSignature[];
|
|
118
|
+
screenings: ClinicScreening[];
|
|
119
|
+
entries: ClinicTreatmentLogEntry[];
|
|
120
|
+
}
|
|
121
|
+
export interface ClinicRecordAccess {
|
|
122
|
+
id: UUID;
|
|
123
|
+
actorUserId: UUID;
|
|
124
|
+
/** The member of staff who read it, or `null` for an account that is not one. */
|
|
125
|
+
actorName: Nullable<string>;
|
|
126
|
+
appointmentId: Nullable<UUID>;
|
|
127
|
+
action: ClinicRecordAccessAction;
|
|
128
|
+
createdAt: IsoDateTime;
|
|
129
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { IsoDateTime } from '../../type/iso-date-time.type.js';
|
|
2
|
+
import type { Nullable } from '../../type/nil.type.js';
|
|
3
|
+
import type { UUID } from '../../type/uuid.type.js';
|
|
4
|
+
import type { LocalizedText } from './localized-text.type.js';
|
|
5
|
+
/** A yes or no question a treatment asks first. Which answer matters is the clinic's judgement. */
|
|
6
|
+
export interface ClinicScreeningQuestion {
|
|
7
|
+
id: UUID;
|
|
8
|
+
treatmentId: UUID;
|
|
9
|
+
text: LocalizedText;
|
|
10
|
+
/** The answer that rules the treatment out, or `null` when it is only for the specialist to read. */
|
|
11
|
+
stopsBookingOn: Nullable<boolean>;
|
|
12
|
+
sortOrder: number;
|
|
13
|
+
createdAt: IsoDateTime;
|
|
14
|
+
updatedAt: IsoDateTime;
|
|
15
|
+
}
|
|
16
|
+
export interface CreateClinicScreeningQuestionRequest {
|
|
17
|
+
text: LocalizedText;
|
|
18
|
+
stopsBookingOn?: Nullable<boolean>;
|
|
19
|
+
}
|
|
20
|
+
export interface UpdateClinicScreeningQuestionRequest {
|
|
21
|
+
text?: LocalizedText;
|
|
22
|
+
stopsBookingOn?: Nullable<boolean>;
|
|
23
|
+
sortOrder?: number;
|
|
24
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export * from './clinic-appointment-status.enum.js';
|
|
2
2
|
export * from './clinic-appointment.type.js';
|
|
3
3
|
export * from './clinic-client.type.js';
|
|
4
|
+
export * from './clinic-consent-form.type.js';
|
|
4
5
|
export * from './clinic-device.type.js';
|
|
5
6
|
export * from './clinic-lead-kind.enum.js';
|
|
6
7
|
export * from './clinic-lead-status.enum.js';
|
|
@@ -16,10 +17,14 @@ export * from './clinic-newsletter.type.js';
|
|
|
16
17
|
export * from './clinic-profile.type.js';
|
|
17
18
|
export * from './clinic-promotion.type.js';
|
|
18
19
|
export * from './clinic-public.type.js';
|
|
20
|
+
export * from './clinic-record-access-action.enum.js';
|
|
21
|
+
export * from './clinic-record-method.enum.js';
|
|
22
|
+
export * from './clinic-record.type.js';
|
|
19
23
|
export * from './clinic-resource-status.enum.js';
|
|
20
24
|
export * from './clinic-review-status.enum.js';
|
|
21
25
|
export * from './clinic-review.type.js';
|
|
22
26
|
export * from './clinic-room.type.js';
|
|
27
|
+
export * from './clinic-screening-question.type.js';
|
|
23
28
|
export * from './clinic-slot.type.js';
|
|
24
29
|
export * from './clinic-specialty.type.js';
|
|
25
30
|
export * from './clinic-staff.type.js';
|
package/dist/api/clinic/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export * from './clinic-appointment-status.enum.js';
|
|
2
2
|
export * from './clinic-appointment.type.js';
|
|
3
3
|
export * from './clinic-client.type.js';
|
|
4
|
+
export * from './clinic-consent-form.type.js';
|
|
4
5
|
export * from './clinic-device.type.js';
|
|
5
6
|
export * from './clinic-lead-kind.enum.js';
|
|
6
7
|
export * from './clinic-lead-status.enum.js';
|
|
@@ -16,10 +17,14 @@ export * from './clinic-newsletter.type.js';
|
|
|
16
17
|
export * from './clinic-profile.type.js';
|
|
17
18
|
export * from './clinic-promotion.type.js';
|
|
18
19
|
export * from './clinic-public.type.js';
|
|
20
|
+
export * from './clinic-record-access-action.enum.js';
|
|
21
|
+
export * from './clinic-record-method.enum.js';
|
|
22
|
+
export * from './clinic-record.type.js';
|
|
19
23
|
export * from './clinic-resource-status.enum.js';
|
|
20
24
|
export * from './clinic-review-status.enum.js';
|
|
21
25
|
export * from './clinic-review.type.js';
|
|
22
26
|
export * from './clinic-room.type.js';
|
|
27
|
+
export * from './clinic-screening-question.type.js';
|
|
23
28
|
export * from './clinic-slot.type.js';
|
|
24
29
|
export * from './clinic-specialty.type.js';
|
|
25
30
|
export * from './clinic-staff.type.js';
|
|
@@ -450,7 +450,13 @@ export declare enum UserPermission {
|
|
|
450
450
|
/** See what a clinic is promoting and publishing. */
|
|
451
451
|
CLINIC_MARKETING_READ = "clinic:marketing:read",
|
|
452
452
|
/** Change what a clinic is promoting and publishing, including its discounts. */
|
|
453
|
-
CLINIC_MARKETING_MANAGE = "clinic:marketing:manage"
|
|
453
|
+
CLINIC_MARKETING_MANAGE = "clinic:marketing:manage",
|
|
454
|
+
/** Read a client's clinical record. Reception runs the calendar without this. */
|
|
455
|
+
CLINIC_RECORD_READ = "clinic:record:read",
|
|
456
|
+
/** Add to a client's clinical record: screening answers, signed consent and the treatment log. */
|
|
457
|
+
CLINIC_RECORD_MANAGE = "clinic:record:manage",
|
|
458
|
+
/** See who has read a client's clinical record, which reading the record does not show. */
|
|
459
|
+
CLINIC_RECORD_AUDIT = "clinic:record:audit"
|
|
454
460
|
}
|
|
455
461
|
/**
|
|
456
462
|
* Every member, for seeding the owner role and validating custom-role input.
|
|
@@ -513,6 +513,12 @@ export var UserPermission;
|
|
|
513
513
|
UserPermission["CLINIC_MARKETING_READ"] = "clinic:marketing:read";
|
|
514
514
|
/** Change what a clinic is promoting and publishing, including its discounts. */
|
|
515
515
|
UserPermission["CLINIC_MARKETING_MANAGE"] = "clinic:marketing:manage";
|
|
516
|
+
/** Read a client's clinical record. Reception runs the calendar without this. */
|
|
517
|
+
UserPermission["CLINIC_RECORD_READ"] = "clinic:record:read";
|
|
518
|
+
/** Add to a client's clinical record: screening answers, signed consent and the treatment log. */
|
|
519
|
+
UserPermission["CLINIC_RECORD_MANAGE"] = "clinic:record:manage";
|
|
520
|
+
/** See who has read a client's clinical record, which reading the record does not show. */
|
|
521
|
+
UserPermission["CLINIC_RECORD_AUDIT"] = "clinic:record:audit";
|
|
516
522
|
})(UserPermission || (UserPermission = {}));
|
|
517
523
|
/**
|
|
518
524
|
* Every member, for seeding the owner role and validating custom-role input.
|