hvp-shared 7.5.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.
@@ -15,7 +15,8 @@ export interface CreateExternalStudyRequest {
15
15
  studyTypeId: string;
16
16
  studyTypeDetail?: string;
17
17
  qvetSupplierId: number;
18
- requestingDoctorId: string;
18
+ responsibleDoctorId: string;
19
+ requestedById?: string;
19
20
  resultUrl?: string;
20
21
  notes?: string;
21
22
  }
@@ -34,7 +35,8 @@ export interface UpdateExternalStudyRequest {
34
35
  studyTypeId?: string;
35
36
  studyTypeDetail?: string;
36
37
  qvetSupplierId?: number;
37
- requestingDoctorId?: string;
38
+ responsibleDoctorId?: string;
39
+ requestedById?: string;
38
40
  resultUrl?: string;
39
41
  notes?: string;
40
42
  }
@@ -71,7 +73,7 @@ export interface PostActionRequest {
71
73
  */
72
74
  export interface ExternalStudyQueryFilters {
73
75
  status?: StudyStatus | StudyStatus[];
74
- requestingDoctorId?: string;
76
+ responsibleDoctorId?: string;
75
77
  qvetSupplierId?: number;
76
78
  studyTypeId?: string;
77
79
  /** ISO date strings */
@@ -15,13 +15,11 @@ export interface ExternalStudyResponse {
15
15
  patientName: string;
16
16
  clientName?: string;
17
17
  studyTypeId: string;
18
- studyTypeName: string;
19
18
  studyTypeCategory: StudyCategory;
20
19
  studyTypeDetail?: string;
21
20
  qvetSupplierId: number;
22
- supplierName: string;
23
- requestingDoctorId: string;
24
- requestingDoctorName: string;
21
+ responsibleDoctorId: string;
22
+ requestedById: string;
25
23
  status: StudyStatus;
26
24
  requestedAt: string;
27
25
  sentAt?: string;
@@ -42,14 +40,19 @@ export interface ExternalStudyResponse {
42
40
  }
43
41
  /**
44
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
45
  */
46
46
  export interface ExternalStudyPendingItem {
47
47
  id: string;
48
48
  patientName: string;
49
- studyTypeName: string;
49
+ clientName?: string;
50
+ studyTypeId: string;
50
51
  studyTypeCategory: StudyCategory;
51
- supplierName: string;
52
- requestingDoctorName: string;
52
+ studyTypeDetail?: string;
53
+ qvetSupplierId: number;
54
+ responsibleDoctorId: string;
55
+ requestedById: string;
53
56
  status: StudyStatus;
54
57
  requestedAt: string;
55
58
  daysSinceRequested: number;
@@ -9,23 +9,26 @@
9
9
  * Workflow state of an external study.
10
10
  *
11
11
  * Transitions:
12
- * solicitadoenviadoresultado_recibidocerrado
13
- *
14
- * cancelado (from any active state)
12
+ * requestedsentresult_receivedclosed
13
+ *
14
+ * cancelled (from any active state)
15
+ *
16
+ * Spanish UI labels are in `STUDY_STATUS_LABELS` — code/DB always uses English.
15
17
  *
16
18
  * Post-received actions (sentToInternalWhatsappAt, uploadedToQvetAt,
17
19
  * informedClientAt) are independent timestamps — not states.
18
20
  */
19
21
  export declare enum StudyStatus {
20
- solicitado = "solicitado",
21
- enviado = "enviado",
22
- resultado_recibido = "resultado_recibido",
23
- cerrado = "cerrado",
24
- cancelado = "cancelado"
22
+ requested = "requested",
23
+ sent = "sent",
24
+ result_received = "result_received",
25
+ closed = "closed",
26
+ cancelled = "cancelled"
25
27
  }
28
+ /** UI-only labels (Spanish). Code uses English enum values everywhere else. */
26
29
  export declare const STUDY_STATUS_LABELS: Record<StudyStatus, string>;
27
30
  /**
28
- * Active states (not cerrado/cancelado). Used to filter pending dashboards.
31
+ * Active states (not closed/cancelled). Used to filter pending dashboards.
29
32
  */
30
33
  export declare const ACTIVE_STUDY_STATUSES: ReadonlyArray<StudyStatus>;
31
34
  /**
@@ -12,35 +12,38 @@ exports.OVERDUE_THRESHOLD_DAYS = exports.ACTIVE_STUDY_STATUSES = exports.STUDY_S
12
12
  * Workflow state of an external study.
13
13
  *
14
14
  * Transitions:
15
- * solicitadoenviadoresultado_recibidocerrado
16
- *
17
- * cancelado (from any active state)
15
+ * requestedsentresult_receivedclosed
16
+ *
17
+ * cancelled (from any active state)
18
+ *
19
+ * Spanish UI labels are in `STUDY_STATUS_LABELS` — code/DB always uses English.
18
20
  *
19
21
  * Post-received actions (sentToInternalWhatsappAt, uploadedToQvetAt,
20
22
  * informedClientAt) are independent timestamps — not states.
21
23
  */
22
24
  var StudyStatus;
23
25
  (function (StudyStatus) {
24
- StudyStatus["solicitado"] = "solicitado";
25
- StudyStatus["enviado"] = "enviado";
26
- StudyStatus["resultado_recibido"] = "resultado_recibido";
27
- StudyStatus["cerrado"] = "cerrado";
28
- StudyStatus["cancelado"] = "cancelado";
26
+ StudyStatus["requested"] = "requested";
27
+ StudyStatus["sent"] = "sent";
28
+ StudyStatus["result_received"] = "result_received";
29
+ StudyStatus["closed"] = "closed";
30
+ StudyStatus["cancelled"] = "cancelled";
29
31
  })(StudyStatus || (exports.StudyStatus = StudyStatus = {}));
32
+ /** UI-only labels (Spanish). Code uses English enum values everywhere else. */
30
33
  exports.STUDY_STATUS_LABELS = {
31
- [StudyStatus.solicitado]: 'Solicitado',
32
- [StudyStatus.enviado]: 'Enviado',
33
- [StudyStatus.resultado_recibido]: 'Resultado recibido',
34
- [StudyStatus.cerrado]: 'Cerrado',
35
- [StudyStatus.cancelado]: 'Cancelado',
34
+ [StudyStatus.requested]: 'Solicitado',
35
+ [StudyStatus.sent]: 'Enviado',
36
+ [StudyStatus.result_received]: 'Resultado recibido',
37
+ [StudyStatus.closed]: 'Cerrado',
38
+ [StudyStatus.cancelled]: 'Cancelado',
36
39
  };
37
40
  /**
38
- * Active states (not cerrado/cancelado). Used to filter pending dashboards.
41
+ * Active states (not closed/cancelled). Used to filter pending dashboards.
39
42
  */
40
43
  exports.ACTIVE_STUDY_STATUSES = [
41
- StudyStatus.solicitado,
42
- StudyStatus.enviado,
43
- StudyStatus.resultado_recibido,
44
+ StudyStatus.requested,
45
+ StudyStatus.sent,
46
+ StudyStatus.result_received,
44
47
  ];
45
48
  /**
46
49
  * Overdue thresholds in days (per category). Hardcoded for now; can move to
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hvp-shared",
3
- "version": "7.5.0",
3
+ "version": "7.6.0",
4
4
  "description": "Shared types and utilities for HVP backend and frontend",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",