Commit fe24708c authored by Thomas Huster's avatar Thomas Huster
Browse files

Merge remote-tracking branch 'origin/master' into f11106

Conflicts:
	bundles/ch.elexis.core.ui.medication/src/ch/elexis/core/ui/medication/views/MedicationComposite.java
	bundles/ch.elexis.core.ui.medication/src/ch/elexis/core/ui/medication/views/MedicationViewHelper.java
	bundles/ch.elexis.core.ui/src/ch/elexis/core/ui/views/controls/StickerComposite.java
	features/ch.elexis.core.application.feature/feature.xml
parents d71ccfe8 92de6f3f
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -250,6 +250,17 @@ public class Artikel extends VerrechenbarAdapter implements IArticle {
		set(FLD_EAN, ean);
	}
	
	public boolean isVaccination(){
		String atcCode = getATC_code();
		if (atcCode != null && atcCode.length() > 4) {
			if (atcCode.toUpperCase().startsWith("J07")
				&& !atcCode.toUpperCase().startsWith("J07AX")) {
				return true;
			}
		}
		return false;
	}
	
	public String getATC_code(){
		String ATC_code = get(FLD_ATC_CODE);
		return ATC_code;
+1 −2
Original line number Diff line number Diff line
@@ -114,8 +114,7 @@ public class Konsultation extends PersistentObject implements Comparable<Konsult
					adjusters.add((IVerrechenbarAdjuster) o);
				}
			} catch (CoreException e) {
				// just log the failed instantiation
				ExHandler.handle(e);
				log.warn("{} [{}]", e.getMessage(), elem.toString());
			}
		}
	}
+16 −7
Original line number Diff line number Diff line
package ch.elexis.data;

import java.sql.PreparedStatement;
import java.sql.SQLException;

import org.apache.commons.lang.StringUtils;
import org.slf4j.LoggerFactory;

import ch.elexis.core.data.events.ElexisEventDispatcher;
import ch.rgw.tools.JdbcLink;
import ch.rgw.tools.JdbcLink.Stm;
import ch.rgw.tools.net.NetTool;

/**
@@ -32,14 +35,20 @@ public class Trace {
		String _action = (StringUtils.isEmpty(action)) ? "" : action;
		
		JdbcLink connection = PersistentObject.getConnection();
		Stm statement = connection.getStatement();
		
		String insertStatement = "INSERT INTO " + TABLENAME + " VALUES(?, ?, ?, ?)";
		
		PreparedStatement statement = connection.getPreparedStatement(insertStatement);
		try {
			statement.exec("INSERT INTO " + TABLENAME + " VALUES("
				+ Long.toString(System.currentTimeMillis()) + ", "
				+ connection.wrapFlavored(_workstation) + ", " + connection.wrapFlavored(_username)
				+ ", " + connection.wrapFlavored(_action) + ")");
			statement.setString(1, Long.toString(System.currentTimeMillis()));
			statement.setString(2, _workstation);
			statement.setString(3, _username);
			statement.setString(4, _action);
			statement.execute();
		} catch (SQLException e) {
			LoggerFactory.getLogger(Trace.class).error("Catched this - FIX IT", e);
		} finally {
			connection.releaseStatement(statement);
			connection.releasePreparedStatement(statement);
		}
	}
	
+11 −0
Original line number Diff line number Diff line
@@ -333,4 +333,15 @@ public class TypedArticle extends AbstractIdDeleteModelAdapter<ch.elexis.core.jp
	public String getLabel(){
		return getName();
	}

	@Override
	public boolean isVaccination() {
		String atcCode = getAtcCode();
		if (atcCode != null && atcCode.length() > 4) {
			if (atcCode.toUpperCase().startsWith("J07") && !atcCode.toUpperCase().startsWith("J07AX")) {
				return true;
			}
		}
		return false;
	}
}
+4 −4
Original line number Diff line number Diff line
@@ -1020,10 +1020,6 @@ public class MedicationComposite extends Composite
			this.parentShell = parentShell;
		}
		
		private boolean isVaccination(IArticle article){
			return article.getAtcCode().startsWith("J07");
		}
		
		@Override
		public void dropped(List<Object> list, DropTargetEvent e){
			for (Object object : list) {
@@ -1056,6 +1052,10 @@ public class MedicationComposite extends Composite
			}
		}
		
		private boolean isVaccination(IArticle article){
			return article.isVaccination();
		}
		
		@Override
		public boolean accept(List<Object> list){
			for (Object object : list) {
Loading