Skip to content

Commit

Permalink
Merge pull request #277 from KPMP/KPMP-5579_add-filters
Browse files Browse the repository at this point in the history
inital implementation of filters
  • Loading branch information
rlreamy authored Nov 13, 2024
2 parents fbc8df4 + 57fe9cc commit df53481
Show file tree
Hide file tree
Showing 2 changed files with 175 additions and 8 deletions.
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

0 comments on commit df53481

Please sign in to comment.