Attachments Module Tries to load Complex Obs for All Encounter Observations

First of all, customizing the encounter template had been nightmarish to say the least. This visits/encounters dashboard is a horror show.

This is what configures the custom encounter template to be used:

{
  "id": "attachments.encounterTemplate",
  "extensionPointId": "org.openmrs.referenceapplication.encounterTemplate",
  "type": "fragment",
  "extensionParams": {
    "templateId": "complexObsEncounterTemplate",
    "templateFragmentProviderName": "attachments",
    "templateFragmentId": "complexObsEncounterTemplate",
    "supportedEncounterTypes": {
      "5021b1a1-e7f6-44b4-ba02-da2f2bcf8718": {
        "icon": "icon-paper-clip",
        "deletable": "false"
      }
    }
  }
}

As you can see, only on encounter type is supposedly supported… You may have to dig in to understand why this is not applied as expected.


The toast message error popups are unrelated, it would be interesting to know why Attachments cannot figure out how to fallback on the complex obs handler that was used for those obs (because it is supposed to actually.). Would you be in a position to investigate this?

It most likely relates to this thread: ‘Visit Documents Module does not display images saved as complex obs from another module’. I was hoping back then that @ivange94 could dig further and raise a ticket.

Or if you are in a position to provide detailed steps as to how to reproduce the ‘core bug’ so to say, that’d be helpful.