hvp-shared 7.4.0 → 7.6.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/contracts/external-study/index.d.ts +6 -0
- package/dist/contracts/external-study/index.js +22 -0
- package/dist/contracts/external-study/requests.d.ts +84 -0
- package/dist/contracts/external-study/requests.js +5 -0
- package/dist/contracts/external-study/responses.d.ts +60 -0
- package/dist/contracts/external-study/responses.js +5 -0
- package/dist/contracts/external-study/types.d.ts +42 -0
- package/dist/contracts/external-study/types.js +56 -0
- package/dist/contracts/index.d.ts +4 -0
- package/dist/contracts/index.js +4 -0
- package/dist/contracts/pending-dashboard/index.d.ts +4 -0
- package/dist/contracts/pending-dashboard/index.js +20 -0
- package/dist/contracts/pending-dashboard/responses.d.ts +34 -0
- package/dist/contracts/pending-dashboard/responses.js +8 -0
- package/dist/contracts/study-type-catalog/index.d.ts +6 -0
- package/dist/contracts/study-type-catalog/index.js +22 -0
- package/dist/contracts/study-type-catalog/requests.d.ts +36 -0
- package/dist/contracts/study-type-catalog/requests.js +5 -0
- package/dist/contracts/study-type-catalog/responses.d.ts +22 -0
- package/dist/contracts/study-type-catalog/responses.js +5 -0
- package/dist/contracts/study-type-catalog/types.d.ts +18 -0
- package/dist/contracts/study-type-catalog/types.js +25 -0
- package/dist/contracts/supplier-overlay/index.d.ts +6 -0
- package/dist/contracts/supplier-overlay/index.js +22 -0
- package/dist/contracts/supplier-overlay/requests.d.ts +22 -0
- package/dist/contracts/supplier-overlay/requests.js +5 -0
- package/dist/contracts/supplier-overlay/responses.d.ts +34 -0
- package/dist/contracts/supplier-overlay/responses.js +5 -0
- package/dist/contracts/supplier-overlay/types.d.ts +11 -0
- package/dist/contracts/supplier-overlay/types.js +12 -0
- package/package.json +1 -1
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* External Study API Contracts
|
|
4
|
+
*/
|
|
5
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
8
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
9
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
10
|
+
}
|
|
11
|
+
Object.defineProperty(o, k2, desc);
|
|
12
|
+
}) : (function(o, m, k, k2) {
|
|
13
|
+
if (k2 === undefined) k2 = k;
|
|
14
|
+
o[k2] = m[k];
|
|
15
|
+
}));
|
|
16
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
17
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
18
|
+
};
|
|
19
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
+
__exportStar(require("./types"), exports);
|
|
21
|
+
__exportStar(require("./requests"), exports);
|
|
22
|
+
__exportStar(require("./responses"), exports);
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* External Study Requests
|
|
3
|
+
*/
|
|
4
|
+
import { StudyStatus } from './types';
|
|
5
|
+
/**
|
|
6
|
+
* Create a new external study.
|
|
7
|
+
*
|
|
8
|
+
* @example POST /api/external-studies
|
|
9
|
+
*/
|
|
10
|
+
export interface CreateExternalStudyRequest {
|
|
11
|
+
qvetPetId?: number;
|
|
12
|
+
qvetClientId?: number;
|
|
13
|
+
patientName: string;
|
|
14
|
+
clientName?: string;
|
|
15
|
+
studyTypeId: string;
|
|
16
|
+
studyTypeDetail?: string;
|
|
17
|
+
qvetSupplierId: number;
|
|
18
|
+
responsibleDoctorId: string;
|
|
19
|
+
requestedById?: string;
|
|
20
|
+
resultUrl?: string;
|
|
21
|
+
notes?: string;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Update a study's editable fields (patient, type, supplier, doctor, links, notes).
|
|
25
|
+
*
|
|
26
|
+
* For state transitions, use the dedicated transition endpoints.
|
|
27
|
+
*
|
|
28
|
+
* @example PATCH /api/external-studies/:id
|
|
29
|
+
*/
|
|
30
|
+
export interface UpdateExternalStudyRequest {
|
|
31
|
+
qvetPetId?: number;
|
|
32
|
+
qvetClientId?: number;
|
|
33
|
+
patientName?: string;
|
|
34
|
+
clientName?: string;
|
|
35
|
+
studyTypeId?: string;
|
|
36
|
+
studyTypeDetail?: string;
|
|
37
|
+
qvetSupplierId?: number;
|
|
38
|
+
responsibleDoctorId?: string;
|
|
39
|
+
requestedById?: string;
|
|
40
|
+
resultUrl?: string;
|
|
41
|
+
notes?: string;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Transition a study to a new state.
|
|
45
|
+
*
|
|
46
|
+
* Backend validates the transition is legal:
|
|
47
|
+
* - solicitado → enviado, cancelado
|
|
48
|
+
* - enviado → resultado_recibido, cancelado
|
|
49
|
+
* - resultado_recibido → cerrado, cancelado
|
|
50
|
+
* - cerrado, cancelado → no transitions out
|
|
51
|
+
*
|
|
52
|
+
* @example POST /api/external-studies/:id/transition
|
|
53
|
+
*/
|
|
54
|
+
export interface TransitionStudyRequest {
|
|
55
|
+
status: StudyStatus;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Toggle a post-received action timestamp.
|
|
59
|
+
*
|
|
60
|
+
* When `done=true` and the timestamp is unset, sets it to now.
|
|
61
|
+
* When `done=false`, clears the timestamp.
|
|
62
|
+
*
|
|
63
|
+
* Only valid when study status is resultado_recibido or cerrado.
|
|
64
|
+
*
|
|
65
|
+
* @example POST /api/external-studies/:id/post-action
|
|
66
|
+
*/
|
|
67
|
+
export interface PostActionRequest {
|
|
68
|
+
action: 'sentToInternalWhatsapp' | 'uploadedToQvet' | 'informedClient';
|
|
69
|
+
done: boolean;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Filter params for listing external studies.
|
|
73
|
+
*/
|
|
74
|
+
export interface ExternalStudyQueryFilters {
|
|
75
|
+
status?: StudyStatus | StudyStatus[];
|
|
76
|
+
responsibleDoctorId?: string;
|
|
77
|
+
qvetSupplierId?: number;
|
|
78
|
+
studyTypeId?: string;
|
|
79
|
+
/** ISO date strings */
|
|
80
|
+
fromDate?: string;
|
|
81
|
+
toDate?: string;
|
|
82
|
+
/** When true, returns only overdue active studies. */
|
|
83
|
+
overdueOnly?: boolean;
|
|
84
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* External Study Responses
|
|
3
|
+
*/
|
|
4
|
+
import { StudyCategory } from '../study-type-catalog/types';
|
|
5
|
+
import { StudyStatus } from './types';
|
|
6
|
+
/**
|
|
7
|
+
* Single external study record.
|
|
8
|
+
*
|
|
9
|
+
* @example GET /api/external-studies/:id
|
|
10
|
+
*/
|
|
11
|
+
export interface ExternalStudyResponse {
|
|
12
|
+
id: string;
|
|
13
|
+
qvetPetId?: number;
|
|
14
|
+
qvetClientId?: number;
|
|
15
|
+
patientName: string;
|
|
16
|
+
clientName?: string;
|
|
17
|
+
studyTypeId: string;
|
|
18
|
+
studyTypeCategory: StudyCategory;
|
|
19
|
+
studyTypeDetail?: string;
|
|
20
|
+
qvetSupplierId: number;
|
|
21
|
+
responsibleDoctorId: string;
|
|
22
|
+
requestedById: string;
|
|
23
|
+
status: StudyStatus;
|
|
24
|
+
requestedAt: string;
|
|
25
|
+
sentAt?: string;
|
|
26
|
+
resultReceivedAt?: string;
|
|
27
|
+
closedAt?: string;
|
|
28
|
+
cancelledAt?: string;
|
|
29
|
+
sentToInternalWhatsappAt?: string;
|
|
30
|
+
uploadedToQvetAt?: string;
|
|
31
|
+
informedClientAt?: string;
|
|
32
|
+
resultUrl?: string;
|
|
33
|
+
notes?: string;
|
|
34
|
+
daysSinceRequested: number;
|
|
35
|
+
isOverdue: boolean;
|
|
36
|
+
createdAt: string;
|
|
37
|
+
updatedAt: string;
|
|
38
|
+
createdBy?: string;
|
|
39
|
+
updatedBy?: string;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Pending dashboard summary for an external study (lighter payload for list views).
|
|
43
|
+
*
|
|
44
|
+
* Only IDs — frontend looks up names from local catalogs.
|
|
45
|
+
*/
|
|
46
|
+
export interface ExternalStudyPendingItem {
|
|
47
|
+
id: string;
|
|
48
|
+
patientName: string;
|
|
49
|
+
clientName?: string;
|
|
50
|
+
studyTypeId: string;
|
|
51
|
+
studyTypeCategory: StudyCategory;
|
|
52
|
+
studyTypeDetail?: string;
|
|
53
|
+
qvetSupplierId: number;
|
|
54
|
+
responsibleDoctorId: string;
|
|
55
|
+
requestedById: string;
|
|
56
|
+
status: StudyStatus;
|
|
57
|
+
requestedAt: string;
|
|
58
|
+
daysSinceRequested: number;
|
|
59
|
+
isOverdue: boolean;
|
|
60
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* External Study Types
|
|
3
|
+
*
|
|
4
|
+
* Tracks studies sent to external labs (YiHealth, Annilab, Peninsular)
|
|
5
|
+
* or imaging providers (USG/RX/ECO). Provides visibility on what's pending,
|
|
6
|
+
* who requested it, and what post-result actions remain.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Workflow state of an external study.
|
|
10
|
+
*
|
|
11
|
+
* Transitions:
|
|
12
|
+
* requested → sent → result_received → closed
|
|
13
|
+
* ↓
|
|
14
|
+
* cancelled (from any active state)
|
|
15
|
+
*
|
|
16
|
+
* Spanish UI labels are in `STUDY_STATUS_LABELS` — code/DB always uses English.
|
|
17
|
+
*
|
|
18
|
+
* Post-received actions (sentToInternalWhatsappAt, uploadedToQvetAt,
|
|
19
|
+
* informedClientAt) are independent timestamps — not states.
|
|
20
|
+
*/
|
|
21
|
+
export declare enum StudyStatus {
|
|
22
|
+
requested = "requested",
|
|
23
|
+
sent = "sent",
|
|
24
|
+
result_received = "result_received",
|
|
25
|
+
closed = "closed",
|
|
26
|
+
cancelled = "cancelled"
|
|
27
|
+
}
|
|
28
|
+
/** UI-only labels (Spanish). Code uses English enum values everywhere else. */
|
|
29
|
+
export declare const STUDY_STATUS_LABELS: Record<StudyStatus, string>;
|
|
30
|
+
/**
|
|
31
|
+
* Active states (not closed/cancelled). Used to filter pending dashboards.
|
|
32
|
+
*/
|
|
33
|
+
export declare const ACTIVE_STUDY_STATUSES: ReadonlyArray<StudyStatus>;
|
|
34
|
+
/**
|
|
35
|
+
* Overdue thresholds in days (per category). Hardcoded for now; can move to
|
|
36
|
+
* settings later. A study is "overdue" when (today - requestedAt) > threshold
|
|
37
|
+
* AND status is in ACTIVE_STUDY_STATUSES.
|
|
38
|
+
*/
|
|
39
|
+
export declare const OVERDUE_THRESHOLD_DAYS: {
|
|
40
|
+
readonly LAB: 5;
|
|
41
|
+
readonly IMAGING: 3;
|
|
42
|
+
};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* External Study Types
|
|
4
|
+
*
|
|
5
|
+
* Tracks studies sent to external labs (YiHealth, Annilab, Peninsular)
|
|
6
|
+
* or imaging providers (USG/RX/ECO). Provides visibility on what's pending,
|
|
7
|
+
* who requested it, and what post-result actions remain.
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.OVERDUE_THRESHOLD_DAYS = exports.ACTIVE_STUDY_STATUSES = exports.STUDY_STATUS_LABELS = exports.StudyStatus = void 0;
|
|
11
|
+
/**
|
|
12
|
+
* Workflow state of an external study.
|
|
13
|
+
*
|
|
14
|
+
* Transitions:
|
|
15
|
+
* requested → sent → result_received → closed
|
|
16
|
+
* ↓
|
|
17
|
+
* cancelled (from any active state)
|
|
18
|
+
*
|
|
19
|
+
* Spanish UI labels are in `STUDY_STATUS_LABELS` — code/DB always uses English.
|
|
20
|
+
*
|
|
21
|
+
* Post-received actions (sentToInternalWhatsappAt, uploadedToQvetAt,
|
|
22
|
+
* informedClientAt) are independent timestamps — not states.
|
|
23
|
+
*/
|
|
24
|
+
var StudyStatus;
|
|
25
|
+
(function (StudyStatus) {
|
|
26
|
+
StudyStatus["requested"] = "requested";
|
|
27
|
+
StudyStatus["sent"] = "sent";
|
|
28
|
+
StudyStatus["result_received"] = "result_received";
|
|
29
|
+
StudyStatus["closed"] = "closed";
|
|
30
|
+
StudyStatus["cancelled"] = "cancelled";
|
|
31
|
+
})(StudyStatus || (exports.StudyStatus = StudyStatus = {}));
|
|
32
|
+
/** UI-only labels (Spanish). Code uses English enum values everywhere else. */
|
|
33
|
+
exports.STUDY_STATUS_LABELS = {
|
|
34
|
+
[StudyStatus.requested]: 'Solicitado',
|
|
35
|
+
[StudyStatus.sent]: 'Enviado',
|
|
36
|
+
[StudyStatus.result_received]: 'Resultado recibido',
|
|
37
|
+
[StudyStatus.closed]: 'Cerrado',
|
|
38
|
+
[StudyStatus.cancelled]: 'Cancelado',
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* Active states (not closed/cancelled). Used to filter pending dashboards.
|
|
42
|
+
*/
|
|
43
|
+
exports.ACTIVE_STUDY_STATUSES = [
|
|
44
|
+
StudyStatus.requested,
|
|
45
|
+
StudyStatus.sent,
|
|
46
|
+
StudyStatus.result_received,
|
|
47
|
+
];
|
|
48
|
+
/**
|
|
49
|
+
* Overdue thresholds in days (per category). Hardcoded for now; can move to
|
|
50
|
+
* settings later. A study is "overdue" when (today - requestedAt) > threshold
|
|
51
|
+
* AND status is in ACTIVE_STUDY_STATUSES.
|
|
52
|
+
*/
|
|
53
|
+
exports.OVERDUE_THRESHOLD_DAYS = {
|
|
54
|
+
LAB: 5,
|
|
55
|
+
IMAGING: 3,
|
|
56
|
+
};
|
|
@@ -16,3 +16,7 @@ export * from './client-billing';
|
|
|
16
16
|
export * from './global-invoice';
|
|
17
17
|
export * from './inventory-report';
|
|
18
18
|
export * from './google-contacts';
|
|
19
|
+
export * from './study-type-catalog';
|
|
20
|
+
export * from './supplier-overlay';
|
|
21
|
+
export * from './external-study';
|
|
22
|
+
export * from './pending-dashboard';
|
package/dist/contracts/index.js
CHANGED
|
@@ -32,3 +32,7 @@ __exportStar(require("./client-billing"), exports);
|
|
|
32
32
|
__exportStar(require("./global-invoice"), exports);
|
|
33
33
|
__exportStar(require("./inventory-report"), exports);
|
|
34
34
|
__exportStar(require("./google-contacts"), exports);
|
|
35
|
+
__exportStar(require("./study-type-catalog"), exports);
|
|
36
|
+
__exportStar(require("./supplier-overlay"), exports);
|
|
37
|
+
__exportStar(require("./external-study"), exports);
|
|
38
|
+
__exportStar(require("./pending-dashboard"), exports);
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Pending Dashboard API Contracts
|
|
4
|
+
*/
|
|
5
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
8
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
9
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
10
|
+
}
|
|
11
|
+
Object.defineProperty(o, k2, desc);
|
|
12
|
+
}) : (function(o, m, k, k2) {
|
|
13
|
+
if (k2 === undefined) k2 = k;
|
|
14
|
+
o[k2] = m[k];
|
|
15
|
+
}));
|
|
16
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
17
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
18
|
+
};
|
|
19
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
+
__exportStar(require("./responses"), exports);
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pending Dashboard Responses
|
|
3
|
+
*
|
|
4
|
+
* Aggregated view of pending items across the system. Visible to anyone.
|
|
5
|
+
* Designed to grow over time — each card represents one source.
|
|
6
|
+
*/
|
|
7
|
+
import { ExternalStudyPendingItem } from '../external-study/responses';
|
|
8
|
+
/**
|
|
9
|
+
* Sales (tickets) with outstanding balance.
|
|
10
|
+
*/
|
|
11
|
+
export interface PendingSaleSummary {
|
|
12
|
+
ticketNumber: number;
|
|
13
|
+
date: string;
|
|
14
|
+
qvetClientId?: number;
|
|
15
|
+
clientName?: string;
|
|
16
|
+
total: number;
|
|
17
|
+
paid: number;
|
|
18
|
+
outstanding: number;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* @example GET /api/pending-dashboard
|
|
22
|
+
*/
|
|
23
|
+
export interface PendingDashboardResponse {
|
|
24
|
+
studies: {
|
|
25
|
+
overdueCount: number;
|
|
26
|
+
activeCount: number;
|
|
27
|
+
overdueItems: ExternalStudyPendingItem[];
|
|
28
|
+
};
|
|
29
|
+
sales: {
|
|
30
|
+
pendingTicketsCount: number;
|
|
31
|
+
totalOutstanding: number;
|
|
32
|
+
topItems: PendingSaleSummary[];
|
|
33
|
+
};
|
|
34
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Pending Dashboard Responses
|
|
4
|
+
*
|
|
5
|
+
* Aggregated view of pending items across the system. Visible to anyone.
|
|
6
|
+
* Designed to grow over time — each card represents one source.
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Study Type Catalog API Contracts
|
|
4
|
+
*/
|
|
5
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
8
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
9
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
10
|
+
}
|
|
11
|
+
Object.defineProperty(o, k2, desc);
|
|
12
|
+
}) : (function(o, m, k, k2) {
|
|
13
|
+
if (k2 === undefined) k2 = k;
|
|
14
|
+
o[k2] = m[k];
|
|
15
|
+
}));
|
|
16
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
17
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
18
|
+
};
|
|
19
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
+
__exportStar(require("./types"), exports);
|
|
21
|
+
__exportStar(require("./requests"), exports);
|
|
22
|
+
__exportStar(require("./responses"), exports);
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Study Type Catalog Requests
|
|
3
|
+
*/
|
|
4
|
+
import { StudyCategory } from './types';
|
|
5
|
+
/**
|
|
6
|
+
* Create a new study type in the catalog.
|
|
7
|
+
*
|
|
8
|
+
* @example POST /api/study-type-catalog
|
|
9
|
+
*/
|
|
10
|
+
export interface CreateStudyTypeRequest {
|
|
11
|
+
name: string;
|
|
12
|
+
qvetCode?: number;
|
|
13
|
+
category: StudyCategory;
|
|
14
|
+
isFlexible: boolean;
|
|
15
|
+
notes?: string;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Update an existing study type.
|
|
19
|
+
*
|
|
20
|
+
* @example PATCH /api/study-type-catalog/:id
|
|
21
|
+
*/
|
|
22
|
+
export interface UpdateStudyTypeRequest {
|
|
23
|
+
name?: string;
|
|
24
|
+
qvetCode?: number;
|
|
25
|
+
category?: StudyCategory;
|
|
26
|
+
isFlexible?: boolean;
|
|
27
|
+
isActive?: boolean;
|
|
28
|
+
notes?: string;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Filter params for listing study types.
|
|
32
|
+
*/
|
|
33
|
+
export interface StudyTypeQueryFilters {
|
|
34
|
+
category?: StudyCategory;
|
|
35
|
+
isActive?: boolean;
|
|
36
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Study Type Catalog Responses
|
|
3
|
+
*/
|
|
4
|
+
import { StudyCategory } from './types';
|
|
5
|
+
/**
|
|
6
|
+
* Single study type catalog entry.
|
|
7
|
+
*
|
|
8
|
+
* @example GET /api/study-type-catalog/:id
|
|
9
|
+
*/
|
|
10
|
+
export interface StudyTypeResponse {
|
|
11
|
+
id: string;
|
|
12
|
+
name: string;
|
|
13
|
+
qvetCode?: number;
|
|
14
|
+
category: StudyCategory;
|
|
15
|
+
isFlexible: boolean;
|
|
16
|
+
isActive: boolean;
|
|
17
|
+
notes?: string;
|
|
18
|
+
createdAt: string;
|
|
19
|
+
updatedAt: string;
|
|
20
|
+
createdBy?: string;
|
|
21
|
+
updatedBy?: string;
|
|
22
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Study Type Catalog Types
|
|
3
|
+
*
|
|
4
|
+
* Catalog of available study types (LAB or IMAGING) used when creating
|
|
5
|
+
* an ExternalStudy. Some entries are "flexible" — they require a free-text
|
|
6
|
+
* detail at use time (e.g. "USG dirigido" → user types "USG cardíaco").
|
|
7
|
+
*
|
|
8
|
+
* Seeded initially from QVET catalog (SERVICIOS EXTERNOS → LABORATORIO/GABINETE)
|
|
9
|
+
* cross-referenced with sales activity. Anyone can add new entries via UI.
|
|
10
|
+
*/
|
|
11
|
+
/**
|
|
12
|
+
* Study category — determines the overdue threshold and groups studies.
|
|
13
|
+
*/
|
|
14
|
+
export declare enum StudyCategory {
|
|
15
|
+
LAB = "LAB",
|
|
16
|
+
IMAGING = "IMAGING"
|
|
17
|
+
}
|
|
18
|
+
export declare const STUDY_CATEGORY_LABELS: Record<StudyCategory, string>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Study Type Catalog Types
|
|
4
|
+
*
|
|
5
|
+
* Catalog of available study types (LAB or IMAGING) used when creating
|
|
6
|
+
* an ExternalStudy. Some entries are "flexible" — they require a free-text
|
|
7
|
+
* detail at use time (e.g. "USG dirigido" → user types "USG cardíaco").
|
|
8
|
+
*
|
|
9
|
+
* Seeded initially from QVET catalog (SERVICIOS EXTERNOS → LABORATORIO/GABINETE)
|
|
10
|
+
* cross-referenced with sales activity. Anyone can add new entries via UI.
|
|
11
|
+
*/
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.STUDY_CATEGORY_LABELS = exports.StudyCategory = void 0;
|
|
14
|
+
/**
|
|
15
|
+
* Study category — determines the overdue threshold and groups studies.
|
|
16
|
+
*/
|
|
17
|
+
var StudyCategory;
|
|
18
|
+
(function (StudyCategory) {
|
|
19
|
+
StudyCategory["LAB"] = "LAB";
|
|
20
|
+
StudyCategory["IMAGING"] = "IMAGING";
|
|
21
|
+
})(StudyCategory || (exports.StudyCategory = StudyCategory = {}));
|
|
22
|
+
exports.STUDY_CATEGORY_LABELS = {
|
|
23
|
+
[StudyCategory.LAB]: 'Laboratorio',
|
|
24
|
+
[StudyCategory.IMAGING]: 'Imagen',
|
|
25
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Supplier Overlay API Contracts
|
|
4
|
+
*/
|
|
5
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
8
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
9
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
10
|
+
}
|
|
11
|
+
Object.defineProperty(o, k2, desc);
|
|
12
|
+
}) : (function(o, m, k, k2) {
|
|
13
|
+
if (k2 === undefined) k2 = k;
|
|
14
|
+
o[k2] = m[k];
|
|
15
|
+
}));
|
|
16
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
17
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
18
|
+
};
|
|
19
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
+
__exportStar(require("./types"), exports);
|
|
21
|
+
__exportStar(require("./requests"), exports);
|
|
22
|
+
__exportStar(require("./responses"), exports);
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Supplier Overlay Requests
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Upsert a supplier overlay.
|
|
6
|
+
*
|
|
7
|
+
* Used to tag a QVET supplier as a study provider (or not).
|
|
8
|
+
* Creates the overlay if it doesn't exist; updates it if it does.
|
|
9
|
+
*
|
|
10
|
+
* @example PATCH /api/supplier-overlays/:qvetSupplierId
|
|
11
|
+
*/
|
|
12
|
+
export interface UpsertSupplierOverlayRequest {
|
|
13
|
+
isStudyProvider: boolean;
|
|
14
|
+
notes?: string;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Filter params for listing supplier overlays.
|
|
18
|
+
*/
|
|
19
|
+
export interface SupplierOverlayQueryFilters {
|
|
20
|
+
/** When true, returns only overlays where isStudyProvider=true. */
|
|
21
|
+
isStudyProvider?: boolean;
|
|
22
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Supplier Overlay Responses
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Supplier overlay record (HVP-specific tags on top of a QVET supplier).
|
|
6
|
+
*/
|
|
7
|
+
export interface SupplierOverlayResponse {
|
|
8
|
+
id: string;
|
|
9
|
+
qvetSupplierId: number;
|
|
10
|
+
isStudyProvider: boolean;
|
|
11
|
+
notes?: string;
|
|
12
|
+
createdAt: string;
|
|
13
|
+
updatedAt: string;
|
|
14
|
+
createdBy?: string;
|
|
15
|
+
updatedBy?: string;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Combined response: a QVET supplier with its overlay attached (or null if no overlay yet).
|
|
19
|
+
*
|
|
20
|
+
* Used by the supplier overlay management UI to show the full QVET supplier list
|
|
21
|
+
* with an inline checkbox/toggle for `isStudyProvider`.
|
|
22
|
+
*
|
|
23
|
+
* @example GET /api/supplier-overlays
|
|
24
|
+
*/
|
|
25
|
+
export interface QvetSupplierWithOverlayResponse {
|
|
26
|
+
qvetSupplierId: number;
|
|
27
|
+
name: string;
|
|
28
|
+
taxId?: string;
|
|
29
|
+
email?: string;
|
|
30
|
+
phone1?: string;
|
|
31
|
+
isActive: boolean;
|
|
32
|
+
/** The HVP overlay (null when not yet tagged). */
|
|
33
|
+
overlay: SupplierOverlayResponse | null;
|
|
34
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Supplier Overlay Types
|
|
3
|
+
*
|
|
4
|
+
* Parallel data layer for QVET suppliers. Stores HVP-specific tags
|
|
5
|
+
* without polluting `qvet_suppliers` (which is upsert-overwritten on every QVET sync).
|
|
6
|
+
*
|
|
7
|
+
* Currently used to flag which suppliers are study providers (so they show up
|
|
8
|
+
* in the ExternalStudy form). Category (LAB/IMAGING) lives in StudyTypeCatalog,
|
|
9
|
+
* not here — the supplier just needs a yes/no flag.
|
|
10
|
+
*/
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Supplier Overlay Types
|
|
4
|
+
*
|
|
5
|
+
* Parallel data layer for QVET suppliers. Stores HVP-specific tags
|
|
6
|
+
* without polluting `qvet_suppliers` (which is upsert-overwritten on every QVET sync).
|
|
7
|
+
*
|
|
8
|
+
* Currently used to flag which suppliers are study providers (so they show up
|
|
9
|
+
* in the ExternalStudy form). Category (LAB/IMAGING) lives in StudyTypeCatalog,
|
|
10
|
+
* not here — the supplier just needs a yes/no flag.
|
|
11
|
+
*/
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|