From acea77361477926dd2a8d1a3a7633cf09aa7098d Mon Sep 17 00:00:00 2001 From: MuslemRahimi Date: Wed, 26 Jun 2024 16:08:40 +0200 Subject: [PATCH] add clinical trial component --- src/lib/components/ClinicalTrial.svelte | 548 ++++++++++++++++++++++ src/lib/store.ts | 1 + src/routes/stocks/[tickerID]/+page.svelte | 10 +- 3 files changed, 558 insertions(+), 1 deletion(-) create mode 100644 src/lib/components/ClinicalTrial.svelte diff --git a/src/lib/components/ClinicalTrial.svelte b/src/lib/components/ClinicalTrial.svelte new file mode 100644 index 00000000..2f94348e --- /dev/null +++ b/src/lib/components/ClinicalTrial.svelte @@ -0,0 +1,548 @@ + + + + + +
+
+ +
+ + +
+ + {#if data?.user?.tier === 'Pro'} + {#if isLoaded} + + {#if rawData?.length !== 0} + +
+
+ The Biotech company {$displayCompanyName} has conducted a total of {abbreviateNumber(rawData?.length)} clinical trials. + Out of these, {numOfActive === 0 ? 'none' : numOfActive} are currently active, + {numOfCompleted} have been completed, {numOfTerminated} were terminated and {numOfResults} trials have produced results. + +
+
+ + +
+ + + +
+ +
+
+ +
+ + + + + + +

+ Latest Information +

+ + + +
+
+ + + + + + + + + + + {#each rawData as item,index} + handleViewData(item)} class="border-y border-gray-800 odd:bg-[#202020] sm:hover:bg-[#245073] sm:hover:bg-opacity-[0.2] bg-[#0F0F0F] border-b-[#0F0F0F] cursor-pointer"> + + + + + + + + + + + + {/each} + +
TitleStagePhase StatusResult
+ {item["Study Title"]?.length > charNumber ? formatString(item["Study Title"]?.slice(0,charNumber)) + "..." : formatString(item["Study Title"])} + + {formatString(item['Study Status'])} + + {item['Phases'] !== 'NA' ? formatString(item["Phases"])?.replace('Phase','') : '-'} + + {formatString(item["Study Results"])} +
+ + +
+
+ + + {/if} + + {:else} +
+
+ +
+
+ {/if} + + {:else} +
+ + Unlock content with Pro Subscription +
+ {/if} + +
+
+ + + + + + + + + + + + + + +
+ +
+ + +
+ + + + +
+ +

+ Title: {trialTitle} +

+

+ Brief Summary: + {trialSummary} +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NCT Number{trialId}
Start Date{trialStart}
End Date{trialEnd}
Study Status{trialStage}
Phase Status{trialPhase}
Study Results{trialResult}
Sex{formatString(trialSex)}
Age{formatString(trialAge)?.replace('Older_adult', 'Older Adult')}
Sponsor{trialSponsor}
Enrollment{trialEnrollment}
Study Type{trialStudyType}
Funder Type{trialFunderType}
Website{trialLink}
+ + +
+ +
+
+
+ + + \ No newline at end of file diff --git a/src/lib/store.ts b/src/lib/store.ts index cb71e678..cdaef86f 100644 --- a/src/lib/store.ts +++ b/src/lib/store.ts @@ -72,6 +72,7 @@ export const sentimentComponent = writable((false)); export const analystEstimateComponent = writable((false)); export const marketMakerComponent = writable((false)); export const optionComponent = writable((false)); +export const clinicalTrialComponent = writable((false)); export const strategyId = writable( ("")); diff --git a/src/routes/stocks/[tickerID]/+page.svelte b/src/routes/stocks/[tickerID]/+page.svelte index 30d992f8..20b4be1c 100644 --- a/src/routes/stocks/[tickerID]/+page.svelte +++ b/src/routes/stocks/[tickerID]/+page.svelte @@ -3,7 +3,7 @@ import {AreaSeries, Chart, PriceLine, CandlestickSeries} from 'svelte-lightweight-charts'; import { TrackingModeExitMode } from 'lightweight-charts'; - import {getCache, setCache, optionComponent, marketMakerComponent, analystEstimateComponent, sentimentComponent, screenWidth, displayCompanyName, numberOfUnreadNotification, globalForm, varComponent, shareStatisticsComponent, enterpriseComponent, darkPoolComponent, retailVolumeComponent, shareholderComponent, trendAnalysisComponent, revenueSegmentationComponent, priceAnalysisComponent, fundamentalAnalysisComponent, userRegion, isCrosshairMoveActive, realtimePrice, priceIncrease, currentPortfolioPrice, currentPrice, stockTicker, isOpen, isBeforeMarketOpen, isWeekend} from '$lib/store'; + import {getCache, setCache, clinicalTrialComponent, optionComponent, marketMakerComponent, analystEstimateComponent, sentimentComponent, screenWidth, displayCompanyName, numberOfUnreadNotification, globalForm, varComponent, shareStatisticsComponent, enterpriseComponent, darkPoolComponent, retailVolumeComponent, shareholderComponent, trendAnalysisComponent, revenueSegmentationComponent, priceAnalysisComponent, fundamentalAnalysisComponent, userRegion, isCrosshairMoveActive, realtimePrice, priceIncrease, currentPortfolioPrice, currentPrice, stockTicker, isOpen, isBeforeMarketOpen, isWeekend} from '$lib/store'; import { onDestroy, onMount } from 'svelte'; import BullBearSay from '$lib/components/BullBearSay.svelte'; import CommunitySentiment from '$lib/components/CommunitySentiment.svelte'; @@ -1244,6 +1244,14 @@ function changeChartType() { {/if} + +
+ {#await import('$lib/components/ClinicalTrial.svelte') then {default: Comp}} + + {/await} +
+
+