public static Patient getEhcPatient(ch.elexis.data.Patient elexisPatient) { Patient ret = new Patient( getEhcPersonName(elexisPatient), getEhcGenderCode(elexisPatient), getDate(elexisPatient.getGeburtsdatum())); // PHONE Telecoms telecoms = new Telecoms(); String value = elexisPatient.get(Kontakt.FLD_PHONE1); if (value != null && !value.isEmpty() && !value.equalsIgnoreCase("0")) { telecoms.addPhone(value, AddressUse.PRIVATE); } value = elexisPatient.get(Kontakt.FLD_MOBILEPHONE); if (value != null && !value.isEmpty() && !value.equalsIgnoreCase("0")) { telecoms.addPhone(value, AddressUse.MOBILE); } ret.setTelecoms(telecoms); // ADDRESS Anschrift elexisAddress = elexisPatient.getAnschrift(); if (elexisAddress != null) { ret.addAddress(getEhcAddress(elexisAddress)); } String socialSecurityNumber = elexisPatient.getXid(Xid.DOMAIN_AHV); if (socialSecurityNumber != null) { socialSecurityNumber = socialSecurityNumber.trim(); socialSecurityNumber = socialSecurityNumber.replaceAll("\\.", ""); if (socialSecurityNumber.length() == 11) { ret.addId( new Identificator( CodeSystems.SwissSSNDeprecated.getCodeSystemId(), socialSecurityNumber)); } else if (socialSecurityNumber.length() == 13) { ret.addId(new Identificator(CodeSystems.SwissSSN.getCodeSystemId(), socialSecurityNumber)); } } return ret; }