@tekkare/romulus 0.1.270 → 0.1.271
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/module.json
CHANGED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Les familles qu'Italy One range dans un projet, decrites pour tout le
|
|
3
|
+
* portail : actes reglementaires de l'AIFA (Trovanorme) et prix des
|
|
4
|
+
* presentations italiennes (Price Tracker). Pas de vue dediee : la ligne du
|
|
5
|
+
* projet mene a la page de l'app, le tiroir montre l'en-tete et le lien vers
|
|
6
|
+
* Italy One.
|
|
7
|
+
*
|
|
8
|
+
* Index lus sur le cluster `drugs` (meme domaine que fr_drugs_app ; chaque app
|
|
9
|
+
* y joint sa propre cle, cf. runtimeConfig.oipEs.drugs).
|
|
10
|
+
*
|
|
11
|
+
* Importe aussi par le serveur : pas d'import propre a Vue ou a Nuxt ici.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
import type { RmProjectKind } from "@tekkare/romulus/utils/projects";
|
|
15
|
+
|
|
16
|
+
const ITALY = { fr: "Italie", en: "Italy" };
|
|
17
|
+
|
|
18
|
+
const day = (value: unknown) => String(value ?? "").slice(0, 10);
|
|
19
|
+
|
|
20
|
+
export const ITALY_PROJECT_KINDS: RmProjectKind[] = [
|
|
21
|
+
{
|
|
22
|
+
// Un acte de l'AIFA (`_id` = opinion_id, ex. TNF_<uuid>). Une carte marque
|
|
23
|
+
// range son dernier acte ; la page de la marque les montre tous.
|
|
24
|
+
type: "ItApproval",
|
|
25
|
+
index: "it__drug_opinion__aifa",
|
|
26
|
+
label: { fr: "Actes de l'AIFA", en: "AIFA acts" },
|
|
27
|
+
section: ITALY,
|
|
28
|
+
icon: "Certificate",
|
|
29
|
+
source: ["brand", "molecule", "nature_of_request", "nature_of_request_en", "decision_date", "has_code"],
|
|
30
|
+
title: (s) => String(s?.brand ?? ""),
|
|
31
|
+
subtitle: (s, lang) =>
|
|
32
|
+
[lang === "en" ? s?.nature_of_request_en || s?.nature_of_request : s?.nature_of_request, day(s?.decision_date)]
|
|
33
|
+
.filter(Boolean)
|
|
34
|
+
.join(" · "),
|
|
35
|
+
path: (s) => (s?.brand ? `/approvals/details/${encodeURIComponent(s.brand)}/` : "/approvals"),
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
// Une presentation du Price Tracker (`_id` = it_<AIC>_1). Une carte marque
|
|
39
|
+
// range ses presentations.
|
|
40
|
+
type: "ItDrugPrice",
|
|
41
|
+
index: "ope__ww_price_tracker__tekkare",
|
|
42
|
+
label: { fr: "Prix (Italie)", en: "Prices (Italy)" },
|
|
43
|
+
section: ITALY,
|
|
44
|
+
icon: "Tag",
|
|
45
|
+
source: ["brand", "label_local", "local_drug_id", "manufacturer_regroup", "manufacturer"],
|
|
46
|
+
title: (s) => String(s?.label_local ?? s?.brand ?? ""),
|
|
47
|
+
subtitle: (s) =>
|
|
48
|
+
[s?.brand, s?.local_drug_id ? `AIC ${s.local_drug_id}` : "", s?.manufacturer_regroup ?? s?.manufacturer]
|
|
49
|
+
.filter(Boolean)
|
|
50
|
+
.join(" · "),
|
|
51
|
+
path: (s, id) => {
|
|
52
|
+
const aic = s?.local_drug_id ?? id.replace(/^it_/, "").replace(/_\d+$/, "");
|
|
53
|
+
return `/price-tracker/details/${encodeURIComponent(aic)}?c=it`;
|
|
54
|
+
},
|
|
55
|
+
titleFromId: (id) => `AIC ${id.replace(/^it_/, "").replace(/_\d+$/, "")}`,
|
|
56
|
+
},
|
|
57
|
+
];
|
|
@@ -19,6 +19,7 @@ import { DRUG_PROJECT_KINDS } from "../oip-drugs/kinds";
|
|
|
19
19
|
import { OIP_PATIENT_INDEXES } from "../oip-patients/indexes";
|
|
20
20
|
import { PATIENT_KIND, VACCINE_KIND } from "../oip-patients/kinds";
|
|
21
21
|
import { GERMANY_PROJECT_KINDS } from "../oip-germany/kinds";
|
|
22
|
+
import { ITALY_PROJECT_KINDS } from "../oip-italy/kinds";
|
|
22
23
|
|
|
23
24
|
/** Les apps qui ont des fiches a montrer, et ou les ouvrir. */
|
|
24
25
|
export const OIP_RESOURCE_APPS = {
|
|
@@ -38,6 +39,10 @@ export const OIP_RESOURCE_APPS = {
|
|
|
38
39
|
name: "Germany One",
|
|
39
40
|
url: "https://germany-one.app.tekkare.com",
|
|
40
41
|
},
|
|
42
|
+
italy_one_app: {
|
|
43
|
+
name: "Italy One",
|
|
44
|
+
url: "https://italy-one.app.tekkare.com",
|
|
45
|
+
},
|
|
41
46
|
} as const;
|
|
42
47
|
|
|
43
48
|
export type OipResourceApp = keyof typeof OIP_RESOURCE_APPS;
|
|
@@ -171,6 +176,23 @@ function germanySpec(kind: RmProjectKind): OipResourceSpec {
|
|
|
171
176
|
};
|
|
172
177
|
}
|
|
173
178
|
|
|
179
|
+
/**
|
|
180
|
+
* Une fiche d'Italy One, lue sur le cluster `drugs`. Sans vue ni onglets : la
|
|
181
|
+
* ligne du projet mene a la page de l'app qui la montre.
|
|
182
|
+
*/
|
|
183
|
+
function italySpec(kind: RmProjectKind): OipResourceSpec {
|
|
184
|
+
return {
|
|
185
|
+
type: kind.type,
|
|
186
|
+
app: "italy_one_app",
|
|
187
|
+
cluster: "drugs",
|
|
188
|
+
kind,
|
|
189
|
+
routeId: (id) => id,
|
|
190
|
+
base: () => "",
|
|
191
|
+
tabs: [],
|
|
192
|
+
detailPath: (id, _tab, doc) => kind.path?.(doc ?? {}, id) ?? "",
|
|
193
|
+
};
|
|
194
|
+
}
|
|
195
|
+
|
|
174
196
|
/** La vue de chaque famille de fr_drugs_app (cf. useOipResourceViews). */
|
|
175
197
|
const DRUG_VIEWS: Record<string, string> = {
|
|
176
198
|
FrHasBrand: "drugs-brand",
|
|
@@ -402,6 +424,7 @@ export const OIP_RESOURCE_SPECS: OipResourceSpec[] = [
|
|
|
402
424
|
patientsSpec(PATIENT_KIND, "patients-patient"),
|
|
403
425
|
patientsSpec(VACCINE_KIND, "patients-vaccine"),
|
|
404
426
|
...GERMANY_PROJECT_KINDS.map(germanySpec),
|
|
427
|
+
...ITALY_PROJECT_KINDS.map(italySpec),
|
|
405
428
|
];
|
|
406
429
|
|
|
407
430
|
export function oipResourceSpec(type: string): OipResourceSpec | undefined {
|