RA-1533 Update the registration module to permit editing all sections#36
RA-1533 Update the registration module to permit editing all sections#36tmvumbi2 wants to merge 1 commit intoopenmrs:masterfrom jembi:RA-1533
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.
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.
| 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.
Why not try to inject the Patient instance directly like here?
There was a problem hiding this comment.
Whatever you end up doing, make sure it works with patient UUIDs.
| @SpringBean("emrApiProperties") EmrApiProperties emrApiProperties, | ||
| @SpringBean("patientValidator") PatientValidator patientValidator, UiUtils ui) throws Exception { | ||
|
|
||
| if (patientIdNumber != null && !patientIdNumber.equals("")) { |
There was a problem hiding this comment.
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