public static ObservableCollection<YellowstonePathology.Business.Patient.Model.PatientLinkingListItem> GetPatientLinkingList(YellowstonePathology.Business.Patient.Model.PatientLinkingListItem patientLinkingListItem)
        {
            ObservableCollection<YellowstonePathology.Business.Patient.Model.PatientLinkingListItem> result = new ObservableCollection<Patient.Model.PatientLinkingListItem>();
            SqlCommand cmd = new SqlCommand("pGetPatientLinking");
            cmd.CommandType = CommandType.StoredProcedure;

            cmd.Parameters.Add("@MasterAccessionNo", SqlDbType.VarChar).Value = patientLinkingListItem.MasterAccessionNo;
            cmd.Parameters.Add("@PFirstName", SqlDbType.VarChar).Value = patientLinkingListItem.PFirstName;
            cmd.Parameters.Add("@PLastName", SqlDbType.VarChar).Value = patientLinkingListItem.PLastName;
            cmd.Parameters.Add("@PSSN", SqlDbType.VarChar).Value = DBNull.Value;
            if (string.IsNullOrEmpty(patientLinkingListItem.PSSN) == false)
            {
                cmd.Parameters["@PSSN"].Value = patientLinkingListItem.PSSN;
            }
            cmd.Parameters.Add("@PatientId", SqlDbType.VarChar).Value = DBNull.Value;
            if (string.IsNullOrEmpty(patientLinkingListItem.PatientId) == false)
            {
                cmd.Parameters["@PatientId"].Value = patientLinkingListItem.PatientId;
            }
            cmd.Parameters.Add("@PBirthdate", SqlDbType.DateTime).Value = patientLinkingListItem.PBirthdate.Value;

            using (SqlConnection cn = new SqlConnection(Properties.Settings.Default.ProductionConnectionString))
            {
                cn.Open();
                cmd.Connection = cn;
                using (SqlDataReader dr = cmd.ExecuteReader())
                {
                    while (dr.Read())
                    {
                        YellowstonePathology.Business.Patient.Model.PatientLinkingListItem item = new YellowstonePathology.Business.Patient.Model.PatientLinkingListItem();
                        YellowstonePathology.Business.Domain.Persistence.DataReaderPropertyWriter propertyWriter = new Business.Domain.Persistence.DataReaderPropertyWriter(dr);
                        item.WriteProperties(propertyWriter);
                        result.Add(item);
                    }
                }
            }
            return result;
        }
Example #2
0
 public BirthdateLastFirstRule(YellowstonePathology.Business.Patient.Model.PatientLinkingListItem itemToLink, YellowstonePathology.Business.Patient.Model.PatientLinkingListItem itemToMatch)
 {
     this.m_ItemToLink  = itemToLink;
     this.m_ItemToMatch = itemToMatch;
 }
        public static ObservableCollection <YellowstonePathology.Business.Patient.Model.PatientLinkingListItem> GetPatientLinkingList(YellowstonePathology.Business.Patient.Model.PatientLinkingListItem patientLinkingListItem)
        {
            ObservableCollection <YellowstonePathology.Business.Patient.Model.PatientLinkingListItem> result = new ObservableCollection <Patient.Model.PatientLinkingListItem>();
            SqlCommand cmd = new SqlCommand("pGetPatientLinking");

            cmd.CommandType = CommandType.StoredProcedure;

            cmd.Parameters.Add("@MasterAccessionNo", SqlDbType.VarChar).Value = patientLinkingListItem.MasterAccessionNo;
            cmd.Parameters.Add("@PFirstName", SqlDbType.VarChar).Value        = patientLinkingListItem.PFirstName;
            cmd.Parameters.Add("@PLastName", SqlDbType.VarChar).Value         = patientLinkingListItem.PLastName;
            cmd.Parameters.Add("@PSSN", SqlDbType.VarChar).Value = DBNull.Value;
            if (string.IsNullOrEmpty(patientLinkingListItem.PSSN) == false)
            {
                cmd.Parameters["@PSSN"].Value = patientLinkingListItem.PSSN;
            }
            cmd.Parameters.Add("@PatientId", SqlDbType.VarChar).Value = DBNull.Value;
            if (string.IsNullOrEmpty(patientLinkingListItem.PatientId) == false)
            {
                cmd.Parameters["@PatientId"].Value = patientLinkingListItem.PatientId;
            }
            cmd.Parameters.Add("@PBirthdate", SqlDbType.DateTime).Value = patientLinkingListItem.PBirthdate.Value;

            using (SqlConnection cn = new SqlConnection(Properties.Settings.Default.ProductionConnectionString))
            {
                cn.Open();
                cmd.Connection = cn;
                using (SqlDataReader dr = cmd.ExecuteReader())
                {
                    while (dr.Read())
                    {
                        YellowstonePathology.Business.Patient.Model.PatientLinkingListItem        item           = new YellowstonePathology.Business.Patient.Model.PatientLinkingListItem();
                        YellowstonePathology.Business.Domain.Persistence.DataReaderPropertyWriter propertyWriter = new Business.Domain.Persistence.DataReaderPropertyWriter(dr);
                        item.WriteProperties(propertyWriter);
                        result.Add(item);
                    }
                }
            }
            return(result);
        }
Example #4
0
        public static ObservableCollection <YellowstonePathology.Business.Patient.Model.PatientLinkingListItem> GetPatientLinkingList(YellowstonePathology.Business.Patient.Model.PatientLinkingListItem patientLinkingListItem)
        {
            ObservableCollection <YellowstonePathology.Business.Patient.Model.PatientLinkingListItem> result = new ObservableCollection <Patient.Model.PatientLinkingListItem>();
            MySqlCommand cmd = new MySqlCommand("pGetPatientLinkingV2");

            cmd.CommandType = CommandType.StoredProcedure;

            cmd.Parameters.AddWithValue("MasterAccessionNo", patientLinkingListItem.MasterAccessionNo);
            cmd.Parameters.AddWithValue("PFirstName", patientLinkingListItem.PFirstName);
            cmd.Parameters.AddWithValue("PLastName", patientLinkingListItem.PLastName);
            cmd.Parameters.AddWithValue("PSSN", DBNull.Value);
            if (string.IsNullOrEmpty(patientLinkingListItem.PSSN) == false)
            {
                cmd.Parameters["PSSN"].Value = patientLinkingListItem.PSSN;
            }
            cmd.Parameters.AddWithValue("PatientId", DBNull.Value);
            if (string.IsNullOrEmpty(patientLinkingListItem.PatientId) == false)
            {
                cmd.Parameters["PatientId"].Value = patientLinkingListItem.PatientId;
            }
            cmd.Parameters.AddWithValue("PBirthdate", patientLinkingListItem.PBirthdate.Value);

            using (MySqlConnection cn = new MySqlConnection(YellowstonePathology.Properties.Settings.Default.CurrentConnectionString))
            {
                cn.Open();
                cmd.Connection = cn;
                using (MySqlDataReader dr = cmd.ExecuteReader())
                {
                    while (dr.Read())
                    {
                        YellowstonePathology.Business.Patient.Model.PatientLinkingListItem    item           = new YellowstonePathology.Business.Patient.Model.PatientLinkingListItem();
                        YellowstonePathology.Business.Persistence.SqlDataReaderPropertyWriter propertyWriter = new Business.Persistence.SqlDataReaderPropertyWriter(item, dr);
                        propertyWriter.WriteProperties();
                        result.Add(item);
                    }
                }
            }
            return(result);
        }
 public BirthdateLastFirstRule(YellowstonePathology.Business.Patient.Model.PatientLinkingListItem itemToLink, YellowstonePathology.Business.Patient.Model.PatientLinkingListItem itemToMatch)
 {
     this.m_ItemToLink = itemToLink;
     this.m_ItemToMatch = itemToMatch;
 }