Example #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);
        }
Example #2
0
 private static YellowstonePathology.Business.Flow.FlowLogListItem BuildFlowLog(BsonDocument accessionDocument, BsonDocument panelSetDocument)
 {
     YellowstonePathology.Business.Flow.FlowLogListItem result = new YellowstonePathology.Business.Flow.FlowLogListItem();
     result.PLastName     = accessionDocument.GetValue("PLastName").AsString;
     result.PFirstName    = accessionDocument.GetValue("PFirstName").AsString;
     result.AccessionDate = accessionDocument.GetValue("AccessionDate").AsDateTime;
     result.ObjectId      = panelSetDocument.GetValue("_id").AsObjectId.ToString();
     result.ReportNo      = panelSetDocument.GetValue("ReportNo").AsString;
     result.FinalDate     = panelSetDocument.GetValue("FinalDate").AsNullableDateTime;
     result.TestName      = panelSetDocument.GetValue("PanelSetName").AsString;
     return(result);
 }
Example #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);
        }
Example #4
0
        public void ListViewFlowCaseList_SelectionChanged(object sender, RoutedEventArgs args)
        {
            if (this.ListViewFlowCaseList.SelectedIndex >= 0)
            {
                YellowstonePathology.Business.Flow.FlowLogListItem flowLogListItem = (YellowstonePathology.Business.Flow.FlowLogListItem) this.ListViewFlowCaseList.SelectedItem;
                this.GetCase(flowLogListItem.ReportNo, flowLogListItem.MasterAccessionNo);

                this.m_FlowUI.FlowLogSearch.FlowLogList.SetLockIsAquiredByMe(this.m_FlowUI.AccessionOrder);
            }
            else
            {
                this.m_FlowUI.AccessionOrder = null;
                this.m_FlowUI.PanelSetOrderLeukemiaLymphoma = null;
                this.m_FlowUI.CaseDocumentCollection        = null;
                this.m_DocumentViewer.ClearContent();
                this.m_FlowUI.ICD9BillingCodeCollection = null;
            }
        }
Example #5
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);
        }
 private static YellowstonePathology.Business.Flow.FlowLogListItem BuildFlowLog(BsonDocument accessionDocument, BsonDocument panelSetDocument)
 {
     YellowstonePathology.Business.Flow.FlowLogListItem result = new YellowstonePathology.Business.Flow.FlowLogListItem();
     result.PLastName = accessionDocument.GetValue("PLastName").AsString;
     result.PFirstName = accessionDocument.GetValue("PFirstName").AsString;
     result.AccessionDate = accessionDocument.GetValue("AccessionDate").AsDateTime;
     result.ObjectId = panelSetDocument.GetValue("_id").AsObjectId.ToString();
     result.ReportNo = panelSetDocument.GetValue("ReportNo").AsString;
     result.FinalDate = panelSetDocument.GetValue("FinalDate").AsNullableDateTime;
     result.TestName = panelSetDocument.GetValue("PanelSetName").AsString;
     return result;
 }