@tekkare/romulus 0.1.344 → 0.1.346
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,76 @@ 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
|
+
// Une fiche par dispositif pour la marque, toutes presentations
|
|
553
|
+
// confondues. Sans dispositif, la ligne reste seule.
|
|
554
|
+
const key = row.scheme_type ? row.scheme_type : hit._id;
|
|
555
|
+
if (!groups.has(key)) groups.set(key, []);
|
|
556
|
+
groups.get(key)!.push(row);
|
|
557
|
+
}
|
|
558
|
+
|
|
559
|
+
return [...groups.entries()]
|
|
560
|
+
.map(([key, group]) => {
|
|
561
|
+
const rows = [...group].sort((a, b) =>
|
|
562
|
+
String(derogatoryDate(b) ?? "").localeCompare(String(derogatoryDate(a) ?? ""))
|
|
563
|
+
);
|
|
564
|
+
// Champs du produit (nom, titulaire, statut actuel...) : communs aux indications.
|
|
565
|
+
const row = rows[0];
|
|
566
|
+
const single = rows.length === 1;
|
|
567
|
+
// Presentations du dispositif : leur nom, ou leur nombre s'il y en a plusieurs
|
|
568
|
+
// (certains noms ANSM embarquent l'indication et font un paragraphe).
|
|
569
|
+
const presentations = [...new Set(rows.map((r) => pickText(r.drug_name)).filter(Boolean))];
|
|
547
570
|
const lastRenewal = [...(row.renewal_date ?? [])].sort().at(-1);
|
|
548
571
|
const milestones = [
|
|
549
572
|
[english ? "Published" : "Publié", row.published_date],
|
|
550
573
|
[english ? "Updated" : "Mis à jour", row.updated_date],
|
|
551
|
-
[english ? "Granted" : "Octroi", row.granted_date],
|
|
574
|
+
[english ? "Granted" : "Octroi", single && row.granted_date],
|
|
552
575
|
[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],
|
|
576
|
+
[english ? "Last renewal" : "Dernier renouvellement", single && lastRenewal],
|
|
577
|
+
[english ? "Stopped" : "Arrêt", single && row.stopped_date],
|
|
578
|
+
[english ? "Refused" : "Refus", single && row.refused_date],
|
|
556
579
|
]
|
|
557
580
|
.filter(([, date]) => date)
|
|
558
581
|
.map(([label, date]) => `${label} : ${date}`);
|
|
582
|
+
const textSections = single
|
|
583
|
+
? [{ key: "text", label: english ? "ANSM text" : "Texte ANSM", body: row.status_text || "" }]
|
|
584
|
+
: rows.map((r, i) => ({
|
|
585
|
+
key: `text-${r.indication_hash || i}`,
|
|
586
|
+
label: derogatoryIndicationLabel(r, english),
|
|
587
|
+
body: r.status_text || "",
|
|
588
|
+
}));
|
|
559
589
|
return {
|
|
560
|
-
key
|
|
590
|
+
key,
|
|
561
591
|
typeLabel: row.scheme_type || "ANSM",
|
|
562
592
|
icon: "Key",
|
|
563
|
-
date: row
|
|
593
|
+
date: derogatoryDate(row),
|
|
564
594
|
url: row.url_link || null,
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
595
|
+
// Le dispositif fait le titre, les presentations le sous-titre.
|
|
596
|
+
title: derogatorySchemeLabel(row.scheme_type, english) || pickText(row.drug_name) || "ANSM",
|
|
597
|
+
excerpt: presentations.length > 1
|
|
598
|
+
? `${presentations.length} ${english ? "presentations" : "présentations"}`
|
|
599
|
+
: presentations[0] || null,
|
|
600
|
+
status: single ? row.state_label || null : null,
|
|
568
601
|
statusTone: derogatoryTone(row.state_label),
|
|
602
|
+
statuses: single ? undefined : derogatoryStateCounts(rows),
|
|
603
|
+
// Une rubrique par indication : jusqu'a une quinzaine, trop pour des onglets.
|
|
604
|
+
layout: single ? undefined : ("accordion" as const),
|
|
569
605
|
sourceLabel: sourceName(HEART_SOURCE_UUIDS.ANSM),
|
|
570
606
|
sections: [
|
|
571
|
-
|
|
607
|
+
...textSections,
|
|
572
608
|
{
|
|
573
609
|
key: "context",
|
|
574
610
|
label: english ? "Framework" : "Cadre",
|
|
@@ -583,14 +619,78 @@ const derogatoryRecords = computed(() =>
|
|
|
583
619
|
.join("\n"),
|
|
584
620
|
},
|
|
585
621
|
],
|
|
586
|
-
documents: ansmDocumentsOf(
|
|
622
|
+
documents: ansmDocumentsOf(rows.flatMap((r) => r.document_url ?? []), locale.value),
|
|
587
623
|
};
|
|
588
624
|
})
|
|
589
|
-
// Rangees sur la date affichee
|
|
590
|
-
//
|
|
591
|
-
//
|
|
592
|
-
.sort((a, b) => String(b.date ?? "").localeCompare(String(a.date ?? "")))
|
|
593
|
-
);
|
|
625
|
+
// Rangees sur la date affichee, celle qui fait aussi le groupe d'annee :
|
|
626
|
+
// triees sur la publication, une AAP publiee en 2021 et refusee en 2023
|
|
627
|
+
// passait sous l'annee 2021.
|
|
628
|
+
.sort((a, b) => String(b.date ?? "").localeCompare(String(a.date ?? "")));
|
|
629
|
+
});
|
|
630
|
+
|
|
631
|
+
const DEROGATORY_SCHEMES: Record<string, { fr: string; en: string }> = {
|
|
632
|
+
AAC: { fr: "Autorisation d'accès compassionnel", en: "Compassionate access authorisation" },
|
|
633
|
+
AAP: { fr: "Autorisation d'accès précoce", en: "Early access authorisation" },
|
|
634
|
+
CPC: { fr: "Cadre de prescription compassionnelle", en: "Compassionate prescription framework" },
|
|
635
|
+
ATU: { fr: "Autorisation temporaire d'utilisation", en: "Temporary use authorisation" },
|
|
636
|
+
ATUc: { fr: "ATU de cohorte", en: "Cohort temporary use authorisation" },
|
|
637
|
+
ATUn: { fr: "ATU nominative", en: "Named-patient temporary use authorisation" },
|
|
638
|
+
RTU: { fr: "Recommandation temporaire d'utilisation", en: "Temporary use recommendation" },
|
|
639
|
+
AMM: { fr: "Autorisation de mise sur le marché", en: "Marketing authorisation" },
|
|
640
|
+
};
|
|
641
|
+
|
|
642
|
+
/** « Autorisation d'accès précoce (AAP) » ; le sigle seul s'il est inconnu. */
|
|
643
|
+
function derogatorySchemeLabel(scheme: string | undefined, english: boolean): string {
|
|
644
|
+
if (!scheme) return "";
|
|
645
|
+
const labels = DEROGATORY_SCHEMES[scheme];
|
|
646
|
+
return labels ? `${english ? labels.en : labels.fr} (${scheme})` : scheme;
|
|
647
|
+
}
|
|
648
|
+
|
|
649
|
+
/**
|
|
650
|
+
* Date d'une indication selon son etat : octroi si elle court, arret si elle
|
|
651
|
+
* est arretee, refus si elle est refusee. Les autres etats gardent la
|
|
652
|
+
* premiere date connue, la publication en dernier recours.
|
|
653
|
+
*/
|
|
654
|
+
function derogatoryDate(row: any): string | null {
|
|
655
|
+
const state = (row.state_label || "").toLowerCase();
|
|
656
|
+
const fallback = row.refused_date || row.stopped_date || row.granted_date || row.published_date || null;
|
|
657
|
+
if (state === "en cours") return row.granted_date || fallback;
|
|
658
|
+
if (state.startsWith("arr")) return row.stopped_date || fallback;
|
|
659
|
+
if (state.startsWith("refus")) return row.refused_date || fallback;
|
|
660
|
+
return fallback;
|
|
661
|
+
}
|
|
662
|
+
|
|
663
|
+
/** « Arrêtée, arrêt : 2026-03-31 », titre de la section d'une indication. */
|
|
664
|
+
function derogatoryIndicationLabel(row: any, english: boolean): string {
|
|
665
|
+
const state = (row.state_label || "").toLowerCase();
|
|
666
|
+
const date = derogatoryDate(row);
|
|
667
|
+
const kind = state === "en cours"
|
|
668
|
+
? english ? "granted" : "octroi"
|
|
669
|
+
: state.startsWith("arr")
|
|
670
|
+
? english ? "stopped" : "arrêt"
|
|
671
|
+
: state.startsWith("refus")
|
|
672
|
+
? english ? "refused" : "refus"
|
|
673
|
+
: null;
|
|
674
|
+
const head = row.state_label || "Indication";
|
|
675
|
+
if (!date) return head;
|
|
676
|
+
return kind ? `${head}, ${kind} : ${date}` : `${head} : ${date}`;
|
|
677
|
+
}
|
|
678
|
+
|
|
679
|
+
/** Une pastille par etat, avec son nombre d'indications : « 2 En cours », « 11 Arrêtées ». */
|
|
680
|
+
function derogatoryStateCounts(rows: any[]): Array<{ label: string; tone: "good" | "bad" | "neutral" }> {
|
|
681
|
+
const counts = new Map<string, number>();
|
|
682
|
+
rows.forEach((r) => {
|
|
683
|
+
const state = r.state_label || "";
|
|
684
|
+
if (state) counts.set(state, (counts.get(state) ?? 0) + 1);
|
|
685
|
+
});
|
|
686
|
+
const order = { good: 0, bad: 1, neutral: 2 };
|
|
687
|
+
return [...counts.entries()]
|
|
688
|
+
.map(([state, n]) => ({
|
|
689
|
+
label: `${n} ${n > 1 && /ée$/.test(state) ? `${state}s` : state}`,
|
|
690
|
+
tone: derogatoryTone(state),
|
|
691
|
+
}))
|
|
692
|
+
.sort((a, b) => order[a.tone] - order[b.tone]);
|
|
693
|
+
}
|
|
594
694
|
|
|
595
695
|
/** Etat ANSM : en cours ou accorde se lit bien, refuse ou defavorable mal. */
|
|
596
696
|
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"
|