...
 
Commits (31)
FROM openjdk:8-jre
MAINTAINER MEDEVIT <office@medevit.at>
ARG branch=master
ARG branch="1.5"
RUN adduser --disabled-password --gecos "" --home /elexis elexis && \
mkdir /es-prog && \
......
......@@ -65,10 +65,10 @@ public class IntegrationPostHandler {
StringBuilder sbBody = new StringBuilder();
switch (logLevel.levelInt) {
case Level.ERROR_INT:
sbBody.append(":exclamation:");
sbBody.append(":exclamation: ");
break;
case Level.WARN_INT:
sbBody.append(":warning:");
sbBody.append(":warning: ");
default:
break;
}
......
......@@ -11,7 +11,8 @@ Require-Bundle: org.eclipse.equinox.ds;bundle-version="1.4.200",
org.eclipse.persistence.asm;bundle-version="5.0.1",
com.mysql.jdbc;bundle-version="5.1.21",
org.h2;bundle-version="1.3.170",
org.postgresql;bundle-version="9.2.0"
org.postgresql;bundle-version="9.2.0",
org.apache.commons.lang3;bundle-version="3.3.2"
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Eclipse-BundleShape: dir
Meta-Persistence: META-INF/persistence.xml
......
......@@ -10,6 +10,7 @@
<class>info.elexis.server.core.connector.elexis.jpa.model.annotated.converter.InvoiceStateConverter</class>
<class>info.elexis.server.core.connector.elexis.jpa.model.annotated.converter.LocalDateConverter</class>
<class>info.elexis.server.core.connector.elexis.jpa.model.annotated.converter.LocalDateTimeConverter</class>
<class>info.elexis.server.core.connector.elexis.jpa.model.annotated.converter.PathologicDescriptionConverter</class>
<class>info.elexis.server.core.connector.elexis.jpa.model.annotated.converter.PriorityConverter</class>
<class>info.elexis.server.core.connector.elexis.jpa.model.annotated.converter.ProcessStatusConverter</class>
<class>info.elexis.server.core.connector.elexis.jpa.model.annotated.converter.TypeConverter</class>
......@@ -29,6 +30,7 @@
<class>info.elexis.server.core.connector.elexis.jpa.model.annotated.Kontakt</class>
<class>info.elexis.server.core.connector.elexis.jpa.model.annotated.KontaktAdressJoint</class>
<class>info.elexis.server.core.connector.elexis.jpa.model.annotated.LabOrder</class>
<class>info.elexis.server.core.connector.elexis.jpa.model.annotated.LabMapping</class>
<class>info.elexis.server.core.connector.elexis.jpa.model.annotated.LabItem</class>
<class>info.elexis.server.core.connector.elexis.jpa.model.annotated.LabResult</class>
<class>info.elexis.server.core.connector.elexis.jpa.model.annotated.Labor2009Tarif</class>
......
package info.elexis.server.core.connector.elexis.jpa.model.annotated;
import info.elexis.server.core.connector.elexis.jpa.model.annotated.Kontakt;
import info.elexis.server.core.connector.elexis.jpa.model.annotated.LabItem;
import javax.annotation.Generated;
import javax.persistence.metamodel.SingularAttribute;
import javax.persistence.metamodel.StaticMetamodel;
@Generated(value="EclipseLink-2.7.0.v20160725-rNA")
@StaticMetamodel(LabMapping.class)
public class LabMapping_ {
public static volatile SingularAttribute<LabMapping, Boolean> charge;
public static volatile SingularAttribute<LabMapping, String> itemname;
public static volatile SingularAttribute<LabMapping, Kontakt> origin;
public static volatile SingularAttribute<LabMapping, LabItem> labItem;
}
\ No newline at end of file
package info.elexis.server.core.connector.elexis.jpa.model.annotated;
import ch.elexis.core.types.PathologicDescription;
import info.elexis.server.core.connector.elexis.jpa.model.annotated.Kontakt;
import info.elexis.server.core.connector.elexis.jpa.model.annotated.LabItem;
import java.time.LocalDate;
......@@ -16,16 +17,16 @@ public class LabResult_ {
public static volatile SingularAttribute<LabResult, String> refMale;
public static volatile SingularAttribute<LabResult, LabItem> item;
public static volatile SingularAttribute<LabResult, LocalDateTime> transmissiontime;
public static volatile SingularAttribute<LabResult, String> origin;
public static volatile SingularAttribute<LabResult, Kontakt> origin;
public static volatile SingularAttribute<LabResult, Integer> flags;
public static volatile SingularAttribute<LabResult, String> zeit;
public static volatile SingularAttribute<LabResult, String> result;
public static volatile SingularAttribute<LabResult, String> unit;
public static volatile SingularAttribute<LabResult, String> originId;
public static volatile SingularAttribute<LabResult, Kontakt> patient;
public static volatile SingularAttribute<LabResult, LocalDateTime> analysetime;
public static volatile SingularAttribute<LabResult, LocalDateTime> observationtime;
public static volatile SingularAttribute<LabResult, String> comment;
public static volatile SingularAttribute<LabResult, PathologicDescription> pathologicDescription;
public static volatile SingularAttribute<LabResult, String> refFemale;
}
\ No newline at end of file
......@@ -9,13 +9,11 @@ public class POHelper {
private static Logger log = LoggerFactory.getLogger(POHelper.class);
/**
* return a numeric field making sure the call will not fail on illegal
* values
* return a numeric field making sure the call will not fail on illegal values
*
* @param in
* name of the field
* @return the value of the field as integer or 0 if it was null or not
* nomeric.
* @return the value of the field as integer or 0 if it was null or not nomeric.
*/
public static int checkZero(final Object in) {
if (StringTool.isNothing(in)) {
......@@ -26,8 +24,28 @@ public class POHelper {
// String at this
// point
} catch (NumberFormatException ex) {
log.warn("Error parsing number: " + ex.getMessage());
log.warn("Error parsing number [{}], returning 0. ", in);
return 0;
}
}
/**
* return a numeric field making sure the call will not fail on illegal values
*
* @param in
* name of the field
* @return the value of the field as double or 0.0 if it was null or not a
* Double.
*/
public static double checkZeroDouble(final String in) {
if (StringTool.isNothing(in)) {
return 0.0;
}
try {
return Double.parseDouble(in.trim());
} catch (NumberFormatException ex) {
log.warn("Error parsing number [{}], returning 0.0. ", in);
return 0.0;
}
}
}
......@@ -55,7 +55,7 @@ public class LabItem extends AbstractDBObjectIdDeleted implements ILabItem {
private String loinccode;
@Convert("booleanStringConverter")
private boolean visible;
private boolean visible = true;
@Convert(value = "IntegerStringConverter")
private int digits;
......
package info.elexis.server.core.connector.elexis.jpa.model.annotated;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import org.eclipse.persistence.annotations.Convert;
@Entity
@Table(name = "AT_MEDEVIT_ELEXIS_LABMAP")
public class LabMapping extends AbstractDBObjectIdDeleted {
@Column(length = 255)
protected String itemname;
@OneToOne
@JoinColumn(name = "originid")
protected Kontakt origin;
@OneToOne
@JoinColumn(name = "labitemid")
protected LabItem labItem;
@Column(length = 1)
@Convert("booleanStringConverter")
protected boolean charge;
public String getItemname() {
return itemname;
}
public void setItemname(String itemname) {
this.itemname = itemname;
}
public Kontakt getOrigin() {
return origin;
}
public void setOrigin(Kontakt origin) {
this.origin = origin;
}
public LabItem getLabItem() {
return labItem;
}
public void setLabItem(LabItem labItem) {
this.labItem = labItem;
}
public boolean isCharge() {
return charge;
}
public void setCharge(boolean charge) {
this.charge = charge;
}
}
......@@ -13,6 +13,9 @@ import javax.persistence.Transient;
import org.eclipse.persistence.annotations.Convert;
import ch.elexis.core.types.PathologicDescription;
import ch.elexis.core.types.PathologicDescription.Description;
@Entity
@Table(name = "laborwerte")
public class LabResult extends AbstractDBObjectIdDeletedExtInfo {
......@@ -36,10 +39,7 @@ public class LabResult extends AbstractDBObjectIdDeletedExtInfo {
@Convert(value = "IntegerStringConverter")
private int flags;
@Column(length = 30)
private String origin;
@Lob
@Column(name = "Kommentar")
private String comment;
......@@ -62,8 +62,12 @@ public class LabResult extends AbstractDBObjectIdDeletedExtInfo {
@Column(length = 255)
private String refFemale;
@Column(length = 25)
private String originId;
@OneToOne
@JoinColumn(name = "originId")
private Kontakt origin;
@Column(length = 128, name = "pathoDesc")
private PathologicDescription pathologicDescription = new PathologicDescription(Description.UNKNOWN);
@Transient
public boolean isFlagged(final int flag) {
......@@ -94,13 +98,7 @@ public class LabResult extends AbstractDBObjectIdDeletedExtInfo {
this.item = item;
}
public String getOrigin() {
return origin;
}
public void setOrigin(String origin) {
this.origin = origin;
}
public String getComment() {
return comment;
......@@ -134,12 +132,12 @@ public class LabResult extends AbstractDBObjectIdDeletedExtInfo {
this.refFemale = refFemale;
}
public String getOriginId() {
return originId;
public Kontakt getOrigin() {
return origin;
}
public void setOriginId(String originId) {
this.originId = originId;
public void setOrigin(Kontakt origin) {
this.origin = origin;
}
public String getResult() {
......@@ -182,6 +180,14 @@ public class LabResult extends AbstractDBObjectIdDeletedExtInfo {
this.flags = flags;
}
public PathologicDescription getPathologicDescription() {
return pathologicDescription;
}
public void setPathologicDescription(PathologicDescription pathologicDescription) {
this.pathologicDescription = pathologicDescription;
}
@Override
public String getLabel() {
StringBuilder sb = new StringBuilder();
......
......@@ -14,12 +14,15 @@ import javax.persistence.Transient;
import ch.elexis.core.model.ICodeElement;
import ch.rgw.tools.TimeTool;
import info.elexis.server.core.connector.elexis.jpa.POHelper;
@Entity
@Table(name = "TARMED")
public class TarmedLeistung extends AbstractDBObjectIdDeleted implements ICodeElement {
public static final String CODESYSTEM_NAME = "Tarmed";
private static String MANDANT_TYPE_EXTINFO_KEY = "ch.elexis.data.tarmed.mandant.type";
public enum MandantType {
SPECIALIST, PRACTITIONER
......@@ -70,6 +73,14 @@ public class TarmedLeistung extends AbstractDBObjectIdDeleted implements ICodeEl
@JoinColumn(name = "id", insertable = false, updatable = false)
private TarmedExtension extension;
/**
* Get the AL value of the {@link TarmedLeistung}.<br>
* <b>IMPORTANT:</b> No scaling according to the Dignität of the {@link Mandant}
* is performed. Use {@link TarmedLeistung#getAL(Mandant)} for AL value with
* scaling included.
*
* @return
*/
@Transient
public int getAL() {
if (extension != null) {
......@@ -85,6 +96,44 @@ public class TarmedLeistung extends AbstractDBObjectIdDeleted implements ICodeEl
}
return 0;
}
/**
* Get the AL scaling value to be used when billing this {@link TarmedLeistung} for the provided
* {@link Mandant}.
*
* @param mandant
* @return
*/
@Transient
public double getALScaling(Kontakt mandant){
double scaling = 100;
if (mandant != null) {
MandantType type = getMandantType(mandant);
if (type == MandantType.PRACTITIONER) {
double alScaling = POHelper.checkZeroDouble(getExtension().getLimits().get(EXT_FLD_F_AL_R));
if (alScaling > 0.1) {
scaling *= alScaling;
}
}
}
return scaling;
}
/**
* Get the {@link MandantType} of the {@link Mandant}. If not found the default value is
* {@link MandantType#SPECIALIST}.
*
* @param mandant
* @return
*/
@Transient
public static MandantType getMandantType(Kontakt mandant){
Object typeObj = mandant.getExtInfoAsString(MANDANT_TYPE_EXTINFO_KEY);
if (typeObj instanceof String) {
return MandantType.valueOf((String) typeObj);
}
return MandantType.SPECIALIST;
}
@Transient
public int getTL() {
......@@ -98,7 +147,6 @@ public class TarmedLeistung extends AbstractDBObjectIdDeleted implements ICodeEl
/* ignore */
}
}
}
return 0;
}
......
package info.elexis.server.core.connector.elexis.jpa.model.annotated.converter;
import javax.persistence.AttributeConverter;
import javax.persistence.Converter;
import org.apache.commons.lang3.StringUtils;
import ch.elexis.core.types.PathologicDescription;
import ch.elexis.core.types.PathologicDescription.Description;
@Converter(autoApply = true)
public class PathologicDescriptionConverter implements AttributeConverter<PathologicDescription, String> {
@Override
public String convertToDatabaseColumn(PathologicDescription attribute) {
if (attribute != null) {
return attribute.toString();
}
return null;
}
@Override
public PathologicDescription convertToEntityAttribute(String dbData) {
if (StringUtils.isEmpty(dbData)) {
return new PathologicDescription(Description.UNKNOWN);
}
return PathologicDescription.of(dbData);
}
}
......@@ -18,9 +18,12 @@ import info.elexis.server.core.connector.elexis.services.VerrechnetService;
public class VerrechenbarTarmedLeistung implements IBillable<TarmedLeistung> {
private final TarmedLeistung tarmedLeistung;
private final TarmedOptifier tarmedOptifier;
private String siteToBill;
public VerrechenbarTarmedLeistung(TarmedLeistung tarmedLeistung) {
this.tarmedLeistung = tarmedLeistung;
this.tarmedOptifier = new TarmedOptifier();
}
@Override
......@@ -54,12 +57,16 @@ public class VerrechenbarTarmedLeistung implements IBillable<TarmedLeistung> {
@Override
public IStatus add(Behandlung kons, Kontakt userContact, Kontakt mandatorContact, float count) {
return new TarmedOptifier().add(this, kons, userContact, mandatorContact, count);
tarmedOptifier.clearContext();
if (getSiteToBill() != null) {
tarmedOptifier.putContext(TarmedOptifier.SIDE, getSiteToBill());
}
return tarmedOptifier.add(this, kons, userContact, mandatorContact, count);
}
@Override
public IStatus removeFromConsultation(Verrechnet vr, Kontakt mandatorContact) {
return new TarmedOptifier().remove(vr);
return tarmedOptifier.remove(vr);
}
@Override
......@@ -94,5 +101,13 @@ public class VerrechenbarTarmedLeistung implements IBillable<TarmedLeistung> {
public VatInfo getVatInfo() {
return VatInfo.VAT_CH_ISTREATMENT;
}
public String getSiteToBill() {
return siteToBill;
}
public void setSiteToBill(String siteToBill) {
this.siteToBill = siteToBill;
}
}
......@@ -41,5 +41,22 @@ public interface IOptifier<T extends AbstractDBObjectIdDeleted> {
*/
public IStatus remove(Verrechnet code);
/**
* Add an object to the context of the {@link IOptifier} implementation. If a object for the
* provided key already exists, the value is replaced.
*
* @param key
* @param value
*/
default void putContext(String key, Object value){
// default do nothing implement in subclass
}
/**
* Add an implementation specific context object. If a object for the provided key already
* exists, the value is replaced.
*/
default void clearContext(){
// default do nothing implement in subclass
}
}
package info.elexis.server.core.connector.elexis.billable.tarmed;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.temporal.ChronoUnit;
import java.util.ArrayList;
import java.util.List;
......@@ -15,18 +17,18 @@ public class TarmedLeistungAge {
private long toDays;
private String fromText;
private String toText;
private TarmedLeistungAge(String datesString, String ageString){
private TarmedLeistungAge(String datesString, String ageString, LocalDateTime consDate) {
parseDatesString(datesString);
parseAgeString(ageString);
parseAgeString(ageString, consDate);
}
private void parseAgeString(String ageString){
private void parseAgeString(String ageString, LocalDateTime consDate) {
String[] parts = ageString.split("\\|");
if (parts.length == 5) {
fromDays = getAsDays(parts[0], parts[1], parts[4], false);
fromDays = getAsDays(parts[0], parts[1], parts[4], consDate, false);
fromText = getAsText(parts[0], parts[1], parts[4]);
toDays = getAsDays(parts[2], parts[3], parts[4], true);
toDays = getAsDays(parts[2], parts[3], parts[4], consDate, true);
toText = getAsText(parts[2], parts[3], parts[4]);
} else {
fromDays = -1;
......@@ -53,17 +55,20 @@ public class TarmedLeistungAge {
}
return sb.toString();
}
private long getAsDays(String age, String tolerance, String unit, boolean positiveTolerance){
private long getAsDays(String age, String tolerance, String unit, LocalDateTime consDate,
boolean positiveTolerance) {
if (age.equals("-1")) {
return -1;
}
try {
int ageInt = Integer.parseInt(age);
if (unit.equals("26")) {
ageInt *= 365;
LocalDateTime beforeCons = consDate.minus(ageInt, ChronoUnit.YEARS);
ageInt = (int) ChronoUnit.DAYS.between(beforeCons, consDate);
} else if (unit.equals("23")) {
ageInt *= 30;
LocalDateTime beforeCons = consDate.minus(ageInt, ChronoUnit.MONTHS);
ageInt = (int) ChronoUnit.DAYS.between(beforeCons, consDate);
}
int toleanceInt = Integer.parseInt(tolerance);
if (positiveTolerance) {
......@@ -97,17 +102,18 @@ public class TarmedLeistungAge {
/**
* Create {@link TarmedLeistungAge} objects for the age String.
*
* @param limits
* @param ages
* @param consDate
* @return
*/
public static List<TarmedLeistungAge> of(String ages){
public static List<TarmedLeistungAge> of(String ages, LocalDateTime consDate) {
List<TarmedLeistungAge> ret = new ArrayList<>();
if (ages != null && !ages.isEmpty()) {
String[] singleAge = ages.split(", ");
for (String string : singleAge) {
String[] validParts = isValidAgeString(string);
if (validParts != null && validParts.length == 2) {
ret.add(new TarmedLeistungAge(validParts[0], validParts[1]));
ret.add(new TarmedLeistungAge(validParts[0], validParts[1], consDate));
} else {
LoggerFactory.getLogger(TarmedLeistungAge.class)
.warn("Could not parse age string [" + string + "]");
......
......@@ -36,6 +36,8 @@ public class TarmedLimitation {
private int electronicBilling;
private boolean skip = false;
private TarmedLeistung tarmedLeistung;
private TarmedGroup tarmedGroup;
......@@ -345,14 +347,21 @@ public class TarmedLimitation {
private LocalDate getDuringStartDate(Behandlung kons) {
LocalDate konsDate = new TimeTool(kons.getDatum()).toLocalDate();
LocalDate ret = null;
if (limitationUnit == LimitationUnit.WEEK) {
return konsDate.minus(limitationAmount, ChronoUnit.WEEKS);
ret = konsDate.minus(limitationAmount, ChronoUnit.WEEKS);
} else if (limitationUnit == LimitationUnit.MONTH) {
return konsDate.minus(limitationAmount, ChronoUnit.MONTHS);
ret = konsDate.minus(limitationAmount, ChronoUnit.MONTHS);
} else if (limitationUnit == LimitationUnit.YEAR) {
return konsDate.minus(limitationAmount, ChronoUnit.YEARS);
ret = konsDate.minus(limitationAmount, ChronoUnit.YEARS);
}
if (tarmedLeistung != null && ret != null) {
LocalDate leistungDate = tarmedLeistung.getGueltigVon();
if (ret.isBefore(leistungDate)) {
ret = leistungDate;
}
}
return null;
return ret;
}
@SuppressWarnings("rawtypes")
......@@ -395,6 +404,9 @@ public class TarmedLimitation {
}
private boolean shouldSkipTest(Kontakt mandatorContact) {
if (skip) {
return skip;
}
return shouldSkipElectronicBilling(mandatorContact);
}
......@@ -415,4 +427,8 @@ public class TarmedLimitation {
public int getAmount() {
return amount;
}
public void setSkip(boolean value) {
this.skip = true;
}
}
package info.elexis.server.core.connector.elexis.services;
import java.time.LocalDate;
import java.util.HashSet;
import java.util.List;
import java.util.Optional;
import java.util.Set;
import java.util.stream.Collectors;
import org.eclipse.core.runtime.IStatus;
......@@ -10,6 +12,8 @@ import org.eclipse.core.runtime.MultiStatus;
import org.eclipse.core.runtime.Status;
import ch.elexis.core.model.InvoiceState;
import ch.rgw.tools.VersionedResource;
import ch.rgw.tools.VersionedResource.ResourceItem;
import info.elexis.server.core.connector.elexis.billable.IBillable;
import info.elexis.server.core.connector.elexis.billable.VerrechenbarArtikel;
import info.elexis.server.core.connector.elexis.billable.VerrechenbarArtikelstammItem;
......@@ -208,4 +212,24 @@ public class BehandlungService extends PersistenceService {
BehandlungService.save(cons);
}
/**
* Retrieve all user id strings for all versioned-entries of a consultation.
* These entries may or may not be resolvable via
* {@link UserService#load(String)}
*
* @param cons
* @return
*/
public static Set<String> getAllCareProviderIdsForConsultation(Behandlung cons) {
Set<String> userIdString = new HashSet<>();
VersionedResource vr = cons.getEintrag();
int version = 0;
ResourceItem item;
while ((item = vr.getVersion(version)) != null) {
userIdString.add(item.remark);
version++;
}
return userIdString;
}
}
......@@ -29,6 +29,8 @@ import info.elexis.server.core.connector.elexis.jpa.model.annotated.AbstractDBOb
import info.elexis.server.core.connector.elexis.jpa.model.annotated.Kontakt;
import info.elexis.server.core.connector.elexis.jpa.model.annotated.LabItem;
import info.elexis.server.core.connector.elexis.jpa.model.annotated.LabItem_;
import info.elexis.server.core.connector.elexis.jpa.model.annotated.LabMapping;
import info.elexis.server.core.connector.elexis.jpa.model.annotated.LabMapping_;
import info.elexis.server.core.connector.elexis.jpa.model.annotated.LabResult;
import info.elexis.server.core.connector.elexis.jpa.model.annotated.LabResult_;
import info.elexis.server.core.connector.elexis.map.PersistentObjectAttributeMapping;
......@@ -41,11 +43,11 @@ public class LabItemService extends PersistenceService {
private static final Pattern varPattern = Pattern.compile(TextContainerConstants.MATCH_TEMPLATE);
public static class Builder extends AbstractBuilder<LabItem> {
public Builder(String code, String title, IContact laboratory, String refMale, String refFemale, String unit,
public Builder(String code, String name, IContact laboratory, String refMale, String refFemale, String unit,
LabItemTyp type, String group, int seq) {
object = new LabItem();
object.setCode(code);
object.setName(title);
object.setName(name);
object.setLabor((Kontakt) laboratory);
object.setReferenceMale(refMale);
object.setReferenceFemale(refFemale);
......@@ -53,6 +55,7 @@ public class LabItemService extends PersistenceService {
object.setTyp(type);
object.setGroup(group);
object.setPriority(Integer.toString(seq));
object.setVisible(true);
}
}
......@@ -176,4 +179,46 @@ public class LabItemService extends PersistenceService {
return results;
}
public static LabMapping findLabMappingByContactAndItemName(Kontakt origin, String itemName) {
JPAQuery<LabMapping> qbe = new JPAQuery<LabMapping>(LabMapping.class);
qbe.add(LabMapping_.origin, QUERY.EQUALS, origin);
qbe.add(LabMapping_.itemname, QUERY.EQUALS, itemName);
List<LabMapping> res = qbe.execute();
if (res.isEmpty()) {
return null;
} else {
if (res.size() > 1) {
throw new IllegalArgumentException(
String.format("Found more then 1 mapping for origin id [%s] - [%s]", origin.getId(), itemName)); //$NON-NLS-1$
}
return res.get(0);
}
}
public static String findItemNameForLabItemByOrigin(LabItem labItem, Kontakt origin) {
JPAQuery<LabMapping> qbe = new JPAQuery<LabMapping>(LabMapping.class);
qbe.add(LabMapping_.origin, QUERY.EQUALS, origin);
qbe.add(LabMapping_.labItem, QUERY.EQUALS, labItem);
List<LabMapping> res = qbe.execute();
if (res.size() == 1) {
return res.get(0).getItemname();
}
return null;
}
public static void addLabMapping(LabItem labItem, Kontakt origin, String itemName) {
LabMapping existing = findLabMappingByContactAndItemName(origin, itemName);
if (existing != null) {
throw new IllegalArgumentException(
String.format("Mapping for origin id [%s] - [%s] already exists can not create multiple instances.", //$NON-NLS-1$
origin.getId(), itemName));
}
LabMapping labMapping = new LabMapping();
labMapping.setItemname(itemName);
labMapping.setOrigin(origin);
labMapping.setLabItem(labItem);
PersistenceService.save(labMapping);
}
}
......@@ -26,14 +26,16 @@ public class LabOrderService extends PersistenceService {
return query.executeGetSingleResult();
}
public static List<LabOrder> findAllLabOrdersInSameOrderIdGroup(LabOrder labOrder) {
JPAQuery<LabOrder> query = new JPAQuery<LabOrder>(LabOrder.class);
query.add(LabOrder_.orderid, QUERY.EQUALS, labOrder.getOrderid());
return query.execute();
}
/**
* Find all {@link LabOrder} that are equal to the provided {@link LabOrder#getOrderid()} and
* {@link LabOrder#getPatient()}
*
* @param labOrder
* @return
*/
public static List<LabOrder> findAllLabOrdersInSameOrderIdGroupWithResults(LabOrder labOrder) {
JPAQuery<LabOrder> query = new JPAQuery<LabOrder>(LabOrder.class);
query.add(LabOrder_.patient, QUERY.EQUALS, labOrder.getPatient());
query.add(LabOrder_.orderid, QUERY.EQUALS, labOrder.getOrderid());
query.add(LabOrder_.result, QUERY.NOT_EQUALS, null);
return query.execute();
......
......@@ -139,7 +139,7 @@ public class LockService implements ILockService {
return LockResponse.OK(lockInfo);
} else {
log.warn("Could not acquire locksLock in #acquireLock (request not handled), denying lock",
log.warn("Could not acquire locksLock in #acquireLock (request not handled), denying lock [{}]", lockInfo,
new Throwable("Diagnosis"));
return LockResponse.DENIED(lockInfo);
}
......@@ -192,8 +192,7 @@ public class LockService implements ILockService {
}
}
log.warn("Denying lock release for [{}]",
lockInfo.getElementStoreToString() + "#" + lockInfo.getUser() + "@" + lockInfo.getSystemUuid());
log.warn("Denying lock release for lockInfo [{}] -> lie [{}]", lockInfo, lie);
return LockResponse.DENIED(lockInfo);
} else {
log.warn("Could not acquire locksLock in #releaseLock (request not handled), denying lock",
......
package info.elexis.server.core.connector.elexis.services;
import java.util.List;
import java.util.Optional;
import org.slf4j.LoggerFactory;
import ch.rgw.tools.TimeTool;
import info.elexis.server.core.connector.elexis.billable.tarmed.TarmedKumulationType;
......@@ -12,35 +15,44 @@ public class TarmedExclusion {
private String slaveCode;
private TarmedKumulationType slaveType;
private boolean validSide;
public TarmedExclusion(TarmedKumulation kumulation) {
slaveCode = kumulation.getSlaveCode();
slaveType = TarmedKumulationType.ofArt(kumulation.getSlaveArt());
validSide = "1".equals(kumulation.getValidSide());
}
public boolean isMatching(TarmedLeistung tarmedLeistung, TimeTool date) {
if (slaveType == TarmedKumulationType.CHAPTER) {
return isMatchingChapter(tarmedLeistung);
} else if (slaveType == TarmedKumulationType.SERVICE) {
return slaveCode.equals(tarmedLeistung.getCode());
return isMatchingService(tarmedLeistung);
} else if (slaveType == TarmedKumulationType.GROUP) {
List<String> groups = tarmedLeistung.getServiceGroups(date);
return groups.contains(slaveCode);
}
return false;
}
private boolean isMatchingService(TarmedLeistung tarmedLeistung){
return slaveCode.equals(tarmedLeistung.getCode());
}
private boolean isMatchingChapter(TarmedLeistung tarmedLeistung) {
if (slaveCode.equals(tarmedLeistung.getCode())) {
return true;
} else {
String parentId = tarmedLeistung.getParent();
if (parentId != null && !parentId.equals("NIL")) {
TarmedLeistung parent = TarmedLeistungService.load(parentId).get();
return isMatchingChapter(parent);
} else {
return false;
Optional<TarmedLeistung> parent = TarmedLeistungService.load(parentId);
if (parent.isPresent()) {
return isMatchingChapter(parent.get());
} else {
LoggerFactory.getLogger(TarmedExclusion.class)
.error("Parent [{}] for TarmedLeistung [{}] not resolvable, returning false.", parentId, tarmedLeistung);
}
}
return false;
}
}
......@@ -50,6 +62,10 @@ public class TarmedExclusion {
}
return slaveCode.equals(tarmedGroup.getGroupName());
}
public boolean isValidSide(){
return validSide;
}
@Override
public String toString() {
......
......@@ -9,6 +9,8 @@ import java.util.Map;
import java.util.Optional;
import java.util.stream.Collectors;
import javax.persistence.EntityManager;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
......@@ -18,6 +20,9 @@ import info.elexis.server.core.connector.elexis.billable.VerrechenbarTarmedLeist
import info.elexis.server.core.connector.elexis.billable.tarmed.TarmedExclusive;
import info.elexis.server.core.connector.elexis.billable.tarmed.TarmedKumulationType;
import info.elexis.server.core.connector.elexis.billable.tarmed.TarmedLimitation;
import info.elexis.server.core.connector.elexis.billable.tarmed.TarmedLimitation.LimitationUnit;
import info.elexis.server.core.connector.elexis.internal.ElexisEntityManager;
import info.elexis.server.core.connector.elexis.jpa.POHelper;
import info.elexis.server.core.connector.elexis.jpa.model.annotated.Behandlung;
import info.elexis.server.core.connector.elexis.jpa.model.annotated.Kontakt;
import info.elexis.server.core.connector.elexis.jpa.model.annotated.TarmedDefinitionen;
......@@ -166,17 +171,22 @@ public class TarmedLeistungService extends PersistenceService {
* @param code
* @param date
* @param law
* @return
* @return
*/
public static Optional<TarmedLeistung> findFromCode(final String code, TimeTool date, String law) {
if (date == null) {
date = new TimeTool();
}
JPAQuery<TarmedLeistung> query = new JPAQuery<TarmedLeistung>(TarmedLeistung.class);
query.add(TarmedLeistung_.code_, QUERY.EQUALS, code);
if (law != null) {
query.add(TarmedLeistung_.law, QUERY.EQUALS, law.toLowerCase());
if (!isAvailableLaw(law)) {
query.add(TarmedLeistung_.law, QUERY.EQUALS, "");
query.or(TarmedLeistung_.law, QUERY.EQUALS, null);
} else {
query.add(TarmedLeistung_.law, QUERY.EQUALS, law.toUpperCase());
}
}
query.add(TarmedLeistung_.code_, QUERY.EQUALS, code);
List<TarmedLeistung> leistungen = query.execute();
for (TarmedLeistung tarmedLeistung : leistungen) {
TimeTool validFrom = new TimeTool(tarmedLeistung.getGueltigVon());
......@@ -188,6 +198,20 @@ public class TarmedLeistungService extends PersistenceService {
return Optional.empty();
}
private static List<String> availableLawsCache;
public static boolean isAvailableLaw(String law) {
if (availableLawsCache == null) {
availableLawsCache = getAvailableLaws();
}
for (String available : availableLawsCache) {
if (available.equalsIgnoreCase(law)) {
return true;
}
}
return false;
}
/**
*
* @param tarmedLeistung
......@@ -243,18 +267,12 @@ public class TarmedLeistungService extends PersistenceService {
* @return
*/
public static int getAL(TarmedLeistung tl, Kontakt mandator) {
double scaling = 100;
Map<String, String> ext = tl.getExtension().getLimits();
if (mandator != null) {
MandantType type = getMandantType(mandator);
if (type == MandantType.PRACTITIONER) {
double alScaling = ServiceUtil.checkZeroDouble(ext.get(TarmedLeistung.EXT_FLD_F_AL_R));
if (scaling > 0.1) {
scaling *= alScaling;
}
}
TarmedExtension extension = tl.getExtension();
if (extension != null) {
return (int) Math.round(POHelper.checkZeroDouble(extension.getLimits().get(TarmedLeistung.EXT_FLD_TP_AL))
* tl.getALScaling(mandator));
}
return (int) Math.round(ServiceUtil.checkZeroDouble(ext.get(TarmedLeistung.EXT_FLD_TP_AL)) * scaling);
return 0;
}
public static Optional<TarmedGroup> findTarmedGroup(String groupName, String law, TimeTool validFrom) {
......@@ -378,18 +396,33 @@ public class TarmedLeistungService extends PersistenceService {
}
public static List<TarmedLimitation> getLimitations(TarmedLeistung tarmedLeistung) {
String lim = (String) tarmedLeistung.getExtension().getLimits().get("limits"); //$NON-NLS-1$
TarmedExtension extension = tarmedLeistung.getExtension();
if (extension == null) {
return Collections.emptyList();
}
String lim = (String) extension.getLimits().get("limits"); //$NON-NLS-1$
if (lim != null && !lim.isEmpty()) {
List<TarmedLimitation> ret = new ArrayList<>();
String[] lines = lim.split("#"); //$NON-NLS-1$
for (String line : lines) {
ret.add(TarmedLimitation.of(line).setTarmedLeistung(tarmedLeistung));
}
fix9533(ret);
return ret;
}
return Collections.emptyList();
}
@SuppressWarnings("unchecked")
public static List<String> getAvailableLaws() {
EntityManager em = ElexisEntityManager.createEntityManager();
try {
return em.createNativeQuery("SELECT DISTINCT law FROM TARMED where ID <> 'Version';").getResultList();
} finally {
em.close();
}
}
public static String getSparteAsText(TarmedLeistung tl) {
JPAQuery<TarmedDefinitionen> query = new JPAQuery<>(TarmedDefinitionen.class);
query.add(TarmedDefinitionen_.spalte, QUERY.EQUALS, "SPARTE");
......@@ -401,4 +434,27 @@ public class TarmedLeistungService extends PersistenceService {
return "";
}
/**
* Method marks {@link LimitationUnit#COVERAGE} {@link TarmedLimitation} as skip
* if in combination with a {@link LimitationUnit#SESSION}. This is a WORKAROUND
* and should be REMOVED after reason is fixed.
*
* @param ret
*/
private static void fix9533(List<TarmedLimitation> ret) {
boolean sessionfound = false;
for (TarmedLimitation tarmedLimitation : ret) {
if (tarmedLimitation.getLimitationUnit() == LimitationUnit.SESSION) {
sessionfound = true;
break;
}
}
if (sessionfound) {
for (TarmedLimitation tarmedLimitation : ret) {
if (tarmedLimitation.getLimitationUnit() == LimitationUnit.COVERAGE) {
tarmedLimitation.setSkip(true);
}
}
}
}
}
......@@ -13,6 +13,7 @@ import org.slf4j.LoggerFactory;
import ch.elexis.core.constants.StringConstants;
import ch.elexis.core.model.Identifiable;
import ch.elexis.core.model.article.IArticle;
import ch.elexis.core.model.verrechnet.Constants;
import ch.elexis.core.status.ObjectStatus;
import ch.elexis.core.status.StatusUtil;
import ch.rgw.tools.Money;
......@@ -265,6 +266,14 @@ public class VerrechnetService extends PersistenceService {
}
return Optional.empty();
}
public static boolean isChangedPrice(Verrechnet verrechnet){
String value = verrechnet.getDetail("changedPrice");
if (value != null) {
return value.equalsIgnoreCase("true");
}
return false;
}
/**
* Get the AL points used to calculate the value of the {@link Verrechnet}. The
......@@ -276,6 +285,11 @@ public class VerrechnetService extends PersistenceService {
* @return
*/
public static int getAL(Verrechnet verrechnet) {
// if price was changed, use TP as AL
boolean changedPrice = VerrechnetService.isChangedPrice(verrechnet);
if (changedPrice) {
return verrechnet.getVk_tp();
}
String alString = (String) verrechnet.getDetail().get(Verrechnet.EXT_VERRRECHNET_AL);
if (alString != null) {
try {
......
properties.0.name = git-rev
properties.0.value = REPLACE_WITH_GIT_REV
properties.1.name = git-repo-url
properties.1.value = REPLACE_WITH_GIT_REPO_URL
\ No newline at end of file
properties.1.value = REPLACE_WITH_GIT_REPO_URL
# Set start level for gemini.jpa
requires.1.namespace = org.eclipse.equinox.p2.iu
requires.1.name = gemini.jpa.bundle.fragment
requires.1.range = 1.0.0
units.1.id = gemini.jpa.bundle.fragment
units.1.version = 1.0.0
units.1.singleton = true
units.1.provides.0.namespace = org.eclipse.equinox.p2.iu
units.1.provides.0.name = gemini.jpa.bundle.fragment
units.1.provides.0.version = 1.0.0
units.1.instructions.configure = setStartLevel(startLevel:2);markStarted(started: true);
units.1.hostRequirements.0.namespace = org.eclipse.equinox.p2.iu
units.1.hostRequirements.0.name = org.eclipse.gemini.jpa
units.1.hostRequirements.0.version = 0.0.0
units.1.instructions.install = installBundle(bundle:${artifact})
units.1.instructions.uninstall = uninstallBundle(bundle:${artifact})
# These settings do not seem to work if directly put into bundle p2.inf
# see https://bugs.eclipse.org/bugs/show_bug.cgi?id=253244
# Set start level for info.elexis.server.core.connector.elexis.datasource
requires.2.namespace = org.eclipse.equinox.p2.iu
requires.2.name = connector.elexis.datasource.bundle.fragment
requires.2.range = 1.0.0
units.2.id = connector.elexis.datasource.bundle.fragment
units.2.version = 1.0.0
units.2.singleton = true
units.2.provides.0.namespace = org.eclipse.equinox.p2.iu
units.2.provides.0.name = connector.elexis.datasource.bundle.fragment
units.2.provides.0.version = 1.0.0
units.2.instructions.configure = setStartLevel(startLevel:2);markStarted(started: true);
units.2.hostRequirements.0.namespace = org.eclipse.equinox.p2.iu
units.2.hostRequirements.0.name = info.elexis.server.core.connector.elexis.datasource
units.2.hostRequirements.0.version = 0.0.0
units.2.instructions.install = installBundle(bundle:${artifact})
units.2.instructions.uninstall = uninstallBundle(bundle:${artifact})
# Set start level for info.elexis.server.core.connector.elexis.jpa
requires.3.namespace = org.eclipse.equinox.p2.iu
requires.3.name = connector.elexis.jpa.bundle.fragment
requires.3.range = 1.0.0
units.3.id = connector.elexis.jpa.bundle.fragment
units.3.version = 1.0.0
units.3.singleton = true
units.3.provides.0.namespace = org.eclipse.equinox.p2.iu
units.3.provides.0.name = connector.elexis.jpa.bundle.fragment
units.3.provides.0.version = 1.0.0
units.3.instructions.configure = setStartLevel(startLevel:3);markStarted(started: true);
units.3.hostRequirements.0.namespace = org.eclipse.equinox.p2.iu
units.3.hostRequirements.0.name = info.elexis.server.core.connector.elexis.jpa
units.3.hostRequirements.0.version = 0.0.0
units.3.instructions.install = installBundle(bundle:${artifact})
units.3.instructions.uninstall = uninstallBundle(bundle:${artifact})
\ No newline at end of file
properties.0.name = git-rev
properties.0.value = REPLACE_WITH_GIT_REV
properties.1.name = git-repo-url
properties.1.value = REPLACE_WITH_GIT_REPO_URL
\ No newline at end of file
properties.1.value = REPLACE_WITH_GIT_REPO_URL
# Set start level for gemini.namining
requires.1.namespace = org.eclipse.equinox.p2.iu
requires.1.name = naming.bundle.fragment
requires.1.range = 1.0.0
units.1.id = naming.bundle.fragment
units.1.version = 1.0.0
units.1.singleton = true
units.1.provides.0.namespace = org.eclipse.equinox.p2.iu
units.1.provides.0.name = naming.bundle.fragment
units.1.provides.0.version = 1.0.0
units.1.instructions.configure = setStartLevel(startLevel:1);markStarted(started: true);
units.1.hostRequirements.0.namespace = org.eclipse.equinox.p2.iu
units.1.hostRequirements.0.name = org.eclipse.gemini.naming
units.1.hostRequirements.0.version = 0.0.0
units.1.instructions.install = installBundle(bundle:${artifact})
units.1.instructions.uninstall = uninstallBundle(bundle:${artifact})
\ No newline at end of file
......@@ -50,24 +50,24 @@
<plugin id="com.eclipsesource.jaxrs.provider.gson" autoStart="true" startLevel="0" />
<plugin id="com.eclipsesource.jaxrs.provider.security" autoStart="true" startLevel="0" />
<plugin id="com.eclipsesource.jaxrs.publisher" autoStart="true" startLevel="0" />
<plugin id="info.elexis.server.core.connector.elexis.datasource" autoStart="true" startLevel="2" />
<plugin id="info.elexis.server.core.connector.elexis.jpa" autoStart="true" startLevel="3" />
<plugin id="javax.persistence" autoStart="true" startLevel="1" />
<plugin id="org.eclipse.core.runtime" autoStart="true" startLevel="0" />
<plugin id="org.eclipse.jetty.osgi.boot" autoStart="true" startLevel="0" />
<plugin id="org.eclipse.jetty.osgi.httpservice" autoStart="true" startLevel="0" />
<plugin id="org.eclipse.osgi" autoStart="false" startLevel="0" />
<plugin id="org.eclipse.equinox.simpleconfigurator" autoStart="true" startLevel="1" />
<plugin id="javax.persistence" autoStart="true" startLevel="1" />
<plugin id="org.eclipse.equinox.common" autoStart="true" startLevel="2" />
<plugin id="org.eclipse.equinox.ds" autoStart="true" startLevel="1" />
<plugin id="org.eclipse.equinox.event" autoStart="true" startLevel="1" />
<plugin id="org.eclipse.gemini.naming" autoStart="true" startLevel="1" />
<plugin id="org.eclipse.equinox.common" autoStart="true" startLevel="2" />
<plugin id="org.eclipse.gemini.jpa" autoStart="true" startLevel="2" />
<plugin id="info.elexis.server.core.connector.elexis.datasource" autoStart="true" startLevel="2" />
<plugin id="info.elexis.server.core.connector.elexis.jpa" autoStart="true" startLevel="3" />
<plugin id="org.eclipse.equinox.frameworkadmin" autoStart="false" startLevel="5" />
<plugin id="org.eclipse.equinox.simpleconfigurator" autoStart="true" startLevel="1" />
<plugin id="org.eclipse.gemini.jpa" autoStart="true" startLevel="2" />
<plugin id="org.eclipse.gemini.naming" autoStart="true" startLevel="1" />
<plugin id="org.eclipse.jetty.osgi.boot" autoStart="true" startLevel="0" />
<plugin id="org.eclipse.jetty.osgi.httpservice" autoStart="true" startLevel="0" />
<plugin id="org.eclipse.osgi" autoStart="false" startLevel="0" />
</configurations>
<repositories>
<repository location="http://download.elexis.info/elexis-server/master/p2/elexis-server" enabled="true" />
<repository location="http://download.elexis.info/elexis-server/1.5/p2/elexis-server" enabled="true" />
</repositories>
<preferencesInfo>
......
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?pde?>
<!-- generated with https://github.com/mbarbero/fr.obeo.releng.targetplatform -->
<target name="Elexis-Server" sequenceNumber="1511189618">
<target name="Elexis-Server" sequenceNumber="1520940131">
<locations>
<location includeMode="slicer" includeAllPlatforms="true" includeSource="true" includeConfigurePhase="false" type="InstallableUnit">
<unit id="org.eclipse.equinox.sdk.feature.group" version="3.12.0.v20170209-1843"/>
......@@ -58,10 +58,10 @@
<unit id="com.eclipsesource.jaxrs.provider.moxy.feature.feature.group" version="2.2.0.201602281253"/>
<unit id="com.eclipsesource.jaxrs.provider.swagger.feature.feature.group" version="1.1.1.201602281253"/>
<unit id="com.eclipsesource.jaxrs.provider.multipart.feature.feature.group" version="2.2.0.201602281253"/>
<unit id="ch.rgw.utility" version="3.4.0.201711170932"/>
<unit id="ch.elexis.core" version="3.4.0.201711201348"/>
<unit id="ch.elexis.core.importer.div" version="3.2.0.201707030925"/>
<unit id="ch.elexis.core.hl7.v2x" version="3.2.0.201709080831"/>
<unit id="ch.rgw.utility" version="3.4.0.201803060630"/>
<unit id="ch.elexis.core" version="3.4.0.201803131013"/>
<unit id="ch.elexis.core.importer.div" version="3.2.0.201802151414"/>
<unit id="ch.elexis.core.hl7.v2x" version="3.2.0.201802151414"/>
<unit id="ch.elexis.core.findings" version="1.0.0.201711031036"/>
<unit id="ch.elexis.core.findings.util" version="1.0.0.201711030958"/>
<unit id="org.postgresql" version="9.2.0.1002-jdbc4"/>
......@@ -74,8 +74,8 @@
<unit id="ca.uhn.hapi.osgi-base" version="1.2.0"/>
<unit id="org.apache.poi" version="3.0.2.FINAL"/>
<unit id="org.beanshell.bsh" version="2.0.0.0b4"/>
<unit id="at.medevit.ch.artikelstamm" version="3.3.0.20170915-0846"/>
<unit id="ch.elexis.base.ch.ticode" version="3.2.0.20171115-1301"/>
<unit id="at.medevit.ch.artikelstamm" version="3.3.0.20180228-1635"/>
<unit id="ch.elexis.base.ch.ticode" version="3.2.0.20171123-0917"/>
<unit id="at.medevit.atc_codes" version="3.1.0.20160519-0702"/>
<unit id="org.tukaani.xz" version="1.5.0.v20170111-1717"/>
<unit id="osgi.enterprise" version="4.2.0.v201108120515"/>
......@@ -127,7 +127,7 @@
<unit id="org.unbescape" version="1.1.4.RELEASE"/>
<unit id="org.springframework.spring-web" version="4.3.8.RELEASE"/>
<unit id="com.eclipsesource.restfuse" version="1.10.0.201601141215"/>
<repository id="elexis-server" location="http://download.elexis.info/elexis-server/p2/master/target/"/>
<repository id="elexis-server" location="http://download.elexis.info/elexis-server/1.5/p2/target/"/>
</location>
</locations>
</target>
target "Elexis-Server" with source allEnvironments
location "http://download.elexis.info/elexis-server/p2/master/target/" elexis-server {
location "http://download.elexis.info/elexis-server/1.5/p2/target/" elexis-server {
org.eclipse.equinox.sdk.feature.group
org.eclipse.core.runtime.feature.feature.group
org.eclipse.emf.common.feature.group
......
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?pde?>
<!-- generated with https://github.com/mbarbero/fr.obeo.releng.targetplatform -->
<target name="Elexis-Server" sequenceNumber="1511430423">
<target name="Elexis-Server" sequenceNumber="1520936939">
<locations>
<location includeMode="slicer" includeAllPlatforms="true" includeSource="true" includeConfigurePhase="false" type="InstallableUnit">
<unit id="ch.rgw.utility" version="3.4.0.201711170932"/>
<unit id="ch.elexis.core" version="3.4.0.201711230916"/>
<unit id="ch.elexis.core.importer.div" version="3.2.0.201707030925"/>
<unit id="ch.elexis.core.hl7.v2x" version="3.2.0.201709080831"/>
<unit id="ch.rgw.utility" version="3.4.0.201803060630"/>
<unit id="ch.elexis.core" version="3.4.0.201803131013"/>
<unit id="ch.elexis.core.importer.div" version="3.2.0.201802151414"/>
<unit id="ch.elexis.core.hl7.v2x" version="3.2.0.201802151414"/>
<unit id="ch.elexis.core.findings" version="1.0.0.201711031036"/>
<unit id="ch.elexis.core.findings.util" version="1.0.0.201711030958"/>
<unit id="org.postgresql" version="9.2.0.1002-jdbc4"/>
......@@ -20,13 +20,13 @@
<unit id="ca.uhn.hapi.osgi-base" version="1.2.0"/>
<unit id="org.apache.poi" version="3.0.2.FINAL"/>
<unit id="org.beanshell.bsh" version="2.0.0.0b4"/>
<repository location="http://download.elexis.info/elexis/master/p2/elexis-3-core/"/>
<repository location="http://download.elexis.info/elexis/3.4/p2/elexis-3-core/"/>
</location>
<location includeMode="slicer" includeAllPlatforms="true" includeSource="true" includeConfigurePhase="false" type="InstallableUnit">
<unit id="ch.elexis.base.ch.ticode" version="3.2.0.20171123-0917"/>
<unit id="at.medevit.ch.artikelstamm" version="3.3.0.20170915-0846"/>
<unit id="at.medevit.ch.artikelstamm" version="3.3.0.20180228-1635"/>
<unit id="at.medevit.atc_codes" version="3.1.0.20160519-0702"/>
<repository location="http://download.elexis.info/elexis/master/p2/elexis-3-base/"/>
<repository location="http://download.elexis.info/elexis/3.4/p2/elexis-3-base/"/>
</location>
<location includeMode="slicer" includeAllPlatforms="true" includeSource="true" includeConfigurePhase="false" type="InstallableUnit">
<unit id="org.eclipse.equinox.sdk.feature.group" version="3.12.0.v20170209-1843"/>
......@@ -152,9 +152,9 @@
<unit id="ch.qos.logback.access" version="1.1.3"/>
<unit id="com.googlecode.json-simple" version="1.1.0"/>
<unit id="com.rabbitmq.client" version="3.0.4"/>
<unit id="com.fasterxml.jackson.core.jackson-core" version="2.8.4"/>
<unit id="com.fasterxml.jackson.core.jackson-databind" version="2.8.4"/>
<unit id="com.fasterxml.jackson.core.jackson-annotations" version="2.8.0"/>
<unit id="com.fasterxml.jackson.core.jackson-core" version="2.9.0.pr2"/>
<unit id="com.fasterxml.jackson.core.jackson-databind" version="2.9.0.pr2"/>
<unit id="com.fasterxml.jackson.core.jackson-annotations" version="2.9.0.pr2"/>
<unit id="hapi-fhir-osgi-core" version="2.4.0"/>
<unit id="org.thymeleaf" version="3.0.2.RELEASE"/>
<unit id="javassist" version="3.20.0.GA"/>
......
......@@ -3,7 +3,7 @@ target "Elexis-Server"
with source allEnvironments
// switch to appropriate Elexis branch on branching ES
location "http://download.elexis.info/elexis/master/p2/elexis-3-core/" {
location "http://download.elexis.info/elexis/3.4/p2/elexis-3-core/" {
ch.rgw.utility
ch.elexis.core
ch.elexis.core.importer.div
......@@ -23,7 +23,7 @@ location "http://download.elexis.info/elexis/master/p2/elexis-3-core/" {
}
// switch to appropriate Elexis branch on branching ES
location "http://download.elexis.info/elexis/master/p2/elexis-3-base/" {
location "http://download.elexis.info/elexis/3.4/p2/elexis-3-base/" {
ch.elexis.base.ch.ticode
at.medevit.ch.artikelstamm
at.medevit.atc_codes
......
......@@ -513,7 +513,8 @@ CREATE TABLE LABORWERTE(
reffemale VARCHAR(255),
OriginID VARCHAR(25),
Kommentar TEXT,
ExtInfo BLOB
ExtInfo BLOB,
pathodesc VARCHAR(128)
);
CREATE INDEX labor1 on LABORWERTE (PatientID);
......@@ -768,4 +769,18 @@ CREATE TABLE ZUSATZADRESSE (
ALTER TABLE ZUSATZADRESSE ADD CONSTRAINT FK_ZUSATZADRESSE_KONTAKT_ID FOREIGN KEY (Kontakt_ID) REFERENCES KONTAKT(ID);
INSERT INTO CONFIG (param,wert) VALUES ('dbversion','3.2.7');
INSERT INTO CONFIG (param,wert) VALUES ('ElexisVersion','3.2.0');
\ No newline at end of file
INSERT INTO CONFIG (param,wert) VALUES ('ElexisVersion','3.2.0');
# ----
CREATE TABLE at_medevit_elexis_labmap (
ID VARCHAR(25) PRIMARY KEY,
lastupdate BIGINT,
deleted CHAR(1) DEFAULT '0',
itemname VARCHAR(255),
originid VARCHAR(128),
labitemid VARCHAR(128),
charge CHAR(1)
);
CREATE INDEX loincmap1 ON at_medevit_elexis_labmap (originid);
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -3,3 +3,5 @@ INSERT INTO `KONTAKT` VALUES ('G299ce51c1100e52801137',1470809122982,'0','1','0'
INSERT INTO `KONTAKT` VALUES ('h2c1172107ce2df95065',1470809122983,'0','0','1','0','1','1','0',NULL,NULL,'m','Dr.',NULL,'Nachname','Hauptanwender',NULL,'Beispielstrasse 15','6840','Beispielstrasse 15','0190 222 222',NULL,'0190 222 224',NULL,'haupt@anwender.ch',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'504B0304140008080800F8400A4900000000000000000000000004000000686173685BF39681B5B88841382BB12C51AFB4243347CF23B138A324312927557837BFAAA2D7931DCC0C4C6E0C5C39F989296E89C925F9459E0C9C251945A9C519F939291505F60E0C20C051CE0124B98198B18481DD37312F2531AFA48441CC2F3139232F313755C123B1B4A02431AF3C352F25B5A80200504B070806C4629A7400000077000000504B01021400140008080800F8400A4906C4629A740000007700000004000000000000000000000000000000000068617368504B0506000000000100010032000000A60000000000');
INSERT INTO `KONTAKT` VALUES ('s9b71824bf6b877701111',1470809122984,'0','0','1','1','0','0','0',NULL,'19880623','w',NULL,NULL,'Testpatientin','Vorname',NULL,'Teststrasse 22c','68223','Testhausen','',NULL,NULL,NULL,NULL,NULL,NULL,'2',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
INSERT INTO `KONTAKT` VALUES ('zd8d46d1b8d44330501105',1470809122985,'0','0','1','1','0','0','0',NULL,'19790315','m',NULL,NULL,'Testpatient','Vorname',NULL,'Teststrasse 15','6840','Testort','',NULL,NULL,NULL,NULL,NULL,NULL,'1',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
INSERT INTO CONFIG (param, wert) VALUES ('PatientNummer', '2');
\ No newline at end of file
......@@ -62,6 +62,9 @@ public class TestDatabaseInitializer {
private static boolean isMandantInitialized = false;
private static Kontakt mandant;
private Kontakt laboratory;
private Kontakt laboratory2;
private static boolean isFallInitialized = false;
private static Fall fall;
......@@ -109,6 +112,7 @@ public class TestDatabaseInitializer {
jdbcConnection.close();
} catch (SQLException e) {
// ignore
e.printStackTrace();
}
}
} else {
......@@ -138,6 +142,7 @@ public class TestDatabaseInitializer {
isTarmedInitialized = initializeDbScript("/rsc/dbScripts/TarmedKumulation.sql");
isTarmedInitialized = initializeDbScript("/rsc/dbScripts/TarmedExtension.sql");
isTarmedInitialized = initializeDbScript("/rsc/dbScripts/TarmedGroup.sql");
isTarmedInitialized = initializeDbScript("/rsc/dbScripts/TarmedDefinitionen.sql");
}
}
......@@ -154,10 +159,9 @@ public class TestDatabaseInitializer {
isLeistungsblockInitialized = initializeDbScript("/rsc/dbScripts/Leistungsblock.sql");
}
}
/**
* Initializes an intrinsic consistent set of LabItems, LabResults and
* LabOrders
* Initializes an intrinsic consistent set of LabItems, LabResults and LabOrders
*
* @throws SQLException
* @throws IOException
......@@ -168,10 +172,10 @@ public class TestDatabaseInitializer {
isLaborItemsOrdersResultsInitialized = initializeDbScript("/rsc/dbScripts/LaborItemsWerteResults.sql");
}
}
public synchronized void initializeReminders() throws IOException, SQLException {
initializeDb();
if(!isRemindersInitialized) {