Skip to content

Comments

RA-1747: Hide 'Admit to inpatient' button on patient dashboard#106

Open
vimla01 wants to merge 3 commits intoopenmrs:masterfrom
vimla01:RA-1747
Open

RA-1747: Hide 'Admit to inpatient' button on patient dashboard#106
vimla01 wants to merge 3 commits intoopenmrs:masterfrom
vimla01:RA-1747

Conversation

@vimla01
Copy link

@vimla01 vimla01 commented Dec 9, 2025

Requirements

  • This PR has a title that briefly describes the work done and includes the ticket number.
  • My work is validated through manual testing using an OpenMRS RefApp SDK server.

Summary

This PR hides the “Admit to Inpatient” button on the clinician-facing patient dashboard.

Removing the privilege referenceapplication.simpleAdmission does not prevent the UI from rendering the action.
As recommended in the Jira discussion, a small CSS override is applied to hide the button at the UI level. This
ensures that users who should not see the admission option do not have access to it visually, while other visit
actions (Transfer, Discharge, Visit Note, Capture Vitals, etc.) remain fully accessible.

Related Issue

Fixes RA-1747

Changes

  • Added a CSS rule to referenceapplication.scss targeting the extension with ID
    referenceapplication.realTime.simpleAdmission.
  • This hides only the “Admit to Inpatient” button without affecting any other UI elements or backend workflows.

CSS Applied

#referenceapplication\.realTime\.simpleAdmission {
    display: none !important;
}

Testing

Before the change

  • Logged in as clinician.
  • Navigated to Inpatient Ward → Select patient → Visits → Visit Actions.
  • Observed the “Admit to Inpatient” button still visible even without the privilege.

After the change

  • Rebuilt and redeployed the module using OpenMRS SDK.
  • Verified that the “Admit to Inpatient” action no longer appears.
  • All other visit actions remain functional.

Screenshots

Before:
before

After:
after

Checklist

  • Manually tested on OpenMRS RefApp SDK
  • No regressions in visit action functionality
  • Matches OpenMRS coding and UI guidelines
  • The change is minimal, clean, and reversible

@import "font-awesome-5/fontawesome";

#referenceapplication\.realTime\.simpleAdmission {
display: none !important;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is !important required here, or can we rely on selector specificity?

Copy link
Author

@vimla01 vimla01 Feb 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @dilankavishka
!important would only be needed if another stylesheet (loaded later) or inline style is forcing display with !important.
I’ve made the change in \omod/src/main/resources/styles/referenceapplication.scssby removing!important` and relying on the specific ID selector

@dilankavishka
Copy link

Could you please take a look on this : https://openmrs.atlassian.net/wiki/spaces/docs/pages/25477199/Pull+Request+Tips

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants