From 6ac675b3608076ff77a7cebba94a1da161c60128 Mon Sep 17 00:00:00 2001 From: zhaowenxuan <chacca165@163.com> Date: 星期一, 30 十二月 2024 18:30:42 +0800 Subject: [PATCH] 20241230 --- src/main/java/com/example/controller/LisController.java | 39 +++++ src/main/java/com/example/service/shanxiqin/xian/MeiJiHisService.java | 4 src/main/java/com/example/factory/ServiceFactory.java | 6 src/main/java/com/example/service/shanxiqin/xian/MeiJiLisService.java | 56 ++++++++ src/main/java/com/example/utils/Test.java | 25 +++ src/main/java/com/example/constant/ApiParamsConstantsLis.java | 246 +++++++++++++++++++++++++++++++++++ src/main/java/com/example/utils/HttpClientUtils.java | 1 src/main/java/com/example/service/LisService.java | 21 +++ 8 files changed, 397 insertions(+), 1 deletions(-) diff --git a/src/main/java/com/example/constant/ApiParamsConstantsLis.java b/src/main/java/com/example/constant/ApiParamsConstantsLis.java new file mode 100644 index 0000000..900b233 --- /dev/null +++ b/src/main/java/com/example/constant/ApiParamsConstantsLis.java @@ -0,0 +1,246 @@ +package com.example.constant; + +/** + * @Company: 瑗垮畨璺嘲绉戞妧鏈夐檺鍏徃 + * @Author: zhaowenxuan + * @Date: 2024/12/25 16:10 + */ +public class ApiParamsConstantsLis { + + /** + * 闂ㄨ瘖鍙风爜 + */ + public static final String PATIENTNO = "patientno"; + + /** + * 鎸傚彿鍙风爜 + */ + public static final String GH_PATIENTNO = "gh_patientno"; + + /** + * 鏍囨湰鏉″舰鐮� + */ + public static final String TXM = "txm"; + + /** + * 杈呭姪鍙风爜 + */ + public static final String PRINTNO = "printno"; + + /** + * 鐥呬汉濮撳悕 + */ + public static final String PATIENTNAME = "patientname"; + + /** + * 鍑虹敓鏃ユ湡 + */ + public static final String BIRTHDAY = "birthday"; + + /** + * 韬唤璇佸彿 + */ + public static final String SFZH = "sfzh"; + + /** + * 1鐢�2濂�0鏈煡 蹇呴』鎻愪緵 + * 鎬у埆 + */ + public static final String GENDER = "gender"; + + /** + * 鍦板潃 + */ + public static final String ADDRESS = "address"; + + /** + * 鐢佃瘽 + */ + public static final String TELEPHONE = "telephone"; + + /** + * 鍖讳繚鍗″彿 + */ + public static final String YBKH = "ybkh"; + + /** + * 浣撴鍗曚綅 + */ + public static final String TJDW = "tjdw"; + + /** + * 榛樿1 蹇呴』鎻愪緵 + * 鏄惁鍚敤 + */ + public static final String ISACTIVE = "isactive"; + + /** + * 澶囨敞 + */ + public static final String MEMO = "memo"; + + /** + * 涓村簥璇婃柇 + */ + public static final String DIAGNOSE = "diagnose"; + + /** + * 閫佹鍖荤敓浠g爜 + */ + public static final String SENDDOCTOR = "senddoctor"; + + /** + * 閫佹鍖荤敓濮撳悕 + */ + public static final String SENDDOCTORNAME = "senddoctorname"; + + /** + * 閫佹绉戝浠g爜 + */ + public static final String SENDDEPARTCODE = "senddepartcode"; + + /** + * 閫佹绉戝鍚嶇О + */ + public static final String SENDDEPARTNAME = "senddepartname"; + + /** + * 寮�鍗曠瀹や唬鐮� + */ + public static final String APPLYDEPARTCODE = "applydepartcode"; + + /** + * 寮�鍗曠瀹ゅ悕绉� + */ + public static final String APPLYDEPARTNAME = "applydepartname"; + + /** + * 寮�鍗曞尰鐢熶唬鐮� + */ + public static final String APPLYDOCTORCODE = "applydoctorcode"; + + /** + * 寮�鍗曞尰鐢熷悕绉� + */ + public static final String APPLYDOCTORNAME = "applydoctorname"; + + /** + * 寮�鍗曟椂闂� + */ + public static final String APPLYDATETIME = "applydatetime"; + + /** + * 閲囨牱鏃堕棿 + */ + public static final String GATHERDATETIME = "gatherdatetime"; + + /** + * 閲囨牱鍖荤敓缂栫爜 + */ + public static final String GATHERDOCTORCODE = "gatherdoctorcode"; + + /** + * 閲囨牱鍖荤敓濮撳悕 + */ + public static final String GATHERDOCTORNAME = "gatherdoctorname"; + + /** + * 搴婂彿 + */ + public static final String BEDNO = "bedno"; + + /** + * 蹇呴』鎻愪緵[yyyy-mm-dd hh:mi:ss] + * 閫佹鏃ユ湡鍜屽紑鍗曟椂闂� + */ + public static final String SENDDATE = "senddate"; + + /** + * 蹇呴』鎻愪緵 + * 渚嬪: SFXMID : 1001 + * 閭d箞: (璇婄枟椤圭洰)閲岄潰鐨凷FXMID涔熻鏈�: 1001 + * 蹇呴』璺�(璇婄枟椤圭洰)閲岄潰鐨凷FXMID涓�鑷� + * 璇婄枟椤圭洰浠g爜 + */ + public static final String SFXMID = "sfxmid"; + + /** + * 蹇呴』鎻愪緵 + * 渚嬪: SFXMNAME : 鑲濆姛鑳�6椤� + * 閭d箞: (璇婄枟椤圭洰)閲岄潰鐨凷FXMNAME涔熻鏈�: 鑲濆姛鑳�6椤� + * 蹇呴』璺�(璇婄枟椤圭洰)閲岄潰鐨凷FXMNAME鍚嶇О涓�鑷� + * 璇婄枟椤圭洰鍚嶇О + */ + public static final String SFXMNAME = "sfxmname"; + + /** + * 璇婄枟椤圭洰鍗曚环 + */ + public static final String SFXMPRICE = "sfxmprice"; + + /** + * 鏀惰垂浜哄憳濮撳悕 + */ + public static final String SFYNAME = "sfyname"; + + /** + * 寮�鍗曟棩鏈�, 蹇呴』鎻愪緵 + * 鏀惰垂鏃ユ湡 + */ + public static final String SFDATE = "sfdate"; + + /** + * 蹇呴』鎻愪緵,鏈烘瀯ID,闇�鍜孡IS宸ョ▼甯堟矡閫� + * 鍖婚櫌缂栧彿 + */ + public static final String HOSPITALID = "hospitalid"; + + /** + * 鏁伴噺 + */ + public static final String QUALITY = "quality"; + + /** + * 鍗$被鍨� + */ + public static final String CARDTYPE = "cardtype"; + + /** + * 灏辫瘖绫诲埆 1锛氶棬璇� 2锛氫綇闄� 3锛氫綋妫� + */ + public static final String PATIENTTYPE = "patienttype"; + + /** + * 涓婚敭 + * 鍖诲槺淇℃伅锛屼繚璇佸�煎敮涓�鎬� + * 鐢ㄤ簬HIS浜や簰绱㈠紩 + * *姣忔潯鎸囨爣涓嶉噸澶嶇殑鍞竴鍊硷紝 + * 渚嬪锛� + * 鐢叉煇鍋氫簡 + * 琛�甯歌 瀵瑰簲鐨凨eyvalue鏄� 1111 + * 澶х敓鍖� 瀵瑰簲鐨凨eyvalue鏄� 2222 + * 灏垮父瑙� 瀵瑰簲鐨凨eyvalue鏄� 3333 + * + * 涓佹煇鍋氫簡 + * 琛�甯歌 瀵瑰簲鐨凨eyvalue鏄� 4444 + * 澶х敓鍖� 瀵瑰簲鐨凨eyvalue鏄� 5555 + * 灏垮父瑙� 瀵瑰簲鐨凨eyvalue鏄� 6666 + */ + public static final String KEYVALUE = "keyvalue"; + + /** + * 蹇呴』鎻愪緵0:涓嶆槸鎬ヨ瘖 1:鏄�ヨ瘖 榛樿锛�0 + * 鎬ヨ瘖鏍囧織 + */ + public static final String JIZHENBZ = "jizhenbz"; + + /** + * 椤圭洰绫诲瀷缂栧彿 + */ + public static final String SpecimenCode = "specimencode"; + + /** + * 椤圭洰绫诲瀷鍚嶇О + */ + public static final String SpecimenDesc = "specimendesc"; +} diff --git a/src/main/java/com/example/controller/LisController.java b/src/main/java/com/example/controller/LisController.java new file mode 100644 index 0000000..a43ead5 --- /dev/null +++ b/src/main/java/com/example/controller/LisController.java @@ -0,0 +1,39 @@ +package com.example.controller; + +import com.example.factory.ServiceFactory; +import com.example.service.LisService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.Map; + +/** + * @Company: 瑗垮畨璺嘲绉戞妧鏈夐檺鍏徃 + * @Author: zhaowenxuan + * @Date: 2024/12/25 10:13 + */ +@RestController +@RequestMapping("/api/his") +public class LisController { + + private final ServiceFactory serviceFactory; + + @Autowired + public LisController(ServiceFactory serviceFactory) { + this.serviceFactory = serviceFactory; + } + + /** + * 鐢熸垚鐢宠鍗� + * @param hospName + * @param map + * @return + */ + @PostMapping("/{hospName}/create") + public String makeSqd(@PathVariable("hospName") String hospName, @RequestBody Map<String ,Object > map){ + LisService lisService = serviceFactory.getLisService(hospName); + return lisService.makeSqd(map); + } + + +} diff --git a/src/main/java/com/example/factory/ServiceFactory.java b/src/main/java/com/example/factory/ServiceFactory.java index 5f8eac4..022bba0 100644 --- a/src/main/java/com/example/factory/ServiceFactory.java +++ b/src/main/java/com/example/factory/ServiceFactory.java @@ -2,6 +2,7 @@ import com.example.config.ConfigValue; import com.example.service.HisService; +import com.example.service.LisService; import com.example.service.PacsService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.ApplicationContext; @@ -31,6 +32,11 @@ return (PacsService) applicationContext.getBean(beanName+"Pacs"); } + public LisService getLisService(String hospName) { + String beanName = getServiceBeanName(hospName); + return (LisService) applicationContext.getBean(beanName+"Lis"); + } + private String getServiceBeanName(String hospName) { switch (hospName) { diff --git a/src/main/java/com/example/service/LisService.java b/src/main/java/com/example/service/LisService.java new file mode 100644 index 0000000..3264333 --- /dev/null +++ b/src/main/java/com/example/service/LisService.java @@ -0,0 +1,21 @@ +package com.example.service; + +import org.springframework.stereotype.Service; + +import java.util.Map; + +/** + * @Company: 瑗垮畨璺嘲绉戞妧鏈夐檺鍏徃 + * @Author: zhaowenxuan + * @Date: 2024/12/25 10:15 + */ +@Service +public interface LisService { + + /** + * 鍒涘缓鐢宠鍗� + * @param map + * @return + */ + String makeSqd(Map<String, Object> map); +} diff --git a/src/main/java/com/example/service/shanxiqin/xian/MeiJiHisService.java b/src/main/java/com/example/service/shanxiqin/xian/MeiJiHisService.java index d9a75eb..d9300f4 100644 --- a/src/main/java/com/example/service/shanxiqin/xian/MeiJiHisService.java +++ b/src/main/java/com/example/service/shanxiqin/xian/MeiJiHisService.java @@ -145,7 +145,9 @@ return JSONUtil.toJsonStr(object); } JSONObject entries = JSONUtil.parseObj(string); - if (entries.get("returnData") != null) { + log.info("鑾峰彇鐥呬汉淇℃伅杩斿洖鏁版嵁 ->{}", entries); + Object returnData = entries.get("returnData"); + if (null != returnData && !returnData.toString().equals("null")) { HashMap<String, String> hashMap = new HashMap<>(); JSONObject data = entries.getJSONObject("returnData"); hashMap.put(ApiParamsConstants.CARD_ID,data.getStr("jiuZhenKh")); diff --git a/src/main/java/com/example/service/shanxiqin/xian/MeiJiLisService.java b/src/main/java/com/example/service/shanxiqin/xian/MeiJiLisService.java new file mode 100644 index 0000000..45ce298 --- /dev/null +++ b/src/main/java/com/example/service/shanxiqin/xian/MeiJiLisService.java @@ -0,0 +1,56 @@ +package com.example.service.shanxiqin.xian; + +import com.example.constant.ApiParamsConstants; +import com.example.constant.ApiParamsConstantsLis; +import com.example.service.LisService; +import org.springframework.stereotype.Service; + +import java.util.HashMap; +import java.util.Map; + +/** + * @Company: 瑗垮畨璺嘲绉戞妧鏈夐檺鍏徃 + * @Author: zhaowenxuan + * @Date: 2024/12/25 10:14 + */ +@Service("ShanXiQinXiAnMeiJiLis") +public class MeiJiLisService implements LisService { + @Override + public String makeSqd(Map<String, Object> map) { + HashMap<String, Object> hashMap = new HashMap<>(); + // 闂ㄨ瘖鍙风爜 + hashMap.put("PATIENTNO", map.get(ApiParamsConstantsLis.PATIENTNO)); + // 鎸傚彿鍙风爜 + hashMap.put("GH_PATIENTNO", map.get(ApiParamsConstantsLis.GH_PATIENTNO)); + // 鏍囨湰鏉″舰鐮� + hashMap.put("TXM", map.get(ApiParamsConstantsLis.TXM)); + // 杈呭姪鍙风爜 + hashMap.put("PRINTNO",map.get(ApiParamsConstantsLis.PRINTNO)); + // 鐥呬汉濮撳悕 + hashMap.put("PATIENTNAME",map.get(ApiParamsConstants.CUS_NAME)); + // 鍑虹敓鏃ユ湡 + hashMap.put("BIRTHDAY",map.get(ApiParamsConstants.CUS_BRITHDAY)); + // 韬唤璇佸彿 + hashMap.put("SFZH",map.get(ApiParamsConstants.CUS_ID_CARD)); + // 鎬у埆 + long cusSex = Long.parseLong(map.get(ApiParamsConstants.CUS_SEX).toString()); + if(cusSex==0L){ + hashMap.put ("GENDER","1"); + }else if(cusSex==1L){ + hashMap.put ("GENDER","2"); + }else { + hashMap.put ("GENDER","0"); + } + hashMap.put("ADDRESS",map.get(ApiParamsConstants.CUS_ADDR)); + hashMap.put("TELEPHONE",map.get(ApiParamsConstants.CUS_PHONE)); + hashMap.put("YBKH",""); + hashMap.put("TJDW",map.get(ApiParamsConstants.COMP_NAME)); + + + + + + + return ""; + } +} diff --git a/src/main/java/com/example/utils/HttpClientUtils.java b/src/main/java/com/example/utils/HttpClientUtils.java index 509a9e5..e18e472 100644 --- a/src/main/java/com/example/utils/HttpClientUtils.java +++ b/src/main/java/com/example/utils/HttpClientUtils.java @@ -205,6 +205,7 @@ .append("=") .append(URLEncoder.encode(entry.getValue().toString(), "UTF-8")); } + log.info("鍙傛暟鎷兼帴 ->{}",postData); writer = new OutputStreamWriter(connection.getOutputStream()); writer.write(postData.toString()); writer.flush(); diff --git a/src/main/java/com/example/utils/Test.java b/src/main/java/com/example/utils/Test.java new file mode 100644 index 0000000..f67245b --- /dev/null +++ b/src/main/java/com/example/utils/Test.java @@ -0,0 +1,25 @@ +package com.example.utils; + +import cn.hutool.json.JSONObject; +import cn.hutool.json.JSONUtil; +import org.apache.ibatis.javassist.compiler.ast.Variable; + +/** + * @Company: 瑗垮畨璺嘲绉戞妧鏈夐檺鍏徃 + * @Author: zhaowenxuan + * @Date: 2024/12/30 14:32 + */ +public class Test { + public static void main(String[] args) { + String json = "{\"businessStackTraces\":null,\"exceptionContent\":null,\"exceptionPosition\":null,\"returnCode\":1,\"returnData\":null,\"returnMessage\":\"璇锋眰鎴愬姛\"}"; + JSONObject entries = JSONUtil.parseObj(json); + Object returnData = entries.get("returnData"); + System.out.println("1 ->"+returnData); + if (null != returnData && !returnData.toString().equals("null")) { + System.out.println("1 = " + 1); + }else { + System.out.println("2 = " + 2); + + } + } +} -- Gitblit v1.8.0