public static Flow.FlowLogList GetByAccessionMonth(DateTime date) { YellowstonePathology.Business.Flow.FlowLogList result = new YellowstonePathology.Business.Flow.FlowLogList(); List<BsonValue> values = new List<BsonValue>(); values.Add(BsonValue.Create(19)); values.Add(BsonValue.Create(143)); YellowstonePathology.Business.Mongo.Server transferServer = new Business.Mongo.TestServer(YellowstonePathology.Business.Mongo.MongoTestServer.LISDatabaseName); MongoCollection collection = transferServer.Database.GetCollection<BsonDocument>("AccessionOrder"); MongoCursor cursor = collection.FindAs<BsonDocument>(Query.And(Query.GTE("AccessionDate", BsonValue.Create(date)), Query.LT("AccessionDate", BsonValue.Create(date.AddMonths(1))), Query.ElemMatch("PanelSetOrderCollection", Query.And(Query.EQ("CaseType", BsonValue.Create("Flow Cytometry")), Query.NotIn("PanelSetId", values))))) .SetSortOrder(SortBy.Descending("AccessionDate", "PanelSetOrderCollection.ReportNo")); foreach (BsonDocument bsonDocument in cursor) { foreach (BsonDocument panelSetDocument in bsonDocument.GetValue("PanelSetOrderCollection").AsBsonArray) { int panelSetId = panelSetDocument.GetValue("PanelSetId").AsInt32; if (panelSetDocument.GetValue("CaseType").AsString == "Flow Cytometry" && panelSetId != 19 && panelSetId != 143) { YellowstonePathology.Business.Flow.FlowLogListItem flowLogListItem = BuildFlowLog(bsonDocument, panelSetDocument); result.Add(flowLogListItem); break; } } } return result; }
public static Flow.FlowLogList GetByAccessionMonth(DateTime date) { YellowstonePathology.Business.Flow.FlowLogList result = new YellowstonePathology.Business.Flow.FlowLogList(); List <BsonValue> values = new List <BsonValue>(); values.Add(BsonValue.Create(19)); values.Add(BsonValue.Create(143)); YellowstonePathology.Business.Mongo.Server transferServer = new Business.Mongo.TestServer(YellowstonePathology.Business.Mongo.MongoTestServer.LISDatabaseName); MongoCollection collection = transferServer.Database.GetCollection <BsonDocument>("AccessionOrder"); MongoCursor cursor = collection.FindAs <BsonDocument>(Query.And(Query.GTE("AccessionDate", BsonValue.Create(date)), Query.LT("AccessionDate", BsonValue.Create(date.AddMonths(1))), Query.ElemMatch("PanelSetOrderCollection", Query.And(Query.EQ("CaseType", BsonValue.Create("Flow Cytometry")), Query.NotIn("PanelSetId", values))))) .SetSortOrder(SortBy.Descending("AccessionDate", "PanelSetOrderCollection.ReportNo")); foreach (BsonDocument bsonDocument in cursor) { foreach (BsonDocument panelSetDocument in bsonDocument.GetValue("PanelSetOrderCollection").AsBsonArray) { int panelSetId = panelSetDocument.GetValue("PanelSetId").AsInt32; if (panelSetDocument.GetValue("CaseType").AsString == "Flow Cytometry" && panelSetId != 19 && panelSetId != 143) { YellowstonePathology.Business.Flow.FlowLogListItem flowLogListItem = BuildFlowLog(bsonDocument, panelSetDocument); result.Add(flowLogListItem); break; } } } return(result); }
public void Search() { switch (this.m_SearchType) { case FlowLogListSearchTypeEnum.GetByLeukemiaNotFinal: this.m_FlowLogList = Gateway.FlowGateway.GetByLeukemiaNotFinal(); break; case FlowLogListSearchTypeEnum.GetByReportNo: string reportNo = (string)this.m_Parameter; this.m_FlowLogList = Gateway.FlowGateway.GetFlowLogListByReportNo(reportNo); break; case FlowLogListSearchTypeEnum.GetByAccessionMonth: DateTime accessionDate = (DateTime)this.m_Parameter; this.m_FlowLogList = Gateway.FlowGateway.GetByAccessionMonth(accessionDate); break; case FlowLogListSearchTypeEnum.GetByPatientName: string patientName = (string)this.m_Parameter; this.m_FlowLogList = Gateway.FlowGateway.GetByPatientName(patientName); break; } if (this.m_FlowLogList == null) { this.m_FlowLogList = new FlowLogList(); } this.NotifyPropertyChanged(""); }
public void GetByAccessionMonth() { DateTime date = DateTime.Parse("1/1/2014"); YellowstonePathology.Business.Flow.FlowLogList flowLogList = YellowstonePathology.Business.Gateway.FlowGatewayMongo.GetByAccessionMonth(date); Assert.IsTrue(flowLogList.Count == 34); }
public static Flow.FlowLogList GetByPatientName(string patientName) { YellowstonePathology.Business.Flow.FlowLogList result = new YellowstonePathology.Business.Flow.FlowLogList(); List <BsonValue> values = new List <BsonValue>(); values.Add(BsonValue.Create(19)); values.Add(BsonValue.Create(143)); YellowstonePathology.Business.Mongo.Server transferServer = new Business.Mongo.TestServer(YellowstonePathology.Business.Mongo.MongoTestServer.LISDatabaseName); MongoCollection collection = transferServer.Database.GetCollection <BsonDocument>("AccessionOrder"); MongoCursor cursor = null; string[] commaSplit = patientName.Split(','); switch (commaSplit.Length) { case 1: cursor = collection.FindAs <BsonDocument>(Query.And(Query.Matches("PLastName", BsonRegularExpression.Create(commaSplit[0] + ".*", "i")), Query.ElemMatch("PanelSetOrderCollection", Query.And(Query.EQ("CaseType", BsonValue.Create("Flow Cytometry")), Query.NotIn("PanelSetId", values))))) .SetSortOrder(SortBy.Descending("AccessionDate", "PanelSetOrderCollection.ReportNo")); break; case 2: cursor = collection.FindAs <BsonDocument>(Query.And(Query.Matches("PLastName", BsonRegularExpression.Create(commaSplit[0] + ".*", "i")), Query.Matches("PFirstName", BsonRegularExpression.Create(commaSplit[1].Trim() + ".*", "i")), Query.ElemMatch("PanelSetOrderCollection", Query.And(Query.EQ("CaseType", BsonValue.Create("Flow Cytometry")), Query.NotIn("PanelSetId", values))))) .SetSortOrder(SortBy.Descending("AccessionDate", "PanelSetOrderCollection.ReportNo")); break; } foreach (BsonDocument bsonDocument in cursor) { foreach (BsonDocument panelSetDocument in bsonDocument.GetValue("PanelSetOrderCollection").AsBsonArray) { int panelSetId = panelSetDocument.GetValue("PanelSetId").AsInt32; if (panelSetDocument.GetValue("CaseType").AsString == "Flow Cytometry" && panelSetId != 19 && panelSetId != 143) { YellowstonePathology.Business.Flow.FlowLogListItem flowLogListItem = BuildFlowLog(bsonDocument, panelSetDocument); result.Add(flowLogListItem); break; } } } return(result); }
public static Flow.FlowLogList GetByTestType(int panelSetId) { YellowstonePathology.Business.Flow.FlowLogList result = new YellowstonePathology.Business.Flow.FlowLogList(); YellowstonePathology.Business.Mongo.Server transferServer = new Business.Mongo.TestServer(YellowstonePathology.Business.Mongo.MongoTestServer.LISDatabaseName); MongoCollection collection = transferServer.Database.GetCollection <BsonDocument>("AccessionOrder"); MongoCursor cursor = collection.FindAs <BsonDocument>(Query.ElemMatch("PanelSetOrderCollection", Query.EQ("PanelSetId", BsonValue.Create(panelSetId)))) .SetSortOrder(SortBy.Descending("AccessionDate", "PanelSetOrderCollection.ReportNo")); foreach (BsonDocument bsonDocument in cursor) { foreach (BsonDocument panelSetDocument in bsonDocument.GetValue("PanelSetOrderCollection").AsBsonArray) { if (panelSetDocument.GetValue("PanelSetId").AsInt32 == panelSetId) { YellowstonePathology.Business.Flow.FlowLogListItem flowLogListItem = BuildFlowLog(bsonDocument, panelSetDocument); result.Add(flowLogListItem); } } } return(result); }
public static Flow.FlowLogList GetByLeukemiaNotFinal() { YellowstonePathology.Business.Flow.FlowLogList result = new YellowstonePathology.Business.Flow.FlowLogList(); YellowstonePathology.Business.Mongo.Server transferServer = new Business.Mongo.TestServer(YellowstonePathology.Business.Mongo.MongoTestServer.LISDatabaseName); MongoCollection collection = transferServer.Database.GetCollection<BsonDocument>("AccessionOrder"); MongoCursor cursor = collection.FindAs<BsonDocument>(Query.ElemMatch("PanelSetOrderCollection", Query.And(Query.EQ("PanelSetId", BsonValue.Create(20)), Query.EQ("Final", BsonValue.Create(false))))) .SetSortOrder(SortBy.Descending("AccessionDate", "PanelSetOrderCollection.ReportNo")); foreach (BsonDocument bsonDocument in cursor) { foreach (BsonDocument panelSetDocument in bsonDocument.GetValue("PanelSetOrderCollection").AsBsonArray) { if (panelSetDocument.GetValue("PanelSetId").AsInt32 == 20) { YellowstonePathology.Business.Flow.FlowLogListItem flowLogListItem = BuildFlowLog(bsonDocument, panelSetDocument); result.Add(flowLogListItem); } } } return result; }
public FlowLogSearch() { this.m_FlowLogList = new FlowLogList(); }
public static Flow.FlowLogList GetFlowLogListByReportNo(string reportNo) { YellowstonePathology.Business.Flow.FlowLogList result = new YellowstonePathology.Business.Flow.FlowLogList(); YellowstonePathology.Business.Mongo.Server transferServer = new Business.Mongo.TestServer(YellowstonePathology.Business.Mongo.MongoTestServer.LISDatabaseName); MongoCollection collection = transferServer.Database.GetCollection<BsonDocument>("AccessionOrder"); MongoCursor cursor = collection.FindAs<BsonDocument>(Query.ElemMatch("PanelSetOrderCollection", Query.EQ("ReportNo", BsonValue.Create(reportNo)))); foreach (BsonDocument bsonDocument in cursor) { foreach (BsonDocument panelSetDocument in bsonDocument.GetValue("PanelSetOrderCollection").AsBsonArray) { if (panelSetDocument.GetValue("ReportNo").AsString == reportNo) { YellowstonePathology.Business.Flow.FlowLogListItem flowLogListItem = BuildFlowLog(bsonDocument, panelSetDocument); result.Add(flowLogListItem); break; } } } return result; }
public static Flow.FlowLogList GetByPatientName(string patientName) { YellowstonePathology.Business.Flow.FlowLogList result = new YellowstonePathology.Business.Flow.FlowLogList(); List<BsonValue> values = new List<BsonValue>(); values.Add(BsonValue.Create(19)); values.Add(BsonValue.Create(143)); YellowstonePathology.Business.Mongo.Server transferServer = new Business.Mongo.TestServer(YellowstonePathology.Business.Mongo.MongoTestServer.LISDatabaseName); MongoCollection collection = transferServer.Database.GetCollection<BsonDocument>("AccessionOrder"); MongoCursor cursor = null; string[] commaSplit = patientName.Split(','); switch (commaSplit.Length) { case 1: cursor = collection.FindAs<BsonDocument>(Query.And(Query.Matches("PLastName", BsonRegularExpression.Create(commaSplit[0] + ".*", "i")), Query.ElemMatch("PanelSetOrderCollection", Query.And(Query.EQ("CaseType", BsonValue.Create("Flow Cytometry")), Query.NotIn("PanelSetId", values))))) .SetSortOrder(SortBy.Descending("AccessionDate", "PanelSetOrderCollection.ReportNo")); break; case 2: cursor = collection.FindAs<BsonDocument>(Query.And(Query.Matches("PLastName", BsonRegularExpression.Create(commaSplit[0] + ".*", "i")), Query.Matches("PFirstName", BsonRegularExpression.Create(commaSplit[1].Trim() + ".*", "i")), Query.ElemMatch("PanelSetOrderCollection", Query.And(Query.EQ("CaseType", BsonValue.Create("Flow Cytometry")), Query.NotIn("PanelSetId", values))))) .SetSortOrder(SortBy.Descending("AccessionDate", "PanelSetOrderCollection.ReportNo")); break; } foreach (BsonDocument bsonDocument in cursor) { foreach (BsonDocument panelSetDocument in bsonDocument.GetValue("PanelSetOrderCollection").AsBsonArray) { int panelSetId = panelSetDocument.GetValue("PanelSetId").AsInt32; if (panelSetDocument.GetValue("CaseType").AsString == "Flow Cytometry" && panelSetId != 19 && panelSetId != 143) { YellowstonePathology.Business.Flow.FlowLogListItem flowLogListItem = BuildFlowLog(bsonDocument, panelSetDocument); result.Add(flowLogListItem); break; } } } return result; }
public void GetByPatientNameLastAndFirst() { YellowstonePathology.Business.Flow.FlowLogList flowLogList = YellowstonePathology.Business.Gateway.FlowGatewayMongo.GetByPatientName("POO, ran"); Assert.IsTrue(flowLogList.Count > 0); }
public void GetFlowLogListByReportNo() { YellowstonePathology.Business.Flow.FlowLogList flowLogList = YellowstonePathology.Business.Gateway.FlowGatewayMongo.GetFlowLogListByReportNo("14-36.F1"); Assert.IsTrue(flowLogList.Count == 1); }
public void GetByTestType() { YellowstonePathology.Business.Flow.FlowLogList flowLogList = YellowstonePathology.Business.Gateway.FlowGatewayMongo.GetByTestType(21); Assert.IsTrue(flowLogList.Count > 0); }