Пример #1
0
 public static void importEhcAddress(ch.elexis.data.Kontakt kontakt, Address address) {
   Anschrift elexisAddress = kontakt.getAnschrift();
   elexisAddress.setOrt(address.getCity());
   elexisAddress.setPlz(address.getZip());
   elexisAddress.setStrasse(address.getStreet() + " " + address.getHouseNumber());
   kontakt.setAnschrift(elexisAddress);
 }
Пример #2
0
  public static Address getEhcAddress(Anschrift elexisAddress) {
    String elexisStreet = elexisAddress.getStrasse();
    String houseNumber = "";
    // try to get the house number
    Matcher matcher = lastIntPattern.matcher(elexisStreet);
    if (matcher.find()) {
      houseNumber = matcher.group(1);
      elexisStreet = elexisStreet.substring(0, matcher.start(1));
    }

    Address ehcAddress =
        new Address(
            elexisStreet.trim(), houseNumber, elexisAddress.getPlz(), elexisAddress.getOrt());
    ehcAddress.setAddressline1(elexisAddress.getStrasse());
    return ehcAddress;
  }