Skip to content
Open
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
1 change: 1 addition & 0 deletions gatsby-config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
module.exports = {
pathPrefix: `/drug-cbd-research`, // <-- your subpath
siteMetadata: {
title: `openFDA`,
siteUrl: `https://www.open.fda.gov`,
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
"author": "Violet Wren, Priyanka Ayer",
"scripts": {
"dev": "gatsby develop -H 0.0.0.0 -p 3000",
"serve": "gatsby serve -H 0.0.0.0 -p 3000",
"build": "gatsby build --verbose",
"serve": "gatsby serve --prefix-paths -H 0.0.0.0 -p 3000",
"build": "gatsby build --prefix-paths --verbose",
"format": "prettier --trailing-comma es5 --no-semi --single-quote --write 'src/**/*.{js,ts,tsx}'",
"develop": "gatsby develop",
"develop": "gatsby develop --prefix-paths",
"cy:open": "cypress open",
"cy:run": "cypress run",
"test:e2e": "start-server-and-test dev http-get://127.0.0.1:3000 cy:open",
Expand Down
6 changes: 6 additions & 0 deletions src/components/ApiStatus.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ let endpointKeys = [
'drugenforcement',
'drugsfda',
'drugshortages',
'drugresearchcbdliverjamap1',
'drugresearchcbdliverjamap2',
'deviceevent',
'devicerecall',
'deviceclass',
Expand Down Expand Up @@ -53,6 +55,8 @@ const catMap: Record<EndpointKey, string> = Object.freeze({
'drugenforcement': 'Drugs › Enforcement Reports',
'drugsfda': 'Drugs › Drugs@FDA',
'drugshortages': 'Drugs › Drug Shortages',
'drugresearchcbdliverjamap1': 'Drugs › CBD Liver JAMA Research Part One',
'drugresearchcbdliverjamap2': 'Drugs › CBD Liver JAMA Research Part Two',
'deviceevent': 'Devices › Adverse Events',
'devicerecall': 'Devices › Recalls',
'deviceclass': 'Devices › Classification',
Expand Down Expand Up @@ -84,6 +88,8 @@ const endpointLinkMap: Record<EndpointKey, string> = Object.freeze({
'drugenforcement': 'drug/enforcement',
'drugsfda': 'drug/drugsfda',
'drugshortages': 'drug/shortages',
'drugresearchcbdliverjamap1': 'drug/researchcbdliverjamap1',
'drugresearchcbdliverjamap2': 'drug/researchcbdliverjamap2',
'deviceevent': 'device/event',
'devicerecall': 'device/recall',
'deviceclass': 'device/classification',
Expand Down
4 changes: 4 additions & 0 deletions src/components/ApiUsage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,8 @@ if (!bp.mob && hasWindow) {
<tr><td>Enforcement Reports</td><td>{this.docCount('drugenforcement')}</td></tr>
<tr><td>Drugs@FDA</td><td>{this.docCount('drugsfda')}</td></tr>
<tr><td>Drug Shortages</td><td>{this.docCount('drugshortages')}</td></tr>
<tr><td>CBD Liver JAMA Research Part One</td><td>{this.docCount('drugresearchcbdliverjamap1')}</td></tr>
<tr><td>CBD Liver JAMA Research Part Two</td><td>{this.docCount('drugresearchcbdliverjamap2')}</td></tr>

<tr className='bg-primary-darkest clr-white'><td colSpan={2}><strong>Foods</strong></td></tr>
<tr><td>Adverse Event Reports</td><td>{this.docCount('foodevent')}</td></tr>
Expand Down Expand Up @@ -514,6 +516,8 @@ if (!bp.mob && hasWindow) {
<tr><td>Enforcement Reports</td><td>{this.downloadCount('drugenforcement')}</td></tr>
<tr><td>Drugs@FDA</td><td>{this.downloadCount('drugsfda')}</td></tr>
<tr><td>Drug Shortages</td><td>{this.downloadCount('drugshortages')}</td></tr>
<tr><td>CBD Liver JAMA Research Part One</td><td>{this.downloadCount('drugresearchcbdliverjamap1')}</td></tr>
<tr><td>CBD Liver JAMA Research Part Two</td><td>{this.downloadCount('drugresearchcbdliverjamap2')}</td></tr>

<tr className='bg-primary-darkest clr-white'><td colSpan={2}><strong>Foods</strong></td></tr>
<tr><td>Adverse Event Reports</td><td>{this.downloadCount('foodevent')}</td></tr>
Expand Down
2 changes: 2 additions & 0 deletions src/components/DataDictionary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@ class DataDictionary extends React.Component<{}, DataDictionaryState> {
'nsde': 'NSDE',
'drugsfda': 'Drugs@FDA',
'drugshortages': 'Drug Shortages',
'researchcbdliverjamap1': 'CBD Liver JAMA Research Part One',
'researchcbdliverjamap2': 'CBD Liver JAMA Research Part Two',
'covid19serology': 'COVID-19 Serology',
'pma': 'Pre-Market Approval',
'recall': 'Recall',
Expand Down
4 changes: 3 additions & 1 deletion src/components/EndpointBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@ const EndpointBox = (props: endpointBoxProps) => {
'ndc': <div className='ep-icon' style={bg_color.drug}><i className='fa fa-3x fa-database' style={{ color: "white" }} /></div>,
'enforcement': <div className='ep-icon' style={bg_color.drug}><i className='fa fa-3x fa-rotate-left' style={{ color: "white" }} /></div>,
'drugsfda': <div className='ep-icon' style={bg_color.drug}><i className='fa fa-3x fa-at' style={{ color: "white" }} /></div>,
'drugshortages': <div className='ep-icon' style={bg_color.drug}><i className='fa fa-3x fa-at' style={{ color: "white" }} /></div>
'drugshortages': <div className='ep-icon' style={bg_color.drug}><i className='fa fa-3x fa-at' style={{ color: "white" }} /></div>,
'researchcbdliverjamap1': <div className='ep-icon' style={bg_color.drug}><i className='fa fa-3x fa-book' style={{ color: "white" }} /></div>,
'researchcbdliverjamap2': <div className='ep-icon' style={bg_color.drug}><i className='fa fa-3x fa-book' style={{ color: "white" }} /></div>
},
'other': {
'historicaldocument': <div className="ep-icon" style={bg_color['other']}><i className="fa fa-3x fa-history" style={{ color: "white" }} /></div>,
Expand Down
3 changes: 2 additions & 1 deletion src/components/Footer.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/* @flow */

import React from 'react'
import { withPrefix } from "gatsby"
import '../css/components/Footer.scss'

const links: Array<Object> = [
Expand Down Expand Up @@ -80,7 +81,7 @@ class Footer extends React.Component {
<img
alt='Go to FDA website'
width='180px'
src='/img/gov-fda-new-white.svg'
src={withPrefix("/img/gov-fda-new-white.svg")}
/>
</a>
</li>
Expand Down
6 changes: 4 additions & 2 deletions src/components/Layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,10 @@ const Layout = (props: LayoutProps) => {
down: 'sticky-scroll-down',
up: 'sticky-scroll-up'
}

const hasSidebar = props.location.pathname.slice(0, 6) === `/apis/`
console.log(props.location.pathname)
console.log(props.location.pathname.slice(0, 23))
const hasSidebar = props.location.pathname.slice(0, 6) === `/apis/` || props.location.pathname.slice(0, 24) === `/drug-cbd-research/apis/`
// const hasSidebar = props.location.pathname.slice(0, 6) === `/apis/`
return (
<DocumentTitle title='openFDA' key='openFDA'>
<div>
Expand Down
16 changes: 12 additions & 4 deletions src/components/RenderContentObject/KeyFacts.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ const source: Record<string, Record<string, string>> = {
'ndc': 'NDC Directory',
'enforcement': 'FDA Recall Enterprise System (RES)',
'drugsfda': 'Drugs@FDA',
'shortages': 'Drug Shortages'
'shortages': 'Drug Shortages',
'researchcbdliverjamap1': 'CBD Liver JAMA Research',
'researchcbdliverjamap2': 'CBD Liver JAMA Research'
},
'other': {
'historicaldocument': 'Historic FDA Press Releases',
Expand Down Expand Up @@ -77,7 +79,9 @@ const sourceLink: any = {
'ndc': '/data/ndc/',
'enforcement': '/data/res/',
'drugsfda': '/data/drugsfda/',
'shortages': '/data/drugshortages'
'shortages': '/data/drugshortages',
'researchcbdliverjamap1': '/data/drugresearchcbdliverjama',
'researchcbdliverjamap2': '/data/drugresearchcbdliverjama'
},
'other': {
'historicaldocument': '/data/historicaldocument/',
Expand Down Expand Up @@ -122,7 +126,9 @@ const timePeriod: any = {
'ndc': 'Last updated on',
'enforcement': '2004 to',
'drugsfda': '1939 to',
'shortages': '2012 to'
'shortages': '2012 to',
'researchcbdliverjamap1': 'Last updated',
'researchcbdliverjamap2': 'Last updated'
},
'other': {
'historicaldocument': '1913 to',
Expand Down Expand Up @@ -168,7 +174,9 @@ const frequency = {
'ndc': 'Daily',
'enforcement': 'Weekly',
'drugsfda': 'Daily (Monday-Friday)',
'shortages': 'Daily'
'shortages': 'Daily',
'researchcbdliverjamap1': 'n/a',
'researchcbdliverjamap2': 'n/a'
},
'other': {
'historicaldocument': 'Infrequently',
Expand Down
2 changes: 1 addition & 1 deletion src/constants/api.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export const API_LINK: string = "https://api.fda.gov"
export const API_LINK: string = "https://openfda-api.preprod.fda.gov"
export const API_NAME: string = "api.fda.gov"
export default {
API_LINK,
Expand Down
12 changes: 9 additions & 3 deletions src/constants/endpoint_box.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ export const description: Record<NounName, Partial<Record<EndpointName, string>>
'ndc': 'NDC directory containing information on the National Drug Code (NDC)',
'enforcement': 'Drug product recall enforcement reports.',
'drugsfda': 'Drugs@FDA includes most of the drug products approved since 1939.',
'drugshortages': 'Drug Shortages can occur for many reasons, including manufacturing and quality problems, delays, and discontinuations.'
'drugshortages': 'Drug Shortages can occur for many reasons, including manufacturing and quality problems, delays, and discontinuations.',
'researchcbdliverjamap1': 'This dataset makes available Part One of the research paper "Cannabidiol and Liver Enzyme Level Elevations in Healthy Adults".',
'researchcbdliverjamap2': 'This dataset makes available Part Two of the research paper "Cannabidiol and Liver Enzyme Level Elevations in Healthy Adults".'
},
'other': {
'historicaldocument': 'FDA Press Releases, 1913-2014, in searchable format',
Expand Down Expand Up @@ -76,7 +78,9 @@ export const ep_title: Record<NounName, Partial<Record<EndpointName, string>>> =
'ndc': 'NDC Directory',
'enforcement': 'Recall enforcement reports',
'drugsfda': 'Drugs@FDA',
'drugshortages': 'Drug shortages'
'drugshortages': 'Drug shortages',
'researchcbdliverjamap1': 'Drug CBD liver JAMA research Part One',
'researchcbdliverjamap2': 'Drug CBD liver JAMA research Part Two'
},
'other': {
'historicaldocument': 'Historical Documents',
Expand Down Expand Up @@ -132,7 +136,9 @@ export const ep_path: Record<NounName, Partial<Record<EndpointName, string>>> =
'ndc': '/apis/drug/ndc/',
'enforcement': '/apis/drug/enforcement/',
'drugsfda': '/apis/drug/drugsfda/',
'drugshortages': '/apis/drug/drugshortages/'
'drugshortages': '/apis/drug/drugshortages/',
'researchcbdliverjamap1': '/apis/drug/researchcbdliverjamap1/',
'researchcbdliverjamap2': '/apis/drug/researchcbdliverjamap2/'
},
'other': {
'historicaldocument': '/apis/other/historicaldocument/',
Expand Down
144 changes: 144 additions & 0 deletions src/constants/fields/drugresearchcbdliverjamap1.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
properties:
treatment:
description: "Type of treatment (one of CBD = “Cannabidiol”; PLB = “Placebo”)"
format:
is_exact: true
possible_values:
type: string
primary_event_flag:
description: "Flag for if the participant had an event meeting criteria for the primary endpoint"
format:
is_exact: true
possible_values:
type: boolean
secondary_event_flag:
description: "Flag for if the participant had an event meeting criteria for the secondary endpoint"
format:
is_exact: true
possible_values:
type: boolean
discontinued_no_event:
description: "Flag for if the participant discontinued before the end of the study for reasons other than liver enzyme elevations (i.e., for non-liver safety, withdrawal of consent, lack of adherence, etc.)"
format:
is_exact: true
possible_values:
type: boolean
start_day:
description: "Day treatment was initiated. (Day = 1 for all participants)"
format:
is_exact: true
possible_values:
type: integer
end_day:
description: "Last day study drug was administered"
format:
is_exact: true
possible_values:
type: integer
sex:
description: "Sex of the participant (one of 'Female' or 'Male')"
format:
is_exact: true
possible_values:
type: string
age:
description: "Age of the participant (unit = years)"
format:
is_exact: true
possible_values:
type: integer
race:
description: "Race of the participant (one of ‘American Indian or Alaska Native’, 'Asian', 'Black or African American', ‘Multiple’, ‘Unknown’, or 'White')"
format:
is_exact: true
possible_values:
type: string
ethnicity:
description: "Ethnicity of the participant (one of 'Hispanic or Latino' or 'Not Hispanic or Latino')"
format:
is_exact: true
possible_values:
type: string
weight:
description: "Weight of the participant (unit = kg)"
format:
is_exact: true
possible_values:
type: number
body_mass_index:
description: "Body mass index of the participant (unit = kg/m2)"
format:
is_exact: true
possible_values:
type: number
height:
description: "Height of the participant (unit = cm)"
format:
is_exact: true
possible_values:
type: integer
study_visit_days:
type: array
items:
type: object
properties:
study_day:
description: "Study visit day"
format:
is_exact: true
possible_values:
type: string
laboratory:
type: array
items:
type: object
properties:
lab_test:
description: "Laboratory test name (one of Alkaline Phos, ALT, AST, Bilirubin Direct, Bilirubin Total, Eosinophil %, Eosinophile Absolute, GGT, INR"
format:
is_exact: true
possible_values:
type: string
reported_lab_result:
description: "Reported laboratory test result/value"
format:
is_exact: true
possible_values:
type: string
reported_lab_result_units:
description: "Reported laboratory test units"
format:
is_exact: true
possible_values:
type: string
analytye:
description: "Measured analyte. One of CBD, 7-OH-CBD, 7-COOH-CBD"
format:
is_exact: true
possible_values:
type: string
concentration:
description: "Reported concentration with values below lower limit of quantification set to zero. (units are defined in Units)"
format:
is_exact: true
possible_values:
type: number
concentration_units:
description: "Units for the reported ‘Concentration’ variable (unit = ng/mL)"
format:
is_exact: true
possible_values:
type: string
lower_limit_of_quantitation:
description: "Lower limit of quantitation for each analyte (1.95, 3.91, and 31.25 for CBD, 7-OH-CBD, and 7-COOH-CBD, respectively)"
format:
is_exact: true
possible_values:
type: number
lower_limit_of_quantitation_flag:
description: "Flag of if the concentration is below the lower limit of quantification"
format:
is_exact: true
possible_values:
type: boolean
type: object
Loading