@tekkare/romulus 0.1.290 → 0.1.292
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-australia/AustraliaPrice.vue +166 -0
- package/layer/app/components/oip-australia/PbacOpinion.vue +130 -0
- package/layer/app/components/oip-australia/PbsItem.vue +143 -0
- package/layer/app/components/oip-australia/Reimbursement.vue +351 -0
- package/layer/app/composables/useOipResourceViews.ts +4 -0
- package/layer/app/oip-australia/australia.css +78 -0
- package/layer/app/oip-australia/kinds.ts +103 -0
- package/layer/app/utils/oipResources.ts +28 -0
- package/layer/nuxt.config.ts +1 -0
- package/layer/server/api/oip/es.post.ts +9 -1
- package/package.json +1 -1
package/dist/module.json
CHANGED
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
Fiche d'une presentation du Price Tracker australien (Australia One, type
|
|
3
|
+
AuPbsPrice), par son `_id` (au_<AMT>_<n>) : identite, prix en vigueur, puis
|
|
4
|
+
les vrais changements de prix (les reconductions « N » a prix inchange sont
|
|
5
|
+
ecartees).
|
|
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-au">
|
|
12
|
+
<RmPageHeader :eyebrow="en ? 'Price, Australia' : 'Prix, Australie'">
|
|
13
|
+
<template #title>
|
|
14
|
+
<span class="oip-au__title">{{ doc?.label_local || id }}</span>
|
|
15
|
+
<slot name="title-link" />
|
|
16
|
+
</template>
|
|
17
|
+
</RmPageHeader>
|
|
18
|
+
|
|
19
|
+
<div class="oip-au__body">
|
|
20
|
+
<RmLoadingState v-if="loading" spinner />
|
|
21
|
+
<RmEmptyState v-else-if="!doc" icon="Prohibit" :title="en ? 'Price not found' : 'Prix introuvable'" />
|
|
22
|
+
<template v-else>
|
|
23
|
+
<div class="oip-au__tags">
|
|
24
|
+
<RmTag v-if="doc.brand" variant="indigo">{{ doc.brand }}</RmTag>
|
|
25
|
+
<RmTag v-if="doc.price_category" :variant="String(doc.price_category).includes('Hospital') ? 'blue' : 'orange'">
|
|
26
|
+
{{ doc.price_category }}
|
|
27
|
+
</RmTag>
|
|
28
|
+
<RmTag v-if="doc.local_drug_id" variant="gray">AMT {{ doc.local_drug_id }}</RmTag>
|
|
29
|
+
</div>
|
|
30
|
+
|
|
31
|
+
<RmCard padding="md">
|
|
32
|
+
<h3 class="oip-au__card-title">{{ en ? "Current price" : "Prix en vigueur" }}</h3>
|
|
33
|
+
<div v-if="current.length" class="oip-au__figures">
|
|
34
|
+
<div v-for="price in current" :key="price.type" class="oip-au__figure">
|
|
35
|
+
<span class="oip-au__figure-label">{{ price.type }}</span>
|
|
36
|
+
<span class="oip-au__figure-value">{{ price.value }}</span>
|
|
37
|
+
<span class="oip-au__figure-note">{{ en ? "since" : "depuis le" }} {{ price.date }}</span>
|
|
38
|
+
</div>
|
|
39
|
+
</div>
|
|
40
|
+
<p v-else class="oip-au__note">{{ en ? "No price recorded." : "Aucun prix enregistré." }}</p>
|
|
41
|
+
<dl class="oip-au__rows oip-au__rows--spaced">
|
|
42
|
+
<template v-for="row in rows" :key="row.label">
|
|
43
|
+
<dt>{{ row.label }}</dt>
|
|
44
|
+
<dd>{{ row.value }}</dd>
|
|
45
|
+
</template>
|
|
46
|
+
</dl>
|
|
47
|
+
</RmCard>
|
|
48
|
+
|
|
49
|
+
<RmCard v-if="history.length" padding="md">
|
|
50
|
+
<h3 class="oip-au__card-title">{{ en ? "Price changes" : "Changements de prix" }} ({{ history.length }})</h3>
|
|
51
|
+
<RmTable
|
|
52
|
+
:columns="historyColumns"
|
|
53
|
+
:rows="history"
|
|
54
|
+
compact
|
|
55
|
+
flat
|
|
56
|
+
:page-size="20"
|
|
57
|
+
max-height="none"
|
|
58
|
+
:empty-text="en ? 'No data' : 'Aucune donnée'"
|
|
59
|
+
/>
|
|
60
|
+
</RmCard>
|
|
61
|
+
</template>
|
|
62
|
+
</div>
|
|
63
|
+
</div>
|
|
64
|
+
</template>
|
|
65
|
+
|
|
66
|
+
<script setup lang="ts">
|
|
67
|
+
import { oipEsGet } from "../../composables/useOipResources";
|
|
68
|
+
import { AUSTRALIA_INDEX } from "../../oip-australia/kinds";
|
|
69
|
+
|
|
70
|
+
const props = withDefaults(
|
|
71
|
+
defineProps<{
|
|
72
|
+
/** Le `resourceId` : `_id` de la presentation (au_<AMT>_<n>). */
|
|
73
|
+
id: string;
|
|
74
|
+
type?: string;
|
|
75
|
+
lang?: "fr" | "en";
|
|
76
|
+
highlight?: string[];
|
|
77
|
+
}>(),
|
|
78
|
+
{ type: "AuPbsPrice", lang: "fr", highlight: () => [] },
|
|
79
|
+
);
|
|
80
|
+
|
|
81
|
+
const en = computed(() => props.lang === "en");
|
|
82
|
+
const loading = ref(true);
|
|
83
|
+
const doc = ref<Record<string, any> | null>(null);
|
|
84
|
+
|
|
85
|
+
/** Le PBS ne publie que le prix fabricant dans l'index ; les autres pour memoire. */
|
|
86
|
+
const PRICE_TYPES: Record<number, { fr: string; en: string }> = {
|
|
87
|
+
1: { fr: "Prix fabricant", en: "Ex-factory" },
|
|
88
|
+
201: { fr: "Prix fabricant (AIP)", en: "Ex-factory (AIP)" },
|
|
89
|
+
202: { fr: "Prix public (AUP)", en: "Public (AUP)" },
|
|
90
|
+
};
|
|
91
|
+
const typeName = (id: number) => {
|
|
92
|
+
const type = PRICE_TYPES[id];
|
|
93
|
+
return type ? (en.value ? type.en : type.fr) : String(id);
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
/** Statuts qui disent un vrai prix (les « N » sont des reconductions). */
|
|
97
|
+
const LIVE = ["Y", "NEW", "INIT", "FP"];
|
|
98
|
+
|
|
99
|
+
const date = (value: unknown) => {
|
|
100
|
+
const parsed = new Date(String(value ?? ""));
|
|
101
|
+
return Number.isNaN(parsed.getTime())
|
|
102
|
+
? "-"
|
|
103
|
+
: parsed.toLocaleDateString(en.value ? "en-GB" : "fr-FR", { day: "numeric", month: "short", year: "numeric" });
|
|
104
|
+
};
|
|
105
|
+
const aud = (value: unknown) => {
|
|
106
|
+
const n = Number(value);
|
|
107
|
+
return Number.isFinite(n)
|
|
108
|
+
? `${n.toLocaleString(en.value ? "en-GB" : "fr-FR", { minimumFractionDigits: 2, maximumFractionDigits: 2 })} A$`
|
|
109
|
+
: "-";
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
const entries = computed(() =>
|
|
113
|
+
[...(doc.value?.price_history ?? [])]
|
|
114
|
+
.filter((entry: any) => LIVE.includes(entry.status_changed))
|
|
115
|
+
.sort((a: any, b: any) => new Date(b.application_date ?? 0).getTime() - new Date(a.application_date ?? 0).getTime()),
|
|
116
|
+
);
|
|
117
|
+
|
|
118
|
+
const current = computed(() => {
|
|
119
|
+
const now = Date.now();
|
|
120
|
+
const seen = new Set<number>();
|
|
121
|
+
const out: { type: string; value: string; date: string }[] = [];
|
|
122
|
+
for (const entry of entries.value) {
|
|
123
|
+
const id = Number(entry.price_type_id);
|
|
124
|
+
if (seen.has(id) || !Number.isFinite(Number(entry.new_price))) continue;
|
|
125
|
+
if (entry.application_date && new Date(entry.application_date).getTime() > now) continue;
|
|
126
|
+
seen.add(id);
|
|
127
|
+
out.push({ type: typeName(id), value: aud(entry.new_price), date: date(entry.application_date) });
|
|
128
|
+
}
|
|
129
|
+
return out;
|
|
130
|
+
});
|
|
131
|
+
|
|
132
|
+
const historyColumns = computed(() => [
|
|
133
|
+
{ key: "date", label: en.value ? "Application date" : "Date d'application" },
|
|
134
|
+
{ key: "type", label: en.value ? "Price type" : "Type de prix" },
|
|
135
|
+
{ key: "price", label: en.value ? "Price" : "Prix", numeric: true },
|
|
136
|
+
{ key: "before", label: en.value ? "Previous price" : "Prix précédent", numeric: true },
|
|
137
|
+
]);
|
|
138
|
+
|
|
139
|
+
const history = computed(() =>
|
|
140
|
+
entries.value.map((entry: any) => ({
|
|
141
|
+
date: date(entry.application_date),
|
|
142
|
+
type: typeName(Number(entry.price_type_id)),
|
|
143
|
+
price: aud(entry.new_price),
|
|
144
|
+
before: entry.last_price != null && Number(entry.last_price) !== Number(entry.new_price) ? aud(entry.last_price) : "-",
|
|
145
|
+
})),
|
|
146
|
+
);
|
|
147
|
+
|
|
148
|
+
const rows = computed(() => {
|
|
149
|
+
const d = doc.value ?? {};
|
|
150
|
+
return [
|
|
151
|
+
{ label: en.value ? "Molecule" : "Molécule", value: d.molecule_en || d.molecule_local },
|
|
152
|
+
{ label: en.value ? "Company" : "Laboratoire", value: d.manufacturer_regroup || d.manufacturer },
|
|
153
|
+
{ label: "ATC4", value: d.atc4 },
|
|
154
|
+
{ label: en.value ? "Pack" : "Conditionnement", value: d.unit },
|
|
155
|
+
].filter((row) => row.value);
|
|
156
|
+
});
|
|
157
|
+
|
|
158
|
+
async function read() {
|
|
159
|
+
loading.value = true;
|
|
160
|
+
const hit = await oipEsGet<any>("drugs", AUSTRALIA_INDEX.prices, props.id).catch(() => null);
|
|
161
|
+
doc.value = hit?._source ?? null;
|
|
162
|
+
loading.value = false;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
watch(() => props.id, read, { immediate: true });
|
|
166
|
+
</script>
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
Fiche d'un avis public du PBAC (Australia One, type AuPbacOpinion), par son
|
|
3
|
+
`_id` (URL de la PSD) : marque, molecule, indication, reunion, sponsor et
|
|
4
|
+
liens vers la PSD, puis les autres avis de la meme marque.
|
|
5
|
+
|
|
6
|
+
Montee par le tiroir des projets ; le lien vers l'app passe par le slot
|
|
7
|
+
`title-link`.
|
|
8
|
+
-->
|
|
9
|
+
<template>
|
|
10
|
+
<div class="oip-au">
|
|
11
|
+
<RmPageHeader :eyebrow="en ? 'PBAC opinion, Australia' : 'Avis du PBAC, Australie'">
|
|
12
|
+
<template #title>
|
|
13
|
+
<span class="oip-au__title">{{ doc?.brand || doc?.drug_label || (en ? "PBAC opinion" : "Avis du PBAC") }}</span>
|
|
14
|
+
<slot name="title-link" />
|
|
15
|
+
</template>
|
|
16
|
+
</RmPageHeader>
|
|
17
|
+
|
|
18
|
+
<div class="oip-au__body">
|
|
19
|
+
<RmLoadingState v-if="loading" spinner />
|
|
20
|
+
<RmEmptyState v-else-if="!doc" icon="Prohibit" :title="en ? 'Opinion not found' : 'Avis introuvable'" />
|
|
21
|
+
<template v-else>
|
|
22
|
+
<div class="oip-au__tags">
|
|
23
|
+
<RmTag v-if="doc.meeting_date" variant="indigo">{{ en ? "Meeting" : "Réunion" }} · {{ date(doc.meeting_date) }}</RmTag>
|
|
24
|
+
<RmTag v-if="doc.indication" variant="blue">{{ doc.indication }}</RmTag>
|
|
25
|
+
</div>
|
|
26
|
+
|
|
27
|
+
<RmCard padding="md">
|
|
28
|
+
<dl class="oip-au__rows">
|
|
29
|
+
<template v-for="row in rows" :key="row.label">
|
|
30
|
+
<dt>{{ row.label }}</dt>
|
|
31
|
+
<dd>{{ row.value }}</dd>
|
|
32
|
+
</template>
|
|
33
|
+
</dl>
|
|
34
|
+
<div class="oip-au__links">
|
|
35
|
+
<a v-if="doc.detail_url" :href="doc.detail_url" target="_blank" rel="noopener" class="oip-au__link">
|
|
36
|
+
{{ en ? "PSD on pbs.gov.au" : "PSD sur pbs.gov.au" }}
|
|
37
|
+
</a>
|
|
38
|
+
<a v-if="pdf" :href="pdf" target="_blank" rel="noopener" class="oip-au__link">PDF</a>
|
|
39
|
+
</div>
|
|
40
|
+
</RmCard>
|
|
41
|
+
|
|
42
|
+
<RmCard v-if="others.length" padding="md">
|
|
43
|
+
<h3 class="oip-au__card-title">
|
|
44
|
+
{{ en ? "Other opinions for this brand" : "Autres avis de la marque" }} ({{ others.length }})
|
|
45
|
+
</h3>
|
|
46
|
+
<RmTable
|
|
47
|
+
:columns="otherColumns"
|
|
48
|
+
:rows="others"
|
|
49
|
+
compact
|
|
50
|
+
flat
|
|
51
|
+
:page-size="10"
|
|
52
|
+
max-height="none"
|
|
53
|
+
:empty-text="en ? 'No data' : 'Aucune donnée'"
|
|
54
|
+
/>
|
|
55
|
+
</RmCard>
|
|
56
|
+
</template>
|
|
57
|
+
</div>
|
|
58
|
+
</div>
|
|
59
|
+
</template>
|
|
60
|
+
|
|
61
|
+
<script setup lang="ts">
|
|
62
|
+
import { oipEsGet, oipEsSearch } from "../../composables/useOipResources";
|
|
63
|
+
import { AUSTRALIA_INDEX } from "../../oip-australia/kinds";
|
|
64
|
+
|
|
65
|
+
const props = withDefaults(
|
|
66
|
+
defineProps<{
|
|
67
|
+
/** Le `resourceId` : `_id` de l'avis (URL de la PSD). */
|
|
68
|
+
id: string;
|
|
69
|
+
type?: string;
|
|
70
|
+
lang?: "fr" | "en";
|
|
71
|
+
highlight?: string[];
|
|
72
|
+
}>(),
|
|
73
|
+
{ type: "AuPbacOpinion", lang: "fr", highlight: () => [] },
|
|
74
|
+
);
|
|
75
|
+
|
|
76
|
+
const en = computed(() => props.lang === "en");
|
|
77
|
+
const loading = ref(true);
|
|
78
|
+
const doc = ref<Record<string, any> | null>(null);
|
|
79
|
+
const siblings = ref<any[]>([]);
|
|
80
|
+
|
|
81
|
+
const date = (value: unknown) => {
|
|
82
|
+
const parsed = new Date(String(value ?? ""));
|
|
83
|
+
return Number.isNaN(parsed.getTime())
|
|
84
|
+
? "-"
|
|
85
|
+
: parsed.toLocaleDateString(en.value ? "en-GB" : "fr-FR", { month: "short", year: "numeric" });
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
/** La copie Tekkare de la PDF d'abord : celle du PBS change d'adresse. */
|
|
89
|
+
const pdf = computed(() => doc.value?.tekkare_pdf_url || doc.value?.pdf_url || "");
|
|
90
|
+
|
|
91
|
+
const rows = computed(() => {
|
|
92
|
+
const d = doc.value ?? {};
|
|
93
|
+
return [
|
|
94
|
+
{ label: en.value ? "Brand" : "Marque", value: d.brand },
|
|
95
|
+
{ label: en.value ? "Molecule" : "Molécule", value: d.drug_label },
|
|
96
|
+
{ label: "Indication", value: d.indication },
|
|
97
|
+
{ label: "Sponsor", value: d.owner },
|
|
98
|
+
{ label: en.value ? "Meeting" : "Réunion", value: d.meeting_date ? date(d.meeting_date) : "" },
|
|
99
|
+
].filter((row) => row.value);
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
const otherColumns = computed(() => [
|
|
103
|
+
{ key: "meeting", label: en.value ? "Meeting" : "Réunion" },
|
|
104
|
+
{ key: "indication", label: "Indication" },
|
|
105
|
+
]);
|
|
106
|
+
const others = computed(() =>
|
|
107
|
+
siblings.value
|
|
108
|
+
.filter((hit: any) => hit._id !== props.id)
|
|
109
|
+
.map((hit: any) => ({ meeting: date(hit._source?.meeting_date), indication: hit._source?.indication || "-" })),
|
|
110
|
+
);
|
|
111
|
+
|
|
112
|
+
async function read() {
|
|
113
|
+
loading.value = true;
|
|
114
|
+
const hit = await oipEsGet<any>("drugs", AUSTRALIA_INDEX.pbac, props.id).catch(() => null);
|
|
115
|
+
doc.value = hit?._source ?? null;
|
|
116
|
+
siblings.value = [];
|
|
117
|
+
loading.value = false;
|
|
118
|
+
const brand = doc.value?.brand;
|
|
119
|
+
if (!brand) return;
|
|
120
|
+
const res = await oipEsSearch<any>("drugs", AUSTRALIA_INDEX.pbac, {
|
|
121
|
+
size: 30,
|
|
122
|
+
query: { term: { "brand.keyword": brand } },
|
|
123
|
+
sort: [{ meeting_date: { order: "desc" } }],
|
|
124
|
+
_source: ["meeting_date", "indication"],
|
|
125
|
+
}).catch(() => null);
|
|
126
|
+
siblings.value = res?.hits?.hits ?? [];
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
watch(() => props.id, read, { immediate: true });
|
|
130
|
+
</script>
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
Fiche d'un code item du PBS (Australia One, type AuPbsItem), par son `_id`
|
|
3
|
+
(AU_ITEM_<code>) : forme et dosage, marques, prix delivre et ticket
|
|
4
|
+
moderateur, regles de delivrance, puis les restrictions (indications).
|
|
5
|
+
|
|
6
|
+
Montee par le tiroir des projets ; le lien vers l'app passe par le slot
|
|
7
|
+
`title-link`.
|
|
8
|
+
-->
|
|
9
|
+
<template>
|
|
10
|
+
<div class="oip-au">
|
|
11
|
+
<RmPageHeader :eyebrow="en ? 'PBS item code, Australia' : 'Code item PBS, Australie'">
|
|
12
|
+
<template #title>
|
|
13
|
+
<span class="oip-au__title">{{ doc?.local_label || doc?.generic_name || code }}</span>
|
|
14
|
+
<slot name="title-link" />
|
|
15
|
+
</template>
|
|
16
|
+
</RmPageHeader>
|
|
17
|
+
|
|
18
|
+
<div class="oip-au__body">
|
|
19
|
+
<RmLoadingState v-if="loading" spinner />
|
|
20
|
+
<RmEmptyState v-else-if="!doc" icon="Prohibit" :title="en ? 'Item code not found' : 'Code item introuvable'" />
|
|
21
|
+
<template v-else>
|
|
22
|
+
<div class="oip-au__tags">
|
|
23
|
+
<RmTag variant="gray">PBS {{ doc.item_code || code }}</RmTag>
|
|
24
|
+
<RmTag v-if="doc.atc5_code" variant="blue">ATC5 · {{ doc.atc5_code }}</RmTag>
|
|
25
|
+
<RmTag v-for="brand in brands" :key="brand" variant="indigo">{{ brand }}</RmTag>
|
|
26
|
+
<RmTag v-if="doc.code_status && doc.code_status !== 'existing'" variant="orange">{{ doc.code_status }}</RmTag>
|
|
27
|
+
</div>
|
|
28
|
+
|
|
29
|
+
<RmCard padding="md">
|
|
30
|
+
<div v-if="prices.length" class="oip-au__figures">
|
|
31
|
+
<div v-for="price in prices" :key="price.label" class="oip-au__figure">
|
|
32
|
+
<span class="oip-au__figure-label">{{ price.label }}</span>
|
|
33
|
+
<span class="oip-au__figure-value">{{ price.value }}</span>
|
|
34
|
+
</div>
|
|
35
|
+
</div>
|
|
36
|
+
<dl class="oip-au__rows" :class="{ 'oip-au__rows--spaced': prices.length }">
|
|
37
|
+
<template v-for="row in rows" :key="row.label">
|
|
38
|
+
<dt>{{ row.label }}</dt>
|
|
39
|
+
<dd>{{ row.value }}</dd>
|
|
40
|
+
</template>
|
|
41
|
+
</dl>
|
|
42
|
+
</RmCard>
|
|
43
|
+
|
|
44
|
+
<RmCard v-if="indications.length" padding="md">
|
|
45
|
+
<h3 class="oip-au__card-title">{{ en ? "Restrictions" : "Restrictions" }} ({{ indications.length }})</h3>
|
|
46
|
+
<RmTable
|
|
47
|
+
:columns="indicationColumns"
|
|
48
|
+
:rows="indications"
|
|
49
|
+
compact
|
|
50
|
+
flat
|
|
51
|
+
:page-size="10"
|
|
52
|
+
max-height="none"
|
|
53
|
+
:empty-text="en ? 'No data' : 'Aucune donnée'"
|
|
54
|
+
/>
|
|
55
|
+
</RmCard>
|
|
56
|
+
</template>
|
|
57
|
+
</div>
|
|
58
|
+
</div>
|
|
59
|
+
</template>
|
|
60
|
+
|
|
61
|
+
<script setup lang="ts">
|
|
62
|
+
import { oipEsGet } from "../../composables/useOipResources";
|
|
63
|
+
import { AUSTRALIA_INDEX } from "../../oip-australia/kinds";
|
|
64
|
+
|
|
65
|
+
const props = withDefaults(
|
|
66
|
+
defineProps<{
|
|
67
|
+
/** Le `resourceId` : `_id` du code item (AU_ITEM_<code>). */
|
|
68
|
+
id: string;
|
|
69
|
+
type?: string;
|
|
70
|
+
lang?: "fr" | "en";
|
|
71
|
+
highlight?: string[];
|
|
72
|
+
}>(),
|
|
73
|
+
{ type: "AuPbsItem", lang: "fr", highlight: () => [] },
|
|
74
|
+
);
|
|
75
|
+
|
|
76
|
+
const en = computed(() => props.lang === "en");
|
|
77
|
+
const loading = ref(true);
|
|
78
|
+
const doc = ref<Record<string, any> | null>(null);
|
|
79
|
+
const code = computed(() => props.id.replace(/^AU_ITEM_/, ""));
|
|
80
|
+
|
|
81
|
+
const aud = (value: unknown) => {
|
|
82
|
+
const n = Number(value);
|
|
83
|
+
return value != null && Number.isFinite(n)
|
|
84
|
+
? `${n.toLocaleString(en.value ? "en-GB" : "fr-FR", { minimumFractionDigits: 2, maximumFractionDigits: 2 })} A$`
|
|
85
|
+
: "";
|
|
86
|
+
};
|
|
87
|
+
const count = (value: unknown) => (value != null && Number.isFinite(Number(value)) ? String(Number(value)) : "");
|
|
88
|
+
const month = (value: unknown) => {
|
|
89
|
+
const parsed = new Date(`${String(value ?? "")}-01`);
|
|
90
|
+
return Number.isNaN(parsed.getTime())
|
|
91
|
+
? ""
|
|
92
|
+
: parsed.toLocaleDateString(en.value ? "en-GB" : "fr-FR", { month: "short", year: "numeric" });
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
const brands = computed(() =>
|
|
96
|
+
(doc.value?.brands ?? []).map((b: any) => (typeof b === "string" ? b : b?.brand_name)).filter(Boolean),
|
|
97
|
+
);
|
|
98
|
+
|
|
99
|
+
const prices = computed(() => {
|
|
100
|
+
const d = doc.value ?? {};
|
|
101
|
+
return [
|
|
102
|
+
{ label: en.value ? "Dispensed price (max.)" : "Prix délivré (max.)", value: aud(d.maximum_supply_price) },
|
|
103
|
+
{ label: en.value ? "General co-payment" : "Ticket modérateur", value: aud(d.general_patient_payment) },
|
|
104
|
+
{ label: en.value ? "Safety net price" : "Prix filet de sécurité", value: aud(d.maximum_safety_net_price) },
|
|
105
|
+
].filter((price) => price.value);
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
const rows = computed(() => {
|
|
109
|
+
const d = doc.value ?? {};
|
|
110
|
+
const supply = [d.first_supply_period, d.last_supply_period].map(month).filter(Boolean).join(" - ");
|
|
111
|
+
return [
|
|
112
|
+
{ label: en.value ? "Molecule" : "Molécule", value: d.generic_name },
|
|
113
|
+
{ label: en.value ? "Form and strength" : "Forme et dosage", value: d.form_strength },
|
|
114
|
+
{ label: en.value ? "Therapeutic area" : "Aire thérapeutique", value: d.therapeutic_area },
|
|
115
|
+
{ label: en.value ? "Route" : "Voie", value: d.administration_route },
|
|
116
|
+
{ label: en.value ? "Program" : "Programme", value: d.reimbursement_program },
|
|
117
|
+
{ label: en.value ? "Authority" : "Autorisation", value: d.authority_requirement },
|
|
118
|
+
{ label: en.value ? "Max. quantity" : "Quantité max.", value: count(d.maximum_supply) },
|
|
119
|
+
{ label: en.value ? "Max. repeats" : "Renouvellements max.", value: count(d.maximum_repeats) },
|
|
120
|
+
{ label: en.value ? "Supplied" : "Délivré", value: supply },
|
|
121
|
+
].filter((row) => row.value);
|
|
122
|
+
});
|
|
123
|
+
|
|
124
|
+
const indicationColumns = computed(() => [
|
|
125
|
+
{ key: "indication", label: "Indication" },
|
|
126
|
+
{ key: "phase", label: en.value ? "Phase" : "Phase" },
|
|
127
|
+
]);
|
|
128
|
+
const indications = computed(() =>
|
|
129
|
+
(doc.value?.indications ?? []).map((item: any) => ({
|
|
130
|
+
indication: typeof item === "string" ? item : item?.indication || "-",
|
|
131
|
+
phase: typeof item === "string" ? "-" : item?.phase || "-",
|
|
132
|
+
})),
|
|
133
|
+
);
|
|
134
|
+
|
|
135
|
+
async function read() {
|
|
136
|
+
loading.value = true;
|
|
137
|
+
const hit = await oipEsGet<any>("drugs", AUSTRALIA_INDEX.items, props.id).catch(() => null);
|
|
138
|
+
doc.value = hit?._source ?? null;
|
|
139
|
+
loading.value = false;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
watch(() => props.id, read, { immediate: true });
|
|
143
|
+
</script>
|
|
@@ -0,0 +1,351 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
Fiche du remboursement PBS d'un code item (Australia One, type
|
|
3
|
+
AuDrugReimbursement), par son `_id` (AU_ITEM_<code>) dans l'index produit.
|
|
4
|
+
|
|
5
|
+
Reprend la lecture de la page Drug reimbursement d'Australia One
|
|
6
|
+
(/drugs/retail) : indicateur, periode glissante et categories de patients
|
|
7
|
+
au-dessus ; courbe mensuelle, synthese des fenetres glissantes (dernier mois,
|
|
8
|
+
3 et 12 derniers mois, depuis janvier) comparees aux memes mois un an plus
|
|
9
|
+
tot, puis le detail mois par mois par categorie de patients. Les mois se
|
|
10
|
+
lisent dans `item_level` (un objet par mois, categorie et section).
|
|
11
|
+
|
|
12
|
+
Montants en dollars australiens : la conversion de la page depend des taux
|
|
13
|
+
de l'app, que le tiroir ne charge pas.
|
|
14
|
+
|
|
15
|
+
Montee par le tiroir des projets ; le lien vers l'app passe par le slot
|
|
16
|
+
`title-link`.
|
|
17
|
+
-->
|
|
18
|
+
<template>
|
|
19
|
+
<div class="oip-au">
|
|
20
|
+
<RmPageHeader :eyebrow="en ? 'PBS reimbursement, Australia' : 'Remboursement PBS, Australie'">
|
|
21
|
+
<template #title>
|
|
22
|
+
<span class="oip-au__title">{{ doc?.local_label || code }}</span>
|
|
23
|
+
<slot name="title-link" />
|
|
24
|
+
</template>
|
|
25
|
+
</RmPageHeader>
|
|
26
|
+
|
|
27
|
+
<div class="oip-au__body">
|
|
28
|
+
<RmLoadingState v-if="loading" spinner />
|
|
29
|
+
<RmEmptyState v-else-if="!doc" icon="Prohibit" :title="en ? 'Item code not found' : 'Code item introuvable'" />
|
|
30
|
+
<template v-else>
|
|
31
|
+
<div class="oip-au__tags">
|
|
32
|
+
<RmTag variant="gray">PBS {{ doc.local_drug_id || code }}</RmTag>
|
|
33
|
+
<RmTag v-if="doc.code_label" variant="blue">{{ doc.code_label }}</RmTag>
|
|
34
|
+
<RmTag v-for="brand in doc.brands ?? []" :key="brand" variant="indigo">{{ brand }}</RmTag>
|
|
35
|
+
<RmTag v-for="section in sections" :key="section" :variant="SECTION_COLORS[section] ?? 'gray'">{{ section }}</RmTag>
|
|
36
|
+
</div>
|
|
37
|
+
|
|
38
|
+
<!-- Les reglages de la page retail, sur le seul code item. -->
|
|
39
|
+
<div class="oip-au__controls">
|
|
40
|
+
<RmFilterDropdown
|
|
41
|
+
v-model="metricModel"
|
|
42
|
+
:multiple="false"
|
|
43
|
+
:label="en ? 'Metric' : 'Indicateur'"
|
|
44
|
+
:options="metricChoices"
|
|
45
|
+
:lang="lang"
|
|
46
|
+
/>
|
|
47
|
+
<RmFilterDropdown
|
|
48
|
+
v-model="periodModel"
|
|
49
|
+
:multiple="false"
|
|
50
|
+
:label="en ? 'Period' : 'Période'"
|
|
51
|
+
:options="periodChoices"
|
|
52
|
+
:lang="lang"
|
|
53
|
+
/>
|
|
54
|
+
<RmMultipleSelect
|
|
55
|
+
v-if="categories.length > 1"
|
|
56
|
+
v-model="selectedCategories"
|
|
57
|
+
:label="en ? 'Patient category' : 'Catégorie de patients'"
|
|
58
|
+
:options="categories"
|
|
59
|
+
:search="false"
|
|
60
|
+
show-all
|
|
61
|
+
:empty-label="en ? 'All' : 'Toutes'"
|
|
62
|
+
:lang="lang"
|
|
63
|
+
/>
|
|
64
|
+
</div>
|
|
65
|
+
|
|
66
|
+
<RmCard v-if="shownPeriods.length" padding="md">
|
|
67
|
+
<h3 class="oip-au__card-title">{{ chartTitle }}</h3>
|
|
68
|
+
<RmLineChart
|
|
69
|
+
:categories="shownPeriods.map(monthLabel)"
|
|
70
|
+
:series="[{ name: metricLabel, data: shownPeriods.map((p) => round(total[p] ?? 0)) }]"
|
|
71
|
+
:height="280"
|
|
72
|
+
:value-formatter="formatValue"
|
|
73
|
+
:description="metricLabel"
|
|
74
|
+
/>
|
|
75
|
+
</RmCard>
|
|
76
|
+
|
|
77
|
+
<RmCard v-if="windows.length" padding="md">
|
|
78
|
+
<h3 class="oip-au__card-title">{{ en ? "Rolling periods" : "Périodes glissantes" }}</h3>
|
|
79
|
+
<p class="oip-au__note oip-au__note--spaced">
|
|
80
|
+
{{
|
|
81
|
+
en
|
|
82
|
+
? `Latest month available: ${monthLabel(latest)}. Each period is compared with the same calendar months one year earlier.`
|
|
83
|
+
: `Dernier mois disponible : ${monthLabel(latest)}. Chaque période est comparée aux mêmes mois civils un an plus tôt.`
|
|
84
|
+
}}
|
|
85
|
+
</p>
|
|
86
|
+
<RmTable
|
|
87
|
+
:columns="windowColumns"
|
|
88
|
+
:rows="windowRows"
|
|
89
|
+
emphasis-key="isTotal"
|
|
90
|
+
compact
|
|
91
|
+
flat
|
|
92
|
+
:striped="false"
|
|
93
|
+
max-height="none"
|
|
94
|
+
:empty-text="en ? 'No data' : 'Aucune donnée'"
|
|
95
|
+
>
|
|
96
|
+
<template #label="{ row }">
|
|
97
|
+
<RmTag v-if="!row.isTotal" :variant="SECTION_COLORS[row.label] ?? 'gray'">{{ row.label }}</RmTag>
|
|
98
|
+
<span v-else>{{ row.label }}</span>
|
|
99
|
+
</template>
|
|
100
|
+
<template v-for="(w, wi) in windows" :key="w.key" #[`w${wi}`]="{ value }">
|
|
101
|
+
<span class="oip-au__nowrap">{{ formatValue(value.value) }}</span>
|
|
102
|
+
<span
|
|
103
|
+
v-if="value.evolution !== null"
|
|
104
|
+
class="oip-au__evo"
|
|
105
|
+
:class="value.evolution >= 0 ? 'oip-au__evo--up' : 'oip-au__evo--down'"
|
|
106
|
+
>({{ signedPercent(value.evolution) }})</span>
|
|
107
|
+
</template>
|
|
108
|
+
</RmTable>
|
|
109
|
+
</RmCard>
|
|
110
|
+
|
|
111
|
+
<RmCard v-if="shownPeriods.length" padding="md">
|
|
112
|
+
<h3 class="oip-au__card-title">{{ en ? "Monthly detail" : "Détail mensuel" }}</h3>
|
|
113
|
+
<RmTable
|
|
114
|
+
:columns="detailColumns"
|
|
115
|
+
:rows="detailRows"
|
|
116
|
+
emphasis-key="isTotal"
|
|
117
|
+
compact
|
|
118
|
+
flat
|
|
119
|
+
:striped="false"
|
|
120
|
+
max-height="none"
|
|
121
|
+
:empty-text="en ? 'No data' : 'Aucune donnée'"
|
|
122
|
+
>
|
|
123
|
+
<template v-for="period in detailPeriods" :key="period" #[period]="{ value }">
|
|
124
|
+
<span class="oip-au__nowrap">{{ value === null || value === undefined ? "-" : formatValue(value) }}</span>
|
|
125
|
+
</template>
|
|
126
|
+
</RmTable>
|
|
127
|
+
</RmCard>
|
|
128
|
+
</template>
|
|
129
|
+
</div>
|
|
130
|
+
</div>
|
|
131
|
+
</template>
|
|
132
|
+
|
|
133
|
+
<script setup lang="ts">
|
|
134
|
+
import { oipEsGet } from "../../composables/useOipResources";
|
|
135
|
+
import { AUSTRALIA_INDEX } from "../../oip-australia/kinds";
|
|
136
|
+
|
|
137
|
+
const props = withDefaults(
|
|
138
|
+
defineProps<{
|
|
139
|
+
/** Le `resourceId` : `_id` du code item (AU_ITEM_<code>). */
|
|
140
|
+
id: string;
|
|
141
|
+
type?: string;
|
|
142
|
+
lang?: "fr" | "en";
|
|
143
|
+
highlight?: string[];
|
|
144
|
+
}>(),
|
|
145
|
+
{ type: "AuDrugReimbursement", lang: "fr", highlight: () => [] },
|
|
146
|
+
);
|
|
147
|
+
|
|
148
|
+
/** Les indicateurs de la page retail, dans son ordre. */
|
|
149
|
+
const METRICS = [
|
|
150
|
+
{ key: "prescriptions", en: "Prescriptions", fr: "Prescriptions", money: false },
|
|
151
|
+
{ key: "total_cost", en: "Total Cost", fr: "Coût total", money: true },
|
|
152
|
+
{ key: "government_contribution", en: "Government Contribution", fr: "Part de l'État", money: true },
|
|
153
|
+
{ key: "patient_contribution", en: "Patient Contribution", fr: "Part du patient", money: true },
|
|
154
|
+
{ key: "retail_markup", en: "Retail Markup", fr: "Marge officinale", money: true },
|
|
155
|
+
] as const;
|
|
156
|
+
type MetricKey = (typeof METRICS)[number]["key"];
|
|
157
|
+
|
|
158
|
+
/** Fenetres de la courbe et du detail (13 mois par defaut, comme la page). */
|
|
159
|
+
const PERIODS = [6, 13, 24, 36, null] as const;
|
|
160
|
+
const DEFAULT_PERIOD = 1;
|
|
161
|
+
|
|
162
|
+
const SECTION_COLORS: Record<string, "blue" | "violet" | "teal" | "gray"> = {
|
|
163
|
+
"Section 85": "blue",
|
|
164
|
+
"Section 100": "violet",
|
|
165
|
+
RPBS: "teal",
|
|
166
|
+
Unknown: "gray",
|
|
167
|
+
};
|
|
168
|
+
|
|
169
|
+
const en = computed(() => props.lang === "en");
|
|
170
|
+
const lang = computed(() => props.lang);
|
|
171
|
+
const loading = ref(true);
|
|
172
|
+
const doc = ref<Record<string, any> | null>(null);
|
|
173
|
+
const code = computed(() => props.id.replace(/^AU_ITEM_/, ""));
|
|
174
|
+
|
|
175
|
+
const metricIndex = ref(0);
|
|
176
|
+
const periodIndex = ref<number>(DEFAULT_PERIOD);
|
|
177
|
+
const selectedCategories = ref<string[]>([]);
|
|
178
|
+
|
|
179
|
+
const metric = computed(() => METRICS[metricIndex.value]!);
|
|
180
|
+
const metricLabel = computed(() => (en.value ? metric.value.en : metric.value.fr));
|
|
181
|
+
const indexModel = (target: Ref<number>) =>
|
|
182
|
+
computed<string[]>({
|
|
183
|
+
get: () => [String(target.value)],
|
|
184
|
+
set: (values) => {
|
|
185
|
+
if (values[0] !== undefined) target.value = Number(values[0]);
|
|
186
|
+
},
|
|
187
|
+
});
|
|
188
|
+
const metricModel = indexModel(metricIndex);
|
|
189
|
+
const periodModel = indexModel(periodIndex);
|
|
190
|
+
const metricChoices = computed(() => METRICS.map((m, i) => ({ value: String(i), label: en.value ? m.en : m.fr })));
|
|
191
|
+
const periodLabel = (count: number | null) =>
|
|
192
|
+
count === null ? (en.value ? "All" : "Tout") : en.value ? `Last ${count} months` : `${count} derniers mois`;
|
|
193
|
+
const periodChoices = computed(() => PERIODS.map((p, i) => ({ value: String(i), label: periodLabel(p) })));
|
|
194
|
+
|
|
195
|
+
// ::::::: lecture des mois :::::::
|
|
196
|
+
const rows = computed<any[]>(() => doc.value?.item_level ?? []);
|
|
197
|
+
const categories = computed(() => [...new Set(rows.value.map((r) => String(r.patient_category ?? "")).filter(Boolean))].sort());
|
|
198
|
+
const sections = computed(() => [...new Set(rows.value.map((r) => String(r.drug_type_category ?? "")).filter(Boolean))].sort());
|
|
199
|
+
/** Tout coche vaut rien de coche. */
|
|
200
|
+
const kept = (row: any) => !selectedCategories.value.length || selectedCategories.value.includes(row.patient_category);
|
|
201
|
+
|
|
202
|
+
/** Somme de l'indicateur par mois, selon une cle de regroupement. */
|
|
203
|
+
function sumBy(group: (row: any) => string) {
|
|
204
|
+
const out: Record<string, Record<string, number>> = {};
|
|
205
|
+
for (const row of rows.value) {
|
|
206
|
+
if (!kept(row) || !row.period) continue;
|
|
207
|
+
const bucket = (out[group(row)] ??= {});
|
|
208
|
+
bucket[row.period] = (bucket[row.period] ?? 0) + (Number(row[metric.value.key as MetricKey]) || 0);
|
|
209
|
+
}
|
|
210
|
+
return out;
|
|
211
|
+
}
|
|
212
|
+
const total = computed(() => sumBy(() => "total").total ?? {});
|
|
213
|
+
const bySection = computed(() => sumBy((row) => String(row.drug_type_category ?? "Unknown")));
|
|
214
|
+
const byCategory = computed(() => sumBy((row) => String(row.patient_category ?? "")));
|
|
215
|
+
|
|
216
|
+
const allPeriods = computed(() => Object.keys(total.value).sort());
|
|
217
|
+
const latest = computed(() => allPeriods.value[allPeriods.value.length - 1] ?? "");
|
|
218
|
+
const shownPeriods = computed(() => {
|
|
219
|
+
const count = PERIODS[periodIndex.value];
|
|
220
|
+
return count ? allPeriods.value.slice(-count) : allPeriods.value;
|
|
221
|
+
});
|
|
222
|
+
/** Le detail se lit du plus recent au plus ancien. */
|
|
223
|
+
const detailPeriods = computed(() => [...shownPeriods.value].reverse());
|
|
224
|
+
|
|
225
|
+
// ::::::: formats :::::::
|
|
226
|
+
const MONTHS = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
|
|
227
|
+
const monthLabel = (period: string) => {
|
|
228
|
+
const [y, m] = period.split("-");
|
|
229
|
+
return y && m ? `${MONTHS[Number(m) - 1]} ${y}` : period;
|
|
230
|
+
};
|
|
231
|
+
const locale = computed(() => (en.value ? "en-GB" : "fr-FR"));
|
|
232
|
+
const round = (value: number) => Math.round(value * 100) / 100;
|
|
233
|
+
const formatValue = (value: number) =>
|
|
234
|
+
metric.value.money
|
|
235
|
+
? `${Math.round(value).toLocaleString(locale.value)} A$`
|
|
236
|
+
: Math.round(value).toLocaleString(locale.value);
|
|
237
|
+
const signedPercent = (value: number) =>
|
|
238
|
+
`${value >= 0 ? "+" : ""}${(value * 100).toLocaleString(locale.value, { maximumFractionDigits: 1 })}%`;
|
|
239
|
+
const chartTitle = computed(() =>
|
|
240
|
+
en.value ? `${metricLabel.value} evolution` : `Évolution : ${metricLabel.value.toLowerCase()}`,
|
|
241
|
+
);
|
|
242
|
+
|
|
243
|
+
// ::::::: fenetres glissantes, comme la synthese de la page :::::::
|
|
244
|
+
const shiftMonth = (period: string, delta: number) => {
|
|
245
|
+
const [y, m] = period.split("-").map(Number);
|
|
246
|
+
const months = y! * 12 + (m! - 1) + delta;
|
|
247
|
+
return `${Math.floor(months / 12)}-${String((months % 12) + 1).padStart(2, "0")}`;
|
|
248
|
+
};
|
|
249
|
+
const monthsBack = (anchor: string, count: number) => Array.from({ length: count }, (_, i) => shiftMonth(anchor, -i));
|
|
250
|
+
const rangeLabel = (periods: string[]) => {
|
|
251
|
+
const sorted = [...periods].sort();
|
|
252
|
+
return sorted.length === 1 ? monthLabel(sorted[0]!) : `${monthLabel(sorted[0]!)} - ${monthLabel(sorted[sorted.length - 1]!)}`;
|
|
253
|
+
};
|
|
254
|
+
|
|
255
|
+
const windows = computed(() => {
|
|
256
|
+
const anchor = latest.value;
|
|
257
|
+
if (!anchor) return [];
|
|
258
|
+
const monthOfYear = Number(anchor.split("-")[1]);
|
|
259
|
+
return [
|
|
260
|
+
{ key: "1", en: "Last month", fr: "Dernier mois", periods: monthsBack(anchor, 1) },
|
|
261
|
+
{ key: "3", en: "Last 3 months", fr: "3 derniers mois", periods: monthsBack(anchor, 3) },
|
|
262
|
+
{ key: "12", en: "Last 12 months", fr: "12 derniers mois", periods: monthsBack(anchor, 12) },
|
|
263
|
+
{ key: "ytd", en: "YTD", fr: "Depuis janvier", periods: monthsBack(anchor, monthOfYear) },
|
|
264
|
+
].map((w) => ({ ...w, previous: w.periods.map((p) => shiftMonth(p, -12)) }));
|
|
265
|
+
});
|
|
266
|
+
|
|
267
|
+
const windowColumns = computed(() => [
|
|
268
|
+
{ key: "label", label: en.value ? "Item code" : "Code item", rowHeader: true, minWidth: "140px" },
|
|
269
|
+
...windows.value.map((w, i) => ({
|
|
270
|
+
key: `w${i}`,
|
|
271
|
+
label: en.value ? w.en : w.fr,
|
|
272
|
+
sublabel: `${rangeLabel(w.periods)} vs ${rangeLabel(w.previous)}`,
|
|
273
|
+
numeric: true,
|
|
274
|
+
})),
|
|
275
|
+
]);
|
|
276
|
+
|
|
277
|
+
const sumOver = (byPeriod: Record<string, number>, periods: string[]) =>
|
|
278
|
+
periods.reduce((sum, p) => sum + (byPeriod[p] ?? 0), 0);
|
|
279
|
+
const cellsFor = (byPeriod: Record<string, number>) =>
|
|
280
|
+
Object.fromEntries(
|
|
281
|
+
windows.value.map((w, i) => {
|
|
282
|
+
const current = sumOver(byPeriod, w.periods);
|
|
283
|
+
const previous = sumOver(byPeriod, w.previous);
|
|
284
|
+
// sans base l'an dernier, une evolution ne voudrait rien dire
|
|
285
|
+
return [`w${i}`, { value: current, evolution: previous > 0 ? (current - previous) / previous : null }];
|
|
286
|
+
}),
|
|
287
|
+
);
|
|
288
|
+
|
|
289
|
+
// Le code item en ligne forte, puis une ligne par section quand il en a plusieurs.
|
|
290
|
+
const windowRows = computed(() => [
|
|
291
|
+
{ label: `PBS ${doc.value?.local_drug_id || code.value}`, isTotal: true, ...cellsFor(total.value) },
|
|
292
|
+
...(Object.keys(bySection.value).length > 1
|
|
293
|
+
? Object.entries(bySection.value).map(([label, byPeriod]) => ({ label, isTotal: false, ...cellsFor(byPeriod) }))
|
|
294
|
+
: []),
|
|
295
|
+
]);
|
|
296
|
+
|
|
297
|
+
// ::::::: detail mensuel par categorie de patients :::::::
|
|
298
|
+
const detailColumns = computed(() => [
|
|
299
|
+
{ key: "label", label: en.value ? "Patient category" : "Catégorie de patients", rowHeader: true, minWidth: "200px" },
|
|
300
|
+
...detailPeriods.value.map((p) => ({ key: p, label: monthLabel(p), numeric: true })),
|
|
301
|
+
]);
|
|
302
|
+
const detailRows = computed(() => {
|
|
303
|
+
const line = (label: string, byPeriod: Record<string, number>, isTotal: boolean) => ({
|
|
304
|
+
label,
|
|
305
|
+
isTotal,
|
|
306
|
+
...Object.fromEntries(detailPeriods.value.map((p) => [p, byPeriod[p] ?? null])),
|
|
307
|
+
});
|
|
308
|
+
return [
|
|
309
|
+
line("Total", total.value, true),
|
|
310
|
+
...Object.entries(byCategory.value)
|
|
311
|
+
.sort(([a], [b]) => a.localeCompare(b))
|
|
312
|
+
.map(([label, byPeriod]) => line(label, byPeriod, false)),
|
|
313
|
+
];
|
|
314
|
+
});
|
|
315
|
+
|
|
316
|
+
async function read() {
|
|
317
|
+
loading.value = true;
|
|
318
|
+
const hit = await oipEsGet<any>("drugs", AUSTRALIA_INDEX.reimbursement, props.id).catch(() => null);
|
|
319
|
+
doc.value = hit?._source ?? null;
|
|
320
|
+
selectedCategories.value = [];
|
|
321
|
+
loading.value = false;
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
watch(() => props.id, read, { immediate: true });
|
|
325
|
+
</script>
|
|
326
|
+
|
|
327
|
+
<style scoped>
|
|
328
|
+
.oip-au__controls {
|
|
329
|
+
display: flex;
|
|
330
|
+
flex-wrap: wrap;
|
|
331
|
+
align-items: flex-end;
|
|
332
|
+
gap: var(--space-12);
|
|
333
|
+
}
|
|
334
|
+
.oip-au__note--spaced {
|
|
335
|
+
margin-bottom: var(--space-12);
|
|
336
|
+
}
|
|
337
|
+
.oip-au__nowrap {
|
|
338
|
+
white-space: nowrap;
|
|
339
|
+
}
|
|
340
|
+
.oip-au__evo {
|
|
341
|
+
margin-left: var(--space-4);
|
|
342
|
+
font-size: var(--font-12);
|
|
343
|
+
white-space: nowrap;
|
|
344
|
+
}
|
|
345
|
+
.oip-au__evo--up {
|
|
346
|
+
color: var(--color-success);
|
|
347
|
+
}
|
|
348
|
+
.oip-au__evo--down {
|
|
349
|
+
color: var(--color-danger);
|
|
350
|
+
}
|
|
351
|
+
</style>
|
|
@@ -108,6 +108,10 @@ const VIEW_LOADERS: Record<string, () => Promise<any>> = {
|
|
|
108
108
|
"italy-aifa-act": () => import("../components/oip-italy/AifaAct.vue"),
|
|
109
109
|
"italy-price": () => import("../components/oip-italy/ItalyPrice.vue"),
|
|
110
110
|
"italy-reimbursement": () => import("../components/oip-italy/Reimbursement.vue"),
|
|
111
|
+
"australia-pbac": () => import("../components/oip-australia/PbacOpinion.vue"),
|
|
112
|
+
"australia-price": () => import("../components/oip-australia/AustraliaPrice.vue"),
|
|
113
|
+
"australia-item": () => import("../components/oip-australia/PbsItem.vue"),
|
|
114
|
+
"australia-reimbursement": () => import("../components/oip-australia/Reimbursement.vue"),
|
|
111
115
|
};
|
|
112
116
|
|
|
113
117
|
const cache = new Map<string, Component>();
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/* Mise en page commune aux fiches d'Australia One dans le tiroir des projets
|
|
2
|
+
(components/oip-australia), globale comme drugs.css : prefixe .oip-au. */
|
|
3
|
+
.oip-au__body {
|
|
4
|
+
display: flex;
|
|
5
|
+
flex-direction: column;
|
|
6
|
+
gap: var(--space-16);
|
|
7
|
+
padding: var(--space-20) var(--space-32) var(--space-32);
|
|
8
|
+
}
|
|
9
|
+
.oip-au__title {
|
|
10
|
+
margin-right: var(--space-12);
|
|
11
|
+
}
|
|
12
|
+
.oip-au__tags {
|
|
13
|
+
display: flex;
|
|
14
|
+
flex-wrap: wrap;
|
|
15
|
+
gap: var(--space-6);
|
|
16
|
+
}
|
|
17
|
+
.oip-au__card-title {
|
|
18
|
+
margin: 0 0 var(--space-12);
|
|
19
|
+
font-size: var(--font-16);
|
|
20
|
+
font-weight: var(--weight-bold);
|
|
21
|
+
}
|
|
22
|
+
.oip-au__figures {
|
|
23
|
+
display: flex;
|
|
24
|
+
flex-wrap: wrap;
|
|
25
|
+
gap: var(--space-12) var(--space-32);
|
|
26
|
+
}
|
|
27
|
+
.oip-au__figure {
|
|
28
|
+
display: flex;
|
|
29
|
+
flex-direction: column;
|
|
30
|
+
gap: 2px;
|
|
31
|
+
}
|
|
32
|
+
.oip-au__figure-label,
|
|
33
|
+
.oip-au__figure-note {
|
|
34
|
+
color: var(--text-muted);
|
|
35
|
+
font-size: var(--font-12);
|
|
36
|
+
}
|
|
37
|
+
.oip-au__figure-value {
|
|
38
|
+
font-size: var(--font-22);
|
|
39
|
+
font-weight: var(--weight-bold);
|
|
40
|
+
font-variant-numeric: tabular-nums;
|
|
41
|
+
}
|
|
42
|
+
.oip-au__rows {
|
|
43
|
+
display: grid;
|
|
44
|
+
grid-template-columns: minmax(140px, max-content) 1fr;
|
|
45
|
+
gap: var(--space-8) var(--space-20);
|
|
46
|
+
margin: 0;
|
|
47
|
+
font-size: var(--font-14);
|
|
48
|
+
}
|
|
49
|
+
.oip-au__rows--spaced {
|
|
50
|
+
margin-top: var(--space-20);
|
|
51
|
+
}
|
|
52
|
+
.oip-au__rows dt {
|
|
53
|
+
padding-top: 2px;
|
|
54
|
+
color: var(--text-muted);
|
|
55
|
+
font-size: var(--font-12);
|
|
56
|
+
font-weight: var(--weight-semibold);
|
|
57
|
+
text-transform: uppercase;
|
|
58
|
+
}
|
|
59
|
+
.oip-au__rows dd {
|
|
60
|
+
margin: 0;
|
|
61
|
+
line-height: 1.5;
|
|
62
|
+
}
|
|
63
|
+
.oip-au__links {
|
|
64
|
+
display: flex;
|
|
65
|
+
flex-wrap: wrap;
|
|
66
|
+
gap: var(--space-16);
|
|
67
|
+
margin-top: var(--space-16);
|
|
68
|
+
}
|
|
69
|
+
.oip-au__link {
|
|
70
|
+
color: var(--color-primary);
|
|
71
|
+
font-size: var(--font-14);
|
|
72
|
+
font-weight: var(--weight-medium);
|
|
73
|
+
}
|
|
74
|
+
.oip-au__note {
|
|
75
|
+
margin: 0;
|
|
76
|
+
color: var(--text-muted);
|
|
77
|
+
font-size: var(--font-13);
|
|
78
|
+
}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Les familles qu'Australia One range dans un projet, decrites pour tout le
|
|
3
|
+
* portail : avis du PBAC (PSD), prix des presentations australiennes (Price
|
|
4
|
+
* Tracker), codes items du PBS et remboursement PBS d'un code item. Le tiroir
|
|
5
|
+
* d'un projet les montre par leurs vues (components/oip-australia) ; la ligne
|
|
6
|
+
* du projet mene a la page de l'app.
|
|
7
|
+
*
|
|
8
|
+
* Index lus sur le cluster `drugs` (meme domaine que fr_drugs_app, cle
|
|
9
|
+
* principale ; cf. runtimeConfig.oipEs.drugs).
|
|
10
|
+
*
|
|
11
|
+
* Importe aussi par le serveur : pas d'import propre a Vue ou a Nuxt ici.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
import type { RmProjectKind } from "@tekkare/romulus/utils/projects";
|
|
15
|
+
|
|
16
|
+
const AUSTRALIA = { fr: "Australie", en: "Australia" };
|
|
17
|
+
|
|
18
|
+
/** Les index des fiches d'Australia One, relus aussi par leurs vues de tiroir. */
|
|
19
|
+
export const AUSTRALIA_INDEX = {
|
|
20
|
+
/** Avis publics du PBAC, `_id` = URL de la PSD sur pbs.gov.au. */
|
|
21
|
+
pbac: "au__drug_opinion__pbac",
|
|
22
|
+
prices: "ope__ww_price_tracker__tekkare",
|
|
23
|
+
/** Dictionnaire des codes items du PBS, `_id` = AU_ITEM_<code>. */
|
|
24
|
+
items: "ope_au_retail_drug_item_dictionary_tekkare",
|
|
25
|
+
/** Remboursement PBS mensuel par code item, meme `_id` que le dictionnaire. */
|
|
26
|
+
reimbursement: "ope_au_retail_drug_product_tekkare",
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
const day = (value: unknown) => String(value ?? "").slice(0, 10);
|
|
30
|
+
const itemCode = (id: string) => id.replace(/^AU_ITEM_/, "");
|
|
31
|
+
|
|
32
|
+
/** Page d'un groupe d'avis : par marque, par molecule pour les PSD sans marque. */
|
|
33
|
+
function pbacPath(s: any) {
|
|
34
|
+
const brand = String(s?.brand ?? "").trim();
|
|
35
|
+
if (brand && brand.toUpperCase() !== "NAN") return `/approvals/details/brand/${encodeURIComponent(brand)}`;
|
|
36
|
+
const molecule = String(s?.drug_label ?? "").trim();
|
|
37
|
+
return molecule ? `/approvals/details/molecule/${encodeURIComponent(molecule)}` : "/approvals";
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export const AUSTRALIA_PROJECT_KINDS: RmProjectKind[] = [
|
|
41
|
+
{
|
|
42
|
+
// Un avis public du PBAC (PSD). Une carte marque range ses avis ; la page
|
|
43
|
+
// de la marque les montre tous.
|
|
44
|
+
type: "AuPbacOpinion",
|
|
45
|
+
index: AUSTRALIA_INDEX.pbac,
|
|
46
|
+
label: { fr: "Avis du PBAC", en: "PBAC opinions" },
|
|
47
|
+
section: AUSTRALIA,
|
|
48
|
+
country: "au",
|
|
49
|
+
icon: "Certificate",
|
|
50
|
+
source: ["brand", "drug_label", "indication", "meeting_date", "owner"],
|
|
51
|
+
title: (s) => String(s?.brand || s?.drug_label || ""),
|
|
52
|
+
subtitle: (s) => [s?.drug_label !== s?.brand ? s?.drug_label : "", s?.indication, day(s?.meeting_date)].filter(Boolean).join(" · "),
|
|
53
|
+
path: (s) => pbacPath(s),
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
// Une presentation du Price Tracker (`_id` = au_<AMT>_<n>, suffixe
|
|
57
|
+
// variable : lire `hit._id`, ne jamais le reconstruire).
|
|
58
|
+
type: "AuPbsPrice",
|
|
59
|
+
index: AUSTRALIA_INDEX.prices,
|
|
60
|
+
label: { fr: "Prix (Australie)", en: "Prices (Australia)" },
|
|
61
|
+
section: AUSTRALIA,
|
|
62
|
+
country: "au",
|
|
63
|
+
icon: "Tag",
|
|
64
|
+
source: ["brand", "label_local", "local_drug_id", "manufacturer_regroup", "manufacturer"],
|
|
65
|
+
title: (s) => String(s?.label_local ?? s?.brand ?? ""),
|
|
66
|
+
subtitle: (s) =>
|
|
67
|
+
[s?.brand, s?.local_drug_id ? `AMT ${s.local_drug_id}` : "", s?.manufacturer_regroup ?? s?.manufacturer]
|
|
68
|
+
.filter(Boolean)
|
|
69
|
+
.join(" · "),
|
|
70
|
+
path: (_s, id) => `/price-tracker/details/${encodeURIComponent(id)}?c=au`,
|
|
71
|
+
titleFromId: (id) => `AMT ${id.replace(/^au_/, "").replace(/_\d+$/, "")}`,
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
// Un code item du PBS : forme, dosage, prix delivre, restrictions.
|
|
75
|
+
type: "AuPbsItem",
|
|
76
|
+
index: AUSTRALIA_INDEX.items,
|
|
77
|
+
label: { fr: "Codes items PBS", en: "PBS item codes" },
|
|
78
|
+
section: AUSTRALIA,
|
|
79
|
+
country: "au",
|
|
80
|
+
icon: "Pill",
|
|
81
|
+
source: ["item_code", "generic_name", "form_strength", "local_label", "atc5_code"],
|
|
82
|
+
title: (s) => String(s?.local_label ?? s?.generic_name ?? ""),
|
|
83
|
+
subtitle: (s) => [s?.item_code ? `PBS ${s.item_code}` : "", s?.atc5_code ? `ATC5 ${s.atc5_code}` : ""].filter(Boolean).join(" · "),
|
|
84
|
+
path: () => "/drugs/search",
|
|
85
|
+
titleFromId: (id) => `PBS ${itemCode(id)}`,
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
// Le remboursement PBS d'un code item (prescriptions, cout, part de
|
|
89
|
+
// l'Etat et du patient, mois par mois).
|
|
90
|
+
type: "AuDrugReimbursement",
|
|
91
|
+
index: AUSTRALIA_INDEX.reimbursement,
|
|
92
|
+
label: { fr: "Remboursement PBS", en: "PBS reimbursement" },
|
|
93
|
+
section: AUSTRALIA,
|
|
94
|
+
country: "au",
|
|
95
|
+
icon: "ChartLine",
|
|
96
|
+
source: ["local_label", "local_drug_id", "code_label", "brands"],
|
|
97
|
+
title: (s) => String(s?.local_label ?? ""),
|
|
98
|
+
subtitle: (s) =>
|
|
99
|
+
[s?.local_drug_id ? `PBS ${s.local_drug_id}` : "", s?.code_label, (s?.brands ?? []).join(", ")].filter(Boolean).join(" · "),
|
|
100
|
+
path: () => "/drugs/retail",
|
|
101
|
+
titleFromId: (id) => `PBS ${itemCode(id)}`,
|
|
102
|
+
},
|
|
103
|
+
];
|
|
@@ -20,6 +20,7 @@ import { OIP_PATIENT_INDEXES } from "../oip-patients/indexes";
|
|
|
20
20
|
import { PATIENT_KIND, VACCINE_KIND } from "../oip-patients/kinds";
|
|
21
21
|
import { GERMANY_PROJECT_KINDS } from "../oip-germany/kinds";
|
|
22
22
|
import { ITALY_PROJECT_KINDS } from "../oip-italy/kinds";
|
|
23
|
+
import { AUSTRALIA_PROJECT_KINDS } from "../oip-australia/kinds";
|
|
23
24
|
|
|
24
25
|
/** Les apps qui ont des fiches a montrer, et ou les ouvrir. */
|
|
25
26
|
export const OIP_RESOURCE_APPS = {
|
|
@@ -43,6 +44,10 @@ export const OIP_RESOURCE_APPS = {
|
|
|
43
44
|
name: "Italy One",
|
|
44
45
|
url: "https://italy-one.app.tekkare.com",
|
|
45
46
|
},
|
|
47
|
+
australia_one_app: {
|
|
48
|
+
name: "Australia One",
|
|
49
|
+
url: "https://australia-one.app.tekkare.com",
|
|
50
|
+
},
|
|
46
51
|
} as const;
|
|
47
52
|
|
|
48
53
|
export type OipResourceApp = keyof typeof OIP_RESOURCE_APPS;
|
|
@@ -197,6 +202,28 @@ function italySpec(kind: RmProjectKind, view: string): OipResourceSpec {
|
|
|
197
202
|
};
|
|
198
203
|
}
|
|
199
204
|
|
|
205
|
+
function australiaSpec(kind: RmProjectKind, view: string): OipResourceSpec {
|
|
206
|
+
return {
|
|
207
|
+
type: kind.type,
|
|
208
|
+
app: "australia_one_app",
|
|
209
|
+
cluster: "drugs",
|
|
210
|
+
kind,
|
|
211
|
+
routeId: (id) => id,
|
|
212
|
+
base: () => "",
|
|
213
|
+
tabs: [],
|
|
214
|
+
view,
|
|
215
|
+
detailPath: (id, _tab, doc) => kind.path?.(doc ?? {}, id) ?? "",
|
|
216
|
+
};
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
/** La fiche de chaque famille d'Australia One (cf. useOipResourceViews). */
|
|
220
|
+
const AUSTRALIA_VIEWS: Record<string, string> = {
|
|
221
|
+
AuPbacOpinion: "australia-pbac",
|
|
222
|
+
AuPbsPrice: "australia-price",
|
|
223
|
+
AuPbsItem: "australia-item",
|
|
224
|
+
AuDrugReimbursement: "australia-reimbursement",
|
|
225
|
+
};
|
|
226
|
+
|
|
200
227
|
/** La fiche de chaque famille d'Italy One (cf. useOipResourceViews). */
|
|
201
228
|
const ITALY_VIEWS: Record<string, string> = {
|
|
202
229
|
ItApproval: "italy-aifa-act",
|
|
@@ -443,6 +470,7 @@ export const OIP_RESOURCE_SPECS: OipResourceSpec[] = [
|
|
|
443
470
|
patientsSpec(VACCINE_KIND, "patients-vaccine"),
|
|
444
471
|
...GERMANY_PROJECT_KINDS.map((kind) => germanySpec(kind, GERMANY_VIEWS[kind.type]!)),
|
|
445
472
|
...ITALY_PROJECT_KINDS.map((kind) => italySpec(kind, ITALY_VIEWS[kind.type]!)),
|
|
473
|
+
...AUSTRALIA_PROJECT_KINDS.map((kind) => australiaSpec(kind, AUSTRALIA_VIEWS[kind.type]!)),
|
|
446
474
|
];
|
|
447
475
|
|
|
448
476
|
export function oipResourceSpec(type: string): OipResourceSpec | undefined {
|
package/layer/nuxt.config.ts
CHANGED
|
@@ -44,6 +44,7 @@ export default defineNuxtConfig({
|
|
|
44
44
|
fileURLToPath(new URL("./app/oip-science/science.css", import.meta.url)),
|
|
45
45
|
fileURLToPath(new URL("./app/oip-drugs/drugs.css", import.meta.url)),
|
|
46
46
|
fileURLToPath(new URL("./app/oip-patients/patients.css", import.meta.url)),
|
|
47
|
+
fileURLToPath(new URL("./app/oip-australia/australia.css", import.meta.url)),
|
|
47
48
|
],
|
|
48
49
|
// Reglages serveur propres au layer. Les cles Directus (directus*Url,
|
|
49
50
|
// directus*Token) restent declarees par l'app, qui les avait deja.
|
|
@@ -6,6 +6,7 @@ import { ES_INDEX } from "../../../app/oip-drugs/esIndices";
|
|
|
6
6
|
import { OIP_PATIENT_INDEXES } from "../../../app/oip-patients/indexes";
|
|
7
7
|
import { GERMANY_INDEX } from "../../../app/oip-germany/kinds";
|
|
8
8
|
import { ITALY_INDEX } from "../../../app/oip-italy/kinds";
|
|
9
|
+
import { AUSTRALIA_INDEX } from "../../../app/oip-australia/kinds";
|
|
9
10
|
|
|
10
11
|
/**
|
|
11
12
|
* POST /api/oip/es?cluster=&index=, servi par le layer OIP.
|
|
@@ -41,6 +42,13 @@ const GERMANY_INDEXES = new Set<string>(Object.values(GERMANY_INDEX));
|
|
|
41
42
|
*/
|
|
42
43
|
const ITALY_INDEXES = new Set<string>([ITALY_INDEX.directory, ITALY_INDEX.reimbursement]);
|
|
43
44
|
|
|
45
|
+
/**
|
|
46
|
+
* Index d'Australia One hors du catalogue de fr_drugs_app (avis du PBAC,
|
|
47
|
+
* dictionnaire et remboursement des codes items PBS) : par leur nom, avec la
|
|
48
|
+
* cle principale.
|
|
49
|
+
*/
|
|
50
|
+
const AUSTRALIA_INDEXES = new Set<string>([AUSTRALIA_INDEX.pbac, AUSTRALIA_INDEX.items, AUSTRALIA_INDEX.reimbursement]);
|
|
51
|
+
|
|
44
52
|
const DRUG_IDS = new Set<string>(Object.values(ES_INDEX) as string[]);
|
|
45
53
|
const ASSOCIATION_IDS = new Set<string>(
|
|
46
54
|
Object.entries(ES_INDEX)
|
|
@@ -59,7 +67,7 @@ const APPROVAL_IDS = new Set<string>(
|
|
|
59
67
|
* Vide si l'index n'est pas au catalogue.
|
|
60
68
|
*/
|
|
61
69
|
async function drugsKeyOf(ref: string): Promise<string> {
|
|
62
|
-
if (DRUG_IDS.has(ref) || GERMANY_INDEXES.has(ref) || ITALY_INDEXES.has(ref)) return ref;
|
|
70
|
+
if (DRUG_IDS.has(ref) || GERMANY_INDEXES.has(ref) || ITALY_INDEXES.has(ref) || AUSTRALIA_INDEXES.has(ref)) return ref;
|
|
63
71
|
const id = (await findOipEsIndex(ref).catch(() => undefined))?.id;
|
|
64
72
|
return id && DRUG_IDS.has(id) ? id : "";
|
|
65
73
|
}
|