public static Flow.FlowLogList GetByPatientName(string patientName) { #if MONGO return(FlowGatewayMongo.GetByPatientName(patientName)); #else SqlCommand cmd = new SqlCommand(); cmd.CommandType = CommandType.Text; string whereClause = string.Empty; string sql = "select pso.ReportNo, ao.PLastName, ao.PFirstName, ao.AccessionDate, pso.FinalDate, pso.PanelSetName [TestName], pso.ObjectId, pso.MasterAccessionNo " + "from tblPanelSetOrder pso join tblAccessionOrder ao on pso.MasterAccessionNo = ao.MasterAccessionNo " + "Where pso.PanelSetId not in (19,143,211,222,223) and pso.CaseType = 'Flow Cytometry' "; string[] commaSplit = patientName.Split(','); switch (commaSplit.Length) { case 1: cmd.Parameters.Add("@PLastName", SqlDbType.VarChar).Value = commaSplit[0] + "%"; whereClause = "and ao.PLastName like @PLastName "; break; case 2: cmd.Parameters.Add("@PLastName", SqlDbType.VarChar).Value = commaSplit[0] + "%"; cmd.Parameters.Add("@PFirstName", SqlDbType.VarChar).Value = commaSplit[1].Trim() + "%"; whereClause = "and ao.PLastName like @PLastName and ao.PFirstName like @PFirstName "; break; } cmd.CommandText = sql + whereClause + " order by ao.AccessionDate desc, pso.ReportNo desc"; cmd.CommandType = CommandType.Text; return(BuildFlowLogList(cmd)); #endif }
public static Flow.FlowLogList GetByLeukemiaNotFinal() { #if MONGO return(FlowGatewayMongo.GetByLeukemiaNotFinal()); #else SqlCommand cmd = new SqlCommand("select pso.ReportNo, ao.PLastName, ao.PFirstName, ao.AccessionDate, pso.FinalDate, pso.PanelSetName [TestName], pso.ObjectId, pso.MasterAccessionNo " + "from tblPanelSetOrder pso join tblAccessionOrder ao on pso.MasterAccessionNo = ao.MasterAccessionNo " + "where pso.PanelSetId = 20 and pso.Final = 0 order by ao.AccessionDate desc, pso.ReportNo desc"); cmd.CommandType = CommandType.Text; return(BuildFlowLogList(cmd)); #endif }
public static Flow.FlowLogList GetFlowLogListByReportNo(string reportNo) { #if MONGO return(FlowGatewayMongo.GetFlowLogListByReportNo(reportNo)); #else SqlCommand cmd = new SqlCommand("select pso.ReportNo, ao.PLastName, ao.PFirstName, ao.AccessionDate, pso.FinalDate, pso.PanelSetName [TestName], pso.ObjectId, pso.MasterAccessionNo " + "from tblPanelSetOrder pso join tblAccessionOrder ao on pso.MasterAccessionNo = ao.MasterAccessionNo " + "where pso.PanelSetId not in (19,143,211,222,223) and pso.CaseType = 'Flow Cytometry' and pso.ReportNo = @ReportNo "); cmd.CommandType = CommandType.Text; cmd.Parameters.Add("@ReportNo", SqlDbType.VarChar).Value = reportNo; return(BuildFlowLogList(cmd)); #endif }
public static Flow.FlowLogList GetByTestType(int panelSetId) { #if MONGO return(FlowGatewayMongo.GetByTestType(panelSetId)); #else SqlCommand cmd = new SqlCommand("select pso.ReportNo, ao.PLastName, ao.PFirstName, ao.AccessionDate, pso.FinalDate, pso.PanelSetName [TestName], pso.ObjectId, pso.MasterAccessionNo " + "from tblPanelSetOrder pso join tblAccessionOrder ao on pso.MasterAccessionNo = ao.MasterAccessionNo " + "Where PanelSetId = @PanelSetId order by ao.AccessionDate desc, pso.ReportNo desc"); cmd.CommandType = CommandType.Text; cmd.Parameters.Add("@PanelSetId", SqlDbType.Int).Value = panelSetId; return(BuildFlowLogList(cmd)); #endif }
public static Flow.FlowMarkerCollection GetFlowMarkerCollectionByReportNo(string reportNo) { #if MONGO return(FlowGatewayMongo.GetFlowMarkerCollectionByReportNo(reportNo)); #else SqlCommand cmd = new SqlCommand(); cmd.CommandType = CommandType.Text; cmd.CommandText = "select fl.* from tblFlowMarkers fl left outer join tblMarkers m on fl.Name = m.MarkerName " + "where fl.ReportNo = @ReportNo order by m.OrderFlag, m.MarkerName for xml path('FlowMarkerItem'), root('FlowMarkerCollection')"; cmd.Parameters.Add("@ReportNo", SqlDbType.VarChar).Value = reportNo; XElement flowMarkerCollectionElement = Domain.Persistence.SqlXmlPersistence.CrudOperations.ExecuteXmlReaderCommand(cmd, Domain.Persistence.DataLocationEnum.ProductionData); return(BuildFlowMarkerCollection(flowMarkerCollectionElement)); #endif }
public static Flow.FlowLogList GetByAccessionMonth(DateTime date) { #if MONGO return(FlowGatewayMongo.GetByAccessionMonth(date)); #else SqlCommand cmd = new SqlCommand("Select pso.ReportNo, ao.PLastName, ao.PFirstName, ao.AccessionDate, pso.FinalDate, pso.PanelSetName [TestName], pso.ObjectId, pso.MasterAccessionNo " + "from tblPanelSetOrder pso join tblAccessionOrder ao on pso.MasterAccessionNo = ao.MasterAccessionNo " + "where pso.PanelSetId not in (19,143,211,222,223) and pso.CaseType = 'Flow Cytometry' and month(ao.AccessionDate) = @Month and Year(ao.AccessionDate) = @Year " + "order by ao.AccessionDate desc, pso.ReportNo desc"); cmd.Parameters.Add("@Month", SqlDbType.Int).Value = date.Month; cmd.Parameters.Add("@Year", SqlDbType.Int).Value = date.Year; cmd.CommandType = CommandType.Text; return(BuildFlowLogList(cmd)); #endif }
public static Flow.FlowMarkerCollection GetFlowMarkerCollectionByPanelId(string reportNo, int panelId) { #if MONGO return(FlowGatewayMongo.GetFlowMarkerCollectionByPanelId(reportNo, panelId)); #else SqlCommand cmd = new SqlCommand(); cmd.CommandType = CommandType.Text; cmd.CommandText = "Select @ReportNo as ReportNo, mp.MarkerName as Name, mp.Intensity, mp.Interpretation, 1 as MarkerUsed " + "from tblFlowMarkerPanel mp left outer join tblMarkers m on mp.MarkerName = m.MarkerName where PanelId = @PanelId " + "order by m.OrderFlag, m.MarkerName for xml path('FlowMarkerItem'), type, root('FlowMarkerCollection')"; cmd.Parameters.Add("@ReportNo", SqlDbType.VarChar).Value = reportNo; cmd.Parameters.Add("@PanelId", SqlDbType.Int).Value = panelId; XElement flowMarkerCollectionElement = Domain.Persistence.SqlXmlPersistence.CrudOperations.ExecuteXmlReaderCommand(cmd, Domain.Persistence.DataLocationEnum.ProductionData); return(BuildFlowMarkerCollection(flowMarkerCollectionElement)); #endif }