Package open.dolphin.helper

Examples of open.dolphin.helper.DBTask


        observation.setStarted(date);
        observation.setStatus(IInfoModel.STATUS_FINAL);
        observation.setMemo(model.getMemo());
        addList.add(observation);
       
        DBTask task = new DBTask<List<Long>>(context) {

            @Override
            protected List<Long> doInBackground() throws Exception {
                //logger.debug("allergy add doInBackground");
                DocumentDelegater ddl = new DocumentDelegater();
                List<Long> ids = ddl.addObservations(addList);
                return ids;
            }
           
            @Override
            protected void succeeded(List<Long> result) {
                //logger.debug("allergy add succeeded");
                model.setObservationId(result.get(0));
                boolean asc = Project.getPreferences().getBoolean(Project.DOC_HISTORY_ASCENDING, false);
                if (asc) {
                    tableModel.addRow(model);
                } else {
                    tableModel.addRow(0, model);
                }
                scroll(asc);
            }
        };
       
        task.execute();
    }
View Full Code Here


        final List<Long> list = new ArrayList<Long>(1);
//pns   list.add(new Long(model.getObservationId()));
        list.add(Long.valueOf(model.getObservationId()));

        DBTask task = new DBTask<Void>(this.context) {

            @Override
            protected Void doInBackground() throws Exception {
               // logger.debug("allergy delete doInBackground");
                DocumentDelegater ddl = new DocumentDelegater();
                ddl.removeObservations(list);
                return null;
            }

            @Override
            protected void succeeded(Void result) {
                //logger.debug("allergy delete succeeded");
                tableModel.deleteRow(row);
            }
        };

        task.execute();
    }
View Full Code Here

        spec.setKarteId(getContext().getKarte().getId());
        spec.setFromDate(fromDate);
        spec.setToDate(MMLDate.getDate());
        ldl = new LaboDelegater();

        DBTask task = new DBTask<Void>(getContext()) {

            @Override
            public Void doInBackground() throws Exception {
                List<LaboModuleValue> results = (List<LaboModuleValue>) ldl.getLaboModules(spec);
                if (results == null || results.size() == 0) {
                    return null;
                }               
                if (laboModules != null) {
                    laboModules.clear();
                }
                laboModules = new Vector<SimpleLaboModule>();

                // LaboModuleValueをイテレートし、テーブルへ表示できるデータに分解する
                for (LaboModuleValue moduleValue : results) {

                    // LaboModuleValuの簡易版オブジェクトを生成しベクトルに加える
                    SimpleLaboModule simpleLaboModule = new SimpleLaboModule();
                    laboModules.add(simpleLaboModule);

                    // 簡易版に値を設定する
                    simpleLaboModule.setSampleTime(moduleValue.getSampleTime());
                    simpleLaboModule.setRegistTime(moduleValue.getRegistTime());
                    simpleLaboModule.setReportTime(moduleValue.getReportTime());
                    simpleLaboModule.setMmlConfirmDate(moduleValue.getConfirmDate());
                    simpleLaboModule.setReportStatus(moduleValue.getReportStatus());
                    simpleLaboModule.setTestCenterName(moduleValue.getLaboratoryCenter());
                    simpleLaboModule.setSet(moduleValue.getSetName());

                    // Module に含まれる標本をイテレートする
                    Collection<LaboSpecimenValue> specimens = moduleValue.getLaboSpecimens();

                    if (specimens != null) {

                        for (LaboSpecimenValue bean : specimens) {

                            // 簡易版ラボテストオブジェクトを生成し簡易版のモジュールへ加える
                            SimpleLaboTest laboTest = new SimpleLaboTest();
                            simpleLaboModule.addSimpleLaboTest(laboTest);
                            SimpleLaboSpecimen specimen = new SimpleLaboSpecimen();
                            laboTest.setSimpleSpecimen(specimen);

                            specimen.setSpecimenCodeID(bean.getSpecimenCodeId());
                            specimen.setSpecimenCode(bean.getSpecimenCode());
                            specimen.setSpecimenName(bean.getSpecimenName());

//pns^                       以前の検査項目を消さないようにする
                            if (allLaboTest == null) {
                                allLaboTest = new AllLaboTest();
                            }
//                          // 検索期間に含まれる全ての検査を保持するオブジェクト - allLaboTestsを生成する
//                          if (allLaboTest != null) {
//                              allLaboTest.clear();
//                          }
//                          // 標本をキーとして登録する
//                          allLaboTest = new AllLaboTest();
//pns$
                            allLaboTest.addSpecimen(specimen);

                            // Specimenに含まれる Item をイテレートする
                            Collection<LaboItemValue> items = bean.getLaboItems();

                            if (items != null) {

                                for (LaboItemValue itemBean : items) {

                                    // 検索項目を標本キーの値(TreeSet)として登録する
                                    SimpleLaboTestItem testItem = new SimpleLaboTestItem();
                                    LaboTestItemID testItemID = new LaboTestItemID();

                                    testItem.setItemCodeID(itemBean.getItemCodeId());
                                    testItemID.setItemCodeID(itemBean.getItemCodeId());

                                    testItem.setItemCode(itemBean.getItemCode());
                                    testItemID.setItemCode(itemBean.getItemCode());

                                    testItem.setItemName(trimJSpace(itemBean.getItemName()));
                                    testItemID.setItemName(trimJSpace(itemBean.getItemName()));

                                    allLaboTest.addTestItem(specimen, testItemID);

                                    testItem.setItemValue(itemBean.getItemValue());
                                    testItem.setItemUnit(itemBean.getUnit());
                                    testItem.setLow(itemBean.getLow());
                                    testItem.setUp(itemBean.getUp());
                                    testItem.setNormal(itemBean.getNormal());
                                    testItem.setOut(itemBean.getNout());

                                    laboTest.addSimpleLaboTestItem(testItem);
                                }
                            }
                        }
                    }
                }

                return null;
            }
           
            @Override
            public void succeeded(Void result) {
                int count = laboModules != null ? laboModules.size() : 0;
                countField.setText(String.valueOf(count));
                generateObjectsForTable();
                constructTable();
            }
        };

        task.execute();
    }
View Full Code Here

        if (addList.size() == 0) {
            return;
        }

        DBTask task = new DBTask<List<Long>>(context) {

            @Override
            protected List<Long> doInBackground() throws Exception {
                logger.debug("physical add doInBackground");
                DocumentDelegater pdl = new DocumentDelegater();
                List<Long> ids = pdl.addObservations(addList);
                return ids;
            }

            @Override
            protected void succeeded(List<Long> result) {
                logger.debug("physical add succeeded");
                if (model.getHeight() != null && model.getWeight() != null) {
                    model.setHeightId(result.get(0));
                    model.setWeightId(result.get(1));
                } else if (model.getHeight() != null) {
                    model.setHeightId(result.get(0));
                } else {
                    model.setWeightId(result.get(0));
                }
                boolean asc = Project.getPreferences().getBoolean(Project.DOC_HISTORY_ASCENDING, false);
                if (asc) {
                    tableModel.addRow(model);
                } else {
                    tableModel.addRow(0, model);
                }
                scroll(asc);
            }
        };

        task.execute();
    }
View Full Code Here

        if (model.getWeight() != null) {
//pns       list.add(new Long(model.getWeightId()));
            list.add(Long.valueOf(model.getWeightId()));
        }
       
        DBTask task = new DBTask<Void>(context) {

            @Override
            protected Void doInBackground() throws Exception {
                logger.debug("physical delete doInBackground");
                DocumentDelegater ddl = new DocumentDelegater();
                ddl.removeObservations(list);
                return null;
            }
           
            @Override
            protected void succeeded(Void result) {
                logger.debug("physical delete succeeded");
                tableModel.deleteRow(row);
            }
        };
       
        task.execute();
    }
View Full Code Here

        patientMemoModel.setRecorded(confirmed);
        patientMemoModel.setStarted(confirmed);
        patientMemoModel.setStatus(IInfoModel.STATUS_FINAL);
        patientMemoModel.setMemo(memoArea.getText().trim());
       
        DBTask task = new DBTask<Void>(context) {

            @Override
            protected Void doInBackground() throws Exception {
                logger.debug("updateMemo doInBackground");
                DocumentDelegater ddl = new DocumentDelegater();
                ddl.updatePatientMemo(patientMemoModel);
                return null;
            }
           
            @Override
            protected void succeeded(Void result) {
                logger.debug("updateMemo succeeded");
            }
        };
       
        task.execute();
    }
View Full Code Here

    public void save() {
       
        final PatientModel update = getContext().getPatient();
        final PatientDelegater pdl = new PatientDelegater();
       
        DBTask task = new DBTask<Void>(getContext()) {
           
            @Override
            public Void doInBackground() throws Exception {
                pdl.updatePatient(update);
                return null;
            }
           
            @Override
            public void succeeded(Void result) {
                stateMgr.processSavedEvent();
            }
        };
       
        task.execute();
    }
View Full Code Here

        final ImageSearchSpec spec = new ImageSearchSpec();
        spec.setCode(ImageSearchSpec.ID_SEARCH);
        spec.setId(entry.getId());
        final DocumentDelegater ddl = new DocumentDelegater();
       
        DBTask task = new DBTask<SchemaModel>(myParent.getContext()) {
           
            @Override
            public SchemaModel doInBackground() throws Exception {
                return ddl.getImage(spec.getId());
            }
           
            @Override
            public void succeeded(SchemaModel result) {
                openDialog(result);
            }
        };

        task.execute();
    }
View Full Code Here

                toDate[2] = c2.getLastDate() + "T23:59:59";
                spec.setToDate(toDate);*/
       
        final DocumentDelegater ddl = new DocumentDelegater();
       
        DBTask task = new DBTask<List[]>(getContext()) {
           
            @Override
            public List[] doInBackground() throws Exception {
                List[] ret = new List[2];
                List modules = ddl.getModuleList(spec);
                ret[0] = modules;
    if (appo) {
                    List appointments = ddl.getAppoinmentList(spec);
                    ret[1] = appointments;
    }
                return ret;
            }
           
            @Override
            public void succeeded(List[] result) {
                setAllModules(result[0]);
                if (appo) {
                    setAllAppointments(result[1]);
                }
            }
        };
       
        task.execute();
    }
View Full Code Here

       
        spec.setIconSize(new Dimension(IMAGE_WIDTH, IMAGE_HEIGHT));
       
        final DocumentDelegater ddl = new DocumentDelegater();
       
        DBTask task = new DBTask<List>(getContext()) {
           
            @Override
            public List doInBackground() throws Exception {
                return ddl.getImageList(spec);
            }
           
            @Override
            public void succeeded(List result) {
                setAllImages(result);
            }
        };
       
        task.execute();
    }
View Full Code Here

TOP

Related Classes of open.dolphin.helper.DBTask

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.