Skip to content
Commits on Source (181)
# This workflow will build the Eclipse RCP application with Maven
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
name: Java CI with Maven
on:
push:
pull_request:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 8
uses: actions/setup-java@v1
with:
java-version: 8
- run: sudo apt-get install xvfb
- name: Cache local Maven repository
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Build with Maven
run: xvfb-run mvn -V clean verify -Dall-archs=true -Dtycho.localArtifacts=ignore
# Build script used by gitlab.medelexis.ch
variables:
ORIGIN_BRANCH: "master"
ORIGIN_BRANCH: "3.7"
stages:
- build
......@@ -11,7 +11,10 @@ build:
script:
- xvfb-run mvn clean verify -B -Pall-archs
- jo token="$WEBHOOK_TOKEN" info="elexis-3-core $CI_JOB_ID $ORIGIN_BRANCH $CI_COMMIT_REF_NAME $CI_COMMIT_SHA" binary=%$(find ch.elexis.core.p2site/target/ch.elexis.core.p2site*.zip) destDir=elexis/$CI_COMMIT_REF_NAME/p2/elexis-3-core | curl -k -H "Content-Type:application/json" -X POST -d @- $WEBHOOK_URL/deploy-zip
- for file in ch.elexis.core.p2site/target/products/*.zip; do jo token="$WEBHOOK_TOKEN" destFilename="${file##*/}" binary=%${file} destDir=elexis/$CI_COMMIT_REF_NAME/products/ | curl -k -H "Content-Type:application/json" -X POST -d @- $WEBHOOK_URL/deploy-file; done
- eval $(ssh-agent -s)
- ssh-add <(echo "$SSH_PRIVATE_KEY_ED25519_BASE64" | base64 -d)
- rsync -aiv --no-recursive -e ssh ch.elexis.core.p2site/target/products/* deploy@download.medelexis.ch:download.elexis.info/elexis/$CI_COMMIT_REF_NAME/products/
- rsync -aiv --delete -e ssh ch.elexis.core.p2site/target/repository/ deploy@download.medelexis.ch:download.elexis.info/elexis/$CI_COMMIT_REF_NAME/p2/elexis-3-core/
artifacts:
reports:
junit:
......
---
dist: xenial # we need xenial to have mysql 5.7
language: java
install: mvn -V -DskipTests=true -Dmaven.javadoc.skip=true -B validate
script: mvn -V --quiet clean verify -Dall-archs=true && find . -name "*.zip"
notifications:
email:
- niklaus.giger@member.fsf.org
jdk: openjdk8 # oraclejdk8 is no longer supported by travis-ci
cache:
directories:
- $HOME/.m2
addons:
postgresql: "9.6"
services:
- mysql
env:
global:
- PGPASSWORD=elexisTest
- JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-amd64
- PATH=$(echo "$PATH" | sed -e 's/:\/usr\/local\/lib\/jvm\/openjdk11\/bin//')
before_install:
- "export DISPLAY=:99.0"
- "sh -e /etc/init.d/xvfb start"
- java -version
# mysql fails currently with fist error in ch.elexis.core.data.tests
# testDatabaseUpdatedToRequiredVersion[mysql 5.1](ch.elexis.data.Test_DBInitialState) Time elapsed: 0.001 sec <<< ERROR!
# ch.rgw.tools.JdbcLinkSyntaxException: Fehler bei: INSERT INTO traces VALUES(1542366761342, 'travis-job-76cef79e-5c90-44d8-a68f-ab...', 'ut_user_h2', 'W globalCfg key [ElexisVersion] => value [3.7.0.qualifier]') (SQLState: 42S02)
- mysql -e 'SHOW VARIABLES LIKE "%case%";'
- echo "[mysqld]" | sudo tee /etc/mysql/mysql.conf.d/lowercase.cnf
- echo "lower_case_table_names = 1" | sudo tee --append /etc/mysql/mysql.conf.d/lowercase.cnf
- cat /etc/mysql/mysql.conf.d/lowercase.cnf
- sudo service mysql restart
- mysql --version
- mysql -e 'SHOW VARIABLES LIKE "%case%";'
- mysql -e 'SHOW VARIABLES LIKE "%version%";'
- mysql -e 'CREATE DATABASE unittests;'
- mysql -e "grant all on unittests.* to elexisTest@localhost identified by 'elexisTest';"
- psql --version
- psql -c "create user elexisTest with UNENCRYPTED password 'elexisTest';" -U postgres
- psql -c "create database unittests;" -U postgres
- psql -c "grant all privileges on database unittests to elexisTest;" -U postgres
# 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
......@@ -177,6 +177,7 @@
name="%elexis.articleSelectorView">
</view>
<view
allowMultiple="true"
category="ch.elexis.datenKategorie"
class="ch.elexis.core.ui.views.BestellBlatt"
icon="platform:/plugin/ch.elexis.core.ui.icons/icons/16x16/printer.png"
......@@ -372,6 +373,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 +427,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 +471,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);
......@@ -152,6 +201,7 @@ public class ApplicationActionBarAdvisor extends ActionBarAdvisor {
editMenu.add(GlobalActions.cutAction);
editMenu.add(GlobalActions.pasteAction);
GlobalActions.perspectiveMenu =
new MenuManager(Messages.ApplicationActionBarAdvisor_7, "openPerspective"); //$NON-NLS-1$
perspectiveMenu.add(resetPerspectiveAction);
......@@ -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
......@@ -38,6 +38,14 @@ public interface IRnOutputter {
*/
public static final String PROP_OUTPUT_METHOD = "OutputMethod";
public static final String PROP_OUTPUT_WITH_ESR = "OutputWithEsr";
public static final String PROP_OUTPUT_WITH_RECLAIM = "OutputWithReclaim";
public static final String PROP_OUTPUT_WITH_MAIL = "OutputWithMail";
public static final String PROP_OUTPUT_MODIFY_INVOICESTATE = "OutputModifyInvoiceState";
/**
* A short textual description for this output (as Label)
*/
......
......@@ -38,11 +38,14 @@ public class CodeElementServiceHolder {
IPersistentObject consultation = ElexisEventDispatcher.getSelected(Konsultation.class);
if (consultation != null) {
ret.put(ContextKeys.CONSULTATION, consultation);
ret.put(ContextKeys.COVERAGE, ((Konsultation) consultation).getFall());
}
if (ret.get(ContextKeys.COVERAGE) == null) {
IPersistentObject coverage = ElexisEventDispatcher.getSelected(Fall.class);
if (coverage != null) {
ret.put(ContextKeys.COVERAGE, coverage);
}
}
return ret;
}
......
......@@ -92,6 +92,14 @@ public class StockService implements IStockService {
}
if (se.getStock().isCommissioningSystem()) {
boolean suspendOutlay =
CoreHub.localCfg.get(Preferences.INVENTORY_MACHINE_SUSPEND_OUTLAY,
Preferences.INVENTORY_MACHINE_SUSPEND_OUTLAY_DEFAULT);
if (suspendOutlay) {
return Status.OK_STATUS;
}
int sellingUnit = article.getSellingUnit();
boolean isPartialUnitOutput =
(sellingUnit > 0 && sellingUnit < article.getPackageUnit());
......
......@@ -11,6 +11,7 @@ import org.osgi.service.component.annotations.ReferencePolicyOption;
import org.slf4j.LoggerFactory;
import ch.elexis.core.model.ICodeElement;
import ch.elexis.core.model.article.IArticle;
import ch.elexis.core.services.ICodeElementService;
import ch.elexis.core.services.ICodeElementServiceContribution;
......@@ -47,4 +48,24 @@ public class CodeElementService implements ICodeElementService {
}
return Optional.empty();
}
@Override
public Optional<IArticle> findArticleByGtin(String gtin){
// TODO select specific contributions
for (ICodeElementServiceContribution contribution : contributions.values()) {
Optional<ICodeElement> loadFromCode =
contribution.createFromCode(gtin, new HashMap<Object, Object>());
if (loadFromCode.isPresent()) {
if (loadFromCode.get() instanceof IArticle) {
return loadFromCode.map(IArticle.class::cast);
} else {
LoggerFactory.getLogger(getClass()).warn(
"Found article for gtin [{}] but is not castable to IArticle [{}]", gtin,
loadFromCode.get().getClass().getName());
}
}
}
return Optional.empty();
}
}
......@@ -100,9 +100,9 @@ public class LocalDocumentService implements ILocalDocumentService {
}
@Override
public void remove(Object documentSource){
public void remove(Object documentSource, boolean delete){
File file = managedFiles.get(documentSource);
if (file != null && file.exists()) {
if (delete && file != null && file.exists()) {
tryDelete(Paths.get(file.getAbsolutePath()));
}
removeManaged(documentSource);
......
......@@ -23,7 +23,6 @@ import ch.elexis.data.PersistentObject;
import ch.rgw.tools.Result;
import ch.rgw.tools.TimeTool;
@SuppressWarnings("deprecation")
public class AllDataAccessor implements IDataAccess {
private Element[] elements = {
......@@ -91,23 +90,23 @@ public class AllDataAccessor implements IDataAccess {
TimeTool date = new TimeTool();
for (Fall fall : patient.getFaelle()) {
sb.append("* Fall " + fall.getLabel() + "\n\n");
for (Konsultation kons : fall.getBehandlungen(true)) {
date.set(kons.getDatum());
sb.append(date.toString(TimeTool.DATE_GER));
sb.append("- " + date.toString(TimeTool.DATE_GER) + " - "
+ kons.getMandant().getLabel(false));
if (withFall) {
sb.append(" ");
sb.append(kons.getMandant().getLabel(false));
sb.append(" - ");
sb.append(fall.getBezeichnung());
sb.append(" ");
}
sb.append("\n"); //$NON-NLS-1$
Samdas samdas = new Samdas(kons.getEintrag().getHead());
sb.append(samdas.getRecordText());
sb.append("\n"); //$NON-NLS-1$
sb.append("\n\n"); //$NON-NLS-1$
}
}
......
......@@ -98,6 +98,28 @@ public class BillingUtil {
*
*/
public static IBillableCheck[] billableChecks = {
// Check already billed
new IBillableCheck() {
@Override
public boolean isBillable(Konsultation konsultation, Result<Konsultation> result){
boolean fail = konsultation.getRechnung() != null
&& !Rechnung.isStorno(konsultation.getRechnung());
if (fail) {
result.add(SEVERITY.ERROR, 1, getDescription(), konsultation, false);
}
return !fail;
}
@Override
public String getId(){
return "alreadyBilled";
}
@Override
public String getDescription(){
return "Behandlung ist bereits verrechnet.";
}
},
// Check for zero sales.
new IBillableCheck() {
@Override
......@@ -393,6 +415,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
......
......@@ -33,8 +33,7 @@ public class BriefExternUtil {
*/
public static boolean isExternFile(){
if (CoreHub.globalCfg.get(Preferences.P_TEXT_EXTERN_FILE, false)) {
boolean ret = isValidExternPath(
CoreHub.globalCfg.get(Preferences.P_TEXT_EXTERN_FILE_PATH, null), true);
boolean ret = isValidExternPath(getExternFilePath(), true);
if (!ret) {
ElexisEventDispatcher.getInstance()
.fireMessageEvent(new MessageEvent(MessageType.WARN, "Brief Extern",
......@@ -52,7 +51,7 @@ public class BriefExternUtil {
* @return Brief or empty if no such file is found
*/
public static Optional<File> getExternFile(Brief brief){
String path = CoreHub.globalCfg.get(Preferences.P_TEXT_EXTERN_FILE_PATH, null);
String path = getExternFilePath();
if (isValidExternPath(path, true)) {
File dir = new File(path);
StringBuilder sb = new StringBuilder();
......@@ -83,7 +82,7 @@ public class BriefExternUtil {
* @return
*/
public static Optional<File> createExternFile(Brief brief){
String path = CoreHub.globalCfg.get(Preferences.P_TEXT_EXTERN_FILE_PATH, null);
String path = getExternFilePath();
if (isValidExternPath(path, true)) {
File dir = new File(path);
Person patient = brief.getPatient();
......@@ -112,6 +111,21 @@ public class BriefExternUtil {
return Optional.empty();
}
public static String getExternFilePath(){
return getAsExternFilePath(
CoreHub.globalCfg.get(Preferences.P_TEXT_EXTERN_FILE_PATH, null));
}
public static String getAsExternFilePath(String path){
if (path != null && path.contains("[home]")) {
path = path.replace("[home]", CoreHub.getWritableUserDir().getAbsolutePath());
LoggerFactory.getLogger(BriefExternUtil.class)
.warn("Replaced [home] -> [" + CoreHub.getWritableUserDir().getAbsolutePath()
+ "] in extern file path result is [" + path + "]");
}
return path;
}
private static String evaluateExtension(String input){
String ext = MimeTool.getExtension(input);
if (StringUtils.isEmpty(ext)) {
......
......@@ -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
......