What's the best way to edit multiple sections in the Registration App?

Application Name: Reference Application Version Number: 2.3

Hi Everyone,

We are working with the new instructions to be able to collect multiple fields with the registration app. Our team realized that clicking the ‘edit’ button in the patient header doesn’t redirect to the appropriate screen, so we followed the work done by @ssmusoke to:

  1. disable the extension points in our module activator. (link to full activator)

    /**

    • @see ModuleActivator#started() */ public void started() { AppFrameworkService appFrameworkService = Context.getService(AppFrameworkService.class);

      try { // disable the reference app registration page appFrameworkService.disableApp(“referenceapplication.registrationapp.registerPatient”); // disable the registration app’s basic registration page appFrameworkService.disableApp(“registrationapp.basicRegisterPatient”); // disable the extension to the edit person demographic information appFrameworkService.disableExtension(“org.openmrs.module.registrationapp.editPatientDemographics”); // disable the extension to the edit person contact information appFrameworkService.disableExtension(“org.openmrs.module.registrationapp.editPatientContactInfo”);

      } catch (Exception e) { Module mod = ModuleFactory.getModuleById(“isanteplusregistration”); ModuleFactory.stopModule(mod); throw new RuntimeException("failed to setup the module ", e); } log.info(“isanteplusregistration Module started”); }

  2. Add the new extension points to our app.json file (link to full app.json)

    { “id”: “referenceapplication.registrationapp.isantePlusRegistration.editPatientDemographics”, “extensionPointId”: “patientHeader.editPatientDemographics”, “type”: “link”, “label”: “general.edit”, “url”: “registrationapp/editSection.page?patientId={{patient.patientId}}&sectionId=demographics&appId=referenceapplication.registrationapp.isantePlusRegistration” }, { “id”: “referenceapplication.registrationapp.isantePlusRegistration.editPatientContactInfo”, “extensionPointId”: “patientHeader.editPatientContactInfo”, “type”: “link”, “label”: “general.edit”, “url”: “registrationapp/editSection.page?patientId={{patient.patientId}}&sectionId=contactInfo&appId=referenceapplication.registrationapp.isantePlusRegistration” }

Questions This is fine for editing patientDemographics and patientContactInfo, but the new app.json technique allows you to collect any number of sections.

  • If we create a new section, how do we access that section for editing?
  • Is there a way to view all information that’s collected in the registration process on a single screen, click “edit” and edit it like we would with htmlformentry?
  • Are there other extension points or places on the dashboard that displays patient fields that have been collected?

Thanks, Craig

@mogoodrich, @darius, @arbaughj, @jmaxy

I remember someone had been working on the ability to display (and I think edit) custom sections. At the Uganda Implementers Conference they were planning to back port that to the current reference app. I forget who was working on that now, and I am away from my computer so can’t look it up. Searching Talk should yield who you should ping for a status update.

Would be great to have a “correct” way to display and edit custom sections…

I don’t have the code in front of me now, but we came with a hacky/less-than-ideal way to handle this. The general idea was that all our extra sections stored all (most?) of the data as obs on the generated registration encounter. So we created individual html forms for each section. Then we used these forms and the coreapps “encounter/mostRecentEncounter” fragment to create a section on the registration summary page for each section we had created. So, in essence, each “mostRecentEncounter” fragment would load the entire most recent encounter, but the individual form associated with that “mostRecentEncounter” fragment would only show the obs from a specific section. Editing happened the same way–each “mostRecentEncounter” fragment would have an edit link that opened the entire registration encounter, but using the specific form, only allowing the specific fields in that section to be editable.

If that’s helpful at all, I can try to dig up the code… :slight_smile:

One of the downsides to this is that you define the content you are collecting twice–in the registration app config, and then in the forms.

Take care, Mark