@tekkare/romulus 0.1.347 → 0.1.348
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
|
@@ -588,13 +588,21 @@ const derogatoryRecords = computed(() => {
|
|
|
588
588
|
]
|
|
589
589
|
.filter(([, date]) => date)
|
|
590
590
|
.map(([label, date]) => `${label} : ${date}`);
|
|
591
|
+
// Une indication : son texte. Plusieurs : une frise, l'etat en tag et sa date
|
|
592
|
+
// (octroi si en cours, arret si arretee, refus si refusee).
|
|
591
593
|
const textSections = single
|
|
592
594
|
? [{ key: "text", label: english ? "ANSM text" : "Texte ANSM", body: row.status_text || "" }]
|
|
593
|
-
:
|
|
594
|
-
key:
|
|
595
|
-
label:
|
|
596
|
-
body:
|
|
597
|
-
|
|
595
|
+
: [{
|
|
596
|
+
key: "indications",
|
|
597
|
+
label: `${rows.length} indications`,
|
|
598
|
+
body: "",
|
|
599
|
+
items: rows.map((r, i) => ({
|
|
600
|
+
key: `text-${r.indication_hash || i}`,
|
|
601
|
+
tag: r.state_label ? { label: r.state_label, tone: derogatoryTone(r.state_label) } : null,
|
|
602
|
+
date: derogatoryDate(r),
|
|
603
|
+
body: r.status_text || "",
|
|
604
|
+
})),
|
|
605
|
+
}];
|
|
598
606
|
return {
|
|
599
607
|
key,
|
|
600
608
|
typeLabel: row.scheme_type || "ANSM",
|
|
@@ -609,8 +617,6 @@ const derogatoryRecords = computed(() => {
|
|
|
609
617
|
status: single ? row.state_label || null : null,
|
|
610
618
|
statusTone: derogatoryTone(row.state_label),
|
|
611
619
|
statuses: single ? undefined : derogatoryStateCounts(rows),
|
|
612
|
-
// Une rubrique par indication : jusqu'a une quinzaine, trop pour des onglets.
|
|
613
|
-
layout: single ? undefined : ("accordion" as const),
|
|
614
620
|
sourceLabel: sourceName(HEART_SOURCE_UUIDS.ANSM),
|
|
615
621
|
sections: [
|
|
616
622
|
...textSections,
|
|
@@ -669,22 +675,6 @@ function derogatoryDate(row: any): string | null {
|
|
|
669
675
|
return fallback;
|
|
670
676
|
}
|
|
671
677
|
|
|
672
|
-
/** « Arrêtée, arrêt : 2026-03-31 », titre de la section d'une indication. */
|
|
673
|
-
function derogatoryIndicationLabel(row: any, english: boolean): string {
|
|
674
|
-
const state = (row.state_label || "").toLowerCase();
|
|
675
|
-
const date = derogatoryDate(row);
|
|
676
|
-
const kind = state === "en cours"
|
|
677
|
-
? english ? "granted" : "octroi"
|
|
678
|
-
: state.startsWith("arr")
|
|
679
|
-
? english ? "stopped" : "arrêt"
|
|
680
|
-
: state.startsWith("refus")
|
|
681
|
-
? english ? "refused" : "refus"
|
|
682
|
-
: null;
|
|
683
|
-
const head = row.state_label || "Indication";
|
|
684
|
-
if (!date) return head;
|
|
685
|
-
return kind ? `${head}, ${kind} : ${date}` : `${head} : ${date}`;
|
|
686
|
-
}
|
|
687
|
-
|
|
688
678
|
/** Une pastille par etat, avec son nombre d'indications : « 2 En cours », « 11 Arrêtées ». */
|
|
689
679
|
function derogatoryStateCounts(rows: any[]): Array<{ label: string; tone: "good" | "bad" | "neutral" }> {
|
|
690
680
|
const counts = new Map<string, number>();
|
|
@@ -34,7 +34,23 @@ const props = defineProps<{
|
|
|
34
34
|
* son chemin, celui de fr_drugs_app (cf. useOipResourceNav).
|
|
35
35
|
*/
|
|
36
36
|
link?: { label: string; to: string; icon?: string } | null;
|
|
37
|
-
sections?: {
|
|
37
|
+
sections?: {
|
|
38
|
+
key: string;
|
|
39
|
+
label: string;
|
|
40
|
+
body: string;
|
|
41
|
+
/**
|
|
42
|
+
* Entrees depliables de la rubrique, en accordeon dans son onglet
|
|
43
|
+
* (les indications d'un acces derogatoire). Chacune porte un tag
|
|
44
|
+
* d'etat et une date en tete.
|
|
45
|
+
*/
|
|
46
|
+
items?: {
|
|
47
|
+
key: string;
|
|
48
|
+
tag?: { label: string; tone?: "good" | "bad" | "neutral" } | null;
|
|
49
|
+
label?: string | null;
|
|
50
|
+
date?: string | null;
|
|
51
|
+
body: string;
|
|
52
|
+
}[];
|
|
53
|
+
}[];
|
|
38
54
|
/**
|
|
39
55
|
* Documents nommes de l'enregistrement : un PDF que sert
|
|
40
56
|
* `/api/oip/pdf` (`preview`) s'ouvre dans la visionneuse, le reste
|
|
@@ -54,7 +70,9 @@ const emit = defineEmits<{ (event: "close"): void }>();
|
|
|
54
70
|
|
|
55
71
|
const { locale } = useI18n();
|
|
56
72
|
|
|
57
|
-
const sections = computed(() =>
|
|
73
|
+
const sections = computed(() =>
|
|
74
|
+
(props.record?.sections ?? []).filter((s) => s.body?.trim() || s.items?.length)
|
|
75
|
+
);
|
|
58
76
|
|
|
59
77
|
const accordion = computed(() => props.record?.layout === "accordion");
|
|
60
78
|
|
|
@@ -100,7 +118,7 @@ watch(
|
|
|
100
118
|
() => props.record,
|
|
101
119
|
() => {
|
|
102
120
|
active.value = 0;
|
|
103
|
-
const first = sections.value[0]?.key;
|
|
121
|
+
const first = sections.value[0]?.items?.[0]?.key ?? sections.value[0]?.key;
|
|
104
122
|
opened.value = first ? { [first]: true } : {};
|
|
105
123
|
},
|
|
106
124
|
{ immediate: true }
|
|
@@ -246,6 +264,25 @@ onBeforeUnmount(() => document.removeEventListener("keydown", onKeydown));
|
|
|
246
264
|
@select="openDocument(doc)"
|
|
247
265
|
/>
|
|
248
266
|
</div>
|
|
267
|
+
<!-- Entrees en frise : un point teinte par l'etat, le plus recent en haut. -->
|
|
268
|
+
<div v-else-if="sections[active]?.items?.length" class="rdr_timeline">
|
|
269
|
+
<section
|
|
270
|
+
v-for="item in sections[active]!.items"
|
|
271
|
+
:key="item.key"
|
|
272
|
+
class="rdr_section rdr_tl_item"
|
|
273
|
+
:class="[{ is_open: opened[item.key] }, `is_${item.tag?.tone || 'neutral'}`]"
|
|
274
|
+
>
|
|
275
|
+
<button type="button" class="rdr_section_head" @click="toggle(item.key)">
|
|
276
|
+
<RmIcon name="CaretRight" :size="14" class="rdr_caret" />
|
|
277
|
+
<span v-if="item.tag" class="rdr_status" :class="`is_${item.tag.tone || 'neutral'}`">
|
|
278
|
+
{{ item.tag.label }}
|
|
279
|
+
</span>
|
|
280
|
+
<span v-if="item.label" class="rdr_item_label">{{ item.label }}</span>
|
|
281
|
+
<RmDate v-if="item.date" :date="item.date" :lang="locale" />
|
|
282
|
+
</button>
|
|
283
|
+
<p v-if="opened[item.key]" class="rdr_text">{{ item.body }}</p>
|
|
284
|
+
</section>
|
|
285
|
+
</div>
|
|
249
286
|
<p v-else class="rdr_text rdr_text--tab">{{ sections[active]?.body }}</p>
|
|
250
287
|
</template>
|
|
251
288
|
</slot>
|
|
@@ -581,6 +618,58 @@ onBeforeUnmount(() => document.removeEventListener("keydown", onKeydown));
|
|
|
581
618
|
padding: 0;
|
|
582
619
|
}
|
|
583
620
|
|
|
621
|
+
/* Frise des entrees d'une rubrique : trait vertical, un point par entree. */
|
|
622
|
+
.rdr_timeline {
|
|
623
|
+
position: relative;
|
|
624
|
+
display: flex;
|
|
625
|
+
flex-direction: column;
|
|
626
|
+
padding-left: 20px;
|
|
627
|
+
}
|
|
628
|
+
|
|
629
|
+
.rdr_timeline::before {
|
|
630
|
+
content: "";
|
|
631
|
+
position: absolute;
|
|
632
|
+
top: 18px;
|
|
633
|
+
bottom: 18px;
|
|
634
|
+
left: 5px;
|
|
635
|
+
width: 2px;
|
|
636
|
+
background: var(--border-default, var(--light));
|
|
637
|
+
}
|
|
638
|
+
|
|
639
|
+
.rdr_tl_item {
|
|
640
|
+
position: relative;
|
|
641
|
+
border-bottom: none;
|
|
642
|
+
}
|
|
643
|
+
|
|
644
|
+
.rdr_tl_item::before {
|
|
645
|
+
content: "";
|
|
646
|
+
position: absolute;
|
|
647
|
+
top: 15px;
|
|
648
|
+
left: -20px;
|
|
649
|
+
width: 12px;
|
|
650
|
+
height: 12px;
|
|
651
|
+
border: 2px solid var(--bg-surface, #fff);
|
|
652
|
+
border-radius: 50%;
|
|
653
|
+
background: var(--text-tertiary, #8f91ac);
|
|
654
|
+
}
|
|
655
|
+
|
|
656
|
+
.rdr_tl_item.is_good::before {
|
|
657
|
+
background: #16a34a;
|
|
658
|
+
}
|
|
659
|
+
|
|
660
|
+
.rdr_tl_item.is_bad::before {
|
|
661
|
+
background: #e11d48;
|
|
662
|
+
}
|
|
663
|
+
|
|
664
|
+
.rdr_tl_item .rdr_text {
|
|
665
|
+
padding-top: 0;
|
|
666
|
+
}
|
|
667
|
+
|
|
668
|
+
.rdr_item_label {
|
|
669
|
+
font-weight: 600;
|
|
670
|
+
color: var(--text-secondary, inherit);
|
|
671
|
+
}
|
|
672
|
+
|
|
584
673
|
.rdr_link {
|
|
585
674
|
color: var(--primary);
|
|
586
675
|
font-size: 14px;
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
*
|
|
5
5
|
* L'index ne donne que des adresses. Les PDF de l'ANSM portent un nom de
|
|
6
6
|
* fichier parlant (`20230809-aap-epcoritamab-avis-ansm.pdf`) : on en tire la
|
|
7
|
-
* date et le libelle. Les autres liens (
|
|
8
|
-
*
|
|
7
|
+
* date et le libelle. Les autres liens (fiche HAS, base publique, FDA...)
|
|
8
|
+
* prennent le nom de leur site ; les liens generiques sont ecartes. Un PDF d'un hote que sert
|
|
9
9
|
* `/api/oip/pdf` s'ouvre dans la visionneuse, le reste dans un onglet.
|
|
10
10
|
*/
|
|
11
11
|
|
|
@@ -21,7 +21,6 @@ export type AnsmDocument = {
|
|
|
21
21
|
const PREVIEW_HOSTS = new Set(["ansm.sante.fr", "has-sante.fr", "www.has-sante.fr"]);
|
|
22
22
|
|
|
23
23
|
const SITE_NAMES: Record<string, { fr: string; en: string }> = {
|
|
24
|
-
"icsaturne.ansm.sante.fr": { fr: "Portail e-Saturne (demande d'accès)", en: "e-Saturne portal (access request)" },
|
|
25
24
|
"ansm.sante.fr": { fr: "ANSM", en: "ANSM" },
|
|
26
25
|
"www.has-sante.fr": { fr: "HAS", en: "HAS" },
|
|
27
26
|
"has-sante.fr": { fr: "HAS", en: "HAS" },
|
|
@@ -56,6 +55,20 @@ const PHRASES: [RegExp, string][] = [
|
|
|
56
55
|
[/\bno (\d+)\b/g, "n°$1"],
|
|
57
56
|
];
|
|
58
57
|
|
|
58
|
+
/**
|
|
59
|
+
* Liens generiques que l'ANSM colle sous presque chaque fiche, sans rien sur le
|
|
60
|
+
* produit : le portail e-Saturne de demande d'acces (262 lignes sur 904 au
|
|
61
|
+
* 13/11/2026), le formulaire de declaration d'effets indesirables (264), les
|
|
62
|
+
* pages d'accueil de la base publique du medicament. Ecartes de la liste.
|
|
63
|
+
*/
|
|
64
|
+
function isGenericLink(url: URL): boolean {
|
|
65
|
+
const path = url.pathname.replace(/\/+$/, "");
|
|
66
|
+
if (url.hostname === "icsaturne.ansm.sante.fr") return true;
|
|
67
|
+
if (url.hostname === "ansm.sante.fr" && path === "/page/formulaire-si") return true;
|
|
68
|
+
if (url.hostname === "base-donnees-publique.medicaments.gouv.fr" && (path === "" || path === "/index.php")) return true;
|
|
69
|
+
return false;
|
|
70
|
+
}
|
|
71
|
+
|
|
59
72
|
/** Fichiers bureautiques : nommes comme un PDF, ouverts dans un onglet. */
|
|
60
73
|
const FILE_EXTENSION = /\.(pdf|docx?|xlsx?|pptx?)$/i;
|
|
61
74
|
|
|
@@ -91,6 +104,7 @@ export function ansmDocumentsOf(urls: string[] | null | undefined, locale: strin
|
|
|
91
104
|
continue;
|
|
92
105
|
}
|
|
93
106
|
if (url.protocol !== "https:" && url.protocol !== "http:") continue;
|
|
107
|
+
if (isGenericLink(url)) continue;
|
|
94
108
|
if (seen.has(url.href)) continue;
|
|
95
109
|
seen.add(url.href);
|
|
96
110
|
|