Exemplo n.º 1
0
        public async Task <IActionResult> GetDoctorListByParentOfficeNodeAsync([FromBody] GetDoctorListByParentOfficeNodeRequestDto requestDto)
        {
            var officeBiz = new OfficeBiz();

            //获取选择的科室model
            var officeModel = await officeBiz.GetAsync(requestDto.OfficeGuid);

            var officeIds = new List <string>();
            //获取医院下所有科室
            var officeModels = await officeBiz.GetHospitalOfficeAllAsync(requestDto.HospitalGuid);

            if (string.IsNullOrWhiteSpace(requestDto.OfficeGuid))
            {
                var levelOneOffices = officeBiz.GetHospitalOffice(requestDto.HospitalGuid, null);
                foreach (var item in levelOneOffices)
                {
                    officeIds.AddRange(officeBiz.GetOfficeListByParentOfficeNode(item.OfficeGuid, officeModels));
                }
            }
            else
            {
                officeIds.AddRange(officeBiz.GetOfficeListByParentOfficeNode(officeModel.OfficeGuid, officeModels));
            }

            requestDto.OfficeIds = officeIds;
            var response = await new DoctorBiz().GetDoctorListByParentOfficeNodeAsync(requestDto);

            return(Success(response));
        }
Exemplo n.º 2
0
        public async Task <IActionResult> GetDoctorByFirstLevelOfficeNameAsync([FromQuery] GetDoctorByFirstLevelOfficeNameRequestDto requestDto)
        {
            var officeBiz       = new OfficeBiz();
            var levelOneOffices = await officeBiz.GetModelByNameAsync(requestDto.OfficeName);

            var officeIds    = new List <string>();
            var officeModels = await officeBiz.GetAllAsync();

            foreach (var item in levelOneOffices)
            {
                officeIds.AddRange(officeBiz.GetOfficeListByParentOfficeNode(item.OfficeGuid, officeModels));
            }
            requestDto.OfficeIds = officeIds;
            var response = await new DoctorBiz().GetDoctorByFirstLevelOfficeNameAsync(requestDto);

            return(Success(response));
        }