PatientController.java 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637
  1. package com.yihu.wlyy.web.patient.account;
  2. import com.yihu.wlyy.entity.doctor.profile.Doctor;
  3. import com.yihu.wlyy.entity.patient.Patient;
  4. import com.yihu.wlyy.entity.patient.SignFamily;
  5. import com.yihu.wlyy.service.app.account.PatientInfoService;
  6. import com.yihu.wlyy.service.app.sign.FamilyContractService;
  7. import com.yihu.wlyy.service.app.team.DrHealthTeamService;
  8. import com.yihu.wlyy.service.common.account.DoctorService;
  9. import com.yihu.wlyy.service.common.account.TokenService;
  10. import com.yihu.wlyy.util.CommonUtil;
  11. import com.yihu.wlyy.util.DateUtil;
  12. import com.yihu.wlyy.util.EncodesUtil;
  13. import com.yihu.wlyy.web.WeixinBaseController;
  14. import io.swagger.annotations.Api;
  15. import org.apache.commons.lang3.StringUtils;
  16. import org.json.JSONArray;
  17. import org.json.JSONObject;
  18. import org.springframework.beans.factory.annotation.Autowired;
  19. import org.springframework.stereotype.Controller;
  20. import org.springframework.web.bind.annotation.RequestMapping;
  21. import org.springframework.web.bind.annotation.RequestParam;
  22. import org.springframework.web.bind.annotation.ResponseBody;
  23. import org.springside.modules.utils.Encodes;
  24. import java.util.List;
  25. /**
  26. * 患者帳戶信息的Controller.
  27. *
  28. * @author George
  29. */
  30. @Controller
  31. @RequestMapping(value = "/patient")
  32. @Api(description = "患者管理")
  33. public class PatientController extends WeixinBaseController {
  34. @Autowired
  35. private PatientInfoService patientInfoService;
  36. @Autowired
  37. private TokenService tokenService;
  38. @Autowired
  39. private FamilyContractService familyContractService;
  40. @Autowired
  41. private DrHealthTeamService doctorTeamService;
  42. @Autowired
  43. private DoctorService doctorService;
  44. /**
  45. * 患者基本信息查询接口
  46. *
  47. * @return
  48. */
  49. @RequestMapping(value = "baseinfo")
  50. @ResponseBody
  51. public String baseinfo() {
  52. try {
  53. Patient temp = patientInfoService.findByCode(getUID());
  54. SignFamily sanshi = familyContractService.findByPatientByType(getUID(), 1);
  55. SignFamily jiating = familyContractService.findByPatientByType(getUID(), 2);
  56. int sign = 0;
  57. if (sanshi != null && jiating != null) {
  58. sign = 3;
  59. } else if (jiating != null) {
  60. sign = 2;
  61. } else if (sanshi != null) {
  62. sign = 1;
  63. }
  64. if (temp != null) {
  65. JSONObject json = new JSONObject();
  66. // 设置患者标识
  67. json.put("code", temp.getCode());
  68. // 设置患者姓名
  69. json.put("name", temp.getName());
  70. // 设置患者头像
  71. json.put("photo", CommonUtil.getPhoneUrl(temp.getPhoto()));
  72. // 设置患者年龄
  73. json.put("birthday", DateUtil.dateToStrShort(temp.getBirthday()));
  74. // 设置患者性别
  75. json.put("sex", temp.getSex());
  76. // 设置手机号码
  77. // json.put("mobile", CommonUtil.getMobileEncode(temp.getMobile()));
  78. json.put("mobile", temp.getMobile());
  79. // 设置身份证号
  80. json.put("idcard", CommonUtil.getIdcardEncode(temp.getIdcard()));//加密过的完整身份证
  81. // 设置社保卡号
  82. json.put("ssc", temp.getSsc());
  83. // 设置省
  84. json.put("province", temp.getProvince());
  85. // 设置市
  86. json.put("city", temp.getCity());
  87. // 设置区县
  88. json.put("area", temp.getTown());
  89. // 设置省名称
  90. json.put("provinceName", temp.getProvinceName());
  91. // 设置市名称
  92. json.put("cityName", temp.getCityName());
  93. // 设置区县名称
  94. json.put("areaName", temp.getTownName());
  95. // 设置街道
  96. json.put("street", temp.getStreet());
  97. // 设置街道名称
  98. json.put("streetName", temp.getStreetName());
  99. // 设置地址
  100. json.put("address", temp.getAddress());
  101. // 设置签约状态:0未签约,1三师,2家庭,3三师和家庭
  102. json.put("sign", sign);
  103. json.put("idcardAll", temp.getIdcard());//完整身份证
  104. return write(200, "患者信息查询成功!", "data", json);
  105. } else {
  106. return error(-1, "患者信息查询失败!");
  107. }
  108. } catch (Exception e) {
  109. error(e);
  110. return invalidUserException(e, -1, "患者信息查询失败!");
  111. }
  112. }
  113. /**
  114. * 患者基本信息保存
  115. *
  116. * @param photo 頭像
  117. * @param name 姓名
  118. * @param sex 性別
  119. * @param birthday 生日
  120. * @param ssc 社保卡號
  121. * @param province 省標識
  122. * @param city 市標識
  123. * @param town 區縣標識
  124. * @param address 詳細地址
  125. * @param street 街道
  126. * @return
  127. */
  128. @RequestMapping(value = "save")
  129. @ResponseBody
  130. public String save(@RequestParam(required = false) String photo, @RequestParam(required = false) String name, @RequestParam(required = false) Integer sex, @RequestParam(required = false) String birthday, @RequestParam(required = false) String ssc, @RequestParam(required = false) String province, @RequestParam(required = false) String city, @RequestParam(required = false) String town, @RequestParam(required = false) String address, @RequestParam(required = false) String street) {
  131. try {
  132. Patient patient = patientInfoService.findByCode(getUID());
  133. if (StringUtils.isEmpty(photo)) {
  134. photo = fetchWxImages();
  135. }
  136. if (StringUtils.isNotEmpty(photo)) {
  137. photo = CommonUtil.copyTempImage(photo);
  138. }
  139. if (StringUtils.isNotEmpty(photo)) {
  140. patient.setPhoto(photo);
  141. }
  142. if (StringUtils.isNotEmpty(name))
  143. patient.setName(name);
  144. if (sex != null)
  145. patient.setSex(sex);
  146. if (StringUtils.isNotEmpty(birthday))
  147. patient.setBirthday(DateUtil.strToDate(birthday, DateUtil.YYYY_MM_DD));
  148. // if (StringUtils.isNotEmpty(ssc) && StringUtils.isEmpty(patient.getSsc()))
  149. // patient.setSsc(ssc);
  150. // if (StringUtils.isNotEmpty(province))
  151. patient.setProvince(province);
  152. //if (StringUtils.isNotEmpty(city))
  153. patient.setCity(city);
  154. //if (StringUtils.isNotEmpty(town))
  155. patient.setTown(town);
  156. //if (StringUtils.isNotEmpty(address))
  157. patient.setAddress(address);
  158. //if (StringUtils.isNotEmpty(street))
  159. patient.setStreet(street);
  160. if (patientInfoService.updatePatient(patient) != null) {
  161. // 修改成功
  162. return success("保存成功!");
  163. } else {
  164. // 注册失败
  165. return error(-1, "保存失败!");
  166. }
  167. } catch (Exception e) {
  168. error(e);
  169. return invalidUserException(e, -1, "保存失败!");
  170. }
  171. }
  172. /**
  173. * 患者信息查询接口
  174. *
  175. * @return
  176. */
  177. @RequestMapping(value = "info")
  178. @ResponseBody
  179. public String info() {
  180. try {
  181. Patient temp = patientInfoService.findByCode(getUID());
  182. if (temp != null) {
  183. JSONObject json = new JSONObject();
  184. // 设置患者标识
  185. json.put("code", temp.getCode());
  186. // 设置患者姓名
  187. json.put("name", temp.getName());
  188. // 设置患者头像
  189. json.put("photo", CommonUtil.getPhoneUrl(temp.getPhoto()));
  190. // 设置患者出生年月
  191. json.put("birthday", DateUtil.dateToStr(temp.getBirthday(), DateUtil.YYYY_MM_DD));
  192. // 设置患者年龄
  193. json.put("age", DateUtil.getAgeByBirthday(temp.getBirthday()));
  194. // 设置患者性别
  195. json.put("sex", temp.getSex());
  196. // 设置患者病情:0绿标,1黄标,2红标
  197. json.put("diseaseLevel", temp.getDiseaseCondition());
  198. // 查询签约信息
  199. SignFamily signContract = familyContractService.findByPatient(getUID());
  200. if (signContract == null) {
  201. // 设置签约日期
  202. json.put("qyrq", "");
  203. // 设置健康管理师
  204. json.put("health", "");
  205. // 设置专科医生
  206. json.put("specialist", "");
  207. // 设置全科医生
  208. json.put("gp", "");
  209. } else {
  210. // 设置签约日期
  211. json.put("qyrq", DateUtil.dateToStr(signContract.getBegin(), DateUtil.YYYY_MM_DD));
  212. // // 查询三师医生信息
  213. // List<DoctorTeamInfo> doctorTeamInfos = doctorTeamService.findDoctorByTeam(signContract.getTeam());
  214. // if (doctorTeamInfos != null) {
  215. // for (DoctorTeamInfo doctorTeamInfo : doctorTeamInfos) {
  216. // if (doctorTeamInfo.getType() == 1) {
  217. // json.put("specialist", doctorTeamInfo.getName());
  218. // } else if (doctorTeamInfo.getType() == 2) {
  219. // json.put("gp", doctorTeamInfo.getName());
  220. // } else
  221. // json.put("health", doctorTeamInfo.getName());
  222. // }
  223. // } else {
  224. json.put("health", "");
  225. json.put("specialist", "");
  226. json.put("gp", "");
  227. // }
  228. }
  229. return write(200, "患者信息查询成功!", "data", json);
  230. } else {
  231. return error(-1, "患者信息查询失败!");
  232. }
  233. } catch (Exception e) {
  234. error(e);
  235. return invalidUserException(e, -1, "患者信息查询失败!");
  236. }
  237. }
  238. /**
  239. * 修改密码
  240. *
  241. * @param oldpwd 旧密码
  242. * @param newpwd 新密码
  243. * @return
  244. */
  245. @RequestMapping(value = "updatepwd")
  246. @ResponseBody
  247. public String updatepwd(String oldpwd, String newpwd) {
  248. try {
  249. Patient patient = patientInfoService.findByCode(getUID());
  250. if (patient == null) {
  251. return error(-1, "修改失败!");
  252. } else {
  253. String encodePWD = EncodesUtil.entryptPassword(Encodes.decodeHex(patient.getSalt()), oldpwd);
  254. if (StringUtils.equals(patient.getPassword(), encodePWD)) {
  255. patient.setPassword(newpwd);
  256. patientInfoService.updatePatientPwd(patient);
  257. return success("修改成功!");
  258. } else {
  259. return error(-1, "修改失败:旧密码错误!");
  260. }
  261. }
  262. } catch (Exception e) {
  263. error(e);
  264. return invalidUserException(e, -1, "修改失败!");
  265. }
  266. }
  267. /**
  268. * 退出登录
  269. *
  270. * @return
  271. */
  272. @RequestMapping(value = "loginout")
  273. @ResponseBody
  274. public String loginout() {
  275. try {
  276. tokenService.delToken(1, getUID());
  277. return success("已成功退出!");
  278. } catch (Exception e) {
  279. error(e);
  280. return invalidUserException(e, -1, "操作失败!");
  281. }
  282. }
  283. /**
  284. * 微信用户退出登录
  285. *
  286. * @return
  287. */
  288. @RequestMapping(value = "wxloginout")
  289. @ResponseBody
  290. public String wxloginout() {
  291. try {
  292. Patient patient = patientInfoService.findByCode(getUID());
  293. if (patient == null) {
  294. return error(-1, "退出失败,用户不存在");
  295. } else {
  296. patient.setOpenid("");
  297. patientInfoService.updateUser(patient);
  298. }
  299. return success("已成功退出!");
  300. } catch (Exception e) {
  301. error(e);
  302. return invalidUserException(e, -1, "操作失败!");
  303. }
  304. }
  305. /**
  306. * 登录患者获取三师信息
  307. *
  308. * @return
  309. */
  310. @RequestMapping(value = "teachers")
  311. @ResponseBody
  312. public String teachers() {
  313. try {
  314. String code = getUID();//getUID();
  315. // 查询签约信息
  316. SignFamily signContract = familyContractService.findBySanshiPatient(code);
  317. if (signContract == null) {
  318. return error(1, "无三师签约信息");
  319. }
  320. JSONObject doctorJson = new JSONObject();
  321. // 设置签约日期
  322. doctorJson.put("qyrq", DateUtil.dateToStr(signContract.getBegin(), DateUtil.YYYY_MM_DD));
  323. // 查询三师医生信息
  324. List<Doctor> doctors = doctorTeamService.findSanshiTeamDoctors(code);
  325. JSONArray jsonArray = new JSONArray();
  326. if (doctors != null) {
  327. for (Doctor doctor : doctors) {
  328. if (doctor == null) {
  329. continue;
  330. }
  331. JSONObject json = new JSONObject();
  332. json.put("code", doctor.getCode());
  333. json.put("name", doctor.getName());
  334. json.put("photo", CommonUtil.getPhoneUrl(doctor.getPhoto()));
  335. json.put("hospitalName", doctor.getHosptialName());
  336. json.put("deptName", doctor.getDeptName());
  337. json.put("jobName", doctor.getJobName());
  338. json.put("expertise", doctor.getExpertise());
  339. int type = doctor.getLevel();
  340. if (type == 1) {
  341. json.put("typename", "专科医生");
  342. } else if (type == 2) {
  343. json.put("typename", "全科医生");
  344. } else if (type == 3) {
  345. json.put("typename", "健康管理师");
  346. } else {
  347. json.put("typename", "");
  348. }
  349. json.put("type", type);
  350. jsonArray.put(json);
  351. }
  352. }
  353. doctorJson.put("list", jsonArray);
  354. return write(200, "查询成功!", "data", doctorJson);
  355. } catch (Exception e) {
  356. error(e);
  357. return invalidUserException(e, -1, "查询失败!");
  358. }
  359. }
  360. /**
  361. * 医生基本信息查询接口
  362. *
  363. * @param doctor 医生标识
  364. * @return
  365. */
  366. @RequestMapping(value = "docInfo")
  367. @ResponseBody
  368. public String doctorInfo(String doctor) {
  369. try {
  370. Doctor temp = doctorService.findDoctorByCode(doctor);
  371. if (temp != null) {
  372. JSONObject json = new JSONObject();
  373. // 设置医生标识
  374. json.put("code", temp.getCode());
  375. // 设置医生姓名
  376. json.put("name", temp.getName());
  377. // 设置医生头像
  378. json.put("photo", CommonUtil.getPhoneUrl(temp.getPhoto()));
  379. // 设置医生性别
  380. json.put("sex", temp.getSex());
  381. // 设置省名称
  382. json.put("provinceName", temp.getProvinceName());
  383. // 设置城市名称
  384. json.put("cityName", temp.getCityName());
  385. // 设置医院名称
  386. json.put("hospitalName", temp.getHosptialName());
  387. // 设置部门名称
  388. json.put("deptName", temp.getDeptName());
  389. // 设置职称
  390. json.put("jobName", temp.getJobName());
  391. // 设置医生专长
  392. json.put("expertise", temp.getExpertise());
  393. // 设置医生简介
  394. json.put("introduce", temp.getIntroduce());
  395. // 二维码地址
  396. json.put("qrcode", temp.getQrcode());
  397. return write(200, "医生信息查询成功!", "data", json);
  398. } else {
  399. return error(-1, "医生信息查询失败!");
  400. }
  401. } catch (Exception e) {
  402. error(e);
  403. return invalidUserException(e, -1, "医生信息查询失败!");
  404. }
  405. }
  406. /**
  407. * 查询患者签约状态
  408. *
  409. * @return
  410. */
  411. @RequestMapping(value = "sign_status")
  412. @ResponseBody
  413. public String signStaus() {
  414. try {
  415. JSONArray teamDoctors = new JSONArray();
  416. JSONArray familyDoctors = new JSONArray();
  417. String id = getUID();
  418. //查询家庭签约
  419. SignFamily jt = familyContractService.findByPatientYes(id);
  420. if (jt != null) {
  421. List<Doctor> doctors = doctorTeamService.findJiatingTeamDoctors(id);
  422. if (doctors != null) {
  423. for (Doctor doctor : doctors) {
  424. if (doctor == null) {
  425. continue;
  426. }
  427. familyDoctors.put(doctor.getName());
  428. }
  429. }
  430. }
  431. // 查询三师医生
  432. SignFamily ss = familyContractService.findBySanshiPatientYes(id);
  433. if (ss != null) {
  434. List<Doctor> doctors = doctorTeamService.findSanshiTeamDoctors(id);
  435. if (doctors != null) {
  436. for (Doctor doctor : doctors) {
  437. if (doctor == null) {
  438. continue;
  439. }
  440. teamDoctors.put(doctor.getName());
  441. }
  442. }
  443. }
  444. // 未签约
  445. int sign = 0;
  446. if (ss != null && jt != null) {
  447. // 三师+家庭
  448. sign = 3;
  449. } else if (jt != null) {
  450. // 家庭签约
  451. sign = 2;
  452. } else if (ss != null) {
  453. // 三师签约
  454. sign = 1;
  455. }
  456. JSONObject json = new JSONObject();
  457. json.put("status", 200);
  458. json.put("msg", "获取签约状态成功!");
  459. json.put("data", sign);
  460. json.put("teamDoctors", teamDoctors);
  461. json.put("familyDoctors", familyDoctors);
  462. return json.toString();
  463. } catch (Exception e) {
  464. error(e);
  465. return error(-1, "签约状态查询失败!");
  466. }
  467. }
  468. /**
  469. * 查询患者签约状态
  470. *
  471. * @return
  472. */
  473. @RequestMapping(value = "sign_doctors")
  474. @ResponseBody
  475. public String signDoctors() {
  476. try {
  477. JSONArray teamDoctors = new JSONArray();
  478. JSONArray familyDoctors = new JSONArray();
  479. String id = getUID();
  480. //查询家庭签约
  481. SignFamily jt = familyContractService.findByPatientYes(id);
  482. if (jt != null) {
  483. List<Doctor> doctors = doctorTeamService.findJiatingTeamDoctors(id);
  484. if (doctors != null) {
  485. for (Doctor doctor : doctors) {
  486. if (doctor == null) {
  487. continue;
  488. }
  489. JSONObject doctorJson = new JSONObject();
  490. doctorJson.put("code", doctor.getCode());
  491. doctorJson.put("name", doctor.getName());
  492. doctorJson.put("level", doctor.getLevel());
  493. familyDoctors.put(doctorJson);
  494. }
  495. }
  496. }
  497. // 查询三师医生
  498. SignFamily ss = familyContractService.findBySanshiPatientYes(id);
  499. if (ss != null) {
  500. List<Doctor> doctors = doctorTeamService.findSanshiTeamDoctors(id);
  501. if (doctors != null) {
  502. for (Doctor doctor : doctors) {
  503. if (doctor == null) {
  504. continue;
  505. }
  506. JSONObject doctorJson = new JSONObject();
  507. doctorJson.put("code", doctor.getCode());
  508. doctorJson.put("name", doctor.getName());
  509. doctorJson.put("level", doctor.getLevel());
  510. teamDoctors.put(doctorJson);
  511. }
  512. }
  513. }
  514. // 未签约
  515. int sign = 0;
  516. if (ss != null && jt != null) {
  517. // 三师+家庭
  518. sign = 3;
  519. } else if (jt != null) {
  520. // 家庭签约
  521. sign = 2;
  522. } else if (ss != null) {
  523. // 三师签约
  524. sign = 1;
  525. }
  526. JSONObject json = new JSONObject();
  527. json.put("status", 200);
  528. json.put("msg", "获取签约状态成功!");
  529. json.put("data", sign);
  530. json.put("teamDoctors", teamDoctors);
  531. json.put("familyDoctors", familyDoctors);
  532. return json.toString();
  533. } catch (Exception e) {
  534. error(e);
  535. return error(-1, "签约状态查询失败!");
  536. }
  537. }
  538. /**
  539. * 查询患者是否有签约信息
  540. *
  541. * @return
  542. */
  543. @RequestMapping(value = "is_sign")
  544. @ResponseBody
  545. public String isSign() {
  546. try {
  547. JSONObject jsonObject = new JSONObject();
  548. //判断是否有三师签约
  549. SignFamily ss = familyContractService.findBySanshiPatient(getUID()); // -1 未签约 0 待签约 1 已签约 2待解约
  550. if (ss != null) {
  551. return write(200, "获取签约状态成功!", "data", ss.getStatus());
  552. }
  553. //判断是否有家庭签约
  554. SignFamily sf = familyContractService.findByFamilySignPatient(getUID());
  555. if (sf != null) {
  556. return write(200, "获取签约状态成功!", "data", sf.getStatus());
  557. }
  558. return write(200, "获取签约状态成功!", "data", -1);
  559. } catch (Exception e) {
  560. error(e);
  561. return error(-1, "签约状态查询失败!");
  562. }
  563. }
  564. /**
  565. * 查询患者身份证号
  566. *
  567. * @return
  568. */
  569. @RequestMapping(value = "idc")
  570. @ResponseBody
  571. public String idcard() {
  572. try {
  573. Patient temp = patientInfoService.findByCode(getUID());
  574. return write(200, "患者信息查询成功!", "data", temp.getIdcard());
  575. } catch (Exception e) {
  576. error(e);
  577. return invalidUserException(e, -1, "患者信息查询失败!");
  578. }
  579. }
  580. /**
  581. * 根據邀請紀錄查詢邀請人信息
  582. *
  583. * @return
  584. */
  585. @RequestMapping(value = "getPatientByInviLogCode")
  586. @ResponseBody
  587. public String getPatientByInviLogCode(String invilogCode) {
  588. try {
  589. Patient temp = patientInfoService.invilogCode(invilogCode);
  590. if (temp != null) {
  591. JSONObject json = new JSONObject();
  592. json.put("code", temp.getCode()); // 设置患者标识
  593. json.put("name", temp.getName());// 设置患者姓名
  594. json.put("photo", CommonUtil.getPhoneUrl(temp.getPhoto()));// 设置患者头像
  595. json.put("birthday", DateUtil.dateToStrShort(temp.getBirthday()));// 设置患者年龄
  596. json.put("sex", temp.getSex());// 设置患者性别
  597. // json.put("mobile", CommonUtil.getMobileEncode(temp.getMobile()));
  598. json.put("mobile", temp.getMobile());// 设置手机号码
  599. json.put("idcard", CommonUtil.getIdcardEncode(temp.getIdcard()));// 设置身份证号
  600. json.put("ssc", temp.getSsc());// 设置社保卡号
  601. json.put("province", temp.getProvince());// 设置省
  602. json.put("city", temp.getCity());// 设置市
  603. json.put("area", temp.getTown()); // 设置区县
  604. json.put("provinceName", temp.getProvinceName());// 设置省名称
  605. json.put("cityName", temp.getCityName());// 设置市名称
  606. json.put("areaName", temp.getTownName());// 设置区县名称
  607. json.put("street", temp.getStreet()); // 设置街道
  608. json.put("streetName", temp.getStreetName());// 设置街道名称
  609. json.put("address", temp.getAddress());// 设置地址
  610. return write(200, "患者信息查询成功!", "data", json);
  611. } else {
  612. return error(-1, "患者信息查询失败!");
  613. }
  614. } catch (Exception e) {
  615. error(e);
  616. return invalidUserException(e, -1, "患者信息查询失败!");
  617. }
  618. }
  619. }