@candesk/contracts 6.70.0 → 6.72.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.
@@ -1,7 +1,9 @@
1
1
  export * from './medication-wish-changed.interface';
2
2
  export * from './treatment.events';
3
+ export * from './treatment-request-approved.interface';
3
4
  export * from './treatment-request-expired.interface';
4
5
  export * from './treatment-request-paid.interface';
5
6
  export * from './treatment-request-refunded.interface';
7
+ export * from './treatment-request-rejected.interface';
6
8
  export * from './withdrawal-received.interface';
7
9
  export * from './withdrawal-rejected.interface';
@@ -16,8 +16,10 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./medication-wish-changed.interface"), exports);
18
18
  __exportStar(require("./treatment.events"), exports);
19
+ __exportStar(require("./treatment-request-approved.interface"), exports);
19
20
  __exportStar(require("./treatment-request-expired.interface"), exports);
20
21
  __exportStar(require("./treatment-request-paid.interface"), exports);
21
22
  __exportStar(require("./treatment-request-refunded.interface"), exports);
23
+ __exportStar(require("./treatment-request-rejected.interface"), exports);
22
24
  __exportStar(require("./withdrawal-received.interface"), exports);
23
25
  __exportStar(require("./withdrawal-rejected.interface"), exports);
@@ -0,0 +1,7 @@
1
+ export interface TreatmentRequestApprovedEvent {
2
+ eventId: string;
3
+ accountId: string;
4
+ email: string;
5
+ firstName?: string;
6
+ number: string;
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,7 @@
1
+ export interface TreatmentRequestRejectedEvent {
2
+ eventId: string;
3
+ accountId: string;
4
+ email: string;
5
+ firstName?: string;
6
+ number: string;
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -5,4 +5,6 @@ export declare const TREATMENT_EVENTS: {
5
5
  readonly WITHDRAWAL_RECEIVED: 'treatment.withdrawal.received';
6
6
  readonly WITHDRAWAL_REJECTED: 'treatment.withdrawal.rejected';
7
7
  readonly REQUEST_REFUNDED: 'treatment.request.refunded';
8
+ readonly REQUEST_APPROVED: 'treatment.request.approved';
9
+ readonly REQUEST_REJECTED: 'treatment.request.rejected';
8
10
  };
@@ -7,5 +7,7 @@ exports.TREATMENT_EVENTS = {
7
7
  MEDICATION_WISH_CHANGED: 'treatment.medication-wish.changed',
8
8
  WITHDRAWAL_RECEIVED: 'treatment.withdrawal.received',
9
9
  WITHDRAWAL_REJECTED: 'treatment.withdrawal.rejected',
10
- REQUEST_REFUNDED: 'treatment.request.refunded'
10
+ REQUEST_REFUNDED: 'treatment.request.refunded',
11
+ REQUEST_APPROVED: 'treatment.request.approved',
12
+ REQUEST_REJECTED: 'treatment.request.rejected'
11
13
  };
@@ -20,6 +20,8 @@ export declare enum NotificationType {
20
20
  NOTIFICATION_TYPE_COMMENT_REJECTED = 16,
21
21
  NOTIFICATION_TYPE_TREATMENT_REQUEST_REFUNDED = 17,
22
22
  NOTIFICATION_TYPE_WITHDRAWAL_REJECTED = 18,
23
+ NOTIFICATION_TYPE_TREATMENT_REQUEST_APPROVED = 19,
24
+ NOTIFICATION_TYPE_TREATMENT_REQUEST_REJECTED = 20,
23
25
  UNRECOGNIZED = -1
24
26
  }
25
27
  export interface Notification {
@@ -30,5 +30,7 @@ var NotificationType;
30
30
  NotificationType[NotificationType["NOTIFICATION_TYPE_COMMENT_REJECTED"] = 16] = "NOTIFICATION_TYPE_COMMENT_REJECTED";
31
31
  NotificationType[NotificationType["NOTIFICATION_TYPE_TREATMENT_REQUEST_REFUNDED"] = 17] = "NOTIFICATION_TYPE_TREATMENT_REQUEST_REFUNDED";
32
32
  NotificationType[NotificationType["NOTIFICATION_TYPE_WITHDRAWAL_REJECTED"] = 18] = "NOTIFICATION_TYPE_WITHDRAWAL_REJECTED";
33
+ NotificationType[NotificationType["NOTIFICATION_TYPE_TREATMENT_REQUEST_APPROVED"] = 19] = "NOTIFICATION_TYPE_TREATMENT_REQUEST_APPROVED";
34
+ NotificationType[NotificationType["NOTIFICATION_TYPE_TREATMENT_REQUEST_REJECTED"] = 20] = "NOTIFICATION_TYPE_TREATMENT_REQUEST_REJECTED";
33
35
  NotificationType[NotificationType["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
34
36
  })(NotificationType || (exports.NotificationType = NotificationType = {}));
@@ -54,6 +54,22 @@ export declare enum TreatmentRequestStatus {
54
54
  TREATMENT_REQUEST_STATUS_REFUND_PENDING = 5,
55
55
  TREATMENT_REQUEST_STATUS_REFUND_FAILED = 6,
56
56
  TREATMENT_REQUEST_STATUS_REFUNDED = 7,
57
+ TREATMENT_REQUEST_STATUS_IN_REVIEW = 8,
58
+ TREATMENT_REQUEST_STATUS_APPROVED = 9,
59
+ UNRECOGNIZED = -1
60
+ }
61
+ export declare enum MedicalRejectionReason {
62
+ MEDICAL_REJECTION_REASON_UNSPECIFIED = 0,
63
+ MEDICAL_REJECTION_REASON_EXCLUSION_CRITERIA = 1,
64
+ MEDICAL_REJECTION_REASON_NO_INDICATION = 2,
65
+ MEDICAL_REJECTION_REASON_OTHER = 3,
66
+ UNRECOGNIZED = -1
67
+ }
68
+ export declare enum MedicalReviewScope {
69
+ MEDICAL_REVIEW_SCOPE_UNSPECIFIED = 0,
70
+ MEDICAL_REVIEW_SCOPE_QUEUE = 1,
71
+ MEDICAL_REVIEW_SCOPE_IN_REVIEW = 2,
72
+ MEDICAL_REVIEW_SCOPE_DONE = 3,
57
73
  UNRECOGNIZED = -1
58
74
  }
59
75
  export declare enum WithdrawalStatus {
@@ -142,6 +158,17 @@ export interface TreatmentRequest {
142
158
  intakeMethods: IntakeMethod[];
143
159
  refundedAt?: string | undefined;
144
160
  withdrawal?: Withdrawal | undefined;
161
+ doctorId?: string | undefined;
162
+ doctorName?: string | undefined;
163
+ reviewStartedAt?: string | undefined;
164
+ decidedAt?: string | undefined;
165
+ rejectionReason?: MedicalRejectionReason | undefined;
166
+ rejectionText?: string | undefined;
167
+ }
168
+ export interface PatientSnapshot {
169
+ firstName: string;
170
+ lastName: string;
171
+ birthDate: string;
145
172
  }
146
173
  export interface GetQuestionnaireRequest {
147
174
  userId: string;
@@ -286,6 +313,73 @@ export interface RejectWithdrawalRequest {
286
313
  export interface RejectWithdrawalResponse {
287
314
  item: WithdrawalItem | undefined;
288
315
  }
316
+ export interface ListMedicalReviewsRequest {
317
+ doctorId: string;
318
+ scope: MedicalReviewScope;
319
+ cursor?: string | undefined;
320
+ limit: number;
321
+ allDoctors?: boolean | undefined;
322
+ }
323
+ export interface ListMedicalReviewsResponse {
324
+ requests: TreatmentRequest[];
325
+ nextCursor?: string | undefined;
326
+ total: number;
327
+ }
328
+ export interface CountMedicalReviewsRequest {
329
+ doctorId: string;
330
+ allDoctors?: boolean | undefined;
331
+ }
332
+ export interface CountMedicalReviewsResponse {
333
+ queue: number;
334
+ inReview: number;
335
+ }
336
+ export interface GetMedicalReviewRequest {
337
+ id: string;
338
+ doctorId: string;
339
+ allDoctors?: boolean | undefined;
340
+ }
341
+ export interface GetMedicalReviewResponse {
342
+ request: TreatmentRequest | undefined;
343
+ answers: QuestionnaireAnswers | undefined;
344
+ patientSnapshot?: PatientSnapshot | undefined;
345
+ previous: TreatmentRequest[];
346
+ }
347
+ export interface TakeMedicalReviewRequest {
348
+ id: string;
349
+ doctorId: string;
350
+ doctorName: string;
351
+ }
352
+ export interface TakeMedicalReviewResponse {
353
+ request: TreatmentRequest | undefined;
354
+ }
355
+ export interface ApproveMedicalReviewRequest {
356
+ id: string;
357
+ doctorId: string;
358
+ }
359
+ export interface ApproveMedicalReviewResponse {
360
+ request: TreatmentRequest | undefined;
361
+ }
362
+ export interface RejectMedicalReviewRequest {
363
+ id: string;
364
+ doctorId: string;
365
+ reason: MedicalRejectionReason;
366
+ text?: string | undefined;
367
+ }
368
+ export interface RejectMedicalReviewResponse {
369
+ request: TreatmentRequest | undefined;
370
+ }
371
+ export interface ReleaseMedicalReviewRequest {
372
+ id: string;
373
+ }
374
+ export interface ReleaseMedicalReviewResponse {
375
+ request: TreatmentRequest | undefined;
376
+ }
377
+ export interface RetryRefundRequest {
378
+ id: string;
379
+ }
380
+ export interface RetryRefundResponse {
381
+ request: TreatmentRequest | undefined;
382
+ }
289
383
  export interface TreatmentService {
290
384
  getQuestionnaire(request: GetQuestionnaireRequest): Promise<GetQuestionnaireResponse>;
291
385
  saveQuestionnaire(request: SaveQuestionnaireRequest): Promise<SaveQuestionnaireResponse>;
@@ -305,4 +399,12 @@ export interface TreatmentService {
305
399
  countPendingWithdrawals(request: CountPendingWithdrawalsRequest): Promise<CountPendingWithdrawalsResponse>;
306
400
  refundWithdrawal(request: RefundWithdrawalRequest): Promise<RefundWithdrawalResponse>;
307
401
  rejectWithdrawal(request: RejectWithdrawalRequest): Promise<RejectWithdrawalResponse>;
402
+ listMedicalReviews(request: ListMedicalReviewsRequest): Promise<ListMedicalReviewsResponse>;
403
+ countMedicalReviews(request: CountMedicalReviewsRequest): Promise<CountMedicalReviewsResponse>;
404
+ getMedicalReview(request: GetMedicalReviewRequest): Promise<GetMedicalReviewResponse>;
405
+ takeMedicalReview(request: TakeMedicalReviewRequest): Promise<TakeMedicalReviewResponse>;
406
+ approveMedicalReview(request: ApproveMedicalReviewRequest): Promise<ApproveMedicalReviewResponse>;
407
+ rejectMedicalReview(request: RejectMedicalReviewRequest): Promise<RejectMedicalReviewResponse>;
408
+ releaseMedicalReview(request: ReleaseMedicalReviewRequest): Promise<ReleaseMedicalReviewResponse>;
409
+ retryRefund(request: RetryRefundRequest): Promise<RetryRefundResponse>;
308
410
  }
@@ -5,7 +5,7 @@
5
5
  // protoc v3.21.12
6
6
  // source: treatment.proto
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
8
- exports.WithdrawalRejectionReason = exports.WithdrawalStatus = exports.TreatmentRequestStatus = exports.TreatmentType = exports.ProductType = exports.IntakeMethod = exports.SymptomDuration = exports.Symptom = exports.QuestionnaireStatus = exports.protobufFileName = exports.protobufPackage = void 0;
8
+ exports.WithdrawalRejectionReason = exports.WithdrawalStatus = exports.MedicalReviewScope = exports.MedicalRejectionReason = exports.TreatmentRequestStatus = exports.TreatmentType = exports.ProductType = exports.IntakeMethod = exports.SymptomDuration = exports.Symptom = exports.QuestionnaireStatus = exports.protobufFileName = exports.protobufPackage = void 0;
9
9
  /* eslint-disable */
10
10
  exports.protobufPackage = "treatment.v1";
11
11
  exports.protobufFileName = "treatment.proto";
@@ -70,8 +70,26 @@ var TreatmentRequestStatus;
70
70
  TreatmentRequestStatus[TreatmentRequestStatus["TREATMENT_REQUEST_STATUS_REFUND_PENDING"] = 5] = "TREATMENT_REQUEST_STATUS_REFUND_PENDING";
71
71
  TreatmentRequestStatus[TreatmentRequestStatus["TREATMENT_REQUEST_STATUS_REFUND_FAILED"] = 6] = "TREATMENT_REQUEST_STATUS_REFUND_FAILED";
72
72
  TreatmentRequestStatus[TreatmentRequestStatus["TREATMENT_REQUEST_STATUS_REFUNDED"] = 7] = "TREATMENT_REQUEST_STATUS_REFUNDED";
73
+ TreatmentRequestStatus[TreatmentRequestStatus["TREATMENT_REQUEST_STATUS_IN_REVIEW"] = 8] = "TREATMENT_REQUEST_STATUS_IN_REVIEW";
74
+ TreatmentRequestStatus[TreatmentRequestStatus["TREATMENT_REQUEST_STATUS_APPROVED"] = 9] = "TREATMENT_REQUEST_STATUS_APPROVED";
73
75
  TreatmentRequestStatus[TreatmentRequestStatus["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
74
76
  })(TreatmentRequestStatus || (exports.TreatmentRequestStatus = TreatmentRequestStatus = {}));
77
+ var MedicalRejectionReason;
78
+ (function (MedicalRejectionReason) {
79
+ MedicalRejectionReason[MedicalRejectionReason["MEDICAL_REJECTION_REASON_UNSPECIFIED"] = 0] = "MEDICAL_REJECTION_REASON_UNSPECIFIED";
80
+ MedicalRejectionReason[MedicalRejectionReason["MEDICAL_REJECTION_REASON_EXCLUSION_CRITERIA"] = 1] = "MEDICAL_REJECTION_REASON_EXCLUSION_CRITERIA";
81
+ MedicalRejectionReason[MedicalRejectionReason["MEDICAL_REJECTION_REASON_NO_INDICATION"] = 2] = "MEDICAL_REJECTION_REASON_NO_INDICATION";
82
+ MedicalRejectionReason[MedicalRejectionReason["MEDICAL_REJECTION_REASON_OTHER"] = 3] = "MEDICAL_REJECTION_REASON_OTHER";
83
+ MedicalRejectionReason[MedicalRejectionReason["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
84
+ })(MedicalRejectionReason || (exports.MedicalRejectionReason = MedicalRejectionReason = {}));
85
+ var MedicalReviewScope;
86
+ (function (MedicalReviewScope) {
87
+ MedicalReviewScope[MedicalReviewScope["MEDICAL_REVIEW_SCOPE_UNSPECIFIED"] = 0] = "MEDICAL_REVIEW_SCOPE_UNSPECIFIED";
88
+ MedicalReviewScope[MedicalReviewScope["MEDICAL_REVIEW_SCOPE_QUEUE"] = 1] = "MEDICAL_REVIEW_SCOPE_QUEUE";
89
+ MedicalReviewScope[MedicalReviewScope["MEDICAL_REVIEW_SCOPE_IN_REVIEW"] = 2] = "MEDICAL_REVIEW_SCOPE_IN_REVIEW";
90
+ MedicalReviewScope[MedicalReviewScope["MEDICAL_REVIEW_SCOPE_DONE"] = 3] = "MEDICAL_REVIEW_SCOPE_DONE";
91
+ MedicalReviewScope[MedicalReviewScope["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
92
+ })(MedicalReviewScope || (exports.MedicalReviewScope = MedicalReviewScope = {}));
75
93
  var WithdrawalStatus;
76
94
  (function (WithdrawalStatus) {
77
95
  WithdrawalStatus[WithdrawalStatus["WITHDRAWAL_STATUS_UNSPECIFIED"] = 0] = "WITHDRAWAL_STATUS_UNSPECIFIED";
@@ -21,6 +21,8 @@ export declare enum NotificationType {
21
21
  NOTIFICATION_TYPE_COMMENT_REJECTED = 16,
22
22
  NOTIFICATION_TYPE_TREATMENT_REQUEST_REFUNDED = 17,
23
23
  NOTIFICATION_TYPE_WITHDRAWAL_REJECTED = 18,
24
+ NOTIFICATION_TYPE_TREATMENT_REQUEST_APPROVED = 19,
25
+ NOTIFICATION_TYPE_TREATMENT_REQUEST_REJECTED = 20,
24
26
  UNRECOGNIZED = -1
25
27
  }
26
28
  export interface Notification {
@@ -32,6 +32,8 @@ var NotificationType;
32
32
  NotificationType[NotificationType["NOTIFICATION_TYPE_COMMENT_REJECTED"] = 16] = "NOTIFICATION_TYPE_COMMENT_REJECTED";
33
33
  NotificationType[NotificationType["NOTIFICATION_TYPE_TREATMENT_REQUEST_REFUNDED"] = 17] = "NOTIFICATION_TYPE_TREATMENT_REQUEST_REFUNDED";
34
34
  NotificationType[NotificationType["NOTIFICATION_TYPE_WITHDRAWAL_REJECTED"] = 18] = "NOTIFICATION_TYPE_WITHDRAWAL_REJECTED";
35
+ NotificationType[NotificationType["NOTIFICATION_TYPE_TREATMENT_REQUEST_APPROVED"] = 19] = "NOTIFICATION_TYPE_TREATMENT_REQUEST_APPROVED";
36
+ NotificationType[NotificationType["NOTIFICATION_TYPE_TREATMENT_REQUEST_REJECTED"] = 20] = "NOTIFICATION_TYPE_TREATMENT_REQUEST_REJECTED";
35
37
  NotificationType[NotificationType["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
36
38
  })(NotificationType || (exports.NotificationType = NotificationType = {}));
37
39
  exports.NOTIFICATION_V1_PACKAGE_NAME = "notification.v1";
@@ -55,6 +55,22 @@ export declare enum TreatmentRequestStatus {
55
55
  TREATMENT_REQUEST_STATUS_REFUND_PENDING = 5,
56
56
  TREATMENT_REQUEST_STATUS_REFUND_FAILED = 6,
57
57
  TREATMENT_REQUEST_STATUS_REFUNDED = 7,
58
+ TREATMENT_REQUEST_STATUS_IN_REVIEW = 8,
59
+ TREATMENT_REQUEST_STATUS_APPROVED = 9,
60
+ UNRECOGNIZED = -1
61
+ }
62
+ export declare enum MedicalRejectionReason {
63
+ MEDICAL_REJECTION_REASON_UNSPECIFIED = 0,
64
+ MEDICAL_REJECTION_REASON_EXCLUSION_CRITERIA = 1,
65
+ MEDICAL_REJECTION_REASON_NO_INDICATION = 2,
66
+ MEDICAL_REJECTION_REASON_OTHER = 3,
67
+ UNRECOGNIZED = -1
68
+ }
69
+ export declare enum MedicalReviewScope {
70
+ MEDICAL_REVIEW_SCOPE_UNSPECIFIED = 0,
71
+ MEDICAL_REVIEW_SCOPE_QUEUE = 1,
72
+ MEDICAL_REVIEW_SCOPE_IN_REVIEW = 2,
73
+ MEDICAL_REVIEW_SCOPE_DONE = 3,
58
74
  UNRECOGNIZED = -1
59
75
  }
60
76
  export declare enum WithdrawalStatus {
@@ -143,6 +159,17 @@ export interface TreatmentRequest {
143
159
  intakeMethods: IntakeMethod[];
144
160
  refundedAt?: string | undefined;
145
161
  withdrawal?: Withdrawal | undefined;
162
+ doctorId?: string | undefined;
163
+ doctorName?: string | undefined;
164
+ reviewStartedAt?: string | undefined;
165
+ decidedAt?: string | undefined;
166
+ rejectionReason?: MedicalRejectionReason | undefined;
167
+ rejectionText?: string | undefined;
168
+ }
169
+ export interface PatientSnapshot {
170
+ firstName: string;
171
+ lastName: string;
172
+ birthDate: string;
146
173
  }
147
174
  export interface GetQuestionnaireRequest {
148
175
  userId: string;
@@ -287,6 +314,73 @@ export interface RejectWithdrawalRequest {
287
314
  export interface RejectWithdrawalResponse {
288
315
  item: WithdrawalItem | undefined;
289
316
  }
317
+ export interface ListMedicalReviewsRequest {
318
+ doctorId: string;
319
+ scope: MedicalReviewScope;
320
+ cursor?: string | undefined;
321
+ limit: number;
322
+ allDoctors?: boolean | undefined;
323
+ }
324
+ export interface ListMedicalReviewsResponse {
325
+ requests: TreatmentRequest[];
326
+ nextCursor?: string | undefined;
327
+ total: number;
328
+ }
329
+ export interface CountMedicalReviewsRequest {
330
+ doctorId: string;
331
+ allDoctors?: boolean | undefined;
332
+ }
333
+ export interface CountMedicalReviewsResponse {
334
+ queue: number;
335
+ inReview: number;
336
+ }
337
+ export interface GetMedicalReviewRequest {
338
+ id: string;
339
+ doctorId: string;
340
+ allDoctors?: boolean | undefined;
341
+ }
342
+ export interface GetMedicalReviewResponse {
343
+ request: TreatmentRequest | undefined;
344
+ answers: QuestionnaireAnswers | undefined;
345
+ patientSnapshot?: PatientSnapshot | undefined;
346
+ previous: TreatmentRequest[];
347
+ }
348
+ export interface TakeMedicalReviewRequest {
349
+ id: string;
350
+ doctorId: string;
351
+ doctorName: string;
352
+ }
353
+ export interface TakeMedicalReviewResponse {
354
+ request: TreatmentRequest | undefined;
355
+ }
356
+ export interface ApproveMedicalReviewRequest {
357
+ id: string;
358
+ doctorId: string;
359
+ }
360
+ export interface ApproveMedicalReviewResponse {
361
+ request: TreatmentRequest | undefined;
362
+ }
363
+ export interface RejectMedicalReviewRequest {
364
+ id: string;
365
+ doctorId: string;
366
+ reason: MedicalRejectionReason;
367
+ text?: string | undefined;
368
+ }
369
+ export interface RejectMedicalReviewResponse {
370
+ request: TreatmentRequest | undefined;
371
+ }
372
+ export interface ReleaseMedicalReviewRequest {
373
+ id: string;
374
+ }
375
+ export interface ReleaseMedicalReviewResponse {
376
+ request: TreatmentRequest | undefined;
377
+ }
378
+ export interface RetryRefundRequest {
379
+ id: string;
380
+ }
381
+ export interface RetryRefundResponse {
382
+ request: TreatmentRequest | undefined;
383
+ }
290
384
  export declare const TREATMENT_V1_PACKAGE_NAME = "treatment.v1";
291
385
  export interface TreatmentServiceClient {
292
386
  getQuestionnaire(request: GetQuestionnaireRequest): Observable<GetQuestionnaireResponse>;
@@ -307,6 +401,14 @@ export interface TreatmentServiceClient {
307
401
  countPendingWithdrawals(request: CountPendingWithdrawalsRequest): Observable<CountPendingWithdrawalsResponse>;
308
402
  refundWithdrawal(request: RefundWithdrawalRequest): Observable<RefundWithdrawalResponse>;
309
403
  rejectWithdrawal(request: RejectWithdrawalRequest): Observable<RejectWithdrawalResponse>;
404
+ listMedicalReviews(request: ListMedicalReviewsRequest): Observable<ListMedicalReviewsResponse>;
405
+ countMedicalReviews(request: CountMedicalReviewsRequest): Observable<CountMedicalReviewsResponse>;
406
+ getMedicalReview(request: GetMedicalReviewRequest): Observable<GetMedicalReviewResponse>;
407
+ takeMedicalReview(request: TakeMedicalReviewRequest): Observable<TakeMedicalReviewResponse>;
408
+ approveMedicalReview(request: ApproveMedicalReviewRequest): Observable<ApproveMedicalReviewResponse>;
409
+ rejectMedicalReview(request: RejectMedicalReviewRequest): Observable<RejectMedicalReviewResponse>;
410
+ releaseMedicalReview(request: ReleaseMedicalReviewRequest): Observable<ReleaseMedicalReviewResponse>;
411
+ retryRefund(request: RetryRefundRequest): Observable<RetryRefundResponse>;
310
412
  }
311
413
  export interface TreatmentServiceController {
312
414
  getQuestionnaire(request: GetQuestionnaireRequest): Promise<GetQuestionnaireResponse> | Observable<GetQuestionnaireResponse> | GetQuestionnaireResponse;
@@ -327,6 +429,14 @@ export interface TreatmentServiceController {
327
429
  countPendingWithdrawals(request: CountPendingWithdrawalsRequest): Promise<CountPendingWithdrawalsResponse> | Observable<CountPendingWithdrawalsResponse> | CountPendingWithdrawalsResponse;
328
430
  refundWithdrawal(request: RefundWithdrawalRequest): Promise<RefundWithdrawalResponse> | Observable<RefundWithdrawalResponse> | RefundWithdrawalResponse;
329
431
  rejectWithdrawal(request: RejectWithdrawalRequest): Promise<RejectWithdrawalResponse> | Observable<RejectWithdrawalResponse> | RejectWithdrawalResponse;
432
+ listMedicalReviews(request: ListMedicalReviewsRequest): Promise<ListMedicalReviewsResponse> | Observable<ListMedicalReviewsResponse> | ListMedicalReviewsResponse;
433
+ countMedicalReviews(request: CountMedicalReviewsRequest): Promise<CountMedicalReviewsResponse> | Observable<CountMedicalReviewsResponse> | CountMedicalReviewsResponse;
434
+ getMedicalReview(request: GetMedicalReviewRequest): Promise<GetMedicalReviewResponse> | Observable<GetMedicalReviewResponse> | GetMedicalReviewResponse;
435
+ takeMedicalReview(request: TakeMedicalReviewRequest): Promise<TakeMedicalReviewResponse> | Observable<TakeMedicalReviewResponse> | TakeMedicalReviewResponse;
436
+ approveMedicalReview(request: ApproveMedicalReviewRequest): Promise<ApproveMedicalReviewResponse> | Observable<ApproveMedicalReviewResponse> | ApproveMedicalReviewResponse;
437
+ rejectMedicalReview(request: RejectMedicalReviewRequest): Promise<RejectMedicalReviewResponse> | Observable<RejectMedicalReviewResponse> | RejectMedicalReviewResponse;
438
+ releaseMedicalReview(request: ReleaseMedicalReviewRequest): Promise<ReleaseMedicalReviewResponse> | Observable<ReleaseMedicalReviewResponse> | ReleaseMedicalReviewResponse;
439
+ retryRefund(request: RetryRefundRequest): Promise<RetryRefundResponse> | Observable<RetryRefundResponse> | RetryRefundResponse;
330
440
  }
331
441
  export declare function TreatmentServiceControllerMethods(): (constructor: Function) => void;
332
442
  export declare const TREATMENT_SERVICE_NAME = "TreatmentService";
@@ -5,7 +5,7 @@
5
5
  // protoc v3.21.12
6
6
  // source: treatment.proto
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
8
- exports.TREATMENT_SERVICE_NAME = exports.TREATMENT_V1_PACKAGE_NAME = exports.WithdrawalRejectionReason = exports.WithdrawalStatus = exports.TreatmentRequestStatus = exports.TreatmentType = exports.ProductType = exports.IntakeMethod = exports.SymptomDuration = exports.Symptom = exports.QuestionnaireStatus = exports.protobufFileName = exports.protobufPackage = void 0;
8
+ exports.TREATMENT_SERVICE_NAME = exports.TREATMENT_V1_PACKAGE_NAME = exports.WithdrawalRejectionReason = exports.WithdrawalStatus = exports.MedicalReviewScope = exports.MedicalRejectionReason = exports.TreatmentRequestStatus = exports.TreatmentType = exports.ProductType = exports.IntakeMethod = exports.SymptomDuration = exports.Symptom = exports.QuestionnaireStatus = exports.protobufFileName = exports.protobufPackage = void 0;
9
9
  exports.TreatmentServiceControllerMethods = TreatmentServiceControllerMethods;
10
10
  /* eslint-disable */
11
11
  const microservices_1 = require("@nestjs/microservices");
@@ -72,8 +72,26 @@ var TreatmentRequestStatus;
72
72
  TreatmentRequestStatus[TreatmentRequestStatus["TREATMENT_REQUEST_STATUS_REFUND_PENDING"] = 5] = "TREATMENT_REQUEST_STATUS_REFUND_PENDING";
73
73
  TreatmentRequestStatus[TreatmentRequestStatus["TREATMENT_REQUEST_STATUS_REFUND_FAILED"] = 6] = "TREATMENT_REQUEST_STATUS_REFUND_FAILED";
74
74
  TreatmentRequestStatus[TreatmentRequestStatus["TREATMENT_REQUEST_STATUS_REFUNDED"] = 7] = "TREATMENT_REQUEST_STATUS_REFUNDED";
75
+ TreatmentRequestStatus[TreatmentRequestStatus["TREATMENT_REQUEST_STATUS_IN_REVIEW"] = 8] = "TREATMENT_REQUEST_STATUS_IN_REVIEW";
76
+ TreatmentRequestStatus[TreatmentRequestStatus["TREATMENT_REQUEST_STATUS_APPROVED"] = 9] = "TREATMENT_REQUEST_STATUS_APPROVED";
75
77
  TreatmentRequestStatus[TreatmentRequestStatus["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
76
78
  })(TreatmentRequestStatus || (exports.TreatmentRequestStatus = TreatmentRequestStatus = {}));
79
+ var MedicalRejectionReason;
80
+ (function (MedicalRejectionReason) {
81
+ MedicalRejectionReason[MedicalRejectionReason["MEDICAL_REJECTION_REASON_UNSPECIFIED"] = 0] = "MEDICAL_REJECTION_REASON_UNSPECIFIED";
82
+ MedicalRejectionReason[MedicalRejectionReason["MEDICAL_REJECTION_REASON_EXCLUSION_CRITERIA"] = 1] = "MEDICAL_REJECTION_REASON_EXCLUSION_CRITERIA";
83
+ MedicalRejectionReason[MedicalRejectionReason["MEDICAL_REJECTION_REASON_NO_INDICATION"] = 2] = "MEDICAL_REJECTION_REASON_NO_INDICATION";
84
+ MedicalRejectionReason[MedicalRejectionReason["MEDICAL_REJECTION_REASON_OTHER"] = 3] = "MEDICAL_REJECTION_REASON_OTHER";
85
+ MedicalRejectionReason[MedicalRejectionReason["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
86
+ })(MedicalRejectionReason || (exports.MedicalRejectionReason = MedicalRejectionReason = {}));
87
+ var MedicalReviewScope;
88
+ (function (MedicalReviewScope) {
89
+ MedicalReviewScope[MedicalReviewScope["MEDICAL_REVIEW_SCOPE_UNSPECIFIED"] = 0] = "MEDICAL_REVIEW_SCOPE_UNSPECIFIED";
90
+ MedicalReviewScope[MedicalReviewScope["MEDICAL_REVIEW_SCOPE_QUEUE"] = 1] = "MEDICAL_REVIEW_SCOPE_QUEUE";
91
+ MedicalReviewScope[MedicalReviewScope["MEDICAL_REVIEW_SCOPE_IN_REVIEW"] = 2] = "MEDICAL_REVIEW_SCOPE_IN_REVIEW";
92
+ MedicalReviewScope[MedicalReviewScope["MEDICAL_REVIEW_SCOPE_DONE"] = 3] = "MEDICAL_REVIEW_SCOPE_DONE";
93
+ MedicalReviewScope[MedicalReviewScope["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
94
+ })(MedicalReviewScope || (exports.MedicalReviewScope = MedicalReviewScope = {}));
77
95
  var WithdrawalStatus;
78
96
  (function (WithdrawalStatus) {
79
97
  WithdrawalStatus[WithdrawalStatus["WITHDRAWAL_STATUS_UNSPECIFIED"] = 0] = "WITHDRAWAL_STATUS_UNSPECIFIED";
@@ -112,6 +130,14 @@ function TreatmentServiceControllerMethods() {
112
130
  "countPendingWithdrawals",
113
131
  "refundWithdrawal",
114
132
  "rejectWithdrawal",
133
+ "listMedicalReviews",
134
+ "countMedicalReviews",
135
+ "getMedicalReview",
136
+ "takeMedicalReview",
137
+ "approveMedicalReview",
138
+ "rejectMedicalReview",
139
+ "releaseMedicalReview",
140
+ "retryRefund",
115
141
  ];
116
142
  for (const method of grpcMethods) {
117
143
  const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@candesk/contracts",
3
- "version": "6.70.0",
3
+ "version": "6.72.0",
4
4
  "description": "Protobuf contracts for CanDesk microservices",
5
5
  "author": {
6
6
  "name": "Alexander Schulz",
@@ -28,6 +28,8 @@ enum NotificationType {
28
28
  NOTIFICATION_TYPE_COMMENT_REJECTED = 16;
29
29
  NOTIFICATION_TYPE_TREATMENT_REQUEST_REFUNDED = 17;
30
30
  NOTIFICATION_TYPE_WITHDRAWAL_REJECTED = 18;
31
+ NOTIFICATION_TYPE_TREATMENT_REQUEST_APPROVED = 19;
32
+ NOTIFICATION_TYPE_TREATMENT_REQUEST_REJECTED = 20;
31
33
  }
32
34
 
33
35
  message Notification {
@@ -21,6 +21,14 @@ service TreatmentService {
21
21
  rpc CountPendingWithdrawals (CountPendingWithdrawalsRequest) returns (CountPendingWithdrawalsResponse);
22
22
  rpc RefundWithdrawal (RefundWithdrawalRequest) returns (RefundWithdrawalResponse);
23
23
  rpc RejectWithdrawal (RejectWithdrawalRequest) returns (RejectWithdrawalResponse);
24
+ rpc ListMedicalReviews (ListMedicalReviewsRequest) returns (ListMedicalReviewsResponse);
25
+ rpc CountMedicalReviews (CountMedicalReviewsRequest) returns (CountMedicalReviewsResponse);
26
+ rpc GetMedicalReview (GetMedicalReviewRequest) returns (GetMedicalReviewResponse);
27
+ rpc TakeMedicalReview (TakeMedicalReviewRequest) returns (TakeMedicalReviewResponse);
28
+ rpc ApproveMedicalReview (ApproveMedicalReviewRequest) returns (ApproveMedicalReviewResponse);
29
+ rpc RejectMedicalReview (RejectMedicalReviewRequest) returns (RejectMedicalReviewResponse);
30
+ rpc ReleaseMedicalReview (ReleaseMedicalReviewRequest) returns (ReleaseMedicalReviewResponse);
31
+ rpc RetryRefund (RetryRefundRequest) returns (RetryRefundResponse);
24
32
  }
25
33
 
26
34
  enum QuestionnaireStatus {
@@ -77,6 +85,22 @@ enum TreatmentRequestStatus {
77
85
  TREATMENT_REQUEST_STATUS_REFUND_PENDING = 5;
78
86
  TREATMENT_REQUEST_STATUS_REFUND_FAILED = 6;
79
87
  TREATMENT_REQUEST_STATUS_REFUNDED = 7;
88
+ TREATMENT_REQUEST_STATUS_IN_REVIEW = 8;
89
+ TREATMENT_REQUEST_STATUS_APPROVED = 9;
90
+ }
91
+
92
+ enum MedicalRejectionReason {
93
+ MEDICAL_REJECTION_REASON_UNSPECIFIED = 0;
94
+ MEDICAL_REJECTION_REASON_EXCLUSION_CRITERIA = 1;
95
+ MEDICAL_REJECTION_REASON_NO_INDICATION = 2;
96
+ MEDICAL_REJECTION_REASON_OTHER = 3;
97
+ }
98
+
99
+ enum MedicalReviewScope {
100
+ MEDICAL_REVIEW_SCOPE_UNSPECIFIED = 0;
101
+ MEDICAL_REVIEW_SCOPE_QUEUE = 1;
102
+ MEDICAL_REVIEW_SCOPE_IN_REVIEW = 2;
103
+ MEDICAL_REVIEW_SCOPE_DONE = 3;
80
104
  }
81
105
 
82
106
  enum WithdrawalStatus {
@@ -170,6 +194,18 @@ message TreatmentRequest {
170
194
  repeated IntakeMethod intake_methods = 14;
171
195
  optional string refunded_at = 15;
172
196
  optional Withdrawal withdrawal = 16;
197
+ optional string doctor_id = 17;
198
+ optional string doctor_name = 18;
199
+ optional string review_started_at = 19;
200
+ optional string decided_at = 20;
201
+ optional MedicalRejectionReason rejection_reason = 21;
202
+ optional string rejection_text = 22;
203
+ }
204
+
205
+ message PatientSnapshot {
206
+ string first_name = 1;
207
+ string last_name = 2;
208
+ string birth_date = 3;
173
209
  }
174
210
 
175
211
  message GetQuestionnaireRequest {
@@ -350,3 +386,86 @@ message RejectWithdrawalRequest {
350
386
  message RejectWithdrawalResponse {
351
387
  WithdrawalItem item = 1;
352
388
  }
389
+
390
+ message ListMedicalReviewsRequest {
391
+ string doctor_id = 1;
392
+ MedicalReviewScope scope = 2;
393
+ optional string cursor = 3;
394
+ int32 limit = 4;
395
+ optional bool all_doctors = 5;
396
+ }
397
+
398
+ message ListMedicalReviewsResponse {
399
+ repeated TreatmentRequest requests = 1;
400
+ optional string next_cursor = 2;
401
+ int32 total = 3;
402
+ }
403
+
404
+ message CountMedicalReviewsRequest {
405
+ string doctor_id = 1;
406
+ optional bool all_doctors = 2;
407
+ }
408
+
409
+ message CountMedicalReviewsResponse {
410
+ int32 queue = 1;
411
+ int32 in_review = 2;
412
+ }
413
+
414
+ message GetMedicalReviewRequest {
415
+ string id = 1;
416
+ string doctor_id = 2;
417
+ optional bool all_doctors = 3;
418
+ }
419
+
420
+ message GetMedicalReviewResponse {
421
+ TreatmentRequest request = 1;
422
+ QuestionnaireAnswers answers = 2;
423
+ optional PatientSnapshot patient_snapshot = 3;
424
+ repeated TreatmentRequest previous = 4;
425
+ }
426
+
427
+ message TakeMedicalReviewRequest {
428
+ string id = 1;
429
+ string doctor_id = 2;
430
+ string doctor_name = 3;
431
+ }
432
+
433
+ message TakeMedicalReviewResponse {
434
+ TreatmentRequest request = 1;
435
+ }
436
+
437
+ message ApproveMedicalReviewRequest {
438
+ string id = 1;
439
+ string doctor_id = 2;
440
+ }
441
+
442
+ message ApproveMedicalReviewResponse {
443
+ TreatmentRequest request = 1;
444
+ }
445
+
446
+ message RejectMedicalReviewRequest {
447
+ string id = 1;
448
+ string doctor_id = 2;
449
+ MedicalRejectionReason reason = 3;
450
+ optional string text = 4;
451
+ }
452
+
453
+ message RejectMedicalReviewResponse {
454
+ TreatmentRequest request = 1;
455
+ }
456
+
457
+ message ReleaseMedicalReviewRequest {
458
+ string id = 1;
459
+ }
460
+
461
+ message ReleaseMedicalReviewResponse {
462
+ TreatmentRequest request = 1;
463
+ }
464
+
465
+ message RetryRefundRequest {
466
+ string id = 1;
467
+ }
468
+
469
+ message RetryRefundResponse {
470
+ TreatmentRequest request = 1;
471
+ }