Пример #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 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);
        }
Пример #4
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);
        }
Пример #5
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;
        }
Пример #6
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;
        }
Пример #7
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;
        }