@tekkare/romulus 0.1.344 → 0.1.345
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
|
@@ -535,40 +535,69 @@ const alertRecords = computed(() =>
|
|
|
535
535
|
|
|
536
536
|
/**
|
|
537
537
|
* Acces derogatoires ANSM de la marque (AAC, AAP, CPC, ATU, RTU, AMM), lus
|
|
538
|
-
* dans leur index par `brand_group`,
|
|
539
|
-
*
|
|
540
|
-
*
|
|
538
|
+
* dans leur index par `brand_group`, la plus recente en tete. Pas dans le
|
|
539
|
+
* nested `derogatory_access` de la fiche HAS : deux produits sur trois n'ont
|
|
540
|
+
* pas de fiche HAS, l'onglet doit exister sans elle.
|
|
541
|
+
*
|
|
542
|
+
* L'index porte un document par indication (nov. 2026 : Keytruda passe de 3 a
|
|
543
|
+
* 16 documents). L'onglet garde une entree par produit et dispositif, comme
|
|
544
|
+
* avant : les indications sont regroupees, l'en-tete compte leurs etats et le
|
|
545
|
+
* detail donne une section par indication, avec son etat et sa date.
|
|
541
546
|
*/
|
|
542
|
-
const derogatoryRecords = computed(() =>
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
+
const derogatoryRecords = computed(() => {
|
|
548
|
+
const english = locale.value === "en";
|
|
549
|
+
const groups = new Map<string, any[]>();
|
|
550
|
+
for (const hit of resultsQueryDerogatory.value) {
|
|
551
|
+
const row = hit._source ?? {};
|
|
552
|
+
// Sans dispositif, rien a quoi la rattacher : la ligne reste seule.
|
|
553
|
+
const key = row.scheme_type ? `${row.drug_id}|${row.scheme_type}` : hit._id;
|
|
554
|
+
if (!groups.has(key)) groups.set(key, []);
|
|
555
|
+
groups.get(key)!.push(row);
|
|
556
|
+
}
|
|
557
|
+
|
|
558
|
+
return [...groups.entries()]
|
|
559
|
+
.map(([key, group]) => {
|
|
560
|
+
const rows = [...group].sort((a, b) =>
|
|
561
|
+
String(derogatoryDate(b) ?? "").localeCompare(String(derogatoryDate(a) ?? ""))
|
|
562
|
+
);
|
|
563
|
+
// Champs du produit (nom, titulaire, statut actuel...) : communs aux indications.
|
|
564
|
+
const row = rows[0];
|
|
565
|
+
const single = rows.length === 1;
|
|
547
566
|
const lastRenewal = [...(row.renewal_date ?? [])].sort().at(-1);
|
|
548
567
|
const milestones = [
|
|
549
568
|
[english ? "Published" : "Publié", row.published_date],
|
|
550
569
|
[english ? "Updated" : "Mis à jour", row.updated_date],
|
|
551
|
-
[english ? "Granted" : "Octroi", row.granted_date],
|
|
570
|
+
[english ? "Granted" : "Octroi", single && row.granted_date],
|
|
552
571
|
[english ? "Marketing authorisation" : "AMM", row.marketing_authorization_date],
|
|
553
|
-
[english ? "Last renewal" : "Dernier renouvellement", lastRenewal],
|
|
554
|
-
[english ? "Stopped" : "Arrêt", row.stopped_date],
|
|
555
|
-
[english ? "Refused" : "Refus", row.refused_date],
|
|
572
|
+
[english ? "Last renewal" : "Dernier renouvellement", single && lastRenewal],
|
|
573
|
+
[english ? "Stopped" : "Arrêt", single && row.stopped_date],
|
|
574
|
+
[english ? "Refused" : "Refus", single && row.refused_date],
|
|
556
575
|
]
|
|
557
576
|
.filter(([, date]) => date)
|
|
558
577
|
.map(([label, date]) => `${label} : ${date}`);
|
|
578
|
+
const textSections = single
|
|
579
|
+
? [{ key: "text", label: english ? "ANSM text" : "Texte ANSM", body: row.status_text || "" }]
|
|
580
|
+
: rows.map((r, i) => ({
|
|
581
|
+
key: `text-${r.indication_hash || i}`,
|
|
582
|
+
label: derogatoryIndicationLabel(r, english),
|
|
583
|
+
body: r.status_text || "",
|
|
584
|
+
}));
|
|
559
585
|
return {
|
|
560
|
-
key
|
|
586
|
+
key,
|
|
561
587
|
typeLabel: row.scheme_type || "ANSM",
|
|
562
588
|
icon: "Key",
|
|
563
|
-
date: row
|
|
589
|
+
date: derogatoryDate(row),
|
|
564
590
|
url: row.url_link || null,
|
|
565
591
|
title: pickText(row.drug_name) || row.scheme_type || "ANSM",
|
|
566
|
-
excerpt:
|
|
567
|
-
status: row.state_label || null,
|
|
592
|
+
excerpt: rows.map((r) => r.status_text).filter(Boolean).join("\n\n") || null,
|
|
593
|
+
status: single ? row.state_label || null : null,
|
|
568
594
|
statusTone: derogatoryTone(row.state_label),
|
|
595
|
+
statuses: single ? undefined : derogatoryStateCounts(rows),
|
|
596
|
+
// Une rubrique par indication : jusqu'a une quinzaine, trop pour des onglets.
|
|
597
|
+
layout: single ? undefined : ("accordion" as const),
|
|
569
598
|
sourceLabel: sourceName(HEART_SOURCE_UUIDS.ANSM),
|
|
570
599
|
sections: [
|
|
571
|
-
|
|
600
|
+
...textSections,
|
|
572
601
|
{
|
|
573
602
|
key: "context",
|
|
574
603
|
label: english ? "Framework" : "Cadre",
|
|
@@ -583,14 +612,60 @@ const derogatoryRecords = computed(() =>
|
|
|
583
612
|
.join("\n"),
|
|
584
613
|
},
|
|
585
614
|
],
|
|
586
|
-
documents: ansmDocumentsOf(
|
|
615
|
+
documents: ansmDocumentsOf(rows.flatMap((r) => r.document_url ?? []), locale.value),
|
|
587
616
|
};
|
|
588
617
|
})
|
|
589
|
-
// Rangees sur la date affichee
|
|
590
|
-
//
|
|
591
|
-
//
|
|
592
|
-
.sort((a, b) => String(b.date ?? "").localeCompare(String(a.date ?? "")))
|
|
593
|
-
);
|
|
618
|
+
// Rangees sur la date affichee, celle qui fait aussi le groupe d'annee :
|
|
619
|
+
// triees sur la publication, une AAP publiee en 2021 et refusee en 2023
|
|
620
|
+
// passait sous l'annee 2021.
|
|
621
|
+
.sort((a, b) => String(b.date ?? "").localeCompare(String(a.date ?? "")));
|
|
622
|
+
});
|
|
623
|
+
|
|
624
|
+
/**
|
|
625
|
+
* Date d'une indication selon son etat : octroi si elle court, arret si elle
|
|
626
|
+
* est arretee, refus si elle est refusee. Les autres etats gardent la
|
|
627
|
+
* premiere date connue, la publication en dernier recours.
|
|
628
|
+
*/
|
|
629
|
+
function derogatoryDate(row: any): string | null {
|
|
630
|
+
const state = (row.state_label || "").toLowerCase();
|
|
631
|
+
const fallback = row.refused_date || row.stopped_date || row.granted_date || row.published_date || null;
|
|
632
|
+
if (state === "en cours") return row.granted_date || fallback;
|
|
633
|
+
if (state.startsWith("arr")) return row.stopped_date || fallback;
|
|
634
|
+
if (state.startsWith("refus")) return row.refused_date || fallback;
|
|
635
|
+
return fallback;
|
|
636
|
+
}
|
|
637
|
+
|
|
638
|
+
/** « Arrêtée, arrêt : 2026-03-31 », titre de la section d'une indication. */
|
|
639
|
+
function derogatoryIndicationLabel(row: any, english: boolean): string {
|
|
640
|
+
const state = (row.state_label || "").toLowerCase();
|
|
641
|
+
const date = derogatoryDate(row);
|
|
642
|
+
const kind = state === "en cours"
|
|
643
|
+
? english ? "granted" : "octroi"
|
|
644
|
+
: state.startsWith("arr")
|
|
645
|
+
? english ? "stopped" : "arrêt"
|
|
646
|
+
: state.startsWith("refus")
|
|
647
|
+
? english ? "refused" : "refus"
|
|
648
|
+
: null;
|
|
649
|
+
const head = row.state_label || "Indication";
|
|
650
|
+
if (!date) return head;
|
|
651
|
+
return kind ? `${head}, ${kind} : ${date}` : `${head} : ${date}`;
|
|
652
|
+
}
|
|
653
|
+
|
|
654
|
+
/** Une pastille par etat, avec son nombre d'indications : « 2 En cours », « 11 Arrêtées ». */
|
|
655
|
+
function derogatoryStateCounts(rows: any[]): Array<{ label: string; tone: "good" | "bad" | "neutral" }> {
|
|
656
|
+
const counts = new Map<string, number>();
|
|
657
|
+
rows.forEach((r) => {
|
|
658
|
+
const state = r.state_label || "";
|
|
659
|
+
if (state) counts.set(state, (counts.get(state) ?? 0) + 1);
|
|
660
|
+
});
|
|
661
|
+
const order = { good: 0, bad: 1, neutral: 2 };
|
|
662
|
+
return [...counts.entries()]
|
|
663
|
+
.map(([state, n]) => ({
|
|
664
|
+
label: `${n} ${n > 1 && /ée$/.test(state) ? `${state}s` : state}`,
|
|
665
|
+
tone: derogatoryTone(state),
|
|
666
|
+
}))
|
|
667
|
+
.sort((a, b) => order[a.tone] - order[b.tone]);
|
|
668
|
+
}
|
|
594
669
|
|
|
595
670
|
/** Etat ANSM : en cours ou accorde se lit bien, refuse ou defavorable mal. */
|
|
596
671
|
function derogatoryTone(state: string): "good" | "bad" | "neutral" {
|
|
@@ -21,6 +21,8 @@ const props = defineProps<{
|
|
|
21
21
|
title: string;
|
|
22
22
|
status?: string | null;
|
|
23
23
|
statusTone?: "good" | "bad" | "neutral";
|
|
24
|
+
/** Plusieurs etats a la fois, a la suite du statut (cf. RecordList). */
|
|
25
|
+
statuses?: Array<{ label: string; tone?: "good" | "bad" | "neutral" }>;
|
|
24
26
|
url?: string | null;
|
|
25
27
|
/** « accordion » quand les rubriques sont trop nombreuses pour des
|
|
26
28
|
onglets (contributions patients) ; onglets par defaut. */
|
|
@@ -160,10 +162,16 @@ onBeforeUnmount(() => document.removeEventListener("keydown", onKeydown));
|
|
|
160
162
|
</p>
|
|
161
163
|
<h2 class="rdr_title">{{ record.title }}</h2>
|
|
162
164
|
|
|
163
|
-
<div v-if="record.status || record.badge" class="rdr_tags">
|
|
165
|
+
<div v-if="record.status || record.statuses?.length || record.badge" class="rdr_tags">
|
|
164
166
|
<span v-if="record.status" class="rdr_status" :class="`is_${record.statusTone || 'neutral'}`">
|
|
165
167
|
{{ record.status }}
|
|
166
168
|
</span>
|
|
169
|
+
<span
|
|
170
|
+
v-for="s in record.statuses ?? []"
|
|
171
|
+
:key="s.label"
|
|
172
|
+
class="rdr_status"
|
|
173
|
+
:class="`is_${s.tone || 'neutral'}`"
|
|
174
|
+
>{{ s.label }}</span>
|
|
167
175
|
<span
|
|
168
176
|
v-if="record.badge"
|
|
169
177
|
class="rdr_badge"
|
|
@@ -25,6 +25,8 @@ export type ListRecord = {
|
|
|
25
25
|
excerpt?: string | null;
|
|
26
26
|
status?: string | null;
|
|
27
27
|
statusTone?: "good" | "bad" | "neutral";
|
|
28
|
+
/** Plusieurs etats a la fois (« 2 En cours », « 11 Arrêtées »), a la suite du statut. */
|
|
29
|
+
statuses?: Array<{ label: string; tone?: "good" | "bad" | "neutral" }>;
|
|
28
30
|
};
|
|
29
31
|
|
|
30
32
|
const props = defineProps<{
|
|
@@ -124,10 +126,16 @@ const years = computed(() => {
|
|
|
124
126
|
<h3 class="rl_card_title">{{ record.title }}</h3>
|
|
125
127
|
<p v-if="record.excerpt" class="rl_excerpt">{{ record.excerpt }}</p>
|
|
126
128
|
|
|
127
|
-
<div v-if="record.status || record.badge" class="rl_tags">
|
|
129
|
+
<div v-if="record.status || record.statuses?.length || record.badge" class="rl_tags">
|
|
128
130
|
<span v-if="record.status" class="rl_status" :class="`is_${record.statusTone || 'neutral'}`">
|
|
129
131
|
{{ record.status }}
|
|
130
132
|
</span>
|
|
133
|
+
<span
|
|
134
|
+
v-for="s in record.statuses ?? []"
|
|
135
|
+
:key="s.label"
|
|
136
|
+
class="rl_status"
|
|
137
|
+
:class="`is_${s.tone || 'neutral'}`"
|
|
138
|
+
>{{ s.label }}</span>
|
|
131
139
|
<span
|
|
132
140
|
v-if="record.badge"
|
|
133
141
|
class="rl_badge"
|