Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
shivankacker committed Jul 22, 2024
1 parent f0f113e commit 5c170e6
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export default function InvestigationBuilder(

const setItem = (object: InvestigationType, i: number) => {
setInvestigations(
investigations.map((investigation, index) =>
investigations?.map((investigation, index) =>
index === i ? object : investigation,
),
);
Expand All @@ -102,7 +102,7 @@ export default function InvestigationBuilder(

return (
<div className="mt-2">
{investigations.map((investigation, i) => {
{investigations?.map((investigation, i) => {
const setFrequency = (frequency: string) => {
setItem(
{
Expand Down
5 changes: 4 additions & 1 deletion src/Components/Patient/DailyRounds.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -481,6 +481,7 @@ export const DailyRounds = (props: any) => {
form={SCRIBE_FORMS.daily_round}
onFormUpdate={async (fields) => {
// Symptoms
let rounds_type = state.form.rounds_type;
if (fields.additional_symptoms) {
for (const symptom of fields.additional_symptoms) {
const { res, error } = await request(SymptomsApi.add, {
Expand All @@ -492,6 +493,7 @@ export const DailyRounds = (props: any) => {
if (res?.ok) setSymptomsSeed((s) => s + 1);
if (error) Notification.Error({ msg: error });
}
rounds_type = "NORMAL";
}

// ICD11 Diagnosis
Expand All @@ -512,11 +514,12 @@ export const DailyRounds = (props: any) => {
]);
if (error) Notification.Error({ msg: error });
}
rounds_type = "NORMAL";
}

dispatch({
type: "set_form",
form: { ...state.form, ...fields },
form: { ...state.form, ...fields, rounds_type },
});
fields.action !== undefined && setPreviousAction(fields.action);
fields.review_interval !== undefined &&
Expand Down
10 changes: 10 additions & 0 deletions src/Components/Scribe/formDetails.ts
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,16 @@ const DAILY_ROUND_FORM_SCRIBE_DATA: Field[] = [
description:
"A list of objects to store the patient's investigations. The type field should be an array of strings corresponding to the names of the investigations provided in the options. The repetitive field should be a boolean value. The time field should be a string and only be filled if repetitive field is false. The frequency field should be a string with one of the following values: '15 min', '30 min', '1 hr', '6 hrs', '12 hrs', '24 hrs', or '48 hrs' and should be only filled if this is a repititive investigation . The notes field should be a string. If the type is not available in options, DO NOT MAKE IT.",
},
{
friendlyName: "Prescriptions",
id: "prescriptions",
type: `{
}[]`,
default: "[]",
example: "",
description: "Leave blank.",
},
];

export const SCRIBE_FORMS: { [key: string]: ScribeForm } = {
Expand Down

0 comments on commit 5c170e6

Please sign in to comment.