Skip to content

Commit

Permalink
Merge branch 'develop' into migrate-consultation-feed-to-newer-compon…
Browse files Browse the repository at this point in the history
…ents
  • Loading branch information
rithviknishad committed May 22, 2024
2 parents f61661f + b39b28f commit c164ab7
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions src/Components/Facility/ConsultationForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@ type FormDetails = {
death_datetime: string;
death_confirmed_doctor: string;
InvestigationAdvice: InvestigationType[];
procedures: ProcedureType[];
consent_records: ConsentRecord[];
};

Expand Down Expand Up @@ -176,7 +175,6 @@ const initForm: FormDetails = {
death_datetime: "",
death_confirmed_doctor: "",
InvestigationAdvice: [],
procedures: [],
consent_records: [],
};

Expand Down Expand Up @@ -375,7 +373,7 @@ export const ConsultationForm = ({ facilityId, patientId, id }: Props) => {
(Array.isArray(data.investigation) && data.investigation) || [],
});
handleFormFieldChange({
name: "procedures",
name: "procedure",
value: (Array.isArray(data.procedure) && data.procedure) || [],
});
if (data.suggestion === "R") {
Expand Down Expand Up @@ -593,7 +591,7 @@ export const ConsultationForm = ({ facilityId, patientId, id }: Props) => {
}
return;
case "procedure": {
for (const p of state.form.procedures) {
for (const p of state.form.procedure) {
if (!p.procedure?.replace(/\s/g, "").length) {
errors[field] = "Procedure field can not be empty";
invalidForm = true;
Expand Down Expand Up @@ -725,7 +723,7 @@ export const ConsultationForm = ({ facilityId, patientId, id }: Props) => {
create_diagnoses: isUpdate ? undefined : state.form.create_diagnoses,
treating_physician: state.form.treating_physician,
investigation: state.form.InvestigationAdvice,
procedure: state.form.procedures,
procedure: state.form.procedure,
patient: patientId,
facility: facilityId,
referred_to:
Expand Down Expand Up @@ -1433,11 +1431,11 @@ export const ConsultationForm = ({ facilityId, patientId, id }: Props) => {
>
<FieldLabel>Procedures</FieldLabel>
<ProcedureBuilder
procedures={state.form.procedures}
setProcedures={(procedures) => {
procedures={state.form.procedure}
setProcedures={(procedure) => {
handleFormFieldChange({
name: "procedures",
value: procedures,
name: "procedure",
value: procedure,
});
}}
/>
Expand Down

0 comments on commit c164ab7

Please sign in to comment.