@tekkare/romulus 0.1.289 → 0.1.291
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/dist/runtime/components/ChoroplethMap.vue +2 -1
- package/dist/runtime/internal/geo/index.js +6 -0
- package/dist/runtime/internal/geo/nz.json +62 -0
- 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 +180 -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
|
@@ -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,180 @@
|
|
|
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
|
+
identite, chiffres des 12 derniers mois publies, courbe mensuelle et
|
|
5
|
+
tableau par annee. Les mois se lisent dans `item_level` (un objet par mois
|
|
6
|
+
et categorie de patients), additionnes ici.
|
|
7
|
+
|
|
8
|
+
Montee par le tiroir des projets ; le lien vers l'app passe par le slot
|
|
9
|
+
`title-link`.
|
|
10
|
+
-->
|
|
11
|
+
<template>
|
|
12
|
+
<div class="oip-au">
|
|
13
|
+
<RmPageHeader :eyebrow="en ? 'PBS reimbursement, Australia' : 'Remboursement PBS, Australie'">
|
|
14
|
+
<template #title>
|
|
15
|
+
<span class="oip-au__title">{{ doc?.local_label || code }}</span>
|
|
16
|
+
<slot name="title-link" />
|
|
17
|
+
</template>
|
|
18
|
+
</RmPageHeader>
|
|
19
|
+
|
|
20
|
+
<div class="oip-au__body">
|
|
21
|
+
<RmLoadingState v-if="loading" spinner />
|
|
22
|
+
<RmEmptyState v-else-if="!doc" icon="Prohibit" :title="en ? 'Item code not found' : 'Code item introuvable'" />
|
|
23
|
+
<template v-else>
|
|
24
|
+
<div class="oip-au__tags">
|
|
25
|
+
<RmTag variant="gray">PBS {{ doc.local_drug_id || code }}</RmTag>
|
|
26
|
+
<RmTag v-if="doc.code_label" variant="blue">{{ doc.code_label }}</RmTag>
|
|
27
|
+
<RmTag v-for="brand in doc.brands ?? []" :key="brand" variant="indigo">{{ brand }}</RmTag>
|
|
28
|
+
</div>
|
|
29
|
+
|
|
30
|
+
<RmCard padding="md">
|
|
31
|
+
<h3 class="oip-au__card-title">
|
|
32
|
+
{{ en ? "Last 12 months" : "12 derniers mois" }}
|
|
33
|
+
<span v-if="lastPeriod" class="oip-au__figure-note">({{ en ? "to" : "jusqu'à" }} {{ month(lastPeriod) }})</span>
|
|
34
|
+
</h3>
|
|
35
|
+
<div class="oip-au__figures">
|
|
36
|
+
<div v-for="figure in lastYear" :key="figure.label" class="oip-au__figure">
|
|
37
|
+
<span class="oip-au__figure-label">{{ figure.label }}</span>
|
|
38
|
+
<span class="oip-au__figure-value">{{ figure.value }}</span>
|
|
39
|
+
</div>
|
|
40
|
+
</div>
|
|
41
|
+
</RmCard>
|
|
42
|
+
|
|
43
|
+
<RmCard v-if="months.length" padding="md">
|
|
44
|
+
<div class="oip-au__chart-head">
|
|
45
|
+
<h3 class="oip-au__card-title">{{ en ? "Monthly evolution" : "Évolution mensuelle" }}</h3>
|
|
46
|
+
<RmSegmented v-model="metric" size="sm" :options="metricOptions" :aria-label="en ? 'Measure' : 'Mesure'" />
|
|
47
|
+
</div>
|
|
48
|
+
<RmLineChart
|
|
49
|
+
:categories="months.map((m) => month(m.period))"
|
|
50
|
+
:series="[{ name: metricLabel, data: months.map((m) => Math.round(m[metric] * 100) / 100) }]"
|
|
51
|
+
:height="260"
|
|
52
|
+
:value-formatter="metric === 'prescriptions' ? number : money"
|
|
53
|
+
:description="metricLabel"
|
|
54
|
+
/>
|
|
55
|
+
</RmCard>
|
|
56
|
+
|
|
57
|
+
<RmCard v-if="years.length" padding="md">
|
|
58
|
+
<h3 class="oip-au__card-title">{{ en ? "By year" : "Par année" }}</h3>
|
|
59
|
+
<RmTable
|
|
60
|
+
:columns="yearColumns"
|
|
61
|
+
:rows="years"
|
|
62
|
+
compact
|
|
63
|
+
flat
|
|
64
|
+
max-height="none"
|
|
65
|
+
:empty-text="en ? 'No data' : 'Aucune donnée'"
|
|
66
|
+
/>
|
|
67
|
+
</RmCard>
|
|
68
|
+
</template>
|
|
69
|
+
</div>
|
|
70
|
+
</div>
|
|
71
|
+
</template>
|
|
72
|
+
|
|
73
|
+
<script setup lang="ts">
|
|
74
|
+
import { oipEsGet } from "../../composables/useOipResources";
|
|
75
|
+
import { AUSTRALIA_INDEX } from "../../oip-australia/kinds";
|
|
76
|
+
|
|
77
|
+
const props = withDefaults(
|
|
78
|
+
defineProps<{
|
|
79
|
+
/** Le `resourceId` : `_id` du code item (AU_ITEM_<code>). */
|
|
80
|
+
id: string;
|
|
81
|
+
type?: string;
|
|
82
|
+
lang?: "fr" | "en";
|
|
83
|
+
highlight?: string[];
|
|
84
|
+
}>(),
|
|
85
|
+
{ type: "AuDrugReimbursement", lang: "fr", highlight: () => [] },
|
|
86
|
+
);
|
|
87
|
+
|
|
88
|
+
type Metric = "prescriptions" | "total_cost" | "government_contribution" | "patient_contribution";
|
|
89
|
+
const METRICS: Metric[] = ["prescriptions", "total_cost", "government_contribution", "patient_contribution"];
|
|
90
|
+
|
|
91
|
+
const en = computed(() => props.lang === "en");
|
|
92
|
+
const loading = ref(true);
|
|
93
|
+
const doc = ref<Record<string, any> | null>(null);
|
|
94
|
+
const code = computed(() => props.id.replace(/^AU_ITEM_/, ""));
|
|
95
|
+
const metric = ref<Metric>("prescriptions");
|
|
96
|
+
|
|
97
|
+
const LABELS: Record<Metric, { fr: string; en: string }> = {
|
|
98
|
+
prescriptions: { fr: "Prescriptions", en: "Prescriptions" },
|
|
99
|
+
total_cost: { fr: "Coût total", en: "Total cost" },
|
|
100
|
+
government_contribution: { fr: "Part de l'État", en: "Government contribution" },
|
|
101
|
+
patient_contribution: { fr: "Part du patient", en: "Patient contribution" },
|
|
102
|
+
};
|
|
103
|
+
const label = (key: Metric) => (en.value ? LABELS[key].en : LABELS[key].fr);
|
|
104
|
+
const metricLabel = computed(() => label(metric.value));
|
|
105
|
+
const metricOptions = computed(() => METRICS.map((key) => ({ value: key, label: label(key) })));
|
|
106
|
+
|
|
107
|
+
const locale = computed(() => (en.value ? "en-GB" : "fr-FR"));
|
|
108
|
+
const number = (value: number) => Math.round(value).toLocaleString(locale.value);
|
|
109
|
+
const money = (value: number) => `${Math.round(value).toLocaleString(locale.value)} A$`;
|
|
110
|
+
const month = (period: string) => {
|
|
111
|
+
const parsed = new Date(`${period}-01`);
|
|
112
|
+
return Number.isNaN(parsed.getTime()) ? period : parsed.toLocaleDateString(locale.value, { month: "short", year: "numeric" });
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
/** Les mois du code item, toutes categories de patients additionnees. */
|
|
116
|
+
const months = computed(() => {
|
|
117
|
+
const byPeriod = new Map<string, Record<Metric, number>>();
|
|
118
|
+
for (const row of doc.value?.item_level ?? []) {
|
|
119
|
+
const period = String(row?.period ?? "");
|
|
120
|
+
if (!period) continue;
|
|
121
|
+
const sums = byPeriod.get(period) ?? { prescriptions: 0, total_cost: 0, government_contribution: 0, patient_contribution: 0 };
|
|
122
|
+
for (const key of METRICS) sums[key] += Number(row?.[key]) || 0;
|
|
123
|
+
byPeriod.set(period, sums);
|
|
124
|
+
}
|
|
125
|
+
return [...byPeriod.entries()].sort(([a], [b]) => a.localeCompare(b)).map(([period, sums]) => ({ period, ...sums }));
|
|
126
|
+
});
|
|
127
|
+
|
|
128
|
+
const lastPeriod = computed(() => months.value[months.value.length - 1]?.period ?? "");
|
|
129
|
+
|
|
130
|
+
const lastYear = computed(() => {
|
|
131
|
+
const recent = months.value.slice(-12);
|
|
132
|
+
return METRICS.map((key) => {
|
|
133
|
+
const total = recent.reduce((sum, m) => sum + m[key], 0);
|
|
134
|
+
return { label: label(key), value: key === "prescriptions" ? number(total) : money(total) };
|
|
135
|
+
});
|
|
136
|
+
});
|
|
137
|
+
|
|
138
|
+
const yearColumns = computed(() => [
|
|
139
|
+
{ key: "year", label: en.value ? "Year" : "Année" },
|
|
140
|
+
...METRICS.map((key) => ({ key, label: label(key), numeric: true })),
|
|
141
|
+
]);
|
|
142
|
+
const years = computed(() => {
|
|
143
|
+
const byYear = new Map<string, Record<Metric, number>>();
|
|
144
|
+
for (const m of months.value) {
|
|
145
|
+
const year = m.period.slice(0, 4);
|
|
146
|
+
const sums = byYear.get(year) ?? { prescriptions: 0, total_cost: 0, government_contribution: 0, patient_contribution: 0 };
|
|
147
|
+
for (const key of METRICS) sums[key] += m[key];
|
|
148
|
+
byYear.set(year, sums);
|
|
149
|
+
}
|
|
150
|
+
return [...byYear.entries()]
|
|
151
|
+
.sort(([a], [b]) => b.localeCompare(a))
|
|
152
|
+
.map(([year, sums]) => ({
|
|
153
|
+
year,
|
|
154
|
+
...Object.fromEntries(METRICS.map((key) => [key, key === "prescriptions" ? number(sums[key]) : money(sums[key])])),
|
|
155
|
+
}));
|
|
156
|
+
});
|
|
157
|
+
|
|
158
|
+
async function read() {
|
|
159
|
+
loading.value = true;
|
|
160
|
+
const hit = await oipEsGet<any>("drugs", AUSTRALIA_INDEX.reimbursement, 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>
|
|
167
|
+
|
|
168
|
+
<style scoped>
|
|
169
|
+
.oip-au__chart-head {
|
|
170
|
+
display: flex;
|
|
171
|
+
flex-wrap: wrap;
|
|
172
|
+
align-items: center;
|
|
173
|
+
justify-content: space-between;
|
|
174
|
+
gap: var(--space-12);
|
|
175
|
+
margin-bottom: var(--space-12);
|
|
176
|
+
}
|
|
177
|
+
.oip-au__chart-head .oip-au__card-title {
|
|
178
|
+
margin: 0;
|
|
179
|
+
}
|
|
180
|
+
</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
|
+
];
|