@iveri/contracts 0.47.0 → 0.49.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-course.type.d.ts +68 -0
- package/dist/api/clinic/clinic-course.type.js +1 -0
- package/dist/api/clinic/clinic-my-appointment.type.d.ts +12 -0
- package/dist/api/clinic/clinic-payment-method.enum.d.ts +13 -0
- package/dist/api/clinic/clinic-payment-method.enum.js +14 -0
- package/dist/api/clinic/clinic-payment.type.d.ts +112 -0
- package/dist/api/clinic/clinic-payment.type.js +1 -0
- package/dist/api/clinic/clinic-profile.type.d.ts +3 -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 +8 -0
- package/dist/api/clinic/index.js +8 -0
- package/dist/enum/user-permission.enum.d.ts +13 -1
- package/dist/enum/user-permission.enum.js +12 -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 {};
|
|
@@ -0,0 +1,68 @@
|
|
|
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 { ClinicPaymentMethod } from './clinic-payment-method.enum.js';
|
|
5
|
+
import type { ClinicResourceStatus } from './clinic-resource-status.enum.js';
|
|
6
|
+
import type { LocalizedText } from './localized-text.type.js';
|
|
7
|
+
/** A prepaid package the clinic offers: so many sessions of one option at one price. */
|
|
8
|
+
export interface ClinicCoursePlan {
|
|
9
|
+
id: UUID;
|
|
10
|
+
treatmentId: UUID;
|
|
11
|
+
optionId: UUID;
|
|
12
|
+
name: LocalizedText;
|
|
13
|
+
sessionCount: number;
|
|
14
|
+
priceMinor: number;
|
|
15
|
+
currency: string;
|
|
16
|
+
/** How long a sold course lasts, or `null` when it does not run out. */
|
|
17
|
+
validityDays: Nullable<number>;
|
|
18
|
+
status: ClinicResourceStatus;
|
|
19
|
+
createdAt: IsoDateTime;
|
|
20
|
+
updatedAt: IsoDateTime;
|
|
21
|
+
}
|
|
22
|
+
export interface CreateClinicCoursePlanRequest {
|
|
23
|
+
optionId: UUID;
|
|
24
|
+
name: LocalizedText;
|
|
25
|
+
sessionCount: number;
|
|
26
|
+
priceMinor: number;
|
|
27
|
+
validityDays?: Nullable<number>;
|
|
28
|
+
}
|
|
29
|
+
export interface UpdateClinicCoursePlanRequest {
|
|
30
|
+
name?: LocalizedText;
|
|
31
|
+
sessionCount?: number;
|
|
32
|
+
priceMinor?: number;
|
|
33
|
+
validityDays?: Nullable<number>;
|
|
34
|
+
status?: ClinicResourceStatus;
|
|
35
|
+
}
|
|
36
|
+
/** A course a client has bought, holding what was agreed then. A later change to the plan does not touch it. */
|
|
37
|
+
export interface ClinicCourse {
|
|
38
|
+
id: UUID;
|
|
39
|
+
clientId: UUID;
|
|
40
|
+
planId: UUID;
|
|
41
|
+
treatmentId: UUID;
|
|
42
|
+
optionId: UUID;
|
|
43
|
+
name: LocalizedText;
|
|
44
|
+
sessionsTotal: number;
|
|
45
|
+
sessionsUsed: number;
|
|
46
|
+
priceMinor: number;
|
|
47
|
+
currency: string;
|
|
48
|
+
expiresAt: Nullable<IsoDateTime>;
|
|
49
|
+
/** Set when the course was refunded, after which its remaining sessions are gone. */
|
|
50
|
+
closedAt: Nullable<IsoDateTime>;
|
|
51
|
+
createdAt: IsoDateTime;
|
|
52
|
+
}
|
|
53
|
+
export interface SellClinicCourseRequest {
|
|
54
|
+
planId: UUID;
|
|
55
|
+
locationId: UUID;
|
|
56
|
+
method: ClinicPaymentMethod;
|
|
57
|
+
note?: Nullable<string>;
|
|
58
|
+
}
|
|
59
|
+
/** A client's own view of a course they bought. */
|
|
60
|
+
export interface MyClinicCourse {
|
|
61
|
+
id: UUID;
|
|
62
|
+
treatmentId: UUID;
|
|
63
|
+
name: LocalizedText;
|
|
64
|
+
sessionsTotal: number;
|
|
65
|
+
sessionsUsed: number;
|
|
66
|
+
expiresAt: Nullable<IsoDateTime>;
|
|
67
|
+
isClosed: boolean;
|
|
68
|
+
}
|
|
@@ -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;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* How a visit was paid for. The first three are money the clinic received.
|
|
3
|
+
*
|
|
4
|
+
* `course` and `bonus` settle a visit without any money changing hands that day, so a day's takings
|
|
5
|
+
* keep them apart: the money for a course came in on the day it was sold.
|
|
6
|
+
*/
|
|
7
|
+
export declare enum ClinicPaymentMethod {
|
|
8
|
+
CASH = "cash",
|
|
9
|
+
CARD = "card",
|
|
10
|
+
TRANSFER = "transfer",
|
|
11
|
+
COURSE = "course",
|
|
12
|
+
BONUS = "bonus"
|
|
13
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* How a visit was paid for. The first three are money the clinic received.
|
|
3
|
+
*
|
|
4
|
+
* `course` and `bonus` settle a visit without any money changing hands that day, so a day's takings
|
|
5
|
+
* keep them apart: the money for a course came in on the day it was sold.
|
|
6
|
+
*/
|
|
7
|
+
export var ClinicPaymentMethod;
|
|
8
|
+
(function (ClinicPaymentMethod) {
|
|
9
|
+
ClinicPaymentMethod["CASH"] = "cash";
|
|
10
|
+
ClinicPaymentMethod["CARD"] = "card";
|
|
11
|
+
ClinicPaymentMethod["TRANSFER"] = "transfer";
|
|
12
|
+
ClinicPaymentMethod["COURSE"] = "course";
|
|
13
|
+
ClinicPaymentMethod["BONUS"] = "bonus";
|
|
14
|
+
})(ClinicPaymentMethod || (ClinicPaymentMethod = {}));
|
|
@@ -0,0 +1,112 @@
|
|
|
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 { ClinicCourse, MyClinicCourse } from './clinic-course.type.js';
|
|
6
|
+
import type { ClinicPaymentMethod } from './clinic-payment-method.enum.js';
|
|
7
|
+
import type { LocalizedText } from './localized-text.type.js';
|
|
8
|
+
/** One line in the clinic's ledger. It is never edited: money given back is a new line pointing at it. */
|
|
9
|
+
export interface ClinicPayment {
|
|
10
|
+
id: UUID;
|
|
11
|
+
locationId: UUID;
|
|
12
|
+
clientId: UUID;
|
|
13
|
+
clientName: string;
|
|
14
|
+
/** The visit this was for, or `null` when it paid for a course. */
|
|
15
|
+
appointmentId: Nullable<UUID>;
|
|
16
|
+
/** The course this sold or used, or `null` when no course was involved. */
|
|
17
|
+
courseId: Nullable<UUID>;
|
|
18
|
+
method: ClinicPaymentMethod;
|
|
19
|
+
/** Negative for a refund. */
|
|
20
|
+
amountMinor: number;
|
|
21
|
+
currency: string;
|
|
22
|
+
refundsPaymentId: Nullable<UUID>;
|
|
23
|
+
/** Why money was given back. Only a refund has one. */
|
|
24
|
+
reason: Nullable<string>;
|
|
25
|
+
note: Nullable<string>;
|
|
26
|
+
/** How much of this can still be given back. Always zero on a refund. */
|
|
27
|
+
refundableMinor: number;
|
|
28
|
+
recordedByName: Nullable<string>;
|
|
29
|
+
createdAt: IsoDateTime;
|
|
30
|
+
}
|
|
31
|
+
export interface RecordClinicPaymentRequest {
|
|
32
|
+
method: ClinicPaymentMethod;
|
|
33
|
+
/** Required except for a course, whose session is worth what its line on the visit costs. */
|
|
34
|
+
amountMinor?: number;
|
|
35
|
+
/** Required for a course. */
|
|
36
|
+
courseId?: UUID;
|
|
37
|
+
note?: Nullable<string>;
|
|
38
|
+
}
|
|
39
|
+
export interface RefundClinicPaymentRequest {
|
|
40
|
+
/** Omitted to give back everything left. A course session or bonus is always given back whole. */
|
|
41
|
+
amountMinor?: number;
|
|
42
|
+
reason: string;
|
|
43
|
+
}
|
|
44
|
+
export interface ClinicBonusBalance {
|
|
45
|
+
currency: string;
|
|
46
|
+
amountMinor: number;
|
|
47
|
+
}
|
|
48
|
+
/** What reception needs at the desk for one visit. */
|
|
49
|
+
export interface ClinicVisitPayments {
|
|
50
|
+
appointmentId: UUID;
|
|
51
|
+
clientId: UUID;
|
|
52
|
+
clientName: string;
|
|
53
|
+
locationId: UUID;
|
|
54
|
+
treatmentName: LocalizedText;
|
|
55
|
+
status: ClinicAppointmentStatus;
|
|
56
|
+
currency: string;
|
|
57
|
+
totalMinor: number;
|
|
58
|
+
paidMinor: number;
|
|
59
|
+
dueMinor: number;
|
|
60
|
+
payments: ClinicPayment[];
|
|
61
|
+
/** This client's bonus in the visit's currency. */
|
|
62
|
+
bonusBalanceMinor: number;
|
|
63
|
+
/** This client's courses that can pay for a line of this visit. */
|
|
64
|
+
usableCourses: ClinicCourse[];
|
|
65
|
+
}
|
|
66
|
+
/** How much has been paid towards one visit. */
|
|
67
|
+
export interface ClinicVisitBalance {
|
|
68
|
+
appointmentId: UUID;
|
|
69
|
+
paidMinor: number;
|
|
70
|
+
}
|
|
71
|
+
export interface ClinicClientAccount {
|
|
72
|
+
clientId: UUID;
|
|
73
|
+
clientName: string;
|
|
74
|
+
bonusBalances: ClinicBonusBalance[];
|
|
75
|
+
courses: ClinicCourse[];
|
|
76
|
+
/** The newest payments, whatever they were for. */
|
|
77
|
+
payments: ClinicPayment[];
|
|
78
|
+
}
|
|
79
|
+
/** One currency's day. The three money figures are net of refunds, so cash is what the drawer should hold. */
|
|
80
|
+
export interface ClinicTakingsLine {
|
|
81
|
+
currency: string;
|
|
82
|
+
cashMinor: number;
|
|
83
|
+
cardMinor: number;
|
|
84
|
+
transferMinor: number;
|
|
85
|
+
netMinor: number;
|
|
86
|
+
refundedMinor: number;
|
|
87
|
+
courseRedeemedMinor: number;
|
|
88
|
+
bonusSpentMinor: number;
|
|
89
|
+
}
|
|
90
|
+
/** A visit that finished with money still owing. */
|
|
91
|
+
export interface ClinicUnsettledVisit {
|
|
92
|
+
appointmentId: UUID;
|
|
93
|
+
clientName: string;
|
|
94
|
+
treatmentName: LocalizedText;
|
|
95
|
+
currency: string;
|
|
96
|
+
totalMinor: number;
|
|
97
|
+
paidMinor: number;
|
|
98
|
+
dueMinor: number;
|
|
99
|
+
}
|
|
100
|
+
export interface ClinicDailyTakings {
|
|
101
|
+
locationId: UUID;
|
|
102
|
+
/** The branch's own calendar day, `YYYY-MM-DD`. */
|
|
103
|
+
date: string;
|
|
104
|
+
lines: ClinicTakingsLine[];
|
|
105
|
+
payments: ClinicPayment[];
|
|
106
|
+
unsettled: ClinicUnsettledVisit[];
|
|
107
|
+
}
|
|
108
|
+
/** What a client holds at this clinic. */
|
|
109
|
+
export interface MyClinicWallet {
|
|
110
|
+
bonusBalances: ClinicBonusBalance[];
|
|
111
|
+
courses: MyClinicCourse[];
|
|
112
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -19,6 +19,8 @@ export interface ClinicProfile {
|
|
|
19
19
|
clientCancelCutoffHours: number;
|
|
20
20
|
/** How far ahead a client can book. */
|
|
21
21
|
bookingHorizonDays: number;
|
|
22
|
+
/** The share of money paid that comes back as bonus. Zero means the clinic runs no bonus programme. */
|
|
23
|
+
bonusEarnPercent: number;
|
|
22
24
|
createdAt: IsoDateTime;
|
|
23
25
|
updatedAt: IsoDateTime;
|
|
24
26
|
}
|
|
@@ -32,4 +34,5 @@ export interface SaveClinicProfileRequest {
|
|
|
32
34
|
isPublished: boolean;
|
|
33
35
|
clientCancelCutoffHours: number;
|
|
34
36
|
bookingHorizonDays: number;
|
|
37
|
+
bonusEarnPercent?: number;
|
|
35
38
|
}
|
|
@@ -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,8 @@
|
|
|
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';
|
|
5
|
+
export * from './clinic-course.type.js';
|
|
4
6
|
export * from './clinic-device.type.js';
|
|
5
7
|
export * from './clinic-lead-kind.enum.js';
|
|
6
8
|
export * from './clinic-lead-status.enum.js';
|
|
@@ -13,13 +15,19 @@ export * from './clinic-gallery.type.js';
|
|
|
13
15
|
export * from './clinic-media.type.js';
|
|
14
16
|
export * from './clinic-newsletter-channel.enum.js';
|
|
15
17
|
export * from './clinic-newsletter.type.js';
|
|
18
|
+
export * from './clinic-payment-method.enum.js';
|
|
19
|
+
export * from './clinic-payment.type.js';
|
|
16
20
|
export * from './clinic-profile.type.js';
|
|
17
21
|
export * from './clinic-promotion.type.js';
|
|
18
22
|
export * from './clinic-public.type.js';
|
|
23
|
+
export * from './clinic-record-access-action.enum.js';
|
|
24
|
+
export * from './clinic-record-method.enum.js';
|
|
25
|
+
export * from './clinic-record.type.js';
|
|
19
26
|
export * from './clinic-resource-status.enum.js';
|
|
20
27
|
export * from './clinic-review-status.enum.js';
|
|
21
28
|
export * from './clinic-review.type.js';
|
|
22
29
|
export * from './clinic-room.type.js';
|
|
30
|
+
export * from './clinic-screening-question.type.js';
|
|
23
31
|
export * from './clinic-slot.type.js';
|
|
24
32
|
export * from './clinic-specialty.type.js';
|
|
25
33
|
export * from './clinic-staff.type.js';
|
package/dist/api/clinic/index.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
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';
|
|
5
|
+
export * from './clinic-course.type.js';
|
|
4
6
|
export * from './clinic-device.type.js';
|
|
5
7
|
export * from './clinic-lead-kind.enum.js';
|
|
6
8
|
export * from './clinic-lead-status.enum.js';
|
|
@@ -13,13 +15,19 @@ export * from './clinic-gallery.type.js';
|
|
|
13
15
|
export * from './clinic-media.type.js';
|
|
14
16
|
export * from './clinic-newsletter-channel.enum.js';
|
|
15
17
|
export * from './clinic-newsletter.type.js';
|
|
18
|
+
export * from './clinic-payment-method.enum.js';
|
|
19
|
+
export * from './clinic-payment.type.js';
|
|
16
20
|
export * from './clinic-profile.type.js';
|
|
17
21
|
export * from './clinic-promotion.type.js';
|
|
18
22
|
export * from './clinic-public.type.js';
|
|
23
|
+
export * from './clinic-record-access-action.enum.js';
|
|
24
|
+
export * from './clinic-record-method.enum.js';
|
|
25
|
+
export * from './clinic-record.type.js';
|
|
19
26
|
export * from './clinic-resource-status.enum.js';
|
|
20
27
|
export * from './clinic-review-status.enum.js';
|
|
21
28
|
export * from './clinic-review.type.js';
|
|
22
29
|
export * from './clinic-room.type.js';
|
|
30
|
+
export * from './clinic-screening-question.type.js';
|
|
23
31
|
export * from './clinic-slot.type.js';
|
|
24
32
|
export * from './clinic-specialty.type.js';
|
|
25
33
|
export * from './clinic-staff.type.js';
|
|
@@ -450,7 +450,19 @@ 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",
|
|
460
|
+
/** See what has been paid, each client's balance and the day's takings. */
|
|
461
|
+
CLINIC_PAYMENT_READ = "clinic:payment:read",
|
|
462
|
+
/** Record money taken at the desk and sell prepaid courses. */
|
|
463
|
+
CLINIC_PAYMENT_RECORD = "clinic:payment:record",
|
|
464
|
+
/** Give money back. Its own permission, because reception taking money does not imply returning it. */
|
|
465
|
+
CLINIC_PAYMENT_REFUND = "clinic:payment:refund"
|
|
454
466
|
}
|
|
455
467
|
/**
|
|
456
468
|
* Every member, for seeding the owner role and validating custom-role input.
|
|
@@ -513,6 +513,18 @@ 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";
|
|
522
|
+
/** See what has been paid, each client's balance and the day's takings. */
|
|
523
|
+
UserPermission["CLINIC_PAYMENT_READ"] = "clinic:payment:read";
|
|
524
|
+
/** Record money taken at the desk and sell prepaid courses. */
|
|
525
|
+
UserPermission["CLINIC_PAYMENT_RECORD"] = "clinic:payment:record";
|
|
526
|
+
/** Give money back. Its own permission, because reception taking money does not imply returning it. */
|
|
527
|
+
UserPermission["CLINIC_PAYMENT_REFUND"] = "clinic:payment:refund";
|
|
516
528
|
})(UserPermission || (UserPermission = {}));
|
|
517
529
|
/**
|
|
518
530
|
* Every member, for seeding the owner role and validating custom-role input.
|