@tekkare/romulus 0.1.376 → 0.1.377

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.375",
7
+ "version": "0.1.376",
8
8
  "builder": {
9
9
  "@nuxt/module-builder": "0.8.4",
10
10
  "unbuild": "2.0.0"
@@ -1,7 +1,9 @@
1
1
  <!--
2
- Carte d'une autorisation oncologique rangee depuis Global Oncology
3
- (EmaApproval, FdaApproval, PmdaApproval, MpdsApproval, MhraApproval), par
4
- son `_id` : agence, produit, molecule, laboratoire, date, cancers tagues.
2
+ Carte d'une fiche rangee depuis Global Oncology, par son `_id` : les
3
+ autorisations (EmaApproval, FdaApproval, PmdaApproval, MpdsApproval,
4
+ MhraApproval : agence, produit, molecule, laboratoire, date, cancers
5
+ tagues), les prix oncologiques (OncoDrugPrice), les genes (Gene) et les
6
+ brevets (PatentEPO).
5
7
  Global Oncology n'a pas de fiche a onglets pour ces familles : la carte
6
8
  reprend les champs de ses cartes de resultat.
7
9
 
@@ -19,7 +21,7 @@
19
21
 
20
22
  <div class="oip-onco__body">
21
23
  <RmLoadingState v-if="loading" spinner />
22
- <RmEmptyState v-else-if="!doc" icon="Prohibit" :title="en ? 'Approval not found' : 'Autorisation introuvable'" />
24
+ <RmEmptyState v-else-if="!doc" icon="Prohibit" :title="en ? 'Item not found' : 'Fiche introuvable'" />
23
25
  <RmCard v-else padding="md">
24
26
  <dl class="oip-onco__rows">
25
27
  <template v-for="row in rows" :key="row.label">
@@ -77,8 +77,8 @@ const LOADERS: Record<string, Record<string, () => Promise<any>>> = {
77
77
  * `id`, `label`).
78
78
  * - `patients-<famille>` : la fiche d'OIP Case Atlas, que ses pages montent
79
79
  * aussi (props `id`, `tab`, `backTo`).
80
- * - `oncology-approval` : la carte d'une autorisation de Global Oncology,
81
- * commune aux cinq agences (props `id`, `type`).
80
+ * - `oncology-approval` : la carte d'une fiche de Global Oncology, commune
81
+ * aux cinq agences, aux prix, aux genes et aux brevets (props `id`, `type`).
82
82
  */
83
83
  const VIEW_LOADERS: Record<string, () => Promise<any>> = {
84
84
  "science-phrc": () => import("../components/oip-science/resources/Phrc.vue"),
@@ -1,7 +1,8 @@
1
1
  /**
2
2
  * Les familles que Global Oncology range dans un projet, decrites pour tout
3
3
  * le portail : les autorisations oncologiques de six agences (EMA, FDA, PMDA,
4
- * MFDS, MHRA) et les avis de la HAS. Le tiroir d'un projet les montre par la
4
+ * MFDS, MHRA), les avis de la HAS, les prix oncologiques du Price Tracker, les
5
+ * genes des biomarqueurs et les brevets. Le tiroir d'un projet les montre par la
5
6
  * carte oncology-approval (components/oip-oncology/Approval.vue), les avis HAS
6
7
  * par la fiche marque de fr_drugs_app (meme index) ; la ligne du projet mene
7
8
  * a la page de Global Oncology.
@@ -43,8 +44,21 @@ export const ONCOLOGY_INDEX = {
43
44
  mhra: "0cb3a88c-9139-48e1-bef2-9f6b9e0d1867",
44
45
  /** HAS (ope_block402_fr__drugs__brand__has), `_id` = brand_group : l'index BRAND_HAS de fr_drugs_app. */
45
46
  has: "d736c6f0-0dc6-4bb6-94c4-644a7ad231e7",
47
+ /** Price Tracker (ope__ww_price_tracker__tekkare), `_id` = <pays>_<id local>_<n> : l'index WW_PRICE_TRACKER de fr_drugs_app. */
48
+ prices: "fe806bee-7e4e-4714-a329-f25879ce1497",
49
+ /** Genes HGNC (biomarqueurs), `_id` = identifiant HGNC (« HGNC:6256 »). Par son nom, hors du catalogue de fr_drugs_app. */
50
+ genes: "ope_block410_genomics",
51
+ /** Brevets EPO, `_id` = global_publication_id (empreinte), la fiche s'adresse par `publication_id`. Par son nom. */
52
+ patents: "ope__patent__tekkare",
46
53
  };
47
54
 
55
+ /**
56
+ * Les index de Global Oncology hors du catalogue de fr_drugs_app, que le proxy
57
+ * du layer lit avec la cle principale du cluster `drugs` (la cle universelle
58
+ * des projets, qui les couvre).
59
+ */
60
+ export const ONCOLOGY_OWN_INDEXES: string[] = [ONCOLOGY_INDEX.pmda, ONCOLOGY_INDEX.mfds, ONCOLOGY_INDEX.genes, ONCOLOGY_INDEX.patents];
61
+
48
62
  type Doc = Record<string, any>;
49
63
 
50
64
  const text = (value: unknown) => (value === null || value === undefined ? "" : String(value).trim());
@@ -166,6 +180,54 @@ export const ONCOLOGY_PROJECT_KINDS: RmProjectKind[] = [
166
180
  subtitle: (s) => join([strings(list(s?.brand_history).map((h) => h.molecule)).join(", "), oncologyDay(s?.last_opinion_date)]),
167
181
  path: (s, id) => `/approvals/has/${encodeURIComponent((text(s?.brand_group) || id).replace(/ \/ /g, " + ").replace(/ /g, "_"))}`,
168
182
  },
183
+ {
184
+ // Une presentation du Price Tracker taguee oncologie (`_id` = dk_104026_1,
185
+ // jamais reconstruit : cf. R-02 des projets). Pas de fiche dans l'app :
186
+ // la ligne mene aux prix oncologiques de son pays.
187
+ type: "OncoDrugPrice",
188
+ index: ONCOLOGY_INDEX.prices,
189
+ label: { fr: "Prix oncologiques", en: "Oncology prices" },
190
+ section: { fr: "Prix oncologiques", en: "Oncology prices" },
191
+ icon: "Tag",
192
+ source: [
193
+ "label_local", "brand", "molecule_en", "molecule_local", "atc_code", "atc4_en", "manufacturer",
194
+ "country_iso_2", "country_name", "price_category", "last_price_update", "icd_code", "icd_label",
195
+ ],
196
+ title: (s) => text(s?.label_local) || text(s?.brand),
197
+ subtitle: (s) => join([s?.brand, s?.molecule_en ?? s?.molecule_local, s?.manufacturer, text(s?.country_iso_2).toUpperCase()]),
198
+ path: (s, id) => {
199
+ const iso = text(s?.country_iso_2) || id.split("_")[0] || "";
200
+ return iso ? `/country/${encodeURIComponent(iso.toLowerCase())}/oncoPrice` : "/priceOncology";
201
+ },
202
+ titleFromId: (id) => id.replace(/_\d+$/, "").replace(/^([a-z]{2})_/, (_m, iso: string) => `${iso.toUpperCase()} `),
203
+ },
204
+ {
205
+ // Un gene des biomarqueurs (`_id` = identifiant HGNC). L'app le montre
206
+ // dans une fenetre de /biomarkers, sans page a lui.
207
+ type: "Gene",
208
+ index: ONCOLOGY_INDEX.genes,
209
+ label: { fr: "Gènes", en: "Genes" },
210
+ section: { fr: "Biomarqueurs", en: "Biomarkers" },
211
+ icon: "Dna",
212
+ source: ["symbol", "name", "hgnc_id", "locus_group", "location", "alias_symbol", "entrez_id", "ensembl_gene_id"],
213
+ title: (s) => text(s?.symbol),
214
+ subtitle: (s) => join([s?.name, s?.location]),
215
+ path: () => "/biomarkers",
216
+ titleFromId: (id) => id,
217
+ },
218
+ {
219
+ // Un brevet (`_id` = empreinte global_publication_id) : la page de l'app
220
+ // s'adresse par son numero de publication.
221
+ type: "PatentEPO",
222
+ index: ONCOLOGY_INDEX.patents,
223
+ label: { fr: "Brevets", en: "Patents" },
224
+ section: { fr: "Brevets", en: "Patents" },
225
+ icon: "Certificate",
226
+ source: ["title", "publication_id", "application_id", "applicants.name", "filling_date", "agency", "type", "country.country_label"],
227
+ title: (s) => text(s?.title),
228
+ subtitle: (s) => join([s?.publication_id, strings(list(s?.applicants).map((a) => a.name)).slice(0, 2).join(", "), oncologyDay(s?.filling_date)]),
229
+ path: (s) => (s?.publication_id ? `/patents/${encodeURIComponent(text(s.publication_id))}/details` : "/patents"),
230
+ },
169
231
  ];
170
232
 
171
233
  /** L'agence d'une famille, pour le bandeau de sa carte. */
@@ -176,6 +238,9 @@ export const ONCOLOGY_AGENCY: Record<string, { fr: string; en: string }> = {
176
238
  MpdsApproval: { fr: "MFDS, Corée du Sud", en: "MFDS, South Korea" },
177
239
  MhraApproval: { fr: "MHRA, Royaume-Uni", en: "MHRA, United Kingdom" },
178
240
  HeartApproval: { fr: "HAS, France", en: "HAS, France" },
241
+ OncoDrugPrice: { fr: "Price Tracker, prix oncologiques", en: "Price Tracker, oncology prices" },
242
+ Gene: { fr: "HGNC, biomarqueurs", en: "HGNC, biomarkers" },
243
+ PatentEPO: { fr: "Brevets", en: "Patents" },
179
244
  };
180
245
 
181
246
  /** Les lignes de la carte d'une autorisation (libelle, valeur), vides sautees. */
@@ -219,6 +284,39 @@ export function oncologyRows(type: string, doc: Doc, lang: RmProjectLang): { lab
219
284
  { label: en ? "Manufacturers" : "Fabricants", value: strings(list(doc.products).map((p) => p.manufacturer)).join(", ") },
220
285
  { label: en ? "Latest approval" : "Dernière autorisation", value: oncologyDay(doc.last_approval_date) },
221
286
  );
287
+ } else if (type === "OncoDrugPrice") {
288
+ rows.push(
289
+ { label: en ? "Brand" : "Marque", value: doc.brand },
290
+ { label: molecule, value: doc.molecule_en ?? doc.molecule_local },
291
+ { label: "ATC", value: join([doc.atc_code, doc.atc4_en]) },
292
+ { label: company, value: doc.manufacturer },
293
+ { label: en ? "Country" : "Pays", value: text(doc.country_name).replace(/^\w/, (c) => c.toUpperCase()) },
294
+ { label: en ? "Category" : "Catégorie", value: doc.price_category },
295
+ { label: en ? "Latest price change" : "Dernier changement de prix", value: oncologyDay(doc.last_price_update) },
296
+ { label: en ? "Cancer (ICD-10)" : "Cancer (CIM-10)", value: join([doc.icd_code, doc.icd_label]) },
297
+ );
298
+ } else if (type === "Gene") {
299
+ rows.push(
300
+ { label: en ? "Name" : "Nom", value: doc.name },
301
+ { label: "HGNC", value: doc.hgnc_id },
302
+ { label: en ? "Locus group" : "Groupe de locus", value: doc.locus_group },
303
+ { label: en ? "Location" : "Localisation", value: doc.location },
304
+ { label: en ? "Aliases" : "Alias", value: strings(Array.isArray(doc.alias_symbol) ? doc.alias_symbol : []).join(", ") },
305
+ { label: "Entrez", value: doc.entrez_id },
306
+ { label: "Ensembl", value: doc.ensembl_gene_id },
307
+ );
308
+ } else if (type === "PatentEPO") {
309
+ rows.push(
310
+ { label: en ? "Publication" : "Publication", value: doc.publication_id },
311
+ { label: en ? "Application" : "Demande", value: doc.application_id },
312
+ { label: en ? "Applicants" : "Déposants", value: strings(list(doc.applicants).map((a) => a.name)).join(", ") },
313
+ { label: en ? "Filing date" : "Date de dépôt", value: oncologyDay(doc.filling_date) },
314
+ { label: en ? "Office" : "Office", value: join([doc.agency, doc.country?.country_label]) },
315
+ { label: "Type", value: doc.type },
316
+ );
317
+ }
318
+ if (type === "OncoDrugPrice" || type === "Gene" || type === "PatentEPO") {
319
+ return rows.map((row) => ({ label: row.label, value: text(row.value) })).filter((row) => row.value);
222
320
  }
223
321
  rows.push({ label: en ? "Cancers (ICD-10)" : "Cancers (CIM-10)", value: oncologyCancers(doc).join(", ") });
224
322
  return rows.map((row) => ({ label: row.label, value: text(row.value) })).filter((row) => row.value);
@@ -297,6 +297,9 @@ const ONCOLOGY_VIEWS: Record<string, string> = {
297
297
  MpdsApproval: "oncology-approval",
298
298
  MhraApproval: "oncology-approval",
299
299
  HeartApproval: "drugs-brand",
300
+ OncoDrugPrice: "oncology-approval",
301
+ Gene: "oncology-approval",
302
+ PatentEPO: "oncology-approval",
300
303
  };
301
304
 
302
305
  /** La fiche de chaque famille de Spain One (cf. useOipResourceViews). */
@@ -10,6 +10,7 @@ import { ITALY_INDEX } from "../../../app/oip-italy/kinds";
10
10
  import { SPAIN_INDEX } from "../../../app/oip-spain/kinds";
11
11
  import { AUSTRALIA_INDEX } from "../../../app/oip-australia/kinds";
12
12
  import { NEW_ZEALAND_INDEX } from "../../../app/oip-new-zealand/kinds";
13
+ import { ONCOLOGY_OWN_INDEXES } from "../../../app/oip-oncology/kinds";
13
14
 
14
15
  /**
15
16
  * POST /api/oip/es?cluster=&index=, servi par le layer OIP.
@@ -66,6 +67,13 @@ const NEW_ZEALAND_INDEXES = new Set<string>([NEW_ZEALAND_INDEX.medsafe, NEW_ZEAL
66
67
  */
67
68
  const SPAIN_INDEXES = new Set<string>([SPAIN_INDEX.aemps, SPAIN_INDEX.reimbursement]);
68
69
 
70
+ /**
71
+ * Index de Global Oncology hors du catalogue de fr_drugs_app (PMDA et MFDS par
72
+ * leur id Directus, genes et brevets par leur nom), avec la cle principale.
73
+ * Les prix passent par le Price Tracker, deja au catalogue.
74
+ */
75
+ const ONCOLOGY_INDEXES = new Set<string>(ONCOLOGY_OWN_INDEXES);
76
+
69
77
  const DRUG_IDS = new Set<string>(Object.values(ES_INDEX) as string[]);
70
78
  const ASSOCIATION_IDS = new Set<string>(
71
79
  Object.entries(ES_INDEX)
@@ -84,7 +92,7 @@ const APPROVAL_IDS = new Set<string>(
84
92
  * Vide si l'index n'est pas au catalogue.
85
93
  */
86
94
  async function drugsKeyOf(ref: string): Promise<string> {
87
- if (DRUG_IDS.has(ref) || GERMANY_INDEXES.has(ref) || ITALY_INDEXES.has(ref) || AUSTRALIA_INDEXES.has(ref) || NEW_ZEALAND_INDEXES.has(ref) || SPAIN_INDEXES.has(ref)) return ref;
95
+ if (DRUG_IDS.has(ref) || GERMANY_INDEXES.has(ref) || ITALY_INDEXES.has(ref) || AUSTRALIA_INDEXES.has(ref) || NEW_ZEALAND_INDEXES.has(ref) || SPAIN_INDEXES.has(ref) || ONCOLOGY_INDEXES.has(ref)) return ref;
88
96
  const id = (await findOipEsIndex(ref).catch(() => undefined))?.id;
89
97
  return id && DRUG_IDS.has(id) ? id : "";
90
98
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tekkare/romulus",
3
- "version": "0.1.376",
3
+ "version": "0.1.377",
4
4
  "description": "Romulus Design System - Nuxt module by Tekkare",
5
5
  "license": "MIT",
6
6
  "type": "module",