| | |
| | | package com.ruoyi.web.component; |
| | | |
| | | import afu.org.checkerframework.checker.oigj.qual.O; |
| | | import com.alibaba.fastjson2.JSONObject; |
| | | import com.fasterxml.jackson.databind.ObjectMapper; |
| | | import com.google.gson.Gson; |
| | | import com.ruoyi.common.core.redis.RedisCache; |
| | | import com.ruoyi.common.enums.MsgLSEnum; |
| | | import com.ruoyi.common.enums.ServiceFromEnum; |
| | | import com.ruoyi.common.enums.WxGZHEnum; |
| | | import com.ruoyi.common.exception.base.BaseException; |
| | | import com.ruoyi.common.utils.HttpUtil; |
| | | import com.ruoyi.common.utils.RSAPublicKeyExample; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | |
| | | import com.smartor.service.IBaseSmsaccountService; |
| | | import com.smartor.service.IServiceOutPathService; |
| | | import com.smartor.service.IServiceSubtaskRecordService; |
| | | import com.sun.org.apache.bcel.internal.generic.NEW; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.collections4.CollectionUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | import java.util.concurrent.Executors; |
| | | import java.util.concurrent.TimeUnit; |
| | | |
| | | import static cn.hutool.core.convert.Convert.numberToWord; |
| | | import static cn.hutool.core.convert.Convert.toHex; |
| | | |
| | | @Slf4j |
| | |
| | | |
| | | @Value("${xhsmsPath}") |
| | | private String xhsmsPath; |
| | | |
| | | @Value("${visitHosp}") |
| | | private Integer visitHosp; |
| | | |
| | | // å建åºå®å¤§å°ççº¿ç¨æ± |
| | | private static final ExecutorService executorService = Executors.newFixedThreadPool(10); |
| | |
| | | sendMagParam.setContent("ãæ°åå»é¢ãæ¨å¥½ï¼é请æ¨å¡«ååºé¢å®£æè°æ¥è¡¨ï¼è¯·ç¹å»" + sendMagParam.getUrl() + "æ¥çãæè°¢æ¨é
åï¼"); |
| | | } |
| | | //çä¿¡è¿éè¦æ¨¡æ¿ |
| | | Map<String, String> req = new HashMap<>(); |
| | | req.put("phone", sendMagParam.getPhone()); |
| | | req.put("content", sendMagParam.getContent()); |
| | | String s = HttpUtil.postJsonRequest(xhsmsPath, new Gson().toJson(req)); |
| | | String s = null; |
| | | if (visitHosp == 1) { |
| | | //æ°åççä¿¡åéæ¹å¼ |
| | | Map<String, String> req = new HashMap<>(); |
| | | req.put("phone", sendMagParam.getPhone()); |
| | | req.put("content", sendMagParam.getContent()); |
| | | s = HttpUtil.postJsonRequest(xhsmsPath, new Gson().toJson(req)); |
| | | } else if (visitHosp == 2) { |
| | | //丽水ççä¿¡åéæ¹å¼ |
| | | String address = MsgLSEnum.getAddressByCode(serviceSubtask.getOrgid()); |
| | | if (StringUtils.isEmpty(address)) { |
| | | ServiceSubtask ss = new ServiceSubtask(); |
| | | ss.setResult("error"); |
| | | ss.setRemark("çä¿¡åé失败,è¯¥æºææ²¡æé
ç½®çä¿¡å°å"); |
| | | ss.setSendstate(5L); |
| | | ss.setId(serviceSubtask.getId()); |
| | | ss.setFinishtime(new Date()); |
| | | serviceSubtaskMapper.updateServiceSubtask(ss); |
| | | continue; |
| | | } |
| | | String dxCode = getDXCode(address, sendMagParam.getPhone(), sendMagParam.getContent(), "", "", MsgLSEnum.getHeaderByCode(serviceSubtask.getOrgid())); |
| | | log.error("---------丽水çä¿¡åéç»æï¼{}-------", dxCode); |
| | | ObjectMapper objectMapper = new ObjectMapper(); |
| | | Map<String, Object> textParam = objectMapper.readValue(dxCode, Map.class); |
| | | String code = textParam.get("code").toString(); |
| | | if (code.equals("0")) { |
| | | s = "true"; |
| | | } else { |
| | | throw new BaseException(null); |
| | | } |
| | | } |
| | | if (s.equals("true")) { |
| | | ServiceSubtaskRecord serviceSubtaskRecord = new ServiceSubtaskRecord(); |
| | | serviceSubtaskRecord.setTaskid(serviceSubtask.getTaskid().toString()); |
| | |
| | | } |
| | | |
| | | |
| | | String wxCode = getWXCode(serviceSubtask.getSfzh(), url, serviceSubtask.getTaskName(), serviceSubtask.getTaskDesc(), patArchive.getTelcode(), patArchive.getName(), patArchive.getPatidHis(),wxqqxx); |
| | | String wxCode = getWXCode(serviceSubtask.getSfzh(), url, serviceSubtask.getTaskName(), serviceSubtask.getTaskDesc(), patArchive.getTelcode(), patArchive.getName(), patArchive.getPatidHis(), wxqqxx); |
| | | Map<String, Object> map = JSONObject.parseObject(wxCode, Map.class); |
| | | if (!map.isEmpty()) { |
| | | serviceSubtask.setResult("success"); |
| | |
| | | return key; |
| | | } |
| | | |
| | | private String getWXCode(String idcard, String url, String taskName, String taskDesc, String phone, String patientname, String setPatientid,List<String> wxqqxx) { |
| | | private String getWXCode(String idcard, String url, String taskName, String taskDesc, String phone, String patientname, String setPatientid, List<String> wxqqxx) { |
| | | XinHuaWXReq xinHuaWXReq = new XinHuaWXReq(); |
| | | xinHuaWXReq.setIdcard(idcard); |
| | | xinHuaWXReq.setUrl(url); |
| | |
| | | return code; |
| | | } |
| | | |
| | | |
| | | private String getDXCode(String address, String ShouJiHM, String FaSongNR, String FaSongRID, String FaSongRXM, Map<String, Object> headerMap) { |
| | | Map<String, Object> map = new LinkedHashMap<>(); |
| | | |
| | | Map<String, Object> YeWuXX = new LinkedHashMap<>(); |
| | | Map<String, Object> DuanXinXX = new LinkedHashMap<>(); |
| | | DuanXinXX.put("ShouJiHM", ShouJiHM); |
| | | DuanXinXX.put("FaSongNR", FaSongNR); |
| | | DuanXinXX.put("FaSongRID", FaSongRID); |
| | | DuanXinXX.put("FaSongRXM", FaSongRXM); |
| | | YeWuXX.put("DuanXinXX", DuanXinXX); |
| | | |
| | | map.put("XiaoXiTou", headerMap); |
| | | map.put("DuanXinXX", DuanXinXX); |
| | | |
| | | String body = new Gson().toJson(map); |
| | | |
| | | String result = HttpUtils.sendPost(address, body); |
| | | log.error("--------resultçå¼ä¸ºï¼{}-----", result); |
| | | |
| | | JSONObject jsonObject = JSONObject.parseObject(result); |
| | | String code = (String) jsonObject.toString(); |
| | | return code; |
| | | } |
| | | |
| | | |
| | | public String encode(String arg) { |
| | | if (arg == null) { |
| | | arg = ""; |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.common.enums; |
| | | |
| | | import com.ruoyi.common.utils.uuid.IdUtils; |
| | | import com.sun.org.apache.bcel.internal.generic.NEW; |
| | | |
| | | import javax.xml.crypto.Data; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.LinkedHashMap; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 丽水çä¿¡æä¸¾ |
| | | * XiaoXiLX FZ_PT_DuanXinFS |
| | | * XiaoXiMC çä¿¡åé |
| | | */ |
| | | public enum MsgLSEnum { |
| | | ZYY("47231022633110211A2101", "https://9.0.124.104:13011/mediinfo-grus-fuwuzxwg/api/esb/lyraAsyncRun", "1400360867068907520", "丽水å¸ä¸å»é¢"), JN("47255004333112711A1001", null, "1400361376454545408", "æ¯å®ç²æèªæ²»å¿äººæ°å»é¢"); |
| | | |
| | | private String orgid; |
| | | private String address; |
| | | private String ZuHuID; |
| | | private String ZuHuMC; |
| | | |
| | | MsgLSEnum(String orgid, String address, String ZuHuID, String ZuHuMC) { |
| | | this.orgid = orgid; |
| | | this.ZuHuID = ZuHuID; |
| | | this.ZuHuMC = ZuHuMC; |
| | | this.address = address; |
| | | } |
| | | |
| | | public static Map<String, Object> getHeaderByCode(String orgid) { |
| | | Map<String, Object> map = new LinkedHashMap<>(); |
| | | MsgLSEnum[] organEnums = values(); |
| | | for (int i = 0; i < organEnums.length; i++) { |
| | | MsgLSEnum organEnum = organEnums[i]; |
| | | if (organEnum.getOrgid().equals(orgid)) { |
| | | map.put("XiaoXiID", IdUtils.simpleUUID()); |
| | | map.put("FaSongSJ", new Date()); |
| | | map.put("ZuHuID", organEnum.getZuHuID()); |
| | | map.put("ZuHuMC", organEnum.getZuHuMC()); |
| | | map.put("FaSongJGID", organEnum.getOrgid()); |
| | | map.put("FaSongJGMC", organEnum.getZuHuMC()); |
| | | map.put("FaSongXTJC", "é访系ç»"); |
| | | map.put("FaSongXTMC", "é访系ç»"); |
| | | map.put("FaSongFCSJC", "äº¥å°æ¶"); |
| | | map.put("XiaoXiLX", "FZ_PT_DuanXinFS"); |
| | | map.put("XiaoXiMC", "çä¿¡åé"); |
| | | } |
| | | } |
| | | return map; |
| | | } |
| | | |
| | | public static String getAddressByCode(String orgid) { |
| | | MsgLSEnum[] organEnums = values(); |
| | | for (int i = 0; i < organEnums.length; i++) { |
| | | MsgLSEnum organEnum = organEnums[i]; |
| | | if (organEnum.getOrgid().equals(orgid)) { |
| | | return organEnum.getAddress(); |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | public String getOrgid() { |
| | | return orgid; |
| | | } |
| | | |
| | | public void setOrgid(String orgid) { |
| | | this.orgid = orgid; |
| | | } |
| | | |
| | | public String getAddress() { |
| | | return address; |
| | | } |
| | | |
| | | public void setAddress(String address) { |
| | | this.address = address; |
| | | } |
| | | |
| | | public String getZuHuID() { |
| | | return ZuHuID; |
| | | } |
| | | |
| | | public void setZuHuID(String zuHuID) { |
| | | ZuHuID = zuHuID; |
| | | } |
| | | |
| | | public String getZuHuMC() { |
| | | return ZuHuMC; |
| | | } |
| | | |
| | | public void setZuHuMC(String zuHuMC) { |
| | | ZuHuMC = zuHuMC; |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | * 丽水å
¬ä¼å· |
| | | */ |
| | | public enum WxGZHEnum { |
| | | ZYY("47231022633110211A2101", "3311000002", "MzMxMTAwMDAwMg==", "http://192.168.10.170:18001/frontend/medical/api"), |
| | | ZYY("47231022633110211A2101", "3311000002", "MzMxMTAwMDAwMg==", "http://40.78.1.5:8101/frontend/medical/api"), |
| | | JN("47255004333112711A1001", null, null, null); |
| | | |
| | | |
| | |
| | | import com.google.gson.JsonArray; |
| | | import com.google.gson.JsonObject; |
| | | import com.ruoyi.common.core.redis.RedisCache; |
| | | import com.ruoyi.common.enums.MsgLSEnum; |
| | | import com.ruoyi.common.enums.ServiceFromEnum; |
| | | import com.ruoyi.common.enums.WxGZHEnum; |
| | | import com.ruoyi.common.exception.base.BaseException; |
| | | import com.ruoyi.common.utils.HttpUtil; |
| | | import com.ruoyi.common.utils.RSAPublicKeyExample; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | |
| | | sendMagParam.setPhone(serviceSubtask.getPhone()); |
| | | sendMagParam.setUrl(ip + ":" + req_path + "/wt?p=" + format); |
| | | sendMagParam.setContent("ãæ°åå»é¢ãæ¨å¥½ï¼é请æ¨å¡«ååºé¢è°æ¥è¡¨ï¼è¯·ç¹å»" + sendMagParam.getUrl() + "å¡«åãæè°¢æ¨é
åï¼"); |
| | | Map<String, String> req = new HashMap<>(); |
| | | req.put("phone", sendMagParam.getPhone()); |
| | | req.put("content", sendMagParam.getContent()); |
| | | String isSuccess = HttpUtil.postJsonRequest(xhsmsPath, new Gson().toJson(req)); |
| | | String isSuccess = null; |
| | | if (visitHosp == 1) { |
| | | Map<String, String> req = new HashMap<>(); |
| | | req.put("phone", sendMagParam.getPhone()); |
| | | req.put("content", sendMagParam.getContent()); |
| | | isSuccess = HttpUtil.postJsonRequest(xhsmsPath, new Gson().toJson(req)); |
| | | } else if (visitHosp == 2) { |
| | | //丽水ççä¿¡åéæ¹å¼ |
| | | String address = MsgLSEnum.getAddressByCode(serviceSubtask.getOrgid()); |
| | | if (StringUtils.isEmpty(address)) { |
| | | ServiceSubtask ss = new ServiceSubtask(); |
| | | ss.setResult("error"); |
| | | ss.setRemark("çä¿¡åé失败,è¯¥æºææ²¡æé
ç½®çä¿¡å°å"); |
| | | ss.setSendstate(5L); |
| | | ss.setId(serviceSubtask.getId()); |
| | | ss.setFinishtime(new Date()); |
| | | serviceSubtaskMapper.updateServiceSubtask(ss); |
| | | continue; |
| | | } |
| | | String dxCode = getDXCode(address, sendMagParam.getPhone(), sendMagParam.getContent(), "", "", MsgLSEnum.getHeaderByCode(serviceSubtask.getOrgid())); |
| | | log.error("---------丽水çä¿¡åéç»æï¼{}-------", dxCode); |
| | | ObjectMapper objectMapper = new ObjectMapper(); |
| | | Map<String, Object> textParam = objectMapper.readValue(dxCode, Map.class); |
| | | String code = textParam.get("code").toString(); |
| | | if (code.equals("0")) { |
| | | isSuccess = "true"; |
| | | } |
| | | } |
| | | //ä»»å¡åéè®°å½ |
| | | ServiceSubtaskRecord serviceSubtaskRecord = new ServiceSubtaskRecord(); |
| | | serviceSubtaskRecord.setTaskid(serviceSubtask.getTaskid().toString()); |
| | |
| | | return key; |
| | | } |
| | | |
| | | private String getDXCode(String address, String ShouJiHM, String FaSongNR, String FaSongRID, String FaSongRXM, Map<String, Object> headerMap) { |
| | | Map<String, Object> map = new LinkedHashMap<>(); |
| | | |
| | | Map<String, Object> YeWuXX = new LinkedHashMap<>(); |
| | | Map<String, Object> DuanXinXX = new LinkedHashMap<>(); |
| | | DuanXinXX.put("ShouJiHM", ShouJiHM); |
| | | DuanXinXX.put("FaSongNR", FaSongNR); |
| | | DuanXinXX.put("FaSongRID", FaSongRID); |
| | | DuanXinXX.put("FaSongRXM", FaSongRXM); |
| | | YeWuXX.put("DuanXinXX", DuanXinXX); |
| | | |
| | | map.put("XiaoXiTou", headerMap); |
| | | map.put("DuanXinXX", DuanXinXX); |
| | | |
| | | String body = new Gson().toJson(map); |
| | | |
| | | String result = HttpUtils.sendPost(address, body); |
| | | log.error("--------resultçå¼ä¸ºï¼{}-----", result); |
| | | |
| | | JSONObject jsonObject = JSONObject.parseObject(result); |
| | | String code = (String) jsonObject.toString(); |
| | | return code; |
| | | } |
| | | |
| | | |
| | | private String getWXCode(String idcard, String url, String taskName, String taskDesc, String phone, String setPatientname, String setPatientid, List<String> wxqqxx) { |
| | | XinHuaWXReq xinHuaWXReq = new XinHuaWXReq(); |
| | | xinHuaWXReq.setIdcard(idcard); |
| | |
| | | private String guid; |
| | | |
| | | /** |
| | | * GUID |
| | | */ |
| | | @ApiModelProperty("åºé¢è¯æ") |
| | | private String leavediagname; |
| | | |
| | | @ApiModelProperty("åºé¢è¯æICDå¼") |
| | | private String leaveicd10code; |
| | | |
| | | /** |
| | | * å§å |
| | | */ |
| | | @ApiModelProperty("æ£è
ç¼å·") |
| | |
| | | /** |
| | | * ç¾ç
åç§° |
| | | */ |
| | | @ApiModelProperty("离é¢ç¾ç
åç§°") |
| | | @Excel(name = " 离é¢ç¾ç
åç§° ") |
| | | private String leavediagname; |
| | | |
| | | @ApiModelProperty("ç¾ç
åç§°") |
| | | @Excel(name = " ç¾ç
åç§° ") |
| | | private String diagname; |
| | | |
| | | |
| | |
| | | private String telcode; |
| | | |
| | | /** |
| | | * ææºå·ç |
| | | * 离é¢ç¾ç
ç¼ç |
| | | */ |
| | | @ApiModelProperty("ææºå·ç ") |
| | | @Excel(name = " ææºå·ç ") |
| | | @ApiModelProperty("离é¢ç¾ç
ç¼ç ") |
| | | @Excel(name = " 离é¢ç¾ç
ç¼ç ") |
| | | private String leaveicd10code; |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Excel(name = "ç¾ç
åç§°") |
| | | @ApiModelProperty("ç¾ç
åç§°") |
| | | private String icdName; |
| | | private String leavediagname; |
| | | |
| | | /** |
| | | * ç¾ç
åç§° |
| | | */ |
| | | @Excel(name = "ç¾ç
åç§°") |
| | | @ApiModelProperty("ç¾ç
åç§°") |
| | | private String leaveicd10code; |
| | | |
| | | /** |
| | | * ææºå· |
| | |
| | | } |
| | | //å°æ¥åºçtagï¼æ¾å°patArchive1éçTagListä¸ |
| | | PatArchivetag patArchivetag = new PatArchivetag(); |
| | | patArchivetag.setTagname(list.get(i).getTag()); |
| | | patArchivetag.setTagid(list.get(i).getTagid()); |
| | | stringList.add(patArchivetag); |
| | | if (StringUtils.isNotEmpty(list.get(i).getTag()) && ObjectUtils.isNotEmpty(list.get(i).getTagid())) { |
| | | patArchivetag.setTagname(list.get(i).getTag()); |
| | | patArchivetag.setTagid(list.get(i).getTagid()); |
| | | stringList.add(patArchivetag); |
| | | } |
| | | } |
| | | patArchive1.setTagList(stringList.stream().collect(Collectors.toList())); |
| | | patArchives.add(patArchive1); |
| | |
| | | serviceSubtask.setDrname(patMedInhosp1.getDrname()); |
| | | serviceSubtask.setDeptcode(patMedInhosp1.getLeaveldeptcode()); |
| | | serviceSubtask.setDeptname(patMedInhosp1.getLeaveldeptname()); |
| | | serviceSubtask.setLeaveicd10code(patMedInhosp1.getLeaveicd10code()); |
| | | serviceSubtask.setLeavediagname(patMedInhosp1.getDiagname()); |
| | | serviceSubtask.setTemplateid(serviceTask.getTemplateid()); |
| | | serviceSubtask.setTemplatename(serviceTask.getTemplatename()); |
| | | serviceSubtask.setPatid(patArchive.getId()); |
| | |
| | | serviceSubtask.setPatid(patArchive.getId()); |
| | | serviceSubtask.setSendname(patArchive.getName()); |
| | | serviceSubtask.setSfzh(patArchive.getIdcardno()); |
| | | serviceSubtask.setLeavediagname(patMedOuthosp.getDiagname()); |
| | | serviceSubtask.setLeaveicd10code(patMedOuthosp.getIcd10code()); |
| | | serviceSubtask.setSfzh(patArchive.getIdcardno()); |
| | | serviceSubtask.setPhone(patArchive.getTelcode()); |
| | | if (StringUtils.isBlank(patArchive.getTelcode())) serviceSubtask.setPhone(patArchive.getRelativetelcode()); |
| | | serviceSubtask.setSex(patArchive.getSex()); |
| | |
| | | serviceSubtask1.setIsVisitAgain(2); |
| | | serviceSubtaskMapper.updateServiceSubtask(serviceSubtask1); |
| | | return "æ é忬¡éè®¿ï¼æ£è
被æ è®°ä¸éè¦è¢«æå¡"; |
| | | } else if (ObjectUtils.isNotEmpty(serviceSubtask1.getIsVisitAgain()) && serviceSubtask1.getIsVisitAgain() == 2) { |
| | | return "æ é忬¡é访ï¼è¯¥ä»»å¡å·²ç»å次é访è¿äº"; |
| | | } |
| | | //æ°å¢å次éè®¿ä»»å¡ |
| | | ServiceSubtask serviceSubtask2 = DtoConversionUtils.sourceToTarget(serviceSubtask, ServiceSubtask.class); |
| | | serviceSubtask2.setId(null); |
| | | serviceSubtask2.setVisitCount(serviceSubtask1.getVisitCount() + 1); |
| | | serviceSubtask2.setSendstate(2L); |
| | | serviceSubtask2.setCreateTime(new Date()); |
| | | serviceSubtask2.setUpdateTime(new Date()); |
| | | int i = serviceSubtaskMapper.insertServiceSubtask(serviceSubtask2); |
| | | if (i == 1) { |
| | | //æ°å¢æååï¼éè¦å°ä¹åçä»»å¡è®¾ç½®ä¸ºä¸è¦åé访ï¼é²æ¢éå¤ç¹ï¼ç¶åéå¤çæï¼ |
| | |
| | | serviceSubtask.setDrname(patTaskRelevance.getDrname()); |
| | | serviceSubtask.setDrcode(patTaskRelevance.getDrcode()); |
| | | serviceSubtask.setInhosptime(patTaskRelevance.getInhosptime()); |
| | | serviceSubtask.setLeaveicd10code(patTaskRelevance.getLeaveicd10code()); |
| | | serviceSubtask.setLeavediagname(patTaskRelevance.getLeavediagname()); |
| | | serviceSubtask.setEndtime(patTaskRelevance.getEndtime()); |
| | | serviceSubtask.setNurseId(patTaskRelevance.getNurseId()); |
| | | serviceSubtask.setNurseName(patTaskRelevance.getNurseName()); |
| | |
| | | <result property="leavehospitaldistrictname" column="leavehospitaldistrictname"/> |
| | | <result property="leavehospitaldistrictcode" column="leavehospitaldistrictcode"/> |
| | | <result property="guid" column="guid"/> |
| | | <result property="leavediagname" column="leavediagname"/> |
| | | <result property="leaveicd10code" column="leaveicd10code"/> |
| | | </resultMap> |
| | | |
| | | <sql id="selectPatArchiveVo"> |
| | |
| | | FROM |
| | | pat_med_inhosp d |
| | | JOIN pat_archive a ON a.id = d.patid |
| | | LEFT JOIN ( SELECT patid, GROUP_CONCAT( tagname ) AS tagname FROM pat_archivetag where del_flag=0 GROUP BY patid ) t ON t.patid = |
| | | LEFT JOIN ( SELECT patid, GROUP_CONCAT( tagname ) AS tagname FROM pat_archivetag where del_flag=0 GROUP BY patid |
| | | ) t ON t.patid = |
| | | d.patid |
| | | <where> |
| | | d.del_flag != 1 |
| | |
| | | t.tagname, |
| | | a.pattype |
| | | from pat_med_outhosp d JOIN pat_archive a ON a.id = d.patid |
| | | LEFT JOIN ( SELECT patid, GROUP_CONCAT( tagname ) AS tagname FROM pat_archivetag where del_flag=0 GROUP BY patid ) t ON t.patid = |
| | | LEFT JOIN ( SELECT patid, GROUP_CONCAT( tagname ) AS tagname FROM pat_archivetag where del_flag=0 GROUP BY patid |
| | | ) t ON t.patid = |
| | | d.patid |
| | | <where> |
| | | d.del_flag != 1 |
| | |
| | | t.tagname, |
| | | a.pattype |
| | | from pat_med_physical d JOIN pat_archive a ON a.id = d.patid |
| | | LEFT JOIN ( SELECT patid, GROUP_CONCAT( tagname ) AS tagname FROM pat_archivetag where del_flag=0 GROUP BY patid ) t ON t.patid = |
| | | LEFT JOIN ( SELECT patid, GROUP_CONCAT( tagname ) AS tagname FROM pat_archivetag where del_flag=0 GROUP BY patid |
| | | ) t ON t.patid = |
| | | d.patid |
| | | <where> |
| | | d.del_flag != 1 |
| | |
| | | d.deptcode, |
| | | d.drcode, |
| | | d.drname, |
| | | d.leavediagname, |
| | | d.leaveicd10code, |
| | | a.sex, |
| | | a.nation, |
| | | a.native_place, |
| | |
| | | FROM |
| | | pat_med_inhosp d |
| | | JOIN pat_archive a ON a.id = d.patid |
| | | LEFT JOIN ( SELECT patid, GROUP_CONCAT( tagname ) AS tagname FROM pat_archivetag where del_flag=0 GROUP BY patid ) t ON t.patid = |
| | | LEFT JOIN ( SELECT patid, GROUP_CONCAT( tagname ) AS tagname FROM pat_archivetag where del_flag=0 GROUP BY patid |
| | | ) t ON t.patid = |
| | | d.patid |
| | | <where> |
| | | d.del_flag != 1 |
| | |
| | | <if test="deptname != null and deptname != ''"> |
| | | and d.deptname LIKE concat('%', #{deptname}, '%') |
| | | </if> |
| | | <if test="drname != null and drname != ''"> |
| | | AND d.drname LIKE concat('%',#{drname}, '%') |
| | | </if> |
| | | <if test="diagname != null and diagname != ''"> |
| | | AND d.diagname LIKE concat('%',#{diagname}, '%') |
| | | <if test="leavediagname != null and leavediagname != ''"> |
| | | AND d.leavediagname LIKE concat('%',#{leavediagname}, '%') |
| | | </if> |
| | | <if test="leavehospitaldistrictcodes != null and leavehospitaldistrictcodes.size()>0"> |
| | | AND d.leavehospitaldistrictcode IN |
| | |
| | | a.place_of_residence, |
| | | a.birthplace, |
| | | a.birthdate, |
| | | a.icd10code as leaveicd10code, |
| | | a.diagname as leavediagname, |
| | | a.age, |
| | | a.age2, |
| | | a.viptype, |
| | |
| | | t.tagname, |
| | | a.pattype |
| | | from pat_med_outhosp d JOIN pat_archive a ON a.id = d.patid |
| | | LEFT JOIN ( SELECT patid, GROUP_CONCAT( tagname ) AS tagname FROM pat_archivetag where del_flag=0 GROUP BY patid ) t ON t.patid = |
| | | LEFT JOIN ( SELECT patid, GROUP_CONCAT( tagname ) AS tagname FROM pat_archivetag where del_flag=0 GROUP BY patid |
| | | ) t ON t.patid = |
| | | d.patid |
| | | <where> |
| | | d.del_flag != 1 |
| | |
| | | </if> |
| | | <if test="notrequiredFlag != null and notrequiredFlag != ''">and a.notrequired_flag = #{notrequiredFlag} |
| | | </if> |
| | | <if test="diagname != null and diagname != ''"> |
| | | AND d.diagname LIKE concat('%',#{diagname}, '%') |
| | | <if test="leavediagname != null and leavediagname != ''"> |
| | | AND d.diagname LIKE concat('%',#{leavediagname}, '%') |
| | | </if> |
| | | <if test="hospitalname != null and hospitalname != ''"> |
| | | AND d.hospitalname = #{hospitalname} |
| | |
| | | t.tagname, |
| | | a.pattype |
| | | from pat_med_physical d JOIN pat_archive a ON a.id = d.patid |
| | | LEFT JOIN ( SELECT patid, GROUP_CONCAT( tagname ) AS tagname FROM pat_archivetag where del_flag=0 GROUP BY patid ) t ON t.patid = |
| | | LEFT JOIN ( SELECT patid, GROUP_CONCAT( tagname ) AS tagname FROM pat_archivetag where del_flag=0 GROUP BY patid |
| | | ) t ON t.patid = |
| | | d.patid |
| | | <where> |
| | | d.del_flag != 1 |