@tekkare/romulus 0.1.272 → 0.1.274

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/module.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "compatibility": {
5
5
  "nuxt": ">=3.16.0"
6
6
  },
7
- "version": "0.1.271",
7
+ "version": "0.1.273",
8
8
  "builder": {
9
9
  "@nuxt/module-builder": "0.8.4",
10
10
  "unbuild": "2.0.0"
@@ -23,6 +23,12 @@
23
23
  default — le corps (libelle, motif...)
24
24
  footer — pied pleine largeur, en retrait (provenance)
25
25
 
26
+ Placement du titre : en tete de carte par defaut, au-dessus du compteur et
27
+ de la zone de droite. `title-in-body` le pose en haut de la zone de droite,
28
+ aligne sur la rangee meta, avec les actions a sa droite : le compteur prend
29
+ alors toute la hauteur de la carte, et le titre se lit avec ce qu'il
30
+ resume plutot qu'au-dessus du chiffre.
31
+
26
32
  Classes utilitaires pour le contenu projete :
27
33
  .rm-rcard__label libelle en capitales (« DERNIER AVIS · 4 OCT. 2023 »)
28
34
  .rm-rcard__ref reference en monospace (« CT-20265 »)
@@ -79,6 +85,8 @@ withDefaults(
79
85
  * l'export, alors qu'un objet est recalcule a chaque rendu de la carte.
80
86
  */
81
87
  payload?: Partial<RmExportPayload> | (() => Partial<RmExportPayload> | null | undefined)
88
+ /** Titre en haut de la zone de droite, aligne sur la rangee meta, plutot qu'en tete de carte. */
89
+ titleInBody?: boolean
82
90
  }>(),
83
91
  {
84
92
  count: null,
@@ -91,13 +99,14 @@ withDefaults(
91
99
  link: undefined,
92
100
  lang: 'fr',
93
101
  payload: undefined,
102
+ titleInBody: false,
94
103
  },
95
104
  )
96
105
  </script>
97
106
 
98
107
  <template>
99
- <div class="rm-rcard" :class="{ 'rm-rcard--clickable': clickable, 'rm-rcard--dense': dense }">
100
- <div class="rm-rcard__head">
108
+ <div class="rm-rcard" :class="{ 'rm-rcard--clickable': clickable, 'rm-rcard--dense': dense, 'rm-rcard--title-in-body': titleInBody }">
109
+ <div v-if="!titleInBody" class="rm-rcard__head">
101
110
  <div class="rm-rcard__identity">
102
111
  <div v-if="$slots.code" class="rm-rcard__code"><slot name="code" /></div>
103
112
  <h3 class="rm-rcard__title"><slot name="title" /></h3>
@@ -127,6 +136,23 @@ withDefaults(
127
136
  </div>
128
137
 
129
138
  <div class="rm-rcard__main">
139
+ <div v-if="titleInBody" class="rm-rcard__main-head">
140
+ <div class="rm-rcard__identity">
141
+ <div v-if="$slots.code" class="rm-rcard__code"><slot name="code" /></div>
142
+ <h3 class="rm-rcard__title"><slot name="title" /></h3>
143
+ <div v-if="$slots.subtitle" class="rm-rcard__subtitle"><slot name="subtitle" /></div>
144
+ </div>
145
+ <div v-if="actions || $slots.actions" class="rm-rcard__actions">
146
+ <slot name="actions" />
147
+ <RmCardActions
148
+ v-if="actions"
149
+ :lang="lang"
150
+ :link="link"
151
+ :payload="payload"
152
+ :visual="false"
153
+ />
154
+ </div>
155
+ </div>
130
156
  <div v-if="$slots.meta" class="rm-rcard__meta"><slot name="meta" /></div>
131
157
  <slot />
132
158
  <p v-if="moreLabel" class="rm-rcard__more">{{ moreLabel }} →</p>
@@ -138,5 +164,5 @@ withDefaults(
138
164
  </template>
139
165
 
140
166
  <style scoped>
141
- .rm-rcard{background:var(--bg-surface);border:1px solid var(--border-default);border-radius:var(--radius-2xl);color:var(--text-primary);display:block;font-family:var(--font-sans);overflow:hidden;transition:border-color var(--duration-fast) linear,box-shadow var(--duration-fast) linear;width:100%}.rm-rcard--clickable{cursor:pointer}.rm-rcard--clickable:hover{border-color:color-mix(in srgb,var(--color-primary) 35%,var(--border-default));box-shadow:var(--shadow-md)}.rm-rcard__head{align-items:flex-start;display:flex;gap:var(--space-16);padding:var(--space-20) var(--space-24) 0}.rm-rcard__identity{flex:1 1 auto;min-width:0}.rm-rcard__code{display:flex;flex-wrap:wrap;gap:var(--space-8);margin-bottom:var(--space-8)}.rm-rcard__title{font-size:var(--font-18);font-weight:800;letter-spacing:.01em;margin:0}.rm-rcard__subtitle{color:var(--text-muted);font-size:var(--font-14);margin-top:4px;overflow-wrap:anywhere}.rm-rcard__actions{align-items:center;display:flex;flex:0 0 auto;gap:var(--space-8)}.rm-rcard__body{align-items:stretch;display:flex;gap:var(--space-24);padding:var(--space-16) var(--space-24) var(--space-20)}.rm-rcard__count{align-items:center;border-right:1px solid var(--border-default);display:flex;flex:0 0 128px;flex-direction:column;gap:var(--space-2);justify-content:center;padding-right:var(--space-24);text-align:center}.rm-rcard__count-value{color:var(--color-primary);font-size:var(--font-32);font-weight:var(--weight-bold);line-height:1.1;margin:0}.rm-rcard__count-label{color:var(--text-muted);font-size:var(--font-12);font-weight:var(--weight-semibold);letter-spacing:.08em;margin:0;text-transform:uppercase}.rm-rcard__count-extra{color:var(--color-primary);font-size:var(--font-13);line-height:1.3;margin:6px 0 0}.rm-rcard__count-extra+.rm-rcard__count-extra{margin-top:2px}.rm-rcard__main{display:flex;flex:1 1 auto;flex-direction:column;gap:var(--space-6);min-width:0}.rm-rcard__meta{align-items:center;display:flex;flex-wrap:wrap;gap:var(--space-8)}.rm-rcard__more{color:var(--color-primary);font-size:var(--font-14);font-weight:var(--weight-semibold);margin:4px 0 0}.rm-rcard__footer{background:var(--bg-surface-2);border-top:1px solid var(--border-default);font-size:var(--font-13);padding:var(--space-12) var(--space-24)}.rm-rcard :deep(.rm-rcard__label){align-items:center;color:var(--text-secondary);display:inline-flex;font-size:var(--font-12);font-weight:var(--weight-bold);gap:var(--space-4);letter-spacing:.06em;text-transform:uppercase}.rm-rcard :deep(.rm-rcard__ref){background:var(--bg-surface-3);border-radius:var(--radius-sm);color:var(--text-secondary);font-family:Courier New,monospace;font-size:var(--font-12);padding:var(--space-2) var(--space-8)}.rm-rcard :deep(.rm-rcard__lead){font-size:15px;font-weight:var(--weight-bold);margin:0}.rm-rcard :deep(.rm-rcard__text){font-size:15px;margin:0}.rm-rcard :deep(.rm-rcard__desc){color:var(--text-secondary);font-size:var(--font-14);line-height:1.5;margin:0}.rm-rcard :deep(.rm-rcard__clamp){display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}.rm-rcard--dense{border-radius:var(--radius-xl)}.rm-rcard--dense .rm-rcard__head{gap:var(--space-12);padding:var(--space-12) var(--space-16) 0}.rm-rcard--dense .rm-rcard__title{font-size:15px}.rm-rcard--dense .rm-rcard__subtitle{font-size:var(--font-13);margin-top:2px}.rm-rcard--dense .rm-rcard__body{gap:var(--space-16);padding:var(--space-8) var(--space-16) var(--space-12)}.rm-rcard--dense .rm-rcard__count{flex-basis:104px;padding-right:var(--space-16)}.rm-rcard--dense .rm-rcard__count-value{font-size:var(--font-24)}.rm-rcard--dense .rm-rcard__count-label{font-size:var(--font-11)}.rm-rcard--dense .rm-rcard__main{gap:var(--space-4)}.rm-rcard--dense .rm-rcard__count-extra,.rm-rcard--dense .rm-rcard__footer,.rm-rcard--dense .rm-rcard__main>:not(.rm-rcard__meta,.rm-rcard__lead){display:none}.rm-rcard--dense :deep(.rm-rcard__lead){display:-webkit-box;-webkit-line-clamp:1;-webkit-box-orient:vertical;overflow:hidden}.rm-rcard--dense .rm-rcard__body{align-items:center}.rm-rcard--dense :deep(.rm-rcard__lead),.rm-rcard--dense :deep(.rm-rcard__text){font-size:var(--font-14)}.rm-rcard--dense :deep(.rm-rcard__desc){font-size:var(--font-13)}
167
+ .rm-rcard{background:var(--bg-surface);border:1px solid var(--border-default);border-radius:var(--radius-2xl);color:var(--text-primary);display:block;font-family:var(--font-sans);overflow:hidden;transition:border-color var(--duration-fast) linear,box-shadow var(--duration-fast) linear;width:100%}.rm-rcard--clickable{cursor:pointer}.rm-rcard--clickable:hover{border-color:color-mix(in srgb,var(--color-primary) 35%,var(--border-default));box-shadow:var(--shadow-md)}.rm-rcard__head{align-items:flex-start;display:flex;gap:var(--space-16);padding:var(--space-20) var(--space-24) 0}.rm-rcard__identity{flex:1 1 auto;min-width:0}.rm-rcard__code{display:flex;flex-wrap:wrap;gap:var(--space-8);margin-bottom:var(--space-8)}.rm-rcard__title{font-size:var(--font-18);font-weight:800;letter-spacing:.01em;margin:0}.rm-rcard__subtitle{color:var(--text-muted);font-size:var(--font-14);margin-top:4px;overflow-wrap:anywhere}.rm-rcard__actions{align-items:center;display:flex;flex:0 0 auto;gap:var(--space-8)}.rm-rcard__body{align-items:stretch;display:flex;gap:var(--space-24);padding:var(--space-16) var(--space-24) var(--space-20)}.rm-rcard--title-in-body .rm-rcard__body{padding-top:var(--space-20)}.rm-rcard__main-head{align-items:flex-start;display:flex;gap:var(--space-16);margin-bottom:var(--space-8)}.rm-rcard__count{align-items:center;border-right:1px solid var(--border-default);display:flex;flex:0 0 128px;flex-direction:column;gap:var(--space-2);justify-content:center;padding-right:var(--space-24);text-align:center}.rm-rcard__count-value{color:var(--color-primary);font-size:var(--font-32);font-weight:var(--weight-bold);line-height:1.1;margin:0}.rm-rcard__count-label{color:var(--text-muted);font-size:var(--font-12);font-weight:var(--weight-semibold);letter-spacing:.08em;margin:0;text-transform:uppercase}.rm-rcard__count-extra{color:var(--color-primary);font-size:var(--font-13);line-height:1.3;margin:6px 0 0}.rm-rcard__count-extra+.rm-rcard__count-extra{margin-top:2px}.rm-rcard__main{display:flex;flex:1 1 auto;flex-direction:column;gap:var(--space-6);min-width:0}.rm-rcard__meta{align-items:center;display:flex;flex-wrap:wrap;gap:var(--space-8)}.rm-rcard__more{color:var(--color-primary);font-size:var(--font-14);font-weight:var(--weight-semibold);margin:4px 0 0}.rm-rcard__footer{background:var(--bg-surface-2);border-top:1px solid var(--border-default);font-size:var(--font-13);padding:var(--space-12) var(--space-24)}.rm-rcard :deep(.rm-rcard__label){align-items:center;color:var(--text-secondary);display:inline-flex;font-size:var(--font-12);font-weight:var(--weight-bold);gap:var(--space-4);letter-spacing:.06em;text-transform:uppercase}.rm-rcard :deep(.rm-rcard__ref){background:var(--bg-surface-3);border-radius:var(--radius-sm);color:var(--text-secondary);font-family:Courier New,monospace;font-size:var(--font-12);padding:var(--space-2) var(--space-8)}.rm-rcard :deep(.rm-rcard__lead){font-size:15px;font-weight:var(--weight-bold);margin:0}.rm-rcard :deep(.rm-rcard__text){font-size:15px;margin:0}.rm-rcard :deep(.rm-rcard__desc){color:var(--text-secondary);font-size:var(--font-14);line-height:1.5;margin:0}.rm-rcard :deep(.rm-rcard__clamp){display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}.rm-rcard--dense{border-radius:var(--radius-xl)}.rm-rcard--dense .rm-rcard__head{gap:var(--space-12);padding:var(--space-12) var(--space-16) 0}.rm-rcard--dense .rm-rcard__title{font-size:15px}.rm-rcard--dense .rm-rcard__subtitle{font-size:var(--font-13);margin-top:2px}.rm-rcard--dense .rm-rcard__body{gap:var(--space-16);padding:var(--space-8) var(--space-16) var(--space-12)}.rm-rcard--dense .rm-rcard__count{flex-basis:104px;padding-right:var(--space-16)}.rm-rcard--dense .rm-rcard__count-value{font-size:var(--font-24)}.rm-rcard--dense .rm-rcard__count-label{font-size:var(--font-11)}.rm-rcard--dense .rm-rcard__main{gap:var(--space-4)}.rm-rcard--dense .rm-rcard__count-extra,.rm-rcard--dense .rm-rcard__footer,.rm-rcard--dense .rm-rcard__main>:not(.rm-rcard__meta,.rm-rcard__lead){display:none}.rm-rcard--dense :deep(.rm-rcard__lead){display:-webkit-box;-webkit-line-clamp:1;-webkit-box-orient:vertical;overflow:hidden}.rm-rcard--dense .rm-rcard__body{align-items:center}.rm-rcard--dense :deep(.rm-rcard__lead),.rm-rcard--dense :deep(.rm-rcard__text){font-size:var(--font-14)}.rm-rcard--dense :deep(.rm-rcard__desc){font-size:var(--font-13)}
142
168
  </style>
@@ -0,0 +1,248 @@
1
+ <!--
2
+ Fiche d'une evaluation du benefice du G-BA (Germany One, type
3
+ DeGbaAssessment) : un groupe de patients d'une resolution, par son `_id`
4
+ (benefit_assessment_id). Puis les autres groupes de patients de la meme
5
+ marque, en bref : la page Drug Approvals de Germany One les montre ensemble.
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-germany">
12
+ <RmPageHeader :eyebrow="en ? 'G-BA benefit assessment' : 'Évaluation du bénéfice, G-BA'">
13
+ <template #title>
14
+ <span class="oip-germany__title">{{ brand || id }}</span>
15
+ <slot name="title-link" />
16
+ </template>
17
+ </RmPageHeader>
18
+
19
+ <div class="oip-germany__body">
20
+ <RmLoadingState v-if="loading" spinner />
21
+ <RmEmptyState v-else-if="!doc" icon="Prohibit" :title="en ? 'Assessment not found' : 'Évaluation introuvable'" />
22
+ <template v-else>
23
+ <div class="oip-germany__tags">
24
+ <RmTag :variant="benefitVariant(doc.added_benefit_en)">{{ doc.added_benefit_en || "N/A" }}</RmTag>
25
+ <RmTag v-if="doc.evidence_certainty_en" variant="gray">{{ doc.evidence_certainty_en }}</RmTag>
26
+ <RmTag v-if="doc.procedure_type_en" variant="fushia">{{ doc.procedure_type_en }}</RmTag>
27
+ <RmTag v-if="doc.is_orphan" variant="purple">{{ en ? "Orphan drug" : "Médicament orphelin" }}</RmTag>
28
+ <RmTag v-if="doc.is_atmp" variant="violet">ATMP</RmTag>
29
+ </div>
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>
70
+ </div>
71
+ </div>
72
+ </template>
73
+
74
+ <script setup lang="ts">
75
+ import { oipEsGet, oipEsSearch } from "../../composables/useOipResources";
76
+ import { GERMANY_INDEX } from "../../oip-germany/kinds";
77
+
78
+ const props = withDefaults(
79
+ defineProps<{
80
+ /** Le `resourceId` : `_id` de l'evaluation (benefit_assessment_id). */
81
+ id: string;
82
+ type?: string;
83
+ lang?: "fr" | "en";
84
+ highlight?: string[];
85
+ }>(),
86
+ { type: "DeGbaAssessment", lang: "en", highlight: () => [] },
87
+ );
88
+
89
+ const en = computed(() => props.lang !== "fr");
90
+ const loading = ref(true);
91
+ const doc = ref<Record<string, any> | null>(null);
92
+ const others = ref<Record<string, any>[]>([]);
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
+ }
146
+
147
+ async function read() {
148
+ loading.value = true;
149
+ doc.value = null;
150
+ others.value = [];
151
+ const hit = await oipEsGet<any>("drugs", GERMANY_INDEX.gba, props.id).catch(() => null);
152
+ doc.value = hit?._source ?? null;
153
+ const brands = [].concat(doc.value?.brand_name ?? []).filter(Boolean);
154
+ if (brands.length) {
155
+ const res = await oipEsSearch<any>("drugs", GERMANY_INDEX.gba, {
156
+ size: 100,
157
+ _source: ["benefit_assessment_id", "patient_group_en", "patient_group_de", "added_benefit_en", "valid_from"],
158
+ query: { terms: { "brand_name.keyword": brands } },
159
+ sort: [{ valid_from: "desc" }],
160
+ }).catch(() => null);
161
+ others.value = (res?.hits?.hits ?? [])
162
+ .map((h: any) => h._source)
163
+ .filter((s: any) => String(s.benefit_assessment_id) !== props.id);
164
+ }
165
+ loading.value = false;
166
+ }
167
+
168
+ watch(() => props.id, read, { immediate: true });
169
+ </script>
170
+
171
+ <style scoped>
172
+ .oip-germany__body {
173
+ display: flex;
174
+ flex-direction: column;
175
+ gap: var(--space-16);
176
+ padding: var(--space-20) var(--space-32) var(--space-32);
177
+ }
178
+ .oip-germany__title {
179
+ 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
+ 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
+ }
248
+ </style>
@@ -0,0 +1,169 @@
1
+ <!--
2
+ Fiche d'une molecule du remboursement ambulatoire allemand (Germany One,
3
+ type DeGkvMolecule) : son document ATC5 par son `_id` (de_<ATC5>_), les
4
+ chiffres cles de la derniere annee contre la precedente, les cinq
5
+ indicateurs annee par annee, puis ses marques sur la derniere annee.
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-germany">
12
+ <RmPageHeader :eyebrow="en ? 'Ambulatory reimbursement, Germany (GKV)' : 'Remboursement ambulatoire, Allemagne (GKV)'">
13
+ <template #title>
14
+ <span class="oip-germany__title">{{ doc?.concat_label_code || id }}</span>
15
+ <slot name="title-link" />
16
+ </template>
17
+ </RmPageHeader>
18
+
19
+ <div class="oip-germany__body">
20
+ <RmLoadingState v-if="loading" spinner />
21
+ <RmEmptyState v-else-if="!doc" icon="Prohibit" :title="en ? 'Molecule not found' : 'Molécule introuvable'" />
22
+ <template v-else>
23
+ <div v-if="last" class="oip-germany__kpis">
24
+ <RmKpi
25
+ v-for="kpi in kpis"
26
+ :key="kpi.label"
27
+ :label="kpi.label"
28
+ :value="kpi.value"
29
+ :unit="kpi.unit"
30
+ :trend="kpi.trend"
31
+ :note="kpi.note"
32
+ />
33
+ </div>
34
+
35
+ <RmTableCard :lang="lang" :actions="false">
36
+ <template #header>
37
+ <h3 class="rm-table-card__title">{{ en ? "Indicators by year" : "Indicateurs par année" }}</h3>
38
+ </template>
39
+ <RmTable :columns="yearColumns" :rows="yearRows" compact flat max-height="none" :empty-text="en ? 'No data' : 'Aucune donnée'" />
40
+ </RmTableCard>
41
+
42
+ <RmTableCard v-if="brandRows.length" :lang="lang" :actions="false">
43
+ <template #header>
44
+ <h3 class="rm-table-card__title">{{ en ? `Brands, ${last?.period}` : `Marques, ${last?.period}` }}</h3>
45
+ </template>
46
+ <RmTable :columns="brandColumns" :rows="brandRows" compact flat max-height="400px" :empty-text="en ? 'No data' : 'Aucune donnée'" />
47
+ </RmTableCard>
48
+ </template>
49
+ </div>
50
+ </div>
51
+ </template>
52
+
53
+ <script setup lang="ts">
54
+ import { oipEsGet, oipEsSearch } from "../../composables/useOipResources";
55
+ import { GERMANY_INDEX } from "../../oip-germany/kinds";
56
+
57
+ const props = withDefaults(
58
+ defineProps<{
59
+ /** Le `resourceId` : `_id` du document ATC5 (de_<ATC5>_). */
60
+ id: string;
61
+ type?: string;
62
+ lang?: "fr" | "en";
63
+ highlight?: string[];
64
+ }>(),
65
+ { type: "DeGkvMolecule", lang: "en", highlight: () => [] },
66
+ );
67
+
68
+ type Year = Record<string, number> & { period: number };
69
+
70
+ const METRICS = [
71
+ { key: "package", en: "Packages", fr: "Boîtes", money: false },
72
+ { key: "daily_dose", en: "Defined daily doses", fr: "Doses journalières", money: false },
73
+ { key: "net_cost", en: "Net cost (€)", fr: "Coût net (€)", money: true },
74
+ { key: "net_cost_daily_dose", en: "Net cost per daily dose (€)", fr: "Coût net par dose (€)", money: true },
75
+ { key: "net_cost_prescription", en: "Net cost per prescription (€)", fr: "Coût net par prescription (€)", money: true },
76
+ ];
77
+
78
+ const en = computed(() => props.lang !== "fr");
79
+ const loading = ref(true);
80
+ const doc = ref<Record<string, any> | null>(null);
81
+ const brands = ref<Record<string, any>[]>([]);
82
+
83
+ const fmt = (value: unknown, digits = 0) =>
84
+ typeof value === "number" ? value.toLocaleString(en.value ? "en-US" : "fr-FR", { maximumFractionDigits: digits }) : "-";
85
+
86
+ const years = computed<Year[]>(() =>
87
+ [...((doc.value?.total_level ?? []) as Year[])].sort((a, b) => Number(a.period) - Number(b.period)),
88
+ );
89
+ const last = computed(() => years.value.at(-1) ?? null);
90
+ const previous = computed(() => years.value.at(-2) ?? null);
91
+
92
+ const growth = (a?: number, b?: number) => (a && b !== undefined ? Number((((b - a) / a) * 100).toFixed(1)) : undefined);
93
+
94
+ const kpis = computed(() =>
95
+ METRICS.slice(0, 3).map((metric) => ({
96
+ label: `${en.value ? metric.en : metric.fr}, ${last.value?.period}`,
97
+ value: fmt(last.value?.[metric.key]),
98
+ unit: undefined,
99
+ trend: growth(previous.value?.[metric.key], last.value?.[metric.key]),
100
+ note: previous.value ? `${en.value ? "vs" : "contre"} ${fmt(previous.value[metric.key])} ${en.value ? "in" : "en"} ${previous.value.period}` : undefined,
101
+ })),
102
+ );
103
+
104
+ const yearColumns = computed(() => [
105
+ { key: "metric", label: en.value ? "Indicator" : "Indicateur", rowHeader: true, minWidth: "220px" },
106
+ ...years.value.map((y) => ({ key: String(y.period), label: String(y.period), numeric: true })),
107
+ ]);
108
+ const yearRows = computed(() =>
109
+ METRICS.map((metric) => ({
110
+ metric: en.value ? metric.en : metric.fr,
111
+ ...Object.fromEntries(years.value.map((y) => [String(y.period), fmt(y[metric.key], metric.money ? 2 : 0)])),
112
+ })),
113
+ );
114
+
115
+ const brandColumns = computed(() => [
116
+ { key: "brand", label: en.value ? "Brand" : "Marque", rowHeader: true },
117
+ { key: "package", label: en.value ? "Packages" : "Boîtes", numeric: true },
118
+ { key: "net_cost", label: en.value ? "Net cost (€)" : "Coût net (€)", numeric: true },
119
+ ]);
120
+ const brandRows = computed(() => {
121
+ const period = last.value?.period;
122
+ return brands.value
123
+ .map((b) => {
124
+ const year = (b.total_level ?? []).find((y: Year) => Number(y.period) === Number(period));
125
+ return { brand: b.label, packageRaw: year?.package ?? 0, package: fmt(year?.package), net_cost: fmt(year?.net_cost) };
126
+ })
127
+ .filter((row) => row.packageRaw > 0)
128
+ .sort((a, b) => b.packageRaw - a.packageRaw);
129
+ });
130
+
131
+ async function read() {
132
+ loading.value = true;
133
+ doc.value = null;
134
+ brands.value = [];
135
+ const hit = await oipEsGet<any>("drugs", GERMANY_INDEX.gkv, props.id).catch(() => null);
136
+ doc.value = hit?._source ?? null;
137
+ const molecule = doc.value?.concat_label_code;
138
+ if (molecule) {
139
+ const res = await oipEsSearch<any>("drugs", GERMANY_INDEX.gkv, {
140
+ size: 500,
141
+ _source: ["label", "total_level"],
142
+ query: {
143
+ bool: { must: [{ term: { "type.keyword": "brand" } }, { term: { "concat_label_code.keyword": molecule } }] },
144
+ },
145
+ }).catch(() => null);
146
+ brands.value = (res?.hits?.hits ?? []).map((h: any) => h._source);
147
+ }
148
+ loading.value = false;
149
+ }
150
+
151
+ watch(() => props.id, read, { immediate: true });
152
+ </script>
153
+
154
+ <style scoped>
155
+ .oip-germany__body {
156
+ display: flex;
157
+ flex-direction: column;
158
+ gap: var(--space-16);
159
+ padding: var(--space-20) var(--space-32) var(--space-32);
160
+ }
161
+ .oip-germany__title {
162
+ margin-right: var(--space-12);
163
+ }
164
+ .oip-germany__kpis {
165
+ display: grid;
166
+ grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
167
+ gap: var(--space-12);
168
+ }
169
+ </style>
@@ -101,6 +101,8 @@ const VIEW_LOADERS: Record<string, () => Promise<any>> = {
101
101
  "drugs-association-fiche": () => import("../components/oip-drugs/fiches/AssociationFiche.vue"),
102
102
  "patients-patient": () => import("../components/oip-patients/PatientFiche.vue"),
103
103
  "patients-vaccine": () => import("../components/oip-patients/VaccineFiche.vue"),
104
+ "germany-gba": () => import("../components/oip-germany/GbaAssessment.vue"),
105
+ "germany-molecule": () => import("../components/oip-germany/GkvMolecule.vue"),
104
106
  };
105
107
 
106
108
  const cache = new Map<string, Component>();
@@ -2,7 +2,7 @@
2
2
  * Les familles que Germany One range dans un projet, decrites pour tout le
3
3
  * portail : evaluations du benefice du G-BA et molecules du remboursement
4
4
  * ambulatoire (GKV). Pas de vue dediee : la ligne du projet mene a la page de
5
- * l'app, le tiroir montre l'en-tete et le lien vers Germany One.
5
+ * l'app ; le tiroir monte la fiche du layer (components/oip-germany).
6
6
  *
7
7
  * Index lus sur le cluster `drugs` (meme domaine que fr_drugs_app ; chaque app
8
8
  * y joint sa propre cle, cf. runtimeConfig.oipEs.drugs).
@@ -14,6 +14,12 @@ import type { RmProjectKind } from "@tekkare/romulus/utils/projects";
14
14
 
15
15
  const GERMANY = { fr: "Allemagne", en: "Germany" };
16
16
 
17
+ /** Index de Germany One, sur le cluster `drugs`. */
18
+ export const GERMANY_INDEX = {
19
+ gba: "ope__de_gba_benefit_assessment_drug_approvals__tekkare",
20
+ gkv: "ope_de_retail_national_tekkare",
21
+ };
22
+
17
23
  const list = (value: unknown) => (Array.isArray(value) ? value.filter(Boolean).join(", ") : String(value ?? ""));
18
24
 
19
25
  export const GERMANY_PROJECT_KINDS: RmProjectKind[] = [
@@ -21,7 +27,7 @@ export const GERMANY_PROJECT_KINDS: RmProjectKind[] = [
21
27
  // Une evaluation = un groupe de patients d'une resolution du G-BA
22
28
  // (`_id` = benefit_assessment_id). Une carte marque en range plusieurs.
23
29
  type: "DeGbaAssessment",
24
- index: "ope__de_gba_benefit_assessment_drug_approvals__tekkare",
30
+ index: GERMANY_INDEX.gba,
25
31
  label: { fr: "Évaluations du G-BA", en: "G-BA assessments" },
26
32
  section: GERMANY,
27
33
  icon: "Certificate",
@@ -36,7 +42,7 @@ export const GERMANY_PROJECT_KINDS: RmProjectKind[] = [
36
42
  {
37
43
  // Une molecule ATC5 de l'index GKV (`_id` = de_<ATC5>_).
38
44
  type: "DeGkvMolecule",
39
- index: "ope_de_retail_national_tekkare",
45
+ index: GERMANY_INDEX.gkv,
40
46
  label: { fr: "Molécules (GKV)", en: "Molecules (GKV)" },
41
47
  section: GERMANY,
42
48
  icon: "Pill",
@@ -160,10 +160,11 @@ function patientsSpec(kind: RmProjectKind, view: string): OipResourceSpec {
160
160
  }
161
161
 
162
162
  /**
163
- * Une fiche de Germany One, lue sur le cluster `drugs`. Sans vue ni onglets :
164
- * la ligne du projet mene a la page de l'app qui la montre.
163
+ * Une fiche de Germany One, lue sur le cluster `drugs` et montree d'un seul
164
+ * tenant (components/oip-germany) ; la ligne du projet mene a la page de
165
+ * l'app qui la liste.
165
166
  */
166
- function germanySpec(kind: RmProjectKind): OipResourceSpec {
167
+ function germanySpec(kind: RmProjectKind, view: string): OipResourceSpec {
167
168
  return {
168
169
  type: kind.type,
169
170
  app: "germany_one_app",
@@ -172,6 +173,7 @@ function germanySpec(kind: RmProjectKind): OipResourceSpec {
172
173
  routeId: (id) => id,
173
174
  base: () => "",
174
175
  tabs: [],
176
+ view,
175
177
  detailPath: (id, _tab, doc) => kind.path?.(doc ?? {}, id) ?? "",
176
178
  };
177
179
  }
@@ -193,6 +195,12 @@ function italySpec(kind: RmProjectKind): OipResourceSpec {
193
195
  };
194
196
  }
195
197
 
198
+ /** La fiche de chaque famille de Germany One (cf. useOipResourceViews). */
199
+ const GERMANY_VIEWS: Record<string, string> = {
200
+ DeGbaAssessment: "germany-gba",
201
+ DeGkvMolecule: "germany-molecule",
202
+ };
203
+
196
204
  /** La vue de chaque famille de fr_drugs_app (cf. useOipResourceViews). */
197
205
  const DRUG_VIEWS: Record<string, string> = {
198
206
  FrHasBrand: "drugs-brand",
@@ -423,7 +431,7 @@ export const OIP_RESOURCE_SPECS: OipResourceSpec[] = [
423
431
  ...DRUG_PROJECT_KINDS.map((kind) => drugsSpec(kind, DRUG_VIEWS[kind.type]!)),
424
432
  patientsSpec(PATIENT_KIND, "patients-patient"),
425
433
  patientsSpec(VACCINE_KIND, "patients-vaccine"),
426
- ...GERMANY_PROJECT_KINDS.map(germanySpec),
434
+ ...GERMANY_PROJECT_KINDS.map((kind) => germanySpec(kind, GERMANY_VIEWS[kind.type]!)),
427
435
  ...ITALY_PROJECT_KINDS.map(italySpec),
428
436
  ];
429
437
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tekkare/romulus",
3
- "version": "0.1.272",
3
+ "version": "0.1.274",
4
4
  "description": "Romulus Design System - Nuxt module by Tekkare",
5
5
  "license": "MIT",
6
6
  "type": "module",