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

#142-filter-for-biosample #143

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
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
9 changes: 8 additions & 1 deletion components/search/DiscoverySearchResults.vue
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ export default {
delete searchParams['symptomOnset']
delete searchParams['ageAtDiagnoses']
delete searchParams['hierarchy']
delete searchParams['biospecimenType']
return searchParams;
},
handleResourceInfoDialogIconClicked (resourceInfo) {
Expand All @@ -82,6 +83,12 @@ export default {
}
return false
},
isBeaconBiosamplesResponse (resourceInfo) {
if (resourceInfo) {
return resourceInfo.queryType.includes('BEACON_BIOSAMPLE')
}
return false
},
isBeaconCatalogsResponse (resourceInfo) {
if (resourceInfo) {
return resourceInfo.queryType.includes('BEACON_CATALOG')
Expand Down Expand Up @@ -221,7 +228,7 @@ export default {
<v-expansion-panel
v-for="(result,i) in searchResults"
:key="i"
v-if="isBeaconIndividualsResponse(result.resourceInfo)"
v-if="isBeaconIndividualsResponse(result.resourceInfo) || isBeaconBiosamplesResponse(result.resourceInfo)"

>
<v-expansion-panel-header
Expand Down
3 changes: 2 additions & 1 deletion components/search/DiscoverySearchWithAutoComplete.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ export default {
ageThisYear: [20,39],
symptomOnset: [20,39],
ageAtDiagnoses: [20,39],
hierarchy: ['UP']
hierarchy: ['UP'],
biospecimenType:['blood specimen', 'bone marrow', 'buffy coat','peripheral blood mononuclear cell', 'blood plasma specimen', 'blood serum', 'ascites fluid', 'cerebrospinal fluid','saliva', 'feces', 'urine', 'swab', 'bodily fluid specimen','FFPE specimen', 'frozen specimen', 'specimen with known storage state', 'DNA extract', 'RNA extract','specimen from organism', 'An array of any of the above' ]
},
showSearchFilters: false,
searchQuery: '',
Expand Down
99 changes: 97 additions & 2 deletions components/search/SearchFilters.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export default {
ageThisYear: [0,100],
symptomOnset: [0,100],
ageAtDiagnoses: [0,100],
biospecimenType:[],
},
items1: ['Patient Registries', 'Biobanks', 'Dataset','Catalog', 'Guideline' ],
value1: ['Patient Registries', 'Biobanks', 'Dataset','Catalog', 'Guideline'],
Expand Down Expand Up @@ -45,7 +46,9 @@ export default {
type: 'UNKNOWN',
checked: true
}
]
],
items3: ['blood specimen', 'bone marrow', 'buffy coat','peripheral blood mononuclear cell', 'blood plasma specimen', 'blood serum', 'ascites fluid', 'cerebrospinal fluid','saliva', 'feces', 'urine', 'swab', 'bodily fluid specimen','FFPE specimen', 'frozen specimen', 'specimen with known storage state', 'DNA extract', 'RNA extract','specimen from organism', 'An array of any of the above' ],
value3: ['blood specimen', 'bone marrow', 'buffy coat','peripheral blood mononuclear cell', 'blood plasma specimen', 'blood serum', 'ascites fluid', 'cerebrospinal fluid','saliva', 'feces', 'urine', 'swab', 'bodily fluid specimen','FFPE specimen', 'frozen specimen', 'specimen with known storage state', 'DNA extract', 'RNA extract','specimen from organism', 'An array of any of the above'],
}
},
computed: {
Expand Down Expand Up @@ -118,6 +121,77 @@ export default {
deep: true,
immediate: true
},
value3: {
handler () {
let newTypes = []
for (let type of this.value3) {
if (type.toLowerCase() === 'blood specimen') {
newTypes.push('BLOOD_SPECIMEN')
}
if (type.toLowerCase() === 'bone marrow') {
newTypes.push('BONE_MARROW')
}
if (type.toLowerCase() === 'buffy coat') {
newTypes.push('BUFFY_COAT')
}
if (type.toLowerCase() === 'peripheral blood mononuclear cell') {
newTypes.push('PERIPHERAL_BLOOD_MONONUCLEAR_CELL')
}
if (type.toLowerCase() === 'blood plasma specimen') {
newTypes.push('BLOOD_PLASMA_SPECIMEN')
}
if (type.toLowerCase() === 'blood serum') {
newTypes.push('BLOOD_SERUM')
}
if (type.toLowerCase() === 'ascites fluid') {
newTypes.push('ASCITES_FLUID')
}
if (type.toLowerCase() === 'cerebrospinal fluid') {
newTypes.push('CEREBROSPINAL_FLUID')
}
if (type.toLowerCase() === 'saliva') {
newTypes.push('SALIVA')
}
if (type.toLowerCase() === 'feces') {
newTypes.push('FECES')
}
if (type.toLowerCase() === 'urine') {
newTypes.push('URINE')
}
if (type.toLowerCase() === 'swab') {
newTypes.push('SWAB')
}
if (type.toLowerCase() === 'bodily fluid specimen') {
newTypes.push('BODILY_FLUID_SPECIMEN')
}
if (type.toLowerCase() === 'FFPE specimen') {
newTypes.push('FFPE_SPECIMEN')
}
if (type.toLowerCase() === 'frozen specimen') {
newTypes.push('FROZEN_SPECIMEN')
}
if (type.toLowerCase() === 'specimen with known storage state') {
newTypes.push('SPECIMEN_WITH_KNOWN_STORAGE_STATE')
}
if (type.toLowerCase() === 'DNA extract') {
newTypes.push('DNA_EXTRACT')
}
if (type.toLowerCase() === 'RNA extract') {
newTypes.push('RNA_EXTRACT')
}
if (type.toLowerCase() === 'specimen from organism') {
newTypes.push('SPECIMEN_FROM_ORGANISM')
}
if (type.toLowerCase() === 'An array of any of the above') {
newTypes.push('AN_ARRAY_OF_ANY_OF_THE_ABOVE')
}

}
this.searchParams.biospecimenType = newTypes
},
deep: true,
immediate: true
},
},
methods: {
selectOrUnselectAllCountries () {
Expand Down Expand Up @@ -243,7 +317,7 @@ export default {
></v-checkbox>
</v-col>
</v-row>
<p class="mt-2">
<p class="mt-8">
Symptom Onset
</p>
<v-range-slider
Expand All @@ -260,6 +334,27 @@ export default {
</v-range-slider>
</v-col>
<v-col>
<p>
Biospecimen Type
</p>
<v-select
v-model="value3"
:items="items3"
label="Select Item"
multiple
>
<template v-slot:selection="{ item, index }">
<v-chip v-if="index === 0">
<span>{{ item }}</span>
</v-chip>
<span
v-if="index === 1"
class="grey--text text-caption"
>
(+{{ value3.length - 1 }} others)
</span>
</template>
</v-select>
<p>
Age this year
</p>
Expand Down
4 changes: 3 additions & 1 deletion pages/discovery/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ export default {
ageThisYear: [20,39],
symptomOnset: [20,39],
ageAtDiagnoses: [20,39],
hierarchy: ['UP']
hierarchy: ['UP'],
biospecimenType:['blood specimen', 'bone marrow', 'buffy coat','peripheral blood mononuclear cell', 'blood plasma specimen', 'blood serum', 'ascites fluid', 'cerebrospinal fluid','saliva', 'feces', 'urine', 'swab', 'bodily fluid specimen','FFPE specimen', 'frozen specimen', 'specimen with known storage state', 'DNA extract', 'RNA extract','specimen from organism', 'An array of any of the above' ]

}
}
},
Expand Down