View Encounters privilege on Visit Summary

Hey there,

Currently, on openmrs, a user with view role (privileges for view only on encounters ) cannot open a form in view mode, it can only see the details on Visit Summary Page:

The problem is that under the details, we can only show the fields that were filled under the encounter. It could be interesting to let the button view acessible for users that have a view privilege for that encounter.

Nowadays we have the code like this:

The solution is very simple: just put the line for viewEncounter outside the privilege (encounter.canEdit):

<i class="viewEncounter view-action icon-file-alt" data-mode="view" data-patient-id="{{- patient.id }}" data-encounter-id="{{- encounter.encounterId }}" {{ if (config.viewUrl) { }} data-view-url="{{- config.viewUrl }}" {{ } }} {{ if (config.uiStyle) { }} data-ui-style="{{- config.uiStyle }}" {{ } }} title="${ ui.message("coreapps.view") }"></i>

{{ if ( (config.editable == null || config.editable) && encounter.canEdit) { }}
        <i class="editEncounter edit-action icon-pencil" data-patient-id="{{- patient.id }}" data-encounter-id="{{- encounter.encounterId }}" {{ if (config.editUrl) { }} data-edit-url="{{- config.editUrl }}" {{ } }} {{ if (config.uiStyle) { }} data-ui-style="{{- config.uiStyle }}" {{ } }} title="${ ui.message("coreapps.edit") }"></i>
{{ } }}

This way we would have something like below for view users:

image

This way they are able to View the entire encounter.

Let me know your thoughts about this.

Thanks!

cc: @mksd

Created ticket RA-1873

1 Like

added a pr on the ticket link

Thank you @herbert24. I think your PR belongs to another Talk :slight_smile: : Edit Privilege on VisitSummary Page. Both talks are improvements on same page: Visit Summary.

Thank you very much for your actions :wink:

1 Like