@tekkare/romulus 0.1.345 → 0.1.347

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.344",
7
+ "version": "0.1.345",
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' });
@@ -549,8 +558,9 @@ const derogatoryRecords = computed(() => {
549
558
  const groups = new Map<string, any[]>();
550
559
  for (const hit of resultsQueryDerogatory.value) {
551
560
  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;
561
+ // Une fiche par dispositif pour la marque, toutes presentations
562
+ // confondues. Sans dispositif, la ligne reste seule.
563
+ const key = row.scheme_type ? row.scheme_type : hit._id;
554
564
  if (!groups.has(key)) groups.set(key, []);
555
565
  groups.get(key)!.push(row);
556
566
  }
@@ -563,6 +573,9 @@ const derogatoryRecords = computed(() => {
563
573
  // Champs du produit (nom, titulaire, statut actuel...) : communs aux indications.
564
574
  const row = rows[0];
565
575
  const single = rows.length === 1;
576
+ // Presentations du dispositif : leur nom, ou leur nombre s'il y en a plusieurs
577
+ // (certains noms ANSM embarquent l'indication et font un paragraphe).
578
+ const presentations = [...new Set(rows.map((r) => pickText(r.drug_name)).filter(Boolean))];
566
579
  const lastRenewal = [...(row.renewal_date ?? [])].sort().at(-1);
567
580
  const milestones = [
568
581
  [english ? "Published" : "Publié", row.published_date],
@@ -588,8 +601,11 @@ const derogatoryRecords = computed(() => {
588
601
  icon: "Key",
589
602
  date: derogatoryDate(row),
590
603
  url: row.url_link || null,
591
- title: pickText(row.drug_name) || row.scheme_type || "ANSM",
592
- excerpt: rows.map((r) => r.status_text).filter(Boolean).join("\n\n") || null,
604
+ // Le dispositif fait le titre, les presentations le sous-titre.
605
+ title: derogatorySchemeLabel(row.scheme_type, english) || pickText(row.drug_name) || "ANSM",
606
+ excerpt: presentations.length > 1
607
+ ? `${presentations.length} ${english ? "presentations" : "présentations"}`
608
+ : presentations[0] || null,
593
609
  status: single ? row.state_label || null : null,
594
610
  statusTone: derogatoryTone(row.state_label),
595
611
  statuses: single ? undefined : derogatoryStateCounts(rows),
@@ -621,6 +637,24 @@ const derogatoryRecords = computed(() => {
621
637
  .sort((a, b) => String(b.date ?? "").localeCompare(String(a.date ?? "")));
622
638
  });
623
639
 
640
+ const DEROGATORY_SCHEMES: Record<string, { fr: string; en: string }> = {
641
+ AAC: { fr: "Autorisation d'accès compassionnel", en: "Compassionate access authorisation" },
642
+ AAP: { fr: "Autorisation d'accès précoce", en: "Early access authorisation" },
643
+ CPC: { fr: "Cadre de prescription compassionnelle", en: "Compassionate prescription framework" },
644
+ ATU: { fr: "Autorisation temporaire d'utilisation", en: "Temporary use authorisation" },
645
+ ATUc: { fr: "ATU de cohorte", en: "Cohort temporary use authorisation" },
646
+ ATUn: { fr: "ATU nominative", en: "Named-patient temporary use authorisation" },
647
+ RTU: { fr: "Recommandation temporaire d'utilisation", en: "Temporary use recommendation" },
648
+ AMM: { fr: "Autorisation de mise sur le marché", en: "Marketing authorisation" },
649
+ };
650
+
651
+ /** « Autorisation d'accès précoce (AAP) » ; le sigle seul s'il est inconnu. */
652
+ function derogatorySchemeLabel(scheme: string | undefined, english: boolean): string {
653
+ if (!scheme) return "";
654
+ const labels = DEROGATORY_SCHEMES[scheme];
655
+ return labels ? `${english ? labels.en : labels.fr} (${scheme})` : scheme;
656
+ }
657
+
624
658
  /**
625
659
  * Date d'une indication selon son etat : octroi si elle court, arret si elle
626
660
  * est arretee, refus si elle est refusee. Les autres etats gardent la
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tekkare/romulus",
3
- "version": "0.1.345",
3
+ "version": "0.1.347",
4
4
  "description": "Romulus Design System - Nuxt module by Tekkare",
5
5
  "license": "MIT",
6
6
  "type": "module",