...
 
Commits (94)
# Build script used by gitlab.medelexis.ch
variables:
ORIGIN_BRANCH: "master"
ORIGIN_BRANCH: "3.7"
stages:
- build
......
# Generated by update_changelog.rb on 2018.12.04
# Generated by update_changelog.rb on 2018.12.24
# similar to git log --date=iso --pretty=format:'%H %ad %an %s' release/3.0.25..release/3.1.0
160 commits between origin/3.6 (2018.06.21) and release/3.7.0 (2018.12.05)
--------------------------------------------------------------------------
10 commits between origin/3.7 (2018.12.11) and release/3.7.0 (2018.12.25)
-------------------------------------------------------------------------
number changes by authors are
73: Marco Descher
37: thomashu
30: Niklaus Giger
19: Txomin Astrain
4: Marco Descher
4: Niklaus Giger
1: d-roesch
1: Txomin Astrain
-------------------------------------------------------------------------
07d70b3679b36f98e98610ef15e4e9882febb99e 2018-12-24 10:36:44 +0100 Niklaus Giger [14645] Wrap interaction text. Fix changing patients
9c90f7d8e14c66800e497f151ae268c652b23218 2018-12-20 10:09:25 +0100 Marco Descher [14765] rgw.utilty - swap sql dependencies from plug-ins to packages
5c66223ecd7192f18a48cbda71b809a6c5918236 2018-12-19 10:59:38 +0100 Marco Descher [14693] mysql connection string -> Europe/Zurich
1eb7f1261b5204cb736c06666f7405052a5e8fe8 2018-12-18 14:07:05 +0100 Marco Descher [14693] Provide mysql connection string time zone workaround
3d60022f410e754ed3e0ce37298d04d1d7362f25 2018-12-18 11:37:31 +0100 Marco Descher [14693] Provide mysql connection string time zone workaround
677c6142e299433118ae6b7067ba547151cd1316 2018-12-18 09:17:50 +0100 Txomin Astrain [14763] Set text to read only (#285)
b9f768873745f52e7961675cc77d8e9956fe289c 2018-12-17 15:09:12 +0100 d-roesch Fix DateTimeParseException exception in Konsultation (#284)
127619372b82613951e617fdf55de42b6a3c7e78 2018-12-12 13:06:40 +0100 Niklaus Giger [14645] Filter mouse-up event
a382e939b8fd36e93737b73f0f0a5c44c4f48d21 2018-12-12 11:38:12 +0100 Niklaus Giger [9664] Set branch to 3.7
e9ce3e1208a4e21db2104544969f5503b347aa37 2018-12-12 10:53:49 +0100 Niklaus Giger [9664] Use fau.de as mirror for download.eclipse.org
183 commits between origin/3.6 (2018.06.21) and origin/3.7 (2018.12.11)
-----------------------------------------------------------------------
number changes by authors are
76: Marco Descher
45: Niklaus Giger
39: thomashu
22: Txomin Astrain
1: thomas
--------------------------------------------------------------------------
-----------------------------------------------------------------------
719bfabfda483cc58d00661791e79f917520af03 2018-12-11 11:39:36 +0100 Txomin Astrain [14491] Translation #12 (#281)
2c9728469bf711c486a5710d46d5271445a4be6e 2018-12-11 10:41:27 +0100 thomashu [14581] added docx4j logback config
052212c1d9daff65aece12169148656c6fecc9eb 2018-12-11 09:48:33 +0100 Niklaus Giger [14645] Fix für Verrechnungs-Toolbar
974c884439945468f054f126a97370700588f82b 2018-12-10 12:30:14 +0100 Niklaus Giger [14645] Fix opening EPHA URL (just) once
b9a9222bcbd278638e2736217819542e370a37a7 2018-12-07 22:57:23 +0100 Niklaus Giger Merge pull request #282 from jamda/f14491
3e9f122c5ee6d0045d5e8eaedef2f90ba150d2f9 2018-12-07 22:50:17 +0100 Niklaus Giger [14491] Simplyfy ImporterHost explanation
c45d3a9b785052816a0345c5a3b3616939deeada 2018-12-07 18:30:52 +0100 Txomin Astrain [14491] View Rechnungskorrektur name change
8f79cd623cc399259daf4c109da9dd89354f8f96 2018-12-07 11:07:04 +0100 Niklaus Giger [16465] Add preference to suppress interaction check
cca5b1d1c6540f36aa0c36bb9c4da7546c7a5de3 2018-11-20 15:51:10 +0100 Niklaus Giger [14645] Better handling of epha URL
94be91ba31ed3744815eb5dfd4639153d1eff405 2018-11-20 14:12:34 +0100 Niklaus Giger [14645] Use ProgressMonitorDialog to not block Elexis
09345a43c75b60f2bfb85aa5ee2831b0e6633571 2018-11-17 08:48:25 +0100 Niklaus Giger [14645] Textanpassung, wenn keine Interaktion bekannt
36c0dcce97156c407755bd6e30f39a3e58446f1f 2018-11-16 17:35:12 +0100 Niklaus Giger [14645] Refactored InteractionLink and add it to FixMedi and medication list
e84b7c069dbe13c55e1174114472109de1d16709 2018-11-14 15:34:14 +0100 Niklaus Giger [14645] Add default messages.properties
903c98390ade31ba7b19f40e1cac7e62a932391d 2018-11-14 14:45:20 +0100 Niklaus Giger [14645] Handle download/opening errors
564675534bcb587465ca3b4690ae704b01c4de91 2018-11-14 13:00:16 +0100 Niklaus Giger [14645] Handle download/loading matrix.csv
747cb2bc85b7f8b619e6108f8a149f25cdca7b64 2018-11-01 17:50:18 +0100 Niklaus Giger [14645] Add opencsv to MANIFEST.MF
171930a946c9dba6277f2d58341c382fc29f1027 2018-11-01 17:44:43 +0100 Niklaus Giger [14645] Show interactions from epha in VerrechnungsDisplay
d8c27bb474dc3c84c9fdb8bd6bcb2af652b410ed 2018-12-07 10:14:42 +0100 Txomin Astrain [14713] Added I18n to DailyOrderDialog patch (#280)
876055f7640b2b48c56cb39573319f1ae86e50dc 2018-12-06 14:41:09 +0100 thomashu [10665] fixed HL7 import for v26 OUL_R24 messages
bec642463dc6ae2585cd59759af374f2777a36b1 2018-12-06 14:10:22 +0100 Marco Descher [4209] Do not show patient reminders on printing multiple bills
abc4f72021f3b933525bbadda9701c2f1112690e 2018-12-06 12:57:06 +0100 Marco Descher [14713] Provide mandator filter for DailyOrderDialog - clean syso
4aac729ed11a2e6009c20a5908ab41e3c12622c7 2018-12-06 12:54:37 +0100 Marco Descher [14713] Provide mandator filter for DailyOrderDialog
cb584d3eb2b55782da19d7f1ebfc2c079a99bd79 2018-12-04 15:16:55 +0100 Niklaus Giger [9093] Update changelog
547e83645c60d71ba3fe22c99399bce3cbc9b9dc 2018-12-04 13:25:39 +0100 thomas [11331] added agenda font config per user
3a628d4e0152e880f53b7065b76e7bda87340e2c 2018-12-03 13:39:28 +0100 Marco Descher [14630] Store selected responsibles for reminder
3d543cf316b8b85b15299cf906ed810877ddc920 2018-12-03 12:40:12 +0100 Marco Descher [5310] Eigenleistung support description search and secondary order
......
......@@ -16,10 +16,12 @@
source 'https://rubygems.org'
gem 'activesupport'
gem 'rubyzip', '~> 1.2.1'
gem 'xml-simple'
gem 'eclipse-plugin', '~> 0.4'
gem 'elexis-wiki-interface', '>= 0.5.4'
gem 'oga'
gem 'rugged'
gem 'trollop'
gem 'optimist'
gem 'pry'
GEM
remote: https://rubygems.org/
specs:
ansi (1.5.0)
ast (2.3.0)
domain_name (0.5.20170404)
unf (>= 0.0.5, < 1.0.0)
eclipse-plugin (0.4.1)
nokogiri
rubyzip (~> 1.2.1)
elexis-wiki-interface (0.5.4)
eclipse-plugin (>= 0.1)
mediawiki-gateway
mediawiki_api
rubyzip (~> 1.2.1)
unicode
faraday (0.13.1)
multipart-post (>= 1.2, < 3)
faraday-cookie_jar (0.0.6)
faraday (>= 0.7.4)
http-cookie (~> 1.0.0)
faraday_middleware (0.12.2)
faraday (>= 0.7.4, < 1.0)
http-cookie (1.0.3)
domain_name (~> 0.5)
mediawiki-gateway (1.1.0)
rest-client (~> 1.7)
mediawiki_api (0.7.1)
faraday (~> 0.9, >= 0.9.0)
faraday-cookie_jar (~> 0.0, >= 0.0.6)
faraday_middleware (~> 0.10, >= 0.10.0)
mime-types (2.99.3)
mini_portile2 (2.3.0)
multipart-post (2.0.0)
netrc (0.11.0)
nokogiri (1.8.2)
mini_portile2 (~> 2.3.0)
oga (2.13)
ast
ruby-ll (~> 2.1)
rest-client (1.8.0)
http-cookie (>= 1.0.2, < 2.0)
mime-types (>= 1.16, < 3.0)
netrc (~> 0.7)
ruby-ll (2.1.2)
ansi
ast
rubyzip (1.2.1)
rugged (0.26.0)
trollop (2.1.2)
unf (0.1.4)
unf_ext
unf_ext (0.0.7.4)
unicode (0.4.4.4)
xml-simple (1.1.5)
PLATFORMS
ruby
DEPENDENCIES
eclipse-plugin (~> 0.4)
elexis-wiki-interface (>= 0.5.4)
oga
rubyzip (~> 1.2.1)
rugged
trollop
xml-simple
BUNDLED WITH
1.16.1
......@@ -372,6 +372,12 @@
id="ch.elexis.core.ui.views.rechnung.InvoiceCorrectionView"
name="Rechnungskorrektur (beta)">
</view>
<view
class="ch.elexis.core.ui.views.ReminderListsView"
icon="platform:/plugin/ch.elexis.core.ui.icons/icons/16x16/bell__exclamation.png"
id="ch.elexis.core.ui.views.reminderlistsview"
name="Pendenzen (beta)">
</view>
</extension>
<extension
point="org.eclipse.ui.perspectives">
......@@ -420,6 +426,12 @@
id="ch.elexis.core.application.perspectives.StockManagementPerspective"
name="%elexis.stockManagementPerspective">
</perspective>
<perspective
class="ch.elexis.core.application.perspectives.BBSPerspective"
icon="platform:/plugin/ch.elexis.core.ui.icons/icons/16x16/tafel.jpg"
id="ch.elexis.SchwarzesBrettV1.0"
name="%elexis.bbsView">
</perspective>
</extension>
<extension
id="ElexisApp"
......@@ -458,7 +470,7 @@
icon="rechnung_perspective"
name="%sidebar.bills"/>
<Perspektive
ID="ch.elexis.SchwarzesBrett"
ID="ch.elexis.SchwarzesBrettV1.0"
icon="bbs_perspective"
name="%sidebar.bbs"/>
<Perspektive
......
......@@ -12,6 +12,7 @@
package ch.elexis.core.application.advisors;
import static ch.elexis.admin.AccessControlDefaults.AC_SHOWVIEW;
import static ch.elexis.core.ui.actions.GlobalActions.perspectiveMenu;
import static ch.elexis.core.ui.actions.GlobalActions.resetPerspectiveAction;
......@@ -22,26 +23,32 @@ import java.util.List;
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.ActionContributionItem;
import org.eclipse.jface.action.GroupMarker;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.action.IContributionItem;
import org.eclipse.jface.action.ICoolBarManager;
import org.eclipse.jface.action.IMenuListener;
import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.action.MenuManager;
import org.eclipse.jface.action.Separator;
import org.eclipse.jface.action.ToolBarManager;
import org.eclipse.ui.IPerspectiveDescriptor;
import org.eclipse.ui.IWorkbenchActionConstants;
import org.eclipse.ui.IWorkbenchCommandConstants;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.actions.ContributionItemFactory;
import org.eclipse.ui.application.ActionBarAdvisor;
import org.eclipse.ui.application.IActionBarConfigurer;
import ch.elexis.admin.AccessControlDefaults;
import ch.elexis.core.constants.Preferences;
import ch.elexis.core.data.activator.CoreHub;
import ch.elexis.core.data.util.Extensions;
import ch.elexis.core.ui.Hub;
import ch.elexis.core.ui.actions.GlobalActions;
import ch.elexis.core.ui.actions.RestrictedAction;
import ch.elexis.core.ui.constants.ExtensionPointConstantsUi;
import ch.rgw.tools.ExHandler;
import ch.rgw.tools.StringTool;
......@@ -116,20 +123,62 @@ public class ApplicationActionBarAdvisor extends ActionBarAdvisor {
}
private final IMenuListener reflectRightsListener = new IMenuListener() {
@Override
public void menuAboutToShow(IMenuManager manager){
IContributionItem[] items = manager.getItems();
for (IContributionItem iContributionItem : items) {
if(iContributionItem instanceof ActionContributionItem) {
ActionContributionItem aci = (ActionContributionItem) iContributionItem;
IAction action = aci.getAction();
if(action instanceof RestrictedAction) {
RestrictedAction ra = (RestrictedAction) aci.getAction();
ra.reflectRight();
continue;
}
String id = action.getActionDefinitionId();
if(id==null) {
continue;
}
switch (id) {
case IWorkbenchCommandConstants.FILE_EXIT:
action.setEnabled(CoreHub.acl.request(AccessControlDefaults.AC_EXIT));
break;
case IWorkbenchCommandConstants.WINDOW_NEW_WINDOW:
action.setEnabled(CoreHub.acl.request(AccessControlDefaults.AC_NEWWINDOW));
break;
case IWorkbenchCommandConstants.HELP_ABOUT:
action.setEnabled(CoreHub.acl.request(AccessControlDefaults.AC_ABOUT));
break;
case IWorkbenchCommandConstants.WINDOW_PREFERENCES:
action.setEnabled(CoreHub.acl.request(AccessControlDefaults.AC_PREFS));
break;
default:
break;
}
}
}
}
};
protected void fillMenuBar(IMenuManager menuBar){
fileMenu =
new MenuManager(Messages.ApplicationActionBarAdvisor_3,
IWorkbenchActionConstants.M_FILE);
fileMenu.addMenuListener(reflectRightsListener);
editMenu =
new MenuManager(Messages.ApplicationActionBarAdvisor_4,
IWorkbenchActionConstants.M_EDIT);
editMenu.addMenuListener(reflectRightsListener);
windowMenu =
new MenuManager(Messages.ApplicationActionBarAdvisor_5,
IWorkbenchActionConstants.M_WINDOW);
helpMenu =
new MenuManager(Messages.ApplicationActionBarAdvisor_6,
IWorkbenchActionConstants.M_HELP);
helpMenu.addMenuListener(reflectRightsListener);
menuBar.add(fileMenu);
menuBar.add(editMenu);
menuBar.add(windowMenu);
......@@ -151,6 +200,7 @@ public class ApplicationActionBarAdvisor extends ActionBarAdvisor {
editMenu.add(GlobalActions.copyAction);
editMenu.add(GlobalActions.cutAction);
editMenu.add(GlobalActions.pasteAction);
GlobalActions.perspectiveMenu =
new MenuManager(Messages.ApplicationActionBarAdvisor_7, "openPerspective"); //$NON-NLS-1$
......@@ -161,6 +211,18 @@ public class ApplicationActionBarAdvisor extends ActionBarAdvisor {
GlobalActions.viewList = ContributionItemFactory.VIEWS_SHORTLIST.create(window);
GlobalActions.viewMenu.add(GlobalActions.viewList);
windowMenu.add(GlobalActions.viewMenu);
windowMenu.addMenuListener(new IMenuListener() {
@Override
public void menuAboutToShow(IMenuManager manager){
IContributionItem[] items = manager.getItems();
for (IContributionItem iContributionItem : items) {
if( "viewsShortlist".equals(iContributionItem.getId())) {
iContributionItem.setVisible(CoreHub.acl.request(AC_SHOWVIEW));
}
}
}
});
/* helpMenu.add(testAction); */
helpMenu.add(GlobalActions.helpAction);
......
......@@ -12,7 +12,6 @@
package ch.elexis.core.application.perspectives;
import org.eclipse.swt.SWT;
import org.eclipse.ui.IPageLayout;
import org.eclipse.ui.IPerspectiveFactory;
......@@ -26,13 +25,14 @@ import ch.elexis.core.ui.views.BBSView;
*
*/
public class BBSPerspective implements IPerspectiveFactory {
public static final String ID = "ch.elexis.SchwarzesBrett"; //$NON-NLS-1$
public static final String ID = "ch.elexis.SchwarzesBrettV1.0"; //$NON-NLS-1$
public void createInitialLayout(IPageLayout layout){
String editorArea = layout.getEditorArea();
layout.setEditorAreaVisible(false);
layout.setFixed(true);
layout.addView(BBSView.ID, SWT.RIGHT, 0.9f, editorArea);
layout.addView(BBSView.ID, IPageLayout.RIGHT, 0.9f, editorArea);
}
......
ALTER TABLE BEHANDLUNGEN ADD billable CHAR(1) default '1';
ALTER TABLE BEHANDLUNGEN ADD Zeit CHAR(6) default '000000';
\ No newline at end of file
OPTIONAL:SET GLOBAL query_cache_type = OFF;
ALTER TABLE BEHANDLUNGEN ADD billable CHAR(1) default '1';
ALTER TABLE BEHANDLUNGEN ADD Zeit CHAR(6) default '000000';
\ No newline at end of file
......@@ -393,6 +393,52 @@ public class BillingUtil {
return items;
}
/**
* Sort the consultations by year.
*
* @param consultations
* @return
*/
public static Map<Integer, List<Konsultation>> getSortedByYear(
List<Konsultation> consultations){
Map<Integer, List<Konsultation>> ret = new HashMap<>();
TimeTool konsDate = new TimeTool();
for (Konsultation consultation : consultations) {
konsDate.set(consultation.getDatum());
Integer year = new Integer(konsDate.get(TimeTool.YEAR));
List<Konsultation> list = ret.get(year);
if (list == null) {
list = new ArrayList<>();
}
list.add(consultation);
ret.put(year, list);
}
return ret;
}
private static Integer[] splitBillYears = {
2018
};
public static boolean canBillYears(List<Integer> years){
for (Integer splitYear : splitBillYears) {
boolean aboveSplitYear = false;
boolean belowSplitYear = false;
for (Integer year : years) {
if (year >= splitYear) {
aboveSplitYear = true;
} else {
belowSplitYear = true;
}
// only above or below is allowed
if (aboveSplitYear && belowSplitYear) {
return false;
}
}
}
return true;
}
/**
* Copies the actual fall, merge the copied fall with changes, transfer cons, storno the old
* invoice
......
......@@ -442,8 +442,7 @@ public class DBUpdate {
// 3.6.1
FILE_LOCATED,
// 3.7.0
"ALTER TABLE BEHANDLUNGEN ADD billable CHAR(1) default '1';"+
"ALTER TABLE BEHANDLUNGEN ADD Zeit CHAR(6) default '000000';"
FILE_LOCATED
};
//@formatter:on
......
......@@ -182,6 +182,7 @@ public class DBConnection {
*/
public boolean connect(){
if (jdbcLink == null && dbDriver != null && dbConnectString != null && dbFlavor != null) {
applyMySqlTimeZoneWorkaround();
jdbcLink = new JdbcLink(dbDriver, dbConnectString, dbFlavor);
} else if (jdbcLink == null && dbConnectString != null && dbFlavor == null
&& dbDriver == null) {
......@@ -304,4 +305,20 @@ public class DBConnection {
public Connection getConnection(){
return jdbcLink.getConnection();
}
/**
* @since 3.7 due to mysql jdbc update a timezone problem may exist, see e.g.
* https://github.com/elexis/elexis-3-core/issues/273 - we fix this by
* adding this parameter if not yet included
*/
public void applyMySqlTimeZoneWorkaround() {
if (dbFlavor.equalsIgnoreCase("mysql") && !dbConnectString.contains("serverTimezone")) {
if (dbConnectString.contains("?")) {
dbConnectString += "&serverTimezone=Europe/Zurich";
} else {
dbConnectString += "?serverTimezone=Europe/Zurich";
}
logger.info("MySQL dbConnection string correction [{}]", dbConnectString);
}
}
}
......@@ -273,7 +273,7 @@ public class Fall extends PersistentObject implements IFall, ITransferable<FallD
*/
public @Nullable Kontakt getCostBearer(){
String costBearerId = get(FLD_KOSTENTRAEGER);
if (costBearerId.length() > 0) {
if (costBearerId != null && costBearerId.length() > 0) {
Kontakt costBearer = Kontakt.load(costBearerId);
if (costBearer.isAvailable()) {
return costBearer;
......
......@@ -407,13 +407,19 @@ public class Konsultation extends PersistentObject implements Comparable<Konsult
/**
* Das Behandlungsdatum setzen
*
* @param date
* Das Datum in folgendem Format dd.MM.yyyy
* @param force
* auch setzen, wenn Kons nicht änderbar
*
*
* @deprecated Use {@link #setDateTime(LocalDateTime, boolean)} instead.
*/
public void setDatum(String dat, boolean force){
LocalDateTime parse = LocalDateTime.parse(dat, dateFormatter);
setDateTime(parse, force);
@Deprecated
public void setDatum(String date, boolean force){
LocalDate localDate = LocalDate.parse(date, dateFormatter);
if(force || isEditable(true)) {
set(DATE, dateFormatter.format(localDate));
}
}
/**
......
......@@ -513,9 +513,13 @@ public class LabItem extends PersistentObject implements Comparable<LabItem>, IL
* Get a List of all LabItems from the database
*
* @return List of {@link LabItem}
* @since 3.7 use query with prefetch
*/
public static List<LabItem> getLabItems(){
Query<LabItem> qbe = new Query<LabItem>(LabItem.class);
Query<LabItem> qbe = new Query<>(LabItem.class, LABITEMS, false, new String[] {
LabItem.TITLE, LabItem.SHORTNAME, LabItem.LOINCCODE, LabItem.UNIT,
LabItem.REF_MALE, LabItem.REF_FEMALE_OR_TEXT, LabItem.GROUP, LabItem.PRIO
});
return qbe.execute();
}
......
......@@ -745,6 +745,14 @@ public class LabResult extends PersistentObject implements ILabResult {
// return getResult();
}
/**
* @deprecated date is used use observationtime
* @since 3.7
* @param pat
* @param date
* @param item
* @return
*/
public static LabResult getForDate(final Patient pat, final TimeTool date, final LabItem item){
Query<LabResult> qbe = new Query<LabResult>(LabResult.class);
qbe.add(ITEM_ID, Query.EQUALS, item.getId());
......@@ -757,6 +765,44 @@ public class LabResult extends PersistentObject implements ILabResult {
return null;
}
/**
* Gets a {@link LabResult} for observationTime timespan.
* @param pat
* @param fromObservationTime
* @param toObservationTime
* @param item
* @return
*/
public static LabResult getForObservationTime(final Patient pat, final TimeTool fromObservationTime, final TimeTool toObservationTime, final LabItem item){
Query<LabResult> qbe = new Query<LabResult>(LabResult.class);
qbe.add(ITEM_ID, Query.EQUALS, item.getId());
qbe.add(PATIENT_ID, Query.EQUALS, pat.getId());
if (fromObservationTime != null) {
fromObservationTime.set(TimeTool.HOUR_OF_DAY, 0);
fromObservationTime.set(TimeTool.MINUTE, 0);
fromObservationTime.set(TimeTool.SECOND, 0);
fromObservationTime.set(TimeTool.MILLISECOND, 0);
qbe.add(OBSERVATIONTIME, Query.GREATER_OR_EQUAL,
fromObservationTime.toString(TimeTool.TIMESTAMP));
}
if (toObservationTime != null) {
toObservationTime.set(TimeTool.HOUR_OF_DAY, 23);
toObservationTime.set(TimeTool.MINUTE, 59);
toObservationTime.set(TimeTool.SECOND, 59);
toObservationTime.set(TimeTool.MILLISECOND, 999);
qbe.add(OBSERVATIONTIME, Query.LESS_OR_EQUAL,
toObservationTime.toString(TimeTool.TIMESTAMP));
}
qbe.orderBy(true, OBSERVATIONTIME);
List<LabResult> res = qbe.execute();
if ((res != null) && (res.size() > 0)) {
return res.get(0);
}
return null;
}
/**
* add a LabResult to the list of unseen LabResults. We do not keep LabResults older than
* KEEP_UNSEEN_LAB_RESULTS days in this list.
......
......@@ -22,6 +22,7 @@ import java.time.LocalDateTime;
import java.time.temporal.ChronoUnit;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.EnumSet;
import java.util.List;
import java.util.Map;
......@@ -286,6 +287,17 @@ public class Patient extends Person {
*/
public Konsultation getLetzteKons(final boolean create){
return getKonsulationByDate(create, null);
}
/**
* Returns a {@link Konsultation} for a given date or the latest if date is null
* @param create
* @param konsDate
* @return
*/
public Konsultation getKonsulationByDate(boolean create, Date konsDate)
{
if (ElexisEventDispatcher.getSelectedMandator() == null) {
MessageEvent.fireError("Kein Mandant angemeldet", "Es ist kein Mandant angemeldet.");
return null;
......@@ -300,8 +312,9 @@ public class Patient extends Person {
}
}
// qbe.add("Datum", "=", new
// TimeTool().toString(TimeTool.DATE_COMPACT));
if (konsDate != null) {
qbe.add("Datum", "=", new TimeTool(konsDate).toString(TimeTool.DATE_COMPACT));
}
Fall[] faelle = getFaelle();
if ((faelle == null) || (faelle.length == 0)) {
......
......@@ -485,7 +485,17 @@ public abstract class PersistentObject implements IPersistentObject {
log.info("Gefundene Datenbankversion: " + vi.version());
if (vi.isOlder(CoreHub.DBVersion)) {
log.warn("Ältere Version der Datenbank gefunden ");
DBUpdate.doUpdate();
if (!DBUpdate.doUpdate()) {
String msg = String.format(
"Datenbank '%1s':\nUpdate auf '%2s' von '%3s' schlug fehlt.\nWollen Sie trotzdem fortsetzen?",
connection.getDBConnectString(), vi.version().toString(), CoreHub.DBVersion);
log.error(msg);
if (!cod.openQuestion("Datenbank update failed ", msg)) {
System.exit(8);
} else {
log.error("User continues with failed Elexis database update");
}
}
}
vi = new VersionInfo(CoreHub.globalCfg.get("ElexisVersion", "0.0.0"));
log.info("Verlangte Elexis-Version: " + vi.version());
......@@ -1016,7 +1026,7 @@ public abstract class PersistentObject implements IPersistentObject {
* @return true wenn es gelöscht ist
*/
public boolean isDeleted(){
return get("deleted").equals("1");
return get(FLD_DELETED).trim().equals(StringConstants.ONE);
}
/**
......@@ -2125,6 +2135,7 @@ public abstract class PersistentObject implements IPersistentObject {
String mapped = map(fields[i]);
if (mapped.startsWith("S:")) {
sql.append(mapped.substring(4));
dbConnection.getCache().remove(getKey(fields[i])); // clear cache
} else {
sql.append(mapped);
dbConnection.getCache().put(getKey(fields[i]), values[i], getCacheTime());
......@@ -2267,7 +2278,7 @@ public abstract class PersistentObject implements IPersistentObject {
* @param rs
* @return decoded string or null if decode was not possible
*/
private String decode(final String field, final ResultSet rs){
protected String decode(final String field, final ResultSet rs){
try {
String mapped = map(field);
......
......@@ -405,27 +405,34 @@ public class Rechnung extends PersistentObject {
* @since 3.3
*/
public List<Konsultation> stornoBill(final boolean reopen){
Money betrag = getBetrag();
new Zahlung(this, betrag, "Storno", null);
if (reopen == true) {
List<Konsultation> kons = new ArrayList<>();
Query<Konsultation> qbe = new Query<Konsultation>(Konsultation.class);
qbe.add(Konsultation.FLD_BILL_ID, Query.EQUALS, getId());
for (Konsultation k : qbe.execute()) {
k.set(Konsultation.FLD_BILL_ID, null);
kons.add(k);
}
/*
* getConnection().exec( "UPDATE BEHANDLUNGEN SET RECHNUNGSID=NULL WHERE RECHNUNGSID=" +
* getWrappedId());
*/
setStatus(RnStatus.STORNIERT);
return kons;
} else {
setStatus(RnStatus.ABGESCHRIEBEN);
return null;
InvoiceState invoiceState = InvoiceState.fromState(getStatus());
List<Konsultation> kons = null;
if (!InvoiceState.CANCELLED.equals(invoiceState)
&& !InvoiceState.DEPRECIATED.equals(invoiceState)) {
Money betrag = getBetrag();
new Zahlung(this, betrag, "Storno", null);
if (reopen) {
kons = removeBillFromKons();
setStatus(InvoiceState.CANCELLED.getState());
} else {
setStatus(InvoiceState.DEPRECIATED.getState());
}
} else if (reopen && InvoiceState.CANCELLED.equals(invoiceState)){
// if bill is canceled ensure that all kons are opened
kons = removeBillFromKons();
}
return kons;
}
private List<Konsultation> removeBillFromKons(){
List<Konsultation> kons = new ArrayList<>();
Query<Konsultation> qbe = new Query<Konsultation>(Konsultation.class);
qbe.add(Konsultation.FLD_BILL_ID, Query.EQUALS, getId());
for (Konsultation k : qbe.execute()) {
k.set(Konsultation.FLD_BILL_ID, null);
kons.add(k);
}
return kons;
}
/** Datum der Rechnung holen */
......@@ -1012,4 +1019,27 @@ public class Rechnung extends PersistentObject {
}
return false;
}
public static boolean isStorno(Rechnung rechnung){
InvoiceState invoiceState = rechnung.getInvoiceState();
return InvoiceState.CANCELLED.equals(invoiceState)
|| InvoiceState.DEPRECIATED.equals(invoiceState);
}
public static boolean hasStornoBeforeDate(Rechnung rechnung, TimeTool date){
boolean stornoSet = false;
TimeTool stornoDate = new TimeTool();
List<Zahlung> zahlungen = rechnung.getZahlungen();
for (Zahlung zahlung : zahlungen) {
if (zahlung.getBemerkung().equals("Storno")) {
stornoSet = true;
stornoDate.set(zahlung.getDatum());
break;
}
}
if (stornoSet && stornoDate.isBeforeOrEqual(date)) {
return true;
}
return false;
}
}
......@@ -401,9 +401,10 @@ public class Reminder extends PersistentObject implements Comparable<Reminder> {
return !Objects.equals(creatorId, contactId);
}
private static String PS_REMINDERS_RESPONSIBLE = "SELECT r.ID FROM " + TABLENAME
+ " r LEFT JOIN REMINDERS_RESPONSIBLE_LINK rrl ON (r.id = rrl.ReminderId) WHERE (rrl.ResponsibleID = ? OR r.Responsible = '"
+ ALL_RESPONSIBLE + "') AND r.deleted = '0'";
private static String PS_REMINDERS_RESPONSIBLE = "SELECT r.ID, r.SUBJECT, r.DateDue, r.IdentID, r.OriginID FROM "
+ TABLENAME
+ " r LEFT JOIN REMINDERS_RESPONSIBLE_LINK rrl ON (r.id = rrl.ReminderId) WHERE (rrl.ResponsibleID = ? OR r.Responsible = '"
+ ALL_RESPONSIBLE + "') AND r.deleted = '0'";
public static List<Reminder> findAllUserIsResponsibleFor(Anwender anwender,
boolean showOnlyDueReminders){
......@@ -427,6 +428,14 @@ public class Reminder extends PersistentObject implements Comparable<Reminder> {
ResultSet res = ps.executeQuery();
while (res.next()) {
Reminder reminder = Reminder.load(res.getString(1));
// cache pre-fetch
reminder.putInCache("subject", res.getString(2));
String decode = reminder.decode(Reminder.FLD_DUE, res);
reminder.putInCache("Due", decode);
reminder.putInCache("IdentId", res.getString(4));
reminder.putInCache("OriginId", res.getString(5));
reminder.setDBConnection(dbConnection);
ret.add(reminder);
}
......@@ -496,9 +505,10 @@ public class Reminder extends PersistentObject implements Comparable<Reminder> {
return qbe.execute();
}
private static String PS_REMINDERS_BASE = "SELECT r.ID FROM " + TABLENAME
+ " r LEFT JOIN REMINDERS_RESPONSIBLE_LINK rrl ON (r.id = rrl.ReminderId) WHERE (rrl.ResponsibleID = ? OR r.Responsible = '"
+ ALL_RESPONSIBLE + "') AND r.deleted = '0' AND r.Status != '3'";
private static String PS_REMINDERS_BASE = "SELECT r.ID, r.SUBJECT, r.DateDue, r.IdentID, r.OriginID FROM "
+ TABLENAME
+ " r LEFT JOIN REMINDERS_RESPONSIBLE_LINK rrl ON (r.id = rrl.ReminderId) WHERE (rrl.ResponsibleID = ? OR r.Responsible = '"
+ ALL_RESPONSIBLE + "') AND r.deleted = '0' AND r.Status != '3'";
/**
* Retrieve all reminders the given {@link Anwender} is responsible for. The select can be
......@@ -517,6 +527,12 @@ public class Reminder extends PersistentObject implements Comparable<Reminder> {
*/
public static List<Reminder> findOpenRemindersResponsibleFor(@NonNull Anwender anwender,
final boolean onlyDue, final Patient patient, final boolean onlyPopup){
return findOpenRemindersResponsibleFor(anwender, onlyDue, -1, patient, onlyPopup);
}
public static List<Reminder> findOpenRemindersResponsibleFor(@NonNull Anwender anwender,
final boolean onlyDue, final int dueDays, final Patient patient, final boolean onlyPopup){
if (anwender == null) {
anwender = CoreHub.actUser;
}
......@@ -526,7 +542,12 @@ public class Reminder extends PersistentObject implements Comparable<Reminder> {
// which resolve to multiple occurences of the same element, due to the left join
DBConnection dbConnection = getDefaultConnection();
StringBuilder query = new StringBuilder(PS_REMINDERS_BASE);
if (onlyDue) {
if (dueDays > 0) {
TimeTool dueDaysDate = new TimeTool();
dueDaysDate.addDays(dueDays);
query.append(" AND r.DateDue != '' AND r.DateDue <= "
+ JdbcLink.wrap(dueDaysDate.toString(TimeTool.DATE_COMPACT)));
} else if (onlyDue) {
query.append(" AND r.DateDue != '' AND r.DateDue <= "
+ JdbcLink.wrap(new TimeTool().toString(TimeTool.DATE_COMPACT)));
}
......@@ -541,6 +562,14 @@ public class Reminder extends PersistentObject implements Comparable<Reminder> {
ResultSet res = ps.executeQuery();
while (res.next()) {
Reminder reminder = Reminder.load(res.getString(1));
// cache pre-fetch
reminder.putInCache("subject", res.getString(2));
String decode = reminder.decode(Reminder.FLD_DUE, res);
reminder.putInCache("Due", decode);
reminder.putInCache("IdentId", res.getString(4));
reminder.putInCache("OriginID", res.getString(5));
reminder.setDBConnection(dbConnection);
if (onlyPopup
&& (reminder.getVisibility() != Visibility.POPUP_ON_PATIENT_SELECTION)) {
......
......@@ -55,48 +55,51 @@ public class FindingDataAccessor implements IDataAccess {
@Override
public List<Element> getList(){
FindingsTemplates findingsTemplates =
FindingsServiceHolder.findingsTemplateService.getFindingsTemplates("Standard Vorlagen");
List<String> parameters = new ArrayList<>();
EList<FindingsTemplate> findingsTemplates2 = findingsTemplates.getFindingsTemplates();
// sort
ECollections.sort(findingsTemplates2, new Comparator<FindingsTemplate>() {
if (FindingsServiceHolder.findingsTemplateService != null) {
FindingsTemplates findingsTemplates = FindingsServiceHolder.findingsTemplateService
.getFindingsTemplates("Standard Vorlagen");
@Override
public int compare(FindingsTemplate o1, FindingsTemplate o2){
if (o1 == null || o2 == null) {
return o1 != null ? 1 : -1;
List<String> parameters = new ArrayList<>();
EList<FindingsTemplate> findingsTemplates2 = findingsTemplates.getFindingsTemplates();
// sort
ECollections.sort(findingsTemplates2, new Comparator<FindingsTemplate>() {
@Override
public int compare(FindingsTemplate o1, FindingsTemplate o2){
if (o1 == null || o2 == null) {
return o1 != null ? 1 : -1;
}
return StringUtils.lowerCase(o1.getTitle())
.compareTo(StringUtils.lowerCase(o2.getTitle()));
}
return StringUtils.lowerCase(o1.getTitle())
.compareTo(StringUtils.lowerCase(o2.getTitle()));
}
});
for (FindingsTemplate findingTemplate : findingsTemplates2) {
if (findingTemplate.getInputData() instanceof InputDataGroupComponent
|| findingTemplate.getInputData() instanceof InputDataGroup) {
parameters.add(findingTemplate.getTitle());
}
}
List<Element> ret = new ArrayList<Element>(parameters.size());
for (String n : parameters) {
// placeholder for first finding
String placeholder = PREFIX_FIRST + n + SUFFIX;
String readableName = n + " - " + "Erster";
ret.add(createElement(readableName, placeholder));
// placeholder for last finding
placeholder = PREFIX_LAST + n + SUFFIX;
readableName = n + " - " + "Letzter";
ret.add(createElement(readableName, placeholder));
});
// placeholder for all findings
placeholder = PREFIX_ALL + n + SUFFIX;
readableName = n + " - " + "Alle";
ret.add(createElement(readableName, placeholder));
for (FindingsTemplate findingTemplate : findingsTemplates2) {
if (findingTemplate.getInputData() instanceof InputDataGroupComponent
|| findingTemplate.getInputData() instanceof InputDataGroup) {
parameters.add(findingTemplate.getTitle());
}
}
List<Element> ret = new ArrayList<Element>(parameters.size());
for (String n : parameters) {
// placeholder for first finding
String placeholder = PREFIX_FIRST + n + SUFFIX;
String readableName = n + " - " + "Erster";
ret.add(createElement(readableName, placeholder));
// placeholder for last finding
placeholder = PREFIX_LAST + n + SUFFIX;
readableName = n + " - " + "Letzter";
ret.add(createElement(readableName, placeholder));
// placeholder for all findings
placeholder = PREFIX_ALL + n + SUFFIX;
readableName = n + " - " + "Alle";
ret.add(createElement(readableName, placeholder));
}
return ret;
}
return ret;
return Collections.emptyList();
}
@Override
......
......@@ -92,8 +92,7 @@ public class ConditionComposite extends Composite {
codingComposite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
codingItem.setControl(codingComposite);
GridData folderGd = new GridData(GridData.FILL_HORIZONTAL);
folderGd.heightHint = 100;
GridData folderGd = new GridData(GridData.FILL_BOTH);
textOrCodingFolder.setLayoutData(folderGd);
notesComposite = new NoteListComposite(this, SWT.NONE);
......
......@@ -68,6 +68,7 @@ public class DiagnoseListComposite extends Composite {
private EventList<ICondition> dataList = new BasicEventList<>();
@SuppressWarnings("deprecation")
public DiagnoseListComposite(Composite parent, int style){
super(parent, style);
setLayout(new GridLayout(1, false));
......
......@@ -25,12 +25,14 @@ public class ConditionEditDialog extends TitleAreaDialog {
public ConditionEditDialog(ConditionCategory category, Shell parentShell){
super(parentShell);
this.category = category;
setShellStyle(SWT.DIALOG_TRIM | SWT.MODELESS | SWT.RESIZE);
}
public ConditionEditDialog(ICondition condition, Shell parentShell){
super(parentShell);
this.condition = Optional.of(condition);
this.category = condition.getCategory();
setShellStyle(SWT.DIALOG_TRIM | SWT.MODELESS | SWT.RESIZE);
}
@Override
......
......@@ -11,14 +11,14 @@ import ca.uhn.hl7v2.model.AbstractPrimitive;
import ca.uhn.hl7v2.model.DataTypeException;
import ca.uhn.hl7v2.model.Message;
import ca.uhn.hl7v2.model.Type;
import ca.uhn.hl7v2.model.v26.datatype.FT;
import ca.uhn.hl7v2.model.v26.group.ORU_R01_PATIENT;
import ca.uhn.hl7v2.model.v26.datatype.CWE;
import ca.uhn.hl7v2.model.v26.datatype.ED;
import ca.uhn.hl7v2.model.v26.datatype.FT;
import ca.uhn.hl7v2.model.v26.datatype.NM;
import ca.uhn.hl7v2.model.v26.datatype.ST;
import ca.uhn.hl7v2.model.v26.datatype.TX;
import ca.uhn.hl7v2.model.v26.group.ORU_R01_ORDER_OBSERVATION;
import ca.uhn.hl7v2.model.v26.group.ORU_R01_PATIENT;
import ca.uhn.hl7v2.model.v26.message.ORU_R01;
import ca.uhn.hl7v2.model.v26.segment.NTE;
import ca.uhn.hl7v2.model.v26.segment.OBR;
......@@ -259,6 +259,13 @@ public class HL7_ORU_R01 extends HL7Writer {
valueTX = ((TX) obx.getObx5_ObservationValue(0).getData()).getValue();
}
appendedTX += valueTX + "\n"; //$NON-NLS-1$
} else if (HL7Constants.OBX_VALUE_TYPE_FT.equals(valueType)) {
String valueFT = ""; //$NON-NLS-1$
Object value = obx.getObx5_ObservationValue(0).getData();
if (value instanceof FT) {
valueFT = ((FT) obx.getObx5_ObservationValue(0).getData()).getValue();
}
appendedTX += parseTextValue(valueFT) + "\n"; //$NON-NLS-1$
} else {
addError(MessageFormat.format("Value type {0} is not implemented!", //$NON-NLS-1$
valueType));
......@@ -285,6 +292,18 @@ public class HL7_ORU_R01 extends HL7Writer {
return observation;
}
public String parseTextValue(String value){
String text = value;
text = text.replaceAll("\\\\.br\\\\", "\n");
text = text.replaceAll("\\\\.BR\\\\", "\n");
// only return parsed value if it contains reasonable input
if (text != null && !text.isEmpty()) {
return text;
}
return value;
}
private String readPatientNotesAndComments(ORU_R01_PATIENT patient){
StringBuilder sb = new StringBuilder();
for (int i = 0; i < patient.getNTEReps(); i++) {
......
......@@ -136,9 +136,16 @@ public class ExcelWrapper {
} else if (types[i].equals(Double.class)) {
ret.add(Double.toString(cell.getNumericCellValue()));
break;
} else /* if(types[i].equals(String.class)) */{
} else if (types[i].equals(String.class)) {
double cv = cell.getNumericCellValue();
if( cv == (long) cv) {
ret.add(String.format("%d", (long) cv));
} else {
ret.add(String.format("%s", cv));
}
break;
} else {
double cv = cell.getNumericCellValue();
// String r=Double.toString(cv);
String r = NumberFormat.getNumberInstance().format(cv);
ret.add(r);
}
......
......@@ -47,6 +47,7 @@ import ch.rgw.tools.TimeTool;
public class HL7Parser {
private static final Logger logger = LoggerFactory.getLogger(HL7Parser.class);
public static final String CFG_IMPORT_ENCDATA = "hl7Parser/importencdata";
public static final String CFG_IMPORT_ENCDATA_CATEGORY = "hl7Parser/importencdataCategory";
private HL7PatientResolver patientResolver;
......
......@@ -2,9 +2,7 @@ package ch.elexis.core.importer.div.importers.multifile.strategy;
import java.io.File;
import org.slf4j.LoggerFactory;
import ch.rgw.tools.TimeTool;
import ch.elexis.core.utils.FileUtil;
public class FileImportStrategyUtil {
......@@ -15,40 +13,6 @@ public class FileImportStrategyUtil {
* @param file
*/
public static void moveAfterImport(boolean ok, File file){
File rootDir = file.getParentFile();
File subDir = null;
if (ok) {
subDir = getOrCreateSubdir(rootDir, "archive");
} else {
subDir = getOrCreateSubdir(rootDir, "error");
}
if (subDir != null) {
moveToDir(file, subDir);
}
}
private static void moveToDir(File file, File subDir){
File newFile = new File(subDir, file.getName());
if (newFile.exists()) {
// on multiple move to archive dir:
// first time use own filename
// n+ times use filename_timestamp
String fnwts = file.getName() + "_" + new TimeTool().toString(TimeTool.TIMESTAMP);
newFile = new File(subDir, fnwts);
}
if (!file.renameTo(newFile)) {
LoggerFactory.getLogger(FileImportStrategyUtil.class).error("Could not move file ["
+ file.getAbsolutePath() + "] to [" + newFile.getAbsolutePath() + "]");
}
}
private static File getOrCreateSubdir(File dir, String string){
File subDir = new File(dir, string);
if (!subDir.exists()) {
subDir.mkdir();
}
return subDir;
FileUtil.moveFileToParentDir(file, ok ? "archive" : "error");
}
}
......@@ -247,6 +247,7 @@ public class Messages extends NLS {
public static String RnActions_stornoActionTooltip;
public static String RnActions_sum;
public static String RnActions_transferMoneyCaption;
public static String RnActions_stornoActionNotPossibleText;
public static String RnContentProvider_collectInvoices;
public static String RnContentProvider_databseRequest;
public static String RnContentProvider_errorRetriveingBillds;
......@@ -958,6 +959,8 @@ public class Messages extends NLS {
public static String BriefAuswahlStressTestButtonText2;
public static String BriefAuswahlColumnDate;
public static String BriefAuswahlColumnTitle;
public static String DiagnosenDisplay_AddDiagnosis;
public static String DiagnosenDisplay_AddTextDiagnosis;
public static String DiagnosenDisplay_DiagnoseTarget;
public static String DiagnosenDisplay_Diagnoses;
public static String DiagnosenDisplay_ErrorStartingCodeSystem;
......@@ -1463,6 +1466,14 @@ public class Messages extends NLS {
public static String TextView_showMenu;
public static String TextView_showMenuBar;
public static String TextView_showToolbar;