Skip to content

Commit

Permalink
Patient Age and Facility Location Edits (#10260)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jacobjeevan authored Jan 29, 2025
1 parent 0c3342f commit 25cdaf6
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 23 deletions.
1 change: 0 additions & 1 deletion src/Utils/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,6 @@ export const formatPatientAge = (
obj: PatientModel | Patient,
abbreviated = false,
) => {
if (obj.age != null) return `${obj.age} Y`;
const suffixes = getRelativeDateSuffix(abbreviated);
const start = dayjs(
obj.date_of_birth
Expand Down
4 changes: 2 additions & 2 deletions src/components/Facility/FacilityForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,8 @@ export default function FacilityForm(props: FacilityProps) {
)?.id,
address: facilityData.address,
phone_number: facilityData.phone_number,
latitude: facilityData.latitude,
longitude: facilityData.longitude,
latitude: Number(facilityData.latitude),
longitude: Number(facilityData.longitude),
is_public: facilityData.is_public,
});
}
Expand Down
16 changes: 0 additions & 16 deletions src/components/Patient/PatientDetailsTab/Demography.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -265,22 +265,6 @@ export const Demography = (props: PatientProps) => {
</div>

<div className="lg:basis-4/5">
<div className="mb-2 flex flex-row justify-between">
<div>
<Button
id="update-patient-details"
variant="outline"
className="mt-4"
disabled={!!patientData.death_datetime}
onClick={withPermissionCheck(() =>
navigate(`/facility/${id}/patient/${id}/update`),
)}
>
<CareIcon icon="l-edit-alt" className="text-lg pr-1" />
{t("edit_profile")}
</Button>
</div>
</div>
{/* <div className="mt-4 rounded-md border border-blue-400 bg-blue-50 p-5 grid grid-cols-1 gap-x-4 gap-y-2 md:grid-cols-2 md:gap-y-8 lg:grid-cols-2">
{[
{ label: t("abha_number"), value: "-" },
Expand Down
7 changes: 4 additions & 3 deletions src/components/Patient/PatientRegistration.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -283,9 +283,10 @@ export default function PatientRegistration(
same_address:
patientQuery.data.address === patientQuery.data.permanent_address,
age_or_dob: patientQuery.data.date_of_birth ? "dob" : "age",
age: !patientQuery.data.date_of_birth
? patientQuery.data.age
: undefined,
age:
!patientQuery.data.date_of_birth && patientQuery.data.year_of_birth
? new Date().getFullYear() - patientQuery.data.year_of_birth
: undefined,
date_of_birth: patientQuery.data.date_of_birth
? patientQuery.data.date_of_birth
: undefined,
Expand Down
1 change: 0 additions & 1 deletion src/types/emr/patient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ export interface PatientModel {
assigned_to?: number | null;
assigned_to_object?: AssignedToObjectModel;
meta_info?: PatientMeta;
age?: string;
}

export const validatePatient = (patient: PatientModel, useDob: boolean) => {
Expand Down

0 comments on commit 25cdaf6

Please sign in to comment.