瀏覽代碼

Merge branch 'dev' of wangjun/wlyy2.0 into dev

wangzhinan 4 年之前
父節點
當前提交
ecb5189cb7

+ 32 - 3
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/PrescriptionService.java

@ -119,6 +119,7 @@ import java.math.BigDecimal;
import java.net.URL;
import java.text.DecimalFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
/**
@ -2181,7 +2182,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
     * @param diagnosisJson
     * @return
     */
    public Map<String, Object> makeDiagnosis(String outPatientId,String prescriptionId, String advice, String type, String infoJsons, String diagnosisJson, String inspectionJson, String emrJson) throws Exception {
    public Map<String, Object> makeDiagnosis(String outPatientId,String prescriptionId, String advice, String type, String infoJsons, String diagnosisJson, String inspectionJson, String emrJson,String hisId) throws Exception {
        Map<String, Object> result = new HashedMap();
@ -2199,6 +2200,9 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            wlyyPrescriptionDO1 = prescriptionDao.findById(prescriptionId);
            prescriptionDO =wlyyPrescriptionDO1.get(0);
        }else{
            if (StringUtils.isNotBlank(hisId)){
                prescriptionDO.setHisId(hisId);
            }
            prescriptionDO.setOutpatientId(outPatientId);
            prescriptionDO.setType(1);
            prescriptionDO.setDept(outpatientDO.getDept());
@ -4301,7 +4305,6 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        }
        return times;
    }
    /**
     * 医生可接单列表(图文复诊、视频复诊、协同门诊)
     *
@ -4311,7 +4314,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
     * @query_status 0:图文复诊候诊 1:图文复诊抢单列表
     * @dept 部门
     */
    public List<Map<String, Object>> findWaitingRoomOutpatientByDoctor(String doctor, Integer type, Integer query_status, String dept) {
    public List<Map<String, Object>> findWaitingRoomOutpatientByDoctor(String doctor, Integer type, Integer query_status, String dept,String sex,String keyword,String ageGroup) {
        String sql = "SELECT " +
                "room.outpatient_id AS \"id\"," +
@ -4327,6 +4330,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                "outpatient.consumer_name as \"consumerName\"," +
                "outpatient.consumer_mobile as \"consumerMobile\", ";
        if ("xm_ykyy_wx".equals(wechatId)) {
            flag =true;
            if(flag){
                sql += "date_format(room.reservation_time ,'yyyy-MM-dd hh24:mi:ss' ) AS \"timedate_format\",";
            }else {
@ -4374,6 +4378,31 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        if (StringUtils.isNoneBlank(dept)) {
            sql += " AND outpatient.dept='" + dept + "' ";
        }
        if(StringUtils.isNoneBlank(sex)){
            sql += " AND patient.sex=" + sex + " ";
        }if(StringUtils.isNoneBlank(keyword)){
            sql += " AND patient.name like '%" + keyword + "%' ";
        }
        if(StringUtils.isNoneBlank(ageGroup)){
            String[] age = ageGroup.split(",");
            Calendar nowBegin = Calendar.getInstance();
            Calendar nowEnd = Calendar.getInstance();
            nowBegin.add(Calendar.YEAR,-Integer.parseInt(age[0]));
            nowEnd.add(Calendar.YEAR,-Integer.parseInt(age[1]));
            SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd");
            String beginAge =  sf.format(nowBegin.getTime());
            String endAge =  sf.format(nowEnd.getTime());
            if("xm_ykyy_wx".equals(wechatId)){
                if (flag){
                    sql+=" and patient.birthday > '" + endAge + "' and patient.birthday<'" + beginAge + "'";
                }else {
                    sql+=" and patient.birthday > to_date('" + endAge + "', 'yyyy-mm-dd') and patient.birthday < to_date('" + beginAge + "','yyyy-mm-dd')";
                }
            }else{
                sql+=" and patient.birthday > '" + endAge + "' and patient.birthday<'" + beginAge + "'";
            }
        }
        logger.info("接口名称:findWaitingRoomOutpatientByDoctor-->sql="+sql);
        List<Map<String, Object>> list = jdbcTemplate.queryForList(sql);

+ 6 - 22
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/entrance/XzzxEntranceService.java

@ -3182,26 +3182,16 @@ public Map checkSyncHis(String IoFlag,String PayCardNo,String NullahNumber,Strin
        return map;
    }
    //组装审药参数并发送到entrance
    public String checkInputInfo(String prescriptionId,String payType,String doctor,String patient,List<WlyyPrescriptionDiagnosisDO> diagnosisDOS,List<WlyyPrescriptionInfoDO> infos) throws Exception{
    public String checkInputInfo(String hisId,String payType,String doctor,String patient,List<WlyyPrescriptionDiagnosisDO> diagnosisDOS,List<WlyyPrescriptionInfoDO> infos) throws Exception{
        JSONObject jsonObject = initEntranceParam(payType,doctor,patient,diagnosisDOS);
        String tjPrescriptionId = "";
        WlyyPrescriptionCheckDO wlyyPrescriptionCheckDO;
        //如果重新审核药品 一定要把返回的orderNo的值拿到赋值到prescriptionId里
        if (StringUtils.isNotEmpty(prescriptionId)){
            tjPrescriptionId = prescriptionId;
            jsonObject.put("PATIENT_PRES_ID",tjPrescriptionId);
            wlyyPrescriptionCheckDO = prescriptionCheckDao.findOne(tjPrescriptionId);
        if (StringUtils.isNotEmpty(hisId)){
            jsonObject.put("PATIENT_PRES_ID",hisId);
        }else {
            wlyyPrescriptionCheckDO = new WlyyPrescriptionCheckDO();
            tjPrescriptionId = UUID.randomUUID().toString();
            wlyyPrescriptionCheckDO.setId(tjPrescriptionId);
            jsonObject.put("PATIENT_PRES_ID",tjPrescriptionId);
            hisId = UUID.randomUUID().toString();
            jsonObject.put("PATIENT_PRES_ID",hisId);
        }
        wlyyPrescriptionCheckDO.setCreateUser(doctor);
        wlyyPrescriptionCheckDO.setCreateUserName(null==jsonObject.get("DOCTOR_NAME")?"":jsonObject.get("DOCTOR_NAME").toString());
        wlyyPrescriptionCheckDO.setDept(null==jsonObject.get("DEPT_CODE")?"":jsonObject.get("DEPT_CODE").toString());
        wlyyPrescriptionCheckDO.setDeptName(null==jsonObject.get("DEPT_NAME")?"":jsonObject.get("DEPT_NAME").toString());
        if (null!=infos&&infos.size()>0) {
            String response = "";
            String returnJson = "";
@ -3225,10 +3215,9 @@ public Map checkSyncHis(String IoFlag,String PayCardNo,String NullahNumber,Strin
                if (StringUtils.isNotBlank(obj)) {
                    List<Map<String,Object>> returnList = transXmlCommen(obj);
                    Map<String,Object> checkIdMap = new HashMap<>();
                    checkIdMap.put("prescriptionOnly",tjPrescriptionId);
                    checkIdMap.put("prescriptionOnly",hisId);
                    returnList.add(checkIdMap);
                    returnJson = JSONArray.toJSONString(returnList);
                    wlyyPrescriptionCheckDO.setReason(returnJson);
                    logger.info("返回到互联网医院的解析后的结果:"+returnJson);
                    wlyyHttpLogDO.setDoctor(doctor);
                    wlyyHttpLogDO.setCreateTime(new Date());
@ -3237,7 +3226,6 @@ public Map checkSyncHis(String IoFlag,String PayCardNo,String NullahNumber,Strin
                    wlyyHttpLogDO.setName("checkPrescription");
                } else {
                    returnJson = "审方返回接口为空请检查参数是否正确";
                    wlyyPrescriptionCheckDO.setStatus(1);
                    logger.info(returnJson);
                    wlyyHttpLogDO.setCode("error");
                    wlyyHttpLogDO.setDoctor(doctor);
@ -3248,7 +3236,6 @@ public Map checkSyncHis(String IoFlag,String PayCardNo,String NullahNumber,Strin
                }
            } else {
                returnJson = "entranceUrl接口调用失败";
                wlyyPrescriptionCheckDO.setStatus(1);
                wlyyHttpLogDO.setCode("error");
                wlyyHttpLogDO.setDoctor(doctor);
                wlyyHttpLogDO.setCreateTime(new Date());
@ -3257,9 +3244,6 @@ public Map checkSyncHis(String IoFlag,String PayCardNo,String NullahNumber,Strin
                wlyyHttpLogDO.setName("checkPrescription");
            }
            wlyyHttpLogDao.save(wlyyHttpLogDO);
            wlyyPrescriptionCheckDO.setStatus(1);
            prescriptionCheckDao.save(wlyyPrescriptionCheckDO);
            wlyyPrescriptionCheckDO.setReason(returnJson);
            return returnJson;
        }else {
            return "药品信息为空";

+ 13 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/hospital/prescription/WlyyPrescriptionDO.java

@ -273,6 +273,19 @@ public class WlyyPrescriptionDO extends UuidIdentityEntity {
     */
    private String voucherNo;
    /**
     * 处方审方唯一标识
     */
    private String hisId;
    @Column(name = "his_id")
    public String getHisId() {
        return hisId;
    }
    public void setHisId(String hisId) {
        this.hisId = hisId;
    }
    @Column(name = "outpatient_id")
    public String getOutpatientId() {
        return outpatientId;

+ 8 - 2
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/consult/DoctorConsultEndpoint.java

@ -129,8 +129,14 @@ public class DoctorConsultEndpoint extends EnvelopRestEndpoint {
			@ApiParam(name = "query_status", value = "0:图文复诊候诊 1:图文复诊抢单列表")
			@RequestParam(value = "",required = false) Integer query_status,
			@ApiParam(name = "dept", value = "部门")
			@RequestParam(value = "",required = false) String dept){
		return success("请求成功",prescriptionService.findWaitingRoomOutpatientByDoctor(doctor,type,query_status,dept));
			@RequestParam(value = "",required = false) String dept,
			@ApiParam(name = "sex", value = "性别1男2女")
			@RequestParam(value = "sex",required = false) String sex,
			@ApiParam(name = "keyWord", value = "姓名关键字")
			@RequestParam(value = "keyWord",required = false) String keyWord,
			@ApiParam(name = "ageGroup", value = "年龄段")
			@RequestParam(value = "ageGroup",required = false) String ageGroup){
		return success("请求成功",prescriptionService.findWaitingRoomOutpatientByDoctor(doctor,type,query_status,dept,sex,keyWord,ageGroup));
	}
	
	@GetMapping(value = BaseHospitalRequestMapping.DodtorIM.findWaitingRoomPatient)

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

@ -463,12 +463,14 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
                                    @ApiParam(name = "emrJson", value = "电子病历")
                                        @RequestParam(value = "emrJson", required = false)String emrJson,
                                    @ApiParam(name = "prescriptionId", value = "处方id")
                                        @RequestParam(value = "prescriptionId", required = false)String prescriptionId)throws Exception {
        Map<String,Object> result = prescriptionService.makeDiagnosis(outPatientId,prescriptionId,advice,type,infoJsons,diagnosisJson,inspectionJson,emrJson);
                                        @RequestParam(value = "prescriptionId", required = false)String prescriptionId,
                                    @ApiParam(name = "hisId", value = "审方唯一标识")
                                        @RequestParam(value = "hisId", required = false)String hisId)throws Exception {
        Map<String,Object> result = prescriptionService.makeDiagnosis(outPatientId,prescriptionId,advice,type,infoJsons,diagnosisJson,inspectionJson,emrJson,hisId);
        try {
            
            com.alibaba.fastjson.JSONObject msgObj = new com.alibaba.fastjson.JSONObject();
            
            List<WlyyPrescriptionDiagnosisDO> diagnosisDOs = (List<WlyyPrescriptionDiagnosisDO>) com.alibaba.fastjson.JSONArray.parseArray(diagnosisJson, WlyyPrescriptionDiagnosisDO.class);
            String zd_str = "";
            String jl_str = advice;