Beispiel #1
0
        public List <BabyProfile> RetrieveAllBabies(FetchAllMotherRequest fmData)
        {
            string stProc = FetchAllBabyProfile;
            var    pList  = new List <SqlParameter>()
            {
                new SqlParameter("@HospitalId", fmData.hospitalId),
                new SqlParameter("@FromDate", fmData.fromDate.ToCheckNull()),
                new SqlParameter("@toDate", fmData.toDate.ToCheckNull()),
            };
            var babiesDetail = UtilityDL.FillData <BabyProfile>(stProc, pList);

            return(babiesDetail);
        }
Beispiel #2
0
        public async Task <IActionResult> GetAllMotherDetail(FetchAllMotherRequest fmData)
        {
            _logger.LogInformation($"Invoking endpoint: {this.HttpContext.Request.GetDisplayUrl()}");
            _logger.LogDebug($"Retrieve mother detail with baby detail - {JsonConvert.SerializeObject(fmData)}");
            var motherResponse = await _profileService.RetrieveAllMother(fmData);

            return(Ok(new MotherProfileResponse
            {
                Status = motherResponse.Status,
                Message = motherResponse.Message,
                data = motherResponse.data,
            }));
        }
Beispiel #3
0
        public ProfileMotherDetails RetrieveAllMother(FetchAllMotherRequest fmData)
        {
            string stProc = FetchAllMotherProfiles;
            var    pList  = new List <SqlParameter>()
            {
                new SqlParameter("@HospitalId", fmData.hospitalId),
                new SqlParameter("@FromDate", fmData.fromDate.ToCheckNull()),
                new SqlParameter("@toDate", fmData.toDate.ToCheckNull()),
            };
            var motherDetail = UtilityDL.FillData <MotherProfile>(stProc, pList);
            var babyDetail   = UtilityDL.FillData <MotherBabiesDetail>(stProc, pList);
            var mother       = new ProfileMotherDetails();

            mother.motherDetail = motherDetail;
            mother.babyDetail   = babyDetail;
            return(mother);
        }
Beispiel #4
0
        public BabyProfileResponse GetAllBabyProfile(FetchAllMotherRequest fmData)
        {
            _logger.LogInformation($"Invoking endpoint: {this.HttpContext.Request.GetDisplayUrl()}");
            try
            {
                var babies = _profileService.RetrieveAllBabies(fmData);

                _logger.LogInformation($"Received babies profile data {babies}");
                return(babies.Count == 0 ?
                       new BabyProfileResponse {
                    Status = "true", Message = "No record found", data = new List <BabyProfile>()
                }
                    : new BabyProfileResponse {
                    Status = "true", Message = string.Empty, data = babies
                });
            }
            catch (Exception e)
            {
                _logger.LogError($"Error in babies profile data {e.StackTrace}");
                return(new BabyProfileResponse {
                    Status = "false", Message = e.Message, data = null
                });
            }
        }
Beispiel #5
0
        public List <BabyProfile> RetrieveAllBabies(FetchAllMotherRequest fmData)
        {
            var babiesDetail = _profileData.RetrieveAllBabies(fmData);

            return(babiesDetail);
        }
Beispiel #6
0
        public async Task <MotherProfileResponse> RetrieveAllMother(FetchAllMotherRequest fmData)
        {
            var motherResponse = new MotherProfileResponse();

            try
            {
                if (fmData.hospitalId <= 0)
                {
                    motherResponse.Status  = "false";
                    motherResponse.Message = "Invalid hospital";
                }
                else
                {
                    var motherDetail          = _profileData.RetrieveAllMother(fmData);
                    var moms                  = new List <MOMProfile>();
                    var motherUniqueSubjectId = "";
                    foreach (var mother in motherDetail.motherDetail)
                    {
                        var mom = new MOMProfile();
                        if (motherUniqueSubjectId != mother.motherSubjectId)
                        {
                            var baby = motherDetail.babyDetail.Where(sd => sd.motherSubjectId == mother.motherSubjectId).ToList();
                            mom.motherSubjectId    = mother.motherSubjectId;
                            mom.dateofRegistration = mother.dateofRegistration;
                            mom.districtId         = mother.districtId;
                            mom.hospitalNo         = mother.hospitalNo;
                            mom.motherFirstName    = mother.motherFirstName;
                            mom.motherLastName     = mother.motherLastName;
                            mom.dob                     = mother.dob;
                            mom.age                     = mother.age;
                            mom.rchId                   = mother.rchId;
                            mom.g                       = mother.g;
                            mom.p                       = mother.p;
                            mom.l                       = mother.l;
                            mom.a                       = mother.a;
                            mom.motherGovIdTypeId       = mother.motherGovIdTypeId;
                            mom.motherGovIdDetail       = mother.motherGovIdDetail;
                            mom.motherContactNo         = mother.motherContactNo;
                            mom.gpla                    = mother.gpla;
                            mom.ecNumber                = mother.ecNumber;
                            mom.address1                = mother.address1;
                            mom.address2                = mother.address2;
                            mom.address3                = mother.address3;
                            mom.stateId                 = mother.stateId;
                            mom.stateName               = mother.stateName;
                            mom.districtName            = mother.districtName;
                            mom.pincode                 = mother.pincode;
                            mom.religionName            = mother.religionName;
                            mom.casteName               = mother.casteName;
                            mom.communityName           = mother.communityName;
                            mom.fatherFirstName         = mother.fatherFirstName;
                            mom.fatherLastName          = mother.fatherLastName;
                            mom.fatherContactNo         = mother.fatherContactNo;
                            mom.guardianFirstName       = mother.guardianFirstName;
                            mom.guardianLastName        = mother.guardianLastName;
                            mom.guardianContactNo       = mother.guardianContactNo;
                            mom.motherHospitalName      = mother.motherHospitalName;
                            mom.motherHospitalAddress   = mother.motherHospitalAddress;
                            mom.motherHospitalContactNo = mother.motherHospitalContactNo;
                            if (baby[0].babySubjectId == null)
                            {
                                mom.babyDetail = null;
                            }
                            else
                            {
                                mom.babyDetail = baby;
                            }
                            motherUniqueSubjectId = mother.motherSubjectId;
                            moms.Add(mom);
                        }
                    }
                    motherResponse.Status  = "true";
                    motherResponse.Message = string.Empty;
                    motherResponse.data    = moms;
                }
            }
            catch (Exception e)
            {
                motherResponse.Status  = "false";
                motherResponse.Message = e.Message;
            }
            return(motherResponse);
        }