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

inital implementation of filters #277

Merged
merged 1 commit into from
Nov 13, 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
40 changes: 37 additions & 3 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,36 @@ store.subscribe(saveState);
const connector = new AppSearchAPIConnector({
searchKey: process.env.REACT_APP_SEARCH_KEY,
engineName: "spatial-viewer",
endpointBase: "/spatial-viewer/search",
endpointBase: process.env.REACT_APP_SEARCH_ENDPOINT,
cacheResponses: false
})

const searchConfig = {
apiConnector: connector,
searchQuery: {
disjunctiveFacets: ["sex", "age", "redcapid", "enrollmentcategory", "imagetype", "datatype", "configtype", "level", "releaseversion"],
disjunctiveFacets: [
"sex",
"age",
"redcapid",
"enrollmentcategory",
"imagetype",
"datatype",
"configtype",
"level",
"releaseversion",
"ethnicity",
"proteinuria",
"hypertensionhistory",
"hypertensionduration",
"onraasblockade",
"diabetesduration",
"diabeteshistory",
"kdigostage",
"a1c",
"albuminuria",
"baselineegfr",
"primaryadjudicatedcategory",
],
facets: {
sex: { type: "value", size: 100},
age: { type: "value", size: 100},
Expand All @@ -70,7 +92,19 @@ const searchConfig = {
datatype: { type: "value", size: 100 },
configtype: { type: "value", size: 100},
level: { type: "value", size: 100},
releaseversion: {type: "value", size: 250}
releaseversion: {type: "value", size: 250},
ethnicity: {type: "value", size: 250},
proteinuria: {type: "value", size: 250},
hypertensionhistory: {type: "value", size: 250},
hypertensionduration: {type: "value", size: 250},
onraasblockade:{type: "value", size: 250},
diabetesduration: {type: "value", size: 250},
diabeteshistory: {type: "value", size: 250},
kdigostage: {type: "value", size: 250},
a1c: {type: "value", size: 250},
albuminuria: {type: "value", size: 250},
baselineegfr: {type: "value", size: 250},
primaryadjudicatedcategory: {type: "value", size: 250},
}
},
initialState: {
Expand Down
143 changes: 138 additions & 5 deletions src/components/SpatialViewer/Facets/AllFacets.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,145 @@ class AllFacets extends Component {
</Col>
</Row>
</AccordionBody>
</AccordionItem>
</AccordionItem>
<AccordionItem>
<AccordionHeader targetId='5'>
Experimental Strategy
<AccordionHeader targetId="5">
Ethnicity
</AccordionHeader>
<AccordionBody accordionId="5">
<Row className='mb-2'>
<Col>
<Facet field='ethnicity' label='' filterType='any' view={MultiCheckboxFacet}/>
</Col>
</Row>
</AccordionBody></AccordionItem>
<AccordionItem>
<AccordionHeader targetId="6">
A1c %
</AccordionHeader>
<AccordionBody accordionId="6">
<Row className='mb-2'>
<Col>
<Facet field='a1c' label='' filterType='any' view={MultiCheckboxFacet}/>
</Col>
</Row>
</AccordionBody></AccordionItem>
<AccordionItem>
<AccordionHeader targetId="7">
Albuminuria
</AccordionHeader>
<AccordionBody accordionId="7">
<Row className='mb-2'>
<Col>
<Facet field='albuminuria' label='' filterType='any' view={MultiCheckboxFacet}/>
</Col>
</Row>
</AccordionBody></AccordionItem>
<AccordionItem>
<AccordionHeader targetId="8">
Baseline eGFR
</AccordionHeader>
<AccordionBody accordionId="8">
<Row className='mb-2'>
<Col>
<Facet field='baselineegfr' label='' filterType='any' view={MultiCheckboxFacet}/>
</Col>
</Row>
</AccordionBody></AccordionItem>
<AccordionItem>
<AccordionHeader targetId="9">
Diabetes Duration
</AccordionHeader>
<AccordionBody accordionId="9">
<Row className='mb-2'>
<Col>
<Facet field='diabetesduration' label='' filterType='any' view={MultiCheckboxFacet}/>
</Col>
</Row>
</AccordionBody></AccordionItem>
<AccordionItem>
<AccordionHeader targetId="10">
Diabetes History
</AccordionHeader>
<AccordionBody accordionId="10">
<Row className='mb-2'>
<Col>
<Facet field='diabeteshistory' label='' filterType='any' view={MultiCheckboxFacet}/>
</Col>
</Row>
</AccordionBody></AccordionItem>
<AccordionItem>
<AccordionHeader targetId="11">
Hypertension Duration
</AccordionHeader>
<AccordionBody accordionId="11">
<Row className='mb-2'>
<Col>
<Facet field='hypertensionduration' label='' filterType='any' view={MultiCheckboxFacet}/>
</Col>
</Row>
</AccordionBody></AccordionItem>
<AccordionItem>
<AccordionHeader targetId="12">
Hypertension History
</AccordionHeader>
<AccordionBody accordionId="12">
<Row className='mb-2'>
<Col>
<Facet field='hypertensionhistory' label='' filterType='any' view={MultiCheckboxFacet}/>
</Col>
</Row>
</AccordionBody></AccordionItem>
<AccordionItem>
<AccordionHeader targetId="13">
KDIGO Stage
</AccordionHeader>
<AccordionBody accordionId="13">
<Row className='mb-2'>
<Col>
<Facet field='kdigostage' label='' filterType='any' view={MultiCheckboxFacet}/>
</Col>
</Row>
</AccordionBody></AccordionItem>
<AccordionItem>
<AccordionHeader targetId='14'>
RAAS Blockade
</AccordionHeader>
<AccordionBody accordionId='14'>
<Row className='mb-2'>
<Col>
<Facet field='onraasblockade' label='' filterType='any' view={MultiCheckboxFacet} />
</Col>
</Row>
</AccordionBody>
</AccordionItem>
<AccordionItem>
<AccordionHeader targetId="15">
Primary Adjudicated Category
</AccordionHeader>
<AccordionBody accordionId="15">
<Row className='mb-2'>
<Col>
<Facet field='primaryadjudicatedcategory' label='' filterType='any' view={MultiCheckboxFacet}/>
</Col>
</Row>
</AccordionBody></AccordionItem>
<AccordionItem>
<AccordionHeader targetId="16">
Proteinuria
</AccordionHeader>
<AccordionBody accordionId="16">
<Row className='mb-2'>
<Col>
<Facet field='proteinuria' label='' filterType='any' view={MultiCheckboxFacet}/>
</Col>
</Row>
</AccordionBody></AccordionItem>
<AccordionItem>
<AccordionHeader targetId='17'>
Experimental Strategy
</AccordionHeader>
<AccordionBody accordionId="17">
<Row className="mb-2">
<Col>
<Facet field="datatype" label="" filterType="any" show="10" view={MultiCheckboxFacet}/>
Expand All @@ -82,10 +215,10 @@ class AllFacets extends Component {
</AccordionBody>
</AccordionItem>
<AccordionItem>
<AccordionHeader targetId="6">
<AccordionHeader targetId="18">
Image Type
</AccordionHeader>
<AccordionBody accordionId="6">
<AccordionBody accordionId="18">
<Row className="mb-2">
<Col>
<Facet field="imagetype" label="" filterType="any" show="10" view={MultiCheckboxFacet}/>
Expand Down
Loading