Package open.dolphin.order

Examples of open.dolphin.order.MasterItem


    @Override
    protected Transferable createTransferable(JComponent c) {
        sourceTable = (JTable) c;
        ObjectReflectTableModel tableModel = (ObjectReflectTableModel) sourceTable.getModel();
        fromIndex = sourceTable.getSelectedRow();
        MasterItem dragItem = (MasterItem) tableModel.getObject(fromIndex);
        return dragItem != null ? new MasterItemTransferable(dragItem) : null;
    }
View Full Code Here


   
    @Override
    public boolean importData(TransferSupport support) {
        if (canImport(support)) {
            try {
                MasterItem dropItem = (MasterItem) support.getTransferable().getTransferData(masterItemFlavor);
                JTable dropTable = (JTable) support.getComponent();
                ObjectReflectTableModel tableModel = (ObjectReflectTableModel) dropTable.getModel();
                JTable.DropLocation dropLocation = (JTable.DropLocation) support.getDropLocation();

                toIndex = dropLocation.getRow();
View Full Code Here

        return new ObjectReflectTableModel(columns, 1, methods, null) {
            private static final long serialVersionUID = 1L;
           
            @Override
            public boolean isCellEditable(int row, int col) {
                MasterItem model = (MasterItem) getObject(row);
               
                // 疾患名カラムは HAND_CODE の時のみ編集可能
                if (col == 1) {
                    return model != null && HAND_CODE.equals(model.getCode());
                   
                //エリアスカラムは modifier でなければ編集可能
                } else if (col == 2) {
                    return model != null && (!model.getCode().startsWith(MODIFIER_CODE));
                }
                return false;
            }
           
            @Override
            public void setValueAt(Object o, int row, int col) {
                if (o == null) return;
                String value = (String)o;
               
                MasterItem model = (MasterItem) getObject(row);
               
                if (col == 1) {
                    // 名前コラムに Object が入力されていた場合は HAND_CODE とする
                    if (!value.equals("")) {
                        // 登録されている MasterItem がなければ作成して加える
                        if (model == null) {
                            model = new MasterItem();
                            model.setName(value);
                            model.setCode(HAND_CODE);
                            addRow(model);

                        // 登録されている MasterItem があれば,HAND_CODE に変更する
                        } else {
                            model.setName(value);
                            model.setCode(HAND_CODE);
                            fireTableCellUpdated(row, col);
                        }
                        // これで StampModelEditor の呼び主の propertyChange が呼ばれる
                        checkState();
                    }
                } else if (col == 2) {
                    // エリアスコラムは MasterItem の dummy を間借り
                    if (model != null) {
                        model.setDummy(value);
                    }
                }
            }
        };
    }
View Full Code Here

        Object newValue = e.getNewValue();
        if (newValue == null
                || !(newValue instanceof MasterItem)
                || !MasterSearchPanel.SELECTED_ITEM_PROP.equals(e.getPropertyName())) return;

        MasterItem mItem = (MasterItem) e.getNewValue();
        if (mItem == null) return;

        // ZZZ コードなら,接頭語(ZZZ1~7)なら頭から挿入
        if (mItem.getCode().matches("^ZZZ[1-7].*")) tableModel.insertRow(0, mItem);
        else tableModel.addRow(mItem);
       
        // ボタンコントロールと通知
        checkState();
    }
View Full Code Here

    public void reconstractDiagnosis() {

        StringBuilder sb = new StringBuilder();
        int count = tableModel.getObjectCount();
        for (int i = 0; i < count; i++) {
            MasterItem diag = (MasterItem) tableModel.getObject(i);
            sb.append(diag.getName());
        }
        combinedDiagnosis.setText(sb.toString());
    }
View Full Code Here

     */
    private boolean hasModifier() {
        boolean hasModifier = false;
        int count = tableModel.getObjectCount();
        for (int i = 0; i < count; i++) {
            MasterItem diag = (MasterItem) tableModel.getObject(i);
            if (diag.getCode().startsWith(MODIFIER_CODE)) {
                hasModifier = true;
                break;
            }
        }
        return hasModifier;
View Full Code Here

        StringBuilder code = new StringBuilder();
        String alias = null;
           
        // テーブルをスキャンする
        for (Object o : tableModel.getObjectList()) {
            MasterItem mItem = (MasterItem)o;
            String diagCode = mItem.getCode();
           
            if (diagCode.startsWith(MODIFIER_CODE)) {
                // 修飾語の場合は ZZZ をトリムする (ORCA 実装)
                diagCode = diagCode.substring(MODIFIER_CODE.length());
           
            } else {
                // 修飾語でないものがみつかったら,基本病名と見なしパラメータを設定する
                // 修飾語がある場合は,基本病名は必ず1つのはず。
                rd.setDiagnosisCodeSystem(mItem.getMasterTableId());
                rd.setCategory(open.dolphin.infomodel.IInfoModel.DEFAULT_DIAGNOSIS_CATEGORY);
                rd.setCategoryDesc(open.dolphin.infomodel.IInfoModel.DEFAULT_DIAGNOSIS_CATEGORY_DESC);
                rd.setCategoryCodeSys(open.dolphin.infomodel.IInfoModel.DEFAULT_DIAGNOSIS_CATEGORY_CODESYS);
               
                alias = mItem.getDummy(); // alias を保存
            }
            // コードを . で連結する
            if (code.length() > 0) code.append(".");
            code.append(diagCode);           
            // 名前を連結する
            name.append(mItem.getName());
        }
       
        // 名前とコードを設定する
        rd.setDiagnosis( getDiagnosisWithAlias(name.toString(), alias) );
        rd.setDiagnosisCode(code.toString());
View Full Code Here

     */
    private Object getValue2() {
        ArrayList<RegisteredDiagnosisModel> ret = new ArrayList<RegisteredDiagnosisModel>();
       
        for(Object o : tableModel.getObjectList()) {
            MasterItem mItem = (MasterItem) o;
            RegisteredDiagnosisModel rd = new RegisteredDiagnosisModel();
            // 診断にエリアスが指定されている場合,dummy に入っている
            rd.setDiagnosis( getDiagnosisWithAlias(mItem.getName(), mItem.getDummy()) );
            rd.setDiagnosisCode(mItem.getCode());
            rd.setDiagnosisCodeSystem(mItem.getMasterTableId());
            rd.setCategory(open.dolphin.infomodel.IInfoModel.DEFAULT_DIAGNOSIS_CATEGORY);
            rd.setCategoryDesc(open.dolphin.infomodel.IInfoModel.DEFAULT_DIAGNOSIS_CATEGORY_DESC);
            rd.setCategoryCodeSys(open.dolphin.infomodel.IInfoModel.DEFAULT_DIAGNOSIS_CATEGORY_CODESYS);
           
            ret.add(rd);
View Full Code Here

                String codeSystem = ClientContext.getString("mml.codeSystem.diseaseMaster");
               
                for (String code : codes) {
                    for (OrcaEntry entry : deList) {
                        if (code.equals(entry.getCode())) {
                            MasterItem model = new MasterItem();
                            model.setName(entry.getName());
                            model.setCode(entry.getCode());
                            model.setMasterTableId(codeSystem);
                            // alias は dummy を間借りする
                            if (! entry.getCode().startsWith(MODIFIER_CODE)) model.setDummy(alias);
                            tableModel.addRow(model);
                            break;
                        }
                    }
                }
View Full Code Here

           
            @Override
            public void setValueAt(Object o, int row, int col) {
                //if (o == null || ((String) o).trim().equals("")) return;
                // MasterItem に数量を設定する
                MasterItem mItem = (MasterItem) getObject(row);
               
                if (col == 2 && mItem != null) {
                    mItem.setNumber((String) o);
                    // 状態をチェックして,ボタン制御+parent に伝える
                    checkState();
                }
                // MasterItem に診療内容(入力したコメント)を設定する
                if (col == 1 && mItem != null) {
                    mItem.setName((String) o);
                    // 状態をチェックして,ボタン制御+parent に伝える
                    checkState();
                }
            }
        };
View Full Code Here

TOP

Related Classes of open.dolphin.order.MasterItem

Copyright © 2018 www.massapicom. 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.