-
Notifications
You must be signed in to change notification settings - Fork 135
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
RA-1533 Update the registration module to permit editing all sections #36
base: master
Are you sure you want to change the base?
Conversation
…ions This commit updates RegisterPatientFragmentController, and adds a new method that handles the edit of the entire patient registration form (without modifying the existing code that handles adding a new registration). When an extra query parameter (patientIdNumber) is included, the controller edits the existing patient. This solution is backward compatible: it doesn't alter the current patient registration flow and adds the possibility to also edit a patient
@tmvumbi2 can you include a link to the ticket as advised at? https://wiki.openmrs.org/display/docs/Pull+Request+Tips |
@dkayiwa done |
@tmvumbi2 can you follow the JIRA workflow process here? https://wiki.openmrs.org/display/docs/Pull+Request+Tips |
@tmvumbi2 are you still working on this? |
@tmvumbi2 ping |
Sorry @dkayiwa for the late reply. Thx for the ping, I'll check the PR tips and update where needed. |
@tmvumbi2 are you still working on this? |
|
||
// Assertion | ||
Patient result = (Patient) pageModel.getAttribute("patient"); | ||
Assert.assertEquals(existingPatient.getId(), result.getId()); |
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.
I understand that you are trying to get 2 checks done in assert.equal check. It would be a better coding convention and improve readability if there was assert.null right before the assert.equals function.
@@ -105,6 +107,7 @@ public FragmentActionResult importMpiPatient(@RequestParam("mpiPersonId") String | |||
public FragmentActionResult submit(UiSessionContext sessionContext, @RequestParam(value="appId") AppDescriptor app, | |||
@SpringBean("registrationCoreService") RegistrationCoreService registrationService, | |||
@ModelAttribute("patient") @BindParams Patient patient, | |||
@RequestParam(value = "patientIdNumber", required = false) String patientIdNumber, |
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.
Why not try to inject the Patient
instance directly like here?
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.
Whatever you end up doing, make sure it works with patient UUIDs.
@@ -121,6 +124,130 @@ public FragmentActionResult submit(UiSessionContext sessionContext, @RequestPara | |||
@SpringBean("emrApiProperties") EmrApiProperties emrApiProperties, | |||
@SpringBean("patientValidator") PatientValidator patientValidator, UiUtils ui) throws Exception { | |||
|
|||
if (patientIdNumber != null && !patientIdNumber.equals("")) { |
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.
Should you stick to a String
param, then use
!StringUtils.isEmpty(patientIdNumber)
@mks-d Is it worth us trying to resurrect this code and get this in? Seems like it was a non-trivial piece of work. |
This PR updates RegisterPatientFragmentController, and adds a new method that handles the edit of the entire patient registration form (without modifying the existing code that handles adding a new registration). When an extra query parameter (patientIdNumber) is included, the controller edits the existing patient. This solution is backward compatible: it doesn't alter the current patient registration flow and adds the possibility to also edit a patient.
Jira ticket: https://issues.openmrs.org/browse/RA-1533