if (!c.isValid()) {
throw new EDataIntegrity("Неполные данные пациента");
}
//CLIENT
ClientDetails clientDetails = new ClientDetails();
clientDetails.surnameId = c.famID;
clientDetails.nameId = c.nameID;
clientDetails.pathronId = c.patronID;
clientDetails.sexId = c.sexID;
clientDetails.born = c.dateBorn;
clientDetails.socialStatusId = c.socStatusID;
clientDetails.districtId = c.districtID;
clientDetails.inn = c.inn;
clientDetails.snils = c.snils;
clientDetails.numberEmc = c.numambk;
ClientUniq cu = new ClientUniq(c.famID, c.nameID, c.patronID, c.dateBorn);
Integer clientID = mapClient.get(cu);
Client client = null;
if (clientID != null && clientID != 0) {
client = findEntity(Client.class, clientID);
}
if (client != null) {
ClientDetails d2 = client.getDetails(this);
d2.surnameId = clientDetails.surnameId;
d2.nameId = clientDetails.nameId;
d2.pathronId = clientDetails.pathronId;
d2.sexId = clientDetails.sexId;