pmiMainDiagnosis.addContentStateListener(new ContentStateListener() {
@Override
public void contentStateChanged() {
try {
DirectoryMKB10Item selectedItem = pmiMainDiagnosis.getSelectedItem();
if (selectedItem != null && selectedItem.getID() != 0){
diagnosisLocal.setMkb(selectedItem);
cbEncounter.setEnabled(false);
if (selectedItem.isTrauma()){
cbEncounter.setSelectedItem(directoryDE.getTrauma());
}else if (selectedItem.isHealthy()){
cbEncounter.setSelectedItem(directoryDE.getHealthy());
}else{
//сбрасывается если было проставлено "травма" или "здоров"
Object last = cbEncounter.getSelectedItem();
if (last.equals(directoryDE.getTrauma())
|| last.equals(directoryDE.getHealthy())) {
cbEncounter.setSelectedItem(directoryDE.getNullItem());
}
cbEncounter.setEnabled(true);
}
}
// setAutoEncounter();
} catch (ClipsException ex) {
MessageBox.showException(ex);
}
}
});
pmiСomplication.setSelectedItem(diagnosisLocal.getComplication());
pmiСomplication.addContentStateListener(new ContentStateListener() {
@Override
public void contentStateChanged() {
try {
DirectoryMKB10Item selectedItem = pmiСomplication.getSelectedItem();
if (selectedItem != null){
diagnosisLocal.setComplication(selectedItem);
}
} catch (ClipsException ex) {
MessageBox.showException(ex);