Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
a6d3211
Based on the commit history and the changes you've shared, here are s…
yingbull May 13, 2025
ce0af1e
refactor: update Struts 2 configuration to improve error handling and…
yingbull May 13, 2025
1b3f77b
feat: configure Struts 2 to support .do extensions and improve error …
yingbull May 13, 2025
c438e03
refactor: remove .action extension and add static resource handling i…
yingbull May 13, 2025
3c51112
refactor: Update CaseManagementEntry2Action to support Struts 2 metho…
yingbull May 13, 2025
3629359
inital fixes for social history
yingbull May 13, 2025
448ac92
sign and save now brings you to a new popup, still broken from in there
AlexSilveira1 May 16, 2025
10e30e8
fix: update containerDiv ID to use dynamic command parameter in viewN…
AlexSilveira1 May 16, 2025
e9d2b7e
commit before change
AlexSilveira1 May 16, 2025
73601e3
refactor: restore copyright notice and improve code structure in view…
AlexSilveira1 May 20, 2025
bfb6bf6
refactor: update note handling to display titles again. pushing curre…
AlexSilveira1 May 22, 2025
bd0efcf
Get the provider number from the session storage. Now displays correc…
AlexSilveira1 May 23, 2025
13f8831
fix: encounter type handling for Struts 2 migration in case management
yingbull May 28, 2025
c905798
Merge remote-tracking branch 'origin/fix/encounter-type-struts2-migra…
AlexSilveira1 May 29, 2025
305a5be
feat: add debug logging to showIssueHistory function
AlexSilveira1 May 29, 2025
5398627
fix: prevent page reload when adding notes to CPP sections
AlexSilveira1 May 29, 2025
fe1768d
feat: add logging and improve CPP note update functionality
AlexSilveira1 May 29, 2025
b87f8e4
refactor: replace direct HTML note text with XML-escaped note content
AlexSilveira1 Jun 4, 2025
4e2cf77
fix: update viewNotes to handle all encounter types consistently
AlexSilveira1 Jun 4, 2025
140cf06
refactor: Simplify note view parameters and remove unnecessary escaping
AlexSilveira1 Jun 5, 2025
80af7f1
fix: escape titleMsg in viewNotes.jsp to prevent empty title display
AlexSilveira1 Jun 5, 2025
946a036
fix: properly escape and reference Java variables in JSP JavaScript c…
AlexSilveira1 Jun 5, 2025
e39ab0c
refactor: Simplify viewNotes.jsp with improved note rendering and onc…
AlexSilveira1 Jun 6, 2025
3f4d6bc
commented out the event stop.
AlexSilveira1 Jun 9, 2025
1a1f88a
refactor: Remove unnecessary blank line in viewNotes.jsp
AlexSilveira1 Jun 9, 2025
cea1e28
feat: add console logging for note details in viewNotes.jsp
AlexSilveira1 Jun 9, 2025
7f97bf9
feat: enhance note logging with full object and stringified output
AlexSilveira1 Jun 9, 2025
46b28d0
Added comments to newCaseManagement for better understanding
AlexSilveira1 Jun 9, 2025
b5a8ab8
Debugging prints
AlexSilveira1 Jun 11, 2025
465f095
feat: add logging for updateCPPNote form data serialization
AlexSilveira1 Jun 16, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,17 @@ public String execute() throws Exception {
return null;
}
String method = request.getParameter("method");
// Check for alternate parameter names used by Struts 2
if (method == null) {
method = request.getParameter("action");
}
if (method == null) {
method = request.getParameter("dispatch");
}
if (method == null) {
method = request.getParameter("parameterValue");
}

if ("setUpMainEncounter".equals(method)) {
return setUpMainEncounter();
} else if ("isNoteEdited".equals(method)) {
Expand Down Expand Up @@ -935,14 +946,23 @@ public String issueNoteSave() throws Exception {
Set<CaseManagementIssue> issueSet = new HashSet<CaseManagementIssue>();
Set<CaseManagementNote> noteSet = new HashSet<CaseManagementNote>();
String[] issue_id = request.getParameterValues("issue_id");
CheckBoxBean[] existingCaseIssueList = sessionFrm.getIssueCheckList();
ArrayList<CheckBoxBean> caseIssueList = new ArrayList<CheckBoxBean>();

// copy existing issues for sessionfrm
for (int idx = 0; idx < existingCaseIssueList.length; ++idx) {
caseIssueList.add(existingCaseIssueList[idx]);
CheckBoxBean[] existingCaseIssueList = null;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

not anything I will send for a request for change, but do look to up the inline comment bar etc at least in the areas being worked on where possible.


if (sessionFrm != null) {
existingCaseIssueList = sessionFrm.getIssueCheckList();
}


if (existingCaseIssueList != null) {
// copy existing issues for sessionfrm
for (CheckBoxBean bean : existingCaseIssueList) {
caseIssueList.add(bean);
}
} else {
logger.info("No existingCaseIssueList found in session form — proceeding with empty list.");
}

// first we check if any notes have been removed
Set<CaseManagementIssue> noteIssues = note.getIssues();
Iterator<CaseManagementIssue> iter = noteIssues.iterator();
Expand Down Expand Up @@ -3243,6 +3263,7 @@ protected CaseManagementCPP copyNote2cpp(CaseManagementCPP cpp, CaseManagementNo
String separator = "\n-----[[" + d + "]]-----\n";
for (CaseManagementIssue issue : issueSet) {
String code = issue.getIssue().getCode();
text = new StringBuilder(); // Reset text for each issue
if (code.equals("OMeds")) {
text.append(cpp.getFamilyHistory());
text.append(separator);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1298,6 +1298,8 @@ public String listNotes() throws Exception {
return null;
}

System.out.println("Notes: " + notes);

return "listNotes";
}

Expand Down
50 changes: 50 additions & 0 deletions src/main/webapp/WEB-INF/web.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,53 @@
<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter</filter-class>
<init-param>
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

OK, going to ask for some comments here that help explain what the additional filter settings do/why they are needed.

<param-name>actionPackages</param-name>
<param-value>org.oscarehr,oscar</param-value>
</init-param>
<init-param>
<param-name>struts.devMode</param-name>
<param-value>false</param-value>
</init-param>
<init-param>
<param-name>struts.configuration.files</param-name>
<param-value>struts-default.xml,struts-plugin.xml,struts.xml</param-value>
</init-param>
<init-param>
<param-name>struts.action.extension</param-name>
<param-value>do</param-value>
</init-param>
<init-param>
<param-name>struts.enable.SlashesInActionNames</param-name>
<param-value>true</param-value>
</init-param>
<init-param>
<param-name>struts.mapper.alwaysSelectFullNamespace</param-name>
<param-value>false</param-value>
</init-param>
<init-param>
<param-name>struts.custom.i18n.resources</param-name>
<param-value>oscarResources</param-value>
</init-param>
<init-param>
<param-name>struts.serve.static</param-name>
<param-value>true</param-value>
</init-param>
<init-param>
<param-name>struts.serve.static.browserCache</param-name>
<param-value>true</param-value>
</init-param>
<init-param>
<param-name>struts.action.excludePattern</param-name>
<param-value>.*\.(css|js|png|jpg|gif)$</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
<dispatcher>REQUEST</dispatcher>
<dispatcher>FORWARD</dispatcher>
<dispatcher>INCLUDE</dispatcher>
</filter-mapping>
<filter>
<filter-name>WebServiceSessionInvalidatingFilter</filter-name>
Expand Down Expand Up @@ -521,6 +562,15 @@
</welcome-file-list>

<error-page>
<error-code>404</error-code>
<location>/errorpage.jsp</location>
</error-page>
<error-page>
<error-code>500</error-code>
<location>/errorpage.jsp</location>
</error-page>
<error-page>
<exception-type>java.lang.Exception</exception-type>
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I like this, but should we have a different setup for development we should have an alternative file we someone use etc?

<location>/errorpage.jsp</location>
</error-page>
</web-app>
2 changes: 1 addition & 1 deletion src/main/webapp/casemgmt/ChartNotes.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,7 @@
<input type="hidden" name="printRx" id="printRx" value="false">
<input type="hidden" name="printLabs" id="printLabs" value="false">
<input type="hidden" name="printPreventions" id="printPreventions" value="false">
<input type="hidden" name="encType" id="encType" value="">
<input type="hidden" name="encType" id="encType" value="<c:out value="${caseManagementEntryForm.caseNote.encounter_type}" default="" />">
<input type="hidden" name="pType" id="pType" value="">
<input type="hidden" name="pStartDate" id="pStartDate" value="">
<input type="hidden" name="pEndDate" id="pEndDate" value="">
Expand Down
3 changes: 1 addition & 2 deletions src/main/webapp/casemgmt/newCaseManagementView.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,8 @@
<!-- social history -->
<div id="divR1I1" class="topBox">
</div>

<!-- medical history -->
<div id="divR1I2" class="topBox">

</div>
</div>

Expand Down
134 changes: 98 additions & 36 deletions src/main/webapp/casemgmt/newEncounterLayout.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -605,17 +605,34 @@
</div>
<!-- hovering divs -->
<div id="showEditNote" class="showEdContent">
<form id="frmIssueNotes" action="" method="post"
onsubmit="return updateCPPNote();">
<input type="hidden" id="reloadUrl" name="reloadUrl" value="">
<input type="hidden" id="containerDiv" name="containerDiv" value="">
<input type="hidden" id="issueChange" name="issueChange" value="">
<input type="hidden" id="archived" name="archived" value="false">
<input type="hidden" id="annotation_attrib" name="annotation_attrib">
<h3 id="winTitle"></h3>

<textarea cols="50" rows="15" id="noteEditTxt"
name="value" class="boxsizingBorder"></textarea>
<form id="frmIssueNotes"
action=""
method="post"
onsubmit="return updateCPPNote();">

<!-- Injected by your showEdit(...) call -->
<input type="hidden"
id="containerDiv"
name="containerDiv"
value="" />

<input type="hidden"
id="reloadUrl"
name="reloadUrl"
value="" />

<!-- other fields -->
<input type="hidden" id="issueChange" name="issueChange" value="">
<input type="hidden" id="archived" name="archived" value="false">
<input type="hidden" id="annotation_attrib" name="annotation_attrib">

<h3 id="winTitle"></h3>

<textarea id="noteEditTxt"
name="value"
cols="50"
rows="15"
class="boxsizingBorder"></textarea>
<br>

<table>
Expand Down Expand Up @@ -712,38 +729,70 @@
</tr>
</table>
<div class="control-panel">
<!-- these two should already be present, set by showEdit(...) -->
<input type="hidden" id="containerDiv" name="containerDiv" value="${param.containerDiv}"/>
<input type="hidden" id="reloadUrl" name="reloadUrl" value="${param.reloadUrl}"/>

<!-- other hidden fields -->
<input type="hidden" id="startTag" value='<fmt:setBundle basename="oscarResources"/><fmt:message key="oscarEncounter.Index.startTime"/>'>
<input type="hidden" id="endTag" value='<fmt:setBundle basename="oscarResources"/><fmt:message key="oscarEncounter.Index.endTime"/>'>
<br> <span style="float: right; margin-right: 10px;">
<input
type="image"
src="<c:out value="${ctx}/oscarEncounter/graphics/copy.png"/>"
title='<fmt:setBundle basename="oscarResources"/><fmt:message key="oscarEncounter.Index.btnCopy"/>'
onclick="copyCppToCurrentNote(); return false;"> <input
<input type="hidden" id="endTag" value='<fmt:setBundle basename="oscarResources"/><fmt:message key="oscarEncounter.Index.endTime"/> '>
<input type="hidden" id="issueChange" name="issueChange" value=""/>
<input type="hidden" id="archived" name="archived" value="false"/>
<input type="hidden" id="annotation_attrib" name="annotation_attrib" value=""/>

<br>
<span style="float: right; margin-right: 10px;">
<!-- Copy -->
<input
type="image"
src="<c:out value="${ctx}/oscarEncounter/graphics/annotation.png"/>"
title='<fmt:setBundle basename="oscarResources"/><fmt:message key="oscarEncounter.Index.btnAnnotation"/>'
id="anno" style="padding-right: 10px;"> <input type="image"
src="<c:out value="${ctx}/oscarEncounter/graphics/edit-cut.png"/>"
title='<fmt:setBundle basename="oscarResources"/><fmt:message key="oscarEncounter.Index.btnArchive"/>'
onclick="$('archived').value='true';"
style="padding-right: 10px;">
<input type="image"
src="<c:out value="${ctx}/oscarEncounter/graphics/note-save.png"/>"
title='<fmt:setBundle basename="oscarResources"/><fmt:message key="oscarEncounter.Index.btnSignSave"/>'
onclick="$('archived').value='false';" style="padding-right: 10px;">
<input type="image"
src="<c:out value="${ctx}/oscarEncounter/graphics/system-log-out.png"/>"
title='<fmt:setBundle basename="oscarResources"/><fmt:message key="global.btnExit"/>'
onclick="this.focus();$('channel').style.visibility ='visible';$('showEditNote').style.display='none';return false;">
</span>
src="<c:out value='${ctx}/oscarEncounter/graphics/copy.png'/>"
title="<fmt:message key='oscarEncounter.Index.btnCopy'/>"
onclick="copyCppToCurrentNote(); return false;"
/>

<!-- Annotation -->
<input
type="image"
src="<c:out value='${ctx}/oscarEncounter/graphics/annotation.png'/>"
title="<fmt:message key='oscarEncounter.Index.btnAnnotation'/>"
id="anno"
style="padding-right: 10px;"
/>

<!-- Archive -->
<input
type="image"
src="<c:out value='${ctx}/oscarEncounter/graphics/edit-cut.png'/>"
title="<fmt:message key='oscarEncounter.Index.btnArchive'/>"
onclick="document.getElementById('archived').value='true'; return false;"
style="padding-right: 10px;"
/>

<!-- **Save** (now a true submit) -->
<input
type="image"
src="<c:out value='${ctx}/oscarEncounter/graphics/note-save.png'/>"
title="<fmt:message key='oscarEncounter.Index.btnSignSave'/>"
onclick="document.getElementById('archived').value='false';"
style="padding-right: 10px;"
/>

<!-- **Cancel** -->
<input
type="image"
src="<c:out value='${ctx}/oscarEncounter/graphics/system-log-out.png'/>"
title="<fmt:message key='global.btnExit'/>"
onclick="document.getElementById('showEditNote').style.display='none'; return false;"
/>
</span>

<label for="position">
<fmt:setBundle basename="oscarResources"/><fmt:message key="oscarEncounter.Index.btnPosition"/>
<fmt:message key="oscarEncounter.Index.btnPosition"/>
</label>
<select id="position" name="position">
<option id="popt0" value="0">1</option>
</select>
</div>
</div>
<div id="issueNoteInfo"></div>
<div id="issueListCPP"
style="background-color: #FFFFFF; height: 200px; width: 350px; position: absolute; z-index: 1; display: none; overflow: auto;">
Expand All @@ -762,6 +811,19 @@
src="<c:out value="${ctx}/oscarEncounter/graphics/busy.gif"/>"
alt="<fmt:setBundle basename="oscarResources"/><fmt:message key="oscarEncounter.Index.btnWorking"/>"></span>
</div>
<fmt:setBundle basename="oscarResources"/>

<c:set var="formKey" value="caseManagementEntryForm${demographicNo}" />
<c:set var="sessionFrm" value="${sessionScope[formKey]}" />

<c:forEach var="checkbox" items="${sessionFrm.issueCheckList}">
<input type="checkbox"
name="issue_id"
value="${checkbox.issue.issue_id}"
<c:if test="${checkbox.checked == 'on'}">checked</c:if> />
${checkbox.issue.description}
</c:forEach>

</form>
</div>
<div id="printOps" class="printOps">
Expand Down
Loading
Loading