public override void Visit(Test.AliquotOrder aliquotOrder)
 {
     if (aliquotOrder.TestOrderCollection.Exists(this.m_TestOrderId) == true)
     {
         aliquotOrder.TestOrderCollection.Remove(this.m_TestOrderId);
     }
 }
        private void HandleTestOrderAliquotOrder(DataTable dataTable)
        {
            DataTableReader dataTableReader = new DataTableReader(dataTable);

            while (dataTableReader.Read())
            {
                string aliquotOrderId = dataTableReader["AliquotOrderId"].ToString();
                YellowstonePathology.Business.Test.AliquotOrder_Base aliquotOrder = null;
                foreach (Business.Test.PanelSetOrder panelSetOrder in this.m_AccessionOrder.PanelSetOrderCollection)
                {
                    foreach (Business.Test.PanelOrder panelOrder in panelSetOrder.PanelOrderCollection)
                    {
                        foreach (Business.Test.Model.TestOrder testOrder in panelOrder.TestOrderCollection)
                        {
                            if (testOrder.AliquotOrderId == aliquotOrderId)
                            {
                                if (testOrder.AliquotOrder == null)
                                {
                                    aliquotOrder           = new Test.AliquotOrder();
                                    testOrder.AliquotOrder = aliquotOrder;
                                }
                                else
                                {
                                    aliquotOrder = testOrder.AliquotOrder;
                                }

                                YellowstonePathology.Business.Persistence.SqlDataTableReaderPropertyWriter sqlDataTableReaderPropertyWriter = new Persistence.SqlDataTableReaderPropertyWriter(aliquotOrder, dataTableReader);
                                sqlDataTableReaderPropertyWriter.WriteProperties();
                            }
                        }
                    }
                }
            }
        }
Beispiel #3
0
 public override void Visit(Test.AliquotOrder aliquotOrder)
 {
     if (aliquotOrder.TestOrderCollection.Exists(this.m_TestOrder.TestOrderId) == true)
     {
         this.m_TestOrderLeftSideIsRemoved = false;
     }
 }
        private void BuildAliquotOrderTestOrder(Test.AliquotOrder aliquotOrder, XElement aliquotOrderElement)
        {
            List <XElement> aliquotOrderElements = (from item in aliquotOrderElement.Elements("TestOrderCollection")
                                                    select item).ToList <XElement>();

            foreach (XElement testOrderElement in aliquotOrderElements.Elements("TestOrder"))
            {
                YellowstonePathology.Business.Test.Model.TestOrder          testOrder         = new YellowstonePathology.Business.Test.Model.TestOrder();
                YellowstonePathology.Business.Persistence.XmlPropertyWriter xmlPropertyWriter = new Persistence.XmlPropertyWriter(testOrderElement, testOrder);
                xmlPropertyWriter.Write();
                aliquotOrder.TestOrderCollection.Add(testOrder);
            }
        }
        private void BuildAliquotOrderLeftSide(Specimen.Model.SpecimenOrder specimenOrder, XElement specimenOrderElement)
        {
            List <XElement> aliquotOrderElements = (from item in specimenOrderElement.Elements("AliquotOrderCollection")
                                                    select item).ToList <XElement>();

            foreach (XElement aliquotOrderElement in aliquotOrderElements.Elements("AliquotOrder"))
            {
                YellowstonePathology.Business.Test.AliquotOrder             aliquotOrder      = new Test.AliquotOrder();
                YellowstonePathology.Business.Persistence.XmlPropertyWriter xmlPropertyWriter = new Persistence.XmlPropertyWriter(aliquotOrderElement, aliquotOrder);
                xmlPropertyWriter.Write();

                BuildAliquotOrderTestOrder(aliquotOrder, aliquotOrderElement);
                BuildAliquotOrderSlideOrderCollection(aliquotOrder, aliquotOrderElement);
                specimenOrder.AliquotOrderCollection.Add(aliquotOrder);
            }
        }
Beispiel #6
0
        public static YellowstonePathology.Business.Test.AliquotOrderCollection GetAliquotOrderCollectionByReportNo(string reportNo)
        {
            YellowstonePathology.Business.Test.AliquotOrderCollection result = new Test.AliquotOrderCollection();
            SqlCommand cmd = new SqlCommand();

            cmd.CommandText = "gwGetAliquotOrderCollectionByReportNo";
            cmd.CommandType = System.Data.CommandType.StoredProcedure;
            cmd.Parameters.Add("@ReportNo", System.Data.SqlDbType.VarChar).Value = reportNo;

            XElement collectionElement = YellowstonePathology.Business.Domain.Persistence.SqlXmlPersistence.CrudOperations.ExecuteCommand(cmd, Domain.Persistence.DataLocationEnum.ProductionData);

            if (collectionElement != null)
            {
                List <XElement> aliquotElements = (from item in collectionElement.Elements("AliquotOrder") select item).ToList <XElement>();
                foreach (XElement aliquotElement in aliquotElements)
                {
                    YellowstonePathology.Business.Test.AliquotOrder             aliquotOrder      = new Test.AliquotOrder();
                    YellowstonePathology.Business.Persistence.XmlPropertyWriter xmlPropertyWriter = new YellowstonePathology.Business.Persistence.XmlPropertyWriter(aliquotElement, aliquotOrder);
                    xmlPropertyWriter.Write();
                    result.Add(aliquotOrder);
                }
            }
            return(result);
        }
 private void Build(YellowstonePathology.Business.Specimen.Model.SpecimenOrder specimenOrder)
 {
     using (MySqlConnection cn = new MySqlConnection(YellowstonePathology.Properties.Settings.Default.CurrentConnectionString))
     {
         cn.Open();
         this.m_SQLCommand.Connection = cn;
         using (MySqlDataReader dr = this.m_SQLCommand.ExecuteReader())
         {
             while (dr.Read())
             {
                 YellowstonePathology.Business.Persistence.SqlDataReaderPropertyWriter sqlDataReaderPropertyWriter = new Persistence.SqlDataReaderPropertyWriter(specimenOrder, dr);
                 sqlDataReaderPropertyWriter.WriteProperties();
             }
             dr.NextResult();
             while (dr.Read())
             {
                 Business.Test.AliquotOrder aliquotOrder = new Test.AliquotOrder();
                 YellowstonePathology.Business.Persistence.SqlDataReaderPropertyWriter sqlDataReaderPropertyWriter = new Persistence.SqlDataReaderPropertyWriter(aliquotOrder, dr);
                 sqlDataReaderPropertyWriter.WriteProperties();
                 specimenOrder.AliquotOrderCollection.Add(aliquotOrder);
             }
         }
     }
 }
        private void BuildAliquotOrderLeftSide(Specimen.Model.SpecimenOrder specimenOrder, XElement specimenOrderElement)
        {
            List<XElement> aliquotOrderElements = (from item in specimenOrderElement.Elements("AliquotOrderCollection")
                                                   select item).ToList<XElement>();
            foreach (XElement aliquotOrderElement in aliquotOrderElements.Elements("AliquotOrder"))
            {
                YellowstonePathology.Business.Test.AliquotOrder aliquotOrder = new Test.AliquotOrder();
                YellowstonePathology.Business.Persistence.XmlPropertyWriter xmlPropertyWriter = new Persistence.XmlPropertyWriter(aliquotOrderElement, aliquotOrder);
                xmlPropertyWriter.Write();

                BuildAliquotOrderTestOrder(aliquotOrder, aliquotOrderElement);
                BuildAliquotOrderSlideOrderCollection(aliquotOrder, aliquotOrderElement);
                specimenOrder.AliquotOrderCollection.Add(aliquotOrder);
            }
        }
 public override object BuildNew()
 {
     YellowstonePathology.Business.Test.AliquotOrder aliquotOrder = new Test.AliquotOrder();
     this.Build(aliquotOrder);
     return aliquotOrder;
 }
        private void BuildAliquotOrderLeftSide(Specimen.Model.SpecimenOrder specimenOrder, XElement specimenOrderElement)
        {
            List<XElement> aliquotOrderElements = (from item in specimenOrderElement.Elements("AliquotOrderCollection")
                                                   select item).ToList<XElement>();

            specimenOrder.AliquotOrderCollection.RemoveDeleted(aliquotOrderElements.Elements("AliquotOrder"));
            foreach (XElement aliquotOrderElement in aliquotOrderElements.Elements("AliquotOrder"))
            {
                string aliquotOrderId = aliquotOrderElement.Element("AliquotOrderId").Value;
                YellowstonePathology.Business.Test.AliquotOrder aliquotOrder = null;
                if (specimenOrder.AliquotOrderCollection.Exists(aliquotOrderId) == true)
                {
                    aliquotOrder = specimenOrder.AliquotOrderCollection.Get(aliquotOrderId);
                }
                else
                {
                    aliquotOrder = new Test.AliquotOrder();
                    specimenOrder.AliquotOrderCollection.Add(aliquotOrder);
                }

                YellowstonePathology.Business.Persistence.XmlPropertyWriter xmlPropertyWriter = new Persistence.XmlPropertyWriter(aliquotOrderElement, aliquotOrder);
                xmlPropertyWriter.Write();

                BuildAliquotOrderTestOrder(aliquotOrder, aliquotOrderElement);
                BuildAliquotOrderSlideOrderCollection(aliquotOrder, aliquotOrderElement);
            }
        }
        public static YellowstonePathology.Business.Test.AliquotOrderCollection GetAliquotOrderCollectionByReportNo(string reportNo)
        {
            YellowstonePathology.Business.Test.AliquotOrderCollection result = new Test.AliquotOrderCollection();
            SqlCommand cmd = new SqlCommand();
            cmd.CommandText = "gwGetAliquotOrderCollectionByReportNo";
            cmd.CommandType = System.Data.CommandType.StoredProcedure;
            cmd.Parameters.Add("@ReportNo", System.Data.SqlDbType.VarChar).Value = reportNo;

            XElement collectionElement = YellowstonePathology.Business.Domain.Persistence.SqlXmlPersistence.CrudOperations.ExecuteCommand(cmd, Domain.Persistence.DataLocationEnum.ProductionData);
            if (collectionElement != null)
            {
                List<XElement> aliquotElements = (from item in collectionElement.Elements("AliquotOrder") select item).ToList<XElement>();
                foreach (XElement aliquotElement in aliquotElements)
                {
                    YellowstonePathology.Business.Test.AliquotOrder aliquotOrder = new Test.AliquotOrder();
                    YellowstonePathology.Business.Persistence.XmlPropertyWriter xmlPropertyWriter = new YellowstonePathology.Business.Persistence.XmlPropertyWriter(aliquotElement, aliquotOrder);
                    xmlPropertyWriter.Write();
                    result.Add(aliquotOrder);
                }
            }
            return result;
        }
        public static YellowstonePathology.Business.Test.AliquotOrderCollection GetAliquotOrderCollection(string specimenOrderId)
        {
            YellowstonePathology.Business.Test.AliquotOrderCollection result = new Test.AliquotOrderCollection();
            SqlCommand cmd = new SqlCommand();
            cmd.CommandText = "Select * from tblAliquotOrder where SpecimenOrderId = '" + specimenOrderId + "'";
            cmd.CommandType = CommandType.Text;

            using (SqlConnection cn = new SqlConnection(YellowstonePathology.Properties.Settings.Default.CurrentConnectionString))
            {
                cn.Open();
                cmd.Connection = cn;
                using (SqlDataReader dr = cmd.ExecuteReader())
                {
                    while (dr.Read())
                    {
                        YellowstonePathology.Business.Test.AliquotOrder aliquotOrder = new Test.AliquotOrder();
                        YellowstonePathology.Business.Persistence.SqlDataReaderPropertyWriter sqlDataReaderPropertyWriter = new Persistence.SqlDataReaderPropertyWriter(aliquotOrder, dr);
                        sqlDataReaderPropertyWriter.WriteProperties();
                        result.Add(aliquotOrder);
                    }
                }
            }
            return result;
        }
        public static YellowstonePathology.Business.Test.AliquotOrderCollection GetEmbeddingCollection(DateTime embeddingVerifiedDate)
        {
            YellowstonePathology.Business.Test.AliquotOrderCollection result = new Test.AliquotOrderCollection();
            SqlCommand cmd = new SqlCommand();
            cmd.CommandText = "select a.*, null as [TestOrderId] " +
                "from tblAccessionOrder ao " +
                "join tblSpecimenOrder s on ao.MasterAccessionNo = s.masterAccessionNo " +
                "join tblAliquotOrder a on s.SpecimenOrderId = a.SpecimenOrderId " +
                "where a.EmbeddingVerifiedDate between @EmbeddingVerifiedDate and @EmbeddingVerifiedDatePlus1 " +
                "order by a.EmbeddingVerifiedDate desc";

            cmd.CommandType = CommandType.Text;
            cmd.Parameters.Add("@EmbeddingVerifiedDate", SqlDbType.DateTime).Value = embeddingVerifiedDate;
            cmd.Parameters.Add("@EmbeddingVerifiedDatePlus1", SqlDbType.DateTime).Value = embeddingVerifiedDate.AddDays(1);

            using (SqlConnection cn = new SqlConnection(YellowstonePathology.Properties.Settings.Default.CurrentConnectionString))
            {
                cn.Open();
                cmd.Connection = cn;
                using (SqlDataReader dr = cmd.ExecuteReader())
                {
                    while (dr.Read())
                    {
                        YellowstonePathology.Business.Test.AliquotOrder aliquotOrder = new Test.AliquotOrder();
                        YellowstonePathology.Business.Persistence.SqlDataReaderPropertyWriter sqlDataReaderPropertyWriter = new Persistence.SqlDataReaderPropertyWriter(aliquotOrder, dr);
                        sqlDataReaderPropertyWriter.WriteProperties();
                        result.Add(aliquotOrder);
                    }
                }
            }
            return result;
        }
        private void HandleTestOrderAliquotOrder(DataTable dataTable)
        {
            DataTableReader dataTableReader = new DataTableReader(dataTable);
            while (dataTableReader.Read())
            {
                string aliquotOrderId = dataTableReader["AliquotOrderId"].ToString();
                YellowstonePathology.Business.Test.AliquotOrder_Base aliquotOrder = null;
                foreach(Business.Test.PanelSetOrder panelSetOrder in this.m_AccessionOrder.PanelSetOrderCollection)
                {
                    foreach(Business.Test.PanelOrder panelOrder in panelSetOrder.PanelOrderCollection)
                    {
                        foreach(Business.Test.Model.TestOrder testOrder in panelOrder.TestOrderCollection)
                        {
                            if (testOrder.AliquotOrderId == aliquotOrderId)
                            {
                                if (testOrder.AliquotOrder == null)
                                {
                                    aliquotOrder = new Test.AliquotOrder();
                                    testOrder.AliquotOrder = aliquotOrder;
                                }
                                else
                                {
                                    aliquotOrder = testOrder.AliquotOrder;
                                }

                                YellowstonePathology.Business.Persistence.SqlDataTableReaderPropertyWriter sqlDataTableReaderPropertyWriter = new Persistence.SqlDataTableReaderPropertyWriter(aliquotOrder, dataTableReader);
                                sqlDataTableReaderPropertyWriter.WriteProperties();
                            }
                        }
                    }
                }

            }
        }
 public override object BuildNew()
 {
     YellowstonePathology.Business.Test.AliquotOrder aliquotOrder = new Test.AliquotOrder();
     this.Build(aliquotOrder);
     return(aliquotOrder);
 }