DirectoryItemDetails d = new DirectoryItemDetails(fields.get(Col.FAMILY).get().trim());
surename = new DirectorySurnameItem(d);
dirSurname.getItems().append(surename);
}
int surnameID = surename.getID();
DirectoryNameItem name = dirName.getItemFromTitle(fields.get(Col.NAME).get().trim());
if (name == null) {
DirectoryItemDetails d = new DirectoryItemDetails(fields.get(Col.NAME).get().trim());
name = new DirectoryNameItem(d);
dirName.getItems().append(name);
}
int nameID = name.getID();
//Финт ушами - исправление отчества
String father = fields.get(Col.FATHER).get().trim();
if (father.equals("Тимирьянович")) {
father = "Тимерзянович";
}
DirectoryPathronItem pathron = dirPathron.getItemFromTitle(father);
if (pathron == null) {
DirectoryItemDetails d = new DirectoryItemDetails(father);
pathron = new DirectoryPathronItem(d);
dirPathron.getItems().append(pathron);
}
int pathronID = pathron.getID();
int specID = dirSpec.getItemFromExtKey(fields.get(Col.KOD_SPEC).get().trim()).getID();
DirectoryReceptionTypeItem recType = dirRecType.getItemFromExtKey(fields.get(Col.KOD_PRIEM).get().trim());
if (recType == null) {
recType = dirRecType.getItemFromExtKey("600");
}
int receptionTypeID = recType.getID();
DirectoryDvrItem dvr = dirDvr.getItemFromExtKey(fields.get(Col.DOLV).get().trim());
if (dvr == null) {
dvr = dirDvr.getItemFromID(0);
}
int dvrID = dvr.getID();
DirectoryMedicalAidTypeItem vmu = dirVmu.getItemFromExtKey(fields.get(Col.VMU).get().trim());
if (vmu == null) {
vmu = dirVmu.getItemFromID(0);
}
int vmuID = vmu.getID();
String snils = fields.get(Col.SNILS).get().trim();
CollabData cd = new CollabData(extKey, surnameID, nameID, pathronID, specID, receptionTypeID, dvrID, vmuID);
ColDataKey key = new ColDataKey(surnameID, nameID, pathronID);
colClientMap.put(key, findClient(surename.getTitle(), name.getTitle(), pathron.getTitle(), snils));
colDataList.add(cd);
} catch (IOException ex) {
closeDBF(dbf);
throw new ClipsException("Ошибка при чтении данных из файла " + dbf.getName() + " (строка " + i + ")", ex);