瀏覽代碼

73医院及第三医院第三方对接

wangzhinan 1 年之前
父節點
當前提交
0fa2ca752d
共有 17 個文件被更改,包括 1137 次插入219 次删除
  1. 33 0
      business/base-service/src/main/java/com/yihu/jw/hospital/family/service/WlyyFamilyMemberService.java
  2. 20 0
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/dao/OutpatientHospitalizationDao.java
  3. 273 0
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/DsyyPrescriptionService.java
  4. 31 3
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/PrescriptionService.java
  5. 184 190
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/entrance/DsyyEntranceService.java
  6. 7 7
      business/base-service/src/main/java/com/yihu/jw/internet/service/InternetCommonService.java
  7. 1 1
      business/base-service/src/main/java/com/yihu/jw/utils/HttpClientUtil.java
  8. 16 0
      business/base-service/src/main/java/com/yihu/jw/utils/dsyyUtil/Service.java
  9. 142 0
      business/base-service/src/main/java/com/yihu/jw/utils/dsyyUtil/ServiceLocator.java
  10. 12 0
      business/base-service/src/main/java/com/yihu/jw/utils/dsyyUtil/ServiceSoap.java
  11. 125 0
      business/base-service/src/main/java/com/yihu/jw/utils/dsyyUtil/ServiceSoapStub.java
  12. 178 0
      common/common-entity/src/main/java/com/yihu/jw/entity/hospital/prescription/WlyyOutpatientHospitalizationDO.java
  13. 1 1
      common/common-util/src/main/java/com/yihu/jw/util/http/HttpClientUtil.java
  14. 23 12
      svr/svr-internet-hospital-entrance/src/main/java/com/yihu/jw/entrance/controller/DsyyController.java
  15. 1 1
      svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/web/quota/JobController.java
  16. 46 4
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/hospital/WlyyFamilyMemberController.java
  17. 44 0
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/prescription/PrescriptionEndpoint.java

+ 33 - 0
business/base-service/src/main/java/com/yihu/jw/hospital/family/service/WlyyFamilyMemberService.java

@ -14,6 +14,7 @@ import com.yihu.jw.hospital.family.dao.WlyyNatPatientFamilyMemberDao;
import com.yihu.jw.hospital.family.dao.BasePatientMemberDictDao;
import com.yihu.jw.hospital.family.dao.WlyyPatientFamilyMemberDao;
import com.yihu.jw.hospital.mapping.dao.PatientMappingDao;
import com.yihu.jw.hospital.prescription.service.DsyyPrescriptionService;
import com.yihu.jw.hospital.prescription.service.entrance.EntranceService;
import com.yihu.jw.hospital.prescription.service.entrance.TnyyEntranceService;
import com.yihu.jw.hospital.prescription.service.entrance.XzzxEntranceService;
@ -72,6 +73,8 @@ public class WlyyFamilyMemberService extends BaseJpaService<WlyyPatientFamilyMem
    private BaseJobCategoryDao baseJobCategoryDao;
    @Autowired
    private WlyyNatPatientFamilyMemberDao natPatientFamilyMemberDao;
    @Autowired
    private DsyyPrescriptionService dsyyPrescriptionService;
    //添加关联家属
    @Transactional
@ -262,6 +265,36 @@ public class WlyyFamilyMemberService extends BaseJpaService<WlyyPatientFamilyMem
                mixEnvelop.setMessage("您所添加的家属无就诊记录,无法添加");
            }
            }
        }else if ("xm_dsyy_wx".equalsIgnoreCase(wxId)) {
            JSONObject object = dsyyPrescriptionService.queryCardListToHospital("",idCard);
            if (object!=null){
                if (object.getString("retCode").equalsIgnoreCase("00")){
                    com.alibaba.fastjson.JSONArray array = object.getJSONArray("cardlist");
                    if(array!=null&&array.size()>0){
                        JSONObject jsonObject= array.getJSONObject(0);
                        String Pat_name = jsonObject.getString("userName");
                        String Next_Of_Kin_Phone = jsonObject.getString("phone");
                        if(!Next_Of_Kin_Phone.equalsIgnoreCase(phoneNum)){
                            mixEnvelop.setStatus(408);
                            mixEnvelop.setMessage("您所添加的家属的电话有误,无法发送验证码");
                            return mixEnvelop;
                        }
                        if(!Pat_name.equalsIgnoreCase(familyName)){
                            mixEnvelop.setStatus(408);
                            mixEnvelop.setMessage("您所添加的家属的名称有误,无法发送验证码");
                            return mixEnvelop;
                        }
                        basePatientDO.setMobile(Next_Of_Kin_Phone);
                        basePatientDO.setPhone(Next_Of_Kin_Phone);
                        basePatientDO.setName(Pat_name);
                        basePatientDO.setBirthday(IdCardUtil.getBirthdayForIdcard(idCard));
                        basePatientDO.setAge(IdCardUtil.getAgeForIdcard(idCard));
                    }/*else {
                        String age =
                        JSONObject object1 = dsyyPrescriptionService.buildAccountToHospital(familyName,familyName,idCard,)
                    }*/
                }
            }
        }else if ("xm_xzzx_wx".equalsIgnoreCase(wxId)) {
            com.alibaba.fastjson.JSONArray jsonArray1 = xzzxEntranceService.selectPateintCardByIdCard(idCard);
            if (null!=jsonArray1&&jsonArray1.size()>0){

+ 20 - 0
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/dao/OutpatientHospitalizationDao.java

@ -0,0 +1,20 @@
package com.yihu.jw.hospital.prescription.dao;
import com.yihu.jw.entity.hospital.prescription.WlyyOutpatientDO;
import com.yihu.jw.entity.hospital.prescription.WlyyOutpatientHospitalizationDO;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import java.util.List;
/**
 * Created by Trick on 2019/6/3.
 */
public interface OutpatientHospitalizationDao extends JpaRepository<WlyyOutpatientHospitalizationDO, String>, JpaSpecificationExecutor<WlyyOutpatientHospitalizationDO> {
    @Query("from WlyyOutpatientHospitalizationDO a where a.outpatientId = ?1 ")
    WlyyOutpatientHospitalizationDO findByOutpatientId(String outpatientId);
}

+ 273 - 0
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/DsyyPrescriptionService.java

@ -26,6 +26,7 @@ import com.yihu.jw.restmodel.hospital.prescription.WlyyPrescriptionInfoVO;
import com.yihu.jw.restmodel.hospital.prescription.WlyyPrescriptionVO;
import com.yihu.jw.util.common.IdCardUtil;
import com.yihu.jw.util.date.DateUtil;
import com.yihu.jw.util.http.HttpClientUtil;
import com.yihu.jw.util.network.HttpResponse;
import com.yihu.jw.util.network.HttpUtils;
import org.apache.commons.collections.map.HashedMap;
@ -76,6 +77,8 @@ public class DsyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
    //请求内网服务
    public static String entranceUrl = "http://192.168.101.2:10024/dsyy/";
    @Autowired
    private HttpClientUtil httpClientUtil;
    //=============查询视图========================
    /**
@ -537,6 +540,276 @@ public class DsyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
    }
    /**
     * 查询待扣费处方信息 ---调内网服务
     *
     * @param cardNo 患者卡号
     * @param cardType 卡类型
     * @param xtgzh0 HIS系统跟踪号(唯一)
     * @param operatorId 操作员ID
     * @param operatorName 操作员姓名
     * @param termNo 终端编号
     * @return
     * @throws Exception
     */
    public JSONObject getSettlementToHospital(String cardNo,String cardType,String xtgzh0,String operatorId,String operatorName,String termNo) throws Exception {
        String url = entranceUrl +"getSettlement";
        JSONObject object = new JSONObject();
        Map<String,Object> params = new HashedMap();
        params.put("cardNo",cardNo);
        params.put("cardType",cardType);
        params.put("xtgzh0",xtgzh0);
        params.put("operatorId",operatorId);
        params.put("operatorName",operatorName);
        params.put("termNo",termNo);
        HttpResponse response = HttpUtils.doPost(url,params);
        String content = response.getContent();
        logger.info("response:"+content);
        JSONObject rs = JSON.parseObject(content);
        Integer status = rs.getInteger("status");
        if (status==200){
            object = rs.getJSONObject("obj");
        }
        return object;
    }
    /**
     * 结算结果确认
     *
     * @param cardNo 患者卡号
     * @param depositAmount 充值金额 如果是医保卡病人,对应个人支付额
     * @param xtgzh0 HIS系统跟踪号(唯一)
     * @param operatorId 操作员ID
     * @param operatorName 操作员姓名
     * @param termNo 终端编号
     * @return
     * @throws Exception
     */
    public JSONObject confirmPayGjybToHospital(String cardNo,String xtgzh0,String depositAmount,String outChargeNo,
                                              String operatorId,String operatorName,String termNo) throws Exception {
        String url = entranceUrl +"confirmPayGjyb";
        JSONObject object = new JSONObject();
        Map<String,Object> params = new HashedMap();
        params.put("cardNo",cardNo);
        params.put("depositAmount",depositAmount);
        params.put("xtgzh0",xtgzh0);
        params.put("operatorId",operatorId);
        params.put("operatorName",operatorName);
        params.put("termNo",termNo);
        params.put("outChargeNo",outChargeNo);
        HttpResponse response = HttpUtils.doPost(url,params);
        String content = response.getContent();
        logger.info("response:"+content);
        JSONObject rs = JSON.parseObject(content);
        Integer status = rs.getInteger("status");
        if (status==200){
            object = rs.getJSONObject("obj");
        }
        return object;
    }
    /**
     * 查询院内卡列表
     *
     * @param userName 姓名
     * @param idNo 身份证
     * @return
     * @throws Exception
     */
    public JSONObject queryCardListToHospital(String userName,String idNo) throws Exception {
        String url = entranceUrl +"queryCardList";
        JSONObject object = new JSONObject();
        Map<String,Object> params = new HashedMap();
        params.put("userName",userName);
        params.put("idNo",idNo);
        HttpResponse response = HttpUtils.doPost(url,params);
        String content = response.getContent();
        logger.info("response:"+content);
        JSONObject rs = JSON.parseObject(content);
        Integer status = rs.getInteger("status");
        if (status==200){
            object = rs.getJSONObject("obj");
        }
        return object;
    }
    /**
     * 账户建档接口
     * @param operatorName 操作者姓名
     * @param userName 姓名
     * @param idNo 身份证
     * @param gend 性别 1男 2女
     * @param phone 手机号
     * @return
     * @throws Exception
     */
    public JSONObject buildAccountToHospital(String operatorName,String userName,String idNo,String gend,String phone,String cardNo) throws Exception {
        String url = entranceUrl +"buildAccount";
        JSONObject object = new JSONObject();
        Map<String,Object> params = new HashedMap();
        params.put("operatorName",operatorName);
        params.put("userName",userName);
        params.put("idNo",idNo);
        params.put("gend",gend);
        params.put("phone",phone);
        params.put("cardNo",cardNo);
        HttpResponse response = HttpUtils.doPost(url,params);
        String content = response.getContent();
        logger.info("response:"+content);
        JSONObject rs = JSON.parseObject(content);
        Integer status = rs.getInteger("status");
        if (status==200){
            object = rs.getJSONObject("obj");
        }
        return object;
    }
    /**
     * 3.12住院申请单保存(门诊收入住院)
     *
     *
     * @param cardNo 就诊卡号
     * @param visitDeptCode 就诊科室代码
     * @param visitDoctor 挂号医生,格式如:刘明/03212
     * @param visitNo 就诊号
     * @param inDeptCode 入院科室代码
     * @param diagnosisCode 入院诊断代码
     * @param diagnosisName 入院诊断名称
     * @param admissionType 入院方式,0-门诊 1-急诊 2-转入 5-留观
     * @param admissionCondition 入院病情,1-病危 2-专科紧急  3-一般  4-急诊 5-专科限期  6-专科普通
     * @param admissionCause 住院目的,0-治疗 1-分娩 2-身体检查 3-计划生育
     * @param trumFlag 是否外伤 0-否 1-是
     * @param relTtpFlag 外伤是否涉及第三方 0-否 1-是
     * @return
     * @throws Exception
     */
    public JSONObject SendHospitalizedCardToHospital(String cardNo ,String visitDeptCode,String visitDoctor,String visitNo,String inDeptCode,String diagnosisCode,
                                             String diagnosisName,String admissionType,String admissionCondition,String admissionCause,
                                             String trumFlag,String relTtpFlag) throws Exception {
        String url = entranceUrl +"SendHospitalizedCard";
        JSONObject object = new JSONObject();
        Map<String,Object> params = new HashedMap();
        params.put("cardNo",cardNo);
        params.put("visitDeptCode",visitDeptCode);
        params.put("visitDoctor",visitDoctor);
        params.put("visitNo",visitNo);
        params.put("inDeptCode",inDeptCode);
        params.put("diagnosisCode",diagnosisCode);
        params.put("diagnosisName",diagnosisName);
        params.put("admissionType",admissionType);
        params.put("admissionCondition",admissionCondition);
        params.put("admissionCause",admissionCause);
        params.put("trumFlag",trumFlag);
        params.put("relTtpFlag",relTtpFlag);
        HttpResponse response = HttpUtils.doPost(url,params);
        String content = response.getContent();
        logger.info("response:"+content);
        JSONObject rs = JSON.parseObject(content);
        Integer status = rs.getInteger("status");
        if (status==200){
            object = rs.getJSONObject("obj");
        }
        return object;
    }
    /**
     *  查询住院病人日清单
     *
     * @param iptNo 住院号
     * @param patientId 病人ID 可为空
     * @param beginDate 开始日期 20230801不能为空
     * @param endData 截止日期 可为空
     * @return
     * @throws Exception
     */
    public JSONObject queryDayDetailListToHospital(String iptNo,String patientId,String beginDate,String endData) throws Exception {
        BasePatientDO patientDO = patientDao.findById(patientId).get();
        String mappingCode="";
        if (patientDO!=null){
           PatientMappingDO mappingDO= patientMappingDao.findByPatient(patientDO.getId());
           mappingCode = mappingDO.getMappingCode();
        }
        String url = entranceUrl +"queryDayDetailList";
        JSONObject object = new JSONObject();
        Map<String,Object> params = new HashedMap();
 /*       params.put("operatorId",operatorId);
        params.put("operatorName",operatorName);
        params.put("termNo",termNo);
        params.put("orgCode",orgCode);*/
        params.put("iptNo",iptNo);
        params.put("patientId",mappingCode);
        params.put("beginDate",beginDate);
        params.put("endData",endData);
        HttpResponse response = HttpUtils.doPost(url,params);
        String content = response.getContent();
        logger.info("response:"+content);
        JSONObject rs = JSON.parseObject(content);
        Integer status = rs.getInteger("status");
        if (status==200){
            object = rs.getJSONObject("obj");
        }
        return object;
    }
    /**
     * 互联网医院通知院内摆药
     *
     * @param hISTradeNo 必填,挂号流水号
     * @param payCardNo 必填,就诊卡号
     * @param isExpress 必填,是否快递
     * @param expressBillNo 必填,快递单号
     * @param expressAddress 快递地址
     * @param expressPhone 快递电话
     * @param remark 注意事项
     * @return
     * @throws Exception
     */
    public JSONObject sendDispensingToHisToHospital(String hISTradeNo,String payCardNo,String isExpress,String expressBillNo,String expressAddress,String expressPhone,String remark) throws Exception {
        String url = entranceUrl +"sendDispensingToHis";
        JSONObject object = new JSONObject();
        Map<String,Object> params = new HashedMap();
        params.put("hISTradeNo",hISTradeNo);
        params.put("payCardNo",payCardNo);
        params.put("isExpress",isExpress);
        params.put("expressBillNo",expressBillNo);
        params.put("expressAddress",expressAddress);
        params.put("expressPhone",expressPhone);
        params.put("remark",remark);
        HttpResponse response = HttpUtils.doPost(url,params);
        String content = response.getContent();
        logger.info("response:"+content);
        JSONObject rs = JSON.parseObject(content);
        Integer status = rs.getInteger("status");
        if (status==200){
            object = rs.getJSONObject("obj");
        }
        return object;
    }
    /**
     * 发送短信验证码
     * @return
     * @throws Exception
     */
    public Integer SendSms(String phone,String content) throws Exception {
        int result = 0;
        String response="";
        String url = entranceUrl+"sendMessage?strPhoneNO="+phone+"&strMsgContent="+content;
        response = httpClientUtil.get(url,"utf-8");
        logger.info("返回参数:"+response);
        JSONObject object = JSONObject.parseObject(response);
        if(object.getInteger("status")==200){
            JSONObject jsonObject = object.getJSONObject("message");
            if (jsonObject.getString("action").equalsIgnoreCase("send")){
                result=0;
            }
        }
        return result;
    }
    /**
     * 数据哈希计算接口
     *

File diff suppressed because it is too large
+ 31 - 3
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/PrescriptionService.java


+ 184 - 190
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/entrance/DsyyEntranceService.java

@ -45,6 +45,7 @@ import com.yihu.jw.util.network.HttpResponse;
import com.yihu.jw.util.network.HttpUtils;
import com.yihu.jw.utils.WebserviceUtil;
import com.yihu.jw.utils.dsyyUtil.SendMessge_ServiceLocator;
import com.yihu.jw.utils.dsyyUtil.ServiceLocator;
import com.yihu.jw.utils.dsyyUtil.WritebackCvalueInterfaceLocator;
import com.yihu.jw.utils.dsyyUtil.ZoesoftHipServiceLocator;
import com.yihu.jw.utils.hibernate.HibenateUtils;
@ -146,7 +147,9 @@ public class DsyyEntranceService {
    @Autowired
    private YlzMedicailRelationDao ylzMedicailRelationDao;
    private static String key="bvvsf3JA0mUXMU+mVnMaOQ==";
    private static String key="5aKX8TLoagFbQiQFFEfRbxr5ClB3P/HG";
    private static String operate = "测试库";
    private static String caKey = "bvvsf3JA0mUXMU+mVnMaOQ==";
@ -1344,7 +1347,7 @@ public class DsyyEntranceService {
        return buffer.toString();
    }
   //=============his webservice 调用开始 =============================
    //=============his webservice 调用开始 =============================
    /**
     * 挂号(调his后台包)
@ -1362,8 +1365,9 @@ public class DsyyEntranceService {
                "<root> " +
                "   <serverName>"+api+"</serverName>  " +
                "   <format>xml</format>" +
                "   <callOperator></callOperator> " +
                "   <callOperator>"+operate+"</callOperator> " +
                "   <certificate>"+key+"</certificate> " +
                "   <orgCode>01</orgCode> " +
                "</root>";
        String condition ="";
        logger.info("clinicclass:"+clinicclass);
@ -1418,8 +1422,9 @@ public class DsyyEntranceService {
                "<root> " +
                "   <serverName>"+api+"</serverName>  " +
                "   <format>xml</format>" +
                "   <callOperator></callOperator> " +
                "   <callOperator>"+operate+"</callOperator> " +
                "   <certificate>"+key+"</certificate> " +
                "   <orgCode>01</orgCode> " +
                "</root>";
        String condition ="";
        if (!StringUtils.isEmpty(IoFlag)){
@ -1486,14 +1491,15 @@ public class DsyyEntranceService {
     * @throws Exception
     */
    public String delHisPrescriptionByHisNo(String IoFlag,String PayCardNo,String NullahNumber,
                                             String ApplyDept,String ApplyDoctor,String ExecuteDept,String PresNo)throws Exception{
                                            String ApplyDept,String ApplyDoctor,String ExecuteDept,String PresNo)throws Exception{
        String api = "delHisPrescriptionByHisNo";
        String msgHeader ="<?xml version=\"1.0\" encoding=\"utf-8\"?> " +
                "<root> " +
                "   <serverName>"+api+"</serverName>  " +
                "   <format>xml</format>" +
                "   <callOperator></callOperator> " +
                "   <callOperator>"+operate+"</callOperator> " +
                "   <certificate>"+key+"</certificate> " +
                "   <orgCode>01</orgCode> " +
                "</root>";
        String condition ="";
        if (!StringUtils.isEmpty(IoFlag)){
@ -1548,8 +1554,9 @@ public class DsyyEntranceService {
                "<root> " +
                "   <serverName>"+api+"</serverName>  " +
                "   <format>xml</format>" +
                "   <callOperator></callOperator> " +
                "   <callOperator>"+operate+"</callOperator> " +
                "   <certificate>"+key+"</certificate> " +
                "   <orgCode>01</orgCode> " +
                "</root>";
        String condition ="";
        if (!StringUtils.isEmpty(ApplyNo)){
@ -1593,8 +1600,9 @@ public class DsyyEntranceService {
                "<root> " +
                "   <serverName>"+api+"</serverName>  " +
                "   <format>xml</format>" +
                "   <callOperator></callOperator> " +
                "   <callOperator>"+operate+"</callOperator> " +
                "   <certificate>"+key+"</certificate> " +
                "   <orgCode>01</orgCode> " +
                "</root>";
        String condition ="";
        if (!StringUtils.isEmpty(ApplyNo)){
@ -1631,8 +1639,9 @@ public class DsyyEntranceService {
                "<root> " +
                "   <serverName>"+api+"</serverName>  " +
                "   <format>xml</format>" +
                "   <callOperator></callOperator> " +
                "   <callOperator>"+operate+"</callOperator> " +
                "   <certificate>"+key+"</certificate> " +
                "   <orgCode>01</orgCode> " +
                "</root>";
        String condition ="";
        condition = "<IoFlag>"+IoFlag+"</IoFlag>";
@ -1697,8 +1706,9 @@ public class DsyyEntranceService {
                "<root> " +
                "   <serverName>"+api+"</serverName>  " +
                "   <format>xml</format>" +
                "   <callOperator></callOperator> " +
                "   <callOperator>"+operate+"</callOperator> " +
                "   <certificate>"+key+"</certificate> " +
                "   <orgCode>01</orgCode> " +
                "</root>";
        String condition ="";
        JSONObject object = new JSONObject();
@ -1721,17 +1731,14 @@ public class DsyyEntranceService {
            object.put("termNo",termNo);
        }
        condition = object.toJSONString();
        String msgBody ="<?xml version=\"1.0\" encoding=\"utf-8\"?>" +
                "<root>"+condition+"</root>";
        String msgBody =condition;
        Map<String,String> params = new HashedMap();
        params.put("msgHeader",msgHeader);
        params.put("msgBody",msgBody);
        logger.info("getSettlement params:"+params.toString());
        String xml = getDsyyWebServiceInfo("CallInterface",params,getOperateUrl());
        XMLSerializer xmlSerializer = new XMLSerializer();
        String json = xmlSerializer.read(xml).toString();
        logger.info(" getSettlement json:"+json);
        return json;
        logger.info(" getSettlement json:"+xml);
        return xml;
    }
@ -1749,14 +1756,15 @@ public class DsyyEntranceService {
     * @throws Exception
     */
    public String confirmPayGjyb(String cardNo,String xtgzh0,String depositAmount,String outChargeNo,
                                String operatorId,String operatorName,String termNo) throws  Exception{
                                 String operatorId,String operatorName,String termNo) throws  Exception{
        String api = "confirm_pay_gjyb";
        String msgHeader ="<?xml version=\"1.0\" encoding=\"utf-8\"?> " +
                "<root> " +
                "   <serverName>"+api+"</serverName>  " +
                "   <format>xml</format>" +
                "   <callOperator></callOperator> " +
                "   <callOperator>"+operate+"</callOperator> " +
                "   <certificate>"+key+"</certificate> " +
                "   <orgCode>01</orgCode> " +
                "</root>";
        String condition ="";
        JSONObject object = new JSONObject();
@ -1782,17 +1790,14 @@ public class DsyyEntranceService {
            object.put("outChargeNo",outChargeNo);
        }
        condition = object.toJSONString();
        String msgBody ="<?xml version=\"1.0\" encoding=\"utf-8\"?>" +
                "<root>"+condition+"</root>";
        String msgBody =condition;
        Map<String,String> params = new HashedMap();
        params.put("msgHeader",msgHeader);
        params.put("msgBody",msgBody);
        logger.info("confirm_pay_gjyb params:"+params.toString());
        String xml = getDsyyWebServiceInfo("CallInterface",params,getOperateUrl());
        XMLSerializer xmlSerializer = new XMLSerializer();
        String json = xmlSerializer.read(xml).toString();
        logger.info(" confirm_pay_gjyb json:"+json);
        return json;
        logger.info(" confirm_pay_gjyb json:"+xml);
        return xml;
    }
@ -1811,8 +1816,9 @@ public class DsyyEntranceService {
                "<root> " +
                "   <serverName>"+api+"</serverName>  " +
                "   <format>xml</format>" +
                "   <callOperator></callOperator> " +
                "   <callOperator>"+operate+"</callOperator> " +
                "   <certificate>"+key+"</certificate> " +
                "   <orgCode>01</orgCode> " +
                "</root>";
        String condition ="";
        JSONObject object = new JSONObject();
@ -1823,82 +1829,66 @@ public class DsyyEntranceService {
            object.put("idNo",idNo);
        }
        condition = object.toJSONString();
        String msgBody ="<?xml version=\"1.0\" encoding=\"utf-8\"?>" +
                "<root>"+condition+"</root>";
        String msgBody =condition;
        Map<String,String> params = new HashedMap();
        params.put("msgHeader",msgHeader);
        params.put("msgBody",msgBody);
        logger.info("op_query_card_list params:"+params.toString());
        String xml = getDsyyWebServiceInfo("CallInterface",params,getOperateUrl());
        XMLSerializer xmlSerializer = new XMLSerializer();
        String json = xmlSerializer.read(xml).toString();
        logger.info(" op_query_card_list json:"+json);
        return json;
        logger.info(" op_query_card_list json:"+xml);
        return xml;
    }
    /**
     * 账户建档接口
     * @param operatorId 操作者id
     * @param operatorName 操作者姓名
     * @param termNo 终端
     * @param userName 姓名
     * @param idNo 身份证
     * @param idType 证件类型 默认01
     * @param gend 性别 1男 2女
     * @param phone 手机号
     * @param brdy 出生日期 yyyy-mm-dd
     * @return
     * @throws Exception
     */
    public String buildAccount(String operatorId,String operatorName,String termNo,String userName,String idNo,String idType,
                               String gend,String phone,String brdy) throws  Exception{
    public String buildAccount(String userName,String idNo,String gend,String phone,String cardNo) throws  Exception{
        String api = "build_account";
        String msgHeader ="<?xml version=\"1.0\" encoding=\"utf-8\"?> " +
                "<root> " +
                "   <serverName>"+api+"</serverName>  " +
                "   <format>xml</format>" +
                "   <callOperator></callOperator> " +
                "   <callOperator>"+operate+"</callOperator> " +
                "   <certificate>"+key+"</certificate> " +
                "   <orgCode>01</orgCode> " +
                "</root>";
        String condition ="";
        JSONObject object = new JSONObject();
        if (StringUtils.isNoneBlank(operatorId)){
            object.put("operatorId",operatorId);
        }
        if (StringUtils.isNoneBlank(operatorName)){
            object.put("operatorName",operatorName);
        object.put("operatorId","HLWYY");
        object.put("operatorName","HLWYY");
        object.put("termNo","DSYYHLWYY");
        if (StringUtils.isNoneBlank(idNo)){
            object.put("idNo",idNo);
            object.put("brdy",IdCardUtil.getBirthdayForIdcardStr(idNo));
        }
        if (StringUtils.isNoneBlank(termNo)){
            object.put("termNo",termNo);
        if (StringUtils.isNoneBlank(cardNo)){
            object.put("cardNo",cardNo);
        }
        if (StringUtils.isNoneBlank(userName)){
            object.put("userName",userName);
        }
        if (StringUtils.isNoneBlank(idType)){
            object.put("idType",idType);
        }
        if (StringUtils.isNoneBlank(gend)){
            object.put("gend",gend);
        }
        if (StringUtils.isNoneBlank(phone)){
            object.put("phone",phone);
        }
        if (StringUtils.isNoneBlank(brdy)){
            object.put("brdy",brdy);
        }
        condition = object.toJSONString();
        String msgBody ="<?xml version=\"1.0\" encoding=\"utf-8\"?>" +
                "<root>"+condition+"</root>";
        String msgBody =condition;
        Map<String,String> params = new HashedMap();
        params.put("msgHeader",msgHeader);
        params.put("msgBody",msgBody);
        logger.info("build_account params:"+params.toString());
        String xml = getDsyyWebServiceInfo("CallInterface",params,getOperateUrl());
        XMLSerializer xmlSerializer = new XMLSerializer();
        String json = xmlSerializer.read(xml).toString();
        logger.info(" build_account json:"+json);
        return json;
        logger.info(" build_account json:"+xml);
        return xml;
    }
@ -1922,15 +1912,16 @@ public class DsyyEntranceService {
     * @throws Exception
     */
    public String SendHospitalizedCard(String cardNo ,String visitDeptCode,String visitDoctor,String visitNo,String inDeptCode,String diagnosisCode,
                               String diagnosisName,String admissionType,String admissionCondition,String admissionCause,
                               String trumFlag,String relTtpFlag) throws  Exception{
                                       String diagnosisName,String admissionType,String admissionCondition,String admissionCause,
                                       String trumFlag,String relTtpFlag) throws  Exception{
        String api = "SendHospitalizedCard";
        String msgHeader ="<?xml version=\"1.0\" encoding=\"utf-8\"?> " +
                "<root> " +
                "   <serverName>"+api+"</serverName>  " +
                "   <format>xml</format>" +
                "   <callOperator></callOperator> " +
                "   <callOperator>"+operate+"</callOperator> " +
                "   <certificate>"+key+"</certificate> " +
                "   <orgCode>01</orgCode> " +
                "</root>";
        String condition ="";
        JSONObject object = new JSONObject();
@ -1971,17 +1962,14 @@ public class DsyyEntranceService {
            object.put("relTtpFlag",relTtpFlag);
        }
        condition = object.toJSONString();
        String msgBody ="<?xml version=\"1.0\" encoding=\"utf-8\"?>" +
                "<root>"+condition+"</root>";
        String msgBody =condition;
        Map<String,String> params = new HashedMap();
        params.put("msgHeader",msgHeader);
        params.put("msgBody",msgBody);
        logger.info("SendHospitalizedCard params:"+params.toString());
        String xml = getDsyyWebServiceInfo("CallInterface",params,getOperateUrl());
        XMLSerializer xmlSerializer = new XMLSerializer();
        String json = xmlSerializer.read(xml).toString();
        logger.info(" SendHospitalizedCard json:"+json);
        return json;
        logger.info(" SendHospitalizedCard json:"+xml);
        return xml;
    }
@ -2000,14 +1988,15 @@ public class DsyyEntranceService {
     * @throws Exception
     */
    public String queryDayDetailList(String operatorId ,String operatorName,String termNo,String orgCode,String iptNo,String patientId,
                                       String beginDate,String endData) throws  Exception{
                                     String beginDate,String endData) throws  Exception{
        String api = "query_day_detail_list";
        String msgHeader ="<?xml version=\"1.0\" encoding=\"utf-8\"?> " +
                "<root> " +
                "   <serverName>"+api+"</serverName>  " +
                "   <format>xml</format>" +
                "   <callOperator></callOperator> " +
                "   <callOperator>"+operate+"</callOperator> " +
                "   <certificate>"+key+"</certificate> " +
                "   <orgCode>01</orgCode> " +
                "</root>";
        String condition ="";
        JSONObject object = new JSONObject();
@ -2036,17 +2025,14 @@ public class DsyyEntranceService {
            object.put("endData",endData);
        }
        condition = object.toJSONString();
        String msgBody ="<?xml version=\"1.0\" encoding=\"utf-8\"?>" +
                "<root>"+condition+"</root>";
        String msgBody =condition;
        Map<String,String> params = new HashedMap();
        params.put("msgHeader",msgHeader);
        params.put("msgBody",msgBody);
        logger.info("query_day_detail_list params:"+params.toString());
        String xml = getDsyyWebServiceInfo("CallInterface",params,getOperateUrl());
        XMLSerializer xmlSerializer = new XMLSerializer();
        String json = xmlSerializer.read(xml).toString();
        logger.info(" query_day_detail_list json:"+json);
        return json;
        logger.info(" query_day_detail_list json:"+xml);
        return xml;
    }
@ -2070,8 +2056,9 @@ public class DsyyEntranceService {
                "<root> " +
                "   <serverName>"+api+"</serverName>  " +
                "   <format>xml</format>" +
                "   <callOperator></callOperator> " +
                "   <callOperator>"+operate+"</callOperator> " +
                "   <certificate>"+key+"</certificate> " +
                "   <orgCode>01</orgCode> " +
                "</root>";
        String condition ="";
        if (StringUtils.isNoneBlank(hISTradeNo)){
@ -2106,7 +2093,6 @@ public class DsyyEntranceService {
        String json = xmlSerializer.read(xml).toString();
        logger.info(" sendDispensingToHis json:"+json);
        return json;
    }
    //=============his webservice 调用结束=========================
@ -2263,6 +2249,11 @@ public class DsyyEntranceService {
        return json;
    }
   /* public String selectEmrByPatientId(String patientId,String visitId){
        ServiceLocator locator = new ServiceLocator();
        String returnStr = locator.getServiceSoap("http://10.95.8.41:80/csp/jhip/JHIPLIB.SOAP.BS.Service.cls?CfgItem=JH1221查询病历接口BS").send()
    }*/
    public void test1(){
        try {
@ -2275,6 +2266,9 @@ public class DsyyEntranceService {
        }
    }
    //========================集成平台调用结束===========================
    public String replaceHtml(String demoData,String oldChar,String newChar){
@ -2586,81 +2580,81 @@ public class DsyyEntranceService {
        //基础标记
        String base =
                "<base>  \n" +
                "    <hospital_code><![CDATA["+outpatientDO.getHospital()+"]]></hospital_code>  \n" +
                "    <event_no><![CDATA["+outpatientDO.getAdmNo()+"]]></event_no>  \n" +
                "    <patient_id><![CDATA["+patientMappingDO.getMappingCode()+"]]></patient_id>  \n" +
                "    <source><![CDATA[门诊]]></source>  \n" +
                "</base>  \n";
                        "    <hospital_code><![CDATA["+outpatientDO.getHospital()+"]]></hospital_code>  \n" +
                        "    <event_no><![CDATA["+outpatientDO.getAdmNo()+"]]></event_no>  \n" +
                        "    <patient_id><![CDATA["+patientMappingDO.getMappingCode()+"]]></patient_id>  \n" +
                        "    <source><![CDATA[门诊]]></source>  \n" +
                        "</base>  \n";
        //患者就诊
        String optPatient =
                "<opt_patient>  \n" +
                "           <sex><![CDATA["+sex+"]]></sex>  \n" +
                "           <name><![CDATA["+ patientDO.getName()+"]]></name> \n" +
                "           <id_type><![CDATA[身份证]]></id_type>\n" +
                "           <id_no><![CDATA["+ patientDO.getIdcard()+"]]></id_no>  \n" +
                "           <birthday><![CDATA["+ patientDO.getBirthday()+"]]></birthday>  \n" +
                "           <event_time><![CDATA["+eventTime+"]]></event_time>  \n" +
                "           <dept_id><![CDATA["+outpatientDO.getDept()+"]]></dept_id>  \n" +
                "           <dept_name><![CDATA["+outpatientDO.getDeptName()+"]]></dept_name>  \n" +
                "           <pay_type><![CDATA["+("1".equalsIgnoreCase(payType) ? "医保" : "自费")+"]]></pay_type>  \n" +
                "           <pregnancy><![CDATA[]]></pregnancy>  \n" +
                "           <time_of_preg><![CDATA[]]></time_of_preg>  \n" +
                "           <breast_feeding><![CDATA[]]></breast_feeding>  \n" +
                "           <height><![CDATA[]]></height>  \n" +
                "           <weight><![CDATA[]]></weight>  \n" +
                "           <address><![CDATA["+ patientDO.getAddress()+"]]></address>  \n" +
                "           <phone_no><![CDATA["+ patientDO.getMobile()+"]]></phone_no>  \n" +
                "           <patient_condition><![CDATA[普通病人]]></patient_condition>  \n" +
                "</opt_patient>";
                        "           <sex><![CDATA["+sex+"]]></sex>  \n" +
                        "           <name><![CDATA["+ patientDO.getName()+"]]></name> \n" +
                        "           <id_type><![CDATA[身份证]]></id_type>\n" +
                        "           <id_no><![CDATA["+ patientDO.getIdcard()+"]]></id_no>  \n" +
                        "           <birthday><![CDATA["+ patientDO.getBirthday()+"]]></birthday>  \n" +
                        "           <event_time><![CDATA["+eventTime+"]]></event_time>  \n" +
                        "           <dept_id><![CDATA["+outpatientDO.getDept()+"]]></dept_id>  \n" +
                        "           <dept_name><![CDATA["+outpatientDO.getDeptName()+"]]></dept_name>  \n" +
                        "           <pay_type><![CDATA["+("1".equalsIgnoreCase(payType) ? "医保" : "自费")+"]]></pay_type>  \n" +
                        "           <pregnancy><![CDATA[]]></pregnancy>  \n" +
                        "           <time_of_preg><![CDATA[]]></time_of_preg>  \n" +
                        "           <breast_feeding><![CDATA[]]></breast_feeding>  \n" +
                        "           <height><![CDATA[]]></height>  \n" +
                        "           <weight><![CDATA[]]></weight>  \n" +
                        "           <address><![CDATA["+ patientDO.getAddress()+"]]></address>  \n" +
                        "           <phone_no><![CDATA["+ patientDO.getMobile()+"]]></phone_no>  \n" +
                        "           <patient_condition><![CDATA[普通病人]]></patient_condition>  \n" +
                        "</opt_patient>";
        //处方单
        String prescriptionInfo =
                "       <opt_prescription_info>  \n" +
                "           <recipe_id><![CDATA["+hisId+"]]></recipe_id>  \n" +
                "           <recipe_no><![CDATA["+hisId+"]]></recipe_no>  \n" +
                "           <recipe_source><![CDATA[门诊]]></recipe_source>  \n" +
                "           <recipe_type><![CDATA[西药方]]></recipe_type>  \n" +
                "           <dept_id><![CDATA["+ baseDoctorHospitalDO.getDeptCode()+"]]></dept_id>  \n" +
                "           <dept_name><![CDATA["+ baseDoctorHospitalDO.getDeptName()+"]]></dept_name>  \n" +
                "           <recipe_doc_title><![CDATA["+baseDoctorDO.getJobTitleName()+"]]></recipe_doc_title>  \n" +
                "           <recipe_doc_id><![CDATA["+doctorMappingDO.getMappingCode()+"]]></recipe_doc_id>  \n" +
                "           <recipe_doc_name><![CDATA["+baseDoctorDO.getName()+"]]></recipe_doc_name>  \n" +
                "           <recipe_time><![CDATA["+recipeTime+"]]></recipe_time>  \n" +
                "           <recipe_fee_total><![CDATA["+recipeFeeTotal+"]]></recipe_fee_total>  \n" +
                "           <herb_unit_price><![CDATA[]]></herb_unit_price>  \n" +
                "           <herb_packet_count><![CDATA[]]></herb_packet_count>  \n" +
                "           <recipe_status><![CDATA[0]]></recipe_status>  \n" +
                "           <comments><![CDATA[]]></comments>  \n" +
                "           <urgent_flag><![CDATA[0]]></urgent_flag>  \n" +
                "       </opt_prescription_info>";
                        "           <recipe_id><![CDATA["+hisId+"]]></recipe_id>  \n" +
                        "           <recipe_no><![CDATA["+hisId+"]]></recipe_no>  \n" +
                        "           <recipe_source><![CDATA[门诊]]></recipe_source>  \n" +
                        "           <recipe_type><![CDATA[西药方]]></recipe_type>  \n" +
                        "           <dept_id><![CDATA["+ baseDoctorHospitalDO.getDeptCode()+"]]></dept_id>  \n" +
                        "           <dept_name><![CDATA["+ baseDoctorHospitalDO.getDeptName()+"]]></dept_name>  \n" +
                        "           <recipe_doc_title><![CDATA["+baseDoctorDO.getJobTitleName()+"]]></recipe_doc_title>  \n" +
                        "           <recipe_doc_id><![CDATA["+doctorMappingDO.getMappingCode()+"]]></recipe_doc_id>  \n" +
                        "           <recipe_doc_name><![CDATA["+baseDoctorDO.getName()+"]]></recipe_doc_name>  \n" +
                        "           <recipe_time><![CDATA["+recipeTime+"]]></recipe_time>  \n" +
                        "           <recipe_fee_total><![CDATA["+recipeFeeTotal+"]]></recipe_fee_total>  \n" +
                        "           <herb_unit_price><![CDATA[]]></herb_unit_price>  \n" +
                        "           <herb_packet_count><![CDATA[]]></herb_packet_count>  \n" +
                        "           <recipe_status><![CDATA[0]]></recipe_status>  \n" +
                        "           <comments><![CDATA[]]></comments>  \n" +
                        "           <urgent_flag><![CDATA[0]]></urgent_flag>  \n" +
                        "       </opt_prescription_info>";
        //处方明细
        String prescriptionItems="";
        for (int i = 0; i < infos.size(); i++) {
            String prescriptionItem =
                    "        <opt_prescription_item>     \n" +
                    "           <recipe_item_id><![CDATA["+hisId+"]]></recipe_item_id>  \n" +
                    "           <recipe_id><![CDATA["+infos.get(i).getId()+"]]></recipe_id>  \n" +
                    "           <group_no><![CDATA["+infos.get(i).getGroupNo()+"]]></group_no>  \n" +
                    "           <drug_id><![CDATA["+infos.get(i).getDrugNo()+"]]></drug_id>  \n" +
                    "           <drug_name><![CDATA["+infos.get(i).getDrugName()+"]]></drug_name>  \n" +
                    "           <specification><![CDATA["+infos.get(i).getSpecification()+"]]></specification>  \n" +
                    "           <manufacturer_name><![CDATA["+infos.get(i).getDrugPlace()+"]]></manufacturer_name>  \n" +
                    "           <drug_dose><![CDATA["+infos.get(i).getDosage() + infos.get(i).getUnitName()+"]]></drug_dose>  \n" +
                    "           <drug_admin_route_name><![CDATA["+infos.get(i).getSupplyName()+"]]></drug_admin_route_name>  \n" +
                    "           <drug_using_freq><![CDATA["+infos.get(i).getUsageCode()+"]]></drug_using_freq>  \n" +
                    "           <despensing_num><![CDATA["+infos.get(i).getQuantity()+"]]></despensing_num>  \n" +
                    "           <pack_unit><![CDATA["+infos.get(i).getPackUnitName()+"]]></pack_unit>  \n" +
                    "           <count_unit><![CDATA["+infos.get(i).getPackQuantity()+"]]></count_unit>  \n" +
                    "           <unit_price><![CDATA["+infos.get(i).getPackRetprice()+"]]></unit_price>  \n" +
                    "           <fee_total><![CDATA["+Integer.parseInt(infos.get(i).getQuantity()) * infos.get(i).getPackRetprice()+"]]></fee_total>  \n" +
                    "           <duration><![CDATA["+infos.get(i).getUsageName()+"]]></duration>  \n" +
                    "           <preparation><![CDATA["+infos.get(i).getUnitName()+"]]></preparation>  \n" +
                    "           <approve_no><![CDATA["+infos.get(i).getPzwh()+"]]></approve_no>  \n" +
                    "           <medicare_type><![CDATA[]]></medicare_type>  \n" +
                    "           <ouvas_flag><![CDATA[]]></ouvas_flag>  \n" +
                    "           <skin_test_flag><![CDATA[]]></skin_test_flag>  \n" +
                    "           <duration><![CDATA[]]></duration>  \n" +
                    "           <special_prompt><![CDATA[]]></special_prompt>  \n" +
                    "       </opt_prescription_item>  ";
                            "           <recipe_item_id><![CDATA["+hisId+"]]></recipe_item_id>  \n" +
                            "           <recipe_id><![CDATA["+infos.get(i).getId()+"]]></recipe_id>  \n" +
                            "           <group_no><![CDATA["+infos.get(i).getGroupNo()+"]]></group_no>  \n" +
                            "           <drug_id><![CDATA["+infos.get(i).getDrugNo()+"]]></drug_id>  \n" +
                            "           <drug_name><![CDATA["+infos.get(i).getDrugName()+"]]></drug_name>  \n" +
                            "           <specification><![CDATA["+infos.get(i).getSpecification()+"]]></specification>  \n" +
                            "           <manufacturer_name><![CDATA["+infos.get(i).getDrugPlace()+"]]></manufacturer_name>  \n" +
                            "           <drug_dose><![CDATA["+infos.get(i).getDosage() + infos.get(i).getUnitName()+"]]></drug_dose>  \n" +
                            "           <drug_admin_route_name><![CDATA["+infos.get(i).getSupplyName()+"]]></drug_admin_route_name>  \n" +
                            "           <drug_using_freq><![CDATA["+infos.get(i).getUsageCode()+"]]></drug_using_freq>  \n" +
                            "           <despensing_num><![CDATA["+infos.get(i).getQuantity()+"]]></despensing_num>  \n" +
                            "           <pack_unit><![CDATA["+infos.get(i).getPackUnitName()+"]]></pack_unit>  \n" +
                            "           <count_unit><![CDATA["+infos.get(i).getPackQuantity()+"]]></count_unit>  \n" +
                            "           <unit_price><![CDATA["+infos.get(i).getPackRetprice()+"]]></unit_price>  \n" +
                            "           <fee_total><![CDATA["+Integer.parseInt(infos.get(i).getQuantity()) * infos.get(i).getPackRetprice()+"]]></fee_total>  \n" +
                            "           <duration><![CDATA["+infos.get(i).getUsageName()+"]]></duration>  \n" +
                            "           <preparation><![CDATA["+infos.get(i).getUnitName()+"]]></preparation>  \n" +
                            "           <approve_no><![CDATA["+infos.get(i).getPzwh()+"]]></approve_no>  \n" +
                            "           <medicare_type><![CDATA[]]></medicare_type>  \n" +
                            "           <ouvas_flag><![CDATA[]]></ouvas_flag>  \n" +
                            "           <skin_test_flag><![CDATA[]]></skin_test_flag>  \n" +
                            "           <duration><![CDATA[]]></duration>  \n" +
                            "           <special_prompt><![CDATA[]]></special_prompt>  \n" +
                            "       </opt_prescription_item>  ";
            prescriptionItems += prescriptionItem;
        }
        //医生反馈信息
@ -2675,15 +2669,15 @@ public class DsyyEntranceService {
            String diagDate = DateUtil.dateToStrLong(diagnosisDOS.get(i).getCreateTime());
            String prescriptionDiagnose =
                    "   <opt_diagnosis>  \n" +
                    "       <diag_id><![CDATA["+diagnosisDOS.get(i).getId()+"]]></diag_id>  \n" +
                    "       <diag_date><![CDATA["+diagDate+"]]></diag_date>  \n" +
                    "       <diag_name><![CDATA["+diagnosisDOS.get(i).getName()+"]]></diag_name>  \n" +
                    "       <diag_code><![CDATA["+diagnosisDOS.get(i).getCode()+"]]></diag_code>  \n" +
                    "       <diag_status><![CDATA[0]]></diag_status>  \n" +
                    "       <diag_doc_name><![CDATA["+baseDoctorDO.getName()+"]]></diag_doc_name>  \n" +
                    "       <diag_type><![CDATA[门诊诊断]]></diag_type>  \n" +
                    "       <diag_code_type><![CDATA[1]]></diag_code_type>  \n" +
                    "   </opt_diagnosis>  ";
                            "       <diag_id><![CDATA["+diagnosisDOS.get(i).getId()+"]]></diag_id>  \n" +
                            "       <diag_date><![CDATA["+diagDate+"]]></diag_date>  \n" +
                            "       <diag_name><![CDATA["+diagnosisDOS.get(i).getName()+"]]></diag_name>  \n" +
                            "       <diag_code><![CDATA["+diagnosisDOS.get(i).getCode()+"]]></diag_code>  \n" +
                            "       <diag_status><![CDATA[0]]></diag_status>  \n" +
                            "       <diag_doc_name><![CDATA["+baseDoctorDO.getName()+"]]></diag_doc_name>  \n" +
                            "       <diag_type><![CDATA[门诊诊断]]></diag_type>  \n" +
                            "       <diag_code_type><![CDATA[1]]></diag_code_type>  \n" +
                            "   </opt_diagnosis>  ";
            prescriptionDiagnoses += prescriptionDiagnose;
        }
        String cancelPrescription = "<opt_prescriptions>  \n" +
@ -2704,11 +2698,11 @@ public class DsyyEntranceService {
        String prescriptions =
                "<opt_prescriptions>\n" +
                    "<opt_prescription>\n" +
                        "<opt_prescription>\n" +
                        prescriptionInfo  +
                        prescriptionItems  +
                    "</opt_prescription>\n" +
                "</opt_prescriptions>";
                        "</opt_prescription>\n" +
                        "</opt_prescriptions>";
        if (serviceCode.equals("GY_V4_FLEXIBLE") || serviceCode.equals("GY_SF_V4")){
            xml = "<root>" + base + optPatient + prescriptions + diagnoses + "</root>";
@ -2763,9 +2757,9 @@ public class DsyyEntranceService {
        if (diagnosisDOS == null || diagnosisDOS.size() == 0){
            return "诊断信息为空";
        }
            String xml = "";
            xml = initParams("GY_V4_FLEXIBLE", hisId, payType, patient, doctor, infos, diagnosisDOS,outpatient);
            String response = checkPrescription("GY_V4_FLEXIBLE", xml, "合理用药审查");
        String xml = "";
        xml = initParams("GY_V4_FLEXIBLE", hisId, payType, patient, doctor, infos, diagnosisDOS,outpatient);
        String response = checkPrescription("GY_V4_FLEXIBLE", xml, "合理用药审查");
        return response;
    }
@ -2778,14 +2772,14 @@ public class DsyyEntranceService {
        if (diagnosisDOS == null || diagnosisDOS.size() == 0){
            return "诊断信息为空";
        }
            String xml = null;
            try {
                xml = initParams("GY_SF_V4",hisId, payType, patient, doctor, infos, diagnosisDOS,outpatient);
            } catch (Exception e) {
                e.printStackTrace();
            }
            String response = checkPrescription("GY_SF_V4", xml, "处方成功保存后调用");
            return response;
        String xml = null;
        try {
            xml = initParams("GY_SF_V4",hisId, payType, patient, doctor, infos, diagnosisDOS,outpatient);
        } catch (Exception e) {
            e.printStackTrace();
        }
        String response = checkPrescription("GY_SF_V4", xml, "处方成功保存后调用");
        return response;
    }
    //处方保存成功后,发送给审方系统进行人工审方
@ -2796,14 +2790,14 @@ public class DsyyEntranceService {
        if (diagnosisDOS == null || diagnosisDOS.size() == 0){
            return "诊断信息为空";
        }
            String xml = null;
            try {
                xml = initParams("SF_V4_VALID_FLAG", hisId, payType, patient, doctor, infos, diagnosisDOS,outpatient);
            } catch (Exception e) {
                e.printStackTrace();
            }
            String response = checkPrescription("SF_V4_VALID_FLAG", xml, "人工审方");
            return response;
        String xml = null;
        try {
            xml = initParams("SF_V4_VALID_FLAG", hisId, payType, patient, doctor, infos, diagnosisDOS,outpatient);
        } catch (Exception e) {
            e.printStackTrace();
        }
        String response = checkPrescription("SF_V4_VALID_FLAG", xml, "人工审方");
        return response;
    }
    //删除已保存处方时调用
@ -2814,14 +2808,14 @@ public class DsyyEntranceService {
        if (diagnosisDOS == null || diagnosisDOS.size() == 0){
            return "诊断信息为空";
        }
            String xml = null;
            try {
                xml = initParams("CANCEL_GROUP_DRUG_V4", hisId, payType, patient, doctor, infos, diagnosisDOS,outpatient);
            } catch (Exception e) {
                e.printStackTrace();
            }
            String response = checkPrescription("CANCEL_GROUP_DRUG_V4", xml, "删除已保存处方时调用");
            return response;
        String xml = null;
        try {
            xml = initParams("CANCEL_GROUP_DRUG_V4", hisId, payType, patient, doctor, infos, diagnosisDOS,outpatient);
        } catch (Exception e) {
            e.printStackTrace();
        }
        String response = checkPrescription("CANCEL_GROUP_DRUG_V4", xml, "删除已保存处方时调用");
        return response;
    }
    //医生在对药师打回的处方进行双签处理后,医生站将双签信息推送给审方系统
@ -2832,14 +2826,14 @@ public class DsyyEntranceService {
        if (diagnosisDOS == null || diagnosisDOS.size() == 0){
            return "诊断信息为空";
        }
            String xml = null;
            try {
                xml = initParams("SF_V4_DOUBLE_SIGN",  hisId, payType, patient, doctor, infos, diagnosisDOS,outpatient);
            } catch (Exception e) {
                e.printStackTrace();
            }
            String response = checkPrescription("SF_V4_DOUBLE_SIGN", xml, "处方双签");
            return response;
        String xml = null;
        try {
            xml = initParams("SF_V4_DOUBLE_SIGN",  hisId, payType, patient, doctor, infos, diagnosisDOS,outpatient);
        } catch (Exception e) {
            e.printStackTrace();
        }
        String response = checkPrescription("SF_V4_DOUBLE_SIGN", xml, "处方双签");
        return response;
    }
@ -3013,7 +3007,7 @@ public class DsyyEntranceService {
     * 获取医生手写签名图片的base64编码
     *
     *
      * @param docIdcard 医生身份证
     * @param docIdcard 医生身份证
     * @return
     * @throws Exception
     */
@ -3087,7 +3081,7 @@ public class DsyyEntranceService {
    /**
     * 电子票据开具
     * @param ylzMedicalRelationDO
     * @param
     * @return
     * @throws Exception
     */

+ 7 - 7
business/base-service/src/main/java/com/yihu/jw/internet/service/InternetCommonService.java

@ -356,7 +356,7 @@ public class InternetCommonService extends BaseJpaService<InternetUpErrorLogDO,
                jb.put("docimg",info.get("photo")==null ?null:getImg("https://hlw.xmdsyy.cn/hlw/fastdfs/"+info.get("photo").toString()));
                jb.put("id_card", info.get("idcard")== null ? "0":info.get("idcard"));
                jb.put("sex", info.get("sex")== null ? "0":info.get("sex"));
                jb.put("birthday", info.get("birthday")  == null?"2020-01-01": DateUtil.dateToStrShort((Date)info.get("birthday")));
                jb.put("birthday", info.get("birthday")  == null?"2020-01-01": info.get("birthday").toString());
                jb.put("subject", dept.length>=1?dept[0]:"");
                jb.put("subject_name",dept.length>=2?dept[1]:"");
                jb.put("belong_dept",info.get("dept_code"));
@ -808,7 +808,7 @@ public class InternetCommonService extends BaseJpaService<InternetUpErrorLogDO,
            String sqlMessage="SELECT\n" +
                    "\tM.sender_name AS \"sender_name\",\n" +
                    "\tM.sender_id AS \"sender_id\",\n" +
                    "\tM.timestamp AS \"timestamp\",\n" +
                    "\tdate_format(M.timestamp,'%Y-%m-%d %H:%i:%S' )  AS \"timestamp\",\n" +
                    "\tM.content AS \"content\",\n" +
                    "\tM.content_type AS \"content_type\",\n" +
                    "\tT.id AS \"id\",\n" +
@ -830,9 +830,9 @@ public class InternetCommonService extends BaseJpaService<InternetUpErrorLogDO,
                String sql1= "SELECT\n" +
                        "\ts.participant_id as \"participant_id\" \n" +
                        "FROM\n" +
                        "\t"+base+".PARTICIPANTS s \n" +
                        "\t"+base+".participants s \n" +
                        "WHERE\n" +
                        "\t s.SESSION_ID = '"+map.get("session_id").toString()+"' AND S.participant_id<> '"+map.get("sender_id").toString()+"'";
                        "\t s.SESSION_ID = '"+map.get("session_id").toString()+"' AND s.participant_id<> '"+map.get("sender_id").toString()+"'";
                List<Map<String,Object>> list2 = jdbcTemplate.queryForList(sql1);
                JSONObject object =new JSONObject();
                if (list2!=null&&list2.size()!=0){
@ -869,7 +869,7 @@ public class InternetCommonService extends BaseJpaService<InternetUpErrorLogDO,
                object.put("sender",map.get("sender_name"));
                object.put("msg",msg);
                object.put("msg_type",msgType);
                object.put("send_time",DateUtil.dateToStr(DateUtil.strToDate(map.get("timestamp").toString(),"yyyy-MM-dd HH:mm:ss"),"yyyy-MM-dd HH:mm:ss"));
                object.put("send_time",DateUtil.dateToStrLong(DateUtil.strToDateLong(map.get("timestamp").toString())));
                array.add(object);
            }
            info.put("content",array);
@ -1550,11 +1550,11 @@ public class InternetCommonService extends BaseJpaService<InternetUpErrorLogDO,
                " WHERE 1=1 and p.register_no is not null " ;
        if(StringUtils.isNotBlank(startDate)){
            yyghSql =  yyghSql + "  and p.create_time >=:startDate ";
            params.put("startDate",DateUtil.stringToDate(startDate+" 00:00:00","yyyy-MM-dd HH:mm:ss"));
            params.put("startDate",DateUtil.stringToDate(startDate,"yyyy-MM-dd HH:mm:ss"));
        }
        if(StringUtils.isNotBlank(endDate)){
            yyghSql =  yyghSql +  "  and p.create_time <=:endDate";
            params.put("endDate",DateUtil.stringToDate(endDate+" 00:00:00","yyyy-MM-dd HH:mm:ss"));
            params.put("endDate",DateUtil.stringToDate(endDate,"yyyy-MM-dd HH:mm:ss"));
        }
        List<Map<String,Object>> yygh = hibenateUtils.createSQLQuery(yyghSql,params);

+ 1 - 1
business/base-service/src/main/java/com/yihu/jw/utils/HttpClientUtil.java

@ -412,7 +412,7 @@ public class HttpClientUtil {
        map.put("AType",AType);
        map.put("ASign",ASign);
        String url = jlUrl+"?ACode="+ACode+"&AParams="+AInParams+"&AType="+AType;
        String response = com.yihu.jw.util.http.HttpClientUtil.postBody(url,map);
        String response = com.yihu.jw.util.http.HttpClientUtil.postBodyStatic(url,map);
        logger.info("请求entrance的参数:"+map.toString());
        logger.info("请求JLTransApi:" + response);
        String res = response.replace("\\","");

+ 16 - 0
business/base-service/src/main/java/com/yihu/jw/utils/dsyyUtil/Service.java

@ -0,0 +1,16 @@
/**
 * Service.java
 *
 * This file was auto-generated from WSDL
 * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter.
 */
package com.yihu.jw.utils.dsyyUtil;
public interface Service extends javax.xml.rpc.Service {
    public String getServiceSoapAddress();
    public ServiceSoap getServiceSoap() throws javax.xml.rpc.ServiceException;
    public ServiceSoap getServiceSoap(java.net.URL portAddress) throws javax.xml.rpc.ServiceException;
}

+ 142 - 0
business/base-service/src/main/java/com/yihu/jw/utils/dsyyUtil/ServiceLocator.java

@ -0,0 +1,142 @@
/**
 * ServiceLocator.java
 *
 * This file was auto-generated from WSDL
 * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter.
 */
package com.yihu.jw.utils.dsyyUtil;
public class ServiceLocator extends org.apache.axis.client.Service implements Service {
    public ServiceLocator() {
    }
    public ServiceLocator(org.apache.axis.EngineConfiguration config) {
        super(config);
    }
    public ServiceLocator(String wsdlLoc, javax.xml.namespace.QName sName) throws javax.xml.rpc.ServiceException {
        super(wsdlLoc, sName);
    }
    // Use to get a proxy class for ServiceSoap
    private String ServiceSoap_address = "http://10.95.8.41/csp/jhip/JHIPLIB.SOAP.BS.Service.cls";
    public String getServiceSoapAddress() {
        return ServiceSoap_address;
    }
    // The WSDD service name defaults to the port name.
    private String ServiceSoapWSDDServiceName = "ServiceSoap";
    public String getServiceSoapWSDDServiceName() {
        return ServiceSoapWSDDServiceName;
    }
    public void setServiceSoapWSDDServiceName(String name) {
        ServiceSoapWSDDServiceName = name;
    }
    public ServiceSoap getServiceSoap() throws javax.xml.rpc.ServiceException {
       java.net.URL endpoint;
        try {
            endpoint = new java.net.URL(ServiceSoap_address);
        }
        catch (java.net.MalformedURLException e) {
            throw new javax.xml.rpc.ServiceException(e);
        }
        return getServiceSoap(endpoint);
    }
    public ServiceSoap getServiceSoap(java.net.URL portAddress) throws javax.xml.rpc.ServiceException {
        try {
            ServiceSoapStub _stub = new ServiceSoapStub(portAddress, this);
            _stub.setPortName(getServiceSoapWSDDServiceName());
            return _stub;
        }
        catch (org.apache.axis.AxisFault e) {
            return null;
        }
    }
    public void setServiceSoapEndpointAddress(String address) {
        ServiceSoap_address = address;
    }
    /**
     * For the given interface, get the stub implementation.
     * If this service has no port for the given interface,
     * then ServiceException is thrown.
     */
    public java.rmi.Remote getPort(Class serviceEndpointInterface) throws javax.xml.rpc.ServiceException {
        try {
            if (ServiceSoap.class.isAssignableFrom(serviceEndpointInterface)) {
                ServiceSoapStub _stub = new ServiceSoapStub(new java.net.URL(ServiceSoap_address), this);
                _stub.setPortName(getServiceSoapWSDDServiceName());
                return _stub;
            }
        }
        catch (Throwable t) {
            throw new javax.xml.rpc.ServiceException(t);
        }
        throw new javax.xml.rpc.ServiceException("There is no stub implementation for the interface:  " + (serviceEndpointInterface == null ? "null" : serviceEndpointInterface.getName()));
    }
    /**
     * For the given interface, get the stub implementation.
     * If this service has no port for the given interface,
     * then ServiceException is thrown.
     */
    public java.rmi.Remote getPort(javax.xml.namespace.QName portName, Class serviceEndpointInterface) throws javax.xml.rpc.ServiceException {
        if (portName == null) {
            return getPort(serviceEndpointInterface);
        }
        String inputPortName = portName.getLocalPart();
        if ("ServiceSoap".equals(inputPortName)) {
            return getServiceSoap();
        }
        else  {
            java.rmi.Remote _stub = getPort(serviceEndpointInterface);
            ((org.apache.axis.client.Stub) _stub).setPortName(portName);
            return _stub;
        }
    }
    public javax.xml.namespace.QName getServiceName() {
        return new javax.xml.namespace.QName("http://bjgoodwillcis.com", "Service");
    }
    private java.util.HashSet ports = null;
    public java.util.Iterator getPorts() {
        if (ports == null) {
            ports = new java.util.HashSet();
            ports.add(new javax.xml.namespace.QName("http://bjgoodwillcis.com", "ServiceSoap"));
        }
        return ports.iterator();
    }
    /**
    * Set the endpoint address for the specified port name.
    */
    public void setEndpointAddress(String portName, String address) throws javax.xml.rpc.ServiceException {
        
if ("ServiceSoap".equals(portName)) {
            setServiceSoapEndpointAddress(address);
        }
        else 
{ // Unknown Port Name
            throw new javax.xml.rpc.ServiceException(" Cannot set Endpoint Address for Unknown Port" + portName);
        }
    }
    /**
    * Set the endpoint address for the specified port name.
    */
    public void setEndpointAddress(javax.xml.namespace.QName portName, String address) throws javax.xml.rpc.ServiceException {
        setEndpointAddress(portName.getLocalPart(), address);
    }
}

+ 12 - 0
business/base-service/src/main/java/com/yihu/jw/utils/dsyyUtil/ServiceSoap.java

@ -0,0 +1,12 @@
/**
 * ServiceSoap.java
 *
 * This file was auto-generated from WSDL
 * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter.
 */
package com.yihu.jw.utils.dsyyUtil;
public interface ServiceSoap extends java.rmi.Remote {
    public String send(String pInput) throws java.rmi.RemoteException;
}

+ 125 - 0
business/base-service/src/main/java/com/yihu/jw/utils/dsyyUtil/ServiceSoapStub.java

@ -0,0 +1,125 @@
/**
 * ServiceSoapStub.java
 *
 * This file was auto-generated from WSDL
 * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter.
 */
package com.yihu.jw.utils.dsyyUtil;
public class ServiceSoapStub extends org.apache.axis.client.Stub implements ServiceSoap {
    private java.util.Vector cachedSerClasses = new java.util.Vector();
    private java.util.Vector cachedSerQNames = new java.util.Vector();
    private java.util.Vector cachedSerFactories = new java.util.Vector();
    private java.util.Vector cachedDeserFactories = new java.util.Vector();
    static org.apache.axis.description.OperationDesc [] _operations;
    static {
        _operations = new org.apache.axis.description.OperationDesc[1];
        _initOperationDesc1();
    }
    private static void _initOperationDesc1(){
        org.apache.axis.description.OperationDesc oper;
        org.apache.axis.description.ParameterDesc param;
        oper = new org.apache.axis.description.OperationDesc();
        oper.setName("Send");
        param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("http://bjgoodwillcis.com", "pInput"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), String.class, false, false);
        param.setOmittable(true);
        oper.addParameter(param);
        oper.setReturnType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"));
        oper.setReturnClass(String.class);
        oper.setReturnQName(new javax.xml.namespace.QName("http://bjgoodwillcis.com", "SendResult"));
        oper.setStyle(org.apache.axis.constants.Style.WRAPPED);
        oper.setUse(org.apache.axis.constants.Use.LITERAL);
        _operations[0] = oper;
    }
    public ServiceSoapStub() throws org.apache.axis.AxisFault {
         this(null);
    }
    public ServiceSoapStub(java.net.URL endpointURL, javax.xml.rpc.Service service) throws org.apache.axis.AxisFault {
         this(service);
         super.cachedEndpoint = endpointURL;
    }
    public ServiceSoapStub(javax.xml.rpc.Service service) throws org.apache.axis.AxisFault {
        if (service == null) {
            super.service = new org.apache.axis.client.Service();
        } else {
            super.service = service;
        }
        ((org.apache.axis.client.Service)super.service).setTypeMappingVersion("1.2");
    }
    protected org.apache.axis.client.Call createCall() throws java.rmi.RemoteException {
        try {
            org.apache.axis.client.Call _call = super._createCall();
            if (super.maintainSessionSet) {
                _call.setMaintainSession(super.maintainSession);
            }
            if (super.cachedUsername != null) {
                _call.setUsername(super.cachedUsername);
            }
            if (super.cachedPassword != null) {
                _call.setPassword(super.cachedPassword);
            }
            if (super.cachedEndpoint != null) {
                _call.setTargetEndpointAddress(super.cachedEndpoint);
            }
            if (super.cachedTimeout != null) {
                _call.setTimeout(super.cachedTimeout);
            }
            if (super.cachedPortName != null) {
                _call.setPortName(super.cachedPortName);
            }
            java.util.Enumeration keys = super.cachedProperties.keys();
            while (keys.hasMoreElements()) {
                String key = (String) keys.nextElement();
                _call.setProperty(key, super.cachedProperties.get(key));
            }
            return _call;
        }
        catch (Throwable _t) {
            throw new org.apache.axis.AxisFault("Failure trying to get the Call object", _t);
        }
    }
    public String send(String pInput) throws java.rmi.RemoteException {
        if (super.cachedEndpoint == null) {
            throw new org.apache.axis.NoEndPointException();
        }
        org.apache.axis.client.Call _call = createCall();
        _call.setOperation(_operations[0]);
        _call.setUseSOAPAction(true);
        _call.setSOAPActionURI("http://bjgoodwillcis.com/JHIPLIB.SOAP.BS.Service.Send");
        _call.setEncodingStyle(null);
        _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE);
        _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE);
        _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);
        _call.setOperationName(new javax.xml.namespace.QName("http://bjgoodwillcis.com", "Send"));
        setRequestHeaders(_call);
        setAttachments(_call);
 try {        Object _resp = _call.invoke(new Object[] {pInput});
        if (_resp instanceof java.rmi.RemoteException) {
            throw (java.rmi.RemoteException)_resp;
        }
        else {
            extractAttachments(_call);
            try {
                return (String) _resp;
            } catch (Exception _exception) {
                return (String) org.apache.axis.utils.JavaUtils.convert(_resp, String.class);
            }
        }
  } catch (org.apache.axis.AxisFault axisFaultException) {
  throw axisFaultException;
}
    }
}

+ 178 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/hospital/prescription/WlyyOutpatientHospitalizationDO.java

@ -0,0 +1,178 @@
package com.yihu.jw.entity.hospital.prescription;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yihu.jw.entity.UuidIdentityEntity;
import com.yihu.jw.entity.UuidIdentityEntityWithCreateTime;
import com.yihu.jw.entity.UuidIdentityEntityWithOperator;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.Date;
/**
* 门诊住院登记表
*
* @author Administrator on  2019年05月31日
*
*/
@Entity
@Table(name = "wlyy_outpatient_hospitalization")
public class WlyyOutpatientHospitalizationDO extends UuidIdentityEntityWithOperator {
    private String outpatientId;
    private String visitDeptCode;//就诊科室代码
    private String visitNo;//就诊号
    private String inDeptCode;//入院科室代码
    private String diagnosisCode;//入院诊断代码
    private String diagnosisName;//入院诊断代码名称
    private Integer admissionType;//入院方式,0-门诊 1-急诊 2-转入 5-留观
    private Integer admissionCondition;//院病情,1-病危 2-专科紧急  3-一般  4-急诊 5-专科限期  6-专科普通
    private Integer admissionCause;//住院目的,0-治疗 1-分娩 2-身体检查 3-计划生育
    private Integer trumFlag;//是否外伤 0-否 1-是
    private Integer relTtpFlag;//外伤是否涉及第三方 0-否 1-是
    private String patient;//患者id
    private String patientName;//患者姓名
    private String doctor;//医生编码
    private String doctorName;//医生姓名
    private String cardNo;//就诊卡号
    private Integer status;//0失败1成功
    public Integer getStatus() {
        return status;
    }
    public void setStatus(Integer status) {
        this.status = status;
    }
    public String getOutpatientId() {
        return outpatientId;
    }
    public void setOutpatientId(String outpatientId) {
        this.outpatientId = outpatientId;
    }
    public String getVisitDeptCode() {
        return visitDeptCode;
    }
    public void setVisitDeptCode(String visitDeptCode) {
        this.visitDeptCode = visitDeptCode;
    }
    public String getVisitNo() {
        return visitNo;
    }
    public void setVisitNo(String visitNo) {
        this.visitNo = visitNo;
    }
    public String getInDeptCode() {
        return inDeptCode;
    }
    public void setInDeptCode(String inDeptCode) {
        this.inDeptCode = inDeptCode;
    }
    public String getDiagnosisCode() {
        return diagnosisCode;
    }
    public void setDiagnosisCode(String diagnosisCode) {
        this.diagnosisCode = diagnosisCode;
    }
    public String getDiagnosisName() {
        return diagnosisName;
    }
    public void setDiagnosisName(String diagnosisName) {
        this.diagnosisName = diagnosisName;
    }
    public Integer getAdmissionType() {
        return admissionType;
    }
    public void setAdmissionType(Integer admissionType) {
        this.admissionType = admissionType;
    }
    public Integer getAdmissionCondition() {
        return admissionCondition;
    }
    public void setAdmissionCondition(Integer admissionCondition) {
        this.admissionCondition = admissionCondition;
    }
    public Integer getAdmissionCause() {
        return admissionCause;
    }
    public void setAdmissionCause(Integer admissionCause) {
        this.admissionCause = admissionCause;
    }
    public Integer getTrumFlag() {
        return trumFlag;
    }
    public void setTrumFlag(Integer trumFlag) {
        this.trumFlag = trumFlag;
    }
    public Integer getRelTtpFlag() {
        return relTtpFlag;
    }
    public void setRelTtpFlag(Integer relTtpFlag) {
        this.relTtpFlag = relTtpFlag;
    }
    public String getPatient() {
        return patient;
    }
    public void setPatient(String patient) {
        this.patient = patient;
    }
    public String getPatientName() {
        return patientName;
    }
    public void setPatientName(String patientName) {
        this.patientName = patientName;
    }
    public String getDoctor() {
        return doctor;
    }
    public void setDoctor(String doctor) {
        this.doctor = doctor;
    }
    public String getDoctorName() {
        return doctorName;
    }
    public void setDoctorName(String doctorName) {
        this.doctorName = doctorName;
    }
    public String getCardNo() {
        return cardNo;
    }
    public void setCardNo(String cardNo) {
        this.cardNo = cardNo;
    }
}

+ 1 - 1
common/common-util/src/main/java/com/yihu/jw/util/http/HttpClientUtil.java

@ -414,7 +414,7 @@ public class HttpClientUtil {
        return buffer.toString();
    }
    
    public static String postBody(String url, com.alibaba.fastjson.JSONObject params) {
    public  String postBody(String url, com.alibaba.fastjson.JSONObject params) {
        RestTemplate restTemplate = new RestTemplate();
        HttpHeaders headers = new HttpHeaders();
        MediaType type = MediaType.parseMediaType("application/json; charset=UTF-8");

+ 23 - 12
svr/svr-internet-hospital-entrance/src/main/java/com/yihu/jw/entrance/controller/DsyyController.java

@ -211,22 +211,13 @@ public class DsyyController extends EnvelopRestEndpoint {
                                    @RequestParam(value = "userName",required = false)String userName,
                                    @ApiParam(name = "idNo", value = "身份证", required = false)
                                    @RequestParam(value = "idNo",required = false)String idNo,
                                   @ApiParam(name = "operatorId", value = "操作者id", required = false)
                                       @RequestParam(value = "operatorId",required = false)String operatorId,
                                   @ApiParam(name = "operatorName", value = "操作者姓名", required = false)
                                       @RequestParam(value = "operatorName",required = false)String operatorName,
                                   @ApiParam(name = "termNo", value = "终端编号", required = false)
                                       @RequestParam(value = "termNo",required = false)String termNo,
                                   @ApiParam(name = "idType", value = "证件类型 默认01", required = false)
                                       @RequestParam(value = "idType",required = false)String idType,
                                   @ApiParam(name = "gend", value = "性别 1男 2女", required = false)
                                       @RequestParam(value = "gend",required = false)String gend,
                                   @ApiParam(name = "phone", value = "电话号码", required = false)
                                       @RequestParam(value = "phone",required = false)String phone,
                                   @ApiParam(name = "brdy", value = "出生日期 yyyy-mm-dd", required = false)
                                       @RequestParam(value = "brdy",required = false)String brdy) throws Exception {
        return success("请求成功",dsyyEntranceService.buildAccount(operatorId,operatorName,termNo,userName,idNo,idType,
                gend,phone,brdy));
                                   @ApiParam(name = "cardNo", value = "卡号", required = false)
                                       @RequestParam(value = "cardNo",required = false)String cardNo) throws Exception {
        return success("请求成功",dsyyEntranceService.buildAccount(userName,idNo,gend,phone,cardNo));
    }
    /**
@ -315,6 +306,26 @@ public class DsyyController extends EnvelopRestEndpoint {
    }
    @PostMapping(value = "/sendDispensingToHis")
    @ApiOperation(value = "互联网医院通知院内摆药")
    public ObjEnvelop buildAccount(@ApiParam(name = "hISTradeNo", value = "必填,挂号流水号", required = false)
                                   @RequestParam(value = "hISTradeNo",required = false)String hISTradeNo,
                                   @ApiParam(name = "payCardNo", value = "必填,就诊卡号", required = false)
                                   @RequestParam(value = "payCardNo",required = false)String payCardNo,
                                   @ApiParam(name = "isExpress", value = "必填,是否快递", required = false)
                                   @RequestParam(value = "isExpress",required = false)String isExpress,
                                   @ApiParam(name = "expressBillNo", value = "必填,快递单号", required = false)
                                   @RequestParam(value = "expressBillNo",required = false)String expressBillNo,
                                   @ApiParam(name = "expressAddress", value = "快递地址", required = false)
                                   @RequestParam(value = "expressAddress",required = false)String expressAddress,
                                   @ApiParam(name = "expressPhone", value = "快递电话", required = false)
                                   @RequestParam(value = "expressPhone",required = false)String expressPhone,
                                   @ApiParam(name = "remark", value = "备份", required = false)
                                   @RequestParam(value = "remark",required = false)String remark) throws Exception {
        return success("请求成功",dsyyEntranceService.sendDispensingToHis(hISTradeNo,payCardNo,isExpress,expressBillNo,expressAddress,expressPhone,remark));
    }
    @GetMapping(value = "/authorize")
    @ApiOperation(value = "ca认证")
    public Envelop authorize() throws Exception {

+ 1 - 1
svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/web/quota/JobController.java

@ -795,7 +795,7 @@ public class JobController extends BaseController {
                    SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
                    for (int i = 0;i<days;i++){
                        endDate = format.format(com.yihu.jw.util.date.DateUtil.getPreDays(format.parse(startDate),1));
                        internetCommonService.upNsInvokeTotal(startDate,endDate);
                        internetCommonService.upNsInvokeTotal(startDate+" 00:00:00",endDate+" 00:00:00");
                        startDate = endDate;
                    }

+ 46 - 4
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/hospital/WlyyFamilyMemberController.java

@ -9,10 +9,8 @@ import com.yihu.jw.hospital.family.dao.WlyyNatPatientFamilyMemberDao;
import com.yihu.jw.hospital.family.dao.WlyyPatientFamilyMemberDao;
import com.yihu.jw.hospital.family.service.PatientMemberDictService;
import com.yihu.jw.hospital.family.service.WlyyFamilyMemberService;
import com.yihu.jw.hospital.prescription.service.entrance.EntranceService;
import com.yihu.jw.hospital.prescription.service.entrance.TnyyEntranceService;
import com.yihu.jw.hospital.prescription.service.entrance.XzzxEntranceService;
import com.yihu.jw.hospital.prescription.service.entrance.YkyyEntranceService;
import com.yihu.jw.hospital.prescription.service.DsyyPrescriptionService;
import com.yihu.jw.hospital.prescription.service.entrance.*;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.MixEnvelop;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
@ -75,6 +73,9 @@ public class WlyyFamilyMemberController extends EnvelopRestEndpoint {
    private WlyyNatPatientFamilyMemberDao natPatientFamilyMemberDao;
    @Value("${wechat.id}")
    private String wxId;
    @Autowired
    private DsyyPrescriptionService dsyyPrescriptionService;
    @ApiOperation("获取家人关系")
    @PostMapping(value = BaseHospitalRequestMapping.WlyyFamilyMember.findRelationDict)
@ -158,6 +159,29 @@ public class WlyyFamilyMemberController extends EnvelopRestEndpoint {
                mixEnvelop.setMessage("您所添加的家属无就诊记录,无法添加");
                return  mixEnvelop;
            }
        }else if ("xm_dsyy_wx".equalsIgnoreCase(wxId)){
            JSONObject object = dsyyPrescriptionService.queryCardListToHospital("",idCard);
            if (object!=null){
                if (object.getString("retCode").equalsIgnoreCase("00")){
                    com.alibaba.fastjson.JSONArray array = object.getJSONArray("cardlist");
                    if(array!=null&&array.size()>0){
                        JSONObject jsonObject= array.getJSONObject(0);
                        String Pat_name = jsonObject.getString("userName");
                        String Next_Of_Kin_Phone = jsonObject.getString("phone");
                        if(!Next_Of_Kin_Phone.equalsIgnoreCase(phoneNum)){
                            mixEnvelop.setStatus(408);
                            mixEnvelop.setMessage("您所添加的家属的电话有误,无法发送验证码");
                            return mixEnvelop;
                        }
                        if(!Pat_name.equalsIgnoreCase(familyName)){
                            mixEnvelop.setStatus(408);
                            mixEnvelop.setMessage("您所添加的家属的名称有误,无法发送验证码");
                            return mixEnvelop;
                        }
                    }
                }
            }
        }else if ("sd_tnzyy_wx".equalsIgnoreCase(wxId)){
            com.alibaba.fastjson.JSONArray jsonArray1 = tnyyEntranceService.selectPatientMappingCode(idCard);
            if (jsonArray1!=null&&jsonArray1.size()>0){
@ -225,6 +249,24 @@ public class WlyyFamilyMemberController extends EnvelopRestEndpoint {
                    mixEnvelop.setMessage("验证码发送失败");
                    mixEnvelop.setStatus(500);
                }
            }else if("xm_dsyy_wx".equalsIgnoreCase(wxId)){
                System.out.println("发送第三医院验证码开始");
                int result = 1;
                if (null!=jsonArray&&jsonArray.size() > 0) {
                    result = dsyyPrescriptionService.SendSms(phoneNum, "您好,您当前操作的验证码是:" + captcha + ",2分钟内有效。如非本人操作,请忽略");
                } else {
                    result = 2;
                }
                if (0 == result) {
                    this.store(client_id, phoneNum, captcha, 120);
                    mixEnvelop.setMessage("验证码发送成功");
                } else if (2 == result) {
                    mixEnvelop.setStatus(408);
                    mixEnvelop.setMessage("您所添加的家属无就诊记录,无法发送验证码");
                } else {
                    mixEnvelop.setMessage("验证码发送失败");
                    mixEnvelop.setStatus(500);
                }
            }else if("xm_xzzx_wx".equalsIgnoreCase(wxId)){
                //发送短信获取验证码
                JSONObject object = new JSONObject();

+ 44 - 0
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/prescription/PrescriptionEndpoint.java

@ -3768,5 +3768,49 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
        }
    }
    @PostMapping("/queryDayDetailList")
    @ApiOperation(value = "查询住院病人日清单", notes = "查询住院病人日清单")
    public Envelop getDoctorInfoByIdcard(
            @ApiParam(name = "iptNo", value = "住院号", required = false)
            @RequestParam(value = "iptNo",required = false)String iptNo,
            @ApiParam(name = "patientId", value = "病人ID 可为空", required = false)
            @RequestParam(value = "patientId",required = false)String patientId,
            @ApiParam(name = "beginDate", value = "开始日期 20230801不能为空", required = false)
            @RequestParam(value = "beginDate",required = false)String beginDate,
            @ApiParam(name = "endDate", value = "截止日期 可为空", required = false)
            @RequestParam(value = "endDate",required = false)String endDate) {
        try {
            return success("操作成功", dsyyPrescriptionService.queryDayDetailListToHospital(iptNo,patientId,beginDate,endDate));
        } catch (Exception e) {
            return Envelop.getError(e.getMessage());
        }
    }
    @PostMapping("/applyHospital")
    @ApiOperation(value = "住院登记申请", notes = "住院登记申请")
    public Envelop applyHospital(
            @ApiParam(name = "json", value = "住院登记实体类json", required = false)
            @RequestParam(value = "json",required = false)String json) {
        try {
            WlyyOutpatientHospitalizationDO hospitalizationDO = toEntity(json,WlyyOutpatientHospitalizationDO.class);
            return success("操作成功", prescriptionService.applyHospital(hospitalizationDO));
        } catch (Exception e) {
            return Envelop.getError(e.getMessage());
        }
    }
    @PostMapping("/selectHospitalizationByOutpatientId")
    @ApiOperation(value = "查询申请记录", notes = "查询申请记录")
    public Envelop selectHospitalizationByOutpatientId(
            @ApiParam(name = "outpatientId", value = "门诊id", required = false)
            @RequestParam(value = "outpatientId",required = false)String outpatientId) {
        try {
            return success("操作成功", prescriptionService.selectHospitalizationByOutpatientId(outpatientId));
        } catch (Exception e) {
            return Envelop.getError(e.getMessage());
        }
    }
}