Integer disID = (Integer) line[0];
Diagnosis referced = (Diagnosis) line[1];
Integer typeID = (Integer) line[2];
String mkbCode = (String) line[3];
mkbCode = fixMkbCode(mkbCode);
DiagnosisEncounter encounter = (DiagnosisEncounter) line[4];
DiagInfo diagInfo = target.get(disID);
if (diagInfo == null) {
diagInfo = new DiagInfo();
target.put(disID, diagInfo);
}
if (referced != null) {
//Сопутствующий
diagInfo.referList.add(mkbCode);
} else if (typeID == DiagnosisType.DIAGNOSIS_TYPE_FINAL) {
//заключительный
if (diagInfo.diag != null) {
throw new EDataIntegrity("Повторный заключительный диагноз в заболевании id = " + disID);
}
diagInfo.diag = mkbCode;
diagInfo.diagEncID = encounter == null ? 0 : encounter.getId();
}
}
System.out.println("Запрос диагнозов завершен + " + resultList.size());
manager.clear();