@tekkare/romulus 0.1.279 → 0.1.281
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-italy/AifaAct.vue +57 -0
- package/layer/app/components/oip-italy/AifaBrandFiche.vue +369 -0
- package/layer/app/components/oip-italy/BrandPrices.vue +247 -0
- package/layer/app/components/oip-italy/ItalyPrice.vue +232 -0
- package/layer/app/composables/useOipResourceViews.ts +2 -0
- package/layer/app/oip-italy/kinds.ts +11 -5
- package/layer/app/oip-italy/useAifaSource.ts +47 -0
- package/layer/app/utils/italyApprovals.ts +92 -0
- package/layer/app/utils/oipResources.ts +12 -4
- package/package.json +1 -1
package/dist/module.json
CHANGED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
<!--
|
|
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
|
+
|
|
7
|
+
Montee par le tiroir des projets ; le lien vers l'app passe par le slot
|
|
8
|
+
`title-link`.
|
|
9
|
+
-->
|
|
10
|
+
<template>
|
|
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>
|
|
27
|
+
</div>
|
|
28
|
+
</template>
|
|
29
|
+
|
|
30
|
+
<script setup lang="ts">
|
|
31
|
+
import { oipEsGet } from "../../composables/useOipResources";
|
|
32
|
+
import { ITALY_INDEX } from "../../oip-italy/kinds";
|
|
33
|
+
|
|
34
|
+
const props = withDefaults(
|
|
35
|
+
defineProps<{
|
|
36
|
+
/** Le `resourceId` : `_id` de l'acte (opinion_id). */
|
|
37
|
+
id: string;
|
|
38
|
+
type?: string;
|
|
39
|
+
lang?: "fr" | "en";
|
|
40
|
+
highlight?: string[];
|
|
41
|
+
}>(),
|
|
42
|
+
{ type: "ItApproval", lang: "fr", highlight: () => [] },
|
|
43
|
+
);
|
|
44
|
+
|
|
45
|
+
const en = computed(() => props.lang === "en");
|
|
46
|
+
const pending = ref(true);
|
|
47
|
+
const brand = ref("");
|
|
48
|
+
|
|
49
|
+
async function read() {
|
|
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;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
watch(() => props.id, read, { immediate: true });
|
|
57
|
+
</script>
|
|
@@ -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>
|
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
Onglet Prix de la fiche marque AIFA (portage de components/approvals/
|
|
3
|
+
BrandPrices d'Italy One) : les presentations de la marque dans le Price
|
|
4
|
+
Tracker italien, leur dernier prix, puis la trajectoire des prix (dernier
|
|
5
|
+
prix connu de chaque annee).
|
|
6
|
+
|
|
7
|
+
Les liens passent par la navigation des ressources : sur place dans Italy
|
|
8
|
+
One, dans un onglet depuis une autre app.
|
|
9
|
+
-->
|
|
10
|
+
<template>
|
|
11
|
+
<div class="oip-italy-prices">
|
|
12
|
+
<RmLoadingState v-if="loading" :lines="3" :chart-height="240" />
|
|
13
|
+
|
|
14
|
+
<RmEmptyState
|
|
15
|
+
v-else-if="!skus.length"
|
|
16
|
+
:title="en ? 'No Italian price for this brand.' : 'Aucun prix italien pour cette marque.'"
|
|
17
|
+
:text="
|
|
18
|
+
en
|
|
19
|
+
? 'A hospital product with no listed price, withdrawn, or marketed under another name.'
|
|
20
|
+
: 'Produit hospitalier non tarifé, retiré du marché, ou commercialisé sous un autre nom.'
|
|
21
|
+
"
|
|
22
|
+
/>
|
|
23
|
+
|
|
24
|
+
<template v-else>
|
|
25
|
+
<div class="oip-italy-prices__head">
|
|
26
|
+
<p class="oip-italy-prices__meta">
|
|
27
|
+
<b>{{ skus.length }}</b>
|
|
28
|
+
{{ en ? (skus.length === 1 ? "presentation" : "presentations") : skus.length === 1 ? "présentation" : "présentations" }}
|
|
29
|
+
</p>
|
|
30
|
+
<a class="oip-italy-prices__link" :href="nav.appHref('italy_one_app', '/price-tracker/')" @click.prevent="nav.openApp('italy_one_app', '/price-tracker/')">
|
|
31
|
+
{{ en ? "Open the Price Tracker" : "Ouvrir le Price Tracker" }}
|
|
32
|
+
</a>
|
|
33
|
+
</div>
|
|
34
|
+
|
|
35
|
+
<RmTableCard :lang="lang" :source="source" :verified="verified" :payload="pricesPayload">
|
|
36
|
+
<template #header>
|
|
37
|
+
<h3 class="rm-table-card__title">{{ en ? "Prices in Italy" : "Prix en Italie" }}</h3>
|
|
38
|
+
</template>
|
|
39
|
+
<RmTable flat :columns="tableColumns" :rows="skus" :page-size="20" :empty-text="en ? 'No data' : 'Aucune donnée'">
|
|
40
|
+
<template #category="{ value }">
|
|
41
|
+
<RmTag v-if="value" variant="gray">{{ value }}</RmTag>
|
|
42
|
+
<span v-else class="oip-italy-prices__muted">-</span>
|
|
43
|
+
</template>
|
|
44
|
+
<template #atc="{ value }">
|
|
45
|
+
<p class="oip-italy-prices__nowrap">{{ value || "-" }}</p>
|
|
46
|
+
</template>
|
|
47
|
+
<template #price="{ value }">
|
|
48
|
+
<p v-if="value !== null" class="oip-italy-prices__nowrap">{{ euro(value) }}</p>
|
|
49
|
+
<p v-else class="oip-italy-prices__muted">-</p>
|
|
50
|
+
</template>
|
|
51
|
+
<template #priceDate="{ value }">
|
|
52
|
+
<p class="oip-italy-prices__nowrap">
|
|
53
|
+
<RmDate v-if="value" :date="value" :lang="lang" compact />
|
|
54
|
+
<span v-else class="oip-italy-prices__muted">-</span>
|
|
55
|
+
</p>
|
|
56
|
+
</template>
|
|
57
|
+
<template #id="{ value }">
|
|
58
|
+
<a
|
|
59
|
+
v-if="value"
|
|
60
|
+
class="oip-italy-prices__link"
|
|
61
|
+
:href="nav.appHref('italy_one_app', detailPath(value))"
|
|
62
|
+
@click.prevent="nav.openApp('italy_one_app', detailPath(value))"
|
|
63
|
+
>
|
|
64
|
+
{{ en ? "Details" : "Détail" }}
|
|
65
|
+
</a>
|
|
66
|
+
</template>
|
|
67
|
+
</RmTable>
|
|
68
|
+
</RmTableCard>
|
|
69
|
+
|
|
70
|
+
<!-- un point par an et par presentation : l'historique est un releve par
|
|
71
|
+
revision, le dernier prix connu de chaque annee suffit a lire la
|
|
72
|
+
trajectoire -->
|
|
73
|
+
<RmChartCard
|
|
74
|
+
v-if="chart.series.length"
|
|
75
|
+
:title="en ? 'Price trajectory (€, last known price per year)' : 'Évolution du prix (€, dernier prix connu par an)'"
|
|
76
|
+
:source="source"
|
|
77
|
+
:verified="verified"
|
|
78
|
+
:lang="lang"
|
|
79
|
+
>
|
|
80
|
+
<RmLineChart :categories="chart.categories" :series="chart.series" :value-formatter="euro" :height="320" />
|
|
81
|
+
</RmChartCard>
|
|
82
|
+
</template>
|
|
83
|
+
</div>
|
|
84
|
+
</template>
|
|
85
|
+
|
|
86
|
+
<script setup lang="ts">
|
|
87
|
+
import { oipEsSearch } from "../../composables/useOipResources";
|
|
88
|
+
import { useOipResourceNav } from "../../composables/useOipResourceNav";
|
|
89
|
+
import { ITALY_INDEX } from "../../oip-italy/kinds";
|
|
90
|
+
import { useAifaSource } from "../../oip-italy/useAifaSource";
|
|
91
|
+
|
|
92
|
+
const props = withDefaults(defineProps<{ brand: string; lang?: "fr" | "en" }>(), { lang: "fr" });
|
|
93
|
+
|
|
94
|
+
const en = computed(() => props.lang === "en");
|
|
95
|
+
const nav = useOipResourceNav();
|
|
96
|
+
const { source, verified } = useAifaSource(() => props.lang);
|
|
97
|
+
|
|
98
|
+
type Sku = {
|
|
99
|
+
id: string;
|
|
100
|
+
label: string;
|
|
101
|
+
category: string;
|
|
102
|
+
atc: string;
|
|
103
|
+
price: number | null;
|
|
104
|
+
priceDate: string;
|
|
105
|
+
history: { date: string; price: number }[];
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
const loading = ref(true);
|
|
109
|
+
const skus = ref<Sku[]>([]);
|
|
110
|
+
|
|
111
|
+
const detailPath = (id: string) => `/price-tracker/details/${encodeURIComponent(id)}/`;
|
|
112
|
+
|
|
113
|
+
const euro = (value: unknown) => {
|
|
114
|
+
const n = Number(value);
|
|
115
|
+
return Number.isFinite(n)
|
|
116
|
+
? `${n.toLocaleString(en.value ? "en-GB" : "fr-FR", { minimumFractionDigits: 2, maximumFractionDigits: 2 })} €`
|
|
117
|
+
: "-";
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
const tableColumns = computed(() => [
|
|
121
|
+
{ key: "label", label: en.value ? "Presentation" : "Présentation", width: "44%" },
|
|
122
|
+
{ key: "category", label: en.value ? "Category" : "Catégorie", width: "12%" },
|
|
123
|
+
{ key: "atc", label: "ATC", width: "11%" },
|
|
124
|
+
{ key: "price", label: en.value ? "Price" : "Prix", width: "11%", align: "right" as const },
|
|
125
|
+
{ key: "priceDate", label: en.value ? "Last revision" : "Dernière révision", width: "11%" },
|
|
126
|
+
{ key: "id", label: "", width: "11%", align: "right" as const },
|
|
127
|
+
]);
|
|
128
|
+
|
|
129
|
+
// la carte montre 20 presentations et leur dernier prix : l'export emporte
|
|
130
|
+
// toutes les presentations et toutes les revisions, en nombres bruts
|
|
131
|
+
const pricesPayload = () => ({
|
|
132
|
+
title: `${props.brand}, ${en.value ? "prices in Italy" : "prix en Italie"}`,
|
|
133
|
+
sheets: [
|
|
134
|
+
{
|
|
135
|
+
name: en.value ? "Prices" : "Prix",
|
|
136
|
+
data: skus.value.flatMap((sku) =>
|
|
137
|
+
(sku.history.length ? sku.history : [{ date: "", price: null }]).map((point) => ({ ...sku, point })),
|
|
138
|
+
),
|
|
139
|
+
schema: [
|
|
140
|
+
{ column: en.value ? "Presentation" : "Présentation", type: String, width: 50, value: (x: any) => x.label },
|
|
141
|
+
{ column: en.value ? "ID" : "Identifiant", type: String, value: (x: any) => x.id },
|
|
142
|
+
{ column: en.value ? "Category" : "Catégorie", type: String, value: (x: any) => x.category },
|
|
143
|
+
{ column: "ATC", type: String, value: (x: any) => x.atc },
|
|
144
|
+
{ column: en.value ? "Application date" : "Date d'application", type: String, value: (x: any) => x.point.date },
|
|
145
|
+
{ column: en.value ? "Price (€)" : "Prix (€)", type: Number, value: (x: any) => x.point.price },
|
|
146
|
+
],
|
|
147
|
+
},
|
|
148
|
+
],
|
|
149
|
+
});
|
|
150
|
+
|
|
151
|
+
// dernier prix connu de chaque annee, une serie par presentation
|
|
152
|
+
const chart = computed(() => {
|
|
153
|
+
const years = new Set<string>();
|
|
154
|
+
const perSku = skus.value.map((sku) => {
|
|
155
|
+
const lastOfYear = new Map<string, { date: string; price: number }>();
|
|
156
|
+
sku.history.forEach((point) => {
|
|
157
|
+
const year = point.date.slice(0, 4);
|
|
158
|
+
const kept = lastOfYear.get(year);
|
|
159
|
+
if (!kept || point.date > kept.date) lastOfYear.set(year, point);
|
|
160
|
+
});
|
|
161
|
+
lastOfYear.forEach((_point, year) => years.add(year));
|
|
162
|
+
return { name: sku.label, lastOfYear };
|
|
163
|
+
});
|
|
164
|
+
const categories = [...years].sort();
|
|
165
|
+
return {
|
|
166
|
+
categories,
|
|
167
|
+
series: perSku
|
|
168
|
+
.filter((sku) => sku.lastOfYear.size)
|
|
169
|
+
.map((sku) => ({ name: sku.name, data: categories.map((year) => sku.lastOfYear.get(year)?.price ?? null) })),
|
|
170
|
+
};
|
|
171
|
+
});
|
|
172
|
+
|
|
173
|
+
async function load() {
|
|
174
|
+
loading.value = true;
|
|
175
|
+
skus.value = [];
|
|
176
|
+
// les marques sont en capitales dans les deux index, mais une URL tapee a la
|
|
177
|
+
// main ou un changement de casse doit encore trouver la marque
|
|
178
|
+
const res = await oipEsSearch<any>("drugs", ITALY_INDEX.prices, {
|
|
179
|
+
size: 200,
|
|
180
|
+
_source: ["local_drug_id", "label_local", "price_category", "atc_who", "atc_local", "price_history"],
|
|
181
|
+
query: {
|
|
182
|
+
bool: {
|
|
183
|
+
must: [
|
|
184
|
+
{ term: { "country_code.keyword": "it" } },
|
|
185
|
+
{ term: { "brand.keyword": { value: props.brand, case_insensitive: true } } },
|
|
186
|
+
],
|
|
187
|
+
},
|
|
188
|
+
},
|
|
189
|
+
}).catch(() => null);
|
|
190
|
+
skus.value = (res?.hits?.hits ?? []).map((hit: any) => {
|
|
191
|
+
const row = hit._source;
|
|
192
|
+
const history = (row.price_history || [])
|
|
193
|
+
.map((point: any) => ({ date: point.application_date as string, price: Number(point.new_price) }))
|
|
194
|
+
.filter((point: any) => point.date && Number.isFinite(point.price))
|
|
195
|
+
.sort((a: any, b: any) => b.date.localeCompare(a.date));
|
|
196
|
+
return {
|
|
197
|
+
id: row.local_drug_id ?? "",
|
|
198
|
+
label: row.label_local ?? "",
|
|
199
|
+
category: row.price_category ?? "",
|
|
200
|
+
atc: row.atc_who || row.atc_local || "",
|
|
201
|
+
price: history[0]?.price ?? null,
|
|
202
|
+
priceDate: history[0]?.date ?? "",
|
|
203
|
+
history,
|
|
204
|
+
};
|
|
205
|
+
});
|
|
206
|
+
loading.value = false;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
watch(() => props.brand, load, { immediate: true });
|
|
210
|
+
</script>
|
|
211
|
+
|
|
212
|
+
<style scoped>
|
|
213
|
+
.oip-italy-prices {
|
|
214
|
+
display: flex;
|
|
215
|
+
flex-direction: column;
|
|
216
|
+
gap: var(--space-16);
|
|
217
|
+
width: 100%;
|
|
218
|
+
}
|
|
219
|
+
.oip-italy-prices__head {
|
|
220
|
+
display: flex;
|
|
221
|
+
flex-wrap: wrap;
|
|
222
|
+
align-items: center;
|
|
223
|
+
justify-content: space-between;
|
|
224
|
+
gap: var(--space-16);
|
|
225
|
+
}
|
|
226
|
+
.oip-italy-prices__meta {
|
|
227
|
+
margin: 0;
|
|
228
|
+
color: var(--text-secondary);
|
|
229
|
+
font-size: var(--font-12);
|
|
230
|
+
}
|
|
231
|
+
.oip-italy-prices__nowrap {
|
|
232
|
+
white-space: nowrap;
|
|
233
|
+
}
|
|
234
|
+
.oip-italy-prices__muted {
|
|
235
|
+
color: var(--text-muted);
|
|
236
|
+
}
|
|
237
|
+
.oip-italy-prices__link {
|
|
238
|
+
color: var(--color-primary);
|
|
239
|
+
font-size: var(--font-12);
|
|
240
|
+
font-weight: var(--weight-semibold);
|
|
241
|
+
text-decoration: none;
|
|
242
|
+
white-space: nowrap;
|
|
243
|
+
}
|
|
244
|
+
.oip-italy-prices__link:hover {
|
|
245
|
+
text-decoration: underline;
|
|
246
|
+
}
|
|
247
|
+
</style>
|
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
Fiche d'une presentation du Price Tracker italien (Italy One, type
|
|
3
|
+
ItDrugPrice), par son `_id` (it_<AIC>_<n>) : identite, prix en vigueur par
|
|
4
|
+
type, puis l'historique des prix.
|
|
5
|
+
|
|
6
|
+
Montee par le tiroir des projets ; le lien vers l'app passe par le slot
|
|
7
|
+
`title-link`.
|
|
8
|
+
-->
|
|
9
|
+
<template>
|
|
10
|
+
<div class="oip-italy">
|
|
11
|
+
<RmPageHeader :eyebrow="en ? 'Price, Italy' : 'Prix, Italie'">
|
|
12
|
+
<template #title>
|
|
13
|
+
<span class="oip-italy__title">{{ doc?.label_local || id }}</span>
|
|
14
|
+
<slot name="title-link" />
|
|
15
|
+
</template>
|
|
16
|
+
</RmPageHeader>
|
|
17
|
+
|
|
18
|
+
<div class="oip-italy__body">
|
|
19
|
+
<RmLoadingState v-if="loading" spinner />
|
|
20
|
+
<RmEmptyState v-else-if="!doc" icon="Prohibit" :title="en ? 'Price not found' : 'Prix introuvable'" />
|
|
21
|
+
<template v-else>
|
|
22
|
+
<div class="oip-italy__tags">
|
|
23
|
+
<RmTag v-if="doc.brand" variant="indigo">{{ doc.brand }}</RmTag>
|
|
24
|
+
<RmTag v-if="doc.price_category" :variant="String(doc.price_category).includes('Hospital') ? 'blue' : 'orange'">
|
|
25
|
+
{{ doc.price_category }}
|
|
26
|
+
</RmTag>
|
|
27
|
+
<RmTag v-if="doc.local_drug_id" variant="gray">AIC {{ doc.local_drug_id }}</RmTag>
|
|
28
|
+
</div>
|
|
29
|
+
|
|
30
|
+
<RmCard padding="md">
|
|
31
|
+
<h3 class="oip-italy__card-title">{{ en ? "Current prices" : "Prix en vigueur" }}</h3>
|
|
32
|
+
<div v-if="current.length" class="oip-italy__prices">
|
|
33
|
+
<div v-for="price in current" :key="price.type" class="oip-italy__price">
|
|
34
|
+
<span class="oip-italy__price-type">{{ price.type }}</span>
|
|
35
|
+
<span class="oip-italy__price-value">{{ price.value }}</span>
|
|
36
|
+
<span class="oip-italy__price-date">{{ en ? "since" : "depuis le" }} {{ price.date }}</span>
|
|
37
|
+
</div>
|
|
38
|
+
</div>
|
|
39
|
+
<p v-else class="oip-italy__note">{{ en ? "No price recorded." : "Aucun prix enregistré." }}</p>
|
|
40
|
+
<dl class="oip-italy__rows oip-italy__rows--spaced">
|
|
41
|
+
<template v-for="row in rows" :key="row.label">
|
|
42
|
+
<dt>{{ row.label }}</dt>
|
|
43
|
+
<dd>{{ row.value }}</dd>
|
|
44
|
+
</template>
|
|
45
|
+
</dl>
|
|
46
|
+
</RmCard>
|
|
47
|
+
|
|
48
|
+
<RmCard v-if="history.length" padding="md">
|
|
49
|
+
<h3 class="oip-italy__card-title">{{ en ? "Price history" : "Historique des prix" }} ({{ history.length }})</h3>
|
|
50
|
+
<RmTable
|
|
51
|
+
:columns="historyColumns"
|
|
52
|
+
:rows="history"
|
|
53
|
+
compact
|
|
54
|
+
flat
|
|
55
|
+
:page-size="20"
|
|
56
|
+
max-height="none"
|
|
57
|
+
:empty-text="en ? 'No data' : 'Aucune donnée'"
|
|
58
|
+
/>
|
|
59
|
+
</RmCard>
|
|
60
|
+
</template>
|
|
61
|
+
</div>
|
|
62
|
+
</div>
|
|
63
|
+
</template>
|
|
64
|
+
|
|
65
|
+
<script setup lang="ts">
|
|
66
|
+
import { oipEsGet } from "../../composables/useOipResources";
|
|
67
|
+
import { ITALY_INDEX } from "../../oip-italy/kinds";
|
|
68
|
+
|
|
69
|
+
const props = withDefaults(
|
|
70
|
+
defineProps<{
|
|
71
|
+
/** Le `resourceId` : `_id` de la presentation (it_<AIC>_<n>). */
|
|
72
|
+
id: string;
|
|
73
|
+
type?: string;
|
|
74
|
+
lang?: "fr" | "en";
|
|
75
|
+
highlight?: string[];
|
|
76
|
+
}>(),
|
|
77
|
+
{ type: "ItDrugPrice", lang: "fr", highlight: () => [] },
|
|
78
|
+
);
|
|
79
|
+
|
|
80
|
+
const en = computed(() => props.lang === "en");
|
|
81
|
+
const loading = ref(true);
|
|
82
|
+
const doc = ref<Record<string, any> | null>(null);
|
|
83
|
+
|
|
84
|
+
/** Les types de prix du Price Tracker, dans l'ordre d'Italy One. */
|
|
85
|
+
const PRICE_TYPES: Record<number, { fr: string; en: string }> = {
|
|
86
|
+
1: { fr: "Prix ex-usine", en: "Ex-factory" },
|
|
87
|
+
2: { fr: "Prix grossiste", en: "Wholesale" },
|
|
88
|
+
11: { fr: "Prix public", en: "Public price" },
|
|
89
|
+
12: { fr: "Remboursement", en: "Reimbursement" },
|
|
90
|
+
13: { fr: "Prix gouvernement", en: "Government" },
|
|
91
|
+
14: { fr: "Prix patient", en: "Patient price" },
|
|
92
|
+
};
|
|
93
|
+
const typeName = (id: number) => {
|
|
94
|
+
const type = PRICE_TYPES[id];
|
|
95
|
+
return type ? (en.value ? type.en : type.fr) : String(id);
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
const date = (value: unknown) => {
|
|
99
|
+
const parsed = new Date(String(value ?? ""));
|
|
100
|
+
return Number.isNaN(parsed.getTime())
|
|
101
|
+
? "-"
|
|
102
|
+
: parsed.toLocaleDateString(en.value ? "en-GB" : "fr-FR", { day: "numeric", month: "short", year: "numeric" });
|
|
103
|
+
};
|
|
104
|
+
const euro = (value: unknown) => {
|
|
105
|
+
const n = Number(value);
|
|
106
|
+
return Number.isFinite(n)
|
|
107
|
+
? `${n.toLocaleString(en.value ? "en-GB" : "fr-FR", { minimumFractionDigits: 2, maximumFractionDigits: 2 })} €`
|
|
108
|
+
: "-";
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
/** L'historique du plus recent au plus ancien (l'index ne le garantit pas pour un meme jour). */
|
|
112
|
+
const entries = computed(() =>
|
|
113
|
+
[...(doc.value?.price_history ?? [])].sort(
|
|
114
|
+
(a: any, b: any) => new Date(b.application_date ?? 0).getTime() - new Date(a.application_date ?? 0).getTime(),
|
|
115
|
+
),
|
|
116
|
+
);
|
|
117
|
+
|
|
118
|
+
const current = computed(() => {
|
|
119
|
+
const seen = new Set<number>();
|
|
120
|
+
const out: { type: string; value: string; date: string }[] = [];
|
|
121
|
+
for (const entry of entries.value) {
|
|
122
|
+
const id = Number(entry.price_type_id);
|
|
123
|
+
if (seen.has(id) || !Number.isFinite(Number(entry.new_price))) continue;
|
|
124
|
+
seen.add(id);
|
|
125
|
+
out.push({ type: typeName(id), value: euro(entry.new_price), date: date(entry.application_date) });
|
|
126
|
+
}
|
|
127
|
+
return out;
|
|
128
|
+
});
|
|
129
|
+
|
|
130
|
+
const historyColumns = computed(() => [
|
|
131
|
+
{ key: "date", label: en.value ? "Application date" : "Date d'application" },
|
|
132
|
+
{ key: "type", label: en.value ? "Price type" : "Type de prix" },
|
|
133
|
+
{ key: "price", label: en.value ? "Price" : "Prix", numeric: true },
|
|
134
|
+
{ key: "before", label: en.value ? "Previous price" : "Prix précédent", numeric: true },
|
|
135
|
+
]);
|
|
136
|
+
|
|
137
|
+
const history = computed(() =>
|
|
138
|
+
entries.value.map((entry: any) => ({
|
|
139
|
+
date: date(entry.application_date),
|
|
140
|
+
type: typeName(Number(entry.price_type_id)),
|
|
141
|
+
price: euro(entry.new_price),
|
|
142
|
+
before: entry.last_price != null && Number(entry.last_price) !== Number(entry.new_price) ? euro(entry.last_price) : "-",
|
|
143
|
+
})),
|
|
144
|
+
);
|
|
145
|
+
|
|
146
|
+
const rows = computed(() => {
|
|
147
|
+
const d = doc.value ?? {};
|
|
148
|
+
return [
|
|
149
|
+
{ label: en.value ? "Molecule" : "Molécule", value: d.molecule_local || d.molecule_en },
|
|
150
|
+
{ label: en.value ? "Company" : "Laboratoire", value: d.manufacturer_regroup || d.manufacturer },
|
|
151
|
+
{ label: "ATC4", value: d.atc4 },
|
|
152
|
+
{ label: en.value ? "Unit" : "Unité", value: d.unit },
|
|
153
|
+
].filter((row) => row.value);
|
|
154
|
+
});
|
|
155
|
+
|
|
156
|
+
async function read() {
|
|
157
|
+
loading.value = true;
|
|
158
|
+
const hit = await oipEsGet<any>("drugs", ITALY_INDEX.prices, props.id).catch(() => null);
|
|
159
|
+
doc.value = hit?._source ?? null;
|
|
160
|
+
loading.value = false;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
watch(() => props.id, read, { immediate: true });
|
|
164
|
+
</script>
|
|
165
|
+
|
|
166
|
+
<style scoped>
|
|
167
|
+
.oip-italy__body {
|
|
168
|
+
display: flex;
|
|
169
|
+
flex-direction: column;
|
|
170
|
+
gap: var(--space-16);
|
|
171
|
+
padding: var(--space-20) var(--space-32) var(--space-32);
|
|
172
|
+
}
|
|
173
|
+
.oip-italy__title {
|
|
174
|
+
margin-right: var(--space-12);
|
|
175
|
+
}
|
|
176
|
+
.oip-italy__tags {
|
|
177
|
+
display: flex;
|
|
178
|
+
flex-wrap: wrap;
|
|
179
|
+
gap: var(--space-6);
|
|
180
|
+
}
|
|
181
|
+
.oip-italy__card-title {
|
|
182
|
+
margin: 0 0 var(--space-12);
|
|
183
|
+
font-size: var(--font-16);
|
|
184
|
+
font-weight: var(--weight-bold);
|
|
185
|
+
}
|
|
186
|
+
.oip-italy__prices {
|
|
187
|
+
display: flex;
|
|
188
|
+
flex-wrap: wrap;
|
|
189
|
+
gap: var(--space-12) var(--space-32);
|
|
190
|
+
}
|
|
191
|
+
.oip-italy__price {
|
|
192
|
+
display: flex;
|
|
193
|
+
flex-direction: column;
|
|
194
|
+
gap: 2px;
|
|
195
|
+
}
|
|
196
|
+
.oip-italy__price-type,
|
|
197
|
+
.oip-italy__price-date {
|
|
198
|
+
color: var(--text-muted);
|
|
199
|
+
font-size: var(--font-12);
|
|
200
|
+
}
|
|
201
|
+
.oip-italy__price-value {
|
|
202
|
+
font-size: var(--font-22);
|
|
203
|
+
font-weight: var(--weight-bold);
|
|
204
|
+
font-variant-numeric: tabular-nums;
|
|
205
|
+
}
|
|
206
|
+
.oip-italy__rows {
|
|
207
|
+
display: grid;
|
|
208
|
+
grid-template-columns: minmax(140px, max-content) 1fr;
|
|
209
|
+
gap: var(--space-8) var(--space-20);
|
|
210
|
+
margin: 0;
|
|
211
|
+
font-size: var(--font-14);
|
|
212
|
+
}
|
|
213
|
+
.oip-italy__rows--spaced {
|
|
214
|
+
margin-top: var(--space-20);
|
|
215
|
+
}
|
|
216
|
+
.oip-italy__rows dt {
|
|
217
|
+
padding-top: 2px;
|
|
218
|
+
color: var(--text-muted);
|
|
219
|
+
font-size: var(--font-12);
|
|
220
|
+
font-weight: var(--weight-semibold);
|
|
221
|
+
text-transform: uppercase;
|
|
222
|
+
}
|
|
223
|
+
.oip-italy__rows dd {
|
|
224
|
+
margin: 0;
|
|
225
|
+
line-height: 1.5;
|
|
226
|
+
}
|
|
227
|
+
.oip-italy__note {
|
|
228
|
+
margin: 0;
|
|
229
|
+
color: var(--text-muted);
|
|
230
|
+
font-size: var(--font-13);
|
|
231
|
+
}
|
|
232
|
+
</style>
|
|
@@ -103,6 +103,8 @@ const VIEW_LOADERS: Record<string, () => Promise<any>> = {
|
|
|
103
103
|
"patients-vaccine": () => import("../components/oip-patients/VaccineFiche.vue"),
|
|
104
104
|
"germany-gba": () => import("../components/oip-germany/GbaAssessment.vue"),
|
|
105
105
|
"germany-molecule": () => import("../components/oip-germany/GkvMolecule.vue"),
|
|
106
|
+
"italy-aifa-act": () => import("../components/oip-italy/AifaAct.vue"),
|
|
107
|
+
"italy-price": () => import("../components/oip-italy/ItalyPrice.vue"),
|
|
106
108
|
};
|
|
107
109
|
|
|
108
110
|
const cache = new Map<string, Component>();
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Les familles qu'Italy One range dans un projet, decrites pour tout le
|
|
3
3
|
* portail : actes reglementaires de l'AIFA (Trovanorme) et prix des
|
|
4
|
-
* presentations italiennes (Price Tracker).
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
* presentations italiennes (Price Tracker). Le tiroir d'un projet les montre
|
|
5
|
+
* par leurs vues (components/oip-italy) ; la ligne du projet mene a la page
|
|
6
|
+
* de l'app.
|
|
7
7
|
*
|
|
8
8
|
* Index lus sur le cluster `drugs` (meme domaine que fr_drugs_app ; chaque app
|
|
9
9
|
* y joint sa propre cle, cf. runtimeConfig.oipEs.drugs).
|
|
@@ -15,6 +15,12 @@ import type { RmProjectKind } from "@tekkare/romulus/utils/projects";
|
|
|
15
15
|
|
|
16
16
|
const ITALY = { fr: "Italie", en: "Italy" };
|
|
17
17
|
|
|
18
|
+
/** Les index des fiches d'Italy One, relus aussi par leurs vues de tiroir. */
|
|
19
|
+
export const ITALY_INDEX = {
|
|
20
|
+
aifa: "it__drug_opinion__aifa",
|
|
21
|
+
prices: "ope__ww_price_tracker__tekkare",
|
|
22
|
+
};
|
|
23
|
+
|
|
18
24
|
const day = (value: unknown) => String(value ?? "").slice(0, 10);
|
|
19
25
|
|
|
20
26
|
export const ITALY_PROJECT_KINDS: RmProjectKind[] = [
|
|
@@ -22,7 +28,7 @@ export const ITALY_PROJECT_KINDS: RmProjectKind[] = [
|
|
|
22
28
|
// Un acte de l'AIFA (`_id` = opinion_id, ex. TNF_<uuid>). Une carte marque
|
|
23
29
|
// range son dernier acte ; la page de la marque les montre tous.
|
|
24
30
|
type: "ItApproval",
|
|
25
|
-
index:
|
|
31
|
+
index: ITALY_INDEX.aifa,
|
|
26
32
|
label: { fr: "Actes de l'AIFA", en: "AIFA acts" },
|
|
27
33
|
section: ITALY,
|
|
28
34
|
country: "it",
|
|
@@ -39,7 +45,7 @@ export const ITALY_PROJECT_KINDS: RmProjectKind[] = [
|
|
|
39
45
|
// Une presentation du Price Tracker (`_id` = it_<AIC>_1). Une carte marque
|
|
40
46
|
// range ses presentations.
|
|
41
47
|
type: "ItDrugPrice",
|
|
42
|
-
index:
|
|
48
|
+
index: ITALY_INDEX.prices,
|
|
43
49
|
label: { fr: "Prix (Italie)", en: "Prices (Italy)" },
|
|
44
50
|
section: ITALY,
|
|
45
51
|
country: "it",
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Source et date de verification des cartes d'Italy One (AIFA), lues dans
|
|
3
|
+
* Directus par /api/oip/sources : meme libelle « Producteur (jeu) » que les
|
|
4
|
+
* pieds de carte de l'app (useCardSource), pour les fiches que le layer monte
|
|
5
|
+
* dans une page comme dans le tiroir d'un projet.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
/** Le jeu Directus des listes et prix de l'AIFA (cf. useDirectusSources d'Italy One). */
|
|
9
|
+
export const AIFA_SOURCE_UUID = "a91e97d1-b6b2-4f65-98b4-0914d14c4ac0";
|
|
10
|
+
|
|
11
|
+
function pickTranslation(rows: any[] | null | undefined, field: string, lang: string): string {
|
|
12
|
+
const list = rows ?? [];
|
|
13
|
+
const wanted = lang === "fr" ? "fr-FR" : "en-US";
|
|
14
|
+
const hit = list.find((t) => t?.languages_code === wanted) ?? list.find((t) => t?.languages_code === "en-US") ?? list[0];
|
|
15
|
+
const value = hit?.[field];
|
|
16
|
+
return typeof value === "string" ? value.trim() : "";
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function buildName(source: any, lang: string): string {
|
|
20
|
+
const dataset = pickTranslation(source?.translations, "source_name", lang) || String(source?.Nickname ?? "").trim();
|
|
21
|
+
const provider = pickTranslation(source?.provider?.translations, "provider_name", lang);
|
|
22
|
+
if (!provider) return dataset;
|
|
23
|
+
if (!dataset) return provider;
|
|
24
|
+
if (dataset.includes("(")) return `${provider}, ${dataset}`;
|
|
25
|
+
return `${provider} (${dataset})`;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export function useAifaSource(lang: () => "fr" | "en") {
|
|
29
|
+
const record = ref<any>(null);
|
|
30
|
+
|
|
31
|
+
onMounted(async () => {
|
|
32
|
+
try {
|
|
33
|
+
const response = await $fetch<{ sources: any[] }>("/api/oip/sources", {
|
|
34
|
+
method: "POST",
|
|
35
|
+
body: { uuids: [AIFA_SOURCE_UUID] },
|
|
36
|
+
});
|
|
37
|
+
record.value = response?.sources?.[0] ?? null;
|
|
38
|
+
} catch {
|
|
39
|
+
record.value = null;
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
return {
|
|
44
|
+
source: computed(() => (record.value ? buildName(record.value, lang()) : "") || "Agenzia Italiana del Farmaco (AIFA)"),
|
|
45
|
+
verified: computed(() => String(record.value?.latest_download_date || "/")),
|
|
46
|
+
};
|
|
47
|
+
}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
// Actes reglementaires de l'AIFA (it__drug_opinion__aifa) : forme d'un acte,
|
|
2
|
+
// libelles et schema d'export, communs a la fiche marque du layer
|
|
3
|
+
// (components/oip-italy) et aux pages d'Italy One.
|
|
4
|
+
//
|
|
5
|
+
// `tekkare_pdf_url` porte le meme lien tronque sur tous les documents :
|
|
6
|
+
// `aifa_url` est le seul lien utilisable.
|
|
7
|
+
|
|
8
|
+
export type OpinionDoc = {
|
|
9
|
+
opinion_id: string;
|
|
10
|
+
document_type: string;
|
|
11
|
+
has_code: string;
|
|
12
|
+
decision_date: string;
|
|
13
|
+
brand: string;
|
|
14
|
+
molecule: string;
|
|
15
|
+
company: string;
|
|
16
|
+
atc5_code: string;
|
|
17
|
+
nature_of_request: string;
|
|
18
|
+
nature_of_request_en: string;
|
|
19
|
+
theme: string;
|
|
20
|
+
theme_en: string;
|
|
21
|
+
indication: string;
|
|
22
|
+
indication_en: string;
|
|
23
|
+
essential: string;
|
|
24
|
+
essential_en: string;
|
|
25
|
+
aifa_url: string;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export const OPINION_FIELDS = [
|
|
29
|
+
"opinion_id",
|
|
30
|
+
"document_type",
|
|
31
|
+
"has_code",
|
|
32
|
+
"decision_date",
|
|
33
|
+
"brand",
|
|
34
|
+
"molecule",
|
|
35
|
+
"company",
|
|
36
|
+
"atc5_code",
|
|
37
|
+
"nature_of_request",
|
|
38
|
+
"nature_of_request_en",
|
|
39
|
+
"theme",
|
|
40
|
+
"theme_en",
|
|
41
|
+
"indication",
|
|
42
|
+
"indication_en",
|
|
43
|
+
"essential",
|
|
44
|
+
"essential_en",
|
|
45
|
+
"aifa_url",
|
|
46
|
+
];
|
|
47
|
+
|
|
48
|
+
// Le texte d'un acte tel que le lecteur le voit : la traduction DeepL quand
|
|
49
|
+
// elle existe, l'original italien sinon (essential_en reste vide, ou vaut
|
|
50
|
+
// « None », une fois le quota mensuel de traduction epuise).
|
|
51
|
+
export const essentialOf = (x: { essential_en?: string; essential?: string } | null) =>
|
|
52
|
+
(x?.essential_en && x.essential_en !== "None" ? x.essential_en : "") || x?.essential || "";
|
|
53
|
+
|
|
54
|
+
// Les cinq canaux de publication du portail Trovanorme, nommes comme lui
|
|
55
|
+
// (detGU / modSecFar / detTNF / docAIFA / news).
|
|
56
|
+
export const DOCUMENT_TYPES = [
|
|
57
|
+
{ code: "GU", label: "Gazzetta Ufficiale" },
|
|
58
|
+
{ code: "MSF", label: "Modifiche secondarie di farmaci" },
|
|
59
|
+
{ code: "TNF", label: "Testi normativi farmaceutici" },
|
|
60
|
+
{ code: "AIFA", label: "Documenti AIFA" },
|
|
61
|
+
{ code: "NEWS", label: "News" },
|
|
62
|
+
];
|
|
63
|
+
|
|
64
|
+
export const documentTypeLabel = (code: string) =>
|
|
65
|
+
DOCUMENT_TYPES.find((x) => x.code === code)?.label ?? (code || "-");
|
|
66
|
+
|
|
67
|
+
// "MUSCULO-SKELETAL SYSTEM" -> "Musculo-skeletal system"
|
|
68
|
+
export function titleCase(value: string) {
|
|
69
|
+
const clean = (value ?? "").trim();
|
|
70
|
+
if (!clean) return "";
|
|
71
|
+
return clean.charAt(0).toUpperCase() + clean.slice(1).toLowerCase();
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
const day = (value?: string) => (value ?? "").slice(0, 10);
|
|
75
|
+
|
|
76
|
+
/** Colonnes d'export d'un acte, partagees par la fiche marque et les pages d'Italy One. */
|
|
77
|
+
export function actSheetSchema(fr: boolean) {
|
|
78
|
+
return [
|
|
79
|
+
{ column: fr ? "Date de décision" : "Decision date", type: String, value: (x: OpinionDoc) => day(x.decision_date) },
|
|
80
|
+
{ column: fr ? "Marque" : "Brand", type: String, width: 25, value: (x: OpinionDoc) => x.brand },
|
|
81
|
+
{ column: fr ? "Molécule" : "Molecule", type: String, width: 35, value: (x: OpinionDoc) => x.molecule },
|
|
82
|
+
{ column: fr ? "Laboratoire" : "Company", type: String, width: 35, value: (x: OpinionDoc) => x.company },
|
|
83
|
+
{ column: "ATC5", type: String, value: (x: OpinionDoc) => x.atc5_code },
|
|
84
|
+
{ column: fr ? "Nature de la demande" : "Nature of request", type: String, width: 30, value: (x: OpinionDoc) => x.nature_of_request_en },
|
|
85
|
+
{ column: fr ? "Aire thérapeutique" : "Therapeutic area", type: String, width: 35, value: (x: OpinionDoc) => x.theme_en },
|
|
86
|
+
{ column: fr ? "Type de document" : "Document type", type: String, value: (x: OpinionDoc) => x.document_type },
|
|
87
|
+
{ column: fr ? "Code du document" : "Document code", type: String, value: (x: OpinionDoc) => x.has_code },
|
|
88
|
+
{ column: "Indication", type: String, width: 80, value: (x: OpinionDoc) => x.indication_en },
|
|
89
|
+
{ column: fr ? "Texte (IT)" : "Text (IT)", type: String, width: 100, value: (x: OpinionDoc) => x.essential },
|
|
90
|
+
{ column: fr ? "Lien AIFA" : "AIFA link", type: String, width: 60, value: (x: OpinionDoc) => x.aifa_url },
|
|
91
|
+
];
|
|
92
|
+
}
|
|
@@ -179,10 +179,11 @@ function germanySpec(kind: RmProjectKind, view: string): OipResourceSpec {
|
|
|
179
179
|
}
|
|
180
180
|
|
|
181
181
|
/**
|
|
182
|
-
* Une fiche d'Italy One, lue sur le cluster `drugs
|
|
183
|
-
* ligne du projet mene a la page de l'app
|
|
182
|
+
* Une fiche d'Italy One, lue sur le cluster `drugs` et montree d'un seul
|
|
183
|
+
* tenant (components/oip-italy) ; la ligne du projet mene a la page de l'app
|
|
184
|
+
* qui la montre.
|
|
184
185
|
*/
|
|
185
|
-
function italySpec(kind: RmProjectKind): OipResourceSpec {
|
|
186
|
+
function italySpec(kind: RmProjectKind, view: string): OipResourceSpec {
|
|
186
187
|
return {
|
|
187
188
|
type: kind.type,
|
|
188
189
|
app: "italy_one_app",
|
|
@@ -191,10 +192,17 @@ function italySpec(kind: RmProjectKind): OipResourceSpec {
|
|
|
191
192
|
routeId: (id) => id,
|
|
192
193
|
base: () => "",
|
|
193
194
|
tabs: [],
|
|
195
|
+
view,
|
|
194
196
|
detailPath: (id, _tab, doc) => kind.path?.(doc ?? {}, id) ?? "",
|
|
195
197
|
};
|
|
196
198
|
}
|
|
197
199
|
|
|
200
|
+
/** La fiche de chaque famille d'Italy One (cf. useOipResourceViews). */
|
|
201
|
+
const ITALY_VIEWS: Record<string, string> = {
|
|
202
|
+
ItApproval: "italy-aifa-act",
|
|
203
|
+
ItDrugPrice: "italy-price",
|
|
204
|
+
};
|
|
205
|
+
|
|
198
206
|
/** La fiche de chaque famille de Germany One (cf. useOipResourceViews). */
|
|
199
207
|
const GERMANY_VIEWS: Record<string, string> = {
|
|
200
208
|
DeGbaAssessment: "germany-gba",
|
|
@@ -432,7 +440,7 @@ export const OIP_RESOURCE_SPECS: OipResourceSpec[] = [
|
|
|
432
440
|
patientsSpec(PATIENT_KIND, "patients-patient"),
|
|
433
441
|
patientsSpec(VACCINE_KIND, "patients-vaccine"),
|
|
434
442
|
...GERMANY_PROJECT_KINDS.map((kind) => germanySpec(kind, GERMANY_VIEWS[kind.type]!)),
|
|
435
|
-
...ITALY_PROJECT_KINDS.map(italySpec),
|
|
443
|
+
...ITALY_PROJECT_KINDS.map((kind) => italySpec(kind, ITALY_VIEWS[kind.type]!)),
|
|
436
444
|
];
|
|
437
445
|
|
|
438
446
|
export function oipResourceSpec(type: string): OipResourceSpec | undefined {
|