多返回值的例子

多返回值的例子
    public void getMedicationAndEncounterInfo() throws Exception
    {
        String sql = getParameter("sql");
        if (sql == null || sql.trim().length() < 1)
            return;

        List<List<Object>> list = new MedicationDAO()
                .getMedicationAndEncounterInfo(sql);

        List<PatientOrder> medicationList = list != null && list.size() > 0 ? (List) list
                .get(0) : new ArrayList<PatientOrder>();

        List<PatientInEncounter> encounterList = list != null
                && list.size() > 1 ? (List) list.get(1)
                : new ArrayList<PatientInEncounter>();

        List<PatientDemographics> demoList = list != null && list.size() > 2 ? (List) list
                .get(2) : new ArrayList<PatientDemographics>();

        resp.addParameter("medicationList", medicationList);
        resp.addParameter("encounterList", encounterList);
        resp.addParameter("demoList", demoList);
    }
多返回值的例子
多返回值的例子
public List<List<Object>> getMedicationAndEncounterInfo(String sql)
            throws Exception
    {
        DBOperator dbo = getDBOperator();
        try
        {
            PatientOrderTableAdapter adapt = new PatientOrderTableAdapter(dbo);
            PatientInEncounterTableAdapter paAdapt = new PatientInEncounterTableAdapter(
                    dbo);
            PatientDemographicsTableAdapter deAdapt = new PatientDemographicsTableAdapter(
                    dbo);
            System.out.println("sql=" + sql);
            List<List<Object>> list = dbo.executeQuery(sql, new TableAdapter[]
            { adapt, paAdapt, deAdapt });
            return list;
        } catch (Exception e)
        {
            dbo.rollback();
            throw e;
        } finally
        {
            dbo.close();
        }
    }
多返回值的例子

 

多返回值的例子
public void LoadPatientOrder()
        {
            ServiceRequest request = new MedicationAction().ServiceReqGetMedicationAndEncounterInfo;
            //string sql = "select a.*,b.*,c.* from gemr.patient_order a,gemr.patient_in_encounter b, patient_demographics c"
            //                + " where (a.status=‘" + Constant.OrderStatus_Submited
            //                + "‘ or a.status=‘" + Constant.OrderStatus_NurseConfirmed
            //                + "‘ or (a.status=‘" + Constant.OrderStatus_NurseExecuted
            //                + "‘and a.long_flag=‘Y‘ and a.date_stopped>‘" + DateTime.Today.ToString("yyyy-MM-dd") + "‘)) and a.record_flag = ‘" + App.RecordFlag + "‘ and b.ward_id = ‘"
            //                + App.CurrentUserRoleWardepComb.Ward.WardId + "‘"
            //                + " and a.encounter_id = b.encounter_id and b.demographics_id = c.demographics_id"
            //                + " and (a.deleted_flag <> ‘Y‘ or a.deleted_flag is null) and (b.deleted_flag <> ‘Y‘ or b.deleted_flag is null) and (c.deleted_flag <> ‘Y‘ or c.deleted_flag is null)"
            //                + " order by b.bed_num,a.encounter_id, a.date_started";

            string sql = "select a.*,b.*,c.* from gemr.patient_order a,gemr.patient_in_encounter b, patient_demographics c"
                          + " where a.status=" + ""+ Constant.OrderStatus_Submited+ ""
                          + " and a.record_flag = "  + ""+App.RecordFlag +"" 
                          +" and b.ward_id = "+""+  App.CurrentUserRoleWardepComb.Ward.WardId + ""
                          + " and a.encounter_id = b.encounter_id and b.demographics_id = c.demographics_id"
                          + " and (a.deleted_flag <> ‘Y‘ or a.deleted_flag is null) and (b.deleted_flag <> ‘Y‘ or b.deleted_flag is null) and (c.deleted_flag <> ‘Y‘ or c.deleted_flag is null)"
                          + " order by b.bed_num,a.encounter_id, a.date_started";

            request.AddParameter("sql", sql);

            InvokeService(request, (e) =>
            {
                if (e.Response == null) return;
                List<PatientOrder> medicationList = e.Response.GetParameterAsList<PatientOrder>("medicationList");
                List<PatientInEncounter> encounterList = e.Response.GetParameterAsList<PatientInEncounter>("encounterList");
                List<PatientDemographics> demoList = e.Response.GetParameterAsList<PatientDemographics>("demoList");
                List<PatientMedicationCombo> comboList = new List<PatientMedicationCombo>();
                for (int i = 0; i < medicationList.Count; i++)
                {
                    PatientInEncounter encou = null;
                    PatientDemographics demo = null;
                    PatientOrder medi = medicationList[i];

                    if (OrderType.Medication.ToString() != medi.OrderType
                        && Constant.OrderStatus_NurseExecuted.Equals(medi.Status))
                    {
                        continue;
                    }

                    if (i < encounterList.Count)
                    {
                        encou = encounterList[i];
                    }
                    if (i < demoList.Count)
                    {
                        demo = demoList[i];
                    }
                    PatientMedicationCombo combo = new PatientMedicationCombo(medi, encou, demo);
                    comboList.Add(combo);
                }

                //if (comboList != null && comboList.Count > 0)
                //{
                //    comboList = comboList.OrderByDescending(c => c.EncounterInfo).ToList();
                //}

                gridControl1.ItemsSource = comboList;
                gridControl1.ExpandAllGroups();
            });
        }
多返回值的例子

多返回值的例子

上一篇:TOJ 2119 Tangled in Cables


下一篇:1、拍静止的小东西,尽量在1m以内拍摄,使背景虚化! 光线好的话,iso100,光线不好的话,iso最好400以内。 2、拍人: 基本都是使用较大的光圈(f5.6以内)、50mm以上的焦距,拍摄距离视全身、半身、大头照而定,