Skip to content

Commit

Permalink
OpenConceptLab/ocl_issues#659 | OCL Fhir CodeSystem search on attribu…
Browse files Browse the repository at this point in the history
…tes status/content-mode/publisher
  • Loading branch information
snyaggarwal committed Apr 12, 2021
1 parent 5a1de83 commit a7b8b28
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/components/search/Search.jsx
Expand Up @@ -286,7 +286,7 @@ class Search extends React.Component {
if(hapi)
params = {...params, ...fhirParams}
else
params = {...params, page: page, _sort: fhirParams._sort}
params = {...params, page: page, ...fhirParams}
}
fetchSearchResults(
_resource,
Expand Down
28 changes: 17 additions & 11 deletions src/components/search/SearchByAttributeInput.jsx
Expand Up @@ -7,23 +7,29 @@ import {
} from '@material-ui/icons';
import { map, get } from 'lodash';

const DEFAULT_FHIR_ATTRIBUTE = {id: 'name', label: 'Name'}
const DEFAULT_HAPI_FHIR_ATTRIBUTE = {id: 'name', label: 'Name'}
const DEFAULT_OCL_FHIR_ATTRIBUTE = {id: 'status', label: 'Status'}

const FHIR_ATTRIBUTES = [
const HAPI_FHIR_ATTRIBUTES = [
{id: '_id', label: 'id'},
{id: 'date', label: 'Release Date'},
{id: 'status', label: 'Status'},
DEFAULT_FHIR_ATTRIBUTE,
DEFAULT_HAPI_FHIR_ATTRIBUTE,
{id: 'version', label: 'Version'},
{id: 'description', label: 'Description'},
]
const OCL_FHIR_ATTRIBUTESS = [
DEFAULT_OCL_FHIR_ATTRIBUTE,
{id: 'content-mode', label: 'Content Mode'},
{id: 'publisher', label: 'Publisher'},
]
class SearchByAttributeInput extends React.Component {
constructor(props) {
super(props);
this.state = {
input: '',
attrs: FHIR_ATTRIBUTES,
selectedAttribute: DEFAULT_FHIR_ATTRIBUTE,
attrs: props.hapi ? HAPI_FHIR_ATTRIBUTES : OCL_FHIR_ATTRIBUTESS,
selectedAttribute: props.hapi ? DEFAULT_HAPI_FHIR_ATTRIBUTE : DEFAULT_OCL_FHIR_ATTRIBUTE,
anchorEl: null,
}
}
Expand Down Expand Up @@ -72,12 +78,12 @@ class SearchByAttributeInput extends React.Component {
{
input &&
<React.Fragment>
<Tooltip title='Clear'>
<IconButton type="submit" style={{padding: '10px'}} aria-label="clear" onClick={this.clearSearch}>
<ClearIcon />
</IconButton>
</Tooltip>
<Divider style={{height: '28px', margin: '4px'}} orientation="vertical" />
<Tooltip title='Clear'>
<IconButton type="submit" style={{padding: '10px'}} aria-label="clear" onClick={this.clearSearch}>
<ClearIcon />
</IconButton>
</Tooltip>
<Divider style={{height: '28px', margin: '4px'}} orientation="vertical" />
</React.Fragment>
}
<Tooltip title='Search'>
Expand Down

0 comments on commit a7b8b28

Please sign in to comment.