Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ALS-6175] Add 'what is the PIC-SURE API page' #21

Merged
merged 3 commits into from
Apr 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/lib/components/Navigation.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,13 @@

async function loginUser(resp: string) {
await login(resp).catch((e) => {
console.log(e);
toastStore.trigger({
message:
'An error occured while validating your token. Please try again later. If this problem persists, please contact an administrator.',
background: 'variant-filled-error',
});
console.log(e);
toastStore.trigger({
message:
'An error occured while validating your token. Please try again later. If this problem persists, please contact an administrator.',
background: 'variant-filled-error',
});
});
}

function handleLogin() {
Expand Down
2 changes: 1 addition & 1 deletion src/lib/configuration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export const branding = {
{
header: 'What is the PIC‑SURE API?',
body: 'The PIC-SURE Application Programming Interface allows you to search, query, and export data using Python or R. \n\nClick this card to read more about the PIC-SURE API.',
link: 'https://pic-sure.org/about',
link: '/api/help',
},
{
header: 'PIC‑SURE API Examples',
Expand Down
6 changes: 5 additions & 1 deletion src/routes/api/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@
</section>
<section id="info-cards" class="w-full flex flex-wrap flex-row justify-between mt-6">
{#each branding.apiPage.cards as card}
<a href={card.link} target="_blank" class="pic-sure-info-card basis-2/4">
<a
href={card.link}
target={card.link.startsWith('http') ? '_blank' : '_self'}
class="pic-sure-info-card basis-2/4"
>
<div class="card card-hover">
<header class="card-header flex flex-col items-center">
<h4 class="my-1" data-testid={card.header}>{card.header}</h4>
Expand Down
147 changes: 147 additions & 0 deletions src/routes/api/help/+page.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
<script lang="ts">
import Content from '$lib/components/Content.svelte';
</script>

<Content>
<div class="mb-8 text-center">
<a class="float-left mr-2 text-primary-500" href="/api">
<i class="btn btn-sm variant-ringed-primary fa-solid fa-angles-left mr-3 text-primary-500"
></i>Back
</a>
<h1>PIC-SURE Application Programming Interface (API)</h1>
</div>

<div class="my-2">
<h2>What is the PICSURE API?</h2>
<p>
The <em
>Patient-Centered Information Commons: Standardized Unification of Research Elements</em
>
(PIC-SURE) <em> Application Programming Interface</em> (API) is a powerful tool designed to simplify
access to a diverse range of databases in the healthcare and research domains. These databases
often have varying architectures and data organizations, presenting challenges for researchers
looking to extract and interpret medical insights
</p>
<p>
Despite the inherent diversity among these databases, the PIC-SURE API facilitates a seamless
interaction with a wide range of data, providing researchers with a unified interface for
database access. This approach significantly simplifies the data access process, empowering
researchers to concentrate their efforts on research analysis and deriving valuable medical
insights.
</p>
</div>

<div class="img-placeholder border my-2">Placeholder image</div>

<div class="grid grid-cols-3 divide-x my-2">
<div class="col-span-2 px-4">
<h2>Key Features</h2>
<dl>
<dt>Search and Query:</dt>
<dd>
Easily search and query the data using intuitive commands and syntax, allowing you to
filter datasets based on specific criteria and keywords.
</dd>
<dt>Participant-Level Data:</dt>
<dd>
Access and export participant-level data, enabling you to conduct detailed analysis and
exploration of individual participant data.
</dd>
<dt>Python and R:</dt>
<dd>
The API is available in Python and R, enabling researchers to query databases using their
preferred coding language.
</dd>
<dt>Open Source:</dt>
<dd>
The PIC-SURE API is open source with an Apache 2.0 license, providing transparency,
flexibility, and community-driven development.
</dd>
</dl>
</div>
<div class="px-4">
<h2>More Information</h2>
<ul class="list-disc ml-4">
<li>
<a
target="_blank"
href="https://app.gitbook.com/o/HwwUMljKAspjFDq5CK7G/s/G6504U3TjKPfCoTEdgY8/"
>PIC-SURE User Guide</a
>
</li>
<li>
<a target="_blank" href="https://github.com/hms-dbmi/pic-sure"
>PIC-SURE API GitHub repository</a
>
</li>
<li>
<a target="_blank" href="https://github.com/hms-dbmi/pic-sure-python-client"
>Python client</a
>
</li>
<li>
<a target="_blank" href="https://github.com/hms-dbmi/pic-sure-python-adapter-hpds"
>Python adapter</a
>
</li>
<li>
<a target="_blank" href="https://github.com/hms-dbmi/pic-sure-r-adapter-hpds">R adapter</a
>
</li>
<li>
<a
target="_blank"
href="https://github.com/hms-dbmi/pic-sure-r-adapter-hpds/blob/main/hpds.pdf"
>R client</a
>
</li>
</ul>
</div>
</div>

<div class="text-right my-6">
<a class="btn btn-lg variant-ringed-primary" href="/api/start">
Get started using the PIC-Sure API <i class="fa-solid fa-angles-right ml-1 text-primary-500"
></i>
</a>
</div>
</Content>

<style>
h1 {
font-size: 2.25em;
}
h2 {
font-size: 1.75em;
}
p {
display: block;
margin: 1em;
}
h2 {
margin: 0 0 0.5em;
}
.img-placeholder {
width: 80%;
margin: 3em auto;
padding: 3em;
}

em {
font-weight: bold;
}
dt {
float: left;
clear: left;
font-weight: bold;
margin: 0 0.3em 0 1em;
}

dd {
padding: 0 1em 0.5em;
}

li {
margin: 0 0.5em 1em;
}
</style>
13 changes: 13 additions & 0 deletions src/routes/api/start/+page.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<script lang="ts">
import Content from '$lib/components/Content.svelte';
</script>

<Content>
<div class="mb-8 text-center">
<a class="float-left mr-2 text-primary-500" href="/api/help">
<i class="btn btn-sm variant-ringed-primary fa-solid fa-angles-left mr-3 text-primary-500"
></i>Back
</a>
<h1>Get Started</h1>
</div>
</Content>