Skip to content

Commit

Permalink
#171 | Include formUuid when searching by concept
Browse files Browse the repository at this point in the history
  • Loading branch information
1t5j0y committed Apr 17, 2024
1 parent f02d3fe commit 7abdb8c
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion client/components/ImageList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import TimeStampConceptFilter from "./FilterComponent/TimeStampConceptFilter";
import TexConceptFilter from "./FilterComponent/TextConceptFilter";
import NumericConceptFilter from "./FilterComponent/NumericConceptFilter";
import {Checkbox, Divider, FormControlLabel, Button as MUIButton} from "@mui/material";
import _ from 'lodash';

export default function ImageList() {
const [parentId, setParentId] = useState<any[]>([])
Expand Down Expand Up @@ -144,7 +145,7 @@ export default function ImageList() {
concept.uuid === element.concept.uuid
);
if (!exists) {
filteredConcept.push(element.concept);
filteredConcept.push(_.merge(element.concept, {formUuid: formUUID}));
}
}
}
Expand Down Expand Up @@ -448,6 +449,7 @@ export default function ImageList() {
if (data && data.length > 0) {
setConceptDates([{
"conceptUuid": selectedFieldConcept.uuid,
"formUuid": selectedFieldConcept.formUuid,
"from": data[0],
"to": data[1]
}])
Expand All @@ -458,6 +460,7 @@ export default function ImageList() {
if (data && data.length > 0) {
setDateTimeConcept([{
"conceptUuid": selectedFieldConcept.uuid,
"formUuid": selectedFieldConcept.formUuid,
"from": data[0],
"to": data[1]
}])
Expand All @@ -467,6 +470,7 @@ export default function ImageList() {
const getNumericConcept = (fromNumber: number, toNumber: number) => {
setToNumericConcept([{
"conceptUuid": selectedFieldConcept.uuid,
"formUuid": selectedFieldConcept.formUuid,
"from": fromNumber,
"to": toNumber
}])
Expand All @@ -476,6 +480,7 @@ export default function ImageList() {
if (data.length > 0) {
setCodedConcept([{
"conceptUuid": selectedFieldConcept.uuid,
"formUuid": selectedFieldConcept.formUuid,
"values": data
}])
} else {
Expand All @@ -488,6 +493,7 @@ export default function ImageList() {
if (data && data.length > 0) {
setNoteConcept([{
"conceptUuid": selectedFieldConcept.uuid,
"formUuid": selectedFieldConcept.formUuid,
"values": data.split(" ")
}])
}
Expand All @@ -499,6 +505,7 @@ export default function ImageList() {
if (data && data.length > 0) {
setTextConcept([{
"conceptUuid": selectedFieldConcept.uuid,
"formUuid": selectedFieldConcept.formUuid,
"values": data.split(" ")
}])
}
Expand Down

0 comments on commit 7abdb8c

Please sign in to comment.