-
Notifications
You must be signed in to change notification settings - Fork 532
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Patient Detail Tabs: Org List Access #10121
base: develop
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -60,7 +60,7 @@ import { PatientModel } from "@/types/emr/patient"; | |
import { Organization } from "@/types/organization/organization"; | ||
|
||
interface PatientRegistrationPageProps { | ||
facilityId: string; | ||
facilityId?: string; | ||
patientId?: string; | ||
} | ||
|
||
|
@@ -224,11 +224,13 @@ export default function PatientRegistration( | |
return; | ||
} | ||
|
||
createPatient({ | ||
...values, | ||
facility: facilityId, | ||
ward_old: undefined, | ||
}); | ||
if (facilityId) { | ||
createPatient({ | ||
...values, | ||
facility: facilityId, | ||
ward_old: undefined, | ||
}); | ||
} | ||
Comment on lines
+227
to
+233
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Add error handling for missing facilityId case. The code correctly checks for facilityId before creating a patient, but doesn't handle the case when facilityId is undefined. Consider adding error feedback for users. if (facilityId) {
createPatient({
...values,
facility: facilityId,
ward_old: undefined,
});
+} else {
+ toast.error(t("facility_required_for_patient_creation"));
}
|
||
} | ||
|
||
const sidebarItems = [ | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
works, but not a fan of this :)