@tekkare/romulus 0.1.280 → 0.1.282
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-drugs/fiches/AssociationFiche.vue +78 -3
- package/layer/app/components/oip-drugs/heart/associations/NationalAssemblyAmendmentCard.vue +308 -0
- package/layer/app/components/oip-italy/AifaAct.vue +27 -206
- package/layer/app/components/oip-italy/AifaBrandFiche.vue +369 -0
- package/layer/app/components/oip-italy/BrandPrices.vue +247 -0
- package/layer/app/oip-drugs/composables/useAssociationDetail.ts +20 -4
- package/layer/app/oip-drugs/esIndices.ts +2 -0
- package/layer/app/oip-drugs/locales/en.json +21 -3
- package/layer/app/oip-drugs/locales/fr.json +21 -3
- package/layer/app/oip-drugs/utils/associationFields.ts +92 -0
- package/layer/app/oip-italy/useAifaSource.ts +47 -0
- package/layer/app/utils/italyApprovals.ts +92 -0
- package/layer/server/api/oip/pdf.get.ts +2 -0
- package/package.json +1 -1
|
@@ -1,77 +1,34 @@
|
|
|
1
1
|
<!--
|
|
2
|
-
|
|
3
|
-
(opinion_id)
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
Un acte de l'AIFA range dans un projet (Italy One, type ItApproval), par son
|
|
3
|
+
`_id` (opinion_id). Comme la page de la marque d'Italy One : on relit
|
|
4
|
+
l'acte pour sa marque, puis on monte la fiche de la marque (actes et prix),
|
|
5
|
+
celle que montre /approvals/details/<marque>.
|
|
6
6
|
|
|
7
7
|
Montee par le tiroir des projets ; le lien vers l'app passe par le slot
|
|
8
8
|
`title-link`.
|
|
9
9
|
-->
|
|
10
10
|
<template>
|
|
11
|
-
<div class="oip-italy">
|
|
12
|
-
<
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
</RmTag>
|
|
28
|
-
<RmTag v-if="hasIndication" variant="emerald">Indication</RmTag>
|
|
29
|
-
</div>
|
|
30
|
-
|
|
31
|
-
<RmCard padding="md">
|
|
32
|
-
<h3 class="oip-italy__card-title">{{ en ? "Act" : "Acte" }}</h3>
|
|
33
|
-
<dl class="oip-italy__rows">
|
|
34
|
-
<template v-for="row in rows" :key="row.label">
|
|
35
|
-
<dt>{{ row.label }}</dt>
|
|
36
|
-
<dd>{{ row.value }}</dd>
|
|
37
|
-
</template>
|
|
38
|
-
</dl>
|
|
39
|
-
</RmCard>
|
|
40
|
-
|
|
41
|
-
<RmCard v-if="hasIndication" padding="md">
|
|
42
|
-
<h3 class="oip-italy__card-title">Indication</h3>
|
|
43
|
-
<p class="oip-italy__text">{{ doc.indication_en || doc.indication }}</p>
|
|
44
|
-
</RmCard>
|
|
45
|
-
|
|
46
|
-
<RmCard v-if="essential" padding="md">
|
|
47
|
-
<h3 class="oip-italy__card-title">{{ en ? "Determination" : "Détermination" }}</h3>
|
|
48
|
-
<p class="oip-italy__text oip-italy__text--long">{{ essential }}</p>
|
|
49
|
-
<a v-if="doc.aifa_url" class="oip-italy__link" :href="doc.aifa_url" target="_blank" rel="noopener">
|
|
50
|
-
{{ en ? "Act on AIFA Trovanorme" : "L’acte sur Trovanorme (AIFA)" }} ↗
|
|
51
|
-
</a>
|
|
52
|
-
</RmCard>
|
|
53
|
-
|
|
54
|
-
<RmCard v-if="others.length" padding="md">
|
|
55
|
-
<h3 class="oip-italy__card-title">
|
|
56
|
-
{{ en ? `Other acts of ${doc.brand}` : `Autres actes de ${doc.brand}` }} ({{ othersTotal }})
|
|
57
|
-
</h3>
|
|
58
|
-
<ul class="oip-italy__list">
|
|
59
|
-
<li v-for="other in others" :key="other.opinion_id">
|
|
60
|
-
<span class="oip-italy__date">{{ date(other.decision_date) }}</span>
|
|
61
|
-
<span>{{ other.nature_of_request_en || other.nature_of_request || documentType(other.document_type) }}</span>
|
|
62
|
-
</li>
|
|
63
|
-
</ul>
|
|
64
|
-
<p v-if="othersTotal > others.length" class="oip-italy__note">
|
|
65
|
-
{{ en ? `The ${others.length} most recent.` : `Les ${others.length} plus récents.` }}
|
|
66
|
-
</p>
|
|
67
|
-
</RmCard>
|
|
68
|
-
</template>
|
|
69
|
-
</div>
|
|
11
|
+
<div class="oip-italy-act">
|
|
12
|
+
<RmLoadingState v-if="pending" spinner />
|
|
13
|
+
|
|
14
|
+
<OipItalyAifaBrandFiche v-else-if="brand" :brand="brand" :lang="lang">
|
|
15
|
+
<template #title-link><slot name="title-link" /></template>
|
|
16
|
+
</OipItalyAifaBrandFiche>
|
|
17
|
+
|
|
18
|
+
<template v-else>
|
|
19
|
+
<RmPageHeader :eyebrow="en ? 'AIFA regulatory act' : 'Acte réglementaire de l’AIFA'">
|
|
20
|
+
<template #title>
|
|
21
|
+
{{ id }}
|
|
22
|
+
<slot name="title-link" />
|
|
23
|
+
</template>
|
|
24
|
+
</RmPageHeader>
|
|
25
|
+
<RmEmptyState icon="Prohibit" :title="en ? 'Act not found' : 'Acte introuvable'" />
|
|
26
|
+
</template>
|
|
70
27
|
</div>
|
|
71
28
|
</template>
|
|
72
29
|
|
|
73
30
|
<script setup lang="ts">
|
|
74
|
-
import { oipEsGet
|
|
31
|
+
import { oipEsGet } from "../../composables/useOipResources";
|
|
75
32
|
import { ITALY_INDEX } from "../../oip-italy/kinds";
|
|
76
33
|
|
|
77
34
|
const props = withDefaults(
|
|
@@ -85,152 +42,16 @@ const props = withDefaults(
|
|
|
85
42
|
{ type: "ItApproval", lang: "fr", highlight: () => [] },
|
|
86
43
|
);
|
|
87
44
|
|
|
88
|
-
const OTHERS_SHOWN = 30;
|
|
89
|
-
|
|
90
45
|
const en = computed(() => props.lang === "en");
|
|
91
|
-
const
|
|
92
|
-
const
|
|
93
|
-
const others = ref<Record<string, any>[]>([]);
|
|
94
|
-
const othersTotal = ref(0);
|
|
95
|
-
|
|
96
|
-
/** Les cinq canaux de publication de Trovanorme, nommes comme le portail. */
|
|
97
|
-
const DOCUMENT_TYPES: Record<string, string> = {
|
|
98
|
-
GU: "Gazzetta Ufficiale",
|
|
99
|
-
MSF: "Modifiche secondarie di farmaci",
|
|
100
|
-
TNF: "Testi normativi farmaceutici",
|
|
101
|
-
AIFA: "Documenti AIFA",
|
|
102
|
-
NEWS: "News",
|
|
103
|
-
};
|
|
104
|
-
const documentType = (code: unknown) => DOCUMENT_TYPES[String(code ?? "")] ?? (String(code ?? "") || "-");
|
|
105
|
-
|
|
106
|
-
const date = (value: unknown) => {
|
|
107
|
-
const parsed = new Date(String(value ?? ""));
|
|
108
|
-
return Number.isNaN(parsed.getTime())
|
|
109
|
-
? "-"
|
|
110
|
-
: parsed.toLocaleDateString(en.value ? "en-GB" : "fr-FR", { day: "numeric", month: "short", year: "numeric" });
|
|
111
|
-
};
|
|
112
|
-
|
|
113
|
-
const hasIndication = computed(() => !!(doc.value?.indication_en || doc.value?.indication));
|
|
114
|
-
// le texte traduit quand il existe, l'original italien sinon (champ « None » quand le quota de traduction est epuise)
|
|
115
|
-
const essential = computed(() => {
|
|
116
|
-
const translated = doc.value?.essential_en;
|
|
117
|
-
return translated && translated !== "None" ? translated : (doc.value?.essential ?? "");
|
|
118
|
-
});
|
|
119
|
-
|
|
120
|
-
const rows = computed(() => {
|
|
121
|
-
const d = doc.value ?? {};
|
|
122
|
-
return [
|
|
123
|
-
{ label: "Date", value: date(d.decision_date) },
|
|
124
|
-
{ label: en.value ? "Reference" : "Référence", value: d.has_code },
|
|
125
|
-
{ label: en.value ? "Molecule" : "Molécule", value: d.atc5_code_label || d.molecule },
|
|
126
|
-
{ label: en.value ? "Company" : "Laboratoire", value: d.company },
|
|
127
|
-
{ label: en.value ? "Therapeutic area" : "Aire thérapeutique", value: d.theme_en || d.theme },
|
|
128
|
-
].filter((row) => row.value);
|
|
129
|
-
});
|
|
46
|
+
const pending = ref(true);
|
|
47
|
+
const brand = ref("");
|
|
130
48
|
|
|
131
49
|
async function read() {
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
const hit = await oipEsGet<any>("drugs", ITALY_INDEX.aifa, props.id).catch(() => null);
|
|
137
|
-
doc.value = hit?._source ?? null;
|
|
138
|
-
if (doc.value?.brand) {
|
|
139
|
-
const res = await oipEsSearch<any>("drugs", ITALY_INDEX.aifa, {
|
|
140
|
-
size: OTHERS_SHOWN + 1,
|
|
141
|
-
track_total_hits: true,
|
|
142
|
-
_source: ["opinion_id", "decision_date", "document_type", "nature_of_request", "nature_of_request_en"],
|
|
143
|
-
query: { term: { "brand.keyword": doc.value.brand } },
|
|
144
|
-
sort: [{ decision_date: "desc" }],
|
|
145
|
-
}).catch(() => null);
|
|
146
|
-
const list = (res?.hits?.hits ?? []).map((h: any) => h._source).filter((s: any) => s.opinion_id !== props.id);
|
|
147
|
-
others.value = list.slice(0, OTHERS_SHOWN);
|
|
148
|
-
othersTotal.value = Math.max(0, (res?.hits?.total?.value ?? list.length) - 1);
|
|
149
|
-
}
|
|
150
|
-
loading.value = false;
|
|
50
|
+
pending.value = true;
|
|
51
|
+
const hit = await oipEsGet<any>("drugs", ITALY_INDEX.aifa, props.id, ["brand"]).catch(() => null);
|
|
52
|
+
brand.value = String(hit?._source?.brand ?? "");
|
|
53
|
+
pending.value = false;
|
|
151
54
|
}
|
|
152
55
|
|
|
153
56
|
watch(() => props.id, read, { immediate: true });
|
|
154
57
|
</script>
|
|
155
|
-
|
|
156
|
-
<style scoped>
|
|
157
|
-
.oip-italy__body {
|
|
158
|
-
display: flex;
|
|
159
|
-
flex-direction: column;
|
|
160
|
-
gap: var(--space-16);
|
|
161
|
-
padding: var(--space-20) var(--space-32) var(--space-32);
|
|
162
|
-
}
|
|
163
|
-
.oip-italy__title {
|
|
164
|
-
margin-right: var(--space-12);
|
|
165
|
-
}
|
|
166
|
-
.oip-italy__tags {
|
|
167
|
-
display: flex;
|
|
168
|
-
flex-wrap: wrap;
|
|
169
|
-
gap: var(--space-6);
|
|
170
|
-
}
|
|
171
|
-
.oip-italy__card-title {
|
|
172
|
-
margin: 0 0 var(--space-12);
|
|
173
|
-
font-size: var(--font-16);
|
|
174
|
-
font-weight: var(--weight-bold);
|
|
175
|
-
}
|
|
176
|
-
.oip-italy__text {
|
|
177
|
-
margin: 0;
|
|
178
|
-
font-size: var(--font-14);
|
|
179
|
-
line-height: 1.6;
|
|
180
|
-
}
|
|
181
|
-
.oip-italy__text--long {
|
|
182
|
-
max-height: 320px;
|
|
183
|
-
overflow-y: auto;
|
|
184
|
-
white-space: pre-line;
|
|
185
|
-
}
|
|
186
|
-
.oip-italy__rows {
|
|
187
|
-
display: grid;
|
|
188
|
-
grid-template-columns: minmax(140px, max-content) 1fr;
|
|
189
|
-
gap: var(--space-8) var(--space-20);
|
|
190
|
-
margin: 0;
|
|
191
|
-
font-size: var(--font-14);
|
|
192
|
-
}
|
|
193
|
-
.oip-italy__rows dt {
|
|
194
|
-
padding-top: 2px;
|
|
195
|
-
color: var(--text-muted);
|
|
196
|
-
font-size: var(--font-12);
|
|
197
|
-
font-weight: var(--weight-semibold);
|
|
198
|
-
text-transform: uppercase;
|
|
199
|
-
}
|
|
200
|
-
.oip-italy__rows dd {
|
|
201
|
-
margin: 0;
|
|
202
|
-
line-height: 1.5;
|
|
203
|
-
}
|
|
204
|
-
.oip-italy__link {
|
|
205
|
-
display: inline-block;
|
|
206
|
-
margin-top: var(--space-16);
|
|
207
|
-
color: var(--color-primary);
|
|
208
|
-
font-size: var(--font-13);
|
|
209
|
-
font-weight: var(--weight-semibold);
|
|
210
|
-
}
|
|
211
|
-
.oip-italy__list {
|
|
212
|
-
display: flex;
|
|
213
|
-
flex-direction: column;
|
|
214
|
-
gap: var(--space-8);
|
|
215
|
-
margin: 0;
|
|
216
|
-
padding: 0;
|
|
217
|
-
font-size: var(--font-13);
|
|
218
|
-
line-height: 1.5;
|
|
219
|
-
list-style: none;
|
|
220
|
-
}
|
|
221
|
-
.oip-italy__list li {
|
|
222
|
-
display: flex;
|
|
223
|
-
gap: var(--space-12);
|
|
224
|
-
}
|
|
225
|
-
.oip-italy__date {
|
|
226
|
-
flex: none;
|
|
227
|
-
width: 96px;
|
|
228
|
-
color: var(--text-muted);
|
|
229
|
-
font-variant-numeric: tabular-nums;
|
|
230
|
-
}
|
|
231
|
-
.oip-italy__note {
|
|
232
|
-
margin: var(--space-10) 0 0;
|
|
233
|
-
color: var(--text-muted);
|
|
234
|
-
font-size: var(--font-12);
|
|
235
|
-
}
|
|
236
|
-
</style>
|
|
@@ -0,0 +1,369 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
Fiche marque des actes de l'AIFA (portage de pages/approvals/details de
|
|
3
|
+
Italy One) : identite de la marque, dernier texte publie, historique
|
|
4
|
+
reglementaire (une ligne s'ouvre sur le texte complet de l'acte), puis
|
|
5
|
+
l'onglet Prix (la meme marque dans le Price Tracker italien).
|
|
6
|
+
|
|
7
|
+
Ce que la page lisait dans sa route arrive en props (`brand`, `tab`) ;
|
|
8
|
+
l'onglet choisi part par `update:tab`. L'export, les alertes et le bouton
|
|
9
|
+
Projet restent dans la page d'Italy One, qui les pose dans le slot
|
|
10
|
+
`actions` et lit les actes charges par `loaded` ; dans le tiroir d'un
|
|
11
|
+
projet, rien n'y est passe et le lien vers l'app passe par `title-link`.
|
|
12
|
+
-->
|
|
13
|
+
<template>
|
|
14
|
+
<div class="oip-italy-brand">
|
|
15
|
+
<RmPageHeader
|
|
16
|
+
:eyebrow="en ? 'AIFA · Regulatory acts' : 'AIFA · Actes réglementaires'"
|
|
17
|
+
:have-return="haveReturn"
|
|
18
|
+
:back-to="backTo"
|
|
19
|
+
:tabs="headerTabs"
|
|
20
|
+
:tabs-label="en ? 'Record sections' : 'Sections de la fiche'"
|
|
21
|
+
@tab="selectTab"
|
|
22
|
+
>
|
|
23
|
+
<template #title>
|
|
24
|
+
<span class="oip-italy-brand__title">{{ title }}</span>
|
|
25
|
+
<slot name="title-link" />
|
|
26
|
+
</template>
|
|
27
|
+
<template v-if="$slots.actions" #actions>
|
|
28
|
+
<slot name="actions" :acts="acts" :latest-act="latestAct" :brand="title" :tab="activeTab" />
|
|
29
|
+
</template>
|
|
30
|
+
</RmPageHeader>
|
|
31
|
+
|
|
32
|
+
<!-- dans une page, la colonne du cadre pose les gouttieres ; dans le
|
|
33
|
+
tiroir d'un projet, la fiche les pose elle-meme -->
|
|
34
|
+
<div class="oip-italy-brand__body" :class="{ 'oip-italy-brand__body--page': haveReturn }">
|
|
35
|
+
<RmLoadingState v-if="loading" :lines="3" :chart-height="240" />
|
|
36
|
+
|
|
37
|
+
<RmEmptyState v-else-if="!acts.length" :title="en ? 'Brand not found.' : 'Marque introuvable.'" :text="brand" />
|
|
38
|
+
|
|
39
|
+
<template v-else-if="activeTab === 1">
|
|
40
|
+
<!-- identite de la marque -->
|
|
41
|
+
<RmSectionCard position="none">
|
|
42
|
+
<div class="oip-italy-brand__stack">
|
|
43
|
+
<p class="oip-italy-brand__meta">
|
|
44
|
+
{{ acts.length }} {{ en ? "acts" : "actes" }}
|
|
45
|
+
· {{ en ? "from" : "de" }}
|
|
46
|
+
<RmDate :date="firstActDate" :lang="lang" compact />
|
|
47
|
+
{{ en ? "to" : "à" }}
|
|
48
|
+
<RmDate :date="latestAct?.decision_date" :lang="lang" compact />
|
|
49
|
+
<template v-if="latestAct?.nature_of_request_en">
|
|
50
|
+
· {{ en ? "latest act:" : "dernier acte :" }}
|
|
51
|
+
{{ latestAct.nature_of_request_en }}
|
|
52
|
+
</template>
|
|
53
|
+
</p>
|
|
54
|
+
<div class="oip-italy-brand__tags">
|
|
55
|
+
<RmTag v-if="latestAct?.molecule" variant="gray">{{ latestAct.molecule }}</RmTag>
|
|
56
|
+
<RmTag v-if="latestAct?.company" variant="gray">{{ latestAct.company }}</RmTag>
|
|
57
|
+
<RmTag variant="gray">ATC5 : {{ latestAct?.atc5_code || "N/A" }}</RmTag>
|
|
58
|
+
<RmTag v-if="latestAct?.theme_en" variant="gray">{{ titleCase(latestAct.theme_en) }}</RmTag>
|
|
59
|
+
</div>
|
|
60
|
+
|
|
61
|
+
<!-- la derniere indication de la marque, ou le texte de son
|
|
62
|
+
dernier acte quand elle n'en a pas ; le tag dit lequel -->
|
|
63
|
+
<div class="oip-italy-brand__stack oip-italy-brand__stack--tight">
|
|
64
|
+
<div class="oip-italy-brand__row">
|
|
65
|
+
<p class="oip-italy-brand__subtitle">{{ en ? "Latest published text" : "Dernier texte publié" }}</p>
|
|
66
|
+
<RmTag :variant="indicationAct ? 'emerald' : 'gray'">
|
|
67
|
+
{{ indicationAct ? "Indication" : en ? "Act text" : "Texte de l'acte" }}
|
|
68
|
+
</RmTag>
|
|
69
|
+
<p v-if="textAct" class="oip-italy-brand__meta">
|
|
70
|
+
<RmDate :date="textAct.decision_date" :lang="lang" compact />
|
|
71
|
+
· {{ textAct.nature_of_request_en }}
|
|
72
|
+
</p>
|
|
73
|
+
</div>
|
|
74
|
+
<p v-if="publishedText" class="oip-italy-brand__text">{{ publishedText }}</p>
|
|
75
|
+
<p v-else class="oip-italy-brand__meta">
|
|
76
|
+
{{ en ? "No text published by AIFA for this brand." : "Aucun texte publié par l'AIFA pour cette marque." }}
|
|
77
|
+
</p>
|
|
78
|
+
</div>
|
|
79
|
+
</div>
|
|
80
|
+
</RmSectionCard>
|
|
81
|
+
|
|
82
|
+
<!-- tous les actes publies pour la marque ; une ligne s'ouvre sur le
|
|
83
|
+
texte complet de la determination -->
|
|
84
|
+
<RmTableCard :lang="lang" :source="source" :verified="verified" :payload="historyPayload">
|
|
85
|
+
<template #header>
|
|
86
|
+
<h3 class="rm-table-card__title">{{ en ? "Regulatory history" : "Historique réglementaire" }}</h3>
|
|
87
|
+
<p class="rm-table-card__context">
|
|
88
|
+
{{ acts.length }} {{ en ? "acts" : "actes" }}
|
|
89
|
+
<span v-if="historyCapped">({{ en ? "most recent" : "les plus récents" }})</span>
|
|
90
|
+
</p>
|
|
91
|
+
</template>
|
|
92
|
+
<RmTable
|
|
93
|
+
flat
|
|
94
|
+
expandable
|
|
95
|
+
row-key="id"
|
|
96
|
+
:columns="tableColumns"
|
|
97
|
+
:rows="tableRows"
|
|
98
|
+
:page-size="20"
|
|
99
|
+
:empty-text="en ? 'No data' : 'Aucune donnée'"
|
|
100
|
+
>
|
|
101
|
+
<template #date="{ value }">
|
|
102
|
+
<p class="oip-italy-brand__nowrap"><RmDate :date="value" :lang="lang" compact /></p>
|
|
103
|
+
</template>
|
|
104
|
+
<template #document="{ row }">
|
|
105
|
+
<p>
|
|
106
|
+
{{ documentTypeLabel(row.documentType) }}
|
|
107
|
+
<span class="oip-italy-brand__muted">{{ row.code }}</span>
|
|
108
|
+
</p>
|
|
109
|
+
</template>
|
|
110
|
+
<template #nature="{ value }">
|
|
111
|
+
<p>{{ value || "-" }}</p>
|
|
112
|
+
</template>
|
|
113
|
+
<template #indication="{ value }">
|
|
114
|
+
<p v-if="value" class="oip-italy-brand__clamp">{{ value }}</p>
|
|
115
|
+
<span v-else class="oip-italy-brand__muted">-</span>
|
|
116
|
+
</template>
|
|
117
|
+
<template #text="{ value }">
|
|
118
|
+
<p v-if="value" class="oip-italy-brand__clamp oip-italy-brand__clamp--one">{{ value }}</p>
|
|
119
|
+
<span v-else class="oip-italy-brand__muted">-</span>
|
|
120
|
+
</template>
|
|
121
|
+
<template #expanded="{ row }">
|
|
122
|
+
<div class="oip-italy-brand__more">
|
|
123
|
+
<div class="oip-italy-brand__row oip-italy-brand__row--between">
|
|
124
|
+
<p class="oip-italy-brand__subtitle">
|
|
125
|
+
{{ en ? "Act text" : "Texte de l'acte" }}
|
|
126
|
+
<span class="oip-italy-brand__meta">
|
|
127
|
+
{{
|
|
128
|
+
row.act.essential_en && row.act.essential_en !== "None"
|
|
129
|
+
? en
|
|
130
|
+
? "(machine translation)"
|
|
131
|
+
: "(traduction automatique)"
|
|
132
|
+
: en
|
|
133
|
+
? "(in Italian, as published by AIFA)"
|
|
134
|
+
: "(en italien, tel que publié par l'AIFA)"
|
|
135
|
+
}}
|
|
136
|
+
</span>
|
|
137
|
+
</p>
|
|
138
|
+
<a v-if="row.act.aifa_url" :href="row.act.aifa_url" target="_blank" rel="noopener" class="oip-italy-brand__link">
|
|
139
|
+
{{ en ? "View on AIFA" : "Voir sur AIFA" }}
|
|
140
|
+
</a>
|
|
141
|
+
</div>
|
|
142
|
+
<p v-if="row.indication" class="oip-italy-brand__text">
|
|
143
|
+
<span class="oip-italy-brand__meta">Indication : </span>{{ row.indication }}
|
|
144
|
+
</p>
|
|
145
|
+
<p class="oip-italy-brand__text">{{ essentialOf(row.act) || "-" }}</p>
|
|
146
|
+
</div>
|
|
147
|
+
</template>
|
|
148
|
+
</RmTable>
|
|
149
|
+
</RmTableCard>
|
|
150
|
+
</template>
|
|
151
|
+
|
|
152
|
+
<!-- la meme marque dans le Price Tracker italien -->
|
|
153
|
+
<OipItalyBrandPrices v-else-if="activeTab === 2" :brand="title" :lang="lang" />
|
|
154
|
+
</div>
|
|
155
|
+
</div>
|
|
156
|
+
</template>
|
|
157
|
+
|
|
158
|
+
<script setup lang="ts">
|
|
159
|
+
import { oipEsSearch } from "../../composables/useOipResources";
|
|
160
|
+
import { ITALY_INDEX } from "../../oip-italy/kinds";
|
|
161
|
+
import { useAifaSource } from "../../oip-italy/useAifaSource";
|
|
162
|
+
import {
|
|
163
|
+
OPINION_FIELDS,
|
|
164
|
+
actSheetSchema,
|
|
165
|
+
documentTypeLabel,
|
|
166
|
+
essentialOf,
|
|
167
|
+
titleCase,
|
|
168
|
+
type OpinionDoc,
|
|
169
|
+
} from "../../utils/italyApprovals";
|
|
170
|
+
|
|
171
|
+
const props = withDefaults(
|
|
172
|
+
defineProps<{
|
|
173
|
+
/** La marque, telle que l'URL la porte (casse indifferente). */
|
|
174
|
+
brand: string;
|
|
175
|
+
/** Onglet ouvert : 1 actes, 2 prix. */
|
|
176
|
+
tab?: number;
|
|
177
|
+
lang?: "fr" | "en";
|
|
178
|
+
/** Fleche de retour du bandeau (page d'Italy One). */
|
|
179
|
+
haveReturn?: boolean;
|
|
180
|
+
backTo?: string;
|
|
181
|
+
}>(),
|
|
182
|
+
{ tab: 1, lang: "fr", haveReturn: false, backTo: undefined },
|
|
183
|
+
);
|
|
184
|
+
|
|
185
|
+
const emit = defineEmits<{
|
|
186
|
+
"update:tab": [tab: number];
|
|
187
|
+
/** Les actes charges : la page en tire son export et ses alertes. */
|
|
188
|
+
loaded: [acts: OpinionDoc[]];
|
|
189
|
+
}>();
|
|
190
|
+
|
|
191
|
+
const HISTORY_SIZE = 500;
|
|
192
|
+
|
|
193
|
+
const en = computed(() => props.lang === "en");
|
|
194
|
+
const { source, verified } = useAifaSource(() => props.lang);
|
|
195
|
+
|
|
196
|
+
// l'onglet suit la prop (page, `?tab=`) ; dans le tiroir, il vit ici
|
|
197
|
+
const localTab = ref(props.tab);
|
|
198
|
+
watch(
|
|
199
|
+
() => props.tab,
|
|
200
|
+
(value) => (localTab.value = value),
|
|
201
|
+
);
|
|
202
|
+
const activeTab = computed(() => (localTab.value === 2 ? 2 : 1));
|
|
203
|
+
function selectTab(key: string | number) {
|
|
204
|
+
localTab.value = Number(key) || 1;
|
|
205
|
+
emit("update:tab", localTab.value);
|
|
206
|
+
}
|
|
207
|
+
const headerTabs = computed(() =>
|
|
208
|
+
(en.value ? ["AIFA acts", "Prices"] : ["Actes AIFA", "Prix"]).map((label, index) => ({
|
|
209
|
+
key: String(index + 1),
|
|
210
|
+
label,
|
|
211
|
+
active: activeTab.value === index + 1,
|
|
212
|
+
})),
|
|
213
|
+
);
|
|
214
|
+
|
|
215
|
+
const loading = ref(true);
|
|
216
|
+
const acts = ref<OpinionDoc[]>([]);
|
|
217
|
+
const historyCapped = ref(false);
|
|
218
|
+
|
|
219
|
+
// la casse canonique, telle que l'AIFA l'ecrit, une fois les actes charges
|
|
220
|
+
const title = computed(() => acts.value[0]?.brand || props.brand);
|
|
221
|
+
const latestAct = computed(() => acts.value[0] ?? null);
|
|
222
|
+
const firstActDate = computed(() => acts.value[acts.value.length - 1]?.decision_date ?? "");
|
|
223
|
+
// l'indication vient rarement avec le dernier acte : le plus recent qui en porte une
|
|
224
|
+
const indicationAct = computed(() => acts.value.find((x) => (x.indication_en || x.indication || "").trim()) ?? null);
|
|
225
|
+
const indicationText = computed(() => indicationAct.value?.indication_en || indicationAct.value?.indication || "");
|
|
226
|
+
// sans indication dans tout l'historique : le texte du dernier acte
|
|
227
|
+
const textAct = computed(() => indicationAct.value ?? latestAct.value);
|
|
228
|
+
const publishedText = computed(() => indicationText.value || essentialOf(latestAct.value));
|
|
229
|
+
|
|
230
|
+
const tableColumns = computed(() => [
|
|
231
|
+
{ key: "date", label: "Date", width: "11%" },
|
|
232
|
+
{ key: "document", label: "Document", width: "17%" },
|
|
233
|
+
{ key: "nature", label: en.value ? "Nature of request" : "Nature de la demande", width: "18%" },
|
|
234
|
+
{ key: "indication", label: "Indication", width: "27%" },
|
|
235
|
+
{ key: "text", label: en.value ? "Text" : "Texte", width: "27%" },
|
|
236
|
+
]);
|
|
237
|
+
|
|
238
|
+
const tableRows = computed(() =>
|
|
239
|
+
acts.value.map((row) => ({
|
|
240
|
+
id: row.opinion_id,
|
|
241
|
+
date: row.decision_date,
|
|
242
|
+
documentType: row.document_type,
|
|
243
|
+
code: row.has_code,
|
|
244
|
+
nature: row.nature_of_request_en,
|
|
245
|
+
indication: (row.indication_en || row.indication || "").trim(),
|
|
246
|
+
text: essentialOf(row).trim(),
|
|
247
|
+
act: row,
|
|
248
|
+
})),
|
|
249
|
+
);
|
|
250
|
+
|
|
251
|
+
// le tableau peint 20 actes par page et un extrait de chacun : l'export de la
|
|
252
|
+
// carte emporte tous les actes charges, textes complets
|
|
253
|
+
const historyPayload = () => ({
|
|
254
|
+
title: `${title.value}, ${en.value ? "regulatory history" : "historique réglementaire"}`,
|
|
255
|
+
sheets: [
|
|
256
|
+
{
|
|
257
|
+
name: en.value ? "Regulatory history" : "Historique réglementaire",
|
|
258
|
+
data: acts.value,
|
|
259
|
+
schema: actSheetSchema(!en.value),
|
|
260
|
+
},
|
|
261
|
+
],
|
|
262
|
+
});
|
|
263
|
+
|
|
264
|
+
async function load() {
|
|
265
|
+
loading.value = true;
|
|
266
|
+
acts.value = [];
|
|
267
|
+
const res = await oipEsSearch<any>("drugs", ITALY_INDEX.aifa, {
|
|
268
|
+
size: HISTORY_SIZE,
|
|
269
|
+
_source: OPINION_FIELDS,
|
|
270
|
+
query: { term: { "brand.keyword": { value: props.brand, case_insensitive: true } } },
|
|
271
|
+
sort: [{ decision_date: { order: "desc" } }],
|
|
272
|
+
track_total_hits: true,
|
|
273
|
+
}).catch(() => null);
|
|
274
|
+
acts.value = (res?.hits?.hits ?? []).map((hit: any) => hit._source as OpinionDoc);
|
|
275
|
+
historyCapped.value = (res?.hits?.total?.value ?? 0) > acts.value.length;
|
|
276
|
+
loading.value = false;
|
|
277
|
+
emit("loaded", acts.value);
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
watch(() => props.brand, load, { immediate: true });
|
|
281
|
+
</script>
|
|
282
|
+
|
|
283
|
+
<style scoped>
|
|
284
|
+
.oip-italy-brand__body {
|
|
285
|
+
display: flex;
|
|
286
|
+
flex-direction: column;
|
|
287
|
+
gap: var(--space-16);
|
|
288
|
+
padding: var(--space-16) var(--space-24) var(--space-32);
|
|
289
|
+
}
|
|
290
|
+
.oip-italy-brand__body--page {
|
|
291
|
+
padding: 0;
|
|
292
|
+
margin-top: var(--space-12);
|
|
293
|
+
}
|
|
294
|
+
.oip-italy-brand__title {
|
|
295
|
+
margin-right: var(--space-12);
|
|
296
|
+
}
|
|
297
|
+
.oip-italy-brand__stack {
|
|
298
|
+
display: flex;
|
|
299
|
+
flex-direction: column;
|
|
300
|
+
gap: var(--space-12);
|
|
301
|
+
}
|
|
302
|
+
.oip-italy-brand__stack--tight {
|
|
303
|
+
gap: var(--space-6);
|
|
304
|
+
}
|
|
305
|
+
.oip-italy-brand__row {
|
|
306
|
+
display: flex;
|
|
307
|
+
flex-wrap: wrap;
|
|
308
|
+
align-items: center;
|
|
309
|
+
gap: var(--space-8);
|
|
310
|
+
}
|
|
311
|
+
.oip-italy-brand__row--between {
|
|
312
|
+
justify-content: space-between;
|
|
313
|
+
gap: var(--space-16);
|
|
314
|
+
}
|
|
315
|
+
.oip-italy-brand__tags {
|
|
316
|
+
display: flex;
|
|
317
|
+
flex-wrap: wrap;
|
|
318
|
+
gap: var(--space-8);
|
|
319
|
+
}
|
|
320
|
+
.oip-italy-brand__meta {
|
|
321
|
+
margin: 0;
|
|
322
|
+
color: var(--text-secondary);
|
|
323
|
+
font-size: var(--font-12);
|
|
324
|
+
}
|
|
325
|
+
.oip-italy-brand__subtitle {
|
|
326
|
+
margin: 0;
|
|
327
|
+
color: var(--text-primary);
|
|
328
|
+
font-size: var(--font-16);
|
|
329
|
+
font-weight: var(--weight-bold);
|
|
330
|
+
}
|
|
331
|
+
.oip-italy-brand__text {
|
|
332
|
+
margin: 0;
|
|
333
|
+
color: var(--text-primary);
|
|
334
|
+
line-height: 1.7;
|
|
335
|
+
white-space: pre-wrap;
|
|
336
|
+
}
|
|
337
|
+
.oip-italy-brand__muted {
|
|
338
|
+
color: var(--text-muted);
|
|
339
|
+
}
|
|
340
|
+
.oip-italy-brand__nowrap {
|
|
341
|
+
white-space: nowrap;
|
|
342
|
+
}
|
|
343
|
+
.oip-italy-brand__link {
|
|
344
|
+
color: var(--color-primary);
|
|
345
|
+
font-size: var(--font-12);
|
|
346
|
+
font-weight: var(--weight-semibold);
|
|
347
|
+
text-decoration: none;
|
|
348
|
+
white-space: nowrap;
|
|
349
|
+
}
|
|
350
|
+
.oip-italy-brand__link:hover {
|
|
351
|
+
text-decoration: underline;
|
|
352
|
+
}
|
|
353
|
+
.oip-italy-brand__clamp {
|
|
354
|
+
display: -webkit-box;
|
|
355
|
+
overflow: hidden;
|
|
356
|
+
-webkit-box-orient: vertical;
|
|
357
|
+
-webkit-line-clamp: 2;
|
|
358
|
+
}
|
|
359
|
+
.oip-italy-brand__clamp--one {
|
|
360
|
+
-webkit-line-clamp: 1;
|
|
361
|
+
}
|
|
362
|
+
.oip-italy-brand__more {
|
|
363
|
+
display: flex;
|
|
364
|
+
flex-direction: column;
|
|
365
|
+
gap: var(--space-8);
|
|
366
|
+
width: 100%;
|
|
367
|
+
padding: var(--space-8) var(--space-4) var(--space-12);
|
|
368
|
+
}
|
|
369
|
+
</style>
|