@tekkare/romulus 0.1.275 → 0.1.277

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.274",
7
+ "version": "0.1.276",
8
8
  "builder": {
9
9
  "@nuxt/module-builder": "0.8.4",
10
10
  "unbuild": "2.0.0"
@@ -199,7 +199,9 @@ function onTitle(event: MouseEvent, row: RmProjectResource) {
199
199
  <span v-else>{{ row.title || T.unknown(row.id) }}</span>
200
200
  </p>
201
201
  <p v-if="row.subtitle" class="rm-project-res__sub">{{ row.subtitle }}</p>
202
- <p v-if="meta(row)" class="rm-project-res__meta">{{ meta(row) }}</p>
202
+ <p v-if="meta(row)" class="rm-project-res__meta">
203
+ <RmFlag v-if="row.country" :code="row.country" :height="10" class="rm-project-res__flag" />{{ meta(row) }}
204
+ </p>
203
205
  </div>
204
206
 
205
207
  <RmBadge variant="info" class="rm-project-res__family">{{ row.family }}</RmBadge>
@@ -251,5 +253,5 @@ function onTitle(event: MouseEvent, row: RmProjectResource) {
251
253
  </template>
252
254
 
253
255
  <style scoped>
254
- .rm-project-res{display:flex;flex-direction:column;gap:16px}.rm-project-res__search{flex:0 1 360px;min-width:160px}.rm-project-res__chips{display:flex;flex-wrap:wrap;gap:6px}.rm-project-res__chip-count{background:var(--bg-surface-3);border-radius:999px;color:var(--text-secondary);font-size:10px;font-weight:700;padding:1px 6px}.toolbar-pill--active .rm-project-res__chip-count{background:hsla(0,0%,100%,.25);color:var(--color-text-inverse)}.rm-project-res__head{display:flex;flex-direction:column;gap:4px;margin-bottom:8px}.rm-project-res__title{color:var(--text-primary);font-size:15px;font-weight:var(--weight-bold);margin:0}.rm-project-res__context{color:var(--text-muted);font-size:12px;margin:0}.rm-project-res__list{display:flex;flex-direction:column;list-style:none;margin:0;padding:0}.rm-project-res__item{align-items:center;border-bottom:1px solid var(--border-soft,var(--border-default));display:flex;gap:12px;padding:10px 0}.rm-project-res__item:last-child{border-bottom:none}.rm-project-res__icon{align-items:center;background:var(--bg-surface-3);border-radius:var(--radius-lg,8px);color:var(--text-secondary);display:flex;flex:none;height:34px;justify-content:center;width:34px}.rm-project-res__text{flex:1;min-width:0}.rm-project-res__item-title{align-items:center;color:var(--text-primary);display:flex;font-size:13px;font-weight:var(--weight-semibold);gap:6px;margin:0}.rm-project-res__item-title a{color:var(--color-primary);text-decoration:underline;text-underline-offset:2px}.rm-project-res__comment{display:inline-flex;position:relative}.rm-project-res__count{background:var(--color-primary);border-radius:9999px;color:#fff;font-size:var(--font-10);font-weight:700;height:16px;line-height:16px;min-width:16px;padding:0 var(--space-4);pointer-events:none;position:absolute;right:-4px;text-align:center;top:-4px}.rm-project-res__sub{color:var(--text-secondary);font-size:12px;margin:2px 0 0}.rm-project-res__meta{color:var(--text-muted);font-size:11px;margin:2px 0 0}.rm-project-res__family{flex:none}.rm-project-res__actions{align-items:center;display:flex;flex:none;gap:2px}.rm-project-res__none{align-items:center;color:var(--text-secondary);display:flex;font-size:13px;gap:6px;margin:8px 0}
256
+ .rm-project-res{display:flex;flex-direction:column;gap:16px}.rm-project-res__search{flex:0 1 360px;min-width:160px}.rm-project-res__chips{display:flex;flex-wrap:wrap;gap:6px}.rm-project-res__chip-count{background:var(--bg-surface-3);border-radius:999px;color:var(--text-secondary);font-size:10px;font-weight:700;padding:1px 6px}.toolbar-pill--active .rm-project-res__chip-count{background:hsla(0,0%,100%,.25);color:var(--color-text-inverse)}.rm-project-res__head{display:flex;flex-direction:column;gap:4px;margin-bottom:8px}.rm-project-res__title{color:var(--text-primary);font-size:15px;font-weight:var(--weight-bold);margin:0}.rm-project-res__context{color:var(--text-muted);font-size:12px;margin:0}.rm-project-res__list{display:flex;flex-direction:column;list-style:none;margin:0;padding:0}.rm-project-res__item{align-items:center;border-bottom:1px solid var(--border-soft,var(--border-default));display:flex;gap:12px;padding:10px 0}.rm-project-res__item:last-child{border-bottom:none}.rm-project-res__icon{align-items:center;background:var(--bg-surface-3);border-radius:var(--radius-lg,8px);color:var(--text-secondary);display:flex;flex:none;height:34px;justify-content:center;width:34px}.rm-project-res__text{flex:1;min-width:0}.rm-project-res__item-title{align-items:center;color:var(--text-primary);display:flex;font-size:13px;font-weight:var(--weight-semibold);gap:6px;margin:0}.rm-project-res__item-title a{color:var(--color-primary);text-decoration:underline;text-underline-offset:2px}.rm-project-res__comment{display:inline-flex;position:relative}.rm-project-res__count{background:var(--color-primary);border-radius:9999px;color:#fff;font-size:var(--font-10);font-weight:700;height:16px;line-height:16px;min-width:16px;padding:0 var(--space-4);pointer-events:none;position:absolute;right:-4px;text-align:center;top:-4px}.rm-project-res__sub{color:var(--text-secondary);font-size:12px;margin:2px 0 0}.rm-project-res__meta{align-items:center;color:var(--text-muted);display:flex;font-size:11px;gap:5px;margin:2px 0 0}.rm-project-res__family,.rm-project-res__flag{flex:none}.rm-project-res__actions{align-items:center;display:flex;flex:none;gap:2px}.rm-project-res__none{align-items:center;color:var(--text-secondary);display:flex;font-size:13px;gap:6px;margin:8px 0}
255
257
  </style>
@@ -61,6 +61,12 @@ export interface RmProjectKind<S = any> {
61
61
  label: Record<RmProjectLang, string>;
62
62
  /** Rubrique de l'app d'ou vient la famille (Essais, Publications...). */
63
63
  section?: Record<RmProjectLang, string>;
64
+ /**
65
+ * Pays de la donnee, code ISO 3166-1 alpha-2 (« it », « de »). La ligne du
66
+ * projet pose son drapeau devant la source : un projet melange des pays, le
67
+ * drapeau se repere plus vite qu'un libelle.
68
+ */
69
+ country?: string;
64
70
  /** Icone Phosphor. */
65
71
  icon: string;
66
72
  /** Champs a relire. Absent : le document entier. */
@@ -93,6 +99,8 @@ export interface RmProjectResource {
93
99
  /** Cle de la famille affichee (cf. RmProjectKind.group) ; `type` reste celui de l'API. */
94
100
  group?: string;
95
101
  section?: string;
102
+ /** Pays de la donnee (ISO alpha-2), cf. RmProjectKind.country. */
103
+ country?: string;
96
104
  icon: string;
97
105
  createdAt?: string;
98
106
  comments?: number;
@@ -91,6 +91,7 @@ export function rmProjectRows(items, documents, kinds, lang = "fr") {
91
91
  family: kind ? kind.label[lang] : item.resourceType,
92
92
  group: kind?.group ?? item.resourceType,
93
93
  section: kind?.section?.[lang],
94
+ country: kind?.country,
94
95
  icon: kind?.icon ?? "Question",
95
96
  createdAt: item.createdAt,
96
97
  comments: item.commentsCount ?? 0,
@@ -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,
@@ -66,6 +66,7 @@ export const DRUG_PROJECT_KINDS: RmProjectKind[] = [
66
66
  index: ES_INDEX.BRAND_HAS,
67
67
  label: { fr: "Avis HAS", en: "HAS opinions" },
68
68
  section: HAS,
69
+ country: "fr",
69
70
  icon: "Certificate",
70
71
  // Molecule et ATC5 vivent dans chaque avis : le cadrage du projet les lit.
71
72
  source: ["brand_group", "last_opinion_date", "brand_history.molecule", "brand_history.atc5_code"],
@@ -78,6 +79,7 @@ export const DRUG_PROJECT_KINDS: RmProjectKind[] = [
78
79
  index: ES_INDEX.INDICATION_SEARCH_HAS,
79
80
  label: { fr: "Indications (LES / APAC)", en: "Indications (LES / APAC)" },
80
81
  section: HAS,
82
+ country: "fr",
81
83
  icon: "ListChecks",
82
84
  source: ["brand", "indication", "indication_fr", "indication_en", "indication_label_fr", "french_label", "card_id"],
83
85
  title: (s, l) => loc(s, "indication", l) || s?.indication_label_fr || s?.french_label || "",
@@ -92,6 +94,7 @@ export const DRUG_PROJECT_KINDS: RmProjectKind[] = [
92
94
  index: ES_INDEX.PUT_HAS,
93
95
  label: { fr: "P.U.T", en: "P.U.T" },
94
96
  section: HAS,
97
+ country: "fr",
95
98
  icon: "ClipboardText",
96
99
  source: ["brand", "dci", "aap_type_fr", "aap_type_en", "authorization_date"],
97
100
  title: (s) => list(s?.brand),
@@ -103,6 +106,7 @@ export const DRUG_PROJECT_KINDS: RmProjectKind[] = [
103
106
  index: ES_INDEX.MITM_BDPM,
104
107
  label: { fr: "MITM", en: "MITM" },
105
108
  section: HAS,
109
+ country: "fr",
106
110
  icon: "FirstAid",
107
111
  source: ["brand", "cis_label", "cis_code", "atc5_french_code_label", "atc5_english_code_label", "owner_regroup"],
108
112
  title: (s) => s?.cis_label ?? s?.brand ?? "",
@@ -115,6 +119,7 @@ export const DRUG_PROJECT_KINDS: RmProjectKind[] = [
115
119
  index: ES_INDEX.PNDS,
116
120
  label: { fr: "PNDS", en: "PNDS" },
117
121
  section: HAS,
122
+ country: "fr",
118
123
  icon: "FileText",
119
124
  source: ["pathology_fr", "pathology_en", "protocol_id", "protocol_date"],
120
125
  title: (s, l) => loc(s, "pathology", l),
@@ -126,6 +131,7 @@ export const DRUG_PROJECT_KINDS: RmProjectKind[] = [
126
131
  index: ES_INDEX.DRUG_CARDS,
127
132
  label: { fr: "Prix", en: "Prices" },
128
133
  section: PRICES,
134
+ country: "fr",
129
135
  icon: "CurrencyEur",
130
136
  source: ["brand", "label", "local_drug_id", "last_price_update"],
131
137
  title: (s) => s?.label ?? s?.brand ?? "",
@@ -137,6 +143,7 @@ export const DRUG_PROJECT_KINDS: RmProjectKind[] = [
137
143
  index: ES_INDEX.DRUG_CARDS_PRICE_JO,
138
144
  label: { fr: "Publications JO", en: "Official journal" },
139
145
  section: PRICES,
146
+ country: "fr",
140
147
  icon: "Newspaper",
141
148
  source: ["brand", "label", "local_drug_id", "jo", "update_date"],
142
149
  title: (s) => s?.label ?? s?.brand ?? "",
@@ -148,6 +155,7 @@ export const DRUG_PROJECT_KINDS: RmProjectKind[] = [
148
155
  index: ES_INDEX.CIS_ANSM,
149
156
  label: { fr: "Autorisations ANSM", en: "ANSM authorizations" },
150
157
  section: { fr: "ANSM", en: "ANSM" },
158
+ country: "fr",
151
159
  icon: "Pill",
152
160
  source: ["brand", "cis_label", "cis_code", "amm_status", "owner_regroup"],
153
161
  title: (s) => s?.cis_label ?? s?.brand ?? "",
@@ -159,6 +167,7 @@ export const DRUG_PROJECT_KINDS: RmProjectKind[] = [
159
167
  index: ES_INDEX.ASSOCIATION_DIRECTORY,
160
168
  label: { fr: "Associations de patients", en: "Patient associations" },
161
169
  section: ASSOCIATIONS,
170
+ country: "fr",
162
171
  icon: "UsersThree",
163
172
  source: ["association_label_regroup", "association_label", "has_contribution_count"],
164
173
  title: (s) => s?.association_label_regroup ?? "",
@@ -172,6 +181,7 @@ export const DRUG_PROJECT_KINDS: RmProjectKind[] = [
172
181
  index: ES_INDEX.ASSOCIATION_CONTRIBUTION_HAS,
173
182
  label: { fr: "Contributions patients", en: "Patient contributions" },
174
183
  section: ASSOCIATIONS,
184
+ country: "fr",
175
185
  icon: "ChatsCircle",
176
186
  source: ["association_label_regroup", "has_code", "request_nature", "contribution_date", "contribution_url"],
177
187
  // `brand_group` vient de l'index HAS (cf. withContributionBrands).
@@ -193,6 +203,7 @@ export const DRUG_PROJECT_KINDS: RmProjectKind[] = [
193
203
  index: ES_INDEX.ASSOCIATION_COMMISSION_SESSION_NATIONAL_ASSEMBLY,
194
204
  label: { fr: "Assemblée nationale", en: "National Assembly" },
195
205
  section: ASSOCIATIONS,
206
+ country: "fr",
196
207
  icon: "Bank",
197
208
  source: ["agenda", "parliamentary_session", "session_date"],
198
209
  title: (s) => s?.agenda ?? "",
@@ -204,6 +215,7 @@ export const DRUG_PROJECT_KINDS: RmProjectKind[] = [
204
215
  index: ES_INDEX.RETAIL_MONTHLY_BRAND,
205
216
  label: { fr: "Medic'AM (marques)", en: "Medic'AM (brands)" },
206
217
  section: { fr: "Médicaments", en: "Drugs" },
218
+ country: "fr",
207
219
  icon: "ChartLine",
208
220
  source: ["code", "period"],
209
221
  title: (s) => s?.code ?? "",
@@ -219,6 +231,7 @@ export const DRUG_PROJECT_KINDS: RmProjectKind[] = [
219
231
  index: ES_INDEX.OUTPATIENT_BRAND,
220
232
  label: { fr: "Outpatient (marques)", en: "Outpatient (brands)" },
221
233
  section: { fr: "Outpatient (PHMEV)", en: "Outpatient (PHMEV)" },
234
+ country: "fr",
222
235
  icon: "Hospital",
223
236
  source: ["code", "max_period"],
224
237
  title: (s) => s?.code ?? "",
@@ -236,6 +249,7 @@ export const DRUG_PROJECT_KINDS: RmProjectKind[] = [
236
249
  index: ES_INDEX.HOSPITAL_ANNUAL_SUS,
237
250
  label: { fr: "Liste en sus (marques)", en: "Inpatient list (brands)" },
238
251
  section: HOSPITAL,
252
+ country: "fr",
239
253
  icon: "Bed",
240
254
  source: ["code", "period"],
241
255
  title: (s) => s?.code ?? "",
@@ -251,6 +265,7 @@ export const DRUG_PROJECT_KINDS: RmProjectKind[] = [
251
265
  index: ES_INDEX.HOSPITAL_ANNUAL_RETROCESSION,
252
266
  label: { fr: "Rétrocession (marques)", en: "Retrocession (brands)" },
253
267
  section: HOSPITAL,
268
+ country: "fr",
254
269
  icon: "FirstAid",
255
270
  source: ["code", "period"],
256
271
  title: (s) => s?.code ?? "",
@@ -30,6 +30,7 @@ export const GERMANY_PROJECT_KINDS: RmProjectKind[] = [
30
30
  index: GERMANY_INDEX.gba,
31
31
  label: { fr: "Évaluations du G-BA", en: "G-BA assessments" },
32
32
  section: GERMANY,
33
+ country: "de",
33
34
  icon: "Certificate",
34
35
  source: ["brand_name", "active_substance", "patient_group_en", "added_benefit_en", "valid_from"],
35
36
  title: (s) => list(s?.brand_name),
@@ -45,6 +46,7 @@ export const GERMANY_PROJECT_KINDS: RmProjectKind[] = [
45
46
  index: GERMANY_INDEX.gkv,
46
47
  label: { fr: "Molécules (GKV)", en: "Molecules (GKV)" },
47
48
  section: GERMANY,
49
+ country: "de",
48
50
  icon: "Pill",
49
51
  source: ["concat_label_code", "atc5_label", "atc5_code"],
50
52
  title: (s) => String(s?.concat_label_code ?? ""),
@@ -25,6 +25,7 @@ export const ITALY_PROJECT_KINDS: RmProjectKind[] = [
25
25
  index: "it__drug_opinion__aifa",
26
26
  label: { fr: "Actes de l'AIFA", en: "AIFA acts" },
27
27
  section: ITALY,
28
+ country: "it",
28
29
  icon: "Certificate",
29
30
  source: ["brand", "molecule", "nature_of_request", "nature_of_request_en", "decision_date", "has_code"],
30
31
  title: (s) => String(s?.brand ?? ""),
@@ -41,6 +42,7 @@ export const ITALY_PROJECT_KINDS: RmProjectKind[] = [
41
42
  index: "ope__ww_price_tracker__tekkare",
42
43
  label: { fr: "Prix (Italie)", en: "Prices (Italy)" },
43
44
  section: ITALY,
45
+ country: "it",
44
46
  icon: "Tag",
45
47
  source: ["brand", "label_local", "local_drug_id", "manufacturer_regroup", "manufacturer"],
46
48
  title: (s) => String(s?.label_local ?? s?.brand ?? ""),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tekkare/romulus",
3
- "version": "0.1.275",
3
+ "version": "0.1.277",
4
4
  "description": "Romulus Design System - Nuxt module by Tekkare",
5
5
  "license": "MIT",
6
6
  "type": "module",