@tekkare/romulus 0.1.276 → 0.1.278
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-germany/BrandCard.vue +294 -0
- package/layer/app/components/oip-germany/GbaAssessment.vue +20 -186
- package/layer/app/components/oip-germany/GkvMolecule.vue +74 -23
- package/layer/app/composables/useAlerts.ts +15 -0
- package/layer/app/oip-defaults/alerts.ts +26 -0
- package/layer/app/oip-germany/kinds.ts +5 -0
- package/package.json +1 -1
package/dist/module.json
CHANGED
|
@@ -0,0 +1,294 @@
|
|
|
1
|
+
<!-- Carte d'une marque evaluee par le G-BA (Germany One), cf. le script. -->
|
|
2
|
+
<script setup lang="ts">
|
|
3
|
+
/**
|
|
4
|
+
* Une marque evaluee par le G-BA (Germany One) : une ligne par groupe de
|
|
5
|
+
* patients, avec le benefice ajoute, le niveau de preuve et, en lignes
|
|
6
|
+
* facultatives, les criteres de jugement et le comparateur.
|
|
7
|
+
*
|
|
8
|
+
* La meme carte sert la page Drug Approvals de Germany One et le tiroir des
|
|
9
|
+
* projets de toutes les apps (cf. GbaAssessment.vue) : une seule lecture
|
|
10
|
+
* d'une evaluation, ou qu'on l'ouvre.
|
|
11
|
+
*/
|
|
12
|
+
import type { PropType } from "vue";
|
|
13
|
+
import { GERMANY_GBA_SOURCE } from "../../oip-germany/kinds";
|
|
14
|
+
|
|
15
|
+
const COLLAPSED_AMOUNT = 3;
|
|
16
|
+
|
|
17
|
+
const props = defineProps({
|
|
18
|
+
brand: { type: String, required: true },
|
|
19
|
+
/** Toutes les lignes d'evaluation de la marque, une par groupe de patients. */
|
|
20
|
+
decisions: { type: Array as PropType<any[]>, required: true },
|
|
21
|
+
/** Termes de recherche, surlignes dans la carte. */
|
|
22
|
+
queries: { type: Array as PropType<string[]>, default: () => [] },
|
|
23
|
+
/** Lignes facultatives (« Personnaliser ») : criteres de jugement, comparateur. */
|
|
24
|
+
show: { type: Object as PropType<{ endpoints?: boolean; comparator?: boolean }>, default: () => ({}) },
|
|
25
|
+
/** Tous les groupes de patients d'emblee, sans « Voir tout » (le tiroir). */
|
|
26
|
+
showAll: { type: Boolean, default: false },
|
|
27
|
+
lang: { type: String as PropType<"fr" | "en">, default: "en" },
|
|
28
|
+
/** Source Directus du pied de carte. */
|
|
29
|
+
sourceUuid: { type: String, default: GERMANY_GBA_SOURCE },
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
const WORDS = {
|
|
33
|
+
en: {
|
|
34
|
+
patientGroup: "patient group", patientGroups: "patient groups", latestDecision: "Latest decision",
|
|
35
|
+
substance: "Active substance", comparator: "Comparator", gbaDecision: "G-BA decision",
|
|
36
|
+
showAll: "Show all patient groups", showLess: "Show less", orphan: "Orphan drug", procedure: "Procedure",
|
|
37
|
+
mortality: "Mortality", morbidity: "Morbidity", qualityOfLife: "Quality of life", adverseEvents: "Adverse events",
|
|
38
|
+
},
|
|
39
|
+
fr: {
|
|
40
|
+
patientGroup: "groupe de patients", patientGroups: "groupes de patients", latestDecision: "Dernière décision",
|
|
41
|
+
substance: "Substance active", comparator: "Comparateur", gbaDecision: "Décision du G-BA",
|
|
42
|
+
showAll: "Voir tous les groupes de patients", showLess: "Réduire", orphan: "Médicament orphelin", procedure: "Procédure",
|
|
43
|
+
mortality: "Mortalité", morbidity: "Morbidité", qualityOfLife: "Qualité de vie", adverseEvents: "Effets indésirables",
|
|
44
|
+
},
|
|
45
|
+
} as const;
|
|
46
|
+
const w = computed(() => WORDS[props.lang === "fr" ? "fr" : "en"]);
|
|
47
|
+
const expanded = ref(false);
|
|
48
|
+
|
|
49
|
+
const sortedDecisions = computed(() =>
|
|
50
|
+
[...props.decisions].sort((a, b) => new Date(b.valid_from).getTime() - new Date(a.valid_from).getTime()),
|
|
51
|
+
);
|
|
52
|
+
const visibleDecisions = computed(() =>
|
|
53
|
+
props.showAll || expanded.value ? sortedDecisions.value : sortedDecisions.value.slice(0, COLLAPSED_AMOUNT),
|
|
54
|
+
);
|
|
55
|
+
/** `_id` Elasticsearch des evaluations : le `benefit_assessment_id`. */
|
|
56
|
+
const assessmentIds = computed(() => props.decisions.map((x) => String(x.benefit_assessment_id)).filter(Boolean));
|
|
57
|
+
const latestDate = computed(() => sortedDecisions.value[0]?.valid_from);
|
|
58
|
+
const substances = computed(() => [...new Set(props.decisions.map((x) => x.active_substance).filter(Boolean))]);
|
|
59
|
+
const atcCodes = computed(() => [...new Set(props.decisions.map((x) => x.atc_code).filter(Boolean))]);
|
|
60
|
+
|
|
61
|
+
const tags = computed(() => {
|
|
62
|
+
const list: { label: string; variant: string }[] = [];
|
|
63
|
+
if (props.decisions.some((x) => x.is_orphan)) list.push({ label: w.value.orphan, variant: "purple" });
|
|
64
|
+
if (props.decisions.some((x) => x.is_atmp)) list.push({ label: "ATMP", variant: "violet" });
|
|
65
|
+
// `procedure_type_en` est la voie d'evaluation (§ 35a), pas le statut du
|
|
66
|
+
// produit : « Orphan drug » y designe la procedure allegee, qui ne coincide
|
|
67
|
+
// pas toujours avec `is_orphan`, d'ou le prefixe explicite.
|
|
68
|
+
[...new Set(props.decisions.map((x) => x.procedure_type_en).filter(Boolean))].forEach((procedure) =>
|
|
69
|
+
list.push({ label: `${w.value.procedure}: ${procedure}`, variant: "fushia" }),
|
|
70
|
+
);
|
|
71
|
+
return list;
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
/** Categories du benefice ajoute, de la meilleure a la pire. */
|
|
75
|
+
function benefitVariant(benefit: string): any {
|
|
76
|
+
switch (benefit) {
|
|
77
|
+
case "Major":
|
|
78
|
+
return "green";
|
|
79
|
+
case "Considerable":
|
|
80
|
+
return "emerald";
|
|
81
|
+
case "Minor":
|
|
82
|
+
return "lime";
|
|
83
|
+
case "Non-quantifiable":
|
|
84
|
+
case "Deemed proven":
|
|
85
|
+
return "sky";
|
|
86
|
+
case "Lesser benefit":
|
|
87
|
+
return "orange";
|
|
88
|
+
default:
|
|
89
|
+
// « Not proven » / « Deemed not proven »
|
|
90
|
+
return "rose";
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
function endpoints(decision: any) {
|
|
95
|
+
return [
|
|
96
|
+
{ label: w.value.mortality, symbol: decision.endpoint_mortality_symbol, text: decision.endpoint_mortality_en },
|
|
97
|
+
{ label: w.value.morbidity, symbol: decision.endpoint_morbidity_symbol, text: decision.endpoint_morbidity_en },
|
|
98
|
+
{ label: w.value.qualityOfLife, symbol: decision.endpoint_quality_of_life_symbol, text: decision.endpoint_quality_of_life_en },
|
|
99
|
+
{ label: w.value.adverseEvents, symbol: decision.endpoint_adverse_events_symbol, text: decision.endpoint_adverse_events_en },
|
|
100
|
+
];
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
function symbolClass(symbol: string) {
|
|
104
|
+
if (symbol === "↑" || symbol === "↑↑") return "positive";
|
|
105
|
+
if (symbol === "↓" || symbol === "↓↓") return "negative";
|
|
106
|
+
return "neutral";
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/** L'export de la carte : toutes les lignes de la marque, pas les trois affichees. */
|
|
110
|
+
const payload = () => ({
|
|
111
|
+
title: props.brand,
|
|
112
|
+
sheets: [
|
|
113
|
+
{
|
|
114
|
+
name: props.brand.slice(0, 31),
|
|
115
|
+
data: sortedDecisions.value,
|
|
116
|
+
schema: [
|
|
117
|
+
{ column: "Patient group", type: String, width: 60, value: (x: any) => x.patient_group_en || x.patient_group_de },
|
|
118
|
+
{ column: "Added benefit", type: String, width: 20, value: (x: any) => x.added_benefit_en },
|
|
119
|
+
{ column: "Certainty of evidence", type: String, width: 20, value: (x: any) => x.evidence_certainty_en },
|
|
120
|
+
{ column: "Valid from", type: String, width: 14, value: (x: any) => x.valid_from },
|
|
121
|
+
{ column: "Active substance", type: String, width: 30, value: (x: any) => x.active_substance },
|
|
122
|
+
{ column: "ATC", type: String, width: 12, value: (x: any) => x.atc_code },
|
|
123
|
+
{ column: "Comparator", type: String, width: 50, value: (x: any) => x.comparator_de },
|
|
124
|
+
{ column: "G-BA decision", type: String, width: 40, value: (x: any) => x.url },
|
|
125
|
+
],
|
|
126
|
+
},
|
|
127
|
+
],
|
|
128
|
+
});
|
|
129
|
+
</script>
|
|
130
|
+
|
|
131
|
+
<template>
|
|
132
|
+
<RmResultCard
|
|
133
|
+
:count="decisions.length"
|
|
134
|
+
:count-label="decisions.length > 1 ? w.patientGroups : w.patientGroup"
|
|
135
|
+
:lang="lang"
|
|
136
|
+
:payload="payload"
|
|
137
|
+
title-in-body
|
|
138
|
+
>
|
|
139
|
+
<!-- Range toutes les evaluations de la marque (une par groupe de patients). -->
|
|
140
|
+
<template #actions>
|
|
141
|
+
<ProjectAddButton :resource-id="assessmentIds" type="DeGbaAssessment" :label="brand" compact />
|
|
142
|
+
</template>
|
|
143
|
+
<template #title>
|
|
144
|
+
<RmTextHighlight class="brand_title" :text="brand" :queries="queries" :lang="lang" />
|
|
145
|
+
</template>
|
|
146
|
+
|
|
147
|
+
<template #meta>
|
|
148
|
+
<span class="rm-rcard__label">
|
|
149
|
+
{{ w.latestDecision }} · <RmDate :date="latestDate" :lang="lang" compact />
|
|
150
|
+
</span>
|
|
151
|
+
<RmTag v-for="tag in tags" :key="tag.label" :variant="tag.variant as any">{{ tag.label }}</RmTag>
|
|
152
|
+
</template>
|
|
153
|
+
|
|
154
|
+
<div class="rows">
|
|
155
|
+
<span class="row_label">{{ w.substance }}</span>
|
|
156
|
+
<span><RmTextHighlight :text="substances.join(', ')" :queries="queries" :lang="lang" /></span>
|
|
157
|
+
<span class="row_label">ATC</span>
|
|
158
|
+
<RmTagRow :tags="atcCodes.length ? atcCodes : ['N/A']" />
|
|
159
|
+
</div>
|
|
160
|
+
|
|
161
|
+
<div class="groups">
|
|
162
|
+
<div v-for="decision in visibleDecisions" :key="decision.benefit_assessment_id" class="group">
|
|
163
|
+
<div class="group_head">
|
|
164
|
+
<div class="group_tags">
|
|
165
|
+
<RmTag :variant="benefitVariant(decision.added_benefit_en)">{{ decision.added_benefit_en || "N/A" }}</RmTag>
|
|
166
|
+
<RmTag v-if="decision.evidence_certainty_en" variant="gray">{{ decision.evidence_certainty_en }}</RmTag>
|
|
167
|
+
</div>
|
|
168
|
+
<span class="group_date"><RmDate :date="decision.valid_from" :lang="lang" compact /></span>
|
|
169
|
+
</div>
|
|
170
|
+
|
|
171
|
+
<RmTextHighlight
|
|
172
|
+
class="group_text"
|
|
173
|
+
:text="decision.patient_group_en || decision.patient_group_de || ''"
|
|
174
|
+
:queries="queries"
|
|
175
|
+
:clamp="3"
|
|
176
|
+
:lang="lang"
|
|
177
|
+
/>
|
|
178
|
+
|
|
179
|
+
<div v-if="show.endpoints" class="endpoints">
|
|
180
|
+
<span v-for="endpoint in endpoints(decision)" :key="endpoint.label" class="endpoint" :title="endpoint.text">
|
|
181
|
+
<span class="endpoint_label">{{ endpoint.label }}</span>
|
|
182
|
+
<span class="endpoint_symbol" :class="symbolClass(endpoint.symbol)">{{ endpoint.symbol || "-" }}</span>
|
|
183
|
+
</span>
|
|
184
|
+
</div>
|
|
185
|
+
|
|
186
|
+
<div class="group_foot">
|
|
187
|
+
<span v-if="show.comparator && decision.comparator_de" class="comparator">
|
|
188
|
+
{{ w.comparator }}: {{ decision.comparator_de }}
|
|
189
|
+
</span>
|
|
190
|
+
<a v-if="decision.url" class="link" :href="decision.url" target="_blank" rel="noopener">
|
|
191
|
+
{{ w.gbaDecision }}
|
|
192
|
+
</a>
|
|
193
|
+
</div>
|
|
194
|
+
</div>
|
|
195
|
+
|
|
196
|
+
<RmButton v-if="!showAll && decisions.length > COLLAPSED_AMOUNT" variant="text" size="sm" @click="expanded = !expanded">
|
|
197
|
+
{{ expanded ? w.showLess : `${w.showAll} (${decisions.length})` }}
|
|
198
|
+
</RmButton>
|
|
199
|
+
</div>
|
|
200
|
+
|
|
201
|
+
<template #footer>
|
|
202
|
+
<OipResourceSource :uuid="sourceUuid" :lang="lang" />
|
|
203
|
+
</template>
|
|
204
|
+
</RmResultCard>
|
|
205
|
+
</template>
|
|
206
|
+
|
|
207
|
+
<style scoped>
|
|
208
|
+
/* Les marques en capitales, comme les cartes du portail fr_drugs_app. */
|
|
209
|
+
.brand_title {
|
|
210
|
+
text-transform: uppercase;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
.rows {
|
|
214
|
+
display: grid;
|
|
215
|
+
grid-template-columns: max-content 1fr;
|
|
216
|
+
gap: var(--space-8) var(--space-16);
|
|
217
|
+
align-items: center;
|
|
218
|
+
font-size: var(--font-14);
|
|
219
|
+
}
|
|
220
|
+
.row_label {
|
|
221
|
+
color: var(--text-muted);
|
|
222
|
+
font-size: var(--font-12);
|
|
223
|
+
text-transform: uppercase;
|
|
224
|
+
}
|
|
225
|
+
.groups {
|
|
226
|
+
display: flex;
|
|
227
|
+
flex-direction: column;
|
|
228
|
+
gap: var(--space-8);
|
|
229
|
+
margin-top: var(--space-16);
|
|
230
|
+
}
|
|
231
|
+
.group {
|
|
232
|
+
display: flex;
|
|
233
|
+
flex-direction: column;
|
|
234
|
+
gap: var(--space-8);
|
|
235
|
+
padding: var(--space-12);
|
|
236
|
+
border: 1px solid var(--border-default);
|
|
237
|
+
border-radius: var(--radius-md);
|
|
238
|
+
}
|
|
239
|
+
.group_head,
|
|
240
|
+
.group_foot {
|
|
241
|
+
display: flex;
|
|
242
|
+
align-items: center;
|
|
243
|
+
justify-content: space-between;
|
|
244
|
+
gap: var(--space-8);
|
|
245
|
+
flex-wrap: wrap;
|
|
246
|
+
}
|
|
247
|
+
.group_tags {
|
|
248
|
+
display: flex;
|
|
249
|
+
gap: var(--space-4);
|
|
250
|
+
flex-wrap: wrap;
|
|
251
|
+
}
|
|
252
|
+
.group_date,
|
|
253
|
+
.comparator {
|
|
254
|
+
color: var(--text-muted);
|
|
255
|
+
font-size: var(--font-12);
|
|
256
|
+
}
|
|
257
|
+
.group_text {
|
|
258
|
+
font-size: var(--font-14);
|
|
259
|
+
}
|
|
260
|
+
.endpoints {
|
|
261
|
+
display: flex;
|
|
262
|
+
flex-wrap: wrap;
|
|
263
|
+
gap: var(--space-8);
|
|
264
|
+
font-size: 11px;
|
|
265
|
+
}
|
|
266
|
+
.endpoint {
|
|
267
|
+
display: flex;
|
|
268
|
+
align-items: center;
|
|
269
|
+
gap: 4px;
|
|
270
|
+
padding: 2px 6px;
|
|
271
|
+
border: 1px solid var(--border-default);
|
|
272
|
+
border-radius: var(--radius-sm);
|
|
273
|
+
}
|
|
274
|
+
.endpoint_label {
|
|
275
|
+
color: var(--text-muted);
|
|
276
|
+
}
|
|
277
|
+
.endpoint_symbol {
|
|
278
|
+
font-weight: var(--weight-bold);
|
|
279
|
+
}
|
|
280
|
+
.endpoint_symbol.positive {
|
|
281
|
+
color: var(--color-success);
|
|
282
|
+
}
|
|
283
|
+
.endpoint_symbol.negative {
|
|
284
|
+
color: var(--color-danger);
|
|
285
|
+
}
|
|
286
|
+
.endpoint_symbol.neutral {
|
|
287
|
+
color: var(--text-muted);
|
|
288
|
+
}
|
|
289
|
+
.link {
|
|
290
|
+
color: var(--color-primary);
|
|
291
|
+
font-size: var(--font-12);
|
|
292
|
+
text-decoration: underline;
|
|
293
|
+
}
|
|
294
|
+
</style>
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
<!--
|
|
2
2
|
Fiche d'une evaluation du benefice du G-BA (Germany One, type
|
|
3
|
-
DeGbaAssessment)
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
DeGbaAssessment), par son `_id` (benefit_assessment_id). Le tiroir montre la
|
|
4
|
+
meme carte que la page Drug Approvals de Germany One : la marque et tous ses
|
|
5
|
+
groupes de patients, criteres de jugement et comparateur compris.
|
|
6
6
|
|
|
7
7
|
Montee par le tiroir des projets ; le lien vers l'app passe par le slot
|
|
8
8
|
`title-link`.
|
|
@@ -17,56 +17,16 @@
|
|
|
17
17
|
</RmPageHeader>
|
|
18
18
|
|
|
19
19
|
<div class="oip-germany__body">
|
|
20
|
-
<RmLoadingState v-if="loading"
|
|
21
|
-
<RmEmptyState v-else-if="!
|
|
22
|
-
<
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
<RmCard padding="md">
|
|
32
|
-
<h3 class="oip-germany__card-title">{{ en ? "Patient group" : "Groupe de patients" }}</h3>
|
|
33
|
-
<p class="oip-germany__text">{{ doc.patient_group_en || doc.patient_group_de }}</p>
|
|
34
|
-
<dl class="oip-germany__rows">
|
|
35
|
-
<template v-for="row in rows" :key="row.label">
|
|
36
|
-
<dt>{{ row.label }}</dt>
|
|
37
|
-
<dd>{{ row.value }}</dd>
|
|
38
|
-
</template>
|
|
39
|
-
</dl>
|
|
40
|
-
</RmCard>
|
|
41
|
-
|
|
42
|
-
<RmCard padding="md">
|
|
43
|
-
<h3 class="oip-germany__card-title">{{ en ? "Endpoints vs comparator" : "Critères de jugement contre comparateur" }}</h3>
|
|
44
|
-
<dl class="oip-germany__rows">
|
|
45
|
-
<template v-for="endpoint in endpoints" :key="endpoint.label">
|
|
46
|
-
<dt>{{ endpoint.label }}</dt>
|
|
47
|
-
<dd>
|
|
48
|
-
<b :class="`oip-germany__symbol oip-germany__symbol--${symbolTone(endpoint.symbol)}`">{{ endpoint.symbol || "-" }}</b>
|
|
49
|
-
{{ endpoint.text }}
|
|
50
|
-
</dd>
|
|
51
|
-
</template>
|
|
52
|
-
</dl>
|
|
53
|
-
<a v-if="doc.url" class="oip-germany__link" :href="doc.url" target="_blank" rel="noopener">
|
|
54
|
-
{{ en ? "G-BA decision" : "Décision du G-BA" }} ↗
|
|
55
|
-
</a>
|
|
56
|
-
</RmCard>
|
|
57
|
-
|
|
58
|
-
<RmCard v-if="others.length" padding="md">
|
|
59
|
-
<h3 class="oip-germany__card-title">
|
|
60
|
-
{{ en ? `Other patient groups of ${brand}` : `Autres groupes de patients de ${brand}` }} ({{ others.length }})
|
|
61
|
-
</h3>
|
|
62
|
-
<ul class="oip-germany__list">
|
|
63
|
-
<li v-for="other in others" :key="other.benefit_assessment_id">
|
|
64
|
-
<RmTag :variant="benefitVariant(other.added_benefit_en)">{{ other.added_benefit_en || "N/A" }}</RmTag>
|
|
65
|
-
<span>{{ other.patient_group_en || other.patient_group_de }}</span>
|
|
66
|
-
</li>
|
|
67
|
-
</ul>
|
|
68
|
-
</RmCard>
|
|
69
|
-
</template>
|
|
20
|
+
<RmLoadingState v-if="loading" :lines="3" :chart="false" />
|
|
21
|
+
<RmEmptyState v-else-if="!decisions.length" icon="Prohibit" :title="en ? 'Assessment not found' : 'Évaluation introuvable'" />
|
|
22
|
+
<OipGermanyBrandCard
|
|
23
|
+
v-else
|
|
24
|
+
:brand="brand"
|
|
25
|
+
:decisions="decisions"
|
|
26
|
+
:show="{ endpoints: true, comparator: true }"
|
|
27
|
+
show-all
|
|
28
|
+
:lang="en ? 'en' : 'fr'"
|
|
29
|
+
/>
|
|
70
30
|
</div>
|
|
71
31
|
</div>
|
|
72
32
|
</template>
|
|
@@ -88,79 +48,22 @@ const props = withDefaults(
|
|
|
88
48
|
|
|
89
49
|
const en = computed(() => props.lang !== "fr");
|
|
90
50
|
const loading = ref(true);
|
|
91
|
-
const
|
|
92
|
-
const
|
|
93
|
-
|
|
94
|
-
const brand = computed(() => [].concat(doc.value?.brand_name ?? []).filter(Boolean).join(", "));
|
|
95
|
-
const date = (value: unknown) => {
|
|
96
|
-
const parsed = new Date(String(value ?? ""));
|
|
97
|
-
return Number.isNaN(parsed.getTime()) ? "-" : parsed.toLocaleDateString(en.value ? "en-GB" : "fr-FR", { day: "numeric", month: "short", year: "numeric" });
|
|
98
|
-
};
|
|
99
|
-
|
|
100
|
-
const rows = computed(() => {
|
|
101
|
-
const d = doc.value ?? {};
|
|
102
|
-
return [
|
|
103
|
-
{ label: en.value ? "Active substance" : "Substance active", value: d.active_substance },
|
|
104
|
-
{ label: "ATC", value: d.atc_code },
|
|
105
|
-
{ label: en.value ? "ICD-10-GM" : "CIM-10-GM", value: [].concat(d.icd_label_de ?? []).join(", ") },
|
|
106
|
-
{ label: en.value ? "Comparator" : "Comparateur", value: d.comparator_de },
|
|
107
|
-
{ label: en.value ? "Valid from" : "En vigueur depuis", value: date(d.valid_from) },
|
|
108
|
-
{ label: en.value ? "Valid until" : "En vigueur jusqu'au", value: d.valid_until ? date(d.valid_until) : "" },
|
|
109
|
-
].filter((row) => row.value);
|
|
110
|
-
});
|
|
111
|
-
|
|
112
|
-
const endpoints = computed(() => {
|
|
113
|
-
const d = doc.value ?? {};
|
|
114
|
-
return [
|
|
115
|
-
{ label: en.value ? "Mortality" : "Mortalité", symbol: d.endpoint_mortality_symbol, text: d.endpoint_mortality_en },
|
|
116
|
-
{ label: en.value ? "Morbidity" : "Morbidité", symbol: d.endpoint_morbidity_symbol, text: d.endpoint_morbidity_en },
|
|
117
|
-
{ label: en.value ? "Quality of life" : "Qualité de vie", symbol: d.endpoint_quality_of_life_symbol, text: d.endpoint_quality_of_life_en },
|
|
118
|
-
{ label: en.value ? "Adverse events" : "Effets indésirables", symbol: d.endpoint_adverse_events_symbol, text: d.endpoint_adverse_events_en },
|
|
119
|
-
];
|
|
120
|
-
});
|
|
121
|
-
|
|
122
|
-
/** Categories du benefice ajoute, de la meilleure a la pire (memes teintes que Germany One). */
|
|
123
|
-
function benefitVariant(benefit: string): any {
|
|
124
|
-
switch (benefit) {
|
|
125
|
-
case "Major":
|
|
126
|
-
return "green";
|
|
127
|
-
case "Considerable":
|
|
128
|
-
return "emerald";
|
|
129
|
-
case "Minor":
|
|
130
|
-
return "lime";
|
|
131
|
-
case "Non-quantifiable":
|
|
132
|
-
case "Deemed proven":
|
|
133
|
-
return "sky";
|
|
134
|
-
case "Lesser benefit":
|
|
135
|
-
return "orange";
|
|
136
|
-
default:
|
|
137
|
-
return "rose";
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
function symbolTone(symbol: string) {
|
|
142
|
-
if (symbol === "↑" || symbol === "↑↑") return "up";
|
|
143
|
-
if (symbol === "↓" || symbol === "↓↓") return "down";
|
|
144
|
-
return "flat";
|
|
145
|
-
}
|
|
51
|
+
const brand = ref("");
|
|
52
|
+
const decisions = ref<Record<string, any>[]>([]);
|
|
146
53
|
|
|
147
54
|
async function read() {
|
|
148
55
|
loading.value = true;
|
|
149
|
-
|
|
150
|
-
others.value = [];
|
|
56
|
+
decisions.value = [];
|
|
151
57
|
const hit = await oipEsGet<any>("drugs", GERMANY_INDEX.gba, props.id).catch(() => null);
|
|
152
|
-
|
|
153
|
-
|
|
58
|
+
const brands: string[] = [].concat(hit?._source?.brand_name ?? []).filter(Boolean);
|
|
59
|
+
brand.value = brands.join(", ");
|
|
154
60
|
if (brands.length) {
|
|
155
61
|
const res = await oipEsSearch<any>("drugs", GERMANY_INDEX.gba, {
|
|
156
|
-
size:
|
|
157
|
-
_source: ["benefit_assessment_id", "patient_group_en", "patient_group_de", "added_benefit_en", "valid_from"],
|
|
62
|
+
size: 200,
|
|
158
63
|
query: { terms: { "brand_name.keyword": brands } },
|
|
159
64
|
sort: [{ valid_from: "desc" }],
|
|
160
65
|
}).catch(() => null);
|
|
161
|
-
|
|
162
|
-
.map((h: any) => h._source)
|
|
163
|
-
.filter((s: any) => String(s.benefit_assessment_id) !== props.id);
|
|
66
|
+
decisions.value = (res?.hits?.hits ?? []).map((h: any) => h._source);
|
|
164
67
|
}
|
|
165
68
|
loading.value = false;
|
|
166
69
|
}
|
|
@@ -170,79 +73,10 @@ watch(() => props.id, read, { immediate: true });
|
|
|
170
73
|
|
|
171
74
|
<style scoped>
|
|
172
75
|
.oip-germany__body {
|
|
173
|
-
display: flex;
|
|
174
|
-
flex-direction: column;
|
|
175
|
-
gap: var(--space-16);
|
|
176
76
|
padding: var(--space-20) var(--space-32) var(--space-32);
|
|
177
77
|
}
|
|
178
78
|
.oip-germany__title {
|
|
179
79
|
margin-right: var(--space-12);
|
|
180
|
-
}
|
|
181
|
-
.oip-germany__tags {
|
|
182
|
-
display: flex;
|
|
183
|
-
flex-wrap: wrap;
|
|
184
|
-
gap: var(--space-6);
|
|
185
|
-
}
|
|
186
|
-
.oip-germany__card-title {
|
|
187
|
-
margin: 0 0 var(--space-12);
|
|
188
|
-
font-size: var(--font-16);
|
|
189
|
-
font-weight: var(--weight-bold);
|
|
190
|
-
}
|
|
191
|
-
.oip-germany__text {
|
|
192
|
-
margin: 0 0 var(--space-16);
|
|
193
|
-
font-size: var(--font-14);
|
|
194
|
-
line-height: 1.6;
|
|
195
|
-
}
|
|
196
|
-
.oip-germany__rows {
|
|
197
|
-
display: grid;
|
|
198
|
-
grid-template-columns: minmax(140px, max-content) 1fr;
|
|
199
|
-
gap: var(--space-8) var(--space-20);
|
|
200
|
-
margin: 0;
|
|
201
|
-
font-size: var(--font-14);
|
|
202
|
-
}
|
|
203
|
-
.oip-germany__rows dt {
|
|
204
|
-
color: var(--text-muted);
|
|
205
|
-
font-size: var(--font-12);
|
|
206
|
-
font-weight: var(--weight-semibold);
|
|
207
80
|
text-transform: uppercase;
|
|
208
|
-
padding-top: 2px;
|
|
209
|
-
}
|
|
210
|
-
.oip-germany__rows dd {
|
|
211
|
-
margin: 0;
|
|
212
|
-
line-height: 1.5;
|
|
213
|
-
}
|
|
214
|
-
.oip-germany__symbol {
|
|
215
|
-
margin-right: var(--space-6);
|
|
216
|
-
}
|
|
217
|
-
.oip-germany__symbol--up {
|
|
218
|
-
color: var(--color-success);
|
|
219
|
-
}
|
|
220
|
-
.oip-germany__symbol--down {
|
|
221
|
-
color: var(--color-danger);
|
|
222
|
-
}
|
|
223
|
-
.oip-germany__symbol--flat {
|
|
224
|
-
color: var(--text-muted);
|
|
225
|
-
}
|
|
226
|
-
.oip-germany__link {
|
|
227
|
-
display: inline-block;
|
|
228
|
-
margin-top: var(--space-16);
|
|
229
|
-
color: var(--color-primary);
|
|
230
|
-
font-size: var(--font-13);
|
|
231
|
-
font-weight: var(--weight-semibold);
|
|
232
|
-
}
|
|
233
|
-
.oip-germany__list {
|
|
234
|
-
display: flex;
|
|
235
|
-
flex-direction: column;
|
|
236
|
-
gap: var(--space-10);
|
|
237
|
-
margin: 0;
|
|
238
|
-
padding: 0;
|
|
239
|
-
list-style: none;
|
|
240
|
-
font-size: var(--font-13);
|
|
241
|
-
line-height: 1.5;
|
|
242
|
-
}
|
|
243
|
-
.oip-germany__list li {
|
|
244
|
-
display: flex;
|
|
245
|
-
align-items: flex-start;
|
|
246
|
-
gap: var(--space-8);
|
|
247
81
|
}
|
|
248
82
|
</style>
|
|
@@ -20,17 +20,37 @@
|
|
|
20
20
|
<RmLoadingState v-if="loading" spinner />
|
|
21
21
|
<RmEmptyState v-else-if="!doc" icon="Prohibit" :title="en ? 'Molecule not found' : 'Molécule introuvable'" />
|
|
22
22
|
<template v-else>
|
|
23
|
-
<
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
23
|
+
<RmResultCard
|
|
24
|
+
v-if="last"
|
|
25
|
+
:count="fmt(last.package)"
|
|
26
|
+
:count-label="en ? `packages, ${last.period}` : `boîtes, ${last.period}`"
|
|
27
|
+
:count-extra="growthText(previous?.package, last.package)"
|
|
28
|
+
:lang="lang"
|
|
29
|
+
:actions="false"
|
|
30
|
+
title-in-body
|
|
31
|
+
>
|
|
32
|
+
<template #actions>
|
|
33
|
+
<ProjectAddButton :resource-id="id" type="DeGkvMolecule" :label="doc.concat_label_code" compact />
|
|
34
|
+
</template>
|
|
35
|
+
<template #title>{{ doc.concat_label_code }}</template>
|
|
36
|
+
<template #meta>
|
|
37
|
+
<span class="rm-rcard__label">GKV · {{ last.period }}</span>
|
|
38
|
+
<RmTag v-if="doc.atc5_code" variant="gray">ATC {{ doc.atc5_code }}</RmTag>
|
|
39
|
+
<RmTag variant="indigo">{{ brandRows.length }} {{ en ? (brandRows.length > 1 ? "brands" : "brand") : (brandRows.length > 1 ? "marques" : "marque") }}</RmTag>
|
|
40
|
+
</template>
|
|
41
|
+
<dl class="oip-germany__rows">
|
|
42
|
+
<template v-for="row in summary" :key="row.label">
|
|
43
|
+
<dt>{{ row.label }}</dt>
|
|
44
|
+
<dd>
|
|
45
|
+
{{ row.value }}
|
|
46
|
+
<span v-if="row.growth" class="oip-germany__growth" :class="row.up ? 'oip-germany__growth--up' : 'oip-germany__growth--down'">{{ row.growth }}</span>
|
|
47
|
+
</dd>
|
|
48
|
+
</template>
|
|
49
|
+
</dl>
|
|
50
|
+
<template #footer>
|
|
51
|
+
<OipResourceSource :uuid="GERMANY_GKV_SOURCE" :lang="lang" />
|
|
52
|
+
</template>
|
|
53
|
+
</RmResultCard>
|
|
34
54
|
|
|
35
55
|
<RmTableCard :lang="lang" :actions="false">
|
|
36
56
|
<template #header>
|
|
@@ -52,7 +72,7 @@
|
|
|
52
72
|
|
|
53
73
|
<script setup lang="ts">
|
|
54
74
|
import { oipEsGet, oipEsSearch } from "../../composables/useOipResources";
|
|
55
|
-
import { GERMANY_INDEX } from "../../oip-germany/kinds";
|
|
75
|
+
import { GERMANY_GKV_SOURCE, GERMANY_INDEX } from "../../oip-germany/kinds";
|
|
56
76
|
|
|
57
77
|
const props = withDefaults(
|
|
58
78
|
defineProps<{
|
|
@@ -91,14 +111,24 @@ const previous = computed(() => years.value.at(-2) ?? null);
|
|
|
91
111
|
|
|
92
112
|
const growth = (a?: number, b?: number) => (a && b !== undefined ? Number((((b - a) / a) * 100).toFixed(1)) : undefined);
|
|
93
113
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
114
|
+
/** Evolution sur l'annee precedente, en texte (« +4,2 % vs 2023 »). */
|
|
115
|
+
function growthText(a?: number, b?: number) {
|
|
116
|
+
const g = growth(a, b);
|
|
117
|
+
if (g === undefined || !previous.value) return "";
|
|
118
|
+
return `${g > 0 ? "+" : ""}${fmt(g, 1)} % ${en.value ? "vs" : "contre"} ${previous.value.period}`;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/** Les autres indicateurs de la derniere annee, sous le chiffre des boites. */
|
|
122
|
+
const summary = computed(() =>
|
|
123
|
+
METRICS.slice(1).map((metric) => {
|
|
124
|
+
const g = growth(previous.value?.[metric.key], last.value?.[metric.key]);
|
|
125
|
+
return {
|
|
126
|
+
label: en.value ? metric.en : metric.fr,
|
|
127
|
+
value: fmt(last.value?.[metric.key], metric.money ? 2 : 0),
|
|
128
|
+
growth: g === undefined ? "" : `${g > 0 ? "+" : ""}${fmt(g, 1)} %`,
|
|
129
|
+
up: (g ?? 0) >= 0,
|
|
130
|
+
};
|
|
131
|
+
}),
|
|
102
132
|
);
|
|
103
133
|
|
|
104
134
|
const yearColumns = computed(() => [
|
|
@@ -161,9 +191,30 @@ watch(() => props.id, read, { immediate: true });
|
|
|
161
191
|
.oip-germany__title {
|
|
162
192
|
margin-right: var(--space-12);
|
|
163
193
|
}
|
|
164
|
-
.oip-
|
|
194
|
+
.oip-germany__rows {
|
|
165
195
|
display: grid;
|
|
166
|
-
grid-template-columns:
|
|
167
|
-
gap: var(--space-
|
|
196
|
+
grid-template-columns: max-content 1fr;
|
|
197
|
+
gap: var(--space-8) var(--space-16);
|
|
198
|
+
margin: 0;
|
|
199
|
+
font-size: var(--font-14);
|
|
200
|
+
}
|
|
201
|
+
.oip-germany__rows dt {
|
|
202
|
+
color: var(--text-muted);
|
|
203
|
+
font-size: var(--font-12);
|
|
204
|
+
text-transform: uppercase;
|
|
205
|
+
}
|
|
206
|
+
.oip-germany__rows dd {
|
|
207
|
+
margin: 0;
|
|
208
|
+
}
|
|
209
|
+
.oip-germany__growth {
|
|
210
|
+
margin-left: var(--space-6);
|
|
211
|
+
font-size: var(--font-12);
|
|
212
|
+
font-weight: var(--weight-semibold);
|
|
213
|
+
}
|
|
214
|
+
.oip-germany__growth--up {
|
|
215
|
+
color: var(--color-success);
|
|
216
|
+
}
|
|
217
|
+
.oip-germany__growth--down {
|
|
218
|
+
color: var(--color-danger);
|
|
168
219
|
}
|
|
169
220
|
</style>
|
|
@@ -12,6 +12,17 @@
|
|
|
12
12
|
*/
|
|
13
13
|
import { useOipApi, type Alert, type AlertEvent, type AlertTrigger } from "#oip-app/api";
|
|
14
14
|
import { sameViewPage } from "../utils/viewPages";
|
|
15
|
+
// Lecture facultative : `BRAND_ALERT_SOURCES` n'existe que dans les apps qui
|
|
16
|
+
// le declarent, et un import nomme d'une valeur absente casse le build.
|
|
17
|
+
import * as appAlerts from "#oip-app/alerts";
|
|
18
|
+
|
|
19
|
+
const BRAND_SOURCES_KEY = "BRAND_ALERT_SOURCES";
|
|
20
|
+
|
|
21
|
+
/** Les index des alertes de produit de l'app, ou rien (ceux du hub). */
|
|
22
|
+
function appBrandSources(): unknown[] | undefined {
|
|
23
|
+
const sources = (appAlerts as Record<string, unknown>)[BRAND_SOURCES_KEY];
|
|
24
|
+
return Array.isArray(sources) && sources.length ? sources : undefined;
|
|
25
|
+
}
|
|
15
26
|
|
|
16
27
|
export function useAlerts() {
|
|
17
28
|
const elysiaApi = useOipApi();
|
|
@@ -207,6 +218,10 @@ export function useAlerts() {
|
|
|
207
218
|
// l'ouverture du panneau.
|
|
208
219
|
query: product ? undefined : declared!.query(),
|
|
209
220
|
resourceType: product ? undefined : declared!.resourceType,
|
|
221
|
+
// Les index d'une alerte de produit : ceux de l'app quand elle les
|
|
222
|
+
// declare, sinon l'API garde ceux du hub. Par decomposition : le type du
|
|
223
|
+
// corps vit dans chaque app (useElysiaApi), qui ne le connait pas encore.
|
|
224
|
+
...(product && appBrandSources() ? { brandSources: appBrandSources() } : {}),
|
|
210
225
|
// L'API nomme l'app par son registre quand elle connait l'hote ; ce
|
|
211
226
|
// nom-ci sert de repli, pour que le digest ne dise pas « OIP » a un
|
|
212
227
|
// client tant que l'app n'y est pas inscrite.
|
|
@@ -16,6 +16,32 @@ export const ALERT_BRAND_DIRECTORY = {
|
|
|
16
16
|
search: async (_body: unknown): Promise<any> => ({}),
|
|
17
17
|
};
|
|
18
18
|
|
|
19
|
+
/**
|
|
20
|
+
* Un index qu'une alerte de produit surveille, decrit par l'app : l'API
|
|
21
|
+
* Virtual Lab y cherche les marques de l'alerte (cf. `brandSources`).
|
|
22
|
+
*/
|
|
23
|
+
export interface BrandAlertSource {
|
|
24
|
+
index: string;
|
|
25
|
+
/** Champ qui porte la marque. */
|
|
26
|
+
brandField: string;
|
|
27
|
+
/** Champs relus pour nommer un resultat : titre, puis ce qui le situe. */
|
|
28
|
+
labelFields: [string] | [string, string];
|
|
29
|
+
/** Nom de la source, pour grouper les evenements dans le digest. */
|
|
30
|
+
label: string;
|
|
31
|
+
/** Ce que l'agent du digest doit savoir de la source pour en parler. */
|
|
32
|
+
digestHint?: string;
|
|
33
|
+
resourceType?: string;
|
|
34
|
+
/** Clause de grain, quand l'index melange plusieurs grains ou pays. */
|
|
35
|
+
filter?: unknown;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Les index des alertes de produit de l'app. Vide : l'API garde ceux du hub
|
|
40
|
+
* (fr_drugs_app). Facultatif dans le contrat : le layer le lit sans import
|
|
41
|
+
* nomme (cf. useAlerts), une app qui ne le declare pas garde son build.
|
|
42
|
+
*/
|
|
43
|
+
export const BRAND_ALERT_SOURCES: BrandAlertSource[] = [];
|
|
44
|
+
|
|
19
45
|
/** La source d'un evenement, nommee pour le journal. */
|
|
20
46
|
export function alertEventSourceLabel(
|
|
21
47
|
_docId: string | null | undefined,
|
|
@@ -14,6 +14,11 @@ import type { RmProjectKind } from "@tekkare/romulus/utils/projects";
|
|
|
14
14
|
|
|
15
15
|
const GERMANY = { fr: "Allemagne", en: "Germany" };
|
|
16
16
|
|
|
17
|
+
/** Source Directus des evaluations du G-BA (G-BA Beschluss-Info). */
|
|
18
|
+
export const GERMANY_GBA_SOURCE = "4fa70cd9-7918-47e9-920e-a2059b964519";
|
|
19
|
+
/** Source Directus du remboursement ambulatoire (GKV-Arzneimittelindex). */
|
|
20
|
+
export const GERMANY_GKV_SOURCE = "400181da-9d16-4b00-86d7-b9d03832a06e";
|
|
21
|
+
|
|
17
22
|
/** Index de Germany One, sur le cluster `drugs`. */
|
|
18
23
|
export const GERMANY_INDEX = {
|
|
19
24
|
gba: "ope__de_gba_benefit_assessment_drug_approvals__tekkare",
|