示例#1
0
        public SearchUI()
        {
            this.m_SearchList = new SearchList();
            this.m_SearchListCollectionView = new ListCollectionView(this.m_SearchList);
            this.m_PhysicianClientCollection = new Client.PhysicianClientCollection();
            this.m_RDPhysicianClientCollection = new Client.PhysicianClientCollection();
            this.m_PatientHistoryList = new YellowstonePathology.Business.Patient.Model.PatientHistoryList();

            this.m_ResultList = new SearchResultList();
        }
示例#2
0
        public static YellowstonePathology.Business.Client.PhysicianClientCollection GetPhysicianClientListByClientPhysicianLastName(string clientName, string physicianLastName)
        {
            YellowstonePathology.Business.Client.PhysicianClientCollection result = new Client.PhysicianClientCollection();
            YellowstonePathology.Business.Mongo.Server server = new Business.Mongo.TestServer(YellowstonePathology.Business.Mongo.MongoTestServer.LISDatabaseName);
            MongoCollection physicianClientCollection         = server.Database.GetCollection <BsonDocument>("PhysicianClient");
            MongoCollection physicianCollection = server.Database.GetCollection <BsonDocument>("Physician");
            MongoCollection clientCollection    = server.Database.GetCollection <BsonDocument>("Client");
            MongoCursor     physicianCursor     = physicianCollection.FindAs <BsonDocument>(Query.Matches("LastName", BsonRegularExpression.Create("^" + physicianLastName + ".*", "i"))).SetSortOrder(SortBy.Ascending("LastName", "FirstName"));

            foreach (BsonDocument physicianDocument in physicianCursor)
            {
                BsonValue        physicianId           = physicianDocument.GetValue("PhysicianId");
                MongoCursor      physicianClientCursor = physicianClientCollection.FindAs <BsonDocument>(Query.EQ("PhysicianId", physicianId));
                List <BsonValue> clientIdList          = new List <BsonValue>();
                foreach (BsonDocument physicianClientDocument in physicianClientCursor)
                {
                    clientIdList.Add(physicianClientDocument.GetValue("ClientId"));
                }

                MongoCursor clientCursor = clientCollection.FindAs <BsonDocument>(Query.And(Query.In("ClientId", clientIdList),
                                                                                            Query.Matches("ClientName", BsonRegularExpression.Create("^" + clientName + ".*", "i")))).SetSortOrder(SortBy.Ascending("ClientName"));
                foreach (BsonDocument clientDocument in clientCursor)
                {
                    BsonValue physicianClientId = null;
                    foreach (BsonDocument physicianClientDocument in physicianClientCursor)
                    {
                        if (physicianClientDocument.GetValue("ClientId").Equals(clientDocument.GetValue("ClientId")))
                        {
                            physicianClientId = physicianClientDocument.GetValue("PhysicianClientId");
                            break;
                        }
                    }

                    YellowstonePathology.Business.Client.PhysicianClient physicianClient = BuildPhysicianClient(clientDocument, physicianDocument, physicianClientId);
                    result.Add(physicianClient);
                }
            }
            return(result);
        }
示例#3
0
        public static YellowstonePathology.Business.Client.PhysicianClientCollection GetPhysicianClientListByClientId(int clientId)
        {
            YellowstonePathology.Business.Client.PhysicianClientCollection result = new Client.PhysicianClientCollection();
            BsonValue bsonClientId = BsonValue.Create(clientId);

            YellowstonePathology.Business.Mongo.Server server = new Business.Mongo.TestServer(YellowstonePathology.Business.Mongo.MongoTestServer.LISDatabaseName);
            MongoCollection  physicianClientCollection        = server.Database.GetCollection <BsonDocument>("PhysicianClient");
            MongoCollection  physicianCollection   = server.Database.GetCollection <BsonDocument>("Physician");
            MongoCollection  clientCollection      = server.Database.GetCollection <BsonDocument>("Client");
            BsonDocument     clientDocument        = clientCollection.FindOneAs <BsonDocument>(Query.EQ("ClientId", bsonClientId));
            MongoCursor      physicianClientCursor = physicianClientCollection.FindAs <BsonDocument>(Query.EQ("ClientId", bsonClientId));
            List <BsonValue> physicianIdList       = new List <BsonValue>();

            foreach (BsonDocument physicianClientDocument in physicianClientCursor)
            {
                physicianIdList.Add(physicianClientDocument.GetValue("PhysicianId"));
            }

            MongoCursor physicianCursor = physicianCollection.FindAs <BsonDocument>(Query.In("PhysicianId", physicianIdList)).SetSortOrder(SortBy.Ascending("LastName", "FirstName"));

            BsonValue bsonPhysicianClientId = null;

            foreach (BsonDocument physicianDocument in physicianCursor)
            {
                foreach (BsonDocument physicianClientDocument in physicianClientCursor)
                {
                    if (physicianClientDocument.GetValue("PhysicianId").Equals(physicianDocument.GetValue("PhysicianId")))
                    {
                        bsonPhysicianClientId = physicianClientDocument.GetValue("PhysicianClientId");
                        break;
                    }
                }

                YellowstonePathology.Business.Client.PhysicianClient physicianClient = BuildPhysicianClient(clientDocument, physicianDocument, bsonPhysicianClientId);
                result.Add(physicianClient);
            }
            return(result);
        }
        public static YellowstonePathology.Business.Client.PhysicianClientCollection GetPhysicianClientListByPhysicianLastNameV2(string physicianLastName)
        {
            YellowstonePathology.Business.Client.PhysicianClientCollection result = new Client.PhysicianClientCollection();
            SqlCommand cmd = new SqlCommand();
            cmd.CommandText = "Select pp.PhysicianClientId, c.ClientId, c.ClientName, ph.PhysicianId, ph.ObjectId [ProviderId], ph.DisplayName [PhysicianName], c.DistributionType, c.Fax [FaxNumber], c.Telephone, c.LongDistance, c.FacilityType, ph.NPI " +
                 "from tblClient c " +
                 "join tblPhysicianClient pp on c.clientid = pp.clientid " +
                 "Join tblPhysician ph on pp.ProviderId = ph.ObjectId " +
                 "where ph.LastName like @LastName + '%' order by ph.LastName, ph.FirstName, c.ClientName";
            cmd.CommandType = CommandType.Text;
            cmd.Parameters.Add(@"LastName", SqlDbType.VarChar, 50).Value = physicianLastName;

            using (SqlConnection cn = new SqlConnection(YellowstonePathology.Business.Properties.Settings.Default.CurrentConnectionString))
            {
                cn.Open();
                cmd.Connection = cn;
                using (SqlDataReader dr = cmd.ExecuteReader())
                {
                    while (dr.Read())
                    {
                        YellowstonePathology.Business.Client.PhysicianClient physicianClient = new Client.PhysicianClient();
                        YellowstonePathology.Business.Persistence.SqlDataReaderPropertyWriter sqlDataReaderPropertyWriter = new Persistence.SqlDataReaderPropertyWriter(physicianClient, dr);
                        sqlDataReaderPropertyWriter.WriteProperties();
                        result.Add(physicianClient);
                    }
                }
            }
            return result;
        }
        public static YellowstonePathology.Business.Client.PhysicianClientCollection GetPhysicianClientListByPhysicianLastName(string physicianLastName)
        {
            YellowstonePathology.Business.Client.PhysicianClientCollection result = new Client.PhysicianClientCollection();
            YellowstonePathology.Business.Mongo.Server server = new Business.Mongo.TestServer(YellowstonePathology.Business.Mongo.MongoTestServer.LISDatabaseName);
            MongoCollection physicianClientCollection = server.Database.GetCollection<BsonDocument>("PhysicianClient");
            MongoCollection physicianCollection = server.Database.GetCollection<BsonDocument>("Physician");
            MongoCollection clientCollection = server.Database.GetCollection<BsonDocument>("Client");
            MongoCursor physicianCursor = physicianCollection.FindAs<BsonDocument>(Query.Matches("LastName", BsonRegularExpression.Create("^" + physicianLastName + ".*", "i"))).SetSortOrder(SortBy.Ascending("LastName", "FirstName"));

            foreach (BsonDocument physicianDocument in physicianCursor)
            {
                BsonValue physicianId = physicianDocument.GetValue("PhysicianId");
                MongoCursor physicianClientCursor = physicianClientCollection.FindAs<BsonDocument>(Query.EQ("PhysicianId", physicianId));
                List<BsonValue> clientIdList = new List<BsonValue>();
                foreach(BsonDocument physicianClientDocument in physicianClientCursor)
                {
                    clientIdList.Add(physicianClientDocument.GetValue("ClientId"));
                }

                MongoCursor clientCursor = clientCollection.FindAs<BsonDocument>(Query.In("ClientId", clientIdList)).SetSortOrder(SortBy.Ascending("ClientName"));
                foreach (BsonDocument clientDocument in clientCursor)
                {
                    BsonValue physicianClientId = null;
                    foreach(BsonDocument physicianClientDocument in physicianClientCursor)
                    {
                        if(physicianClientDocument.GetValue("ClientId").Equals(clientDocument.GetValue("ClientId")))
                        {
                            physicianClientId = physicianClientDocument.GetValue("PhysicianClientId");
                            break;
                        }
                    }

                    YellowstonePathology.Business.Client.PhysicianClient physicianClient = BuildPhysicianClient(clientDocument, physicianDocument, physicianClientId);
                    result.Add(physicianClient);
                }
            }
            return result;
        }
        public static YellowstonePathology.Business.Client.PhysicianClientCollection GetPhysicianClientListByClientId(int clientId)
        {
            YellowstonePathology.Business.Client.PhysicianClientCollection result = new Client.PhysicianClientCollection();
            BsonValue bsonClientId = BsonValue.Create(clientId);
            YellowstonePathology.Business.Mongo.Server server = new Business.Mongo.TestServer(YellowstonePathology.Business.Mongo.MongoTestServer.LISDatabaseName);
            MongoCollection physicianClientCollection = server.Database.GetCollection<BsonDocument>("PhysicianClient");
            MongoCollection physicianCollection = server.Database.GetCollection<BsonDocument>("Physician");
            MongoCollection clientCollection = server.Database.GetCollection<BsonDocument>("Client");
            BsonDocument clientDocument = clientCollection.FindOneAs<BsonDocument>(Query.EQ("ClientId", bsonClientId));
            MongoCursor physicianClientCursor = physicianClientCollection.FindAs<BsonDocument>(Query.EQ("ClientId", bsonClientId));
            List<BsonValue> physicianIdList = new List<BsonValue>();

            foreach (BsonDocument physicianClientDocument in physicianClientCursor)
            {
                physicianIdList.Add(physicianClientDocument.GetValue("PhysicianId"));
            }

            MongoCursor physicianCursor = physicianCollection.FindAs<BsonDocument>(Query.In("PhysicianId", physicianIdList)).SetSortOrder(SortBy.Ascending("LastName", "FirstName"));

            BsonValue bsonPhysicianClientId = null;
            foreach (BsonDocument physicianDocument in physicianCursor)
            {
                foreach (BsonDocument physicianClientDocument in physicianClientCursor)
                {
                    if (physicianClientDocument.GetValue("PhysicianId").Equals(physicianDocument.GetValue("PhysicianId")))
                    {
                        bsonPhysicianClientId = physicianClientDocument.GetValue("PhysicianClientId");
                        break;
                    }
                }

                YellowstonePathology.Business.Client.PhysicianClient physicianClient = BuildPhysicianClient(clientDocument, physicianDocument, bsonPhysicianClientId);
                result.Add(physicianClient);
            }
            return result;
        }
示例#7
0
 public void GetRDPhysicianClientCollection(string physicianLastName)
 {
     this.m_RDPhysicianClientCollection = YellowstonePathology.Business.Gateway.PhysicianClientGateway.GetPhysicianClientListByPhysicianLastNameV2(physicianLastName);
     this.NotifyPropertyChanged("RDPhysicianClientCollection");
 }