예제 #1
0
 private static ServiceAnalysis.ArrayOfString stringListToServiceAnalysisStringList(List<string> prescrI)
 {
     ServiceAnalysis.ArrayOfString prescr = new ServiceAnalysis.ArrayOfString();
        foreach (string line in prescrI)
        {
        prescr.Add(line);
        }
        return prescr;
 }
예제 #2
0
        private void analysePrescription()
        {
            string patient = patientControl2.getPatientJson();
               if(patient!=null && patient!=""){

            ServiceAnalysis.ArrayOfString prescr = new ServiceAnalysis.ArrayOfString();
            foreach (DataGridViewRow row in dataGridView1.Rows)
            {
                if (row.Cells[GRID_NAME].Value!=null && row.Cells[GRID_NAME].ToolTipText != "")
                {
                     prescr.Add((string)row.Cells[GRID_NAME].ToolTipText);
                }
            }
                DateTime now = DateTime.Now;
                PrescriptionAnalysisDto result =  helper.AnalysisService_getAlerts(patient,prescr);
                if (result != null)
                {
                    DateTime fin = DateTime.Now;
                    listBox2.Items.Add(fin - now);

                    for (int i = 0; i < result.PrescriptionLineAnalysisList.Count; i++)
                    {
                        PrescriptionLineAnalysisDto line = result.PrescriptionLineAnalysisList[i];
                        if (line.Drug.safetyAlert == false)
                        {
                            dataGridView1.Rows[i].DefaultCellStyle.BackColor = Color.Red;
                        }
                        else
                        {
                            dataGridView1.Rows[i].DefaultCellStyle.BackColor = Color.White;
                        }
                         if (line.AlertList != null)
                        {
                            var iam = from a in line.AlertList where a.Type == "DRUG_INTERACTION" select a;
                            SetAlert(GRID_IAM, i, iam);

                            var CI = from a in line.AlertList where a.Type == "CONTRA_INDICATION" select a;
                            SetAlert(GRID_CI, i, CI);

                            var PE = from a in line.AlertList where a.Type == "PRECAUTION" select a;
                            SetAlert(GRID_PE, i, PE);

                            var sub = from a in line.AlertList where a.Type == "ALLERGY" select a;
                            SetAlert(GRID_SUB, i, sub);

                            var poso = from a in line.AlertList where a.Type == "POSOLOGY" select a;
                            SetAlert(GRID_POSO, i, poso);

                            var warnings = from a in line.AlertList where a.Type == "WARNING" select a;
                            SetAlert(GRID_MEG, i, warnings);

                            var surve = from a in line.AlertList where a.Type == "SURVEILLANCE" select a;
                            SetAlert(GRID_SURVEILLANCE, i, surve);

                            var pci = from a in line.AlertList where a.Type == "PHYSICO_CHEMICAL_INTERACTION" select a;
                            SetAlert(GRID_PCI, i, pci);

                            var redondance = from a in line.AlertList where a.Type == "REDUNDANT_ACTIVE_INGREDIENT" select a;
                            SetAlert(GRID_REDUNDANT, i,redondance);
                        }

                    }
                }
            }
        }