public static YellowstonePathology.Business.Test.Model.TestOrder BuildTestOrder(XElement testOrderElement)
 {
     YellowstonePathology.Business.Test.Model.TestOrder testOrder = new YellowstonePathology.Business.Test.Model.TestOrder();
     YellowstonePathology.Business.Persistence.XmlPropertyWriter xmlPropertyWriter = new Persistence.XmlPropertyWriter(testOrderElement, testOrder);
     xmlPropertyWriter.Write();
     return testOrder;
 }
        private void BuildSlideOrderTestOrder(YellowstonePathology.Business.Slide.Model.SlideOrder slideOrder, XElement slideOrderElement)
        {
            XElement testOrderElement = slideOrderElement.Element("TestOrder");

            if (testOrderElement != null)
            {
                YellowstonePathology.Business.Test.Model.TestOrder          testOrder         = new YellowstonePathology.Business.Test.Model.TestOrder();
                YellowstonePathology.Business.Persistence.XmlPropertyWriter xmlPropertyWriter = new Persistence.XmlPropertyWriter(testOrderElement, testOrder);
                xmlPropertyWriter.Write();
                slideOrder.TestOrder = testOrder;
            }
        }
        private void BuildTestOrderAliquotOrder(YellowstonePathology.Business.Test.Model.TestOrder testOrder, XElement testOrderElement)
        {
            XElement aliquotOrderElement = testOrderElement.Element("AliquotOrder");

            if (aliquotOrderElement != null)
            {
                YellowstonePathology.Business.Test.AliquotOrder_Base        aliquotOrder      = new Test.AliquotOrder_Base();
                YellowstonePathology.Business.Persistence.XmlPropertyWriter xmlPropertyWriter = new Persistence.XmlPropertyWriter(aliquotOrderElement, aliquotOrder);
                xmlPropertyWriter.Write();
                testOrder.AliquotOrder = aliquotOrder;
            }
        }
        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);
            }
        }
示例#5
0
        public void Build(XElement rootElement)
        {
            if (rootElement != null)
            {
                YellowstonePathology.Business.Client.Model.Client           client            = new YellowstonePathology.Business.Client.Model.Client();
                YellowstonePathology.Business.Persistence.XmlPropertyWriter xmlPropertyWriter = new Persistence.XmlPropertyWriter(rootElement, client);
                xmlPropertyWriter.Write();

                BuildLocation(client, rootElement);
                this.m_Client = client;
            }
            else
            {
                this.m_Client = null;
            }
        }
示例#6
0
        public void Build(XElement rootElement)
        {
            if (rootElement != null)
            {
                YellowstonePathology.Business.Client.Model.Client client = new YellowstonePathology.Business.Client.Model.Client();
                YellowstonePathology.Business.Persistence.XmlPropertyWriter xmlPropertyWriter = new Persistence.XmlPropertyWriter(rootElement, client);
                xmlPropertyWriter.Write();

                BuildLocation(client, rootElement);
                this.m_Client = client;
            }
            else
            {
                this.m_Client = null;
            }
        }
        private void BuildTestOrderRightSide(Test.PanelOrder panelOrder, XElement panelOrderElement)
        {
            List <XElement> testOrderElements = (from item in panelOrderElement.Elements("TestOrderCollection")
                                                 select item).ToList <XElement>();

            foreach (XElement testOrderElement in testOrderElements.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();

                BuildTestOrderAliquotOrder(testOrder, testOrderElement);
                BuildTestOrderSlideOrderCollection(testOrder, testOrderElement);
                panelOrder.TestOrderCollection.Add(testOrder);
            }
        }
        private void BuildSpecimenOrder(Test.AccessionOrder accessionOrder, XElement accessionOrderElement)
        {
            accessionOrder.SpecimenOrderCollection.IsLoading = true;
            List <XElement> specimenOrderElements = (from item in accessionOrderElement.Elements("SpecimenOrderCollection")
                                                     select item).ToList <XElement>();

            foreach (XElement specimenOrderElement in specimenOrderElements.Elements("SpecimenOrder"))
            {
                Specimen.Model.SpecimenOrder specimenOrder = new Specimen.Model.SpecimenOrder();
                YellowstonePathology.Business.Persistence.XmlPropertyWriter xmlPropertyWriter = new Persistence.XmlPropertyWriter(specimenOrderElement, specimenOrder);
                xmlPropertyWriter.Write();
                BuildAliquotOrderLeftSide(specimenOrder, specimenOrderElement);
                accessionOrder.SpecimenOrderCollection.Add(specimenOrder);
            }
            accessionOrder.SpecimenOrderCollection.IsLoading = false;
        }
        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);
            }
        }
        private void BuildClientSupplyOrder(YellowstonePathology.Business.Client.Model.ClientSupplyOrder clientSupplyOrder)
        {
            using (SqlConnection cn = new SqlConnection(YellowstonePathology.Business.Properties.Settings.Default.CurrentConnectionString))
            {
                cn.Open();
                this.m_SQLCommand.Connection = cn;
                using (XmlReader xmlReader = this.m_SQLCommand.ExecuteXmlReader())
                {
                    if (xmlReader.Read() == true)
                    {
                        XElement result = XElement.Load(xmlReader, LoadOptions.PreserveWhitespace);
                        YellowstonePathology.Business.Persistence.XmlPropertyWriter xmlPropertyWriter = new Persistence.XmlPropertyWriter(result, clientSupplyOrder);
                        xmlPropertyWriter.Write();

                        BuildClientSupplyOrderDetail(clientSupplyOrder, result);
                    }
                }
            }
        }
示例#11
0
        private void BuildClientSupplyOrder(YellowstonePathology.Business.Client.Model.ClientSupplyOrder clientSupplyOrder)
        {
            using (SqlConnection cn = new SqlConnection(YellowstonePathology.Business.Properties.Settings.Default.CurrentConnectionString))
            {
                cn.Open();
                this.m_SQLCommand.Connection = cn;
                using (XmlReader xmlReader = this.m_SQLCommand.ExecuteXmlReader())
                {
                    if (xmlReader.Read() == true)
                    {
                        XElement result = XElement.Load(xmlReader, LoadOptions.PreserveWhitespace);
                        YellowstonePathology.Business.Persistence.XmlPropertyWriter xmlPropertyWriter = new Persistence.XmlPropertyWriter(result, clientSupplyOrder);
                        xmlPropertyWriter.Write();

                        BuildClientSupplyOrderDetail(clientSupplyOrder, result);
                    }
                }
            }
        }
        /*        public static Domain.ClientCollection GetClientsByPhysicianId(int physicianId)
        {
        #if MONGO
            return PhysicianClientGatewayMongo.GetClientsByPhysicianId(physicianId);
        #else
            Domain.ClientCollection result = new Domain.ClientCollection();

            SqlCommand cmd = new SqlCommand();
            cmd.CommandText = "select c.* " +
               "from tblClient c " +
               "join tblPhysicianClient pc on c.ClientId = pc.ClientId " +
               "where pc.PhysicianId = @PhysicianId ";
            cmd.Parameters.Add("@PhysicianId", SqlDbType.Int).Value = physicianId;
            cmd.CommandType = CommandType.Text;

            using (SqlConnection cn = new SqlConnection(YellowstonePathology.Business.BaseData.SqlConnectionString))
            {
                cn.Open();
                cmd.Connection = cn;
                using (SqlDataReader dr = cmd.ExecuteReader())
                {
                    while (dr.Read())
                    {
                        YellowstonePathology.Business.Client.Model.Client client = new YellowstonePathology.Business.Client.Model.Client();
                        YellowstonePathology.Business.Persistence.SqlDataReaderPropertyWriter sqlDataReaderPropertyWriter = new Persistence.SqlDataReaderPropertyWriter(client, dr);
                        sqlDataReaderPropertyWriter.WriteProperties();
                        result.Add(client);
                    }
                }
            }
            return result;
        #endif
        }*/
        /*        public static Domain.PhysicianClient GetPhysicianClient(int physicianId, int clientId)
        {
        #if MONGO
            return PhysicianClientGatewayMongo.GetPhysicianClient(physicianId, clientId);
        #else
            Domain.PhysicianClient result = null;
            SqlCommand cmd = new SqlCommand();
            cmd.CommandText = "Select * from tblPhysicianClient where PhysicianId = @PhysicianId and ClientId = @ClientId";
            cmd.CommandType = CommandType.Text;
            cmd.Parameters.Add("@PhysicianId", SqlDbType.Int).Value = physicianId;
            cmd.Parameters.Add("@ClientId", SqlDbType.Int).Value = clientId;

            using (SqlConnection cn = new SqlConnection(YellowstonePathology.Business.BaseData.SqlConnectionString))
            {
                cn.Open();
                cmd.Connection = cn;
                using (SqlDataReader dr = cmd.ExecuteReader())
                {
                    while (dr.Read())
                    {
                        result = new Domain.PhysicianClient();
                        YellowstonePathology.Business.Persistence.SqlDataReaderPropertyWriter sqlDataReaderPropertyWriter = new Persistence.SqlDataReaderPropertyWriter(result, dr);
                        sqlDataReaderPropertyWriter.WriteProperties();
                    }
                }
            }

            return result;
        #endif
        }

        public static View.ClientPhysicianView GetClientPhysicianViewByClientId(int clientId)
        {
        #if MONGO
            return PhysicianClientGatewayMongo.GetClientPhysicianViewByClientId(clientId);
        #else
            View.ClientPhysicianView result = null;
            SqlCommand cmd = new SqlCommand();
            cmd.CommandText = "with phys as(select p.* from tblPhysician p join tblPhysicianClient pc on p.PhysicianId = pc.PhysicianId where pc.ClientId = @ClientId) " +
                "select c.*," +
                " ( select phys.*" +
                "   from phys order by phys.FirstName for xml Path('Physician'), type) Physicians" +
                " from tblClient c where c.ClientId = @ClientId for xml Path('Client'), root('ClientPhysicianView')";
            cmd.CommandType = CommandType.Text;
            cmd.Parameters.Add("@ClientId", SqlDbType.Int).Value = clientId;
            XElement resultElement = PhysicianClientGateway.GetXElementFromCommand(cmd);
            if (resultElement != null)
            {
                result = PhysicianClientGateway.BuildClientPhysicianView(resultElement);
            }
            return result;
        #endif
        }*/
        private static View.ClientPhysicianView BuildClientPhysicianView(XElement sourceElement)
        {
            View.ClientPhysicianView result = new View.ClientPhysicianView();
            XElement clientElement = sourceElement.Element("Client");
            YellowstonePathology.Business.Persistence.XmlPropertyWriter xmlPropertyWriter = new Persistence.XmlPropertyWriter(clientElement, result);
            xmlPropertyWriter.Write();

            XElement physiciansElement = clientElement.Element("Physicians");
            if(physiciansElement != null)
            {
                List<XElement> physicianElements = physiciansElement.Elements("Physician").ToList<XElement>();
                foreach (XElement physicianElement in physicianElements)
                {
                    Domain.Physician physician = new Domain.Physician();
                    YellowstonePathology.Business.Persistence.XmlPropertyWriter xmlPropertyWriter1 = new Persistence.XmlPropertyWriter(physicianElement, physician);
                    xmlPropertyWriter1.Write();
                    result.Physicians.Add(physician);
                }
            }
            return result;
        }
 private void BuildTestOrderAliquotOrder(YellowstonePathology.Business.Test.Model.TestOrder testOrder, XElement testOrderElement)
 {
     XElement aliquotOrderElement = testOrderElement.Element("AliquotOrder");
     if (aliquotOrderElement != null)
     {
         YellowstonePathology.Business.Test.AliquotOrder_Base aliquotOrder = new Test.AliquotOrder_Base();
         YellowstonePathology.Business.Persistence.XmlPropertyWriter xmlPropertyWriter = new Persistence.XmlPropertyWriter(aliquotOrderElement, aliquotOrder);
         xmlPropertyWriter.Write();
         testOrder.AliquotOrder = aliquotOrder;
     }
 }
 private void BuildSlideOrderTestOrder(YellowstonePathology.Business.Slide.Model.SlideOrder slideOrder, XElement slideOrderElement)
 {
     XElement testOrderElement = slideOrderElement.Element("TestOrder");
     if (testOrderElement != null)
     {
         YellowstonePathology.Business.Test.Model.TestOrder testOrder = new YellowstonePathology.Business.Test.Model.TestOrder();
         YellowstonePathology.Business.Persistence.XmlPropertyWriter xmlPropertyWriter = new Persistence.XmlPropertyWriter(testOrderElement, testOrder);
         xmlPropertyWriter.Write();
         slideOrder.TestOrder = 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);
            }
        }
        private static YellowstonePathology.Business.Client.Model.ClientSupplyOrder BuildClientSupplyOrder(XElement sourceElement)
        {
            YellowstonePathology.Business.Client.Model.ClientSupplyOrder clientSupplyOrder = new Client.Model.ClientSupplyOrder();
            YellowstonePathology.Business.Persistence.XmlPropertyWriter xmlPropertyWriter = new Persistence.XmlPropertyWriter(sourceElement, clientSupplyOrder);
            xmlPropertyWriter.Write();

            List<XElement> clientSupplyOrderDetailElements = (from item in sourceElement.Elements("ClientSupplyOrderDetailCollection")
                                                            select item).ToList<XElement>();
            foreach (XElement clientSupplyOrderDetailElement in clientSupplyOrderDetailElements.Elements("ClientSupplyOrderDetail"))
            {
                YellowstonePathology.Business.Client.Model.ClientSupplyOrderDetail clientSupplyOrderDetail = new YellowstonePathology.Business.Client.Model.ClientSupplyOrderDetail();
                YellowstonePathology.Business.Persistence.XmlPropertyWriter xmlPropertyWriterDetail = new YellowstonePathology.Business.Persistence.XmlPropertyWriter(clientSupplyOrderDetailElement, clientSupplyOrderDetail);
                xmlPropertyWriterDetail.Write();
                clientSupplyOrder.ClientSupplyOrderDetailCollection.Add(clientSupplyOrderDetail);
            }
            return clientSupplyOrder;
        }
        public static Surgical.SurgicalMasterLogList GetSurgicalMasterLogList(DateTime reportDate)
        {
            Surgical.SurgicalMasterLogList result = new Surgical.SurgicalMasterLogList();
            StringBuilder xmlString = new StringBuilder();
            SqlCommand cmd = new SqlCommand();
            StringBuilder commandText = new StringBuilder();
            commandText.Append("With rpts as(");
            commandText.Append("SELECT Distinct a.AccessionTime, pso.ReportNo, a.AccessioningFacilityId, a.PFirstName, a.PLastName, a.PBirthdate, a.PhysicianName, a.ClientName, Count(*) AliquotCount ");
            commandText.Append("FROM tblAccessionOrder a JOIN tblPanelSetOrder pso ON a.MasterAccessionNo = pso.MasterAccessionNo ");
            commandText.Append("JOIN tblSpecimenORder so on a.MasterAccessionNo = so.MasterAccessionNo ");
            commandText.Append("LEFT OUTER JOIN tblAliquotOrder ao on so.SpecimenOrderId = ao.SpecimenOrderId ");
            commandText.Append("WHERE AccessionDate = @ReportDate and pso.PanelSetId in (13, 50) ");
            commandText.Append(" group by a.AccessionTime, pso.ReportNo, a.AccessioningFacilityId, a.PFirstName, a.PLastName, a.PBirthdate, a.PhysicianName, a.ClientName");
            commandText.Append(") ");
            commandText.Append("SELECT rpts.*, ");
            commandText.Append("(Select ssr.DiagnosisId, so.Description ");
            commandText.Append("FROM tblSurgicalSpecimen ssr ");
            commandText.Append("JOIN tblSpecimenOrder so ON ssr.SpecimenOrderId = so.SpecimenOrderId ");
            commandText.Append("WHERE ssr.ReportNo = rpts.ReportNo for xml path('MasterLogItem'), type) MasterLogList ");
            commandText.Append("From rpts Order By AccessionTime for xml path('SurgicalMasterLogItem'), type, root('SurgicalMasterLogList')");
            cmd.CommandText = commandText.ToString();
            cmd.CommandType = CommandType.Text;
            cmd.Parameters.Add("@ReportDate", SqlDbType.VarChar, 20).Value = reportDate.ToShortDateString();

            using (SqlConnection cn = new SqlConnection(YellowstonePathology.Business.Properties.Settings.Default.CurrentConnectionString))
            {
                cn.Open();
                cmd.Connection = cn;
                using (XmlReader xmlReader = cmd.ExecuteXmlReader())
                {
                    while (xmlReader.Read())
                    {
                        xmlString.Append(xmlReader.ReadOuterXml());
                    }
                }
            }

            XElement resultElement = XElement.Parse(xmlString.ToString(), LoadOptions.PreserveWhitespace);
            List<XElement> surgicalMasterLogItemElements = (from item in resultElement.Elements("SurgicalMasterLogItem")
                                                             select item).ToList<XElement>();
            foreach (XElement surgicalMasterLogItemElement in surgicalMasterLogItemElements)
            {
                YellowstonePathology.Business.Surgical.SurgicalMasterLogItem surgicalMasterLogItem = new Surgical.SurgicalMasterLogItem();
                YellowstonePathology.Business.Persistence.XmlPropertyWriter xmlPropertyWriter = new Persistence.XmlPropertyWriter(surgicalMasterLogItemElement, surgicalMasterLogItem);
                xmlPropertyWriter.Write();

                List<XElement> masterLogListElements = (from item in surgicalMasterLogItemElement.Elements("MasterLogList")
                                                                     select item).ToList<XElement>();
                foreach (XElement masterLogListElement in masterLogListElements)
                {
                    List<XElement> masterLogItemElements = (from item in masterLogListElement.Elements("MasterLogItem")
                                                                             select item).ToList<XElement>();
                    foreach (XElement masterLogItemElement in masterLogItemElements)
                    {
                        YellowstonePathology.Business.Surgical.MasterLogItem masterLogItem = new Surgical.MasterLogItem();
                        YellowstonePathology.Business.Persistence.XmlPropertyWriter xmlPropertyWriter1 = new Persistence.XmlPropertyWriter(masterLogItemElement, masterLogItem);
                        xmlPropertyWriter1.Write();

                        surgicalMasterLogItem.MasterLogList.Add(masterLogItem);
                    }
                }
                result.Add(surgicalMasterLogItem);
            }

            return result;
        }
        public static Surgical.PathologistHistoryList GetPathologistPatientHistory(string patientId)
        {
            Surgical.PathologistHistoryList result = new Surgical.PathologistHistoryList();
            StringBuilder xmlString = new StringBuilder();
            SqlCommand cmd = new SqlCommand();
            cmd.CommandText = "prcGetPatientHistory_4";
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.Add("@PatientId", SqlDbType.VarChar).Value = patientId;

            using (SqlConnection cn = new SqlConnection(YellowstonePathology.Business.Properties.Settings.Default.CurrentConnectionString))
            {
                cn.Open();
                cmd.Connection = cn;
                using (XmlReader xmlReader = cmd.ExecuteXmlReader())
                {
                    while (xmlReader.Read())
                    {
                        xmlString.Append(xmlReader.ReadOuterXml());
                    }
                }
            }

            if (xmlString.Length != 0)
            {
                XElement resultElements = XElement.Parse(xmlString.ToString(), LoadOptions.PreserveWhitespace);
                List<XElement> pathologistHistoryItemElements = (from item in resultElements.Elements("PathologistHistoryItem")
                                                                 select item).ToList<XElement>();
                foreach (XElement pathologistHistoryElement in pathologistHistoryItemElements)
                {
                    YellowstonePathology.Business.Surgical.PathologistHistoryItem pathologistHistory = new Surgical.PathologistHistoryItem();
                    YellowstonePathology.Business.Persistence.XmlPropertyWriter xmlPropertyWriter = new Persistence.XmlPropertyWriter(pathologistHistoryElement, pathologistHistory);
                    xmlPropertyWriter.Write();

                    List<XElement> pathologistHistoryItemListElements = (from item in pathologistHistoryElement.Elements("PathologistHistoryItemList")
                                                                         select item).ToList<XElement>();
                    foreach (XElement pathologistHistoryItemListElement in pathologistHistoryItemListElements)
                    {
                        List<XElement> pathologistHistoryItemListItemElements = (from item in pathologistHistoryItemListElement.Elements("PathologistHistoryItemListItem")
                                                                                 select item).ToList<XElement>();
                        foreach (XElement pathologistHistoryItemListItemElement in pathologistHistoryItemListItemElements)
                        {
                            YellowstonePathology.Business.Surgical.PathologistHistoryItemListItem pathologistHistoryItemListItem = new Surgical.PathologistHistoryItemListItem();
                            YellowstonePathology.Business.Persistence.XmlPropertyWriter xmlPropertyWriter1 = new Persistence.XmlPropertyWriter(pathologistHistoryItemListItemElement, pathologistHistoryItemListItem);
                            xmlPropertyWriter1.Write();

                            pathologistHistory.PathologistHistoryItemList.Add(pathologistHistoryItemListItem);
                        }
                    }
                    result.Add(pathologistHistory);
                }
            }

            return result;
        }
        private static YellowstonePathology.Business.Client.Model.ProviderClient BuildHomeBaseProviderClient(XElement providerElement)
        {
            YellowstonePathology.Business.Client.Model.ProviderClient result = new Client.Model.ProviderClient();
            YellowstonePathology.Business.Domain.Physician physician = new Domain.Physician();
            YellowstonePathology.Business.Persistence.XmlPropertyWriter xmlPropertyWriterP = new Persistence.XmlPropertyWriter(providerElement, physician);
            xmlPropertyWriterP.Write();
            result.Physician = physician;

            XElement clientElement = providerElement.Element("Client");
            if (clientElement != null)
            {
                YellowstonePathology.Business.Client.Model.Client client = new Client.Model.Client();
                YellowstonePathology.Business.Persistence.XmlPropertyWriter xmlPropertyWriterC = new Persistence.XmlPropertyWriter(clientElement, client);
                xmlPropertyWriterC.Write();
                result.Client = client;
            }

            XElement providerClientElement = providerElement.Element("ProviderClient");
            if (providerClientElement != null)
            {
                YellowstonePathology.Business.Persistence.XmlPropertyWriter xmlPropertyWriterPC = new Persistence.XmlPropertyWriter(providerClientElement, result);
                xmlPropertyWriterPC.Write();
            }
            return result;
        }
示例#20
0
        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);
            }
        }
 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);
     }
 }
示例#22
0
        private void BuildAliquotOrderTestOrder(Test.AliquotOrder aliquotOrder, XElement aliquotOrderElement)
        {
            List<XElement> aliquotOrderElements = (from item in aliquotOrderElement.Elements("TestOrderCollection")
                                                   select item).ToList<XElement>();
            aliquotOrder.TestOrderCollection.RemoveDeleted(aliquotOrderElements.Elements("TestOrder"));
            foreach (XElement testOrderElement in aliquotOrderElements.Elements("TestOrder"))
            {
                string testOrderId = testOrderElement.Element("TestOrderId").Value;
                YellowstonePathology.Business.Test.Model.TestOrder_Base testOrder = null;
                if (aliquotOrder.TestOrderCollection.Exists(testOrderId) == true)
                {
                    testOrder = aliquotOrder.TestOrderCollection.GetBase(testOrderId);
                }
                else
                {
                    testOrder = new YellowstonePathology.Business.Test.Model.TestOrder();
                    aliquotOrder.TestOrderCollection.Add(testOrder);
                }

                YellowstonePathology.Business.Persistence.XmlPropertyWriter xmlPropertyWriter = new Persistence.XmlPropertyWriter(testOrderElement, testOrder);
                xmlPropertyWriter.Write();
            }
        }
 private void BuildSpecimenOrder(Test.AccessionOrder accessionOrder, XElement accessionOrderElement)
 {
     accessionOrder.SpecimenOrderCollection.IsLoading = true;
     List<XElement> specimenOrderElements = (from item in accessionOrderElement.Elements("SpecimenOrderCollection")
                                             select item).ToList<XElement>();
     foreach (XElement specimenOrderElement in specimenOrderElements.Elements("SpecimenOrder"))
     {
         Specimen.Model.SpecimenOrder specimenOrder = new Specimen.Model.SpecimenOrder();
         YellowstonePathology.Business.Persistence.XmlPropertyWriter xmlPropertyWriter = new Persistence.XmlPropertyWriter(specimenOrderElement, specimenOrder);
         xmlPropertyWriter.Write();
         BuildAliquotOrderLeftSide(specimenOrder, specimenOrderElement);
         accessionOrder.SpecimenOrderCollection.Add(specimenOrder);
     }
     accessionOrder.SpecimenOrderCollection.IsLoading = false;
 }
示例#24
0
        private void BuildSpecimenOrder(Test.AccessionOrder accessionOrder, XElement accessionOrderElement)
        {
            accessionOrder.SpecimenOrderCollection.IsLoading = true;
            List<XElement> specimenOrderElements = (from item in accessionOrderElement.Elements("SpecimenOrderCollection")
                                                    select item).ToList<XElement>();

            accessionOrder.SpecimenOrderCollection.RemoveDeleted(specimenOrderElements.Elements("SpecimenOrder"));
            foreach (XElement specimenOrderElement in specimenOrderElements.Elements("SpecimenOrder"))
            {
                string specimenOrderId = specimenOrderElement.Element("SpecimenOrderId").Value;
                Specimen.Model.SpecimenOrder specimenOrder = null;

                if (accessionOrder.SpecimenOrderCollection.Exists(specimenOrderId) == true)
                {
                    specimenOrder = accessionOrder.SpecimenOrderCollection.GetSpecimenOrder(specimenOrderId);
                }
                else
                {
                    specimenOrder = new Specimen.Model.SpecimenOrder();
                    accessionOrder.SpecimenOrderCollection.Add(specimenOrder);
                }

                YellowstonePathology.Business.Persistence.XmlPropertyWriter xmlPropertyWriter = new Persistence.XmlPropertyWriter(specimenOrderElement, specimenOrder);
                xmlPropertyWriter.Write();
                BuildAliquotOrderLeftSide(specimenOrder, specimenOrderElement);

            }
            accessionOrder.SpecimenOrderCollection.IsLoading = false;
        }
        private void BuildTestOrderRightSide(Test.PanelOrder panelOrder, XElement panelOrderElement)
        {
            List<XElement> testOrderElements = (from item in panelOrderElement.Elements("TestOrderCollection")
                                                select item).ToList<XElement>();
            foreach (XElement testOrderElement in testOrderElements.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();

                BuildTestOrderAliquotOrder(testOrder, testOrderElement);
                BuildTestOrderSlideOrderCollection(testOrder, testOrderElement);
                panelOrder.TestOrderCollection.Add(testOrder);
            }
        }
示例#26
0
        private void BuildTestOrderRightSide(Test.PanelOrder panelOrder, XElement panelOrderElement)
        {
            List<XElement> testOrderElements = (from item in panelOrderElement.Elements("TestOrderCollection")
                                                select item).ToList<XElement>();

            panelOrder.TestOrderCollection.RemoveDeleted(testOrderElements.Elements("TestOrder"));
            foreach (XElement testOrderElement in testOrderElements.Elements("TestOrder"))
            {
                string testOrderId = testOrderElement.Element("TestOrderId").Value;
                YellowstonePathology.Business.Test.Model.TestOrder testOrder = null;
                if (panelOrder.TestOrderCollection.Exists(testOrderId) == true)
                {
                    testOrder = panelOrder.TestOrderCollection.Get(testOrderId);
                }
                else
                {
                    testOrder = new YellowstonePathology.Business.Test.Model.TestOrder();
                    panelOrder.TestOrderCollection.Add(testOrder);
                }

                YellowstonePathology.Business.Persistence.XmlPropertyWriter xmlPropertyWriter = new Persistence.XmlPropertyWriter(testOrderElement, testOrder);
                xmlPropertyWriter.Write();

                BuildTestOrderAliquotOrder(testOrder, testOrderElement);
                BuildTestOrderSlideOrderCollection(testOrder, testOrderElement);
            }
        }