@tekkare/romulus 0.1.250 → 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.
Files changed (270) hide show
  1. package/dist/module.json +1 -1
  2. package/dist/runtime/components/BarChart.vue +1 -0
  3. package/dist/runtime/components/ChoroplethMap.vue +4 -1
  4. package/dist/runtime/internal/geo/fr-regions.json +1 -1
  5. package/dist/runtime/utils/chart.d.ts +6 -3
  6. package/dist/runtime/utils/chart.js +15 -2
  7. package/layer/app/app.config.ts +6 -0
  8. package/layer/app/components/OipPubmedSummary.vue +223 -0
  9. package/layer/app/components/OipResourceDrawer.vue +331 -0
  10. package/layer/app/components/OipResourceDrawerLink.vue +40 -0
  11. package/layer/app/components/OipResourceField.vue +41 -0
  12. package/layer/app/components/OipResourceGenericCard.vue +54 -0
  13. package/layer/app/components/OipResourceSource.vue +50 -0
  14. package/layer/app/components/OipResourceTags.vue +65 -0
  15. package/layer/app/components/OipResourceView.vue +107 -0
  16. package/layer/app/components/oip-drugs/fiches/AssociationFiche.vue +775 -0
  17. package/layer/app/components/oip-drugs/fiches/BrandFiche.vue +1111 -0
  18. package/layer/app/components/oip-drugs/fiches/IndicationFiche.vue +182 -0
  19. package/layer/app/components/oip-drugs/fiches/JoFiche.vue +101 -0
  20. package/layer/app/components/oip-drugs/fiches/PndsFiche.vue +279 -0
  21. package/layer/app/components/oip-drugs/heart/JoCard.vue +314 -0
  22. package/layer/app/components/oip-drugs/heart/TextHighlight.vue +326 -0
  23. package/layer/app/components/oip-drugs/heart/ansm/BrandCard.vue +187 -0
  24. package/layer/app/components/oip-drugs/heart/ansm/CisDetail.vue +363 -0
  25. package/layer/app/components/oip-drugs/heart/ansm/CisTable.vue +167 -0
  26. package/layer/app/components/oip-drugs/heart/associations/NationalAssemblyCard.vue +373 -0
  27. package/layer/app/components/oip-drugs/heart/associations/NationalAssemblyFiche.vue +372 -0
  28. package/layer/app/components/oip-drugs/heart/associations/TranscriptionCard.vue +55 -0
  29. package/layer/app/components/oip-drugs/heart/elastic/SourceContainerElastic.vue +103 -0
  30. package/layer/app/components/oip-drugs/heart/france/BrandGroupCard.vue +450 -0
  31. package/layer/app/components/oip-drugs/heart/mitm/Card.vue +199 -0
  32. package/layer/app/components/oip-drugs/heart/mitm/Source.vue +23 -0
  33. package/layer/app/components/oip-drugs/heart/mitm/details/Overview.vue +381 -0
  34. package/layer/app/components/oip-drugs/heart/put/Card.vue +212 -0
  35. package/layer/app/components/oip-drugs/heart/results/AccesCard.vue +696 -0
  36. package/layer/app/components/oip-drugs/heart/results/AlertCard.vue +342 -0
  37. package/layer/app/components/oip-drugs/heart/results/AsmrCursor.vue +229 -0
  38. package/layer/app/components/oip-drugs/heart/results/EvalCard.vue +370 -0
  39. package/layer/app/components/oip-drugs/heart/results/IndicCard.vue +743 -0
  40. package/layer/app/components/oip-drugs/heart/results/MatchExplain.vue +243 -0
  41. package/layer/app/components/oip-drugs/heart/results/PrefRows.vue +105 -0
  42. package/layer/app/components/oip-drugs/heart/results/details/HasHistory.vue +487 -0
  43. package/layer/app/components/oip-drugs/heart/results/details/InternationalCountryCard.vue +461 -0
  44. package/layer/app/components/oip-drugs/heart/results/details/InternationalOverview.vue +200 -0
  45. package/layer/app/components/oip-drugs/heart/results/details/InternationalPriceDrawer.vue +647 -0
  46. package/layer/app/components/oip-drugs/heart/results/details/Monograph.vue +128 -0
  47. package/layer/app/components/oip-drugs/heart/results/details/OpinionDrawer.vue +535 -0
  48. package/layer/app/components/oip-drugs/heart/results/details/PresentationDrawer.vue +738 -0
  49. package/layer/app/components/oip-drugs/heart/results/details/Price.vue +227 -0
  50. package/layer/app/components/oip-drugs/heart/results/details/PriceOverview.vue +1261 -0
  51. package/layer/app/components/oip-drugs/heart/results/details/RecordDrawer.vue +494 -0
  52. package/layer/app/components/oip-drugs/heart/results/details/RecordList.vue +426 -0
  53. package/layer/app/components/oip-drugs/heart/results/les/Card.vue +340 -0
  54. package/layer/app/components/oip-drugs/heart/results/les/Drawer.vue +67 -0
  55. package/layer/app/components/oip-drugs/heart/results/les/IndicationDetail.vue +149 -0
  56. package/layer/app/components/oip-drugs/heart/results/les/Source.vue +20 -0
  57. package/layer/app/components/oip-drugs/heart/results/les/SourceTag.vue +39 -0
  58. package/layer/app/components/oip-drugs/heart/searchPage/DynamicSource.vue +29 -0
  59. package/layer/app/components/oip-drugs/medicam/market/Chart.vue +121 -0
  60. package/layer/app/components/oip-drugs/outpatient/ProductEvolution.vue +236 -0
  61. package/layer/app/components/oip-drugs/resources/Ansm.vue +75 -0
  62. package/layer/app/components/oip-drugs/resources/Association.vue +30 -0
  63. package/layer/app/components/oip-drugs/resources/Brand.vue +65 -0
  64. package/layer/app/components/oip-drugs/resources/Contribution.vue +216 -0
  65. package/layer/app/components/oip-drugs/resources/Hospital.vue +151 -0
  66. package/layer/app/components/oip-drugs/resources/Indication.vue +54 -0
  67. package/layer/app/components/oip-drugs/resources/Jo.vue +57 -0
  68. package/layer/app/components/oip-drugs/resources/Medicam.vue +140 -0
  69. package/layer/app/components/oip-drugs/resources/Mitm.vue +84 -0
  70. package/layer/app/components/oip-drugs/resources/NationalAssembly.vue +93 -0
  71. package/layer/app/components/oip-drugs/resources/Outpatient.vue +97 -0
  72. package/layer/app/components/oip-drugs/resources/Pnds.vue +24 -0
  73. package/layer/app/components/oip-drugs/resources/Price.vue +106 -0
  74. package/layer/app/components/oip-drugs/resources/Put.vue +143 -0
  75. package/layer/app/components/oip-science/appel-a-projet/Cards.vue +162 -0
  76. package/layer/app/components/oip-science/clinical-trials/Cards.vue +382 -0
  77. package/layer/app/components/oip-science/clinical-trials/CardsGlobal.vue +273 -0
  78. package/layer/app/components/oip-science/clinical-trials/LinkedList.vue +366 -0
  79. package/layer/app/components/oip-science/clinical-trials/PairBadge.vue +25 -0
  80. package/layer/app/components/oip-science/clinical-trials/PairBody.vue +182 -0
  81. package/layer/app/components/oip-science/clinical-trials/SitesDrawer.vue +95 -0
  82. package/layer/app/components/oip-science/common/Form.vue +73 -0
  83. package/layer/app/components/oip-science/common/MatchAvgTag.vue +283 -0
  84. package/layer/app/components/oip-science/common/NoData.vue +16 -0
  85. package/layer/app/components/oip-science/common/ScoreBadge.vue +35 -0
  86. package/layer/app/components/oip-science/common/Source.vue +31 -0
  87. package/layer/app/components/oip-science/common/TableTags.vue +279 -0
  88. package/layer/app/components/oip-science/common/Timeline.vue +104 -0
  89. package/layer/app/components/oip-science/common/ToolTips.vue +89 -0
  90. package/layer/app/components/oip-science/cross/publicationPubmed.vue +484 -0
  91. package/layer/app/components/oip-science/crossData/CrossDataLocations.vue +71 -0
  92. package/layer/app/components/oip-science/ctgov/Investigators.vue +148 -0
  93. package/layer/app/components/oip-science/ctgov/Locations.vue +102 -0
  94. package/layer/app/components/oip-science/ctgov/Publications.vue +52 -0
  95. package/layer/app/components/oip-science/ctgov/Sponsors.vue +66 -0
  96. package/layer/app/components/oip-science/ctgov/StudyDescription.vue +1136 -0
  97. package/layer/app/components/oip-science/ctgov-centers/ClinicalTrials.vue +40 -0
  98. package/layer/app/components/oip-science/ctgov-centers/Publications.vue +50 -0
  99. package/layer/app/components/oip-science/ctgov-investigators/ClinicalTrials.vue +43 -0
  100. package/layer/app/components/oip-science/ctgov-investigators/Informations.vue +171 -0
  101. package/layer/app/components/oip-science/ctgov-investigators/Publications.vue +44 -0
  102. package/layer/app/components/oip-science/elastic/DateRangeFilter.vue +209 -0
  103. package/layer/app/components/oip-science/elastic/Filter.vue +719 -0
  104. package/layer/app/components/oip-science/elastic/MatchExplain.vue +152 -0
  105. package/layer/app/components/oip-science/establishments/Cards.vue +183 -0
  106. package/layer/app/components/oip-science/establishments/ClinicalTrials.vue +62 -0
  107. package/layer/app/components/oip-science/establishments/Hcps.vue +227 -0
  108. package/layer/app/components/oip-science/establishments/Informations.vue +263 -0
  109. package/layer/app/components/oip-science/establishments/LinkedList.vue +153 -0
  110. package/layer/app/components/oip-science/establishments/MatchedLabels.vue +194 -0
  111. package/layer/app/components/oip-science/establishments/PublicFinance.vue +62 -0
  112. package/layer/app/components/oip-science/euct/Investigators.vue +125 -0
  113. package/layer/app/components/oip-science/euct/Locations.vue +102 -0
  114. package/layer/app/components/oip-science/euct/Products.vue +101 -0
  115. package/layer/app/components/oip-science/euct/Publications.vue +89 -0
  116. package/layer/app/components/oip-science/euct/Sponsors.vue +86 -0
  117. package/layer/app/components/oip-science/euct/StudyDescription.vue +1075 -0
  118. package/layer/app/components/oip-science/euct-centers/ClinicalTrials.vue +40 -0
  119. package/layer/app/components/oip-science/euct-centers/Publications.vue +55 -0
  120. package/layer/app/components/oip-science/euct-investigators/ClinicalTrials.vue +41 -0
  121. package/layer/app/components/oip-science/euct-investigators/Informations.vue +171 -0
  122. package/layer/app/components/oip-science/euct-investigators/Publications.vue +51 -0
  123. package/layer/app/components/oip-science/hcps/AppelsAProjet.vue +62 -0
  124. package/layer/app/components/oip-science/hcps/Cards.vue +237 -0
  125. package/layer/app/components/oip-science/hcps/ClinicalTrials.vue +78 -0
  126. package/layer/app/components/oip-science/hcps/Informations.vue +296 -0
  127. package/layer/app/components/oip-science/hcps/LinkedList.vue +153 -0
  128. package/layer/app/components/oip-science/hcps/MatchedLabels.vue +207 -0
  129. package/layer/app/components/oip-science/hcps/Pubmed.vue +128 -0
  130. package/layer/app/components/oip-science/local/SliderTabs.vue +99 -0
  131. package/layer/app/components/oip-science/local/SliderTabsFull.vue +135 -0
  132. package/layer/app/components/oip-science/pubmed/Authors.vue +128 -0
  133. package/layer/app/components/oip-science/pubmed/Cards.vue +417 -0
  134. package/layer/app/components/oip-science/pubmed/ClinicalTrials.vue +71 -0
  135. package/layer/app/components/oip-science/resources/Phrc.vue +39 -0
  136. package/layer/app/composables/useOipChapterScroll.ts +43 -0
  137. package/layer/app/composables/useOipResourceHooks.ts +27 -0
  138. package/layer/app/composables/useOipResourceNav.ts +66 -0
  139. package/layer/app/composables/useOipResourceViews.ts +117 -0
  140. package/layer/app/composables/useOipResources.ts +83 -0
  141. package/layer/app/oip-drugs/PORTING.md +120 -0
  142. package/layer/app/oip-drugs/composables/useAssociationDetail.ts +220 -0
  143. package/layer/app/oip-drugs/composables/useAssociationExport.ts +63 -0
  144. package/layer/app/oip-drugs/composables/useAssociationLookup.ts +105 -0
  145. package/layer/app/oip-drugs/composables/useCardPrefOptions.ts +201 -0
  146. package/layer/app/oip-drugs/composables/useCurrency.ts +121 -0
  147. package/layer/app/oip-drugs/composables/useDirectusSources.ts +224 -0
  148. package/layer/app/oip-drugs/composables/useHeartBrandMatches.ts +112 -0
  149. package/layer/app/oip-drugs/composables/useHeartDetailSearches.ts +479 -0
  150. package/layer/app/oip-drugs/composables/useHeartIntlApprovals.ts +661 -0
  151. package/layer/app/oip-drugs/composables/useHeartLesIndication.ts +168 -0
  152. package/layer/app/oip-drugs/composables/useHeartMatchExplain.ts +231 -0
  153. package/layer/app/oip-drugs/composables/useHeartReports.ts +239 -0
  154. package/layer/app/oip-drugs/composables/useHeartSearchFields.ts +233 -0
  155. package/layer/app/oip-drugs/composables/useMergeByKey.ts +23 -0
  156. package/layer/app/oip-drugs/composables/useOipDrugsElastic.ts +621 -0
  157. package/layer/app/oip-drugs/composables/usePageEmpty.ts +58 -0
  158. package/layer/app/oip-drugs/composables/v-useSalesSource.ts +64 -0
  159. package/layer/app/oip-drugs/drugs.css +500 -0
  160. package/layer/app/oip-drugs/esIndices.ts +322 -0
  161. package/layer/app/oip-drugs/kinds.ts +264 -0
  162. package/layer/app/oip-drugs/locales/en.json +1571 -0
  163. package/layer/app/oip-drugs/locales/fr.json +1571 -0
  164. package/layer/app/oip-drugs/monographs/blincyto-has.vue +289 -0
  165. package/layer/app/oip-drugs/monographs/darzalex-has.vue +276 -0
  166. package/layer/app/oip-drugs/monographs/dupixent-has.vue +216 -0
  167. package/layer/app/oip-drugs/monographs/enhertu-has.vue +280 -0
  168. package/layer/app/oip-drugs/monographs/has-sein-2023.vue +1649 -0
  169. package/layer/app/oip-drugs/monographs/ibrance-has.vue +277 -0
  170. package/layer/app/oip-drugs/monographs/imfinzi-has.vue +293 -0
  171. package/layer/app/oip-drugs/monographs/keytruda-has.vue +334 -0
  172. package/layer/app/oip-drugs/monographs/kisqali-has.vue +201 -0
  173. package/layer/app/oip-drugs/monographs/opdivo-has.vue +231 -0
  174. package/layer/app/oip-drugs/monographs/ozempic-has.vue +186 -0
  175. package/layer/app/oip-drugs/monographs/tecentriq-has.vue +312 -0
  176. package/layer/app/oip-drugs/monographs/yescarta-has.vue +272 -0
  177. package/layer/app/oip-drugs/types/elastic.ts +113 -0
  178. package/layer/app/oip-drugs/types/es/agencies.ts +152 -0
  179. package/layer/app/oip-drugs/types/es/directory.ts +54 -0
  180. package/layer/app/oip-drugs/types/es/docByIndex.ts +151 -0
  181. package/layer/app/oip-drugs/types/es/openmedic.ts +67 -0
  182. package/layer/app/oip-drugs/types/es/outpatient.ts +71 -0
  183. package/layer/app/oip-drugs/types/es/portal.ts +130 -0
  184. package/layer/app/oip-drugs/types/es/retail.ts +107 -0
  185. package/layer/app/oip-drugs/types/es/statistics.ts +29 -0
  186. package/layer/app/oip-drugs/types/heart/CurrencyRate.ts +16 -0
  187. package/layer/app/oip-drugs/types/heart/ansm.ts +106 -0
  188. package/layer/app/oip-drugs/types/heart/tag.ts +29 -0
  189. package/layer/app/oip-drugs/utils/associationFields.ts +118 -0
  190. package/layer/app/oip-drugs/utils/contributions.ts +36 -0
  191. package/layer/app/oip-drugs/utils/countryMapping.ts +387 -0
  192. package/layer/app/oip-drugs/utils/esHighlight.ts +21 -0
  193. package/layer/app/oip-drugs/utils/exportSheets.ts +57 -0
  194. package/layer/app/oip-drugs/utils/heartIntlPrice.ts +228 -0
  195. package/layer/app/oip-drugs/utils/heartStyleAndFormat.ts +262 -0
  196. package/layer/app/oip-drugs/utils/heartStyleAnsm.ts +71 -0
  197. package/layer/app/oip-drugs/utils/latestDate.ts +31 -0
  198. package/layer/app/oip-drugs/utils/p-heartCardTags.ts +53 -0
  199. package/layer/app/oip-drugs/utils/priceExport.ts +269 -0
  200. package/layer/app/oip-drugs/utils/q-hasRatings.ts +43 -0
  201. package/layer/app/oip-drugs/utils/s-openCard.ts +20 -0
  202. package/layer/app/oip-drugs/utils/sourceUuids.ts +155 -0
  203. package/layer/app/oip-drugs/utils/styleAndFormat.ts +40 -0
  204. package/layer/app/oip-drugs/utils/v-salesSeries.ts +156 -0
  205. package/layer/app/oip-drugs/utils/v-scopeTags.ts +23 -0
  206. package/layer/app/oip-science/PORTING.md +93 -0
  207. package/layer/app/oip-science/assets/smartSelection.json +428 -0
  208. package/layer/app/oip-science/composables/useAuthorMatching.ts +342 -0
  209. package/layer/app/oip-science/composables/useCTCenter.ts +107 -0
  210. package/layer/app/oip-science/composables/useCTInvestigators.ts +107 -0
  211. package/layer/app/oip-science/composables/useEstablishmentCrossData.ts +139 -0
  212. package/layer/app/oip-science/composables/useEstablishmentMatching.ts +176 -0
  213. package/layer/app/oip-science/composables/useEuct.ts +418 -0
  214. package/layer/app/oip-science/composables/useEuctCenter.ts +107 -0
  215. package/layer/app/oip-science/composables/useEuctInvestigators.ts +107 -0
  216. package/layer/app/oip-science/composables/useGlobalClinicalTrials.ts +624 -0
  217. package/layer/app/oip-science/composables/useLinkedTrials.ts +83 -0
  218. package/layer/app/oip-science/composables/useOipElastic.ts +658 -0
  219. package/layer/app/oip-science/composables/useOipSearchExplain.ts +166 -0
  220. package/layer/app/oip-science/composables/usePubmed.ts +487 -0
  221. package/layer/app/oip-science/composables/useSearchFields.ts +153 -0
  222. package/layer/app/oip-science/indexConfig.json +794 -0
  223. package/layer/app/oip-science/locales/en.json +483 -0
  224. package/layer/app/oip-science/locales/fr.json +483 -0
  225. package/layer/app/oip-science/science.css +1182 -0
  226. package/layer/app/oip-science/utils/a-openCard.ts +23 -0
  227. package/layer/app/oip-science/utils/b-openCard.ts +35 -0
  228. package/layer/app/oip-science/utils/c-filterContext.ts +81 -0
  229. package/layer/app/oip-science/utils/f-types.ts +241 -0
  230. package/layer/app/oip-science/utils/frDiseaseTerms.ts +269 -0
  231. package/layer/app/oip-science/utils/matchMethod.ts +53 -0
  232. package/layer/app/oip-science/utils/sliderTabs.ts +13 -0
  233. package/layer/app/oip-science/utils/sources.ts +15 -0
  234. package/layer/app/oip-science/utils/styleAndFormat.ts +608 -0
  235. package/layer/app/oip-science/utils/toPresets.ts +7 -0
  236. package/layer/app/oip-science/utils/valueTable.ts +126 -0
  237. package/layer/app/plugins/oip-science-i18n.ts +17 -0
  238. package/layer/app/utils/oipFicheRoutes.ts +118 -0
  239. package/layer/app/utils/oipResources.ts +440 -0
  240. package/layer/nuxt.config.ts +22 -2
  241. package/layer/public/reports/blincyto-has.html +292 -0
  242. package/layer/public/reports/blincyto-has.pdf +0 -0
  243. package/layer/public/reports/darzalex-has.html +279 -0
  244. package/layer/public/reports/darzalex-has.pdf +0 -0
  245. package/layer/public/reports/dupixent-has.html +217 -0
  246. package/layer/public/reports/dupixent-has.pdf +0 -0
  247. package/layer/public/reports/enhertu-has.html +283 -0
  248. package/layer/public/reports/enhertu-has.pdf +0 -0
  249. package/layer/public/reports/has-sein-2023.html +1639 -0
  250. package/layer/public/reports/ibrance-has.html +280 -0
  251. package/layer/public/reports/ibrance-has.pdf +0 -0
  252. package/layer/public/reports/imfinzi-has.html +297 -0
  253. package/layer/public/reports/imfinzi-has.pdf +0 -0
  254. package/layer/public/reports/keytruda-has.html +337 -0
  255. package/layer/public/reports/keytruda-has.pdf +0 -0
  256. package/layer/public/reports/kisqali-has.html +202 -0
  257. package/layer/public/reports/kisqali-has.pdf +0 -0
  258. package/layer/public/reports/opdivo-has.html +232 -0
  259. package/layer/public/reports/opdivo-has.pdf +0 -0
  260. package/layer/public/reports/ozempic-has.html +188 -0
  261. package/layer/public/reports/ozempic-has.pdf +0 -0
  262. package/layer/public/reports/tecentriq-has.html +315 -0
  263. package/layer/public/reports/tecentriq-has.pdf +0 -0
  264. package/layer/public/reports/yescarta-has.html +275 -0
  265. package/layer/public/reports/yescarta-has.pdf +0 -0
  266. package/layer/server/api/oip/es.post.ts +99 -0
  267. package/layer/server/api/oip/pdf.get.ts +70 -0
  268. package/layer/server/api/oip/reports.get.ts +98 -0
  269. package/layer/server/api/oip/resource-types.get.ts +22 -0
  270. package/package.json +1 -1
@@ -0,0 +1,624 @@
1
+ import indexConfig from '../indexConfig.json';
2
+ import useOipElastic from './useOipElastic';
3
+ import { ifNoRes } from '../utils/styleAndFormat';
4
+ // Types de France Augmented Science (types/ClinicalTrials) : pas portes, le document reste libre.
5
+ type ClinicalTrial = any;
6
+ type ClinicalTrialCondition = any;
7
+ type ClinicalTrialIntervention = any;
8
+ type ClinicalTrialResultDesignGroupsIntervention = any;
9
+ type ClinicalTrialDesignOutcome = any;
10
+ type ClinicalTrialOverallOfficial = any;
11
+ type ClinicalTrialFacilityInvestigator = any;
12
+ type ClinicalTrialFacility = any;
13
+
14
+ export default function useGlobalClinicalTrials() {
15
+ const { queryElastic, queryCustomElastic, queryOneElastic } = useOipElastic();
16
+
17
+ const indexQuery = ref(indexConfig.globalCT.index);
18
+ const cluster = ref(indexConfig.globalCT.cluster);
19
+ // GENE CONTENT
20
+ const isLoadingctList = ref(false as boolean);
21
+ const isLoadingQueryClinicalTrial = ref(false);
22
+
23
+ const resultsQueryClinicalTrial = ref(null as ClinicalTrial | null);
24
+ const ctListResult = ref(null as ClinicalTrial[] | null);
25
+
26
+ const findClinicalTrialById = ({
27
+ id,
28
+ source,
29
+ }: {
30
+ id: string;
31
+ source?: string[];
32
+ }): Promise<ClinicalTrial> => {
33
+ isLoadingQueryClinicalTrial.value = true;
34
+ return new Promise<ClinicalTrial>(async (resolve, reject) => {
35
+ try {
36
+ const res = await queryOneElastic({
37
+ index: indexQuery.value,
38
+ path: 'nct_id',
39
+ source: source,
40
+ cluster: cluster.value,
41
+ id,
42
+ });
43
+ if (res) {
44
+ resultsQueryClinicalTrial.value = res as ClinicalTrial;
45
+ resolve(res as ClinicalTrial);
46
+ } else {
47
+ // Document absent de l'index : la fiche montre son etat vide.
48
+ resolve(null as any);
49
+ }
50
+ } catch (error) {
51
+ reject(error);
52
+ } finally {
53
+ isLoadingQueryClinicalTrial.value = false;
54
+ }
55
+ });
56
+ };
57
+
58
+ const findManyClinicalTrialById = async ({
59
+ ids,
60
+ source,
61
+ }: {
62
+ ids: string[];
63
+ source?: string[];
64
+ }): Promise<ClinicalTrial[]> => {
65
+ isLoadingQueryClinicalTrial.value = true;
66
+
67
+ try {
68
+ const query = {
69
+ from: 0,
70
+ query: {
71
+ bool: {
72
+ must: [
73
+ {
74
+ terms: {
75
+ _id: ids,
76
+ },
77
+ },
78
+ ],
79
+ },
80
+ },
81
+ size: 1000,
82
+ track_total_hits: true,
83
+ sort: [{ study_first_posted_date: { order: 'desc' } }],
84
+ _source: {
85
+ include: source || [],
86
+ exclude: [],
87
+ },
88
+ };
89
+
90
+ const res = await queryCustomElastic({
91
+ index: indexQuery.value,
92
+ customQuery: query,
93
+ cluster: cluster.value,
94
+ });
95
+
96
+ if (res && res.results) {
97
+ ctListResult.value = res.results as ClinicalTrial[];
98
+ return res.results as ClinicalTrial[];
99
+ } else {
100
+ throw new Error('Aucun résultat trouvé');
101
+ }
102
+ } catch (error) {
103
+ throw error;
104
+ } finally {
105
+ isLoadingQueryClinicalTrial.value = false;
106
+ }
107
+ };
108
+
109
+ async function ctContentFromIds({
110
+ ids,
111
+ customQuery,
112
+ }: {
113
+ ids?: any;
114
+ customQuery?: any;
115
+ }): Promise<any> {
116
+ isLoadingctList.value = true;
117
+ return new Promise((resolve, reject) => {
118
+ let query = {
119
+ from: 0,
120
+ query: {
121
+ bool: {
122
+ must: [
123
+ {
124
+ terms: {
125
+ _id: ids,
126
+ },
127
+ },
128
+ ],
129
+ },
130
+ },
131
+ size: 1000,
132
+ track_total_hits: true,
133
+ sort: [{ study_first_posted_date: { order: 'desc' } }],
134
+ };
135
+
136
+ queryCustomElastic({
137
+ index: indexQuery.value,
138
+ customQuery: customQuery ? customQuery : query,
139
+ cluster: cluster.value,
140
+ })
141
+ .then((res) => {
142
+ if (res) {
143
+ ctListResult.value = res?.results;
144
+ resolve(res);
145
+ } else {
146
+ reject('Aucun résultat trouvé');
147
+ }
148
+ })
149
+ .catch((error) => {
150
+ reject(error);
151
+ })
152
+ .finally(() => {
153
+ isLoadingctList.value = false;
154
+ });
155
+ });
156
+ }
157
+
158
+ // SPECIAL QUERY
159
+ // ::::::::::::::::::::::::::::::::::::::::::::::::::
160
+
161
+ const CTDiseaseQuery = (name: string, synonymes?: string[]) => {
162
+ // IF ICD10
163
+
164
+ if (synonymes && synonymes.length) {
165
+ const mergeResult = synonymes.concat(name);
166
+ const query = {
167
+ bool: {
168
+ should: [] as any[],
169
+ },
170
+ };
171
+
172
+ mergeResult.forEach((name) => {
173
+ query.bool.should.push(
174
+ {
175
+ query_string: {
176
+ query: `(\"${name}\")`,
177
+ fields: ['official_title'],
178
+ default_operator: 'AND',
179
+ analyze_wildcard: true,
180
+ allow_leading_wildcard: false,
181
+ phrase_slop: 0,
182
+ auto_generate_synonyms_phrase_query: true,
183
+ fuzziness: 'AUTO',
184
+ },
185
+ },
186
+ {
187
+ nested: {
188
+ path: 'brief_summary',
189
+ query: {
190
+ query_string: {
191
+ query: `(\"${name}\")`,
192
+ fields: ['brief_summary.brief_summary'],
193
+ default_operator: 'AND',
194
+ analyze_wildcard: true,
195
+ allow_leading_wildcard: false,
196
+ phrase_slop: 0,
197
+ auto_generate_synonyms_phrase_query: true,
198
+ fuzziness: 'AUTO',
199
+ },
200
+ },
201
+ },
202
+ },
203
+ {
204
+ nested: {
205
+ path: 'brief_summary',
206
+ query: {
207
+ query_string: {
208
+ query: `(\"${name}\")`,
209
+ fields: ['brief_summary.brief_summary'],
210
+ default_operator: 'AND',
211
+ analyze_wildcard: true,
212
+ allow_leading_wildcard: false,
213
+ phrase_slop: 0,
214
+ auto_generate_synonyms_phrase_query: true,
215
+ fuzziness: 'AUTO',
216
+ },
217
+ },
218
+ },
219
+ },
220
+ {
221
+ nested: {
222
+ path: 'keywords',
223
+ query: {
224
+ query_string: {
225
+ query: `(\"${name}\")`,
226
+ fields: ['keywords.keyword_name'],
227
+ default_operator: 'AND',
228
+ analyze_wildcard: true,
229
+ allow_leading_wildcard: false,
230
+ phrase_slop: 0,
231
+ auto_generate_synonyms_phrase_query: true,
232
+ fuzziness: 'AUTO',
233
+ },
234
+ },
235
+ },
236
+ },
237
+ {
238
+ nested: {
239
+ path: 'rare_diseases',
240
+ query: {
241
+ query_string: {
242
+ query: `(\"${name}\")`,
243
+ fields: ['rare_diseases.concat_disease_name_orpha_code'],
244
+ default_operator: 'AND',
245
+ analyze_wildcard: true,
246
+ allow_leading_wildcard: false,
247
+ phrase_slop: 0,
248
+ auto_generate_synonyms_phrase_query: true,
249
+ fuzziness: 'AUTO',
250
+ },
251
+ },
252
+ },
253
+ },
254
+ {
255
+ nested: {
256
+ path: 'rare_diseases',
257
+ query: {
258
+ query_string: {
259
+ query: `(\"${name}\")`,
260
+ fields: ['rare_diseases.disease_synonyms'],
261
+ default_operator: 'AND',
262
+ analyze_wildcard: true,
263
+ allow_leading_wildcard: false,
264
+ phrase_slop: 0,
265
+ auto_generate_synonyms_phrase_query: true,
266
+ fuzziness: 'AUTO',
267
+ },
268
+ },
269
+ },
270
+ },
271
+ {
272
+ nested: {
273
+ path: 'conditions',
274
+ query: {
275
+ query_string: {
276
+ query: `(\"${name}\")`,
277
+ fields: ['conditions.condition_name_en'],
278
+ default_operator: 'AND',
279
+ analyze_wildcard: true,
280
+ allow_leading_wildcard: false,
281
+ phrase_slop: 0,
282
+ auto_generate_synonyms_phrase_query: true,
283
+ fuzziness: 'AUTO',
284
+ },
285
+ },
286
+ },
287
+ }
288
+ );
289
+ });
290
+ return query;
291
+ }
292
+ // IF RARE DISEASES
293
+ else {
294
+ return {
295
+ bool: {
296
+ should: [
297
+ {
298
+ nested: {
299
+ path: 'rare_diseases',
300
+ query: {
301
+ query_string: {
302
+ query: `(\"${name}\")`,
303
+ fields: ['rare_diseases.concat_disease_name_orpha_code'],
304
+ default_operator: 'AND',
305
+ analyze_wildcard: true,
306
+ allow_leading_wildcard: false,
307
+ phrase_slop: 0,
308
+ auto_generate_synonyms_phrase_query: true,
309
+ fuzziness: 'AUTO',
310
+ },
311
+ },
312
+ },
313
+ },
314
+ {
315
+ nested: {
316
+ path: 'rare_diseases',
317
+ query: {
318
+ query_string: {
319
+ query: `(\"${name}\")`,
320
+ fields: ['rare_diseases.disease_synonyms'],
321
+ default_operator: 'AND',
322
+ analyze_wildcard: true,
323
+ allow_leading_wildcard: false,
324
+ phrase_slop: 0,
325
+ auto_generate_synonyms_phrase_query: true,
326
+ fuzziness: 'AUTO',
327
+ },
328
+ },
329
+ },
330
+ },
331
+ {
332
+ nested: {
333
+ path: 'conditions',
334
+ query: {
335
+ query_string: {
336
+ query: `(\"${name}\")`,
337
+ fields: ['conditions.condition_name_en'],
338
+ default_operator: 'AND',
339
+ analyze_wildcard: true,
340
+ allow_leading_wildcard: false,
341
+ phrase_slop: 0,
342
+ auto_generate_synonyms_phrase_query: true,
343
+ fuzziness: 'AUTO',
344
+ },
345
+ },
346
+ },
347
+ },
348
+ ],
349
+ },
350
+ };
351
+ }
352
+ };
353
+
354
+ const CTMoleculeQuery = (label: string) => ({
355
+ bool: {
356
+ should: [
357
+ // {
358
+ // match: {
359
+ // 'atc5.molecule.keyword': label,
360
+ // },
361
+ // },
362
+ {
363
+ query_string: {
364
+ query: `(\"${label}\")`,
365
+ fields: ['atc5.molecule.keyword', 'official_title'],
366
+ default_operator: 'AND',
367
+ analyze_wildcard: true,
368
+ allow_leading_wildcard: false,
369
+ phrase_slop: 0,
370
+ auto_generate_synonyms_phrase_query: true,
371
+ fuzziness: 'AUTO',
372
+ },
373
+ },
374
+ ],
375
+ },
376
+ });
377
+
378
+ const CTIdsQuery = (ids: string) => ({
379
+ bool: {
380
+ must: [
381
+ {
382
+ terms: {
383
+ _id: ids,
384
+ },
385
+ },
386
+ ],
387
+ },
388
+ });
389
+
390
+ // FOR EXPORTS AND TABLES
391
+ // ::::::::::::::::::::::::::::::::::::::::::::::::::
392
+
393
+ const formatCTGlobalData = (results: ClinicalTrial[]) => {
394
+ return results.map((item: ClinicalTrial) => ({
395
+ ...item,
396
+
397
+ brief_summary: item.brief_summary?.[0]?.brief_summary || null,
398
+
399
+ conditions: item.conditions?.length
400
+ ? item.conditions
401
+ .map(
402
+ (x: ClinicalTrialCondition) =>
403
+ `${x.condition_name_en || x.condition_name_fr}${
404
+ x.condition_description ? `\n${x.condition_description}` : ''
405
+ }`
406
+ )
407
+ .join(',\n\n')
408
+ : null,
409
+
410
+ intervention: item.intervention?.length
411
+ ? item.intervention
412
+ .map(
413
+ (x: ClinicalTrialIntervention) =>
414
+ `${x.intervention_type}: ${x.intervention_name}\n${x.intervention_description}`
415
+ )
416
+ .join(',\n\n')
417
+ : null,
418
+
419
+ with_result: item.with_result ? 'Yes' : 'No',
420
+
421
+ allocation: Array.isArray(item?.designs)
422
+ ? item.designs[0]?.allocation
423
+ : null,
424
+
425
+ intervention_model: Array.isArray(item?.designs)
426
+ ? item?.designs[0]?.intervention_model
427
+ : null,
428
+
429
+ masking: Array.isArray(item?.designs)
430
+ ? item.designs[0]?.subject_masked
431
+ ? 'Yes'
432
+ : 'No'
433
+ : null,
434
+
435
+ masking_description: Array.isArray(item?.designs)
436
+ ? item.designs[0]?.masking
437
+ : null,
438
+
439
+ primary_purpose: Array.isArray(item?.designs)
440
+ ? item?.designs[0]?.primary_purpose
441
+ : null,
442
+
443
+ arms: item?.resultDesignGroupsInterventions?.length
444
+ ? item.resultDesignGroupsInterventions
445
+ .map(
446
+ (x: ClinicalTrialResultDesignGroupsIntervention) =>
447
+ `${x.title} : ${x.intervention_type}\n${x.intervention_description}`
448
+ )
449
+ .join(',\n\n')
450
+ : null,
451
+
452
+ primary_outcomes_measures: item.design_outcomes?.filter(
453
+ (d: ClinicalTrialDesignOutcome) => d.outcome_type === 'primary'
454
+ )?.length
455
+ ? item.design_outcomes
456
+ .filter(
457
+ (d: ClinicalTrialDesignOutcome) => d.outcome_type === 'primary'
458
+ )
459
+ .map(
460
+ (x: ClinicalTrialDesignOutcome) =>
461
+ `${x.measure}\nDescription: ${ifNoRes(
462
+ x.outcome_description
463
+ )}\nTime frame: ${ifNoRes(x.time_frame)}\nPopulation: ${ifNoRes(
464
+ x.population
465
+ )}`
466
+ )
467
+ .join(',\n\n')
468
+ : null,
469
+
470
+ secondary_outcomes_measures: item.design_outcomes?.filter(
471
+ (d: ClinicalTrialDesignOutcome) => d.outcome_type === 'secondary'
472
+ )?.length
473
+ ? item.design_outcomes
474
+ .filter(
475
+ (d: ClinicalTrialDesignOutcome) => d.outcome_type === 'secondary'
476
+ )
477
+ .map(
478
+ (x: ClinicalTrialDesignOutcome) =>
479
+ `${x.measure}\nDescription: ${ifNoRes(
480
+ x.outcome_description
481
+ )}\nTime frame: ${ifNoRes(x.time_frame)}\nPopulation: ${ifNoRes(
482
+ x.population
483
+ )}`
484
+ )
485
+ .join(',\n\n')
486
+ : null,
487
+
488
+ other_outcomes_measures: item.design_outcomes?.filter(
489
+ (d: ClinicalTrialDesignOutcome) => d.outcome_type === 'other'
490
+ )?.length
491
+ ? item.design_outcomes
492
+ .filter(
493
+ (d: ClinicalTrialDesignOutcome) => d.outcome_type === 'other'
494
+ )
495
+ .map(
496
+ (x: ClinicalTrialDesignOutcome) =>
497
+ `${x.measure}\nDescription: ${ifNoRes(
498
+ x.outcome_description
499
+ )}\nTime frame: ${ifNoRes(x.time_frame)}\nPopulation: ${ifNoRes(
500
+ x.population
501
+ )}`
502
+ )
503
+ .join(',\n\n')
504
+ : null,
505
+
506
+ minimum_age: item.eligibilities?.length
507
+ ? `${item.eligibilities[0]?.minimum_age} to ${item.eligibilities[0]?.maximum_age}`
508
+ : null,
509
+
510
+ gender: item.eligibilities?.[0]?.gender || null,
511
+
512
+ gender_based:
513
+ item.eligibilities?.[0]?.gender_based !== undefined
514
+ ? item.eligibilities[0].gender_based
515
+ ? 'Yes'
516
+ : 'No'
517
+ : null,
518
+
519
+ healthy_volunteers: item.eligibilities?.[0]?.healthy_volunteers
520
+ ? 'Yes'
521
+ : 'No',
522
+
523
+ criteria: item.eligibilities?.[0]?.criteria || null,
524
+
525
+ scientific_leadership: item.overall_officials?.length
526
+ ? item.overall_officials
527
+ .map(
528
+ (x: ClinicalTrialOverallOfficial) =>
529
+ `Role: ${x.role}\nName: ${x.name}\nAffiliation: ${x.affiliation}`
530
+ )
531
+ .join(',\n\n')
532
+ : null,
533
+
534
+ investigators: item.facilitiesInvestigators?.length
535
+ ? item.facilitiesInvestigators
536
+ .map((x: ClinicalTrialFacilityInvestigator) => {
537
+ const facility = item.facilities?.find(
538
+ (y: ClinicalTrialFacility) => y.facility_id === x.facility_id
539
+ );
540
+ return `Role: ${x.facility_investigator_role}\nName: ${x.name}${
541
+ facility
542
+ ? `\nLocation: ${facility.name} \nCity: ${facility.city} \nCountry: ${facility.country}`
543
+ : ''
544
+ }`;
545
+ })
546
+ .join(',\n\n')
547
+ : null,
548
+
549
+ is_fda_regulated_drug: item.is_fda_regulated_drug ? 'Yes' : 'No',
550
+ is_fda_regulated_device: item.is_fda_regulated_device ? 'Yes' : 'No',
551
+
552
+ genomics: item.genomics?.length
553
+ ? item.genomics.map((x: any) => `${x.symbol}`).join(',\n\n')
554
+ : null,
555
+
556
+ rare_diseases: item.rare_diseases?.length
557
+ ? item.rare_diseases
558
+ .map((x: any) => `${x.concat_disease_name_orpha_code}`)
559
+ .join(',\n\n')
560
+ : null,
561
+
562
+ oncology_icd10: (item as any).diseases?.length
563
+ ? (item as any).diseases
564
+ .flatMap((x: any) => x.icd10?.map((icd: any) => icd.combined_label) ?? [])
565
+ .filter((v: any, i: number, a: any[]) => a.indexOf(v) === i)
566
+ .join(',\n')
567
+ : null,
568
+
569
+ oncology_terms: (item as any).diseases?.length
570
+ ? (item as any).diseases
571
+ .flatMap((x: any) => x.section?.map((s: any) => s.label) ?? [])
572
+ .filter((v: any, i: number, a: any[]) => v && a.indexOf(v) === i)
573
+ .join(',\n')
574
+ : null,
575
+
576
+ info_keywords: item.keywords?.length
577
+ ? item.keywords.map((x: any) => `${x.keyword}`).join(',\n\n')
578
+ : null,
579
+
580
+ info_link: item.nct_id
581
+ ? `https://clinicaltrials.gov/ct2/show/${item.nct_id}`
582
+ : null,
583
+
584
+ countries: item.countries?.length
585
+ ? item.countries.map((x: any) => x.country_name).join(',\n')
586
+ : null,
587
+
588
+ sponsors: item.sponsors?.length
589
+ ? item.sponsors
590
+ .map((x: any) => `${x.sponsor_name} (${x.sponsor_type})`)
591
+ .join(',\n\n')
592
+ : null,
593
+
594
+ contacts: item.facilitiesContacts?.length
595
+ ? item.facilitiesContacts
596
+ .map((x: any) => {
597
+ const facility = item.facilities?.find(
598
+ (y: ClinicalTrialFacility) => y.facility_id === x.facility_id
599
+ );
600
+ return `Name: ${x.name}\nPhone: ${x.phone}\nEmail: ${x.email}${
601
+ facility
602
+ ? `\nLocation: ${facility.name} \nCity: ${facility.city} \nCountry: ${facility.country}`
603
+ : ''
604
+ }`;
605
+ })
606
+ .join(',\n\n')
607
+ : null,
608
+ }));
609
+ };
610
+
611
+ return {
612
+ ctContentFromIds,
613
+ ctListResult,
614
+ isLoadingctList,
615
+ CTIdsQuery,
616
+ CTDiseaseQuery,
617
+ CTMoleculeQuery,
618
+ findClinicalTrialById,
619
+ resultsQueryClinicalTrial,
620
+ isLoadingQueryClinicalTrial,
621
+ findManyClinicalTrialById,
622
+ formatCTGlobalData,
623
+ };
624
+ }
@@ -0,0 +1,83 @@
1
+ import indexConfig from '../indexConfig.json';
2
+ import useOipElastic from './useOipElastic';
3
+
4
+ /**
5
+ * Essais enregistres dans les deux registres : l'essai EUCT porte le numero
6
+ * NCT (`nct_number`), c'est le seul lien. Une liste charge l'essai jumeau de
7
+ * ses resultats en une requete, limitee aux nouveaux numeros et aux champs
8
+ * que la carte double affiche ; « Charger plus » ne redemande que la suite.
9
+ */
10
+ const EUCT_FIELDS = [
11
+ 'euct_number',
12
+ 'nct_number',
13
+ 'public_title',
14
+ 'global_status',
15
+ 'trial_phase',
16
+ 'medical_condition.condition_name_en',
17
+ 'products.productDictionaryInfo.prodName',
18
+ 'products.productDictionaryInfo.activeSubstanceName',
19
+ 'co_sponsors.organisation.name',
20
+ 'enrollment_status.total_planned_enrollment',
21
+ ];
22
+
23
+ const NCT_FIELDS = [
24
+ 'nct_id',
25
+ 'official_title',
26
+ 'overall_status',
27
+ 'phase',
28
+ 'conditions.condition_name_en',
29
+ 'intervention.intervention_name',
30
+ 'sponsors.sponsor_name',
31
+ 'enrollment',
32
+ ];
33
+
34
+ export function useLinkedTrials(kind: 'euct' | 'nct') {
35
+ const { queryCustomElastic } = useOipElastic();
36
+ /** Numero de l'essai de la liste -> essai jumeau (null : pas de jumeau). */
37
+ const linked = ref<Record<string, any | null>>({});
38
+
39
+ async function load(ids: (string | null | undefined)[]) {
40
+ const wanted = [...new Set(ids.filter((x): x is string => !!x))].filter(
41
+ (id) => !(id in linked.value),
42
+ );
43
+ if (!wanted.length) return;
44
+ const next: Record<string, any | null> = Object.fromEntries(wanted.map((id) => [id, null]));
45
+ try {
46
+ if (kind === 'euct') {
47
+ // Liste NCT : les essais EUCT qui citent ces numeros NCT.
48
+ const res = await queryCustomElastic({
49
+ index: indexConfig.euct.index,
50
+ cluster: indexConfig.euct.cluster,
51
+ customQuery: {
52
+ size: wanted.length,
53
+ _source: EUCT_FIELDS,
54
+ query: { terms: { 'nct_number.keyword': wanted } },
55
+ },
56
+ });
57
+ for (const doc of res?.results || []) {
58
+ if (doc?.nct_number && doc.nct_number in next) next[doc.nct_number] = doc;
59
+ }
60
+ } else {
61
+ // Liste EUCT : `wanted` porte les numeros NCT cites, cle = NCT.
62
+ const res = await queryCustomElastic({
63
+ index: indexConfig.globalCT.index,
64
+ cluster: indexConfig.globalCT.cluster,
65
+ customQuery: {
66
+ size: wanted.length,
67
+ _source: NCT_FIELDS,
68
+ query: { ids: { values: wanted } },
69
+ },
70
+ });
71
+ for (const doc of res?.results || []) {
72
+ if (doc?.nct_id && doc.nct_id in next) next[doc.nct_id] = doc;
73
+ }
74
+ }
75
+ } catch (e) {
76
+ console.error('Error fetching linked trials:', e);
77
+ return;
78
+ }
79
+ linked.value = { ...linked.value, ...next };
80
+ }
81
+
82
+ return { linked, load };
83
+ }