Esempio 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));
        }
Esempio n. 2
0
        /// <summary>
        /// 获取当前科室和下属所有科室的医生列表
        /// </summary>
        /// <param name="requestDto"></param>
        /// <returns></returns>
        public async Task <GetDoctorListByParentOfficeNodeResponseDto> GetDoctorListByParentOfficeNodeAsync(GetDoctorListByParentOfficeNodeRequestDto requestDto)
        {
            var sqlWhere = string.Empty;

            if (requestDto.Gender != null)
            {
                sqlWhere = "and u.gender=@Gender";
            }

            var sql = $@"SELECT
	                        doc.doctor_guid AS DoctorGuid,
	                        tbUser.user_name AS DoctorName,
	                        doc.hospital_guid AS HospitalGuid,
	                        hos.hos_name AS HospitalName,
	                        doc.office_guid AS OfficeGuid,
	                        doc.office_name AS OfficeName,
	                        jobTitle.config_name AS Title,
	                        doc.adept_tags AS AdeptTags,
	                        doc.honor AS Honor,
	                        CONCAT( picture.base_path, picture.relative_path ) AS Picture,
	                        CONCAT( hospicture.base_path, hospicture.relative_path ) AS HospitalPicture 
                        FROM
	                        t_doctor AS doc
                            inner join t_utility_user u on doc.doctor_guid=u.user_guid
	                        LEFT JOIN t_manager_dictionary AS jobTitle ON doc.title_guid = jobTitle.dic_guid 
	                        AND jobTitle.`enable` =
	                        TRUE LEFT JOIN t_utility_accessory AS picture ON accessory_guid = doc.portrait_guid 
	                        AND picture.`enable` =
	                        TRUE LEFT JOIN t_utility_user AS tbUser ON tbUser.user_guid = doc.doctor_guid 
	                        AND tbUser.`enable` =
	                        TRUE LEFT JOIN t_doctor_hospital AS hos ON hos.hospital_guid = doc.hospital_guid 
	                        AND hos.`enable` =
	                        TRUE LEFT JOIN t_utility_accessory AS hospicture ON hospicture.accessory_guid = hos.logo_guid 
                        WHERE
	                        doc.`enable` = TRUE 
	                        AND doc.`status` = 'approved' and hos.`enable`=1 {sqlWhere}
                            and doc.office_guid in @OfficeIds
                        ORDER BY
	                        doc.creation_date"    ;

            return(await MySqlHelper.QueryByPageAsync <GetDoctorListByParentOfficeNodeRequestDto, GetDoctorListByParentOfficeNodeResponseDto, GetDoctorListByParentOfficeNodeItemDto>(sql, requestDto));
        }