예제 #1
0
        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;
        }
예제 #2
0
        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);
        }
예제 #3
0
        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("");
        }
예제 #4
0
        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);
        }
예제 #5
0
        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);
        }
예제 #6
0
        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);
        }
예제 #7
0
        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;
        }
예제 #8
0
 public FlowLogSearch()
 {
     this.m_FlowLogList = new FlowLogList();
 }
예제 #9
0
        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;
        }
예제 #10
0
        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;
        }
예제 #11
0
 public void GetByPatientNameLastAndFirst()
 {
     YellowstonePathology.Business.Flow.FlowLogList flowLogList = YellowstonePathology.Business.Gateway.FlowGatewayMongo.GetByPatientName("POO, ran");
     Assert.IsTrue(flowLogList.Count > 0);
 }
예제 #12
0
 public void GetFlowLogListByReportNo()
 {
     YellowstonePathology.Business.Flow.FlowLogList flowLogList = YellowstonePathology.Business.Gateway.FlowGatewayMongo.GetFlowLogListByReportNo("14-36.F1");
     Assert.IsTrue(flowLogList.Count == 1);
 }
예제 #13
0
 public void GetByTestType()
 {
     YellowstonePathology.Business.Flow.FlowLogList flowLogList = YellowstonePathology.Business.Gateway.FlowGatewayMongo.GetByTestType(21);
     Assert.IsTrue(flowLogList.Count > 0);
 }