|
@ -9,9 +9,11 @@ import com.yihu.jw.entity.base.doctor.BaseDoctorHospitalDO;
|
|
|
import com.yihu.jw.entity.base.im.ConsultDo;
|
|
|
import com.yihu.jw.entity.base.im.ConsultTeamDo;
|
|
|
import com.yihu.jw.entity.base.patient.BasePatientDO;
|
|
|
import com.yihu.jw.entity.hospital.mapping.PatientMappingDO;
|
|
|
import com.yihu.jw.entity.hospital.message.SystemMessageDO;
|
|
|
import com.yihu.jw.entity.hospital.prescription.WlyyOutpatientDO;
|
|
|
import com.yihu.jw.entity.hospital.prescription.WlyyPrescriptionEmrDO;
|
|
|
import com.yihu.jw.hospital.mapping.dao.PatientMappingDao;
|
|
|
import com.yihu.jw.hospital.prescription.dao.OutpatientDao;
|
|
|
import com.yihu.jw.hospital.prescription.service.PrescriptionService;
|
|
|
import com.yihu.jw.hospital.prescription.service.XzyyPrescriptionService;
|
|
@ -19,6 +21,7 @@ import com.yihu.jw.hospital.prescription.service.entrance.YkyyEntranceService;
|
|
|
import com.yihu.jw.hospital.service.SystemMessage.HospitalSystemMessageService;
|
|
|
import com.yihu.jw.im.dao.ConsultDao;
|
|
|
import com.yihu.jw.im.service.ImService;
|
|
|
import com.yihu.jw.order.pay.ylz.YlzPayService;
|
|
|
import com.yihu.jw.patient.dao.BasePatientDao;
|
|
|
import com.yihu.jw.restmodel.web.Envelop;
|
|
|
import com.yihu.jw.restmodel.web.ListEnvelop;
|
|
@ -96,6 +99,10 @@ public class DoctorConsultEndpoint extends EnvelopRestEndpoint {
|
|
|
private ConsultDao consultDao;
|
|
|
@Autowired
|
|
|
private YkyyEntranceService ykyyEntranceService;
|
|
|
@Autowired
|
|
|
private YlzPayService ylzPayService;
|
|
|
@Autowired
|
|
|
private PatientMappingDao patientMappingDao;
|
|
|
|
|
|
@Value("${wechat.id}")
|
|
|
private String wxId;
|
|
@ -234,6 +241,43 @@ public class DoctorConsultEndpoint extends EnvelopRestEndpoint {
|
|
|
return success("操作成功",result);
|
|
|
}
|
|
|
|
|
|
@PostMapping(value = BaseHospitalRequestMapping.DodtorIM.refundRegisterNo)
|
|
|
@ApiOperation(value = "退号", notes = "退号")
|
|
|
public Envelop refundRegisterNo(@ApiParam(name = "outpatientCode", value = "就诊记录code", defaultValue = "1")
|
|
|
@RequestParam(value = "outpatientCode", required = true) String outpatientCode)throws Exception{
|
|
|
|
|
|
JSONObject result = new JSONObject();
|
|
|
synchronized (outpatientCode.intern()){
|
|
|
|
|
|
if(!"xm_ykyy_wx".equals(wxId)){//中山医院-心脏中心需要挂号
|
|
|
//1.调用退号接口
|
|
|
logger.info("调用挂号接口====START");
|
|
|
String rsCode = "";
|
|
|
String mes = "";
|
|
|
if("xm_xzzx_wx".equals(wxId)){ //心脏中心挂号
|
|
|
|
|
|
}else {
|
|
|
if (demoFlag.equalsIgnoreCase("true")){
|
|
|
rsCode="0";
|
|
|
mes="已退号";
|
|
|
}else {
|
|
|
net.sf.json.JSONObject res = prescriptionService.refundRegisterNo(outpatientCode);
|
|
|
rsCode = (String)res.get("@RESULT");
|
|
|
mes = (String)res.get("@MSG");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
if("-1".equals(rsCode)){
|
|
|
return failed(mes);
|
|
|
}
|
|
|
logger.info("调用退号接口====END");
|
|
|
}else {
|
|
|
}
|
|
|
|
|
|
}
|
|
|
return success("操作成功",result);
|
|
|
}
|
|
|
|
|
|
|
|
|
@PostMapping(value = BaseHospitalRequestMapping.DodtorIM.addConsult)
|
|
|
@ApiOperation(value = "添加(复诊咨询,协同门诊)", notes = "添加(复诊咨询,协同门诊)")
|
|
@ -369,9 +413,34 @@ public class DoctorConsultEndpoint extends EnvelopRestEndpoint {
|
|
|
JSONObject msgObj = new JSONObject();
|
|
|
msgObj.put("msg",baseDoctorDO.getName()+"结束了咨询");
|
|
|
msgObj.put("consultcode",consult);
|
|
|
|
|
|
String jsonStr = "";
|
|
|
|
|
|
ConsultDo cons = consultDao.findOne(consult);
|
|
|
if (StringUtils.isNoneBlank(cons.getRelationCode())){
|
|
|
List<WlyyOutpatientDO> wlyyOutpatientDOList = outpatientDao.findByPatientListNoStatus(cons.getPatient());
|
|
|
//发送诊断消息
|
|
|
if (wlyyOutpatientDOList==null||wlyyOutpatientDOList.size()==0){
|
|
|
WlyyOutpatientDO outpatientDO = wlyyOutpatientDOList.get(0);
|
|
|
BasePatientDO patientDO = basePatientDao.findById(outpatientDO.getPatient());
|
|
|
String userName = null;
|
|
|
String idcard = null;
|
|
|
if (patientDO != null) {
|
|
|
userName = patientDO.getName();
|
|
|
idcard = patientDO.getIdcard();
|
|
|
}
|
|
|
PatientMappingDO patientMappingDO = patientMappingDao.findByPatient(outpatientDO.getPatient());
|
|
|
String userNo = null;
|
|
|
if (patientMappingDO != null) {
|
|
|
userNo = patientMappingDO.getMappingCode();
|
|
|
}
|
|
|
String cardNo = null;
|
|
|
if (StringUtils.isNoneBlank(outpatientDO.getCardNo())) {
|
|
|
cardNo = outpatientDO.getCardNo();
|
|
|
}
|
|
|
String date=DateUtil.dateToStr(outpatientDO.getRegisterDate(), "yyyyMMddHHmmss");
|
|
|
ylzPayService.msgPush("01", cardNo, "01", patientDO.getMobile(), "00", userNo, userName, idcard, null, outpatientDO.getDeptName(), outpatientDO.getDoctorName(), date, "15", "1");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
if(1 == resutl){
|
|
|
jsonStr = "{\"id\":\""+ UUID.randomUUID().toString()+"\",\"sender_id\":\""+doctorCode+"\",\"sender_name\":\"系统\",\"timestamp\":"+new Date().getTime()+",\"content_type\":7,\"content\":"+msgObj.toString()+",\"business_type\":1}";
|
|
|
}
|