@tekkare/romulus 0.1.251 → 0.1.252
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/app.config.ts +6 -0
- package/layer/app/components/OipPubmedSummary.vue +223 -0
- package/layer/app/components/OipResourceDrawer.vue +331 -0
- package/layer/app/components/OipResourceDrawerLink.vue +40 -0
- package/layer/app/components/OipResourceField.vue +41 -0
- package/layer/app/components/OipResourceGenericCard.vue +54 -0
- package/layer/app/components/OipResourceSource.vue +50 -0
- package/layer/app/components/OipResourceTags.vue +65 -0
- package/layer/app/components/OipResourceView.vue +107 -0
- package/layer/app/components/oip-drugs/fiches/AssociationFiche.vue +775 -0
- package/layer/app/components/oip-drugs/fiches/BrandFiche.vue +1111 -0
- package/layer/app/components/oip-drugs/fiches/IndicationFiche.vue +182 -0
- package/layer/app/components/oip-drugs/fiches/JoFiche.vue +101 -0
- package/layer/app/components/oip-drugs/fiches/PndsFiche.vue +279 -0
- package/layer/app/components/oip-drugs/heart/JoCard.vue +314 -0
- package/layer/app/components/oip-drugs/heart/TextHighlight.vue +326 -0
- package/layer/app/components/oip-drugs/heart/ansm/BrandCard.vue +187 -0
- package/layer/app/components/oip-drugs/heart/ansm/CisDetail.vue +363 -0
- package/layer/app/components/oip-drugs/heart/ansm/CisTable.vue +167 -0
- package/layer/app/components/oip-drugs/heart/associations/NationalAssemblyCard.vue +373 -0
- package/layer/app/components/oip-drugs/heart/associations/NationalAssemblyFiche.vue +372 -0
- package/layer/app/components/oip-drugs/heart/associations/TranscriptionCard.vue +55 -0
- package/layer/app/components/oip-drugs/heart/elastic/SourceContainerElastic.vue +103 -0
- package/layer/app/components/oip-drugs/heart/france/BrandGroupCard.vue +450 -0
- package/layer/app/components/oip-drugs/heart/mitm/Card.vue +199 -0
- package/layer/app/components/oip-drugs/heart/mitm/Source.vue +23 -0
- package/layer/app/components/oip-drugs/heart/mitm/details/Overview.vue +381 -0
- package/layer/app/components/oip-drugs/heart/put/Card.vue +212 -0
- package/layer/app/components/oip-drugs/heart/results/AccesCard.vue +696 -0
- package/layer/app/components/oip-drugs/heart/results/AlertCard.vue +342 -0
- package/layer/app/components/oip-drugs/heart/results/AsmrCursor.vue +229 -0
- package/layer/app/components/oip-drugs/heart/results/EvalCard.vue +370 -0
- package/layer/app/components/oip-drugs/heart/results/IndicCard.vue +743 -0
- package/layer/app/components/oip-drugs/heart/results/MatchExplain.vue +243 -0
- package/layer/app/components/oip-drugs/heart/results/PrefRows.vue +105 -0
- package/layer/app/components/oip-drugs/heart/results/details/HasHistory.vue +487 -0
- package/layer/app/components/oip-drugs/heart/results/details/InternationalCountryCard.vue +461 -0
- package/layer/app/components/oip-drugs/heart/results/details/InternationalOverview.vue +200 -0
- package/layer/app/components/oip-drugs/heart/results/details/InternationalPriceDrawer.vue +647 -0
- package/layer/app/components/oip-drugs/heart/results/details/Monograph.vue +128 -0
- package/layer/app/components/oip-drugs/heart/results/details/OpinionDrawer.vue +535 -0
- package/layer/app/components/oip-drugs/heart/results/details/PresentationDrawer.vue +738 -0
- package/layer/app/components/oip-drugs/heart/results/details/Price.vue +227 -0
- package/layer/app/components/oip-drugs/heart/results/details/PriceOverview.vue +1261 -0
- package/layer/app/components/oip-drugs/heart/results/details/RecordDrawer.vue +494 -0
- package/layer/app/components/oip-drugs/heart/results/details/RecordList.vue +426 -0
- package/layer/app/components/oip-drugs/heart/results/les/Card.vue +340 -0
- package/layer/app/components/oip-drugs/heart/results/les/Drawer.vue +67 -0
- package/layer/app/components/oip-drugs/heart/results/les/IndicationDetail.vue +149 -0
- package/layer/app/components/oip-drugs/heart/results/les/Source.vue +20 -0
- package/layer/app/components/oip-drugs/heart/results/les/SourceTag.vue +39 -0
- package/layer/app/components/oip-drugs/heart/searchPage/DynamicSource.vue +29 -0
- package/layer/app/components/oip-drugs/medicam/market/Chart.vue +121 -0
- package/layer/app/components/oip-drugs/outpatient/ProductEvolution.vue +236 -0
- package/layer/app/components/oip-drugs/resources/Ansm.vue +75 -0
- package/layer/app/components/oip-drugs/resources/Association.vue +30 -0
- package/layer/app/components/oip-drugs/resources/Brand.vue +65 -0
- package/layer/app/components/oip-drugs/resources/Contribution.vue +216 -0
- package/layer/app/components/oip-drugs/resources/Hospital.vue +151 -0
- package/layer/app/components/oip-drugs/resources/Indication.vue +54 -0
- package/layer/app/components/oip-drugs/resources/Jo.vue +57 -0
- package/layer/app/components/oip-drugs/resources/Medicam.vue +140 -0
- package/layer/app/components/oip-drugs/resources/Mitm.vue +84 -0
- package/layer/app/components/oip-drugs/resources/NationalAssembly.vue +93 -0
- package/layer/app/components/oip-drugs/resources/Outpatient.vue +97 -0
- package/layer/app/components/oip-drugs/resources/Pnds.vue +24 -0
- package/layer/app/components/oip-drugs/resources/Price.vue +106 -0
- package/layer/app/components/oip-drugs/resources/Put.vue +143 -0
- package/layer/app/components/oip-science/appel-a-projet/Cards.vue +162 -0
- package/layer/app/components/oip-science/clinical-trials/Cards.vue +382 -0
- package/layer/app/components/oip-science/clinical-trials/CardsGlobal.vue +273 -0
- package/layer/app/components/oip-science/clinical-trials/LinkedList.vue +366 -0
- package/layer/app/components/oip-science/clinical-trials/PairBadge.vue +25 -0
- package/layer/app/components/oip-science/clinical-trials/PairBody.vue +182 -0
- package/layer/app/components/oip-science/clinical-trials/SitesDrawer.vue +95 -0
- package/layer/app/components/oip-science/common/Form.vue +73 -0
- package/layer/app/components/oip-science/common/MatchAvgTag.vue +283 -0
- package/layer/app/components/oip-science/common/NoData.vue +16 -0
- package/layer/app/components/oip-science/common/ScoreBadge.vue +35 -0
- package/layer/app/components/oip-science/common/Source.vue +31 -0
- package/layer/app/components/oip-science/common/TableTags.vue +279 -0
- package/layer/app/components/oip-science/common/Timeline.vue +104 -0
- package/layer/app/components/oip-science/common/ToolTips.vue +89 -0
- package/layer/app/components/oip-science/cross/publicationPubmed.vue +484 -0
- package/layer/app/components/oip-science/crossData/CrossDataLocations.vue +71 -0
- package/layer/app/components/oip-science/ctgov/Investigators.vue +148 -0
- package/layer/app/components/oip-science/ctgov/Locations.vue +102 -0
- package/layer/app/components/oip-science/ctgov/Publications.vue +52 -0
- package/layer/app/components/oip-science/ctgov/Sponsors.vue +66 -0
- package/layer/app/components/oip-science/ctgov/StudyDescription.vue +1136 -0
- package/layer/app/components/oip-science/ctgov-centers/ClinicalTrials.vue +40 -0
- package/layer/app/components/oip-science/ctgov-centers/Publications.vue +50 -0
- package/layer/app/components/oip-science/ctgov-investigators/ClinicalTrials.vue +43 -0
- package/layer/app/components/oip-science/ctgov-investigators/Informations.vue +171 -0
- package/layer/app/components/oip-science/ctgov-investigators/Publications.vue +44 -0
- package/layer/app/components/oip-science/elastic/DateRangeFilter.vue +209 -0
- package/layer/app/components/oip-science/elastic/Filter.vue +719 -0
- package/layer/app/components/oip-science/elastic/MatchExplain.vue +152 -0
- package/layer/app/components/oip-science/establishments/Cards.vue +183 -0
- package/layer/app/components/oip-science/establishments/ClinicalTrials.vue +62 -0
- package/layer/app/components/oip-science/establishments/Hcps.vue +227 -0
- package/layer/app/components/oip-science/establishments/Informations.vue +263 -0
- package/layer/app/components/oip-science/establishments/LinkedList.vue +153 -0
- package/layer/app/components/oip-science/establishments/MatchedLabels.vue +194 -0
- package/layer/app/components/oip-science/establishments/PublicFinance.vue +62 -0
- package/layer/app/components/oip-science/euct/Investigators.vue +125 -0
- package/layer/app/components/oip-science/euct/Locations.vue +102 -0
- package/layer/app/components/oip-science/euct/Products.vue +101 -0
- package/layer/app/components/oip-science/euct/Publications.vue +89 -0
- package/layer/app/components/oip-science/euct/Sponsors.vue +86 -0
- package/layer/app/components/oip-science/euct/StudyDescription.vue +1075 -0
- package/layer/app/components/oip-science/euct-centers/ClinicalTrials.vue +40 -0
- package/layer/app/components/oip-science/euct-centers/Publications.vue +55 -0
- package/layer/app/components/oip-science/euct-investigators/ClinicalTrials.vue +41 -0
- package/layer/app/components/oip-science/euct-investigators/Informations.vue +171 -0
- package/layer/app/components/oip-science/euct-investigators/Publications.vue +51 -0
- package/layer/app/components/oip-science/hcps/AppelsAProjet.vue +62 -0
- package/layer/app/components/oip-science/hcps/Cards.vue +237 -0
- package/layer/app/components/oip-science/hcps/ClinicalTrials.vue +78 -0
- package/layer/app/components/oip-science/hcps/Informations.vue +296 -0
- package/layer/app/components/oip-science/hcps/LinkedList.vue +153 -0
- package/layer/app/components/oip-science/hcps/MatchedLabels.vue +207 -0
- package/layer/app/components/oip-science/hcps/Pubmed.vue +128 -0
- package/layer/app/components/oip-science/local/SliderTabs.vue +99 -0
- package/layer/app/components/oip-science/local/SliderTabsFull.vue +135 -0
- package/layer/app/components/oip-science/pubmed/Authors.vue +128 -0
- package/layer/app/components/oip-science/pubmed/Cards.vue +417 -0
- package/layer/app/components/oip-science/pubmed/ClinicalTrials.vue +71 -0
- package/layer/app/components/oip-science/resources/Phrc.vue +39 -0
- package/layer/app/composables/useOipChapterScroll.ts +43 -0
- package/layer/app/composables/useOipResourceHooks.ts +27 -0
- package/layer/app/composables/useOipResourceNav.ts +66 -0
- package/layer/app/composables/useOipResourceViews.ts +117 -0
- package/layer/app/composables/useOipResources.ts +83 -0
- package/layer/app/oip-drugs/PORTING.md +120 -0
- package/layer/app/oip-drugs/composables/useAssociationDetail.ts +220 -0
- package/layer/app/oip-drugs/composables/useAssociationExport.ts +63 -0
- package/layer/app/oip-drugs/composables/useAssociationLookup.ts +105 -0
- package/layer/app/oip-drugs/composables/useCardPrefOptions.ts +201 -0
- package/layer/app/oip-drugs/composables/useCurrency.ts +121 -0
- package/layer/app/oip-drugs/composables/useDirectusSources.ts +224 -0
- package/layer/app/oip-drugs/composables/useHeartBrandMatches.ts +112 -0
- package/layer/app/oip-drugs/composables/useHeartDetailSearches.ts +479 -0
- package/layer/app/oip-drugs/composables/useHeartIntlApprovals.ts +661 -0
- package/layer/app/oip-drugs/composables/useHeartLesIndication.ts +168 -0
- package/layer/app/oip-drugs/composables/useHeartMatchExplain.ts +231 -0
- package/layer/app/oip-drugs/composables/useHeartReports.ts +239 -0
- package/layer/app/oip-drugs/composables/useHeartSearchFields.ts +233 -0
- package/layer/app/oip-drugs/composables/useMergeByKey.ts +23 -0
- package/layer/app/oip-drugs/composables/useOipDrugsElastic.ts +621 -0
- package/layer/app/oip-drugs/composables/usePageEmpty.ts +58 -0
- package/layer/app/oip-drugs/composables/v-useSalesSource.ts +64 -0
- package/layer/app/oip-drugs/drugs.css +500 -0
- package/layer/app/oip-drugs/esIndices.ts +322 -0
- package/layer/app/oip-drugs/kinds.ts +264 -0
- package/layer/app/oip-drugs/locales/en.json +1571 -0
- package/layer/app/oip-drugs/locales/fr.json +1571 -0
- package/layer/app/oip-drugs/monographs/blincyto-has.vue +289 -0
- package/layer/app/oip-drugs/monographs/darzalex-has.vue +276 -0
- package/layer/app/oip-drugs/monographs/dupixent-has.vue +216 -0
- package/layer/app/oip-drugs/monographs/enhertu-has.vue +280 -0
- package/layer/app/oip-drugs/monographs/has-sein-2023.vue +1649 -0
- package/layer/app/oip-drugs/monographs/ibrance-has.vue +277 -0
- package/layer/app/oip-drugs/monographs/imfinzi-has.vue +293 -0
- package/layer/app/oip-drugs/monographs/keytruda-has.vue +334 -0
- package/layer/app/oip-drugs/monographs/kisqali-has.vue +201 -0
- package/layer/app/oip-drugs/monographs/opdivo-has.vue +231 -0
- package/layer/app/oip-drugs/monographs/ozempic-has.vue +186 -0
- package/layer/app/oip-drugs/monographs/tecentriq-has.vue +312 -0
- package/layer/app/oip-drugs/monographs/yescarta-has.vue +272 -0
- package/layer/app/oip-drugs/types/elastic.ts +113 -0
- package/layer/app/oip-drugs/types/es/agencies.ts +152 -0
- package/layer/app/oip-drugs/types/es/directory.ts +54 -0
- package/layer/app/oip-drugs/types/es/docByIndex.ts +151 -0
- package/layer/app/oip-drugs/types/es/openmedic.ts +67 -0
- package/layer/app/oip-drugs/types/es/outpatient.ts +71 -0
- package/layer/app/oip-drugs/types/es/portal.ts +130 -0
- package/layer/app/oip-drugs/types/es/retail.ts +107 -0
- package/layer/app/oip-drugs/types/es/statistics.ts +29 -0
- package/layer/app/oip-drugs/types/heart/CurrencyRate.ts +16 -0
- package/layer/app/oip-drugs/types/heart/ansm.ts +106 -0
- package/layer/app/oip-drugs/types/heart/tag.ts +29 -0
- package/layer/app/oip-drugs/utils/associationFields.ts +118 -0
- package/layer/app/oip-drugs/utils/contributions.ts +36 -0
- package/layer/app/oip-drugs/utils/countryMapping.ts +387 -0
- package/layer/app/oip-drugs/utils/esHighlight.ts +21 -0
- package/layer/app/oip-drugs/utils/exportSheets.ts +57 -0
- package/layer/app/oip-drugs/utils/heartIntlPrice.ts +228 -0
- package/layer/app/oip-drugs/utils/heartStyleAndFormat.ts +262 -0
- package/layer/app/oip-drugs/utils/heartStyleAnsm.ts +71 -0
- package/layer/app/oip-drugs/utils/latestDate.ts +31 -0
- package/layer/app/oip-drugs/utils/p-heartCardTags.ts +53 -0
- package/layer/app/oip-drugs/utils/priceExport.ts +269 -0
- package/layer/app/oip-drugs/utils/q-hasRatings.ts +43 -0
- package/layer/app/oip-drugs/utils/s-openCard.ts +20 -0
- package/layer/app/oip-drugs/utils/sourceUuids.ts +155 -0
- package/layer/app/oip-drugs/utils/styleAndFormat.ts +40 -0
- package/layer/app/oip-drugs/utils/v-salesSeries.ts +156 -0
- package/layer/app/oip-drugs/utils/v-scopeTags.ts +23 -0
- package/layer/app/oip-science/PORTING.md +93 -0
- package/layer/app/oip-science/assets/smartSelection.json +428 -0
- package/layer/app/oip-science/composables/useAuthorMatching.ts +342 -0
- package/layer/app/oip-science/composables/useCTCenter.ts +107 -0
- package/layer/app/oip-science/composables/useCTInvestigators.ts +107 -0
- package/layer/app/oip-science/composables/useEstablishmentCrossData.ts +139 -0
- package/layer/app/oip-science/composables/useEstablishmentMatching.ts +176 -0
- package/layer/app/oip-science/composables/useEuct.ts +418 -0
- package/layer/app/oip-science/composables/useEuctCenter.ts +107 -0
- package/layer/app/oip-science/composables/useEuctInvestigators.ts +107 -0
- package/layer/app/oip-science/composables/useGlobalClinicalTrials.ts +624 -0
- package/layer/app/oip-science/composables/useLinkedTrials.ts +83 -0
- package/layer/app/oip-science/composables/useOipElastic.ts +658 -0
- package/layer/app/oip-science/composables/useOipSearchExplain.ts +166 -0
- package/layer/app/oip-science/composables/usePubmed.ts +487 -0
- package/layer/app/oip-science/composables/useSearchFields.ts +153 -0
- package/layer/app/oip-science/indexConfig.json +794 -0
- package/layer/app/oip-science/locales/en.json +483 -0
- package/layer/app/oip-science/locales/fr.json +483 -0
- package/layer/app/oip-science/science.css +1182 -0
- package/layer/app/oip-science/utils/a-openCard.ts +23 -0
- package/layer/app/oip-science/utils/b-openCard.ts +35 -0
- package/layer/app/oip-science/utils/c-filterContext.ts +81 -0
- package/layer/app/oip-science/utils/f-types.ts +241 -0
- package/layer/app/oip-science/utils/frDiseaseTerms.ts +269 -0
- package/layer/app/oip-science/utils/matchMethod.ts +53 -0
- package/layer/app/oip-science/utils/sliderTabs.ts +13 -0
- package/layer/app/oip-science/utils/sources.ts +15 -0
- package/layer/app/oip-science/utils/styleAndFormat.ts +608 -0
- package/layer/app/oip-science/utils/toPresets.ts +7 -0
- package/layer/app/oip-science/utils/valueTable.ts +126 -0
- package/layer/app/plugins/oip-science-i18n.ts +17 -0
- package/layer/app/utils/oipFicheRoutes.ts +118 -0
- package/layer/app/utils/oipResources.ts +440 -0
- package/layer/nuxt.config.ts +22 -2
- package/layer/public/reports/blincyto-has.html +292 -0
- package/layer/public/reports/blincyto-has.pdf +0 -0
- package/layer/public/reports/darzalex-has.html +279 -0
- package/layer/public/reports/darzalex-has.pdf +0 -0
- package/layer/public/reports/dupixent-has.html +217 -0
- package/layer/public/reports/dupixent-has.pdf +0 -0
- package/layer/public/reports/enhertu-has.html +283 -0
- package/layer/public/reports/enhertu-has.pdf +0 -0
- package/layer/public/reports/has-sein-2023.html +1639 -0
- package/layer/public/reports/ibrance-has.html +280 -0
- package/layer/public/reports/ibrance-has.pdf +0 -0
- package/layer/public/reports/imfinzi-has.html +297 -0
- package/layer/public/reports/imfinzi-has.pdf +0 -0
- package/layer/public/reports/keytruda-has.html +337 -0
- package/layer/public/reports/keytruda-has.pdf +0 -0
- package/layer/public/reports/kisqali-has.html +202 -0
- package/layer/public/reports/kisqali-has.pdf +0 -0
- package/layer/public/reports/opdivo-has.html +232 -0
- package/layer/public/reports/opdivo-has.pdf +0 -0
- package/layer/public/reports/ozempic-has.html +188 -0
- package/layer/public/reports/ozempic-has.pdf +0 -0
- package/layer/public/reports/tecentriq-has.html +315 -0
- package/layer/public/reports/tecentriq-has.pdf +0 -0
- package/layer/public/reports/yescarta-has.html +275 -0
- package/layer/public/reports/yescarta-has.pdf +0 -0
- package/layer/server/api/oip/es.post.ts +99 -0
- package/layer/server/api/oip/pdf.get.ts +70 -0
- package/layer/server/api/oip/reports.get.ts +98 -0
- package/layer/server/api/oip/resource-types.get.ts +22 -0
- package/package.json +1 -1
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Portage de composables/useHeartCardTags.ts de fr_drugs_app (absent du
|
|
3
|
+
* partage des lots, d'ou le prefixe `p-`).
|
|
4
|
+
*
|
|
5
|
+
* Tags d'un document de marque HAS, tels que la carte les affiche.
|
|
6
|
+
*
|
|
7
|
+
* Le tagging est porte a la racine du document (une marque), pas par avis :
|
|
8
|
+
* `oncology_tagging_*` (termes oncologie et leurs codes CIM-10),
|
|
9
|
+
* `rare_diseases*` (Orphanet) et `genes_tagging_*`. Chaque lecture rend une
|
|
10
|
+
* liste de libelles dedoublonnes, vide quand la marque n'est pas taguee.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
function unique(values: (string | null | undefined)[]) {
|
|
14
|
+
return [...new Set(values.filter((v): v is string => typeof v === "string" && v.trim() !== ""))];
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
function oncologyTagging(source: any, locale: string): any[] {
|
|
18
|
+
const tagging = locale === "en" ? source?.oncology_tagging_en : source?.oncology_tagging_fr;
|
|
19
|
+
return Array.isArray(tagging) ? tagging : [];
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/** « Lymphome hodgkinien (ORPHA:98293) ». */
|
|
23
|
+
export function heartRareTags(source: any, locale: string): string[] {
|
|
24
|
+
const list =
|
|
25
|
+
locale === "en"
|
|
26
|
+
? source?.rare_diseases_en
|
|
27
|
+
: source?.rare_diseases_fr ?? source?.rare_diseases;
|
|
28
|
+
if (!Array.isArray(list)) return [];
|
|
29
|
+
return unique(list.map((r: any) => r?.concat_disease_name_orpha_code ?? r?.label));
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/** Libelles CIM-10 des termes oncologie. */
|
|
33
|
+
export function heartOncoIcd10Tags(source: any, locale: string): string[] {
|
|
34
|
+
return unique(
|
|
35
|
+
oncologyTagging(source, locale).flatMap((t: any) => {
|
|
36
|
+
const icd = t?.icd10;
|
|
37
|
+
if (Array.isArray(icd)) return icd.map((x: any) => x?.combined_label);
|
|
38
|
+
return [icd?.combined_label];
|
|
39
|
+
}),
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/** Termes oncologie (libelle prefere). */
|
|
44
|
+
export function heartOncoTermTags(source: any, locale: string): string[] {
|
|
45
|
+
return unique(oncologyTagging(source, locale).map((t: any) => t?.preferred_label));
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/** Symboles de genes (« AQP4 »). */
|
|
49
|
+
export function heartGeneTags(source: any, locale: string): string[] {
|
|
50
|
+
const list = locale === "en" ? source?.genes_tagging_en : source?.genes_tagging_fr;
|
|
51
|
+
if (!Array.isArray(list)) return [];
|
|
52
|
+
return unique(list.map((g: any) => g?.symbol ?? g?.gene_name));
|
|
53
|
+
}
|
|
@@ -0,0 +1,269 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Colonnes du suivi des prix France, partagees par ses deux exports.
|
|
3
|
+
*
|
|
4
|
+
* Le meme classeur sort de deux endroits : le panneau du cadre, pour la liste
|
|
5
|
+
* filtree, et le bouton d'une carte, pour une marque et elle seule. Les deux
|
|
6
|
+
* doivent donner exactement les memes colonnes, dans le meme ordre, avec les
|
|
7
|
+
* memes types — un prix qui sort en nombre d'un cote et en texte de l'autre,
|
|
8
|
+
* et la moitie des classeurs n'est plus sommable.
|
|
9
|
+
*
|
|
10
|
+
* Le code vient de `components/heart/france/export.vue`, ou il etait ecrit
|
|
11
|
+
* pour la liste. Rien n'a change en le deplacant, hors ce qu'il fallait
|
|
12
|
+
* passer en parametre : la traduction des intitules et le taux du dollar,
|
|
13
|
+
* qui vivent dans le composant.
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
/** Traduction d'un intitule de colonne, et taux du jour pour l'onglet USD. */
|
|
17
|
+
export interface PriceExportContext {
|
|
18
|
+
/** `heart.app.downloadExport.<key>` traduit. */
|
|
19
|
+
label: (key: string) => string;
|
|
20
|
+
/** Taux EUR vers USD, ou null quand il n'a pas ete charge. */
|
|
21
|
+
dollarRate: number | null;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export const PRICE_COLUMN_KEYS = [
|
|
25
|
+
"distribution",
|
|
26
|
+
"products",
|
|
27
|
+
"molecule",
|
|
28
|
+
"atc5",
|
|
29
|
+
"date",
|
|
30
|
+
"exfactory",
|
|
31
|
+
"public",
|
|
32
|
+
"reimbursement",
|
|
33
|
+
"brand",
|
|
34
|
+
"company",
|
|
35
|
+
"tfr",
|
|
36
|
+
"tfrReference",
|
|
37
|
+
"opposability",
|
|
38
|
+
"collectivity",
|
|
39
|
+
"socialInsured",
|
|
40
|
+
"retrocession",
|
|
41
|
+
"t2a",
|
|
42
|
+
"cip",
|
|
43
|
+
"joDate",
|
|
44
|
+
"commercializationStatus",
|
|
45
|
+
"commercializationDate",
|
|
46
|
+
"taaMco",
|
|
47
|
+
"taaSsr",
|
|
48
|
+
] as const;
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Intitule d'une colonne. « Référence TFR » n'a pas de cle i18n : les
|
|
52
|
+
* locales ne bougent pas dans cette passe, on lit la langue sur un libelle
|
|
53
|
+
* deja traduit par l'appelant.
|
|
54
|
+
*/
|
|
55
|
+
function columnLabel(key: string, ctx: PriceExportContext) {
|
|
56
|
+
if (key !== "tfrReference") return ctx.label(key);
|
|
57
|
+
return ctx.label("yes") === "Oui" ? "Référence TFR" : "TFR reference";
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Valeur d'une colonne pour un produit.
|
|
62
|
+
*
|
|
63
|
+
* `history` porte la ligne d'historique quand l'export liste les changements
|
|
64
|
+
* de prix ; sans lui, on lit le dernier prix connu du produit. C'est la seule
|
|
65
|
+
* difference entre les deux jeux, les deux anciennes pages en avaient fait
|
|
66
|
+
* deux fonctions de cent cinquante lignes chacune.
|
|
67
|
+
*/
|
|
68
|
+
export function priceCell(
|
|
69
|
+
key: string,
|
|
70
|
+
product: any,
|
|
71
|
+
history: any | null,
|
|
72
|
+
inDollars: boolean,
|
|
73
|
+
ctx: PriceExportContext,
|
|
74
|
+
) {
|
|
75
|
+
const label = (name: string) => ctx.label(name);
|
|
76
|
+
const toDollars = (value: any) =>
|
|
77
|
+
typeof value === "number" && ctx.dollarRate !== null ? value * ctx.dollarRate : null;
|
|
78
|
+
const yesNo = (value: any) =>
|
|
79
|
+
value === true ? label("yes") : value === false ? label("no") : null;
|
|
80
|
+
const price = (value: any) => (inDollars ? toDollars(value) : (value ?? null));
|
|
81
|
+
const last = history ?? product.reimbursement_history?.[0] ?? null;
|
|
82
|
+
|
|
83
|
+
switch (key) {
|
|
84
|
+
case "distribution":
|
|
85
|
+
return product.distribution_channel;
|
|
86
|
+
case "products":
|
|
87
|
+
return product.label;
|
|
88
|
+
case "molecule":
|
|
89
|
+
return product.molecule;
|
|
90
|
+
case "atc5":
|
|
91
|
+
return product.atc5;
|
|
92
|
+
case "brand":
|
|
93
|
+
return product.brand;
|
|
94
|
+
case "company":
|
|
95
|
+
return product.manufacturer;
|
|
96
|
+
case "cip":
|
|
97
|
+
// L'historique remonte au groupe de CIP quand le produit en a un : une
|
|
98
|
+
// ligne de prix peut porter un code different du code courant.
|
|
99
|
+
return history && product.cip_reference_group?.[0]
|
|
100
|
+
? product.cip_reference_group[0].related_cip_code
|
|
101
|
+
: product.local_drug_id;
|
|
102
|
+
case "date":
|
|
103
|
+
return last?.application_date ?? null;
|
|
104
|
+
case "exfactory":
|
|
105
|
+
return price(last?.factory_price ?? null);
|
|
106
|
+
case "public":
|
|
107
|
+
return price(last?.public_price ?? null);
|
|
108
|
+
case "priceVar": {
|
|
109
|
+
// Variation lue sur la ligne d'historique : elle n'existe que la. En
|
|
110
|
+
// nombre, le signe vient du format de la colonne.
|
|
111
|
+
const variation = history?.variation ?? null;
|
|
112
|
+
if (!variation) return null;
|
|
113
|
+
return inDollars ? toDollars(variation) : variation;
|
|
114
|
+
}
|
|
115
|
+
case "reimbursement":
|
|
116
|
+
if (history) return history.reimbursement_rate ?? null;
|
|
117
|
+
// Sur le prix courant, un taux absent vaut zero et un produit sans
|
|
118
|
+
// historique de remboursement n'a pas de taux du tout. En nombre : la
|
|
119
|
+
// colonne est en pourcentage, une chaine y sortirait vide.
|
|
120
|
+
if (product.reimbursement_history === null) return 0;
|
|
121
|
+
if (last?.reimbursement_rate === null) return 0;
|
|
122
|
+
return last?.reimbursement_rate === undefined ? null : last.reimbursement_rate;
|
|
123
|
+
case "opposability":
|
|
124
|
+
return last?.opposability_date ?? null;
|
|
125
|
+
case "joDate":
|
|
126
|
+
return last?.announce_date ?? null;
|
|
127
|
+
case "tfr":
|
|
128
|
+
// Le produit qui sert de reference ne porte pas de tarif de reference :
|
|
129
|
+
// la cellule reste vide (colonne en nombre), la colonne d'a cote le dit.
|
|
130
|
+
return product.is_generic_reference
|
|
131
|
+
? null
|
|
132
|
+
: price(product.reference_history?.[0]?.reference_price ?? null);
|
|
133
|
+
case "tfrReference":
|
|
134
|
+
return yesNo(product.is_generic_reference);
|
|
135
|
+
case "collectivity":
|
|
136
|
+
return yesNo(product.is_community);
|
|
137
|
+
case "socialInsured":
|
|
138
|
+
return yesNo(product.is_social_insured);
|
|
139
|
+
case "retrocession":
|
|
140
|
+
return yesNo(product.is_outpatient);
|
|
141
|
+
case "t2a":
|
|
142
|
+
return yesNo(product.is_inpatient);
|
|
143
|
+
case "taaMco":
|
|
144
|
+
return yesNo(product.is_taa_mco);
|
|
145
|
+
case "taaSsr":
|
|
146
|
+
return yesNo(product.is_taa_ssr);
|
|
147
|
+
case "commercializationStatus":
|
|
148
|
+
return product.commercialization_status ?? null;
|
|
149
|
+
case "commercializationDate":
|
|
150
|
+
return product.commercialization_date ?? null;
|
|
151
|
+
default:
|
|
152
|
+
return null;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
/** Colonnes du jeu demande : l'historique intercale la variation de prix. */
|
|
157
|
+
export function priceColumnKeys(dataset: "current" | "history"): string[] {
|
|
158
|
+
const keys = [...PRICE_COLUMN_KEYS] as string[];
|
|
159
|
+
if (dataset !== "history") return keys;
|
|
160
|
+
const out = [...keys];
|
|
161
|
+
out.splice(out.indexOf("exfactory") + 1, 0, "priceVar");
|
|
162
|
+
return out;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
/**
|
|
166
|
+
* Lignes d'un jeu de produits.
|
|
167
|
+
*
|
|
168
|
+
* `current` : une ligne par presentation, son dernier prix. `history` : une
|
|
169
|
+
* ligne par changement de prix, la variation appariee sur la date de la
|
|
170
|
+
* decision — elle vit dans un autre tableau du document.
|
|
171
|
+
*/
|
|
172
|
+
export function priceRows(
|
|
173
|
+
products: any[],
|
|
174
|
+
dataset: "current" | "history",
|
|
175
|
+
inDollars: boolean,
|
|
176
|
+
ctx: PriceExportContext,
|
|
177
|
+
): Record<string, any>[] {
|
|
178
|
+
const keys = priceColumnKeys(dataset);
|
|
179
|
+
|
|
180
|
+
if (dataset !== "history") {
|
|
181
|
+
return products.map((product: any) => {
|
|
182
|
+
const row: Record<string, any> = {};
|
|
183
|
+
keys.forEach(
|
|
184
|
+
(key) => (row[columnLabel(key, ctx)] = priceCell(key, product, null, inDollars, ctx)),
|
|
185
|
+
);
|
|
186
|
+
return row;
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
return products.flatMap((product: any) => {
|
|
191
|
+
const history = product.reimbursement_history ?? [];
|
|
192
|
+
return history.map((entry: any) => {
|
|
193
|
+
const withVariation = {
|
|
194
|
+
...entry,
|
|
195
|
+
variation:
|
|
196
|
+
product.changed_history?.find(
|
|
197
|
+
(change: any) =>
|
|
198
|
+
change.application_date === entry.application_date &&
|
|
199
|
+
change.price_type_id === 1,
|
|
200
|
+
)?.price_variation ?? null,
|
|
201
|
+
};
|
|
202
|
+
const row: Record<string, any> = {};
|
|
203
|
+
keys.forEach(
|
|
204
|
+
(key) =>
|
|
205
|
+
(row[columnLabel(key, ctx)] = priceCell(key, product, withVariation, inDollars, ctx)),
|
|
206
|
+
);
|
|
207
|
+
return row;
|
|
208
|
+
});
|
|
209
|
+
});
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
/**
|
|
213
|
+
* Schema du classeur : les prix en nombre a deux decimales, les dates en date,
|
|
214
|
+
* le taux de remboursement en pourcentage. Sans cela tout sort en texte et
|
|
215
|
+
* rien n'est sommable dans le tableur.
|
|
216
|
+
*/
|
|
217
|
+
export function priceSchema(keys: string[], ctx: PriceExportContext) {
|
|
218
|
+
return keys.map((key) => {
|
|
219
|
+
const column = columnLabel(key, ctx);
|
|
220
|
+
|
|
221
|
+
if (key === "exfactory" || key === "public" || key === "tfr") {
|
|
222
|
+
return {
|
|
223
|
+
column,
|
|
224
|
+
type: Number,
|
|
225
|
+
format: "#,##0.00",
|
|
226
|
+
value: (item: any) => (typeof item[column] === "number" ? item[column] : null),
|
|
227
|
+
};
|
|
228
|
+
}
|
|
229
|
+
if (key === "priceVar") {
|
|
230
|
+
// Signe porte par le format : la valeur reste un nombre sommable.
|
|
231
|
+
return {
|
|
232
|
+
column,
|
|
233
|
+
type: Number,
|
|
234
|
+
format: "+0.00;-0.00",
|
|
235
|
+
value: (item: any) => (typeof item[column] === "number" ? item[column] : null),
|
|
236
|
+
};
|
|
237
|
+
}
|
|
238
|
+
if (
|
|
239
|
+
key === "date" ||
|
|
240
|
+
key === "opposability" ||
|
|
241
|
+
key === "joDate" ||
|
|
242
|
+
key === "commercializationDate"
|
|
243
|
+
) {
|
|
244
|
+
return {
|
|
245
|
+
column,
|
|
246
|
+
type: Date,
|
|
247
|
+
format: "mmm d yyyy",
|
|
248
|
+
width: 15,
|
|
249
|
+
value: (item: any) => (item[column] ? new Date(item[column]) : null),
|
|
250
|
+
};
|
|
251
|
+
}
|
|
252
|
+
if (key === "reimbursement") {
|
|
253
|
+
return {
|
|
254
|
+
column,
|
|
255
|
+
type: Number,
|
|
256
|
+
format: "0%",
|
|
257
|
+
value: (item: any) => (typeof item[column] === "number" ? item[column] : null),
|
|
258
|
+
};
|
|
259
|
+
}
|
|
260
|
+
return {
|
|
261
|
+
column,
|
|
262
|
+
type: String,
|
|
263
|
+
width: key === "products" ? 60 : key === "company" || key === "molecule" ? 40 : 15,
|
|
264
|
+
value: (item: any) =>
|
|
265
|
+
typeof item[column] === "number" ? item[column].toString() : item[column],
|
|
266
|
+
};
|
|
267
|
+
});
|
|
268
|
+
}
|
|
269
|
+
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Niveaux SMR et ASMR d'un avis HAS, en etiquettes. Un avis qui couvre
|
|
3
|
+
* plusieurs indications porte plusieurs niveaux : chacun a son etiquette, les
|
|
4
|
+
* doublons en moins.
|
|
5
|
+
*/
|
|
6
|
+
type RatingVariant = "green" | "amber" | "rose" | "gray";
|
|
7
|
+
|
|
8
|
+
const SMR_TONES: Record<string, RatingVariant> = {
|
|
9
|
+
Majeur: "green",
|
|
10
|
+
Important: "green",
|
|
11
|
+
Modéré: "amber",
|
|
12
|
+
Faible: "amber",
|
|
13
|
+
Insuffisant: "rose",
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
const ASMR_TONES: Record<string, RatingVariant> = {
|
|
17
|
+
"I (majeur)": "green",
|
|
18
|
+
"II (important)": "green",
|
|
19
|
+
"III (modéré)": "green",
|
|
20
|
+
"IV (mineur)": "amber",
|
|
21
|
+
"V (absence)": "rose",
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export function hasRatingTags(
|
|
25
|
+
opinion: any,
|
|
26
|
+
locale: string,
|
|
27
|
+
): { key: string; label: string; variant: RatingVariant }[] {
|
|
28
|
+
const tags: { key: string; label: string; variant: RatingVariant }[] = [];
|
|
29
|
+
for (const [kind, tones] of [
|
|
30
|
+
["SMR", SMR_TONES],
|
|
31
|
+
["ASMR", ASMR_TONES],
|
|
32
|
+
] as const) {
|
|
33
|
+
const seen = new Set<string>();
|
|
34
|
+
for (const level of opinion?.[kind.toLowerCase()] ?? []) {
|
|
35
|
+
const type = level?.type?.trim();
|
|
36
|
+
if (!type || seen.has(type)) continue;
|
|
37
|
+
seen.add(type);
|
|
38
|
+
const label = (locale === "en" && level.type_en?.trim()) || type;
|
|
39
|
+
tags.push({ key: `${kind}-${type}`, label: `${kind} ${label}`, variant: tones[type] ?? "gray" });
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
return tags;
|
|
43
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { OipResourceNav } from "../../composables/useOipResourceNav";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Ouvre une page de fr_drugs_app depuis une carte de resultat (portage de
|
|
5
|
+
* heartOpenCard). La carte entiere mene au detail, sauf ce qui porte sa propre
|
|
6
|
+
* action (lien, bouton, pagination d'un tableau interne). Ctrl/Cmd-clic : un
|
|
7
|
+
* nouvel onglet sur l'URL de l'app, comme un vrai lien.
|
|
8
|
+
*/
|
|
9
|
+
const OWN_ACTION = "a, button, input, select, textarea, .rcd-pagination, .rcd-pagination-navigate";
|
|
10
|
+
|
|
11
|
+
export function openDrugsCard(nav: OipResourceNav, event: MouseEvent, path: string | null | undefined) {
|
|
12
|
+
const target = event.target as HTMLElement | null;
|
|
13
|
+
if (target?.closest(OWN_ACTION)) return;
|
|
14
|
+
if (!path) return;
|
|
15
|
+
if (event.metaKey || event.ctrlKey || event.shiftKey) {
|
|
16
|
+
window.open(nav.appHref("fr_drugs_app", path), "_blank", "noopener");
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
nav.openApp("fr_drugs_app", path);
|
|
20
|
+
}
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Les fiches Directus citees par les fiches medicament (portage de
|
|
3
|
+
* useHeartSourceUuids de fr_drugs_app).
|
|
4
|
+
*
|
|
5
|
+
* fr_drugs_app deduisait les sources de son chemin et de l'onglet ouvert. Une
|
|
6
|
+
* fiche du layer ne connait pas sa route : chaque composant cite ses uuids
|
|
7
|
+
* explicitement, et les tables ci-dessous gardent les choix de fr_drugs_app
|
|
8
|
+
* (la premiere source d'une liste est la principale).
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
export const HEART_SOURCE_UUIDS = {
|
|
12
|
+
HAS: '6f0bfe9a-bc58-4feb-9e9c-f37a0ac9ceba',
|
|
13
|
+
LES: '3c106b10-76b7-41ad-a40e-4c0fde0f2c43',
|
|
14
|
+
MITM: 'cc472c26-fdab-4c27-a9c0-416d10396257',
|
|
15
|
+
PNDS: 'cb14de5b-d7fb-454d-9e07-bcda8ccd6a6b',
|
|
16
|
+
ASSOCIATIONS: '7c192cff-c2c9-49c5-a02a-241c3f86dbe5',
|
|
17
|
+
ASSOCIATIONS_ANSM: '85eab016-9010-4882-b2f2-2f807ad3bc60',
|
|
18
|
+
PUT: '0fa6d577-3fa9-48d5-9715-8ed0726496d1',
|
|
19
|
+
ACTUALITE_JO: '1018988c-4ed2-4aee-84a9-17be83f663de',
|
|
20
|
+
PRICE_TRACKER: '2625b233-7a1f-487b-a316-5962cd38c390',
|
|
21
|
+
BIOSIMILAIRES: 'f13ded2c-2651-4977-a17e-554672a00e43',
|
|
22
|
+
ANSM: '6ed012ef-9df7-4a2f-80b2-79b341d9c692',
|
|
23
|
+
FDA: '4c344cfe-94b5-4e25-9241-0f74d04a939b',
|
|
24
|
+
EMA: 'd5a2cb42-69af-4c6d-8ea7-b318b2538bfd',
|
|
25
|
+
JCA: '4a311879-080e-4c26-bfc2-5c3a80f9758b',
|
|
26
|
+
} as const;
|
|
27
|
+
|
|
28
|
+
/** Toutes les sources agregees par la page Screening (/overview). */
|
|
29
|
+
export const HEART_OVERVIEW_UUIDS: string[] = [
|
|
30
|
+
HEART_SOURCE_UUIDS.HAS,
|
|
31
|
+
HEART_SOURCE_UUIDS.LES,
|
|
32
|
+
HEART_SOURCE_UUIDS.MITM,
|
|
33
|
+
HEART_SOURCE_UUIDS.ANSM,
|
|
34
|
+
HEART_SOURCE_UUIDS.BIOSIMILAIRES,
|
|
35
|
+
HEART_SOURCE_UUIDS.PRICE_TRACKER,
|
|
36
|
+
HEART_SOURCE_UUIDS.ACTUALITE_JO,
|
|
37
|
+
HEART_SOURCE_UUIDS.PUT,
|
|
38
|
+
HEART_SOURCE_UUIDS.PNDS,
|
|
39
|
+
HEART_SOURCE_UUIDS.FDA,
|
|
40
|
+
HEART_SOURCE_UUIDS.EMA,
|
|
41
|
+
];
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Sources de chaque onglet de la fiche marque, la premiere etant la principale.
|
|
45
|
+
*
|
|
46
|
+
* Une fiche agrege des origines differentes : ce qu'on lit sous l'onglet
|
|
47
|
+
* Alertes vient de l'ANSM, sous MITM de la liste MITM, sous Prix du suivi
|
|
48
|
+
* tarifaire. Afficher les memes sources pour toute la fiche revenait a citer
|
|
49
|
+
* des references etrangeres a ce qui est a l'ecran.
|
|
50
|
+
*/
|
|
51
|
+
export const HEART_DETAIL_TAB_UUIDS: Record<string, string[]> = {
|
|
52
|
+
monograph: [HEART_SOURCE_UUIDS.HAS],
|
|
53
|
+
overview: [HEART_SOURCE_UUIDS.HAS],
|
|
54
|
+
contributions: [HEART_SOURCE_UUIDS.HAS],
|
|
55
|
+
alerts: [HEART_SOURCE_UUIDS.ANSM, HEART_SOURCE_UUIDS.HAS],
|
|
56
|
+
price: [HEART_SOURCE_UUIDS.PRICE_TRACKER, HEART_SOURCE_UUIDS.BIOSIMILAIRES],
|
|
57
|
+
// Le regard international cite, pays par pays, le referentiel de prix et le
|
|
58
|
+
// registre d'autorisation : les memes fiches que les pieds de carte
|
|
59
|
+
// (cf. HEART_INTL_COUNTRIES).
|
|
60
|
+
international: [
|
|
61
|
+
HEART_SOURCE_UUIDS.EMA,
|
|
62
|
+
HEART_SOURCE_UUIDS.FDA,
|
|
63
|
+
"4fa70cd9-7918-47e9-920e-a2059b964519", // G-BA (Nutzenbewertung)
|
|
64
|
+
"7cfd0f9c-cdda-44fe-872f-989edd258c16", // AEMPS
|
|
65
|
+
"6ed39046-aa49-4266-bb02-7c3fe339d2b1", // MHRA
|
|
66
|
+
"a91e97d1-b6b2-4f65-98b4-0914d14c4ac0", // AIFA (prix et decisions)
|
|
67
|
+
"70416855-3761-4085-9664-b01ec4db30dc", // Gelbe Liste (prix DE)
|
|
68
|
+
"765a7f89-09c3-483a-b6b0-4046738a3bb4", // Vademecum (prix ES)
|
|
69
|
+
"6ae4d4c6-a073-4cce-975f-3b255d3dd908", // dm+d (prix GB)
|
|
70
|
+
"244d86d9-5a81-4560-ba75-d5a8664a2d18", // FSS / VA (prix US)
|
|
71
|
+
],
|
|
72
|
+
ansm: [HEART_SOURCE_UUIDS.ANSM, HEART_SOURCE_UUIDS.HAS],
|
|
73
|
+
mitm: [HEART_SOURCE_UUIDS.MITM, HEART_SOURCE_UUIDS.HAS],
|
|
74
|
+
put: [HEART_SOURCE_UUIDS.PUT, HEART_SOURCE_UUIDS.HAS],
|
|
75
|
+
les: [HEART_SOURCE_UUIDS.LES, HEART_SOURCE_UUIDS.HAS],
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
/** Sources de la fiche marque sans onglet connu (cf. le defaut de fr_drugs_app). */
|
|
79
|
+
export const HEART_BRAND_UUIDS: string[] = [
|
|
80
|
+
HEART_SOURCE_UUIDS.HAS,
|
|
81
|
+
HEART_SOURCE_UUIDS.BIOSIMILAIRES,
|
|
82
|
+
HEART_SOURCE_UUIDS.PRICE_TRACKER,
|
|
83
|
+
];
|
|
84
|
+
|
|
85
|
+
/** Sources des fiches sans route propre a l'onglet. */
|
|
86
|
+
export const HEART_INDICATION_UUIDS: string[] = [HEART_SOURCE_UUIDS.LES];
|
|
87
|
+
export const HEART_PNDS_UUIDS: string[] = [HEART_SOURCE_UUIDS.PNDS];
|
|
88
|
+
export const HEART_PUT_UUIDS: string[] = [HEART_SOURCE_UUIDS.PUT];
|
|
89
|
+
export const HEART_JO_UUIDS: string[] = [HEART_SOURCE_UUIDS.ACTUALITE_JO];
|
|
90
|
+
export const HEART_MITM_UUIDS: string[] = [HEART_SOURCE_UUIDS.MITM, HEART_SOURCE_UUIDS.ANSM];
|
|
91
|
+
export const HEART_PRICE_UUIDS: string[] = [HEART_SOURCE_UUIDS.PRICE_TRACKER, HEART_SOURCE_UUIDS.BIOSIMILAIRES];
|
|
92
|
+
export const HEART_ANSM_DETAIL_UUIDS: string[] = [
|
|
93
|
+
HEART_SOURCE_UUIDS.ANSM,
|
|
94
|
+
HEART_SOURCE_UUIDS.HAS,
|
|
95
|
+
HEART_SOURCE_UUIDS.BIOSIMILAIRES,
|
|
96
|
+
HEART_SOURCE_UUIDS.PRICE_TRACKER,
|
|
97
|
+
];
|
|
98
|
+
/**
|
|
99
|
+
* L'annuaire des associations croise trois origines : l'appartenance vient de
|
|
100
|
+
* France Assos Sante, les comites d'interface de l'ANSM, les compteurs de
|
|
101
|
+
* contributions des avis HAS.
|
|
102
|
+
*/
|
|
103
|
+
export const HEART_ASSOCIATION_UUIDS: string[] = [
|
|
104
|
+
HEART_SOURCE_UUIDS.ASSOCIATIONS,
|
|
105
|
+
HEART_SOURCE_UUIDS.ASSOCIATIONS_ANSM,
|
|
106
|
+
HEART_SOURCE_UUIDS.HAS,
|
|
107
|
+
];
|
|
108
|
+
/** Les contributions ecrites viennent des avis HAS, pas de l'annuaire. */
|
|
109
|
+
export const HEART_CONTRIBUTION_UUIDS: string[] = [HEART_SOURCE_UUIDS.HAS];
|
|
110
|
+
/**
|
|
111
|
+
* Les comptes rendus de commission viennent de l'open data de l'Assemblee
|
|
112
|
+
* nationale, qui n'a pas encore de fiche Directus : aucune source plutot que
|
|
113
|
+
* de citer l'annuaire, etranger au texte.
|
|
114
|
+
*/
|
|
115
|
+
export const HEART_NATIONAL_ASSEMBLY_UUIDS: string[] = [];
|
|
116
|
+
|
|
117
|
+
/** Sources d'un onglet de la fiche marque, sinon celles de la fiche entiere. */
|
|
118
|
+
export function heartDetailTabUuids(tab?: string | null): string[] {
|
|
119
|
+
return (tab && HEART_DETAIL_TAB_UUIDS[tab]) || HEART_BRAND_UUIDS;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* Les sources d'un chemin de fr_drugs_app (sans prefixe de langue), avec
|
|
124
|
+
* l'onglet de la fiche marque quand il est connu : la table de
|
|
125
|
+
* useHeartSourceUuids, en fonction pure. Pour une fiche qui connait son
|
|
126
|
+
* chemin d'origine ; les autres citent leurs uuids directement.
|
|
127
|
+
*/
|
|
128
|
+
export function heartSourceUuidsForPath(rawPath: string, tab?: string | null): string[] {
|
|
129
|
+
const path = rawPath.replace(/^\/(fr|en)(?=\/|$)/, '').split(/[?#]/)[0] ?? '';
|
|
130
|
+
|
|
131
|
+
if (path.includes('/hubr/heart/details') && tab) {
|
|
132
|
+
const uuids = HEART_DETAIL_TAB_UUIDS[tab];
|
|
133
|
+
if (uuids) return uuids;
|
|
134
|
+
}
|
|
135
|
+
if (path.includes('/hubr/heart/overview')) return HEART_OVERVIEW_UUIDS;
|
|
136
|
+
if (path.includes('/hubr/heart/agencies/fda')) return [HEART_SOURCE_UUIDS.FDA];
|
|
137
|
+
if (path.includes('/hubr/heart/agencies/ema')) return [HEART_SOURCE_UUIDS.EMA];
|
|
138
|
+
if (path.includes('/hubr/heart/reports/jca')) return [HEART_SOURCE_UUIDS.JCA];
|
|
139
|
+
if (path.includes('/hubr/heart/pnds')) return HEART_PNDS_UUIDS;
|
|
140
|
+
if (path.includes('/hubr/heart/put')) return HEART_PUT_UUIDS;
|
|
141
|
+
if (path.includes('/hubr/heart/prices/jo')) return HEART_JO_UUIDS;
|
|
142
|
+
if (path.includes('/hubr/heart/prices')) return HEART_PRICE_UUIDS;
|
|
143
|
+
if (path.startsWith('/hubr/heart/ansm/details')) return HEART_ANSM_DETAIL_UUIDS;
|
|
144
|
+
if (path.startsWith('/hubr/heart/ansm')) return [HEART_SOURCE_UUIDS.ANSM];
|
|
145
|
+
if (path.includes('/hubr/heart/indication')) return HEART_INDICATION_UUIDS;
|
|
146
|
+
if (path.includes('/hubr/heart/mitm')) return HEART_MITM_UUIDS;
|
|
147
|
+
// Le test precede celui de l'annuaire, dont le chemin est un prefixe du sien.
|
|
148
|
+
if (path.includes('/hubr/heart/associations/contributions')) return HEART_CONTRIBUTION_UUIDS;
|
|
149
|
+
if (path.includes('/hubr/heart/associations/national-assembly')) return HEART_NATIONAL_ASSEMBLY_UUIDS;
|
|
150
|
+
if (path.includes('/hubr/heart/associations')) return HEART_ASSOCIATION_UUIDS;
|
|
151
|
+
if (path.includes('/hubr/heart/details')) return HEART_BRAND_UUIDS;
|
|
152
|
+
|
|
153
|
+
// Defaut : la page de recherche.
|
|
154
|
+
return [HEART_SOURCE_UUIDS.HAS, HEART_SOURCE_UUIDS.BIOSIMILAIRES];
|
|
155
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { OIP_RESOURCE_HOOKS } from "../../composables/useOipResourceHooks";
|
|
2
|
+
import { HEART_SOURCE_UUIDS } from "./sourceUuids";
|
|
3
|
+
|
|
4
|
+
export const formatNumber = (value: any) => {
|
|
5
|
+
return value.toLocaleString('fr-FR');
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
export const formatRate = (val: number, round: number) => {
|
|
9
|
+
if (typeof val !== 'number') return val;
|
|
10
|
+
return (val * 100)
|
|
11
|
+
.toFixed(round)
|
|
12
|
+
.toString()
|
|
13
|
+
.replace(/\B(?=(\d{3})+(?!\d))/g, ' ');
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export const dateFormat = (value: any) => {
|
|
17
|
+
return new Date(value).toLocaleDateString('en-US', {
|
|
18
|
+
// weekday: 'long',
|
|
19
|
+
year: 'numeric',
|
|
20
|
+
month: 'long',
|
|
21
|
+
day: 'numeric',
|
|
22
|
+
});
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Ouvre le panneau Sources de l'app sur la fiche `uuid` (par defaut HAS), par
|
|
27
|
+
* le hook qu'elle prete au layer (cf. useOipResourceHooks). Appelable hors
|
|
28
|
+
* d'un setup (gestionnaire de clic) : le hook est relu dans le contexte de
|
|
29
|
+
* l'app. Sans hook, rien.
|
|
30
|
+
*/
|
|
31
|
+
export const openSource = (uuid: string = HEART_SOURCE_UUIDS.HAS) => {
|
|
32
|
+
const hooks = useNuxtApp().vueApp.runWithContext(() => inject(OIP_RESOURCE_HOOKS, {}));
|
|
33
|
+
hooks.openSource?.(uuid);
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
// Le suivi PostHog reste dans l'app qui monte les fiches : le layer ne
|
|
37
|
+
// l'embarque pas. Les fonctions gardent leur nom, et ne font rien.
|
|
38
|
+
export const sendToPosthog = (_eventName: string, _eventProps: any) => {};
|
|
39
|
+
|
|
40
|
+
export const captureException = (_message: string, _properties: {}) => {};
|