Photo by Stephen Radford on Unsplash
Hiding Columns in Group Notes – myEvolv
– Katie Hutchinson
If you are like us, you want to make event forms in your EHR system as user-friendly as possible. And by user-friendly I mean no-possible-way-anyone-could-screw-this-up. But also you want as little to look at as possible. Because of this, we love to hide non-essential fields on forms/events. Sometimes it’s easy; just uncheck Is Visible or if you want it to hide based on information entered somewhere else, you use a hide code in an On Change script. Other times it’s not that easy.
When one of the systems we work with updated recently, our old code used on the group note parent form for hiding columns on the system nonmodifiable (and non-find-able) subform, columns not as easily hidden as stated earlier, broke the form. And the internet. And flooded our inbox. I asked my bff ChatGPT to edit it for me.
It did not go well.
Hours later, I was either getting no results or errors. I only know enough about javascript to be dangerous, so I went to a forum to ask for help. A wonderful gentleman suggested that I “use a development tool in the browser to view the resulting page source and determine what the new names or structure is.”
To do this, I inspected the page that had the new naming structure. You can inspect a page by right clicking anywhere in a blank space and clicking Inspect. On the Element tab, click in the top left corner:

After the icon at the top left is selected you can click the area on the page you want to drill down on and select the name/structure. I put the old code into Chat with a snip of the new naming structure and, as they say, Bob’s your uncle.
So:
function sleep(ms) { return new Promise(res => setTimeout(res, ms)); }
let myAsyncFunc = async function() {
if ( $(‘.rgMasterTable tr’).length <= 1) {
FormUtil.blockUI(“….. Load Group Member …..”);
await sleep(100);
myAsyncFunc();
}
else {
$(‘#groupMembers th:nth-child(6)’).hide();
$(‘#groupMembers td:nth-child(6)’).hide();
$(‘#groupMembers th:nth-child(7)’).hide();
$(‘#groupMembers td:nth-child(7)’).hide();
$(‘#groupMembers th:nth-child(8)’).hide();
$(‘#groupMembers td:nth-child(8)’).hide();
$(‘#groupMembers th:nth-child(12)’).hide();
$(‘#groupMembers td:nth-child(12)’).hide();
$(‘#groupMembers th:nth-child(5)’).hide();
$(‘#groupMembers td:nth-child(5)’).hide();
}
}
myAsyncFunc();
Became:
(function hideGroupMembersColumns() {
const columnsToHide = [5, 6, 7, 8, 12]; // 6,7,8,9,13 (0-based)
const hideColumns = () => {
const table = document.querySelector(‘table[id^=”table-form-group-grid_”]’);
if (!table) return false;
table.querySelectorAll(“tr”).forEach(tr => {
columnsToHide.forEach(idx => {
if (tr.children[idx]) {
tr.children[idx].style.display = “none”;
}
});
});
return true;
};
if (hideColumns()) return;
const observer = new MutationObserver(() => {
if (hideColumns()) observer.disconnect();
});
observer.observe(document.body, { childList: true, subtree: true });
})();
I had worked hours the day before, but once I had the right information, it took less than 2 min. Garbage in garbage out. Well, it wasn’t garbage. It just wasn’t the full picture.
*General Netsmart Disclaimer: KHIT Consulting is not an affiliate of or associated in any way with Netsmart Technologies. Implement customizations at your own risk and test workflows and processes in development before implementing in production. Netsmart does not support system customizations that are not outlined in their own documentation and resources. KHIT Consulting is not responsible for any negative outcomes as the result of your implementation of custom processes.
Questions? Contact us via email: [email protected]





