@tekkare/romulus 0.1.375 → 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 +1 -1
- package/layer/app/components/oip-oncology/Approval.vue +6 -4
- package/layer/app/components/project/Guided.vue +95 -20
- package/layer/app/composables/useOipResourceViews.ts +2 -2
- package/layer/app/oip-guided/families.ts +240 -19
- package/layer/app/oip-oncology/kinds.ts +99 -1
- package/layer/app/utils/countries.ts +1 -1
- package/layer/app/utils/oipResources.ts +3 -0
- package/layer/server/api/oip/es.post.ts +9 -1
- package/package.json +1 -1
package/dist/module.json
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
<!--
|
|
2
|
-
Carte d'une
|
|
3
|
-
(EmaApproval, FdaApproval, PmdaApproval, MpdsApproval,
|
|
4
|
-
|
|
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 ? '
|
|
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">
|
|
@@ -122,16 +122,18 @@
|
|
|
122
122
|
{{ tr("Aucun sujet pour l'instant.", "No subject yet.") }}
|
|
123
123
|
</p>
|
|
124
124
|
|
|
125
|
-
<!-- Les pays des donnees : ils filtrent les sources des trois blocs.
|
|
125
|
+
<!-- Les pays des donnees : ils filtrent les sources des trois blocs. Les
|
|
126
|
+
pays suggeres ont aussi le reglementaire et les ventes ; les autres,
|
|
127
|
+
la science seule. -->
|
|
126
128
|
<div class="prj_gd_country_pick">
|
|
127
129
|
<p class="prj_gd_lead">{{ tr("Dans quel(s) pays ?", "In which countr(y/ies)?") }}</p>
|
|
128
130
|
<div class="prj_gd_countries" role="group" :aria-label="tr('Pays', 'Countries')">
|
|
129
131
|
<button
|
|
130
132
|
type="button"
|
|
131
133
|
class="prj_gd_country"
|
|
132
|
-
:class="{ 'is-on': !
|
|
133
|
-
:aria-pressed="!
|
|
134
|
-
@click="
|
|
134
|
+
:class="{ 'is-on': !chosenCountries.length }"
|
|
135
|
+
:aria-pressed="!chosenCountries.length"
|
|
136
|
+
@click="allCountries"
|
|
135
137
|
>
|
|
136
138
|
{{ tr("Tous", "All") }}
|
|
137
139
|
</button>
|
|
@@ -147,7 +149,36 @@
|
|
|
147
149
|
<RmFlag :code="entry.code" :height="12" />
|
|
148
150
|
{{ entry.label[lang] }}
|
|
149
151
|
</button>
|
|
152
|
+
<button
|
|
153
|
+
v-for="code in otherCountries"
|
|
154
|
+
:key="code"
|
|
155
|
+
type="button"
|
|
156
|
+
class="prj_gd_country is-on"
|
|
157
|
+
aria-pressed="true"
|
|
158
|
+
:title="tr('Retirer ce pays', 'Remove this country')"
|
|
159
|
+
@click="removeOther(code)"
|
|
160
|
+
>
|
|
161
|
+
<RmFlag :code="code" :height="12" />
|
|
162
|
+
{{ guidedCountryName(code, lang) }}
|
|
163
|
+
<RmIcon name="X" :size="12" />
|
|
164
|
+
</button>
|
|
150
165
|
</div>
|
|
166
|
+
<RmMultipleSelect
|
|
167
|
+
v-model="otherNames"
|
|
168
|
+
:label="tr('Autres pays', 'Other countries')"
|
|
169
|
+
:options="otherOptions.map((entry) => entry.name)"
|
|
170
|
+
:empty-label="tr('Ajouter un pays', 'Add a country')"
|
|
171
|
+
:search-placeholder="tr('Rechercher un pays', 'Search a country')"
|
|
172
|
+
:lang="lang"
|
|
173
|
+
/>
|
|
174
|
+
<p class="prj_gd_hint">
|
|
175
|
+
{{
|
|
176
|
+
tr(
|
|
177
|
+
"Les pays suggérés couvrent le réglementaire, les ventes et la science. Les autres pays couvrent les essais, leurs centres, leurs investigateurs et les publications.",
|
|
178
|
+
"Suggested countries cover regulatory, sales and science. Other countries cover trials, their centers, their investigators and publications.",
|
|
179
|
+
)
|
|
180
|
+
}}
|
|
181
|
+
</p>
|
|
151
182
|
</div>
|
|
152
183
|
</section>
|
|
153
184
|
|
|
@@ -163,7 +194,7 @@
|
|
|
163
194
|
</p>
|
|
164
195
|
<div class="prj_gd_blocks">
|
|
165
196
|
<article
|
|
166
|
-
v-for="block in
|
|
197
|
+
v-for="block in shownBlocks"
|
|
167
198
|
:key="block.key"
|
|
168
199
|
class="prj_gd_block"
|
|
169
200
|
:class="{ 'is-on': blockOn(block.key) }"
|
|
@@ -277,7 +308,8 @@
|
|
|
277
308
|
<details v-for="type in phaseTypes" :key="type" class="prj_gd_review" open>
|
|
278
309
|
<summary class="prj_gd_review_head">
|
|
279
310
|
<span class="prj_gd_review_title">
|
|
280
|
-
<
|
|
311
|
+
<RmIcon v-if="guidedFamilyWorld(type)" name="Globe" :size="12" class="prj_gd_review_flag" />
|
|
312
|
+
<RmFlag v-else :code="guidedFamilyCountry(type)" :height="12" class="prj_gd_review_flag" />
|
|
281
313
|
{{ familyLabel(type) }}
|
|
282
314
|
</span>
|
|
283
315
|
<span class="prj_gd_review_count">
|
|
@@ -426,7 +458,10 @@ import { PROJECT_GUIDED_BLOCKS, useGuidedCountries } from "#oip-projects";
|
|
|
426
458
|
import {
|
|
427
459
|
GUIDED_BLOCKS,
|
|
428
460
|
GUIDED_COUNTRIES,
|
|
461
|
+
GUIDED_WORLD_COUNTRIES,
|
|
462
|
+
guidedCountryName,
|
|
429
463
|
guidedFamilyCountry,
|
|
464
|
+
guidedFamilyWorld,
|
|
430
465
|
type GuidedCountry,
|
|
431
466
|
GUIDED_GROUPED_TYPES,
|
|
432
467
|
collectGuided,
|
|
@@ -469,23 +504,55 @@ const blocks = computed<GuidedBlock[]>(() => GUIDED_BLOCKS.filter((block) => (PR
|
|
|
469
504
|
|
|
470
505
|
/** Les pays que la licence ouvre ; `null` : tous. */
|
|
471
506
|
const licensed = useGuidedCountries();
|
|
472
|
-
/** Les pays
|
|
507
|
+
/** Les pays suggeres : ceux de la creation guidee que la licence ouvre (reglementaire, ventes, science). */
|
|
473
508
|
const allowedCountries = computed(() =>
|
|
474
509
|
GUIDED_COUNTRIES.filter((entry) => !licensed.value || licensed.value.includes(entry.code)),
|
|
475
510
|
);
|
|
511
|
+
const allowedCodes = computed(() => allowedCountries.value.map((entry) => entry.code));
|
|
476
512
|
|
|
477
|
-
/** Les pays choisis a l'etape des sujets
|
|
513
|
+
/** Les pays suggeres choisis a l'etape des sujets. */
|
|
478
514
|
const countries = ref<GuidedCountry[]>([]);
|
|
479
|
-
/** Les pays
|
|
480
|
-
const
|
|
481
|
-
|
|
515
|
+
/** Les autres pays choisis : la science seule. */
|
|
516
|
+
const otherCountries = ref<GuidedCountry[]>([]);
|
|
517
|
+
/** Tous les pays choisis ; vide : « Tous ». */
|
|
518
|
+
const chosenCountries = computed(() => [...countries.value, ...otherCountries.value]);
|
|
519
|
+
|
|
520
|
+
/** Les autres pays proposes : le monde entier, hors pays suggeres. */
|
|
521
|
+
const otherOptions = computed(() =>
|
|
522
|
+
GUIDED_WORLD_COUNTRIES.filter((code) => !allowedCodes.value.includes(code))
|
|
523
|
+
.map((code) => ({ code, name: guidedCountryName(code, lang.value) }))
|
|
524
|
+
.sort((a, b) => a.name.localeCompare(b.name, lang.value)),
|
|
525
|
+
);
|
|
526
|
+
/** Les autres pays par leur nom, pour le champ de choix. */
|
|
527
|
+
const otherNames = computed<string[]>({
|
|
528
|
+
get: () => otherCountries.value.map((code) => guidedCountryName(code, lang.value)),
|
|
529
|
+
set: (names) => {
|
|
530
|
+
otherCountries.value = otherOptions.value.filter((entry) => names.includes(entry.name)).map((entry) => entry.code);
|
|
531
|
+
},
|
|
532
|
+
});
|
|
533
|
+
|
|
534
|
+
/** Les pays des familles nationales : les suggeres choisis, sinon tous ceux de la licence. */
|
|
535
|
+
const nationalCountries = computed<GuidedCountry[]>(() =>
|
|
536
|
+
chosenCountries.value.length ? chosenCountries.value.filter((code) => allowedCodes.value.includes(code)) : allowedCodes.value,
|
|
482
537
|
);
|
|
538
|
+
/** Les pays de la science : le choix, sinon ceux de la licence ; vide : le monde entier. */
|
|
539
|
+
const scienceCountries = computed<GuidedCountry[]>(() =>
|
|
540
|
+
chosenCountries.value.length ? chosenCountries.value : licensed.value ? allowedCodes.value : [],
|
|
541
|
+
);
|
|
542
|
+
|
|
483
543
|
function toggleCountry(code: GuidedCountry) {
|
|
484
544
|
countries.value = countries.value.includes(code) ? countries.value.filter((entry) => entry !== code) : [...countries.value, code];
|
|
485
545
|
}
|
|
486
|
-
|
|
546
|
+
function removeOther(code: GuidedCountry) {
|
|
547
|
+
otherCountries.value = otherCountries.value.filter((entry) => entry !== code);
|
|
548
|
+
}
|
|
549
|
+
function allCountries() {
|
|
550
|
+
countries.value = [];
|
|
551
|
+
otherCountries.value = [];
|
|
552
|
+
}
|
|
553
|
+
const inCountries = (type: string) => guidedFamilyWorld(type) || nationalCountries.value.includes(guidedFamilyCountry(type));
|
|
487
554
|
/** Plusieurs pays en jeu : le libelle d'une famille d'un autre pays que la France le dit. */
|
|
488
|
-
const manyCountries = computed(() =>
|
|
555
|
+
const manyCountries = computed(() => nationalCountries.value.length !== 1);
|
|
489
556
|
|
|
490
557
|
const step = ref<Step>("subjects");
|
|
491
558
|
const stepIndex = computed(() => STEPS.findIndex((entry) => entry.key === step.value));
|
|
@@ -586,17 +653,21 @@ const familyState = (type: string): GuidedFamilyState => states.value[type] ?? {
|
|
|
586
653
|
const familyCount = (type: string) => familyState(type).rows.length;
|
|
587
654
|
const familyLabel = (type: string) => {
|
|
588
655
|
const label = guidedFamilyLabel(type, lang.value);
|
|
656
|
+
if (guidedFamilyWorld(type)) return label;
|
|
589
657
|
const code = guidedFamilyCountry(type);
|
|
590
658
|
if (!manyCountries.value || code === "fr") return label;
|
|
591
|
-
const name =
|
|
659
|
+
const name = guidedCountryName(code, lang.value);
|
|
592
660
|
return name && !label.includes(name) ? `${label} (${name})` : label;
|
|
593
661
|
};
|
|
594
662
|
|
|
663
|
+
/** Les blocs qu'un pays choisi couvre : un pays hors suggestions n'a que la science. */
|
|
664
|
+
const shownBlocks = computed(() => blocks.value.filter((block) => block.types.some(inCountries)));
|
|
665
|
+
|
|
595
666
|
const blockOf = (key: GuidedBlockKey) => blocks.value.find((block) => block.key === key)!;
|
|
596
667
|
const blockCount = (key: GuidedBlockKey) => blockOf(key).types.filter(inCountries).reduce((sum, type) => sum + familyCount(type), 0);
|
|
597
668
|
const blockLoading = (key: GuidedBlockKey) => blockOf(key).types.filter(inCountries).some((type) => familyState(type).loading);
|
|
598
669
|
/** Un bloc se coche de lui-meme quand il a des fiches, tant qu'on n'a rien choisi. */
|
|
599
|
-
const blockOn = (key: GuidedBlockKey) => blockChoice[key] ?? blockCount(key) > 0;
|
|
670
|
+
const blockOn = (key: GuidedBlockKey) => (blockChoice[key] ?? blockCount(key) > 0) && blockOf(key).types.some(inCountries);
|
|
600
671
|
const toggleBlock = (key: GuidedBlockKey) => {
|
|
601
672
|
blockChoice[key] = !blockOn(key);
|
|
602
673
|
};
|
|
@@ -608,7 +679,11 @@ const sortedTypes = (block: GuidedBlock) =>
|
|
|
608
679
|
const countLabel = (count: number) => (count ? tr(`${count} fiches`, `${count} records`) : tr("rien trouvé", "nothing found"));
|
|
609
680
|
|
|
610
681
|
function startSearch() {
|
|
611
|
-
const key = [
|
|
682
|
+
const key = [
|
|
683
|
+
...subjects.value.map((subject) => subject.key).sort(),
|
|
684
|
+
`n:${[...nationalCountries.value].sort().join(",")}`,
|
|
685
|
+
`s:${[...scienceCountries.value].sort().join(",")}`,
|
|
686
|
+
].join("|");
|
|
612
687
|
if (key === searchedKey) return;
|
|
613
688
|
searchedKey = key;
|
|
614
689
|
states.value = {};
|
|
@@ -620,7 +695,7 @@ function startSearch() {
|
|
|
620
695
|
states.value = { ...states.value, [type]: state };
|
|
621
696
|
// Une famille qui repond se coche si elle a des fiches, sauf choix deja fait.
|
|
622
697
|
if (!state.loading && families[type] === undefined) families[type] = state.rows.length > 0;
|
|
623
|
-
}, [...
|
|
698
|
+
}, { national: [...nationalCountries.value], science: [...scienceCountries.value] }).finally(() => {
|
|
624
699
|
if (searchedKey === mine) searching.value = false;
|
|
625
700
|
});
|
|
626
701
|
}
|
|
@@ -689,8 +764,8 @@ function propose() {
|
|
|
689
764
|
? `${tr("Médicaments", "Drugs")}${sep}${drugs.map((subject) => withHint(subject.label, subject.focus === "brand" ? subject.hint.toLowerCase() : subject.hint, subject.focus === "molecule")).join(", ")}.`
|
|
690
765
|
: "",
|
|
691
766
|
`${tr("Périmètre", "Scope")}${sep}${
|
|
692
|
-
|
|
693
|
-
?
|
|
767
|
+
scienceCountries.value.length
|
|
768
|
+
? scienceCountries.value.map((code) => guidedCountryName(code, lang.value)).join(", ")
|
|
694
769
|
: tr("tous les pays", "all countries")
|
|
695
770
|
}.`,
|
|
696
771
|
followed.length ? `${tr("Sources suivies", "Followed sources")}${sep}${followed.join(", ")}.` : "",
|
|
@@ -986,7 +1061,7 @@ function requestClose(value: boolean) {
|
|
|
986
1061
|
|
|
987
1062
|
function reset() {
|
|
988
1063
|
step.value = "subjects";
|
|
989
|
-
|
|
1064
|
+
allCountries();
|
|
990
1065
|
reached.value = 0;
|
|
991
1066
|
reviewPhase.value = 0;
|
|
992
1067
|
query.value = "";
|
|
@@ -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
|
|
81
|
-
*
|
|
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"),
|
|
@@ -14,10 +14,17 @@
|
|
|
14
14
|
* - la marque (fr_drugs_app) : les avis HAS directs, les marques saisies et
|
|
15
15
|
* celles des molecules (repertoire des marques) cherchent les familles qui
|
|
16
16
|
* ne connaissent que la marque (ventes, prix, ANSM...) ;
|
|
17
|
-
* - l'essai (France Augmented Science) : les essais directs
|
|
18
|
-
* cherchent leurs sites et leurs investigateurs
|
|
17
|
+
* - l'essai (France Augmented Science) : les essais directs des pays choisis
|
|
18
|
+
* cherchent leurs sites et leurs investigateurs (centres et investigateurs
|
|
19
|
+
* NCT et EUCT partout, FINESS et RPPS en France), puis les publications et
|
|
19
20
|
* les appels a projets qui les citent.
|
|
20
21
|
*
|
|
22
|
+
* Deux sortes de pays. Les pays suggeres (GUIDED_COUNTRIES) ont leurs propres
|
|
23
|
+
* familles reglementaires et de ventes, ouvertes par la licence. Tous les
|
|
24
|
+
* autres (GUIDED_WORLD_COUNTRIES) n'ont que la science : essais, centres,
|
|
25
|
+
* investigateurs et publications se cherchent dans n'importe quel pays, les
|
|
26
|
+
* pays suggeres compris.
|
|
27
|
+
*
|
|
21
28
|
* Chaque fiche porte l'`_id` Elasticsearch que l'API des projets verifie
|
|
22
29
|
* (R-02), et ses preuves : ce qui la relie au sujet.
|
|
23
30
|
*/
|
|
@@ -25,6 +32,7 @@
|
|
|
25
32
|
import { ES_INDEX } from "../oip-drugs/esIndices";
|
|
26
33
|
import scienceIndexConfig from "../oip-science/indexConfig.json";
|
|
27
34
|
import { oipResourceSpec } from "../utils/oipResources";
|
|
35
|
+
import { ISO_ALPHA2 } from "../utils/countries";
|
|
28
36
|
import {
|
|
29
37
|
LIMIT,
|
|
30
38
|
clean,
|
|
@@ -50,9 +58,14 @@ type Text = { fr: string; en: string };
|
|
|
50
58
|
|
|
51
59
|
export type GuidedBlockKey = "drugs" | "regulatory" | "science";
|
|
52
60
|
|
|
53
|
-
/**
|
|
54
|
-
export type GuidedCountry =
|
|
61
|
+
/** Un pays, en code ISO 3166-1 alpha-2 minuscule. */
|
|
62
|
+
export type GuidedCountry = string;
|
|
55
63
|
|
|
64
|
+
/**
|
|
65
|
+
* Les pays suggeres : ceux ou la creation guidee cherche plus que la science
|
|
66
|
+
* (reglementaire, ventes, prix). Les autres pays du monde n'ont que le bloc
|
|
67
|
+
* science (GUIDED_WORLD_COUNTRIES).
|
|
68
|
+
*/
|
|
56
69
|
export const GUIDED_COUNTRIES: Array<{ code: GuidedCountry; label: Text }> = [
|
|
57
70
|
{ code: "fr", label: { fr: "France", en: "France" } },
|
|
58
71
|
{ code: "it", label: { fr: "Italie", en: "Italy" } },
|
|
@@ -62,6 +75,89 @@ export const GUIDED_COUNTRIES: Array<{ code: GuidedCountry; label: Text }> = [
|
|
|
62
75
|
{ code: "nz", label: { fr: "Nouvelle-Zélande", en: "New Zealand" } },
|
|
63
76
|
];
|
|
64
77
|
|
|
78
|
+
/** Tous les pays du monde, suggeres compris : ceux ou se cherche la science. */
|
|
79
|
+
export const GUIDED_WORLD_COUNTRIES: GuidedCountry[] = ISO_ALPHA2.map((code) => code.toLowerCase());
|
|
80
|
+
|
|
81
|
+
/** Le nom d'un pays dans la langue de l'interface. */
|
|
82
|
+
export function guidedCountryName(code: GuidedCountry, lang: GuidedLang) {
|
|
83
|
+
const known = GUIDED_COUNTRIES.find((entry) => entry.code === code);
|
|
84
|
+
if (known) return known.label[lang];
|
|
85
|
+
try {
|
|
86
|
+
return new Intl.DisplayNames([lang], { type: "region" }).of(code.toUpperCase()) ?? code.toUpperCase();
|
|
87
|
+
} catch {
|
|
88
|
+
return code.toUpperCase();
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Les noms qu'un pays porte dans les index d'essais, de centres et
|
|
94
|
+
* d'investigateurs, au-dela de son nom anglais (Intl). ClinicalTrials.gov et
|
|
95
|
+
* CTIS gardent les noms officiels d'avant (« Korea, Republic of », « Czech
|
|
96
|
+
* Republic »), les investigateurs NCT des abreviations (« Usa »). La
|
|
97
|
+
* comparaison ignore la casse.
|
|
98
|
+
*/
|
|
99
|
+
const COUNTRY_ALIASES: Record<string, string[]> = {
|
|
100
|
+
us: ["United States", "Usa"],
|
|
101
|
+
gb: ["United Kingdom", "Uk", "United Kingdom of Great Britain and Northern Ireland"],
|
|
102
|
+
tr: ["Turkey", "Turkey (Türkiye)", "Türkiye"],
|
|
103
|
+
kr: ["Korea, Republic of", "South Korea"],
|
|
104
|
+
kp: ["Korea, Democratic People's Republic of"],
|
|
105
|
+
ru: ["Russian Federation", "Russia"],
|
|
106
|
+
hk: ["Hong Kong"],
|
|
107
|
+
mo: ["Macau", "Macao"],
|
|
108
|
+
cz: ["Czech Republic", "Czechia"],
|
|
109
|
+
ir: ["Iran, Islamic Republic of", "Iran"],
|
|
110
|
+
ba: ["Bosnia and Herzegovina"],
|
|
111
|
+
md: ["Moldova, Republic of", "Moldova"],
|
|
112
|
+
sy: ["Syrian Arab Republic", "Syria"],
|
|
113
|
+
mk: ["Macedonia, The Former Yugoslav Republic of", "North Macedonia"],
|
|
114
|
+
cd: ["Congo, The Democratic Republic of the", "Democratic Republic of the Congo", "The Democratic Republic of the Congo"],
|
|
115
|
+
cg: ["Congo", "Republic of the Congo"],
|
|
116
|
+
ci: ["Côte D'Ivoire", "Côte d'Ivoire", "Ivory Coast"],
|
|
117
|
+
re: ["Reunion", "Réunion"],
|
|
118
|
+
ps: ["Palestinian Territory, occupied", "Palestinian Territories, Occupied", "Palestine"],
|
|
119
|
+
mm: ["Myanmar", "Burma"],
|
|
120
|
+
la: ["Lao People's Democratic Republic", "Laos"],
|
|
121
|
+
ag: ["Antigua and Barbuda"],
|
|
122
|
+
tt: ["Trinidad and Tobago"],
|
|
123
|
+
sz: ["Swaziland", "Eswatini"],
|
|
124
|
+
ly: ["Libyan Arab Jamahiriya", "Libya"],
|
|
125
|
+
gm: ["The Gambia", "Gambia"],
|
|
126
|
+
vi: ["Virgin Islands (U.S.)", "Virgin Islands"],
|
|
127
|
+
fo: ["Faroe Islands"],
|
|
128
|
+
yt: ["Mayotte"],
|
|
129
|
+
bn: ["Brunei Darussalam", "Brunei"],
|
|
130
|
+
kn: ["Saint Kitts and Nevis"],
|
|
131
|
+
lc: ["Saint Lucia"],
|
|
132
|
+
vc: ["Saint Vincent and the Grenadines"],
|
|
133
|
+
va: ["Holy See", "Holy See (Vatican City State)", "Vatican City"],
|
|
134
|
+
bs: ["The Bahamas", "Bahamas"],
|
|
135
|
+
ax: ["Aland Islands", "Åland Islands"],
|
|
136
|
+
fm: ["Federated States of Micronesia", "Micronesia"],
|
|
137
|
+
cv: ["Cabo Verde", "Cape Verde"],
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
/** Les noms d'un pays tels que les index les ecrivent. */
|
|
141
|
+
export function guidedCountryIndexNames(code: GuidedCountry) {
|
|
142
|
+
let english = "";
|
|
143
|
+
try {
|
|
144
|
+
english = (new Intl.DisplayNames(["en"], { type: "region" }).of(code.toUpperCase()) ?? "").replace(/ & /g, " and ").replace(/^St\. /, "Saint ");
|
|
145
|
+
} catch {
|
|
146
|
+
// Pas d'Intl : les alias seuls.
|
|
147
|
+
}
|
|
148
|
+
return uniq([english, ...(COUNTRY_ALIASES[code] ?? [])].filter(Boolean));
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
/** Un filtre sur le champ pays d'un index (`keyword`), pour une liste de pays. */
|
|
152
|
+
export function guidedCountryFilter(field: string, codes: GuidedCountry[]) {
|
|
153
|
+
return {
|
|
154
|
+
bool: {
|
|
155
|
+
should: codes.flatMap(guidedCountryIndexNames).map((name) => ({ term: { [field]: { value: name, case_insensitive: true } } })),
|
|
156
|
+
minimum_should_match: 1,
|
|
157
|
+
},
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
|
|
65
161
|
/**
|
|
66
162
|
* Un bloc de sources, le meme quel que soit le pays : ses familles sont
|
|
67
163
|
* celles de tous les pays (les actes AIFA sont du reglementaire, les prix
|
|
@@ -123,16 +219,46 @@ export const GUIDED_BLOCKS: GuidedBlock[] = [
|
|
|
123
219
|
key: "science",
|
|
124
220
|
label: { fr: "Augmented Science", en: "Augmented Science" },
|
|
125
221
|
description: {
|
|
126
|
-
fr: "Essais
|
|
127
|
-
en: "Trials
|
|
222
|
+
fr: "Essais, centres, investigateurs et publications dans tous les pays, appels à projets en France.",
|
|
223
|
+
en: "Trials, centers, investigators and publications in every country, calls for projects in France.",
|
|
128
224
|
},
|
|
129
225
|
icon: "Flask",
|
|
130
|
-
// Les essais et les publications d'abord : les
|
|
131
|
-
// etablissements s'en deduisent.
|
|
132
|
-
types: [
|
|
226
|
+
// Les essais et les publications d'abord : les centres, les
|
|
227
|
+
// investigateurs, les professionnels et les etablissements s'en deduisent.
|
|
228
|
+
types: [
|
|
229
|
+
"ClinicalTrialsEUCT",
|
|
230
|
+
"ClinicalTrialsNCT",
|
|
231
|
+
"PubMed",
|
|
232
|
+
"ClinicalTrialsCentersNCT",
|
|
233
|
+
"ClinicalTrialsCentersEUCT",
|
|
234
|
+
"ClinicalTrialsInvestigatorsNCT",
|
|
235
|
+
"ClinicalTrialsInvestigatorsEUCT",
|
|
236
|
+
"HCP",
|
|
237
|
+
"Establishment",
|
|
238
|
+
"PHRC",
|
|
239
|
+
],
|
|
133
240
|
},
|
|
134
241
|
];
|
|
135
242
|
|
|
243
|
+
/**
|
|
244
|
+
* Les familles qui se cherchent dans tous les pays : les essais, leurs
|
|
245
|
+
* centres et leurs investigateurs, les publications. Le pays choisi les
|
|
246
|
+
* filtre, il ne les ecarte pas. HCP, etablissements et PHRC restent
|
|
247
|
+
* francais (RPPS, FINESS).
|
|
248
|
+
*/
|
|
249
|
+
export const GUIDED_WORLD_TYPES = new Set([
|
|
250
|
+
"ClinicalTrialsNCT",
|
|
251
|
+
"ClinicalTrialsEUCT",
|
|
252
|
+
"PubMed",
|
|
253
|
+
"ClinicalTrialsCentersNCT",
|
|
254
|
+
"ClinicalTrialsCentersEUCT",
|
|
255
|
+
"ClinicalTrialsInvestigatorsNCT",
|
|
256
|
+
"ClinicalTrialsInvestigatorsEUCT",
|
|
257
|
+
]);
|
|
258
|
+
|
|
259
|
+
/** Une famille cherchee dans tous les pays (cf. GUIDED_WORLD_TYPES). */
|
|
260
|
+
export const guidedFamilyWorld = (type: string) => GUIDED_WORLD_TYPES.has(type);
|
|
261
|
+
|
|
136
262
|
/** Le pays des donnees d'une famille (celui de sa spec), la France par defaut. */
|
|
137
263
|
export function guidedFamilyCountry(type: string): GuidedCountry {
|
|
138
264
|
return (oipResourceSpec(type)?.kind.country as GuidedCountry | undefined) ?? "fr";
|
|
@@ -191,15 +317,24 @@ function merge(rows: GuidedRow[], limit = LIMIT) {
|
|
|
191
317
|
return [...byId.values()].sort((a, b) => KIND_ORDER[a.kind] - KIND_ORDER[b.kind]).slice(0, limit);
|
|
192
318
|
}
|
|
193
319
|
|
|
320
|
+
/** Ou chercher : les pays des familles nationales, et ceux de la science. */
|
|
321
|
+
export interface GuidedScope {
|
|
322
|
+
/** Les pays dont les familles nationales (HAS, ventes, prix...) sont cherchees ; absent : tous. */
|
|
323
|
+
national?: GuidedCountry[];
|
|
324
|
+
/** Les pays des essais, centres, investigateurs et publications ; vide ou absent : le monde entier. */
|
|
325
|
+
science?: GuidedCountry[];
|
|
326
|
+
}
|
|
327
|
+
|
|
194
328
|
/** Lance la recherche de toutes les familles ; `onFamily` recoit chacune des qu'elle repond. */
|
|
195
329
|
export async function collectGuided(
|
|
196
330
|
subjects: GuidedSubject[],
|
|
197
331
|
lang: GuidedLang,
|
|
198
332
|
onFamily: (type: string, state: GuidedFamilyState) => void,
|
|
199
|
-
|
|
200
|
-
countries: GuidedCountry[] = [],
|
|
333
|
+
scope: GuidedScope = {},
|
|
201
334
|
) {
|
|
202
|
-
const
|
|
335
|
+
const national = scope.national;
|
|
336
|
+
const scienceCountries = scope.science ?? [];
|
|
337
|
+
const wanted = (type: string) => guidedFamilyWorld(type) || !national || national.includes(guidedFamilyCountry(type));
|
|
203
338
|
const t = (fr: string, en: string) => (lang === "en" ? en : fr);
|
|
204
339
|
const diseases = subjects.filter((subject) => subject.focus === "disease");
|
|
205
340
|
const molecules = subjects.filter((subject) => subject.focus === "molecule");
|
|
@@ -688,7 +823,7 @@ export async function collectGuided(
|
|
|
688
823
|
);
|
|
689
824
|
}
|
|
690
825
|
|
|
691
|
-
/** Les essais d'un sujet,
|
|
826
|
+
/** Les essais d'un sujet, dans les pays choisis. Clauses nommees : `condition`, `code`, `intervention` (direct), `text` (mention). */
|
|
692
827
|
async function trialsOf(type: "ClinicalTrialsNCT" | "ClinicalTrialsEUCT", subject: GuidedSubject): Promise<GuidedRow[]> {
|
|
693
828
|
const nct = type === "ClinicalTrialsNCT";
|
|
694
829
|
const onDisease = subject.focus === "disease";
|
|
@@ -720,9 +855,11 @@ export async function collectGuided(
|
|
|
720
855
|
},
|
|
721
856
|
}
|
|
722
857
|
: { bool: { ...textMatch(subject.label, matchFields).bool, _name: matchName } };
|
|
723
|
-
const
|
|
724
|
-
?
|
|
725
|
-
|
|
858
|
+
const inCountries = scienceCountries.length
|
|
859
|
+
? nct
|
|
860
|
+
? [{ nested: { path: "countries", query: guidedCountryFilter("countries.countries_name.keyword", scienceCountries) } }]
|
|
861
|
+
: [guidedCountryFilter("countries.country_name.keyword", scienceCountries)]
|
|
862
|
+
: [];
|
|
726
863
|
|
|
727
864
|
const hits = await search(type, {
|
|
728
865
|
size: 50,
|
|
@@ -736,7 +873,7 @@ export async function collectGuided(
|
|
|
736
873
|
],
|
|
737
874
|
query: {
|
|
738
875
|
bool: {
|
|
739
|
-
filter:
|
|
876
|
+
filter: inCountries,
|
|
740
877
|
should: [condition, { bool: { ...textMatch(subject.label, titleFields).bool, _name: "text" } }, ...(code ? [code] : [])],
|
|
741
878
|
minimum_should_match: 1,
|
|
742
879
|
},
|
|
@@ -889,6 +1026,70 @@ export async function collectGuided(
|
|
|
889
1026
|
});
|
|
890
1027
|
});
|
|
891
1028
|
|
|
1029
|
+
/**
|
|
1030
|
+
* Les centres et investigateurs NCT et EUCT des essais retenus, dans les
|
|
1031
|
+
* pays choisis : un document par centre ou investigateur, ses essais dans
|
|
1032
|
+
* `records`. Les plus investis d'abord.
|
|
1033
|
+
*/
|
|
1034
|
+
const WORLD_ACTORS: Record<string, { source: "nct" | "euct"; role: "site" | "investigator"; country: string }> = {
|
|
1035
|
+
ClinicalTrialsCentersNCT: { source: "nct", role: "site", country: "facility_country" },
|
|
1036
|
+
ClinicalTrialsCentersEUCT: { source: "euct", role: "site", country: "country" },
|
|
1037
|
+
ClinicalTrialsInvestigatorsNCT: { source: "nct", role: "investigator", country: "country" },
|
|
1038
|
+
ClinicalTrialsInvestigatorsEUCT: { source: "euct", role: "investigator", country: "country" },
|
|
1039
|
+
};
|
|
1040
|
+
|
|
1041
|
+
async function worldActorRows(type: string): Promise<GuidedRow[]> {
|
|
1042
|
+
const how = WORLD_ACTORS[type]!;
|
|
1043
|
+
const spec = oipResourceSpec(type);
|
|
1044
|
+
const kept = await keptTrials;
|
|
1045
|
+
const trials = kept[how.source];
|
|
1046
|
+
if (!spec || !trials.length) return [];
|
|
1047
|
+
const idField = how.source === "nct" ? "records.nct_id" : "records.euct_number";
|
|
1048
|
+
const hits = await search(type, {
|
|
1049
|
+
size: 500,
|
|
1050
|
+
_source: [...(spec.kind.source ?? []), idField],
|
|
1051
|
+
query: {
|
|
1052
|
+
bool: {
|
|
1053
|
+
filter: [
|
|
1054
|
+
{ terms: { [`${idField}.keyword`]: trials } },
|
|
1055
|
+
...(scienceCountries.length ? [guidedCountryFilter(`${how.country}.keyword`, scienceCountries)] : []),
|
|
1056
|
+
],
|
|
1057
|
+
},
|
|
1058
|
+
},
|
|
1059
|
+
});
|
|
1060
|
+
const keptIds = new Set(trials);
|
|
1061
|
+
const field = idField.split(".")[1]!;
|
|
1062
|
+
return hits
|
|
1063
|
+
.map((hit) => ({ hit, ids: uniq(list(hit._source?.records).map((record) => clean(record?.[field]))).filter((id) => keptIds.has(id)) }))
|
|
1064
|
+
.filter(({ ids }) => ids.length)
|
|
1065
|
+
.sort((a, b) => b.ids.length - a.ids.length)
|
|
1066
|
+
.slice(0, LIMIT)
|
|
1067
|
+
.map(({ hit, ids }): GuidedRow => {
|
|
1068
|
+
const s = hit._source ?? {};
|
|
1069
|
+
const count = ids.length;
|
|
1070
|
+
const lines = ids.slice(0, 5).map((id) => trialLine(kept.titles, id));
|
|
1071
|
+
if (count > 5) lines.push(t(`et ${count - 5} autres`, `and ${count - 5} more`));
|
|
1072
|
+
return {
|
|
1073
|
+
id: hit._id,
|
|
1074
|
+
title: spec.kind.title(s, lang) || hit._id,
|
|
1075
|
+
subtitle: joinDot(actorCount(how.role, count), spec.kind.subtitle?.(s, lang)),
|
|
1076
|
+
kind: "deduced",
|
|
1077
|
+
evidence: [
|
|
1078
|
+
{
|
|
1079
|
+
label:
|
|
1080
|
+
how.role === "site"
|
|
1081
|
+
? t(`Centre de ${count} essai${count > 1 ? "s" : ""} sur « ${subjectNames} »`, `Center of ${count} trial${count > 1 ? "s" : ""} on "${subjectNames}"`)
|
|
1082
|
+
: t(`Investigateur dans ${count} essai${count > 1 ? "s" : ""} sur « ${subjectNames} »`, `Investigator in ${count} trial${count > 1 ? "s" : ""} on "${subjectNames}"`),
|
|
1083
|
+
values: lines,
|
|
1084
|
+
},
|
|
1085
|
+
],
|
|
1086
|
+
source: s,
|
|
1087
|
+
};
|
|
1088
|
+
});
|
|
1089
|
+
}
|
|
1090
|
+
|
|
1091
|
+
const worldActorTasks = Object.keys(WORLD_ACTORS).map((type) => run(type, () => worldActorRows(type)));
|
|
1092
|
+
|
|
892
1093
|
/** Le sujet dans une publication : code ou titre pour une maladie, titre et substances pour le reste. */
|
|
893
1094
|
const publicationSubject = {
|
|
894
1095
|
bool: {
|
|
@@ -940,10 +1141,29 @@ export async function collectGuided(
|
|
|
940
1141
|
},
|
|
941
1142
|
});
|
|
942
1143
|
}
|
|
943
|
-
//
|
|
1144
|
+
// Le sujet, par un auteur des pays choisis (en France, un auteur au RPPS
|
|
1145
|
+
// connu compte aussi) ; sans pays, tout le monde.
|
|
1146
|
+
const authorCountry = scienceCountries.length
|
|
1147
|
+
? [
|
|
1148
|
+
{
|
|
1149
|
+
nested: {
|
|
1150
|
+
path: "authors",
|
|
1151
|
+
query: {
|
|
1152
|
+
bool: {
|
|
1153
|
+
should: [
|
|
1154
|
+
{ terms: { "authors.country_code.keyword": scienceCountries.map((code) => code.toUpperCase()) } },
|
|
1155
|
+
...(scienceCountries.includes("fr") ? [{ exists: { field: "authors.hcp_code" } }] : []),
|
|
1156
|
+
],
|
|
1157
|
+
minimum_should_match: 1,
|
|
1158
|
+
},
|
|
1159
|
+
},
|
|
1160
|
+
},
|
|
1161
|
+
},
|
|
1162
|
+
]
|
|
1163
|
+
: [];
|
|
944
1164
|
should.push({
|
|
945
1165
|
constant_score: {
|
|
946
|
-
filter: { bool: { filter: [publicationSubject,
|
|
1166
|
+
filter: { bool: { filter: [publicationSubject, ...authorCountry], _name: "subject" } },
|
|
947
1167
|
boost: 1,
|
|
948
1168
|
},
|
|
949
1169
|
});
|
|
@@ -1143,6 +1363,7 @@ export async function collectGuided(
|
|
|
1143
1363
|
...Object.entries(brandTasks).map(([type, task]) => run(type, task)),
|
|
1144
1364
|
nctRows,
|
|
1145
1365
|
euctRows,
|
|
1366
|
+
...worldActorTasks,
|
|
1146
1367
|
establishmentRows,
|
|
1147
1368
|
hcpRows,
|
|
1148
1369
|
publicationRows,
|
|
@@ -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)
|
|
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);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// ISO 3166-1 alpha-2 codes → localized country names via Intl.DisplayNames.
|
|
2
2
|
// Used by the onboarding country picker (searchable select).
|
|
3
|
-
const ISO_ALPHA2 = [
|
|
3
|
+
export const ISO_ALPHA2 = [
|
|
4
4
|
"AF","AX","AL","DZ","AS","AD","AO","AI","AQ","AG","AR","AM","AW","AU","AT","AZ",
|
|
5
5
|
"BS","BH","BD","BB","BY","BE","BZ","BJ","BM","BT","BO","BA","BW","BR","IO","BN",
|
|
6
6
|
"BG","BF","BI","KH","CM","CA","CV","KY","CF","TD","CL","CN","CO","KM","CG","CD",
|
|
@@ -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
|
}
|