Uploaded image for project: 'Reference Application'
  1. Reference Application
  2. RA-1620

Ensure that form filling follows the correct order

    XMLWordPrintable

Details

    • Low

    Description

      In Nigeria implementation of openmrs, we want to enforce that some forms filling follows a correct order. In the current state, when a patient dashboard is accessed, the data enter clerk can start entering record from any of the forms and this not right.

      For example, list of our forms includes Childbirth Registration Detail Form, Child Follow up form etc. The correct thing to do is to fill Childbirth registration form first before the child follow up form and provide the childbirth details as lookup on the follow up form.

      Preferably, as you are saving the childbirth registration form, you should be prompted to redirect to the next form.

      Similar with what we have in the link below: Conditionally displaying Apps and Extensions but for encounter types.

      You can put a blank line after this one: https://github.com/openmrs/openmrs-module-coreapps/blob/master/omod/src/main/java/org/openmrs/module/coreapps/page/controller/clinicianfacing/PatientPageController.java#L96
      Then put code like below:

      List<EncounterType> encounterTypes = new ArrayList<EncounterType>();
      List<Encounter> encounters = encounterService.getEncountersByPatient(patient);
              for (Encounter encounter : encounters) {
              	encounterTypes.add(encounter.getEncounterType());
              }
      contextModel.put("encounterTypes", ConversionUtil.convertToRepresentation(encounterTypes, Representation.DEFAULT));
      

      Remember to put another blank line after this code.

      Then one should be able to for instance configure a form for patients on the ART program with the show if condition below:

      hasMemberWithProperty (encounterTypes, 'name', 'INITIAL ENCOUNTER')
      or

      hasMemberWithProperty (encounterTypes, 'uuid', 'uuid-for-the-encounter-type')
      After this code has been merged, update the above wiki documentation by adding how one can conditionally show forms based on previous encounter types.

      Just in case you are not aware of these pull request tips: https://wiki.openmrs.org/display/docs/Pull+Request+Tips

      https://wiki.openmrs.org/display/docs/Using+Git

      Options

      Gliffy Diagrams

        Attachments

          Issue Links

            Activity

              People

                musakizito Kizito Musa
                aeze Arinze Eze
                Votes:
                0 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                  Created:
                  Updated: