@tekkare/romulus 0.1.346 → 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
@@ -4,7 +4,7 @@
4
4
  "compatibility": {
5
5
  "nuxt": ">=3.16.0"
6
6
  },
7
- "version": "0.1.345",
7
+ "version": "0.1.346",
8
8
  "builder": {
9
9
  "@nuxt/module-builder": "0.8.4",
10
10
  "unbuild": "2.0.0"
@@ -344,6 +344,17 @@ const intlDecisionCount = computed(() =>
344
344
  Object.values(intlRecords.value as Record<string, any[]>).reduce((sum, list) => sum + list.length, 0),
345
345
  );
346
346
 
347
+ // MITM et « SMR & ASMR » lisent les memes documents : un document MITM n'ouvre
348
+ // l'onglet que s'il a de quoi le remplir (produits rattaches, avis SMR / ASMR).
349
+ const hasMitmProducts = computed(() =>
350
+ resultsQueryMitm.value.some((m: any) =>
351
+ (m._source?.molecule ?? []).some((row: any) => row?.brand || row?.drug_label || row?.cis_code),
352
+ ),
353
+ );
354
+ const hasMitmOpinions = computed(() =>
355
+ resultsQueryMitm.value.some((m: any) => (m._source?.smr?.length ?? 0) + (m._source?.asmr?.length ?? 0) > 0),
356
+ );
357
+
347
358
  // Onglets disponibles (l'ordre = l'ordre d'affichage). La MARQUE est le pivot :
348
359
  // HAS n'apparait que s'il existe un avis, ANSM que s'il existe des CIS, etc.
349
360
  const availableTabs = computed(() => {
@@ -351,15 +362,13 @@ const availableTabs = computed(() => {
351
362
  const tabs: { key: string; label: string }[] = [];
352
363
  if (hasMonograph.value) tabs.push({ key: 'monograph', label: en ? 'Monograph' : 'Monographie' });
353
364
  if (resultsQuery.value) tabs.push({ key: 'overview', label: 'HAS' });
354
- if (hasContributions.value) tabs.push({ key: 'contributions', label: en ? 'Patient Contribution' : 'Contribution Patient' });
365
+ // Les avis SMR / ASMR du CIS suivent ceux de la HAS, le MITM garde les CIP.
366
+ if (hasMitmOpinions.value) tabs.push({ key: 'smr', label: 'SMR & ASMR' });
367
+ if (hasContributions.value) tabs.push({ key: 'contributions', label: en ? 'Patient contrib.' : 'Contrib. Patient' });
355
368
  if (resultsQueryPrice.value.length > 0) tabs.push({ key: 'price', label: t('oipDrugs.heart.details.tabs.price') });
356
- if (resultsQueryIntlPrice.value.length > 0 || intlDecisionCount.value > 0) tabs.push({ key: 'international', label: en ? 'International view' : 'Regard international' });
369
+ if (resultsQueryIntlPrice.value.length > 0 || intlDecisionCount.value > 0) tabs.push({ key: 'international', label: en ? 'Intl. view' : 'Regard inter.' });
357
370
  if (resultsQueryAnsm.value.length > 0) tabs.push({ key: 'ansm', label: 'ANSM' });
358
- if (resultsQueryMitm.value.length > 0) {
359
- tabs.push({ key: 'mitm', label: 'MITM' });
360
- // Les avis SMR / ASMR du CIS ont leur onglet, le MITM garde les CIP.
361
- tabs.push({ key: 'smr', label: 'SMR & ASMR' });
362
- }
371
+ if (hasMitmProducts.value) tabs.push({ key: 'mitm', label: 'MITM' });
363
372
  if (resultsQueryPut.value.length > 0) tabs.push({ key: 'put', label: 'PUT' });
364
373
  if (derogatoryRecords.value.length > 0) tabs.push({ key: 'derogatory', label: en ? 'Derogatory access' : 'Accès dérogatoire' });
365
374
  if (resultsQueryLes.value.length > 0) tabs.push({ key: 'les', label: 'LES' });
@@ -579,13 +588,21 @@ const derogatoryRecords = computed(() => {
579
588
  ]
580
589
  .filter(([, date]) => date)
581
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).
582
593
  const textSections = single
583
594
  ? [{ 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
- }));
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
+ }];
589
606
  return {
590
607
  key,
591
608
  typeLabel: row.scheme_type || "ANSM",
@@ -600,8 +617,6 @@ const derogatoryRecords = computed(() => {
600
617
  status: single ? row.state_label || null : null,
601
618
  statusTone: derogatoryTone(row.state_label),
602
619
  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),
605
620
  sourceLabel: sourceName(HEART_SOURCE_UUIDS.ANSM),
606
621
  sections: [
607
622
  ...textSections,
@@ -660,22 +675,6 @@ function derogatoryDate(row: any): string | null {
660
675
  return fallback;
661
676
  }
662
677
 
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
678
  /** Une pastille par etat, avec son nombre d'indications : « 2 En cours », « 11 Arrêtées ». */
680
679
  function derogatoryStateCounts(rows: any[]): Array<{ label: string; tone: "good" | "bad" | "neutral" }> {
681
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?: { key: string; label: string; body: string }[];
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(() => (props.record?.sections ?? []).filter((s) => s.body?.trim()));
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 (e-Saturne, fiche HAS, base publique,
8
- * FDA...) prennent le nom de leur site. Un PDF d'un hote que sert
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
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tekkare/romulus",
3
- "version": "0.1.346",
3
+ "version": "0.1.348",
4
4
  "description": "Romulus Design System - Nuxt module by Tekkare",
5
5
  "license": "MIT",
6
6
  "type": "module",