-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(fix) Fixed dynamic loading of organizations and sources
- Loading branch information
1 parent
6313fae
commit 16f6dcc
Showing
7 changed files
with
2,135 additions
and
1,439 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,42 @@ | ||
|
||
import useSWR from "swr"; | ||
import { API_BASE_URL } from '../index'; | ||
import { API_BASE_URL } from "../index"; | ||
import Cookies from 'js-cookie'; | ||
|
||
export const getOrganizations = () => { | ||
const fetcher = (url) => fetch(url).then((res) => res.json()); | ||
const fetcher = (url) => fetch(url).then((res) => res.json()); | ||
|
||
const { data, isLoading, isError, mutate } = useSWR( | ||
`${API_BASE_URL}/orgs/?limit=1000&verbose=false&includeRetired=false`, | ||
fetcher, | ||
{ revalidateOnFocus: false, revalidateOnReconnect: false } | ||
); | ||
|
||
return { | ||
data, | ||
isLoading, | ||
isError, | ||
mutate, | ||
}; | ||
}; | ||
|
||
export const getUserOrganizations = () => { | ||
const fetcher = (url) => | ||
fetch(url, { | ||
headers: { | ||
Authorization: "Bearer " + Cookies.get("token"), | ||
}, | ||
}).then((res) => res.json()); | ||
|
||
const { | ||
data, | ||
isLoading, | ||
isError, | ||
mutate, | ||
} = useSWR( | ||
`${API_BASE_URL}/orgs/?limit=1000&verbose=false&includeRetired=false`, | ||
fetcher, | ||
{ revalidateOnFocus: false, revalidateOnReconnect: false } | ||
); | ||
const { data, isLoading, isError, mutate } = useSWR( | ||
`${API_BASE_URL}/user/orgs/`, | ||
fetcher, | ||
{ revalidateOnFocus: false, revalidateOnReconnect: false } | ||
); | ||
|
||
return { | ||
data, isLoading, isError, mutate | ||
} | ||
} | ||
return { | ||
data, | ||
isLoading, | ||
isError, | ||
mutate, | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
export const dataTypes = [ | ||
"Boolean", | ||
"Coded", | ||
"Complex", | ||
"Date", | ||
"Datetime", | ||
"Document", | ||
"None", | ||
"Numeric", | ||
"Rule", | ||
"Structured-Numeric", | ||
"Text", | ||
"Time", | ||
]; | ||
|
||
export const conceptClasses = [ | ||
"Test", | ||
"Procedure", | ||
"Drug", | ||
"Diagnosis", | ||
"Finding", | ||
"Anatomy", | ||
"Question", | ||
"LabSet", | ||
"MedSet", | ||
"ConvSet", | ||
"Misc", | ||
"Symptom", | ||
"Symptom/Finding", | ||
"Specimen", | ||
"Misc Order", | ||
"Program", | ||
"State", | ||
"Medical supply", | ||
"Code", | ||
"Radiology/Imaging Procedure", | ||
"Concept Class", | ||
"Indicator", | ||
"Drug form", | ||
"Units of Measure", | ||
"Frequency", | ||
"Pharmacologic Drug Class", | ||
"Workflow", | ||
"Organism", | ||
"none", | ||
"Products", | ||
"InteractSet", | ||
]; |
Oops, something went wrong.