@tekkare/romulus 0.1.259 → 0.1.260

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.258",
7
+ "version": "0.1.259",
8
8
  "builder": {
9
9
  "@nuxt/module-builder": "0.8.4",
10
10
  "unbuild": "2.0.0"
@@ -79,14 +79,23 @@
79
79
  :data="row.doc"
80
80
  :linked-euct="row.linked"
81
81
  :highlight="highlight"
82
+ :class="{ linked_priority: isPriority(row) }"
82
83
  >
83
84
  <template #extra>
85
+ <RmTag v-if="isPriority(row)" variant="indigo">{{ priority?.label }}</RmTag>
84
86
  <RmTag v-if="row.extra?.role" variant="gray">{{ row.extra.role }}</RmTag>
85
87
  <OipScienceCommonScoreBadge :score="row.extra?.score" />
86
88
  </template>
87
89
  </OipScienceClinicalTrialsCardsGlobal>
88
- <OipScienceClinicalTrialsCards v-else :data="row.doc" :linked-nct="row.linked" :highlight="highlight">
90
+ <OipScienceClinicalTrialsCards
91
+ v-else
92
+ :data="row.doc"
93
+ :linked-nct="row.linked"
94
+ :highlight="highlight"
95
+ :class="{ linked_priority: isPriority(row) }"
96
+ >
89
97
  <template #extra>
98
+ <RmTag v-if="isPriority(row)" variant="indigo">{{ priority?.label }}</RmTag>
90
99
  <RmTag v-if="row.extra?.role" variant="gray">{{ row.extra.role }}</RmTag>
91
100
  <OipScienceCommonScoreBadge :score="row.extra?.score" />
92
101
  </template>
@@ -136,10 +145,22 @@ const props = withDefaults(
136
145
  loading?: boolean;
137
146
  /** Termes a surligner dans les cartes (filterStore dans FAS). */
138
147
  highlight?: string[];
148
+ /**
149
+ * Essais a mettre en tete et en avant, par numero NCT ou EUCT (ceux d'une
150
+ * recherche par maladie dans FAS), avec le libelle de leur etiquette.
151
+ */
152
+ priority?: { ids: string[]; label: string } | null;
139
153
  }>(),
140
- { nctIds: () => [], euctIds: () => [], extras: () => ({}), loading: false, highlight: () => [] },
154
+ { nctIds: () => [], euctIds: () => [], extras: () => ({}), loading: false, highlight: () => [], priority: null },
141
155
  );
142
156
 
157
+ const priorityIds = computed(() => new Set(props.priority?.ids ?? []));
158
+ /** Un essai compte aussi par son jumeau de l'autre registre. */
159
+ const isPriority = (row: Row) =>
160
+ priorityIds.value.has(row.id) ||
161
+ priorityIds.value.has(row.linked?.euct_number) ||
162
+ priorityIds.value.has(row.linked?.nct_id);
163
+
143
164
  const { locale } = useI18n();
144
165
  const lang = computed<'fr' | 'en'>(() => (locale.value === 'en' ? 'en' : 'fr'));
145
166
  const { queryCustomElastic } = useOipElastic();
@@ -226,7 +247,7 @@ const rows = computed<Row[]>(() => {
226
247
  date: new Date(doc.decision_date || doc.last_update_date || 0).getTime(),
227
248
  });
228
249
  }
229
- return out.sort((a, b) => b.date - a.date);
250
+ return out.sort((a, b) => Number(isPriority(b)) - Number(isPriority(a)) || b.date - a.date);
230
251
  });
231
252
 
232
253
  // ::::: Filtres locaux
@@ -359,6 +380,9 @@ watch(
359
380
  </script>
360
381
 
361
382
  <style scoped>
383
+ .linked_priority {
384
+ box-shadow: inset 3px 0 0 var(--color-secondary);
385
+ }
362
386
  .load_more {
363
387
  align-self: center;
364
388
  justify-self: center;
@@ -13,6 +13,7 @@
13
13
  :sources="['CT.gov', 'EUCT', 'FINESS']"
14
14
  index-last-update="CT.gov"
15
15
  :loading="isLoading"
16
+ :priority="priority"
16
17
  />
17
18
  </div>
18
19
  </template>
@@ -23,10 +24,20 @@ import useEstablishmentCrossData from '../../../oip-science/composables/useEstab
23
24
  // Meme forme que LinkedTrialExtra de clinical-trials/LinkedList.vue.
24
25
  type LinkedTrialExtra = { score?: number | null; role?: string | null };
25
26
 
26
- const props = withDefaults(defineProps<{ id: string; highlight?: string[]; lang?: 'fr' | 'en' }>(), {
27
- highlight: () => [],
28
- lang: undefined,
29
- });
27
+ const props = withDefaults(
28
+ defineProps<{
29
+ id: string;
30
+ highlight?: string[];
31
+ lang?: 'fr' | 'en';
32
+ /** Essais a mettre en tete et en avant (cf. clinical-trials/LinkedList.vue). */
33
+ priority?: { ids: string[]; label: string } | null;
34
+ }>(),
35
+ {
36
+ highlight: () => [],
37
+ lang: undefined,
38
+ priority: null,
39
+ },
40
+ );
30
41
 
31
42
  const { fetchCrossData } = useEstablishmentCrossData();
32
43
 
@@ -12,6 +12,7 @@
12
12
  :sources="['CT.gov', 'EUCT', 'RPPS']"
13
13
  index-last-update="HCPs"
14
14
  :loading="isLoading"
15
+ :priority="priority"
15
16
  />
16
17
  </div>
17
18
  </template>
@@ -24,10 +25,20 @@ import useOipElastic from '../../../oip-science/composables/useOipElastic';
24
25
  type LinkedTrialExtra = { score?: number | null; role?: string | null };
25
26
  type HcpTrialName = { first_name?: string; last_name?: string; name?: string; match_method: string; score: number };
26
27
 
27
- const props = withDefaults(defineProps<{ id: string; highlight?: string[]; lang?: 'fr' | 'en' }>(), {
28
- highlight: () => [],
29
- lang: undefined,
30
- });
28
+ const props = withDefaults(
29
+ defineProps<{
30
+ id: string;
31
+ highlight?: string[];
32
+ lang?: 'fr' | 'en';
33
+ /** Essais a mettre en tete et en avant (cf. clinical-trials/LinkedList.vue). */
34
+ priority?: { ids: string[]; label: string } | null;
35
+ }>(),
36
+ {
37
+ highlight: () => [],
38
+ lang: undefined,
39
+ priority: null,
40
+ },
41
+ );
31
42
 
32
43
  const { queryOneElastic } = useOipElastic();
33
44
 
@@ -6,14 +6,19 @@
6
6
  <div class="oip-science">
7
7
  <div v-if="!isLoading && pubmedResults.length" class="oip_grid gap-24">
8
8
  <RmResultsLine icon="Article" :items="[{ count: pubmedResults.length, label: $t('oipScience.resultKpis.publications', pubmedResults.length) }]" />
9
- <div v-for="(res, index) in pubmedResults" :key="index">
9
+ <div v-for="(res, index) in ordered" :key="index">
10
10
  <OipSciencePubmedCards
11
11
  :data="res"
12
12
  :id="res.PubMed_ID"
13
13
  :match-score="scoreByPmid[res.PubMed_ID] ?? null"
14
14
  :match-method="methodByPmid[res.PubMed_ID] || null"
15
15
  :highlight="highlight"
16
- />
16
+ :class="{ linked_priority: isPriority(res) }"
17
+ >
18
+ <template #extra>
19
+ <RmTag v-if="isPriority(res)" variant="indigo">{{ priority?.label }}</RmTag>
20
+ </template>
21
+ </OipSciencePubmedCards>
17
22
  </div>
18
23
  </div>
19
24
  <RmLoadingState v-if="isLoading" :lines="3" :chart-height="240" />
@@ -29,10 +34,20 @@
29
34
  import indexConfig from '../../../oip-science/indexConfig.json';
30
35
  import useOipElastic from '../../../oip-science/composables/useOipElastic';
31
36
 
32
- const props = withDefaults(defineProps<{ id: string; highlight?: string[]; lang?: 'fr' | 'en' }>(), {
33
- highlight: () => [],
34
- lang: undefined,
35
- });
37
+ const props = withDefaults(
38
+ defineProps<{
39
+ id: string;
40
+ highlight?: string[];
41
+ lang?: 'fr' | 'en';
42
+ /** Publications a mettre en tete et en avant, par PMID. */
43
+ priority?: { ids: string[]; label: string } | null;
44
+ }>(),
45
+ {
46
+ highlight: () => [],
47
+ lang: undefined,
48
+ priority: null,
49
+ },
50
+ );
36
51
 
37
52
  const { queryCustomElastic, queryOneElastic } = useOipElastic();
38
53
 
@@ -125,4 +140,17 @@ async function load(urlId: string) {
125
140
  }
126
141
 
127
142
  watch(() => props.id, (id) => { if (id) load(id); }, { immediate: true });
143
+
144
+ const priorityIds = computed(() => new Set(props.priority?.ids ?? []));
145
+ const isPriority = (res: any) => priorityIds.value.has(String(res?.PubMed_ID));
146
+ /** Les publications prioritaires d'abord, chaque groupe gardant l'ordre par date. */
147
+ const ordered = computed(() =>
148
+ [...pubmedResults.value].sort((a, b) => Number(isPriority(b)) - Number(isPriority(a))),
149
+ );
128
150
  </script>
151
+
152
+ <style scoped>
153
+ .linked_priority {
154
+ box-shadow: inset 3px 0 0 var(--color-secondary);
155
+ }
156
+ </style>
@@ -53,6 +53,7 @@
53
53
  :class="matchScore >= 0.85 ? 'score-high' : 'score-low'"
54
54
  :data-tooltip="$t('oipScience.common.matchingScoreTooltip')"
55
55
  >{{ $t('oipScience.cards.matchingScore') }} : {{ Math.round(matchScore * 100) }}%</span>
56
+ <slot name="extra" />
56
57
  </template>
57
58
 
58
59
  <RmDrawer v-model="showModal" size="md" :label="$t('oipScience.cards.pubmedAbstract')">
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tekkare/romulus",
3
- "version": "0.1.259",
3
+ "version": "0.1.260",
4
4
  "description": "Romulus Design System - Nuxt module by Tekkare",
5
5
  "license": "MIT",
6
6
  "type": "module",