Updating Patient CPP via New UI Adds Duplicate Entries into Casemgmt_issue table

Preconditions

None

Steps to Reproduce

None

Expected Result

None

Observed Result

None

Additional Comments

OSCAR build date: 2016-09-26 01:21 PM
OSCAR build tag: oscar15BetaMaster-457
Client browser: firefox
Client OS: windows
Preconditions:
1. Please provide all information needed before this issue will present

None

Steps to reproduce:
1. Please give all steps to reproduce this issue (if there is data
required to reproduce, please attach that to the issue)

a) create a new patient
b) open the patient's chart in the new UI
c) add a first of any of the following: other meds, ongoing concerns, medical history, social history, reminders, risk factors
d) add a second of the same

Expected Result:

In the casemgmt_issue table, only one of each issue would exist for this demographic.

I can continue to use all aspects of this patient's chart.

Observed:

In the casemgmt_issue table, two issues exist for each.

Cannot save notes via the classic UI anymore.

Please attach relevant log entries, screenshots

Error when trying to save note via classic UI.

javax.persistence.NonUniqueResultException: Expected 1 result got more : 2(9788,MedHistory)
org.oscarehr.casemgmt.dao.CaseManagementIssueDAO.getIssuebyIssueCode(CaseManagementIssueDAO.java:82)
org.oscarehr.casemgmt.web.CaseManagementEntryAction.saveCheckedIssues_newCme(CaseManagementEntryAction.java:1578)
org.oscarehr.casemgmt.web.CaseManagementEntryAction.noteSave(CaseManagementEntryAction.java:1331)
org.oscarehr.casemgmt.web.CaseManagementEntryAction.saveAndExit(CaseManagementEntryAction.java:1940)
sun.reflect.GeneratedMethodAccessor859.invoke(Unknown Source)
sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
java.lang.reflect.Method.invoke(Unknown Source)
org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:274)
org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:194)
org.springframework.web.struts.DelegatingActionProxy.execute(DelegatingActionProxy.java:110)
org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:419)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:224)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194)
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
javax.servlet.http.HttpServlet.service(HttpServlet.java:648)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:160)
oscar.oscarSecurity.LoginFilter.doFilter(LoginFilter.java:200)
net.sf.cookierevolver.servlet.CRFilterImpl.doFilter(CRFilterImpl.java:60)
org.displaytag.filter.ResponseOverrideFilter.doFilter(ResponseOverrideFilter.java:125)
org.oscarehr.util.LoggedInUserFilter.doFilter(LoggedInUserFilter.java:56)
org.oscarehr.util.DbConnectionFilter.doFilter(DbConnectionFilter.java:66)
org.oscarehr.common.printing.PrivacyStatementAppendingFilter.doFilter(PrivacyStatementAppendingFilter.java:118)
org.oscarehr.util.ProblemCheckFilter.doFilter(ProblemCheckFilter.java:194)
org.oscarehr.util.ResponseDefaultsFilter.doFilter(ResponseDefaultsFilter.java:109)
net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:160)

This makes sense as CaseManagementIssueDAO.java is deliberately checking to ensure only one result is retrieved:

" public CaseManagementIssue getIssuebyIssueCode(String demo, String issueCode) {
@SuppressWarnings("unchecked")
List<CaseManagementIssue> list = this.getHibernateTemplate().find("select cmi from CaseManagementIssue cmi, Issue issue where cmi.issue_id=issue.id and issue.code = ? and cmi.demographic_no = ?",new Object[]{issueCode,demo});

if(list == null || list.size()<1) return(null);

if (list.size() == 1 ) return list.get(0);

throw(new NonUniqueResultException("Expected 1 result got more : "+list.size() + "(" + demo + "," + issueCode + ")"));
}"

Other details:

Attachments

Assignee

John Wilson

Reporter

Sourceforge Migration

Labels

OSCAR Build Date

None

OSCAR Build Tag

None

Client Browser

None

Client OS

None

Are you or your organization planning on submitting a fix for this bug in the next 30 days?

None

Validated by Reporter

None

SourceForge Reporter

kchung-magenta

SourceForge Assigned To

None

SourceForge Date Created

None

SourceForge ID

4,464

Fix versions

Affects versions

Priority

7
Configure