Skip to content

Commit

Permalink
#1173 | Use model method to retrieve concept key value
Browse files Browse the repository at this point in the history
  • Loading branch information
1t5j0y committed Mar 21, 2024
1 parent 6d25d23 commit f70d370
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/dataEntryApp/components/SubjectFormElement.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,11 @@ import { subjectService } from "../services/SubjectService";
import { find, first, isEmpty, xor } from "lodash";
import { FormHelperText } from "@material-ui/core";
import { Individual } from "avni-models";
import { Concept } from "openchs-models";

const SubjectFormElement = props => {
const { t } = useTranslation();
const subjectTypeUuid = props.formElement.concept.keyValues
.find(keyValue => keyValue.key === "subjectTypeUUID")
.value.replace(/^"(.*)"$/, "$1");
const subjectTypeUuid = props.formElement.concept.recordValueByKey(Concept.keys.subjectTypeUUID);
const isMultiSelect = props.formElement.type === "MultiSelect";
const isMandatory = props.formElement.mandatory;
const fieldLabel = props.formElement.name;
Expand Down

0 comments on commit f70d370

Please sign in to comment.