Skip to content

Commit

Permalink
Merge branch 'develop' into issue#6608
Browse files Browse the repository at this point in the history
  • Loading branch information
nihal467 authored Jan 1, 2024
2 parents 17aeabc + f066a36 commit 38c5234
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 17 deletions.
9 changes: 5 additions & 4 deletions src/Components/Common/BloodPressureFormField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export default function BloodPressureFormField(props: Props) {
name: field.name,
value: {
...field.value,
[event.name]: event.value,
[event.name]: event.value ?? -1,
},
});
};
Expand All @@ -35,9 +35,10 @@ export default function BloodPressureFormField(props: Props) {
<FormField
field={{
...field,
labelSuffix: map ? (
<span className="font-medium">MAP: {map.toFixed(1)}</span>
) : undefined,
labelSuffix:
map && map !== -1 ? (
<span className="font-medium">MAP: {map.toFixed(1)}</span>
) : undefined,
}}
>
<div className="flex flex-row items-center">
Expand Down
1 change: 1 addition & 0 deletions src/Components/Facility/Consultations/Mews.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ const getHeartRateScore = (value?: number) => {

const getSystolicBPScore = (value?: number) => {
if (typeof value !== "number") return;
if (value === -1) return;

if (value <= 70) return 3;
if (value <= 80) return 2;
Expand Down
10 changes: 8 additions & 2 deletions src/Components/Patient/DailyRoundListDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -158,14 +158,20 @@ export const DailyRoundListDetails = (props: any) => {
<span className="font-semibold leading-relaxed">
Systolic:{" "}
</span>
{dailyRoundListDetailsData.bp?.systolic ?? "-"}
{dailyRoundListDetailsData.bp?.systolic &&
dailyRoundListDetailsData.bp?.systolic !== -1
? dailyRoundListDetailsData.bp?.systolic
: "-"}
</div>
<div className="flex">
{" "}
<span className="font-semibold leading-relaxed">
Diastolic:
</span>
{dailyRoundListDetailsData.bp?.diastolic ?? "-"}
{dailyRoundListDetailsData.bp?.diastolic &&
dailyRoundListDetailsData.bp?.diastolic !== -1
? dailyRoundListDetailsData.bp?.diastolic
: "-"}
</div>
</div>
</div>
Expand Down
50 changes: 39 additions & 11 deletions src/Components/Patient/DailyRounds.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@ const initForm: any = {
rhythm_detail: "",
ventilator_spo2: null,
consciousness_level: "UNKNOWN",
bp: {
systolic: -1,
diastolic: -1,
mean: -1,
},
// bed: null,
};

Expand Down Expand Up @@ -242,6 +247,18 @@ export const DailyRounds = (props: any) => {
invalidForm = true;
}
return;
case "bp":
if (
(state.form.bp?.systolic &&
state.form.bp?.diastolic &&
state.form.bp.systolic !== -1 &&
state.form.bp.diastolic === -1) ||
(state.form.bp.systolic === -1 && state.form.bp.diastolic !== -1)
) {
errors.bp = "Please enter both systolic and diastolic values";
invalidForm = true;
}
return;
default:
return;
}
Expand Down Expand Up @@ -287,21 +304,32 @@ export const DailyRounds = (props: any) => {
data = {
...data,
bp:
state.form.bp && state.form.bp.systolic && state.form.bp.diastolic
state.form.bp?.systolic !== -1 && state.form.bp?.diastolic !== -1
? {
systolic: Number(state.form.bp.systolic),
diastolic: Number(state.form.bp.diastolic),
mean: parseFloat(
meanArterialPressure(state.form.bp).toFixed(2)
),
systolic: state.form.bp?.systolic
? Number(state.form.bp?.systolic)
: -1,
diastolic: state.form.bp?.diastolic
? Number(state.form.bp?.diastolic)
: -1,
mean:
state.form.bp?.systolic && state.form.bp?.diastolic
? parseFloat(
meanArterialPressure(state.form.bp).toFixed(2)
)
: -1,
}
: undefined,
pulse: state.form.pulse,
resp: state.form.resp,
temperature: state.form.temperature,
: {
systolic: -1,
diastolic: -1,
mean: -1,
},
pulse: state.form.pulse ?? null,
resp: state.form.resp ?? null,
temperature: state.form.temperature ?? null,
rhythm: state.form.rhythm || 0,
rhythm_detail: state.form.rhythm_detail,
ventilator_spo2: state.form.ventilator_spo2,
ventilator_spo2: state.form.ventilator_spo2 ?? null,
consciousness_level: state.form.consciousness_level,
};
}
Expand Down
2 changes: 2 additions & 0 deletions src/Components/Patient/PatientInfoCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -490,6 +490,7 @@ export default function PatientInfoCard(props: {
key={i}
className="dropdown-item-primary pointer-events-auto m-2 flex cursor-pointer items-center justify-start gap-2 rounded border-0 p-2 text-sm font-normal transition-all duration-200 ease-in-out"
href={
action[1] !== "Treatment Summary" &&
consultation?.admitted &&
!consultation?.current_bed &&
i === 1
Expand All @@ -498,6 +499,7 @@ export default function PatientInfoCard(props: {
}
onClick={() => {
if (
action[1] !== "Treatment Summary" &&
consultation?.admitted &&
!consultation?.current_bed &&
i === 1
Expand Down

0 comments on commit 38c5234

Please sign in to comment.