Package clips.service.mes

Source Code of clips.service.mes.MesEditPanel

/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/

/*
* MesEditPanel.java
*
* Created on Dec 30, 2008, 3:00:49 PM
*/

package clips.service.mes;

import cli_fmw.delegate.directory.complex.DirectoryLocator;
import clips.delegate.service.mes.MedicEconomicStandartLocal;
import cli_fmw.main.ClipsException;
import cli_fmw.report.panels.model.CachedObjectListModel;
import cli_fmw.report.panels.model.ObjectContainer;
import cli_fmw.report.panels.model.ObjectListener;
import cli_fmw.report.panels.model.delegate.DelegateComboboxModel;
import cli_fmw.report.panels.model.delegate.DelegateTextModel;
import cli_fmw.report.panels.model.delegate.DirectoryComboBoxModel;
import cli_fmw.utils.MessageBox;
import clips.delegate.directory.complex.DirectoryMKB10;
import clips.delegate.directory.complex.DirectoryMKB10Item;
import clips.delegate.directory.filtered.DirectoryService;
import clips.delegate.directory.filtered.DirectoryServiceItem;
import clips.delegate.directory.simple.mes.DirectoryMESTarget;
import clips.delegate.directory.simple.mes.DirectoryMESTargetItem;
import clips.delegate.directory.simple.receptionType.DirectoryReceptionType;
import clips.delegate.directory.simple.receptionType.DirectoryReceptionTypeItem;
import framework.utils.Converter;
import java.awt.Window;
import java.text.ParseException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

/**
*
* @author finder
*/
public class MesEditPanel extends javax.swing.JPanel {
  static final long                  serialVersionUID = 1L;
  static final String[]                defaultDurations = {null, "1", "3", "7", "10", "14", "20", "40"};

  Window                        parentW;
 
  ArrayList<ObjectContainer<MedicEconomicStandartLocal>> containers = new ArrayList<ObjectContainer<MedicEconomicStandartLocal>>();
 
  MedicEconomicStandartLocal              mes;
  DelegateTextModel<MedicEconomicStandartLocal>    diseaseNameModel, mesCodeModel, targetsModel,
                            criteriaOfQualityModel, sizeOfCureModel,
                            complexitySupervisionModel, complexityOperationsModel,
                            tariffModel;
  DelegateComboboxModel<MedicEconomicStandartLocal>  mesDurationModel;
  DirectoryComboBoxModel<MedicEconomicStandartLocal,
      DirectoryMESTargetItem>            targetsComboBoxModel;
  DelegateComboboxModel<MedicEconomicStandartLocal>  normalDurationModel;
  CachedObjectListModel<MedicEconomicStandartLocal,
          DirectoryMKB10Item>          mkbListModel;
  CachedObjectListModel<MedicEconomicStandartLocal,
          DirectoryServiceItem>        serviceListModel;
  CachedObjectListModel<MedicEconomicStandartLocal,
          DirectoryReceptionTypeItem>      recTypeListModel;

  /** Creates new form MesEditPanel
   * @param mes
   */
    public MesEditPanel(Window parentW, MedicEconomicStandartLocal mes) {
    this.parentW = parentW;
        initComponents();
    this.mes = mes;
    initModels();
    }

  private void initModels(){
    diseaseNameModel = new DelegateTextModel<MedicEconomicStandartLocal>(tfDiseaseName, mes) {
      static final long                serialVersionUID = 1L;
      @Override
      protected void setModelTextChecked(String text) throws ClipsException {
        getObject().setDiseaseName(text);
      }

      @Override
      protected String getModelTextChecked() throws ClipsException {
        return getObject().getDiseaseName();
      }
    };
    containers.add(diseaseNameModel);

    mesCodeModel = new DelegateTextModel<MedicEconomicStandartLocal>(tfMesCode, mes) {
      static final long                serialVersionUID = 1L;

      @Override
      protected void setModelTextChecked(String text) throws ClipsException {
        getObject().setCode(text);
      }

      @Override
      protected String getModelTextChecked() throws ClipsException {
        return getObject().getCode();
      }
    };
    containers.add(mesCodeModel);

    try {
      DirectoryMESTarget      dir = DirectoryLocator.getDirectory(DirectoryMESTarget.class);
      targetsComboBoxModel = new DirectoryComboBoxModel<MedicEconomicStandartLocal, DirectoryMESTargetItem>(cbTargets, dir, mes) {
        static final long                serialVersionUID = 1L;
        @Override
        public DirectoryMESTargetItem getSelectedDirectoryItem() throws ClipsException {
          return getObject().getMesTargets();
        }

        @Override
        public void setSelectedDirectoryItem(DirectoryMESTargetItem item) throws ClipsException {
          getObject().setMesTargets(item);
        }
      };
      containers.add(targetsComboBoxModel);
    }
    catch (ClipsException ex) {
      MessageBox.showException(ex);
    }

    criteriaOfQualityModel = new DelegateTextModel<MedicEconomicStandartLocal>(tfCriteriaOfQuality, mes) {
      static final long                serialVersionUID = 1L;
      @Override
      protected void setModelTextChecked(String text) throws ClipsException {
        getObject().setCriteriaOfQuality(text);
      }

      @Override
      protected String getModelTextChecked() throws ClipsException {
        return getObject().getCriteriaOfQuality();
      }
    };
    containers.add(criteriaOfQualityModel);

    sizeOfCureModel = new DelegateTextModel<MedicEconomicStandartLocal>(taSizeOfCure, mes) {
      static final long                serialVersionUID = 1L;
      @Override
      protected void setModelTextChecked(String text) throws ClipsException {
        getObject().setSizeOfCure(text);
      }

      @Override
      protected String getModelTextChecked() throws ClipsException {
        return getObject().getSizeOfCure();
      }
    };
    containers.add(sizeOfCureModel);
   
    normalDurationModel = new DelegateComboboxModel<MedicEconomicStandartLocal>(cbNormalDuration, mes, false) {
      static final long                serialVersionUID = 1L;

      @Override
      public Object getElementAtImp(int index) throws ClipsException {
        return defaultDurations[index];
      }

      @Override
      public int getSizeImp() throws ClipsException {
        return defaultDurations.length;
      }

      @Override
      public Object getSelectedItemImp() throws ClipsException {
        Integer        dn = getObject().getNormalDuration();
        return dn == null? null: dn.toString();
      }

      @Override
      public void setSelectedItemImp(Object anItem) throws ClipsException {
        String        itm = (String)anItem;
        if (itm == null){
          getObject().setNormalDuration(null);
        }
        else{
          try{
            getObject().setNormalDuration(Integer.parseInt(itm));
          }
          catch (NumberFormatException ex){
            // nothing to do
          }
        }
      }
    };
    containers.add(normalDurationModel);

    complexitySupervisionModel = new DelegateTextModel<MedicEconomicStandartLocal>(tfComplexitySupervision, mes) {
      static final long                serialVersionUID = 1L;

      @Override
      protected void setModelTextChecked(String text) throws ClipsException, ParseException, NumberFormatException {
        getObject().setComplexitySupervision(text == null? null: Integer.parseInt(text));
      }

      @Override
      protected String getModelTextChecked() throws ClipsException {
        Integer        val = getObject().getComplexitySupervision();
        return val == null? null: val.toString();
      }
    };
    containers.add(complexitySupervisionModel);

    complexityOperationsModel = new DelegateTextModel<MedicEconomicStandartLocal>(tfComplexityOperations, mes) {
      static final long                serialVersionUID = 1L;

      @Override
      protected void setModelTextChecked(String text) throws ClipsException, ParseException, NumberFormatException {
        getObject().setComplexityOperations(text == null? null: Integer.parseInt(text));
      }

      @Override
      protected String getModelTextChecked() throws ClipsException {
        Integer        val = getObject().getComplexityOperations();
        return val == null? null: val.toString();
      }
    };
    containers.add(complexityOperationsModel);

    tariffModel = new DelegateTextModel<MedicEconomicStandartLocal>(tfTariff, mes) {
      static final long                serialVersionUID = 1L;

      @Override
      protected void setModelTextChecked(String text) throws ClipsException, ParseException, NumberFormatException {
        // TODO: fix (int)
        getObject().setTariff((int)Converter.stringToPrice(text));
      }

      @Override
      protected String getModelTextChecked() throws ClipsException {
        return Converter.priceToString(getObject().getTariff());
      }
    };
    containers.add(complexityOperationsModel);

    mkbListModel = new CachedObjectListModel<MedicEconomicStandartLocal, DirectoryMKB10Item>(lsMkb, new ObjectListener<MedicEconomicStandartLocal>(mes), true, false) {
      static final long                serialVersionUID = 1L;

      @Override
      protected ArrayList<DirectoryMKB10Item> getItems() throws ClipsException {
        ArrayList<DirectoryMKB10Item> target = new ArrayList<DirectoryMKB10Item>(getObject().getMkb10());
        Collections.sort(target);
        return target;
      }
    };
    containers.add(mkbListModel);

    serviceListModel = new CachedObjectListModel<MedicEconomicStandartLocal, DirectoryServiceItem>(lsServise, new ObjectListener<MedicEconomicStandartLocal>(mes), true, false) {
      static final long                serialVersionUID = 1L;

      @Override
      protected ArrayList<DirectoryServiceItem> getItems() throws ClipsException {
        ArrayList<DirectoryServiceItem> target = new ArrayList<DirectoryServiceItem>(getObject().getService());
        Collections.sort(target);
        return target;
      }
    };
    containers.add(serviceListModel);

    recTypeListModel = new CachedObjectListModel<MedicEconomicStandartLocal, DirectoryReceptionTypeItem>
                (lsRecTypes, new ObjectListener<MedicEconomicStandartLocal>(mes), true, false) {
      static final long                serialVersionUID = 1L;

      @Override
      protected ArrayList<DirectoryReceptionTypeItem> getItems() throws ClipsException {
        ArrayList<DirectoryReceptionTypeItem> target = new ArrayList<DirectoryReceptionTypeItem>(getObject().getReceptionType());
        Collections.sort(target);
        return target;
      }
    };
    containers.add(recTypeListModel);
  }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanel2 = new javax.swing.JPanel();
        jPanel10 = new javax.swing.JPanel();
        jScrollPane4 = new javax.swing.JScrollPane();
        taSizeOfCure = new javax.swing.JTextArea();
        jPanel14 = new javax.swing.JPanel();
        jPanel13 = new javax.swing.JPanel();
        tfDiseaseName = new javax.swing.JTextField();
        tfMesCode = new javax.swing.JTextField();
        cbTargets = new javax.swing.JComboBox();
        tfCriteriaOfQuality = new javax.swing.JTextField();
        jPanel12 = new javax.swing.JPanel();
        jLabel9 = new javax.swing.JLabel();
        jLabel12 = new javax.swing.JLabel();
        jLabel10 = new javax.swing.JLabel();
        jLabel7 = new javax.swing.JLabel();
        jPanel11 = new javax.swing.JPanel();
        jPanel16 = new javax.swing.JPanel();
        jLabel5 = new javax.swing.JLabel();
        cbNormalDuration = new javax.swing.JComboBox();
        jPanel9 = new javax.swing.JPanel();
        jLabel8 = new javax.swing.JLabel();
        jLabel6 = new javax.swing.JLabel();
        tfComplexityOperations = new javax.swing.JTextField();
        tfComplexitySupervision = new javax.swing.JTextField();
        jPanel15 = new javax.swing.JPanel();
        jLabel4 = new javax.swing.JLabel();
        tfTariff = new javax.swing.JTextField();
        jPanel1 = new javax.swing.JPanel();
        jPanel3 = new javax.swing.JPanel();
        jScrollPane2 = new javax.swing.JScrollPane();
        lsMkb = new javax.swing.JList();
        jPanel6 = new javax.swing.JPanel();
        btEditMkb = new javax.swing.JButton();
        jLabel1 = new javax.swing.JLabel();
        jPanel4 = new javax.swing.JPanel();
        jScrollPane1 = new javax.swing.JScrollPane();
        lsRecTypes = new javax.swing.JList();
        jPanel7 = new javax.swing.JPanel();
        btEditSpecialitys = new javax.swing.JButton();
        jLabel2 = new javax.swing.JLabel();
        jPanel5 = new javax.swing.JPanel();
        jScrollPane3 = new javax.swing.JScrollPane();
        lsServise = new javax.swing.JList();
        jPanel8 = new javax.swing.JPanel();
        btEditService = new javax.swing.JButton();
        jLabel3 = new javax.swing.JLabel();

        setLayout(new java.awt.BorderLayout());

        jPanel2.setLayout(new java.awt.BorderLayout());

        jScrollPane4.setBorder(javax.swing.BorderFactory.createTitledBorder("Объем лечения:"));

        taSizeOfCure.setColumns(15);
        taSizeOfCure.setLineWrap(true);
        taSizeOfCure.setRows(3);
        jScrollPane4.setViewportView(taSizeOfCure);

        jPanel14.setLayout(new java.awt.BorderLayout());

        jPanel13.setLayout(new java.awt.GridLayout(0, 1, 0, 4));

        tfDiseaseName.setText("jTextField1");
        jPanel13.add(tfDiseaseName);

        tfMesCode.setText("jTextField4");
        jPanel13.add(tfMesCode);

        cbTargets.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
        jPanel13.add(cbTargets);

        tfCriteriaOfQuality.setText("Улучшение общего состояния, прибавка в весе.");
        jPanel13.add(tfCriteriaOfQuality);

        jPanel14.add(jPanel13, java.awt.BorderLayout.CENTER);

        jPanel12.setLayout(new java.awt.GridLayout(0, 1));

        jLabel9.setText("Наименование заболевания");
        jPanel12.add(jLabel9);

        jLabel12.setText("Код МЭС");
        jPanel12.add(jLabel12);

        jLabel10.setText("Цели лечения");
        jPanel12.add(jLabel10);

        jLabel7.setText("Критерии качества");
        jPanel12.add(jLabel7);

        jPanel14.add(jPanel12, java.awt.BorderLayout.WEST);

        javax.swing.GroupLayout jPanel10Layout = new javax.swing.GroupLayout(jPanel10);
        jPanel10.setLayout(jPanel10Layout);
        jPanel10Layout.setHorizontalGroup(
            jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel14, javax.swing.GroupLayout.DEFAULT_SIZE, 663, Short.MAX_VALUE)
            .addComponent(jScrollPane4, javax.swing.GroupLayout.DEFAULT_SIZE, 663, Short.MAX_VALUE)
        );
        jPanel10Layout.setVerticalGroup(
            jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel10Layout.createSequentialGroup()
                .addComponent(jPanel14, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jScrollPane4, javax.swing.GroupLayout.PREFERRED_SIZE, 109, javax.swing.GroupLayout.PREFERRED_SIZE))
        );

        jPanel2.add(jPanel10, java.awt.BorderLayout.CENTER);

        jPanel16.setLayout(new java.awt.GridLayout(0, 1));

        jLabel5.setText("Срок лечения");
        jPanel16.add(jLabel5);

        cbNormalDuration.setEditable(true);
        cbNormalDuration.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
        jPanel16.add(cbNormalDuration);

        jPanel9.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Критерии сложности", javax.swing.border.TitledBorder.CENTER, javax.swing.border.TitledBorder.DEFAULT_POSITION));

        jLabel8.setText("операции");

        jLabel6.setText("курации");

        javax.swing.GroupLayout jPanel9Layout = new javax.swing.GroupLayout(jPanel9);
        jPanel9.setLayout(jPanel9Layout);
        jPanel9Layout.setHorizontalGroup(
            jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel9Layout.createSequentialGroup()
                .addComponent(jLabel8)
                .addGap(6, 6, 6)
                .addComponent(tfComplexityOperations, javax.swing.GroupLayout.DEFAULT_SIZE, 91, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel6)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(tfComplexitySupervision, javax.swing.GroupLayout.DEFAULT_SIZE, 91, Short.MAX_VALUE))
        );

        jPanel9Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {jLabel6, jLabel8});

        jPanel9Layout.setVerticalGroup(
            jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                .addComponent(jLabel8, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addComponent(tfComplexitySupervision, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addComponent(jLabel6, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addComponent(tfComplexityOperations, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        );

        jPanel15.setLayout(new java.awt.GridLayout(0, 1));

        jLabel4.setText("Тариф за день");
        jPanel15.add(jLabel4);

        tfTariff.setText("jTextField1");
        jPanel15.add(tfTariff);

        javax.swing.GroupLayout jPanel11Layout = new javax.swing.GroupLayout(jPanel11);
        jPanel11.setLayout(jPanel11Layout);
        jPanel11Layout.setHorizontalGroup(
            jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel11Layout.createSequentialGroup()
                .addComponent(jPanel16, javax.swing.GroupLayout.DEFAULT_SIZE, 171, Short.MAX_VALUE)
                .addComponent(jPanel9, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(jPanel15, javax.swing.GroupLayout.DEFAULT_SIZE, 138, Short.MAX_VALUE))
        );
        jPanel11Layout.setVerticalGroup(
            jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel16, javax.swing.GroupLayout.PREFERRED_SIZE, 56, javax.swing.GroupLayout.PREFERRED_SIZE)
            .addComponent(jPanel9, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
            .addComponent(jPanel15, javax.swing.GroupLayout.PREFERRED_SIZE, 56, javax.swing.GroupLayout.PREFERRED_SIZE)
        );

        jPanel2.add(jPanel11, java.awt.BorderLayout.PAGE_END);

        add(jPanel2, java.awt.BorderLayout.PAGE_START);

        jPanel1.setLayout(new java.awt.GridLayout(0, 1));

        jPanel3.setLayout(new java.awt.BorderLayout());

        lsMkb.setModel(new javax.swing.AbstractListModel() {
            String[] strings = { "Item 1", "Item 2", "Item 3", "Item 4", "Item 5" };
            public int getSize() { return strings.length; }
            public Object getElementAt(int i) { return strings[i]; }
        });
        jScrollPane2.setViewportView(lsMkb);

        jPanel3.add(jScrollPane2, java.awt.BorderLayout.CENTER);

        btEditMkb.setText("Редактировать");
        btEditMkb.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btEditMkbActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel6Layout = new javax.swing.GroupLayout(jPanel6);
        jPanel6.setLayout(jPanel6Layout);
        jPanel6Layout.setHorizontalGroup(
            jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel6Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(btEditMkb, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jPanel6Layout.setVerticalGroup(
            jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel6Layout.createSequentialGroup()
                .addComponent(btEditMkb)
                .addContainerGap(46, Short.MAX_VALUE))
        );

        jPanel3.add(jPanel6, java.awt.BorderLayout.LINE_END);

        jLabel1.setText("Код по Mkb10");
        jPanel3.add(jLabel1, java.awt.BorderLayout.PAGE_START);

        jPanel1.add(jPanel3);

        jPanel4.setLayout(new java.awt.BorderLayout());

        lsRecTypes.setModel(new javax.swing.AbstractListModel() {
            String[] strings = { "Item 1", "Item 2", "Item 3", "Item 4", "Item 5" };
            public int getSize() { return strings.length; }
            public Object getElementAt(int i) { return strings[i]; }
        });
        jScrollPane1.setViewportView(lsRecTypes);

        jPanel4.add(jScrollPane1, java.awt.BorderLayout.CENTER);

        btEditSpecialitys.setText("Редактировать");
        btEditSpecialitys.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btEditSpecialitysActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel7Layout = new javax.swing.GroupLayout(jPanel7);
        jPanel7.setLayout(jPanel7Layout);
        jPanel7Layout.setHorizontalGroup(
            jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel7Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(btEditSpecialitys))
        );
        jPanel7Layout.setVerticalGroup(
            jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel7Layout.createSequentialGroup()
                .addComponent(btEditSpecialitys)
                .addContainerGap(46, Short.MAX_VALUE))
        );

        jPanel4.add(jPanel7, java.awt.BorderLayout.LINE_END);

        jLabel2.setText("Консультации у врачей");
        jPanel4.add(jLabel2, java.awt.BorderLayout.PAGE_START);

        jPanel1.add(jPanel4);

        jPanel5.setLayout(new java.awt.BorderLayout());

        lsServise.setModel(new javax.swing.AbstractListModel() {
            String[] strings = { "Item 1", "Item 2", "Item 3", "Item 4", "Item 5" };
            public int getSize() { return strings.length; }
            public Object getElementAt(int i) { return strings[i]; }
        });
        jScrollPane3.setViewportView(lsServise);

        jPanel5.add(jScrollPane3, java.awt.BorderLayout.CENTER);

        btEditService.setText("Редактировать");
        btEditService.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btEditServiceActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel8Layout = new javax.swing.GroupLayout(jPanel8);
        jPanel8.setLayout(jPanel8Layout);
        jPanel8Layout.setHorizontalGroup(
            jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel8Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(btEditService))
        );
        jPanel8Layout.setVerticalGroup(
            jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel8Layout.createSequentialGroup()
                .addComponent(btEditService)
                .addContainerGap(46, Short.MAX_VALUE))
        );

        jPanel5.add(jPanel8, java.awt.BorderLayout.LINE_END);

        jLabel3.setText("Услуги по мэсу");
        jPanel5.add(jLabel3, java.awt.BorderLayout.PAGE_START);

        jPanel1.add(jPanel5);

        add(jPanel1, java.awt.BorderLayout.CENTER);
    }// </editor-fold>//GEN-END:initComponents

  private void btEditMkbActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btEditMkbActionPerformed
    try {
      DirectoryMKB10        dir = DirectoryLocator.getDirectory(DirectoryMKB10.class);
      DirectoryRecursiveSelectDialog<DirectoryMKB10Item> dlg =
            new DirectoryRecursiveSelectDialog<DirectoryMKB10Item>(
            parentW, mes.getMkb10(), dir);
      dlg.setVisible(true);
      if (dlg.getResould() == DirectoryRecursiveSelectDialog.DLG_OK) {
        mes.setMkb10(dlg.getItems());
      }
      mkbListModel.stateChanged(null);
    }
    catch (ClipsException ex) {
      MessageBox.showException(ex);
    }
}//GEN-LAST:event_btEditMkbActionPerformed

  private void btEditSpecialitysActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btEditSpecialitysActionPerformed
    try {
      DirectoryReceptionType      dir = DirectoryLocator.getDirectory(DirectoryReceptionType.class);
      DirectoryItemSelectDialog<DirectoryReceptionTypeItem>  dlg =
            new DirectoryItemSelectDialog<DirectoryReceptionTypeItem>(
            parentW, mes.getReceptionType(), dir);
      dlg.setVisible(true);
      if (dlg.getReturnStatus() == DirectoryRecursiveSelectDialog.DLG_OK) {
        mes.setReceptionType(dlg.getItems());
      }
      recTypeListModel.stateChanged(null);
    }
    catch (ClipsException ex) {
      MessageBox.showException(ex);
    }
}//GEN-LAST:event_btEditSpecialitysActionPerformed

  private void btEditServiceActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btEditServiceActionPerformed
    try {
      DirectoryService      dir = DirectoryLocator.getDirectory(DirectoryService.class);
      DirectoryItemSelectDialog<DirectoryServiceItem>  dlg =
            new DirectoryItemSelectDialog<DirectoryServiceItem>(
            parentW, mes.getService(), dir);
      dlg.setVisible(true);
      if (dlg.getReturnStatus() == DirectoryRecursiveSelectDialog.DLG_OK) {
        mes.setService(dlg.getItems());
      }
      serviceListModel.stateChanged(null);
    }
    catch (ClipsException ex) {
      MessageBox.showException(ex);
    }
}//GEN-LAST:event_btEditServiceActionPerformed


    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btEditMkb;
    private javax.swing.JButton btEditService;
    private javax.swing.JButton btEditSpecialitys;
    private javax.swing.JComboBox cbNormalDuration;
    private javax.swing.JComboBox cbTargets;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel10;
    private javax.swing.JPanel jPanel11;
    private javax.swing.JPanel jPanel12;
    private javax.swing.JPanel jPanel13;
    private javax.swing.JPanel jPanel14;
    private javax.swing.JPanel jPanel15;
    private javax.swing.JPanel jPanel16;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JPanel jPanel5;
    private javax.swing.JPanel jPanel6;
    private javax.swing.JPanel jPanel7;
    private javax.swing.JPanel jPanel8;
    private javax.swing.JPanel jPanel9;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JScrollPane jScrollPane3;
    private javax.swing.JScrollPane jScrollPane4;
    private javax.swing.JList lsMkb;
    private javax.swing.JList lsRecTypes;
    private javax.swing.JList lsServise;
    private javax.swing.JTextArea taSizeOfCure;
    private javax.swing.JTextField tfComplexityOperations;
    private javax.swing.JTextField tfComplexitySupervision;
    private javax.swing.JTextField tfCriteriaOfQuality;
    private javax.swing.JTextField tfDiseaseName;
    private javax.swing.JTextField tfMesCode;
    private javax.swing.JTextField tfTariff;
    // End of variables declaration//GEN-END:variables

  public void setObject(MedicEconomicStandartLocal objcet){
    for (ObjectContainer<MedicEconomicStandartLocal> objectContainer : containers) {
      objectContainer.setObject(objcet);
    }
  }
}
TOP

Related Classes of clips.service.mes.MesEditPanel

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.