コード例 #1
0
 private void Add(object p)
 {
     if (PatientList != null)
     {
         PatientList.Add(new MyData()
         {
             Name    = PatientName,
             Address = PatientAddr,
             Age     = PatientAge
         });
     }
 }
コード例 #2
0
ファイル: MainViewModel.cs プロジェクト: fR33Q/Dicom
        private void OnRefresh(object obj)
        {
            PatientList.Clear();
            // typ wyszukiwania (rozpoczynamy od pacjenta)
            gdcm.ERootType typ = gdcm.ERootType.ePatientRootType;

            // do jakiego poziomu wyszukujemy
            gdcm.EQueryLevel poziom = gdcm.EQueryLevel.ePatient; // zobacz inne

            // klucze (filtrowanie lub okreœlenie, które dane s¹ potrzebne)
            gdcm.KeyValuePairArrayType klucze = new gdcm.KeyValuePairArrayType();
            //gdcm.Tag tag = new gdcm.Tag(0x0010, 0x0010);
            gdcm.KeyValuePairType klucz1 = new gdcm.KeyValuePairType(new gdcm.Tag(0x0010, 0x0010), "*");
            klucze.Add(klucz1);
            klucze.Add(new gdcm.KeyValuePairType(new gdcm.Tag(0x0010, 0x0020), ""));

            // skonstruuj zapytanie
            gdcm.BaseRootQuery zapytanie = gdcm.CompositeNetworkFunctions.ConstructQuery(typ, poziom, klucze);

            // sprawdŸ, czy zapytanie spe³nia kryteria
            if (!zapytanie.ValidateQuery())
            {
                State = "B³êdne zapytanie";
                return;
            }

            // wykonaj zapytanie
            gdcm.DataSetArrayType wynik = new gdcm.DataSetArrayType();
            bool stan = gdcm.CompositeNetworkFunctions.CFind(IP, ushort.Parse(Port), zapytanie, wynik, AET, "ARCHIWUM");

            // sprawdŸ stan
            if (!stan)
            {
                State = "Nie dzia³a";
                return;
            }

            // poka¿ wyniki
            foreach (gdcm.DataSet x in wynik)
            {
                // jeden element pary klucz-wartoϾ
                gdcm.DataElement de = x.GetDataElement(new gdcm.Tag(0x0010, 0x0020)); // konkretnie 10,20 = PATIENT_ID

                // dostêp jako string
                gdcm.Value val = de.GetValue();  // pobierz wartoϾ dla wskazanego klucza...
                string     str = val.toString(); // ...jako napis
                PatientList.Add(str);
            }
        }
コード例 #3
0
        public MainWindowViewModel()
        {
            PatientList.Add(new PatientData()
            {
                PatientName   = "이선주",
                PatientNumber = "A20",
                PatientGender = "여",
                PatientAge    = 10
            });

            PatientList.Add(new PatientData()
            {
                PatientName   = "송재원",
                PatientNumber = "B30",
                PatientGender = "남",
                PatientAge    = 20
            });

            PatientList.Add(new PatientData()
            {
                PatientName   = "류다영",
                PatientNumber = "C40",
                PatientGender = "여",
                PatientAge    = 30
            });

            PatientList.Add(new PatientData()
            {
                PatientName   = "박종현",
                PatientNumber = "D50",
                PatientGender = "남",
                PatientAge    = 40
            });

            PatientList.Add(new PatientData()
            {
                PatientName   = "채민규",
                PatientNumber = "E60",
                PatientGender = "남",
                PatientAge    = 50
            });
        }
コード例 #4
0
        public static PatientList Patients_Get()
        {
            //DataSet ds;
            //MySqlDataAdapter da;
            PatientList wPatientList = new PatientList();
            Patient     wPatient;

            using (MySqlConnection conn = new MySqlConnection(cmsys_cnnstring))
            {
                try
                {
                    conn.Open();
                    MySqlCommand wCommand = new MySqlCommand("select * from patient", conn);
                    //da = new MySqlDataAdapter("select * from patients", conn);
                    //MySqlCommandBuilder cb = new MySqlCommandBuilder(da);
                    //ds = new DataSet();


                    //da.Fill(ds, "Patients");

                    MySqlDataReader myReader = wCommand.ExecuteReader();
                    while (myReader.Read())
                    {
                        wPatient = new Patient();
                        if (myReader["birth"] != DBNull.Value)
                        {
                            wPatient.birth = myReader.GetDateTime("birth");
                        }
                        if (myReader["business_addy"] != DBNull.Value)
                        {
                            wPatient.business_addy = myReader.GetString("business_addy");
                        }
                        if (myReader["business_city"] != DBNull.Value)
                        {
                            wPatient.business_city = myReader.GetString("business_city");
                        }

                        if (myReader["business_country_id"] != DBNull.Value)
                        {
                            wPatient.business_country_id = myReader.GetInt32("business_country_id");
                        }
                        if (myReader["business_email"] != DBNull.Value)
                        {
                            wPatient.business_email = myReader.GetString("business_email");
                        }
                        if (myReader["business_phone"] != DBNull.Value)
                        {
                            wPatient.business_phone = myReader.GetString("business_phone");
                        }

                        if (myReader["business_province_id"] != DBNull.Value)
                        {
                            wPatient.business_province_id = myReader.GetInt32("business_province_id");
                        }

                        if (myReader["business_province_name"] != DBNull.Value)
                        {
                            wPatient.business_province_name = myReader.GetString("business_province_name");
                        }
                        if (myReader["business_province_name"] != DBNull.Value)
                        {
                            wPatient.business_zip_code = myReader.GetString("business_province_name");
                        }
                        if (myReader["business_province_name"] != DBNull.Value)
                        {
                            wPatient.business_zip_code = myReader.GetString("business_province_name");
                        }
                        if (myReader["business_province_name"] != DBNull.Value)
                        {
                            wPatient.cuil = myReader.GetString("business_province_name");
                        }

                        if (myReader["death"] != DBNull.Value)
                        {
                            wPatient.death = myReader.GetDateTime("death");
                        }

                        //wPatient.extra = myReader.GetString("extra");
                        if (myReader["first_name"] != DBNull.Value)
                        {
                            wPatient.first_name = myReader.GetString("first_name");
                        }
                        if (myReader["home_addy"] != DBNull.Value)
                        {
                            wPatient.home_addy = myReader.GetString("home_addy");
                        }
                        if (myReader["home_city"] != DBNull.Value)
                        {
                            wPatient.home_city = myReader.GetString("home_city");
                        }



                        if (myReader["home_country_id"] != DBNull.Value)
                        {
                            wPatient.home_country_id = myReader.GetInt32("home_country_id");
                        }

                        if (myReader["home_email"] != DBNull.Value)
                        {
                            wPatient.home_phone = myReader.GetString("home_email");
                        }

                        if (myReader["home_province_id"] != DBNull.Value)
                        {
                            wPatient.home_province_id = myReader.GetInt32("home_province_id");
                        }

                        if (myReader["home_province_name"] != DBNull.Value)
                        {
                            wPatient.home_province_name = myReader.GetString("home_province_name");
                        }
                        if (myReader["home_zip_code"] != DBNull.Value)
                        {
                            wPatient.home_zip_code = myReader.GetString("home_zip_code");
                        }

                        wPatient.id1 = myReader.GetInt32("id1");
                        wPatient.id2 = myReader.GetInt32("id2");

                        if (myReader["last_name"] != DBNull.Value)
                        {
                            wPatient.last_name = myReader.GetString("last_name");
                        }

                        if (myReader["marital_status"] != DBNull.Value)
                        {
                            wPatient.marital_status = myReader.GetInt32("marital_status");
                        }

                        if (myReader["notes"] != DBNull.Value)
                        {
                            wPatient.notes = myReader.GetString("notes");
                        }

                        if (myReader["occupation"] != DBNull.Value)
                        {
                            wPatient.occupation = myReader.GetString("occupation");
                        }

                        if (myReader["patient_medins_default_plan_id"] != DBNull.Value)
                        {
                            wPatient.patient_medins_default_plan_id = myReader.GetInt32("patient_medins_default_plan_id");
                        }

                        if (myReader["relative_addy"] != DBNull.Value)
                        {
                            wPatient.relative_addy = myReader.GetString("relative_addy");
                        }

                        if (myReader["relative_city"] != DBNull.Value)
                        {
                            wPatient.relative_city = myReader.GetString("relative_city");
                        }

                        if (myReader["relative_country_id"] != DBNull.Value)
                        {
                            wPatient.relative_country_id = myReader.GetInt32("relative_country_id");
                        }

                        wPatientList.Add(wPatient);
                    }
                    myReader.Close();
                }
                catch (MySql.Data.MySqlClient.MySqlException ex1)
                {
                    Fwk.Exceptions.TechnicalException te = new Fwk.Exceptions.TechnicalException("Problemas de coneccion a base de adatos MySQL\r\ncomuniquese con su administrador", ex1);
                    te.ErrorId = "3001";
                    throw te;
                }
                catch (Exception ex)
                {
                    throw ex;
                }
                return(wPatientList);
            }
        }
コード例 #5
0
        private void initialization()
        {
            IsOk   = false;
            IsInit = true;

            VisibleMaleIcon   = true;
            VisibleFemaleIcon = true;

            PrescriptionList = new ObservableCollection <PrescriptionData>();

            this.AgeCollection = new List <string>()
            {
                "~10대", "20대", "30대", "40대", "50대", "60대", "70대", "80대", "90대~"
            };

            _PatientSearchList = PatientList;


            PatientList.Add(new PatientData()
            {
                PatientName   = "이선주",
                PatientNumber = "A20",
                PatientGender = "여",
                PatientAge    = 10
            });

            PatientList.Add(new PatientData()
            {
                PatientName   = "송재원",
                PatientNumber = "B30",
                PatientGender = "남",
                PatientAge    = 20
            });

            PatientList.Add(new PatientData()
            {
                PatientName   = "류다영",
                PatientNumber = "C40",
                PatientGender = "여",
                PatientAge    = 30
            });

            PatientList.Add(new PatientData()
            {
                PatientName   = "박종현",
                PatientNumber = "D50",
                PatientGender = "남",
                PatientAge    = 40
            });

            PatientList.Add(new PatientData()
            {
                PatientName   = "채민규",
                PatientNumber = "E60",
                PatientGender = "남",
                PatientAge    = 50
            });

            for (int i = 0; i < 10; i++)
            {
                PrescriptionData a = new PrescriptionData()
                {
                    PrescriptionNumber = i + 1
                };
                PrescriptionList.Add(a);
            }
        }