Package open.dolphin.infomodel

Examples of open.dolphin.infomodel.BundleMed


        IInfoModel obj = module.getModel();
        StringBuilder buf = new StringBuilder();
       
        if (obj instanceof BundleMed) {
           
            BundleMed med = (BundleMed) obj;
           
            buf.append("RP<xhtml:br/>\n");
       
            ClaimItem[] items = med.getClaimItem();
          
            for (ClaimItem item : items) {
               
                buf.append("・");
                buf.append(item.getName());
                buf.append(" ");

                if (item.getNumber() != null) {
                    buf.append(item.getNumber());
                    if (item.getUnit() != null) {
                        buf.append(item.getUnit());
                    }
                }
                buf.append("<xhtml:br/>\n");
            }

            if (med.getAdmin().startsWith("内服")) {
                buf.append(med.getAdmin().substring(0,2));
                buf.append(" ");
                buf.append(med.getAdmin().substring(4));
            } else {
                buf.append(med.getAdmin());
            }
            buf.append(" x ");
            buf.append(med.getBundleNumber());
            // FIXME
            if (med.getAdmin().startsWith("内服")) {
                if (med.getAdmin().charAt(3) == '回') {
                    buf.append(" 日分");
                }
            }
            buf.append("<xhtml:br/>\n");

            // Print admMemo
            if (med.getAdminMemo() != null) {
                buf.append(med.getAdminMemo());
                buf.append("<xhtml:br/>\n");
            }

            // Print admMemo
            if (med.getMemo() != null) {
                buf.append(med.getMemo());
                buf.append("<xhtml:br/>\n");
            }

        }
       
View Full Code Here


            if (!options[0].equals(ans) && !options[1].equals(ans)) {
                return;
            }
           
            // 新たなスタンプ作成
            BundleMed srcBundle = (BundleMed)ctx.getStamp().getModel();
            ModuleModel stamp = createModuleModel(ctx.getStamp());
            BundleMed bundle = (BundleMed) stamp.getModel();
           
            ArrayList<ClaimItem> list = new ArrayList<ClaimItem>();
           
            // 既存のコメント以外はそのまま登録,追加登録の場合は既存のコメントも登録
            for(ClaimItem src : srcBundle.getClaimItem()) {
                if (!src.getCode().startsWith("810000001") || options[0].equals(ans)) {
                    list.add(createClaimItem(src));
                }
            }
            // あらたな ClaimItem を作る
            ClaimItem newComment = new ClaimItem();
            newComment.setClassCode("2");
            newComment.setClassCodeSystem("Claim003");
            newComment.setCode("810000001");
            newComment.setName(tf.getText());
            newComment.setNumber(".");
            newComment.setNumberCode(ClaimConst.YAKUZAI_TOYORYO); // = "10"
            newComment.setNumberCodeSystem("Claim004");
           
            // コメントを登録,ただしコメントに何も入力されていなければリストに追加しない
            if (!tf.getText().trim().equals("")) {
                list.add(newComment);
            }
           
            // できた list を srcBundle に登録
            bundle.setClaimItem(list.toArray(new ClaimItem[list.size()]));
           
            dialog.dispose();
            propertyChanged(stamp);
        }
View Full Code Here

            generic.setNumber(".");
            generic.setNumberCode(ClaimConst.YAKUZAI_TOYORYO); // = "10"
            generic.setNumberCodeSystem("Claim004");
           
            // 新たなスタンプ作成
            BundleMed srcBundle = (BundleMed)ctx.getStamp().getModel();
            ModuleModel stamp = createModuleModel(ctx.getStamp());
            BundleMed bundle = (BundleMed) stamp.getModel();
           
            ArrayList<ClaimItem> list = new ArrayList<ClaimItem>();
           
            // 薬を検索して,最初に見つかった薬の後に一般名処方を入れる
            boolean found = false;
            for(ClaimItem src : srcBundle.getClaimItem()) {
                list.add(createClaimItem(src));
                if (!found && src.getCode().startsWith("6")) {
                    list.add(generic);
                    found = true;
                }
            }
           
            // できた list を srcBundle に登録
            bundle.setClaimItem(list.toArray(new ClaimItem[list.size()]));           
            propertyChanged(stamp);        }
View Full Code Here

    /**
     * 外用剤,内服薬,それぞれに適切なメニュー項目を加える
     */
    public void addStampChangeMenu() {
       
        BundleMed bundle = (BundleMed) ctx.getStamp().getModel();
       
        if (ClaimConst.RECEIPT_CODE_NAIYO.equals(bundle.getClassCode()) ||
            ClaimConst.RECEIPT_CODE_TONYO.equals(bundle.getClassCode())) {

            // 内服薬用の変更メニューを加える
            addBundleChangeMenu();

        } else {
View Full Code Here

     * @return
     */
    private ModuleModel createModuleModel(ModuleModel src) {
       
        ModuleInfoBean srcModuleInfo = src.getModuleInfo();
        BundleMed srcBundle = (BundleMed) src.getModel();
       
        // 複製
        ModuleModel dist = new ModuleModel();
       
        BundleMed distBundle = createBundleMed(srcBundle);
        dist.setModel(distBundle);
       
        ModuleInfoBean distModuleInfo = dist.getModuleInfo();
        distModuleInfo.setEntity(srcModuleInfo.getEntity());
        distModuleInfo.setStampRole(srcModuleInfo.getStampRole());
View Full Code Here

     * BundleMed を複製して返す。ただし ClaimItem は空。
     * @param src
     * @return
     */
    private BundleMed createBundleMed(BundleMed src) {
        BundleMed dist = new BundleMed();
        dist.setAdmin(src.getAdmin());
        dist.setAdminCode(src.getAdminCode());
        dist.setAdminCodeSystem(src.getAdminCodeSystem());
        dist.setAdminMemo(src.getAdminMemo());
        dist.setBundleNumber(src.getBundleNumber());
        dist.setClassCode(src.getClassCode());
        dist.setClassCodeSystem(src.getClassCodeSystem());
        dist.setClassName(src.getClassName());
        dist.setMemo(src.getMemo());
        dist.setOrderName(src.getOrderName());
        return dist;
    }
View Full Code Here

        private static final long serialVersionUID = 1L;
        private int value;

        public BundleChangeAction(int value) {
            this.value = value;
            BundleMed bundle = (BundleMed) ctx.getStamp().getModel();
            String label = ClaimConst.RECEIPT_CODE_NAIYO.equals(bundle.getClassCode())? " 日分" : " 回分";
            putValue(AbstractAction.NAME, String.valueOf(value) + label);
        }
View Full Code Here

            putValue(AbstractAction.NAME, String.valueOf(value) + label);
        }
        @Override
        public void actionPerformed(ActionEvent e) {
            // 変更されていなければそのまま帰る
            BundleMed srcBundle = (BundleMed) ctx.getStamp().getModel();
            if (srcBundle.getBundleNumber().equals(String.valueOf(value))) return;
           
            // コピーして stamp を新たに作成
            ModuleModel stamp = createModuleModel(ctx.getStamp());
            BundleMed bundle = (BundleMed) stamp.getModel();
            // ClaimItem をコピー
            bundle.setClaimItem(createClaimItemInArray());
            // 何日分の部分をセット
            bundle.setBundleNumber(String.valueOf(value));           
           
            propertyChanged(stamp);
        }
View Full Code Here

        }
        @Override
        public void actionPerformed(ActionEvent e) {
           
            // 変更されていなければそのまま帰る
            BundleMed srcBundle = (BundleMed) ctx.getStamp().getModel();
            if (admin.code.equals(srcBundle.getAdminCode())) return;
           
            // 新たなスタンプ作成
            ModuleModel stamp = createModuleModel(ctx.getStamp());
            BundleMed bundle = (BundleMed) stamp.getModel();
            bundle.setAdmin(admin.str);
            bundle.setAdminCode(admin.code);           

            // 変更に応じて投与量が何倍になるか = factor
            int srcTimes = getTimes(srcBundle.getAdminCode());
            int distTimes = getTimes(admin.code);
            double factor = (srcTimes==0)? 1 : (double)distTimes/srcTimes;
           
            ArrayList<ClaimItem> list = new ArrayList<ClaimItem>();
            // ClaimItem をチェックしながらコピー
            for(ClaimItem src : srcBundle.getClaimItem()) {
                ClaimItem dist = createClaimItem(src);
                String str = dist.getName();
                // 1日量文字列がある場合は,投与量を調節する
                if (str.contains("日量")) {
                    double dose = DailyDoseStringTool.getDose(str) * factor;
                    dist.setName(DailyDoseStringTool.getString(str, dose));                   
                }
                list.add(dist);
            }
            // できた list を srcBundle に登録
            bundle.setClaimItem(list.toArray(new ClaimItem[list.size()]));
           
            propertyChanged(stamp);
        }
View Full Code Here

            putValue(AbstractAction.NAME, admin.str);           
        }
        @Override
        public void actionPerformed(ActionEvent e) {
           
            BundleMed srcBundle = (BundleMed) ctx.getStamp().getModel();
           
            // 変更されていなければそのまま帰る
            if (admin.code.equals(srcBundle.getAdminCode())) return;
           
            ModuleModel stamp = createModuleModel(ctx.getStamp());
            BundleMed bundle = (BundleMed) stamp.getModel();
            bundle.setAdmin(admin.str);
            bundle.setAdminCode(admin.code);
            bundle.setClaimItem(createClaimItemInArray());
           
            propertyChanged(stamp);
        }
View Full Code Here

TOP

Related Classes of open.dolphin.infomodel.BundleMed

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.