Browse Source

Merge branch 'dev' of http://192.168.1.220:10080/Amoy2/wlyy2.0 into dev

ysj 5 years ago
parent
commit
ff14302c97

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

@ -0,0 +1,22 @@
package com.yihu.jw.hospital.prescription.dao;
import com.yihu.jw.entity.hospital.prescription.WlyyPrescriptionDO;
import com.yihu.jw.entity.hospital.prescription.WlyyPrescriptionEmrDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import java.util.Date;
import java.util.List;
/**
 * Created by wangzhinan on 2019/5/17.
 */
public interface PrescriptionEmrDao extends PagingAndSortingRepository<WlyyPrescriptionEmrDO, String>, JpaSpecificationExecutor<WlyyPrescriptionEmrDO> {
    @Query("select a from WlyyPrescriptionEmrDO a where a.prescriptionId = ?1 and a.del=1 ")
    List<WlyyPrescriptionEmrDO> findByPrescriptionId(String prescriptionId);
}

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

@ -182,6 +182,8 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
    private PrescriptionCheckDao prescriptionCheckDao;
    @Autowired
    private PrescriptionExpressageLogDao prescriptionExpressageLogDao;
    @Autowired
    private PrescriptionEmrDao prescriptionEmrDao;
    @Value("${demo.flag}")
@ -5641,5 +5643,28 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
    }
    /**
     * 创建电子病历
     * @param wlyyPrescriptionEmrDO
     * @return
     */
    public WlyyPrescriptionEmrDO saveEmr(WlyyPrescriptionEmrDO wlyyPrescriptionEmrDO){
        wlyyPrescriptionEmrDO.setCreateTime(new Date());
        wlyyPrescriptionEmrDO.setUpdateTime(new Date());
        wlyyPrescriptionEmrDO.setDel(1);
        return prescriptionEmrDao.save(wlyyPrescriptionEmrDO);
    }
    /**
     * 查询电子病历
     * @param prescriptionId
     * @return
     */
    public List<WlyyPrescriptionEmrDO> findByPrescriptionId(String  prescriptionId){
        return prescriptionEmrDao.findByPrescriptionId(prescriptionId);
    }
}

+ 2 - 1
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/XzyyPrescriptionService.java

@ -116,8 +116,9 @@ public class XzyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
                return res;
            }
        }
        String doctorFlag =  doctorMappingDO.getDoctorName()+"/"+doctorMappingDO.getMappingCode();
        JSONArray response =  xzzxEntranceService.registeredOperate(doctorMappingDO.getMappingCode(),outpatientDO.getDept(),patientMappingDO.getMappingCode(),doctorDO.getChargeType());
        JSONArray response =  xzzxEntranceService.registeredOperate(doctorFlag,outpatientDO.getDept(),patientMappingDO.getMappingCode(),doctorDO.getChargeType());
        JSONObject res = response.getJSONObject(0);
        logger.info("挂号结果 res: " + response.toString());
        String rsCode = res.getString("registerNo");

+ 2 - 0
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/entrance/EntranceService.java

@ -2569,4 +2569,6 @@ public class EntranceService {
        }
        return ConvertUtil.convertListEnvelopInBody(resp);
    }
}

+ 20 - 0
business/im-service/src/main/java/com/yihu/jw/im/service/ImService.java

@ -1690,6 +1690,26 @@ public class ImService {
		}
	}
	
	/**
	 * 发送咨询建议
	 * @param jsonObject
	 * @param doctor
	 * @param doctorName
	 * @param outpatientId
	 * @param patient
	 * @return
	 * @throws Exception
	 */
	public String sendOutPatientSuggestMsg(com.alibaba.fastjson.JSONObject jsonObject,String doctor,String doctorName,String outpatientId,String patient,String outpatientType) throws Exception {
		if("1".equals(outpatientType)){
			return imUtil.sendImMsg(doctor, doctorName, patient+"_"+outpatientId+"_9", "34",jsonObject.toString(),"1");
		}else if("2".equals(outpatientType)){
			return imUtil.sendImMsg(doctor, doctorName, patient+"_"+outpatientId+"_12", "34",jsonObject.toString(),"1");
		}else{
			return null;
		}
	}
	
	
	/**
	 * 发送处方驳回消息

+ 1 - 1
common/common-entity/src/main/java/com/yihu/jw/entity/IntegerIdentityEntity.java

@ -25,7 +25,7 @@ public abstract class IntegerIdentityEntity implements Serializable {
//==========mysql 环境 id策略 end======================================================
//==========Oracle 环境id策略 =========================================================
    /*@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="id_generated")*/
/*    @GeneratedValue(strategy=GenerationType.SEQUENCE, generator="id_generated")*/
//==========Oracle 环境id策略 =========================================================
    public Integer getId() {
        return id;

+ 122 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/hospital/prescription/WlyyPrescriptionEmrDO.java

@ -0,0 +1,122 @@
package com.yihu.jw.entity.hospital.prescription;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yihu.jw.entity.UuidIdentityEntity;
import com.yihu.jw.entity.UuidIdentityEntityWithOperator;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.Date;
/**
* 在线处方电子病历
*
* @author
*
*/
@Entity
@Table(name = "wlyy_prescription_emr")
public class WlyyPrescriptionEmrDO extends UuidIdentityEntityWithOperator {
    /**
     * 处方id
     */
    private String prescriptionId;
    /**
     * 主诉
     */
    private String complaint;
    /**
     * 现病史
     */
    private String medicalHistory;
    /**
     * 即往史
     */
    private String pastHistory;
    /**
     * 体格检查
     */
    private String physicalExamination;
    /**
     *辅助检查
     */
    private String assistExamination;
    /**
     * 标识是否删除
     */
    private Integer del;
    @Column(name = "complaint")
    public String getComplaint() {
        return complaint;
    }
    public void setComplaint(String complaint) {
        this.complaint = complaint;
    }
    @Column(name = "medical_history")
    public String getMedicalHistory() {
        return medicalHistory;
    }
    public void setMedicalHistory(String medicalHistory) {
        this.medicalHistory = medicalHistory;
    }
    @Column(name = "past_history")
    public String getPastHistory() {
        return pastHistory;
    }
    public void setPastHistory(String pastHistory) {
        this.pastHistory = pastHistory;
    }
    @Column(name = "physical_examination")
    public String getPhysicalExamination() {
        return physicalExamination;
    }
    public void setPhysicalExamination(String physicalExamination) {
        this.physicalExamination = physicalExamination;
    }
    @Column(name = "assist_examination")
    public String getAssistExamination() {
        return assistExamination;
    }
    public void setAssistExamination(String assistExamination) {
        this.assistExamination = assistExamination;
    }
    @Column(name = "prescription_id")
    public String getPrescriptionId() {
        return prescriptionId;
    }
    public void setPrescriptionId(String prescriptionId) {
        this.prescriptionId = prescriptionId;
    }
    @Column(name = "del")
    public Integer getDel() {
        return del;
    }
    public void setDel(Integer del) {
        this.del = del;
    }
}

+ 8 - 0
common/common-request-mapping/src/main/java/com/yihu/jw/rm/hospital/BaseHospitalRequestMapping.java

@ -408,6 +408,11 @@ public class BaseHospitalRequestMapping {
        public static final String selectExpireTime = "/selectExpireTime";
        public static final String saveEmr="/saveEmr";
        public static final String findEmrByPrescriptionId="/findEmrByPrescriptionId";
    }
@ -920,6 +925,9 @@ public class BaseHospitalRequestMapping {
    
        //医生端:发起/断开 会话小程序视频邀请
        public static final String videoInviteMiniProgram="videoInviteMiniProgram";
    
        //医生端:发送咨询建议消息
        public static final String sendOutPatientSuggestMsg = "sendOutPatientSuggestMsg";
    }

+ 54 - 54
svr/svr-base/src/main/java/com/yihu/jw/base/service/wx/WechatService.java

@ -224,9 +224,9 @@ public class WechatService {
    //====================图文素材管理============================
    public MixEnvelop findWechatCombo(String saasId){
        String sql ="SELECT t.id,t.`name`," +
                "t.app_origin_id AS appOriginId," +
                "t.public_type AS publicType " +
        String sql ="SELECT t.id AS \"id\",t.name as \"name\"," +
                "t.app_origin_id AS \"appOriginId\"," +
                "t.public_type AS \"publicType\" " +
                "from wx_wechat t";
        if(StringUtils.isNotBlank(saasId)){
            sql += " JOIN wx_wechat_saas s ON s.wechat_id = t.id " +
@ -252,7 +252,7 @@ public class WechatService {
        }
        String sql = "SELECT " +
                " g.id,g.wechat_id AS wechatId,g.scene " +
                " g.id as \"id\",g.wechat_id AS \"wechatId\",g.scene AS \"scene\" " +
                " FROM " +
                " wx_graphic_scene g " +
                " WHERE " +
@ -325,7 +325,7 @@ public class WechatService {
    public MixEnvelop findImg(String wechatId,String title,String scene,Integer page,Integer size){
        String sqlTotal = "SELECT " +
                " COUNT(1) AS total " +
                " COUNT(1) AS \"total\" " +
                " FROM " +
                " wx_graphic_message m ";
                if(StringUtils.isNotBlank(scene)){
@ -347,13 +347,13 @@ public class WechatService {
        }
        String sql = "SELECT " +
                " m.id, " +
                " m.wechat_id AS wechatId, " +
                " m.title, " +
                " m.description, " +
                " m.url, " +
                " m.pic_url AS picUrl, " +
                " m.`status` " +
                " m.id as \"id\", " +
                " m.wechat_id AS \"wechatId\", " +
                " m.title as \"title\", " +
                " m.description \"description\", " +
                " m.url as \"url\", " +
                " m.pic_url AS \"picUrl\", " +
                " m.status AS \"status\" " +
                " FROM " +
                " wx_graphic_message m ";
        if(StringUtils.isNotBlank(scene)){
@ -460,7 +460,7 @@ public class WechatService {
    public MixEnvelop findWxReplyScene(String wechatId,String msgType,String event,String content,Integer status,Integer page,Integer size){
        String totalSql = "SELECT " +
                " COUNT(1) AS total " +
                " COUNT(1) AS \"total\" " +
                " FROM " +
                " wx_reply_scene s " +
                " WHERE " +
@ -485,15 +485,15 @@ public class WechatService {
        }
        String sql = "SELECT " +
                " s.id," +
                " s.wechat_id AS wechatId," +
                " s.scene, " +
                " s.`status`, " +
                " s.id, " +
                " s.content, " +
                " s.app_origin_id AS appOriginId, " +
                " s.`event`, " +
                " s.msg_type AS msgType" +
                " s.id AS \"id\"," +
                " s.wechat_id AS \"wechatId\"," +
                " s.scene AS \"scene\", " +
                " s.status as \"status\", " +
                " s.id as \"id\", " +
                " s.content as \"content\", " +
                " s.app_origin_id AS \"appOriginId\", " +
                " s.event as \"event\", " +
                " s.msg_type AS \"msgType\"" +
                " FROM " +
                " wx_reply_scene s " +
                " WHERE " +
@ -560,7 +560,7 @@ public class WechatService {
    public MixEnvelop findWxtemp(String wechatId,Integer status,String name,String key,Integer page,Integer size){
        String totalSql = "SELECT " +
                " COUNT(1) AS total " +
                " COUNT(1) AS \"total\" " +
                " FROM " +
                " wx_template t" +
                " WHERE t.wechat_id= '"+wechatId+"' ";
@ -580,13 +580,13 @@ public class WechatService {
        }
        String sql = "SELECT " +
                " t.id, " +
                " t.title, " +
                " t.wechat_id AS wechatId, " +
                " t.template_id AS templateId, " +
                " t.template_name AS templateName, " +
                " t.content, " +
                " t.`status` " +
                " t.id as \"id\", " +
                " t.title AS \"title\", " +
                " t.wechat_id AS \"wechatId\", " +
                " t.template_id AS \"templateId\", " +
                " t.template_name AS \"templateName\", " +
                " t.content as \"content\", " +
                " t.status as \"status\" " +
                " FROM " +
                " wx_template t" +
                " WHERE t.wechat_id= '"+wechatId+"' ";
@ -621,7 +621,7 @@ public class WechatService {
    public MixEnvelop findWxTempConfigList(String wechatId,String templateId,String scene,Integer page,Integer size){
        String totalSql ="SELECT " +
                " COUNT(1) AS total " +
                " COUNT(1) AS \"total\" " +
                " FROM " +
                " wx_template_config g " +
                " WHERE " +
@ -639,29 +639,29 @@ public class WechatService {
        }
        String sql ="SELECT " +
                " g.id, " +
                " g.wechat_id AS wechatId, " +
                " g.template_id AS templateId, " +
                " g.template_name AS template_name, " +
                " g.scene, " +
                " g.scene_description AS sceneDescription, " +
                " g.`first`, " +
                " g.url, " +
                " g.remark, " +
                " g.keyword1, " +
                " g.keyword2, " +
                " g.keyword3, " +
                " g.keyword4, " +
                " g.keyword5, " +
                " g.keyword6, " +
                " g.keyword7, " +
                " g.create_time AS createTime, " +
                " g.create_user AS createUser, " +
                " g.create_user_name AS createUserName, " +
                " g.update_time AS updateTime, " +
                " g.update_user AS updateUser, " +
                " g.update_user_name AS updateUserName, " +
                " g.status " +
                " g.id as \"id\", " +
                " g.wechat_id AS \"wechatId\", " +
                " g.template_id AS \"templateId\", " +
                " g.template_name AS \"template_name\", " +
                " g.scene AS \"scene\", " +
                " g.scene_description AS \"sceneDescription\", " +
                " g.first AS \"first\", " +
                " g.url AS \"url\", " +
                " g.remark AS \"remark\", " +
                " g.keyword1 AS \"keyword1\", " +
                " g.keyword2 AS \"keyword2\", " +
                " g.keyword3 AS \"keyword3\", " +
                " g.keyword4 AS \"keyword4\", " +
                " g.keyword5 AS \"keyword5\", " +
                " g.keyword6 AS \"keyword6\", " +
                " g.keyword7 AS \"keyword7\", " +
                " g.create_time AS \"createTime\", " +
                " g.create_user AS \"createUser\", " +
                " g.create_user_name AS \"createUserName\", " +
                " g.update_time AS \"updateTime\", " +
                " g.update_user AS \"updateUser\", " +
                " g.update_user_name AS \"updateUserName\", " +
                " g.status AS \"status\"" +
                " FROM " +
                " wx_template_config g " +
                " WHERE " +

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

@ -10,6 +10,7 @@ import com.yihu.jw.entity.base.im.ConsultTeamDo;
import com.yihu.jw.entity.base.patient.BasePatientDO;
import com.yihu.jw.entity.hospital.message.SystemMessageDO;
import com.yihu.jw.entity.hospital.prescription.WlyyOutpatientDO;
import com.yihu.jw.entity.hospital.prescription.WlyyPrescriptionDiagnosisDO;
import com.yihu.jw.hospital.prescription.dao.OutpatientDao;
import com.yihu.jw.hospital.prescription.service.PrescriptionService;
import com.yihu.jw.hospital.prescription.service.XzyyPrescriptionService;
@ -716,5 +717,38 @@ public class DoctorConsultEndpoint extends EnvelopRestEndpoint {
		wxTemplateService.sendWeTempMesMiniProgram(sender_id,sender_name,reciver_id,reciver_name,session_id);
		return success("操作成功");
	}
	
	@PostMapping(value = BaseHospitalRequestMapping.DodtorIM.sendOutPatientSuggestMsg)
	@ApiOperation(value = "医生端:发送咨询建议消息", notes = "医生端:发送咨询建议消息")
	public Envelop sendOutPatientSuggestMsg(@ApiParam(name = "outPatientId", value = "门诊编号")
	                                            @RequestParam(value = "outPatientId", required = true)String outPatientId,
	                                        @ApiParam(name = "diagnosticAdvice", value = "诊断建议")
	                                            @RequestParam(value = "diagnosticAdvice", required = true)String diagnosticAdvice,
	                                        @ApiParam(name = "treatmentAdvice", value = "治疗建议")
	                                            @RequestParam(value = "treatmentAdvice", required = true)String treatmentAdvice,
	                                        @ApiParam(name = "adjust", value = "0调整 1已调整,非必填,默认为0")
	                                            @RequestParam(value = "treatmentAdvice", required = false)String adjust
	)throws Exception  {
		try {
			com.alibaba.fastjson.JSONObject msgObj = new com.alibaba.fastjson.JSONObject();
			WlyyOutpatientDO wlyyOutpatientDO = outpatientDao.findOne(outPatientId);
			
			if(StringUtils.isBlank(adjust)){
				adjust = "0";
			}
			
			msgObj.put("adjust",adjust);//0调整 1已调整,非必填,默认为0
			msgObj.put("diagnosticAdvice",diagnosticAdvice);//诊断建议
			msgObj.put("treatmentAdvice",treatmentAdvice);//治疗建议
			msgObj.put("outPatientId",outPatientId);
			
			String immsg = imService.sendOutPatientSuggestMsg(msgObj,wlyyOutpatientDO.getDoctor(),wlyyOutpatientDO.getDoctorName(),outPatientId,wlyyOutpatientDO.getPatient(),wlyyOutpatientDO.getOutpatientType());
			System.out.println("发送咨询建议消息成功:"+immsg);
		}catch (Exception e){
			System.out.println("发送咨询建议消息失败:"+e.getMessage());
//            e.printStackTrace();
		}
		return success("操作成功");
	}
}

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

@ -1,13 +1,11 @@
package com.yihu.jw.hospital.endpoint.prescription;
import com.alibaba.fastjson.JSONObject;
import com.yihu.jw.doctor.service.excel.DoctorWorkTimeExcelReader;
import com.yihu.jw.doctor.service.excel.DoctorWorkTimeMainExcelDO;
import com.yihu.jw.entity.base.doctor.BaseDoctorDO;
import com.yihu.jw.entity.hospital.message.SystemMessageDO;
import com.yihu.jw.entity.hospital.prescription.WlyyOutpatientDO;
import com.yihu.jw.entity.hospital.prescription.WlyyPrescriptionCheckDO;
import com.yihu.jw.entity.hospital.prescription.WlyyPrescriptionDO;
import com.yihu.jw.entity.hospital.prescription.WlyyPrescriptionDiagnosisDO;
import com.yihu.jw.entity.hospital.prescription.*;
import com.yihu.jw.hospital.prescription.dao.OutpatientDao;
import com.yihu.jw.hospital.prescription.service.InspectionService;
import com.yihu.jw.hospital.prescription.service.PrescriptionLogService;
@ -1404,5 +1402,44 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
            return ObjEnvelop.getError(e.getMessage());
        }
    }
    /**
     * 创建电子病历
     * @param emrJson
     * @return
     * @throws Exception
     */
    @PostMapping(value= BaseHospitalRequestMapping.Prescription.saveEmr)
    @ApiOperation("创建电子病历")
    public ObjEnvelop saveEmr(
            @ApiParam(name = "emrJson", value = "emrJson", required = true)
            @RequestParam(required = true)String emrJson) throws Exception {
        try {
            WlyyPrescriptionEmrDO emrDO = objectMapper.readValue(emrJson,WlyyPrescriptionEmrDO.class);
            return ObjEnvelop.getSuccess("ok",prescriptionService.saveEmr(emrDO));
        } catch (Exception e) {
            return ObjEnvelop.getError(e.getMessage());
        }
    }
    /**
     * 查询电子病历
     * @param prescriptionId
     * @return
     * @throws Exception
     */
    @GetMapping(value= BaseHospitalRequestMapping.Prescription.findEmrByPrescriptionId)
    @ApiOperation("查询电子病历")
    public ObjEnvelop findByPrescriptionId(
            @ApiParam(name = "prescriptionId", value = "prescriptionId", required = true)
            @RequestParam(required = true)String prescriptionId) throws Exception {
        try {
            return ObjEnvelop.getSuccess("ok",prescriptionService.findByPrescriptionId(prescriptionId));
        } catch (Exception e) {
            return ObjEnvelop.getError(e.getMessage());
        }
    }
    
}