Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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 @@ -32,6 +32,7 @@
import org.apache.commons.lang.math.NumberUtils;
import org.apache.logging.log4j.Logger;
import org.apache.struts2.ServletActionContext;
import org.apache.struts2.interceptor.SessionAware;
import org.oscarehr.PMmodule.dao.ProgramProviderDAO;
import org.oscarehr.PMmodule.dao.ProviderDao;
import org.oscarehr.PMmodule.model.Program;
Expand Down Expand Up @@ -89,7 +90,7 @@
import java.text.SimpleDateFormat;
import java.util.*;

public class CaseManagementEntry2Action extends ActionSupport {
public class CaseManagementEntry2Action extends ActionSupport implements SessionAware {

HttpServletRequest request = ServletActionContext.getRequest();
HttpServletResponse response = ServletActionContext.getResponse();
Expand All @@ -109,7 +110,11 @@ public String execute() throws Exception {
logger.error(message);
return null;
}
String method = request.getParameter("method");

restoreFromSession();

String method = request.getParameter("method") != null ? request.getParameter("method") : (String) request.getAttribute("method");

if ("setUpMainEncounter".equals(method)) {
return setUpMainEncounter();
} else if ("isNoteEdited".equals(method)) {
Expand Down Expand Up @@ -205,7 +210,8 @@ public String edit() throws Exception {
return null;
}

this.setChain("");
CaseManagementEntryFormBean cform = new CaseManagementEntryFormBean();
cform.setChain("");
request.setAttribute("change_flag", "false");
request.setAttribute("from", "casemgmt");

Expand Down Expand Up @@ -279,7 +285,7 @@ public String edit() throws Exception {
logger.debug("Get Issues and filter them " + String.valueOf(current - start));
start = current;

this.setDemoNo(demono);
cform.setDemoNo(demono);
CaseManagementNote note = null;

String nId = request.getParameter("noteId");
Expand Down Expand Up @@ -411,8 +417,8 @@ else if (nId != null && !"null".equalsIgnoreCase(nId) && Integer.parseInt(nId) >
start = current;

// put the new/retrieved not in the form object for rendering on page
this.setCaseNote(note);
logger.debug("note in cform " + this.getCaseNote_note());
cform.setCaseNote(note);
logger.debug("note in cform " + cform.getCaseNote_note());
/* set issue checked list */

// get issues for current demographic, based on provider rights
Expand Down Expand Up @@ -458,11 +464,11 @@ else if (nId != null && !"null".equalsIgnoreCase(nId) && Integer.parseInt(nId) >

current = System.currentTimeMillis();

this.setIssueCheckList(checkedList);
cform.setIssueCheckList(checkedList);

this.setSign("off");
if (!note.isIncludeissue()) this.setIncludeIssue("off");
else this.setIncludeIssue("on");
cform.setSign("off");
if (!note.isIncludeissue()) cform.setIncludeIssue("off");
else cform.setIncludeIssue("on");

boolean passwd = caseManagementMgr.getEnabled();
String chain = request.getParameter("chain");
Expand All @@ -481,15 +487,15 @@ else if (nId != null && !"null".equalsIgnoreCase(nId) && Integer.parseInt(nId) >

if (casemgmtNoteLock.isLocked()) {
note = makeNewNote(providerNo, demono, request);
this.setCaseNote(note);
cform.setCaseNote(note);
}

session.setAttribute("casemgmtNoteLock" + demono, casemgmtNoteLock);

String frmName = "caseManagementEntryForm" + demono;
//logger.debug("Setting session form - " + frmName + " - " + String.valueOf(cform != null));
logger.debug("note in cform " + this.getCaseNote_note());
//session.setAttribute(frmName, cform);
logger.debug("note in cform " + cform.getCaseNote_note());
mySessionMap.put(frmName, cform);

String fwd, finalFwd = null;
if (chain != null && chain.length() > 0) {
Expand Down Expand Up @@ -1213,6 +1219,7 @@ public String issueNoteSave() throws Exception {
return null;
}

Comment thread
yingbull marked this conversation as resolved.
this.setReloadUrl("/CaseManagementView.do?" + reloadUrl);
return "listCPPNotes";
}

Expand Down Expand Up @@ -3754,6 +3761,24 @@ public void setCPPMedicalHistory(CaseManagementCPP cpp, String providerNo, List
}
}

private Map<String, Object> mySessionMap;

@Override
public void setSession(Map<String, Object> session) {
this.mySessionMap = session;
Comment thread
yingbull marked this conversation as resolved.
}

private void restoreFromSession() {
if (demographicNo != null) {
String sessionName = "caseManagementEntryForm" + demographicNo;
CaseManagementEntryFormBean sessionFrm = (CaseManagementEntryFormBean) mySessionMap.get(sessionName);
if (sessionFrm != null) {
this.issueCheckList = sessionFrm.getIssueCheckList();
this.newIssueCheckList = sessionFrm.getNewIssueCheckList();
}
}
}

private CaseManagementNote caseNote;
private CaseManagementCPP cpp;
private String demoNo;
Expand Down Expand Up @@ -3795,6 +3820,8 @@ public void setCPPMedicalHistory(CaseManagementCPP cpp, String providerNo, List
private Integer OscarMsgType;
private Integer OscarMsgTypeLink;

private String reloadUrl;

public String getObservation_date() {
return this.observation_date;
}
Expand Down Expand Up @@ -4091,6 +4118,14 @@ public void setMinuteOfEncTransportationTime(Integer minuteOfEncTransportationTi
this.minuteOfEncTransportationTime = minuteOfEncTransportationTime;
}

public String getReloadUrl() {
return reloadUrl;
}

public void setReloadUrl(String reloadUrl) {
this.reloadUrl = reloadUrl;
}

/**
* @return the OscarMsgType
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,8 @@ public String execute() throws Exception {
request.getSession().setAttribute("casemgmt_msgBeans", new ArrayList<Object>());


String method = request.getParameter("method");
String method = request.getParameter("method") != null ? request.getParameter("method") : (String) request.getAttribute("method");

if ("saveAndExit".equals(method)) {
return saveAndExit();
} else if ("save".equals(method)) {
Expand Down
4 changes: 3 additions & 1 deletion src/main/webapp/WEB-INF/classes/struts.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2146,7 +2146,9 @@
<result name="setUpMainEncounterPage">/casemgmt/newEncounterLayout.jsp</result>
<result name="view">/casemgmt/CaseManagementEntry.jsp</result>
<result name="list">/CaseManagementView.do?method=view</result>
<result name="listCPPNotes">/CaseManagementView.do</result>
<result name="listCPPNotes" type="redirect">
<param name="location">${reloadUrl}</param>
</result>
<result name="IssueSearch">/casemgmt/IssueSearch.jsp</result>
<result name="NoDemoERR">/casemgmt/noDemo.jsp</result>
<result name="windowClose">/casemgmt/close.jsp</result>
Expand Down
9 changes: 1 addition & 8 deletions src/main/webapp/casemgmt/ChartNotes.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -188,13 +188,6 @@
</script>
<div id="topContent">

<form name="caseManagementEntryForm" id="caseManagementEntryForm" style="display:none;">
<input type="hidden" name="method" value="edit">
<input type="hidden" name="note_edit" value="new">
<input type="hidden" name="noteId" value="0">
<input type="hidden" name="ajax" value="false">
<input type="hidden" name="chain" value="list">
</form>
<form name="caseManagementViewForm" action="${pageContext.request.contextPath}/CaseManagementView.do" method="post">
<input type="hidden" name="demographicNo" value="<%=demographicNo%>"/>
<input type="hidden" name="providerNo" value="<%=provNo%>"/>
Expand Down Expand Up @@ -527,7 +520,7 @@
String oscarMsgType = (String) request.getParameter("msgType");
String OscarMsgTypeLink = (String) request.getParameter("OscarMsgTypeLink");
%>
<form action="<%=request.getContextPath()%>/CaseManagementEntry.do" method="post">
<form name="caseManagementEntryForm" id="caseManagementEntryForm" action="<%=request.getContextPath()%>/CaseManagementEntry.do" method="post">
<input type="hidden" name="demographicNo" value="<%=demographicNo%>"/>
<input type="hidden" name="includeIssue" value="off"/>
<input type="hidden" name="OscarMsgType" value="<%=oscarMsgType%>"/>
Expand Down
2 changes: 1 addition & 1 deletion src/main/webapp/casemgmt/forward.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@

String redirectURL;
if ("true".equals(useNewCaseMgmt)) {
redirectURL = request.getContextPath() + "/CaseManagementEntry.do?method=setUpMainEncounter&from=casemgmt&chain=list&demographicNo=" + request.getParameter("demographicNo") + "&OscarMsgTypeLink=" + request.getParameter("OscarMsgTypeLink") + "&msgType=" + request.getParameter("msgType");
redirectURL = request.getContextPath() + "/CaseManagementEntry.do?method=setUpMainEncounter&from=casemgmt&chain=list&demographicNo=" + request.getParameter("demographicNo") + "&providerNo=" + request.getParameter("providerNo") + "&OscarMsgTypeLink=" + request.getParameter("OscarMsgTypeLink") + "&msgType=" + request.getParameter("msgType");
} else {
redirectURL = request.getContextPath() + "/CaseManagementView.do";
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/webapp/casemgmt/noteIssueList.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@
${issueCheckList.issueDisplay.description}
</a>

<c:if test="${issueCheckList.issue.used == false}">
<c:if test="${issueCheckList.used == false}">
<c:set var="submitDelete" value="removeIssue('${winame}');document.forms['caseManagementEntryForm'].deleteId.value='${status.index}';return ajaxUpdateIssues('issueDelete', $('noteIssues').up().id);" />
&nbsp;
<a href="#" onclick="${submitDelete}">Delete</a>
Expand Down
Loading
Loading