Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

The method of developing Medical Registration system web

2025-04-07 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)05/31 Report--

Today, the editor will share with you the relevant knowledge points about the development of the medical registration system web. The content is detailed and the logic is clear. I believe most people still know too much about this knowledge, so share this article for your reference. I hope you can get something after reading this article. Let's take a look at it.

I. Hospital interface

In this paper, the development of distributed medical registration system, into the hospital information, department, typesetting interface development, the content is relatively boring.

Query hospital interface

Controller layer:

PostMapping ("hospital/show") public Result getHospital (HttpServletRequest request) {/ / 1. Convert the hospital information passed from the hospital management table to Object type Map requestMap = request.getParameterMap (); Map paramMap = HttpRequestHelper.switchMap (requestMap); / / 2. Get the key in the hospital management table (already encrypted with MD5) String hospSign = (String) paramMap.get ("sign"); / / 3. Get the key in the hospital setting table and encrypt it with MD5 String hoscode = (String) paramMap.get ("hoscode"); String signKey = hospitalSetService.getSignKey (hoscode); String signKeyMd5 = MD5.encrypt (signKey); / / 4. The error if (! hospSign.equals (signKeyMd5)) {throw new YyghException (ResultCodeEnum.SIGN_ERROR);} / / 5 is thrown if the key does not match. Execute query operation Hospital hospital = hospitalService.getByHoscode (hoscode); return Result.ok (hospital);}

Service interface:

Hospital getByHoscode (String hoscode)

Service implementation class:

@ Override public Hospital getByHoscode (String hoscode) {Hospital hospital = hospitalRepository.getHospitalByHoscode (hoscode); return hospital;}

Repository layer:

@ Repositorypublic interface HospitalRepository extends MongoRepository {/ * obtain records according to HosCode * @ param hoscode * @ return * / Hospital getHospitalByHoscode (String hoscode);}

II. Department interface (1) upload department function

Upload Controller layer of the department:

PostMapping ("saveDepartment") public Result saveDepartment (HttpServletRequest request) {/ / 1. Convert the passed array type to the Object type Map requestMap = request.getParameterMap (); Map paramMap = HttpRequestHelper.switchMap (requestMap); / / 2. Get the key in the hospital management table (already encrypted with MD5) String hospSign = (String) paramMap.get ("sign"); / / 3. Get the key in the hospital setting table and encrypt it with MD5 String hoscode = (String) paramMap.get ("hoscode"); String signKey = hospitalSetService.getSignKey (hoscode); String signKeyMd5 = MD5.encrypt (signKey); / / 4. The error if (! hospSign.equals (signKeyMd5)) {throw new YyghException (ResultCodeEnum.SIGN_ERROR);} / / 5 is thrown if the key does not match. Perform upload operation departmentService.save (paramMap); return Result.ok ();}

Upload the Service interface of the department:

Void save (Map paramMap)

Upload the department Service implementation class:

Override public void save (Map paramMap) {/ / 1. Convert the paramMap collection into Department objects (with the help of JSONObject tools) String paramMapString = JSONObject.toJSONString (paramMap); Department department = JSONObject.parseObject (paramMapString, Department.class); / / 2. According to the hospital number and department number, query the department information Department departmentExist = departmentRepository. GetDepartmentByHoscodeAndDepcode (department.getHoscode (), department.getDepcode ()); / / 3. If there is, perform the update, if not, save if (null! = departmentExist) {/ / update departmentExist.setUpdateTime (new Date ()); departmentExist.setIsDeleted (0); departmentRepository.save (departmentExist);} else {/ / save department.setCreateTime (new Date ()); department.setUpdateTime (new Date ()) Department.setIsDeleted (0); departmentRepository.save (department);}}

The Repositroy layer is left to Spring Data to complete automatically.

(2) inquire about the function of the department

Inquire about the Controller layer of the department:

PostMapping ("department/list") public Result findDepartment (HttpServletRequest request) {/ / 1. Convert the passed department to Object type Map requestMap = request.getParameterMap (); Map paramMap = HttpRequestHelper.switchMap (requestMap); / / 3. Get the hospital number String hoscode = (String) paramMap.get ("hoscode"); / / 2. Get the key in the hospital management table (already encrypted with MD5) String hospSign = (String) paramMap.get ("sign"); / / current page and records per page int page = StringUtils.isEmpty (paramMap.get ("page"))? 1: Integer.parseInt ((String) paramMap.get ("page")) Int limit = StringUtils.isEmpty (paramMap.get ("limit"))? 1: Integer.parseInt ((String) paramMap.get ("limit")); String signKey = hospitalSetService.getSignKey (hoscode); String signKeyMd5 = MD5.encrypt (signKey); / / 4. Throw the error if (! hospSign.equals (signKeyMd5)) {throw new YyghException (ResultCodeEnum.SIGN_ERROR);} DepartmentQueryVo departmentQueryVo = new DepartmentQueryVo (); departmentQueryVo.setHoscode (hoscode); / / execute the query department operation Page pageModel = departmentService.findPageDepartment (page, limit, departmentQueryVo); return Result.ok (pageModel);}

Query the Service interface of the department:

Page findPageDepartment (int page, int limit, DepartmentQueryVo departmentQueryVo)

Query the Service implementation class of the department:

@ Override public Page findPageDepartment (int page, int limit, DepartmentQueryVo departmentQueryVo) {/ / create Pageable object, set current page and records per page PageRequest pageable = PageRequest.of (page-1, limit); / / create Example object Department department = new Department (); BeanUtils.copyProperties (departmentQueryVo, department); department.setIsDeleted (0) ExampleMatcher matcher = ExampleMatcher.matching () .withStringMatcher (ExampleMatcher.StringMatcher.CONTAINING) .withIgnoreCase (true); Example example = Example.of (department, matcher); Page all = departmentRepository.findAll (example, pageable); return all;}

The Repositroy layer is left to Spring Data to complete automatically.

(3) delete the function of the department.

Delete the department Controller layer:

PostMapping ("department/remove") public Result removeDepartment (HttpServletRequest request) {/ / 1. Convert the passed department to Object type Map requestMap = request.getParameterMap (); Map paramMap = HttpRequestHelper.switchMap (requestMap); / / obtain the department number and hospital number String depcode = (String) paramMap.get ("depcode"); String hoscode = (String) paramMap.get ("hoscode"); / / 2. Get the key in the hospital management table (already encrypted with MD5) String hospSign = (String) paramMap.get ("sign"); / / 3. Get the key in the hospital setting table and encrypt it with MD5 String signKey = hospitalSetService.getSignKey (hoscode); String signKeyMd5 = MD5.encrypt (signKey); / / 4. Throw an error if (! hospSign.equals (signKeyMd5)) {throw new YyghException (ResultCodeEnum.SIGN_ERROR);} departmentService.remove (hoscode, depcode); return Result.ok ();}

Delete the Service API of department:

PostMapping ("department/remove") public Result removeDepartment (HttpServletRequest request) {/ / 1. Convert the passed department to Object type Map requestMap = request.getParameterMap (); Map paramMap = HttpRequestHelper.switchMap (requestMap); / / obtain the department number and hospital number String depcode = (String) paramMap.get ("depcode"); String hoscode = (String) paramMap.get ("hoscode"); / / 2. Get the key in the hospital management table (already encrypted with MD5) String hospSign = (String) paramMap.get ("sign"); / / 3. Get the key in the hospital setting table and encrypt it with MD5 String signKey = hospitalSetService.getSignKey (hoscode); String signKeyMd5 = MD5.encrypt (signKey); / / 4. Throw an error if (! hospSign.equals (signKeyMd5)) {throw new YyghException (ResultCodeEnum.SIGN_ERROR);} departmentService.remove (hoscode, depcode); return Result.ok ();}

Delete the Service API of department:

Void remove (String hoscode, String depcode)

Delete the department Service implementation class:

Override public void remove (String hoscode, String depcode) {/ / 1. Query department information according to hospital number and department number Department department = departmentRepository.getDepartmentByHoscodeAndDepcode (hoscode, depcode); if (null! = department) {/ / execute deletion method departmentRepository.deleteById (department.getId ());}}

The Repositroy layer is left to Spring Data to complete automatically.

3. Scheduling API (1) upload scheduling function

Upload the Controller layer of scheduling:

@ PostMapping ("saveSchedule") public Result saveSchedule (HttpServletRequest request) {Map requestMap = request.getParameterMap (); Map paramMap = HttpRequestHelper.switchMap (requestMap); / / obtain the department number and hospital number String hoscode = (String) paramMap.get ("hoscode"); / / 2. Get the key in the hospital management table (already encrypted with MD5) String hospSign = (String) paramMap.get ("sign"); / / 3. Get the key in the hospital setting table and encrypt it with MD5 String signKey = hospitalSetService.getSignKey (hoscode); String signKeyMd5 = MD5.encrypt (signKey); / / 4. Throw an error if (! hospSign.equals (signKeyMd5)) {throw new YyghException (ResultCodeEnum.SIGN_ERROR);} / perform upload operation scheduleService.save (paramMap); return Result.ok ();}

Upload Service API for scheduling:

Void save (Map paramMap)

Upload scheduling Service implementation class:

Override public void save (Map paramMap) {/ / 1. Convert the paramMap collection into Department objects (with the help of JSONObject tools) String paramMapString = JSONObject.toJSONString (paramMap); Schedule schedule = JSONObject.parseObject (paramMapString, Schedule.class); / / 2. Query the department information Schedule scheduleExist = scheduleRepository .getScheduleByHoscodeAndHosScheduleId (schedule.getHoscode (), schedule.getHosScheduleId ()) according to the hospital number and schedule number; / / 3. If there is an update, then save if (null! = scheduleExist) {/ / update scheduleExist.setUpdateTime (new Date ()); scheduleExist.setIsDeleted (0); scheduleExist.setStatus (1); scheduleRepository.save (scheduleExist);} else {/ / save schedule.setCreateTime (new Date ()) Schedule.setUpdateTime (new Date ()); schedule.setIsDeleted (0); schedule.setStatus (1); scheduleRepository.save (schedule);}}

The Repositroy layer is left to Spring Data to complete automatically.

(2) query scheduling function

Query scheduling Controller layer:

PostMapping ("schedule/list") public Result findSchedule (HttpServletRequest request) {Map requestMap = request.getParameterMap (); Map paramMap = HttpRequestHelper.switchMap (requestMap); / / 3. Get the hospital number: String hoscode = (String) paramMap.get ("hoscode"); String depcode = (String) paramMap.get ("depcode"); / / 2. Get the key in the hospital management table (already encrypted with MD5) String hospSign = (String) paramMap.get ("sign"); / / current page and records per page int page = StringUtils.isEmpty (paramMap.get ("page"))? 1: Integer.parseInt ((String) paramMap.get ("page")) Int limit = StringUtils.isEmpty (paramMap.get ("limit"))? 1: Integer.parseInt ((String) paramMap.get ("limit")); String signKey = hospitalSetService.getSignKey (hoscode); String signKeyMd5 = MD5.encrypt (signKey); / / 4. Throw error if (! hospSign.equals (signKeyMd5)) {throw new YyghException (ResultCodeEnum.SIGN_ERROR);} ScheduleQueryVo scheduleQueryVo = new ScheduleQueryVo (); scheduleQueryVo.setHoscode (hoscode); scheduleQueryVo.setHoscode (depcode); / / perform query operation Page pageModel = scheduleService.findPageSchedule (page, limit, scheduleQueryVo); return Result.ok (pageModel);}

Query the Service API for scheduling:

Page findPageSchedule (int page, int limit, ScheduleQueryVo scheduleQueryVo)

Query scheduling Service implementation class:

@ Override public Page findPageSchedule (int page, int limit, ScheduleQueryVo scheduleQueryVo) {/ / create Pageable object, set current page and records per page PageRequest pageable = PageRequest.of (page-1, limit); / / create Example object Schedule schedule = new Schedule (); BeanUtils.copyProperties (scheduleQueryVo, schedule); schedule.setIsDeleted (0); schedule.setStatus (1) ExampleMatcher matcher = ExampleMatcher.matching () .withStringMatcher (ExampleMatcher.StringMatcher.CONTAINING) .withIgnoreCase (true); Example example = Example.of (schedule, matcher); Page all = scheduleRepository.findAll (example, pageable); return all;}

The Repositroy layer is left to Spring Data to complete automatically.

(3) delete the scheduling function

Delete the scheduling Controller layer:

@ PostMapping ("schedule/remove") public Result removeSchedule (HttpServletRequest request) {Map requestMap = request.getParameterMap (); Map paramMap = HttpRequestHelper.switchMap (requestMap); / / get the hospital number and scheduling number String hoscode = (String) paramMap.get ("hoscode"); String hosScheduleId = (String) paramMap.get ("hosScheduleId"); / / 2. Get the key in the hospital management table (already encrypted with MD5) String hospSign = (String) paramMap.get ("sign"); / / 3. Get the key in the hospital setting table and encrypt it with MD5 String signKey = hospitalSetService.getSignKey (hoscode); String signKeyMd5 = MD5.encrypt (signKey); / / 4. Throw an error if (! hospSign.equals (signKeyMd5)) {throw new YyghException (ResultCodeEnum.SIGN_ERROR);} scheduleService.removeSchedule (hoscode, hosScheduleId); return Result.ok ();}

Delete the scheduling Service API:

Void removeSchedule (String hoscode, String hosScheduleId)

Delete the scheduling Service implementation class:

@ PostMapping ("schedule/remove") public Result removeSchedule (HttpServletRequest request) {Map requestMap = request.getParameterMap (); Map paramMap = HttpRequestHelper.switchMap (requestMap); / / get the hospital number and scheduling number String hoscode = (String) paramMap.get ("hoscode"); String hosScheduleId = (String) paramMap.get ("hosScheduleId"); / / 2. Get the key in the hospital management table (already encrypted with MD5) String hospSign = (String) paramMap.get ("sign"); / / 3. Get the key in the hospital setting table and encrypt it with MD5 String signKey = hospitalSetService.getSignKey (hoscode); String signKeyMd5 = MD5.encrypt (signKey); / / 4. Throw an error if (! hospSign.equals (signKeyMd5)) {throw new YyghException (ResultCodeEnum.SIGN_ERROR);} scheduleService.removeSchedule (hoscode, hosScheduleId); return Result.ok ();}

The Repositroy layer is left to Spring Data to complete automatically.

These are all the contents of this article entitled "the method of developing Medical Registration system web". Thank you for reading! I believe you will gain a lot after reading this article. The editor will update different knowledge for you every day. If you want to learn more knowledge, please pay attention to the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report