예제 #1
0
        public HttpResponseMessage GetHospitalDetail(string hospitalid)
        {
            List <HospitalDetails> hospitals = _hospitaldetailsRepo.Find(x => x.HospitalId == hospitalid);

            var             hospitalService  = _hospitalServicesRepository.GetAll().OrderBy(x => x.HospitalServices).ToList();
            var             hospitalAmenitie = _hospitalAmenitieRepository.GetAll().OrderBy(x => x.HospitalAmenities).ToList();
            var             disease          = _diseaseDetailRepo.GetAll().OrderBy(x => x.DiseaseType).ToList();
            Hospital        _hospital        = new Hospital();
            List <Hospital> _hospitals       = new List <Hospital>();

            foreach (var h in hospitals ?? new List <HospitalDetails>())
            {
                var feedback = _feedbackRepo.Find(x => x.PageId == h.HospitalId);


                _hospital = new Hospital
                {
                    HospitalId        = h.HospitalId,
                    HospitalName      = h.HospitalName,
                    Mobile            = h.Mobile,
                    AlternateNumber   = h.AlternateNumber,
                    Email             = h.Email,
                    Website           = h.Website,
                    EstablishYear     = h.EstablishYear,
                    NumberofBed       = h.NumberofBed,
                    NumberofAmbulance = h.NumberofAmbulance,
                    PaymentType       = h.PaymentType,
                    Emergency         = h.Emergency,
                    FacilityId        = h.FacilityId,
                    Address           = h.Address,
                    Street            = h.Street,
                    Country           = h.Country,
                    City               = h.City,
                    PostCode           = h.PostCode,
                    Landmark           = h.Landmark,
                    InsuranceCompanies = h.InsuranceCompanies,
                    // AmenitiesIds = Array.ConvertAll(h.Amenities.Split(','), s => int.Parse(s)),
                    Amenities = getHospitalAmenities(h.Amenities, hospitalAmenitie),
                    // ServicesIds = Array.ConvertAll(h.Services.Split(','), s => int.Parse(s)),
                    Services         = getHospitalService(h.Services, hospitalService),
                    Specialization   = getSpecialization(h.Specialization, disease),
                    Doctors          = getDoctors(h.HospitalId),
                    Likes            = feedback.Where(x => x.ILike == true).Count(),
                    Feedbacks        = feedback.Count(),
                    BookingUrl       = $"booking/{h.HospitalId}",
                    ProfileDetailUrl = $"hospitalDetails/{h.HospitalId}",
                    ImgUrl           = $"{constant.imgUrl}/Hospital/{h.HospitalId}.Jpeg"
                };

                _hospitals.Add(_hospital);
            }
            return(Request.CreateResponse(HttpStatusCode.Accepted, _hospitals));
        }
예제 #2
0
        public HttpResponseMessage doctorDetails(string doctorid)
        {
            List <Feedback> feedbacks        = new List <Feedback>();
            var             disease          = _diseaseDetailRepo.GetAll().OrderBy(x => x.DiseaseType).ToList();
            Doctor          d                = _doctorRepo.Find(x => x.DoctorId == doctorid).FirstOrDefault();
            var             feedback         = _feedbackRepo.Find(x => x.PageId == doctorid);
            var             hospitalService  = _hospitalServicesRepository.GetAll().OrderBy(x => x.HospitalServices).ToList();
            var             hospitalAmenitie = _hospitalAmenitieRepository.GetAll().OrderBy(x => x.HospitalAmenities).ToList();
            HospitalDetails hospitals        = _hospitaldetailsRepo.Find(x => x.HospitalId == d.HospitalId).FirstOrDefault();

            if (d != null)
            {
                Doctors _doctor = new Doctors
                {
                    DoctorId             = d.DoctorId,
                    FirstName            = d.FirstName,
                    LastName             = d.LastName,
                    Email                = d.Email,
                    PhoneNumber          = d.PhoneNumber,
                    AlternatePhoneNumber = d.AlternatePhoneNumber,
                    Gender               = d.Gender,
                    Experience           = d.Experience,
                    FeeMoney             = d.FeeMoney,
                    Language             = d.Language,
                    AgeGroupGender       = d.AgeGroupGender,
                    Degree               = d.Degree,
                    AboutUs              = d.AboutUs,
                    HospitalName         = hospitals.HospitalName,
                    HospitalId           = hospitals.HospitalId,
                    HospitalEmail        = hospitals.Email,
                    HospitalAddress      = hospitals.Address,
                    HospitalPicUrl       = $"{constant.imgUrl}/" + hospitals.ProfilePath,
                    aboutMe              = d.AboutUs,
                    DoctorAvilability    = _doctorAvailabilityRepo.Find(x => x.DoctorId == d.DoctorId),
                    Specialization       = getSpecialization(d.Specialization, disease),
                    Amenities            = getHospitalAmenities(hospitals.Amenities, hospitalAmenitie),
                    Services             = getHospitalService(hospitals.Services, hospitalService),
                    Feedback             = _feedbackRepo.Find(x => x.PageId == doctorid),
                    Likes                = _feedbackRepo.Find(x => x.PageId == doctorid && x.ILike == true).Count(),
                    location             = "",
                    ImgUrl               = $"{constant.imgUrl}/ProfilePic/Doctor/{d.DoctorId}.Jpeg",
                    website              = hospitals.Website,
                    Address              = hospitals.Address
                };
                return(Request.CreateResponse(HttpStatusCode.Accepted, _doctor));
            }
            return(Request.CreateResponse(HttpStatusCode.NotFound));
        }
예제 #3
0
        public PersonsDiseaseQuery(IPersonRepository personRepository, IDiseaseRepository diseaseRepository, IPersonalDiseasesRepository pdRepository)
        {
            Name = "PersonsDiseaseQuery";

            Field <PersonsType>(
                "person",
                arguments: new QueryArguments(new QueryArgument <IntGraphType> {
                Name = "Id"
            }),
                resolve: context => personRepository.GetById(context.GetArgument <int>("Id"))
                );

            Field <ListGraphType <PersonsType> >(
                "persons", "Returns list of persons",
                resolve: context => personRepository.GetAll()
                );

            Field <DiseasesType>(
                "disease",
                arguments: new QueryArguments(new QueryArgument <IntGraphType> {
                Name = "Id"
            }),
                resolve: context => diseaseRepository.GetById(context.GetArgument <int>("Id"))
                );

            Field <ListGraphType <DiseasesType> >(
                "diseases", "returns list of disease",
                resolve: context => diseaseRepository.GetAll()
                );

            Field <ListGraphType <PersonalDiseasesType> >(
                "personsDiseases", "returns list of all persons with diseases",
                resolve: context => pdRepository.GetAll()
                );
        }
        private List <Doctors> getDoctors(string HospitalId)
        {
            List <TimeMaster> _timeMaster = new List <TimeMaster>();
            var timeMaster = _timeMasterRepo.GetAll().OrderBy(x => x.Id).ToList();


            List <Disease> _disease  = new List <Disease>();
            List <decimal> _priceses = new List <decimal>();
            Doctors        _doctor   = new Doctors();
            List <Doctors> _doctors  = new List <Doctors>();
            List <Doctor>  doctors   = _doctorRepo.Find(x => x.HospitalId == HospitalId);
            var            disease   = _diseaseDetailRepo.GetAll().OrderBy(x => x.DiseaseType).ToList();

            foreach (var d in doctors ?? new List <Doctor>())
            {
                var feedback           = _feedbackRepo.Find(x => x.PageId == d.DoctorId);
                var doctorAvailability = _doctorAvailabilityRepo.Find(x => x.DoctorId == d.DoctorId).FirstOrDefault();
                _doctor = new Doctors
                {
                    DoctorId                                                       = d.DoctorId,
                    FirstName                                                      = d.FirstName,
                    LastName                                                       = d.LastName,
                    Email                                                          = d.Email,
                    PhoneNumber                                                    = d.PhoneNumber,
                    AlternatePhoneNumber                                           = d.AlternatePhoneNumber,
                    Gender                                                         = d.Gender,
                    Experience                                                     = d.Experience,
                    FeeMoney                                                       = d.FeeMoney,
                    Language                                                       = d.Language,
                    AgeGroupGender                                                 = d.AgeGroupGender,
                    Degree                                                         = d.Degree,
                    SpecializationIds                                              = Array.ConvertAll(d.Specialization.Split(','), s => int.Parse(s)),//d.Specialization,
                    Specialization                                                 = getSpecialization(d.Specialization, disease),
                    AboutUs                                                        = d.AboutUs,
                    TimeAvailability                                               = doctorAvailability != null?getDoctorAvilability(doctorAvailability.TimeId, timeMaster) : null,
                                                                  Likes            = feedback.Where(x => x.ILike == true).Count(),
                                                                  Feedbacks        = feedback.Count(),
                                                                  BookingUrl       = $"booking/{d.DoctorId}",
                                                                  ProfileDetailUrl = $"doctorDetails/{d.DoctorId}",
                                                                  ImgUrl           = $"{constant.imgUrl}/ProfilePic/Doctor/{d.DoctorId}.Jpeg"
                };

                _doctors.Add(_doctor);
            }
            return(_doctors);
        }
예제 #5
0
        public HttpResponseMessage GetFacilityDetail(string FacilityDetailId)
        {
            var disease                      = _diseaseDetailRepo.GetAll().OrderBy(x => x.DiseaseType).ToList();
            var hospitalService              = _hospitalServicesRepository.GetAll().OrderBy(x => x.HospitalServices).ToList();
            var hospitalAmenitie             = _hospitalAmenitieRepository.GetAll().OrderBy(x => x.HospitalAmenities).ToList();
            List <FacilityDetail> facility   = _facilityDetailRepo.Find(x => x.FacilityDetailId == FacilityDetailId);
            Facilities            _facilties = new Facilities();

            List <Facilities> _faciltiess = new List <Facilities>();

            foreach (var f in facility ?? new List <FacilityDetail>())
            {
                _facilties = new Facilities
                {
                    Id = f.Id,
                    FacilityDetailId = f.FacilityDetailId,
                    FacilityId       = f.FacilityId,
                    ProviderName     = f.ProviderName,
                    FirstName        = f.FirstName,
                    LastName         = f.LastName,
                    CountryCode      = f.CountryCode,
                    Email            = f.Email,
                    EmailConfirmed   = f.EmailConfirmed,
                    PhoneNumber      = f.PhoneNumber,
                    jobType          = f.jobType,
                    AboutUs          = f.AboutUs,
                    PhotoPath        = f.PhotoPath,
                    Website          = f.Website,
                    EstablishYear    = f.EstablishYear,
                    Address          = f.Address,
                    Street           = f.Street,
                    Country          = f.Country,
                    City             = f.City,
                    PostCode         = f.PostCode,
                    Landmark         = f.Landmark,
                    MapLocation      = f.MapLocation,
                    Specialization   = getSpecialization(f.Specialization, disease),
                    // Amenities = f.Amenities,
                    Amenities = getHospitalAmenities(f.Amenities, hospitalAmenitie),
                    // Services = f.Services,
                    Services     = getHospitalService(f.Services, hospitalService),
                    Timing       = f.Timing,
                    IsDeleted    = f.IsDeleted,
                    CreatedBy    = f.CreatedBy,
                    ModifiedBy   = f.ModifiedBy,
                    DateEntered  = Convert.ToDateTime(f.DateEntered),
                    DateModified = Convert.ToDateTime(f.DateModified),
                };

                _faciltiess.Add(_facilties);
            }
            return(Request.CreateResponse(HttpStatusCode.Accepted, _faciltiess));
        }
예제 #6
0
        public HttpResponseMessage getAllPrescription(string patientId)
        {
            var disease = _diseaseDetailRepo.GetAll().OrderBy(x => x.DiseaseType).ToList();
            var patientPrescriptions = from p in _prescriptionRepo.GetAll()
                                       join d in _doctorRepo.GetAll() on p.DoctorId equals d.DoctorId
                                       join h in _hospitaldetailsRepo.GetAll() on d.HospitalId equals h.HospitalId
                                       where (p.PatientId == patientId)
                                       select new
            {
                HospitalName     = h.HospitalName,
                HospitalNCNumber = h.HospitalId,
                DoctorName       = d.FirstName + " " + d.LastName,
                DoctorNCNumber   = d.DoctorId,
                Prescription     = p.Prescription,
                Report           = p.Report,
                PrescriptionDate = p.DateEntered,
                PrescriptionId   = p.Id,
                Specialization   = getSpecialization(d.Specialization, disease),
                //Doctors = getDoctorDetailByDoctorId(d.DoctorId)
            };

            return(Request.CreateResponse(HttpStatusCode.Accepted, patientPrescriptions));
        }
예제 #7
0
        public List <Disease> GetDisease()
        {
            IDiseaseRepository _diseaseDetailRepo = RepositoryFactory.Create <IDiseaseRepository>(ContextTypes.EntityFramework);

            return(_diseaseDetailRepo.GetAll().OrderBy(x => x.DiseaseType).ToList());
        }
예제 #8
0
 private void Bind(IEnumerable <Medicine> medicine)
 {
     BindMedicineWithDisease(medicine, _diseaseRepository.GetAll());
     BindMedicineWithIngredients(medicine, _ingredientRepository.GetAll());
 }
예제 #9
0
 public ICollection <Disease> GetAllDiseases()
 {
     return(_repository.GetAll());
 }
예제 #10
0
 public async Task <IEnumerable <DiseaseDTO> > GetAll()
 {
     return((await _diseaseRepository.GetAll()).Select(DiseaseMapper.Map).ToList());
 }
예제 #11
0
        public HttpResponseMessage GetUploadedDocInfo(string clientId)
        {
            var    desiesTypeResultList = new List <DesiesTypeResult>();
            var    disease = _diseaseDetailRepo.GetAll().OrderBy(x => x.DiseaseType).ToList();
            string host    = ConfigurationManager.AppSettings.Get("ImageBaseUrl");//HttpContext.Current.Request.Url.Host;
            var    result  = _quickUploadRepo.Find(x => x.ClientId == clientId);

            //int count = _doctorRepo.Find(doc => doc.DoctorId == clientId).Count;
            //if (count > 0)
            //{
            //    var quickUp = _quickUploadRepo.GetAll().ToList();
            //    var quickUpAssign = _QuickUploadAssignRepo.GetAll().ToList();

            //    var appointDetail = (from a in quickUp
            //                         join t in quickUpAssign on a.Id equals t.QuickUploadId
            //                         where t.AssignId == clientId && t.IsActive == true
            //                         select a).ToList();
            //    result = appointDetail;
            //}


            var list = result.ToList();
            var data = list.GroupBy(item => item.DesiesType)
                       .Select(group => new { diseaseType = group.Key, Items = group.ToList() })
                       .ToList();

            foreach (var x in data)
            {
                var desiesTypeResult = new DesiesTypeResult();
                var listYear         = x.Items.Select(xx => xx).ToList().GroupBy(p => p.AddedYear).
                                       Select(group => new { AddedYear = group.Key, Items = group.ToList() })
                                       .ToList();
                desiesTypeResult.Years = new List <int?>();
                if (x.diseaseType != 0)
                {
                    desiesTypeResult.DiseaseType = x.diseaseType;
                    desiesTypeResult.DesiesName  = disease.Where(c => c.Id == x.diseaseType).FirstOrDefault().DiseaseType;
                }
                desiesTypeResult.YearList = new List <YearList>();
                foreach (var it in listYear)
                {
                    desiesTypeResult.Years.Add(it.AddedYear);
                    var yearList = new YearList();
                    yearList.Year = it.AddedYear;

                    var listMonth = it.Items.Select(xxp => xxp).ToList().GroupBy(ppp => ppp.AddedMonth).
                                    Select(group => new { AddedMonth = group.Key, Items = group.ToList() })
                                    .ToList();
                    yearList.Month     = new List <int?>();
                    yearList.MonthList = new List <MonthList>();
                    foreach (var mo in listMonth)
                    {
                        yearList.Month.Add(mo.AddedMonth);
                        var monthList = new MonthList();
                        monthList.Month = mo.AddedMonth;

                        yearList.MonthList.Add(monthList);
                        //MonthList
                        // To get Files details
                        monthList.FileList = new List <FileName>();
                        foreach (var file in mo.Items)
                        {
                            var fileName = new FileName();
                            fileName.DocName    = file.FilePath;
                            fileName.HospitalId = file.HospitalId;
                            fileName.Id         = file.Id;
                            //baseURL/ClientDocument/ClientId/DesiseType/Year/Month/Files.jpg
                            fileName.DocUrl = constant.imgUrl + "ClientDocument/" + clientId + "/" + desiesTypeResult.DiseaseType + "/" + it.AddedYear
                                              + "/" + mo.AddedMonth + "/" + file.FilePath;
                            monthList.FileList.Add(fileName);
                        }
                    }

                    desiesTypeResult.YearList.Add(yearList);
                }

                desiesTypeResultList.Add(desiesTypeResult);
            }

            return(Request.CreateResponse(HttpStatusCode.Accepted, desiesTypeResultList));
        }