|
@ -386,10 +386,15 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
}
|
|
|
}
|
|
|
}else {
|
|
|
wlyyOutpatientVOList = new ArrayList<>();
|
|
|
wlyyOutpatientVOList = wlyyOutpatientVOList1;
|
|
|
}
|
|
|
|
|
|
if (wlyyOutpatientVOList!=null&&wlyyOutpatientVOList.size()!=0){
|
|
|
for (WlyyOutpatientVO wlyyOutpatientVO:wlyyOutpatientVOList){
|
|
|
if (!StringUtils.isNoneBlank(wlyyOutpatientVO.getIcd10Name())){
|
|
|
wlyyOutpatientVO.setIcd10Name("无诊断");
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
return wlyyOutpatientVOList;
|
|
|
}
|
|
|
|
|
@ -2718,6 +2723,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
* @param diagnosisJson
|
|
|
* @return
|
|
|
*/
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public Map<String, Object> makeDiagnosis(String outPatientId,String prescriptionId, String advice, String type, String infoJsons, String diagnosisJson, String inspectionJson, String emrJson,String hisId,String diseaseCode,String diseaseName,String isDisease) throws Exception {
|
|
|
|
|
|
Map<String, Object> result = new HashedMap();
|
|
@ -2731,6 +2737,30 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
outpatientDO.setDiseaseName(diseaseName);
|
|
|
outpatientDO.setIsDisease(isDisease);
|
|
|
|
|
|
String sql = "SELECT\n" +
|
|
|
"\tpi.drug_no AS \"drugNo\",\n" +
|
|
|
"\tpi.drug_name AS \"drugName\"\n" +
|
|
|
"FROM\n" +
|
|
|
"\twlyy_prescription_info pi,\n" +
|
|
|
"\twlyy_prescription p\n" +
|
|
|
"WHERE\n" +
|
|
|
"\tp.id = pi.prescription_id\n" +
|
|
|
" and p.outpatient_id= '"+outPatientId+"'" +
|
|
|
"and p.status >= 20 and p.real_order is not null ";
|
|
|
List<Map<String,Object>> maps = jdbcTemplate.queryForList(sql);
|
|
|
if (StringUtils.isNoneBlank(infoJsons)){
|
|
|
List<WlyyPrescriptionInfoDO> infoDOs = (List<WlyyPrescriptionInfoDO>) com.alibaba.fastjson.JSONArray.parseArray(infoJsons, WlyyPrescriptionInfoDO.class);
|
|
|
for (WlyyPrescriptionInfoDO infoDO:infoDOs){
|
|
|
for (int i=0;i<maps.size();i++){
|
|
|
if (infoDO.getDrugNo().equalsIgnoreCase(maps.get(i).get("drugNo").toString())){
|
|
|
throw new Exception("您当前开的药品有重复,请先作废处方再重新开。");
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
//========================处方操作=============================================================
|
|
|
//创建处方记录
|
|
|
WlyyPrescriptionDO prescriptionDO= new WlyyPrescriptionDO();
|
|
@ -5139,7 +5169,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
WlyyHospitalSysDictDO hospitalSysDictDO = hospitalSysDictDao.findById("isCloseRefund");
|
|
|
if (hospitalSysDictDO!=null&&hospitalSysDictDO.getDictValue().equalsIgnoreCase("1")){
|
|
|
try {
|
|
|
if (businessOrderDO.getStatus()==1){
|
|
|
if (businessOrderDO.getStatus()==1&&StringUtils.isNoneBlank(businessOrderDO.getTraceNo())){
|
|
|
entranceService.hisRefund(outPatientId);
|
|
|
}
|
|
|
}catch (Exception e){
|
|
@ -9289,13 +9319,37 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
}
|
|
|
String name = one.getPatientName();
|
|
|
String baseUrl = findDomainUrlInDict();
|
|
|
//向当前医生发送消息
|
|
|
if (one.getType().equalsIgnoreCase("1")){
|
|
|
title = "图文复诊";
|
|
|
msg = name+"("+sex+" "+age+"岁)向您发起了图文复诊已更换其他医生接诊,您无需接诊。";
|
|
|
}else if (one.getType().equalsIgnoreCase("2")){
|
|
|
title = "视频复诊";
|
|
|
date = DateUtil.dateToStrLong(one.getRegisterDate());
|
|
|
msg = name+"("+sex+" "+age+"岁)预约了"+date+"的视频复诊已更换其他医生接诊,您无需接诊。";
|
|
|
}
|
|
|
if (wechatId.equalsIgnoreCase("xm_zsyy_wx")){
|
|
|
String url = "";
|
|
|
// String url=baseUrl+"/hlwyy/ims-app-web/#/onlineChat/detail?_rs_title="+one.getDescription()+"&type=3&id="+one.getId();
|
|
|
enterpriseService.sendTWMesByDoctor("zsyy",doctor,title,msg,url);
|
|
|
}else if (wechatId.equalsIgnoreCase("xm_ykyy_wx")){
|
|
|
String url=baseUrl+"/ims-app-web/#/onlineChat/detail?_rs_title="+one.getDescription()+"&type=3&id="+one.getId();
|
|
|
enterpriseService.sendTWMesByDoctor("xm_ykyy_wx",doctor,title,msg,url);
|
|
|
}else if (wechatId.equalsIgnoreCase("xm_xzzx_wx")){
|
|
|
String url="https://ih.xmheart.com/hlwyy/ims-app-web/#/onlineChat/detail?_rs_title="+one.getDescription()+"&type=3&id="+one.getId();
|
|
|
enterpriseService.sendTWMesByDoctor("xm_xzzx_wx",doctor,title,msg,url);
|
|
|
}else if (wechatId.equalsIgnoreCase("xm_hcyy_wx")){
|
|
|
String url="https://hlwyy.xmhcyy.com/hcyy/ims-app-web/#/onlineChat/detail?_rs_title="+one.getDescription()+"&type=3&id="+one.getId();
|
|
|
enterpriseService.sendTWMesByDoctor("xm_hcyy_wx",doctor,title,msg,url);
|
|
|
}
|
|
|
//向更换的医生发消息
|
|
|
if (one.getType().equalsIgnoreCase("1")){
|
|
|
title = "图文复诊";
|
|
|
msg = name+"("+sex+" "+age+"岁)向您发起了图文复诊已更换其他医生接诊,请您知悉。";
|
|
|
msg = name+"("+sex+" "+age+"岁)向您发起了图文复诊,请您及时接诊。";
|
|
|
}else if (one.getType().equalsIgnoreCase("2")){
|
|
|
title = "视频复诊";
|
|
|
date = DateUtil.dateToStrLong(one.getRegisterDate());
|
|
|
msg = name+"("+sex+" "+age+"岁)预约了"+date+"的视频复诊已更换其他医生接诊,请您知悉。";
|
|
|
msg = name+"("+sex+" "+age+"岁)预约了"+date+"的视频复诊,请您及时接诊。";
|
|
|
}
|
|
|
if (wechatId.equalsIgnoreCase("xm_zsyy_wx")){
|
|
|
String url=baseUrl+"/hlwyy/ims-app-web/#/onlineChat/detail?_rs_title="+one.getDescription()+"&type=3&id="+one.getId();
|
|
@ -10339,6 +10393,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
* @param prescriptionId
|
|
|
* @return
|
|
|
*/
|
|
|
|
|
|
public WlyyPrescriptionCheckDO saveCheck(String operate, String operateName, String reason, Integer status, String prescriptionId, String wxId,String ip) throws Exception {
|
|
|
WlyyPrescriptionCheckDO prescriptionCheckDO = new WlyyPrescriptionCheckDO();
|
|
|
prescriptionCheckDO.setCreateTime(new Date());
|
|
@ -16149,6 +16204,36 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
return mapList;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 药品明细表
|
|
|
*
|
|
|
* @param startTime
|
|
|
* @param endTime
|
|
|
* @return
|
|
|
*/
|
|
|
public List<Map<String, Object>> selectInspectTotal(String startTime,String endTime){
|
|
|
List<Map<String, Object>> mapList = new ArrayList<>();
|
|
|
Date stateDate = DateUtil.strToDateLong(startTime);
|
|
|
Date endDate = DateUtil.strToDateLong(endTime);
|
|
|
List<WlyyPrescriptionDO> prescriptionDOList = prescriptionDao.findListInspectBySuccessStatus(stateDate,endDate);
|
|
|
for (WlyyPrescriptionDO prescriptionDO:prescriptionDOList){
|
|
|
com.alibaba.fastjson.JSONObject objectString = (com.alibaba.fastjson.JSONObject) com.alibaba.fastjson.JSONObject.toJSON(prescriptionDO);
|
|
|
List<WlyyInspectionDO> inspectionDOList = wlyyInspectionDao.findByPrescriptionId(prescriptionDO.getId(),1);
|
|
|
objectString.put("inspect",inspectionDOList);
|
|
|
WlyyOutpatientDO outpatientDO = outpatientDao.findById(prescriptionDO.getOutpatientId());
|
|
|
if (outpatientDO!=null){
|
|
|
objectString.put("consumerName",outpatientDO.getConsumerName());
|
|
|
}else {
|
|
|
objectString.put("consumerName","");
|
|
|
}
|
|
|
|
|
|
Map<String,Object> map = new HashedMap();
|
|
|
map.put("prescription",objectString);
|
|
|
mapList.add(map);
|
|
|
}
|
|
|
return mapList;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 药品明细表导出
|
|
|
*
|
|
@ -16187,7 +16272,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
|
|
|
for (Map<String, Object> m : ls) {
|
|
|
com.alibaba.fastjson.JSONObject jsonObject = com.alibaba.fastjson.JSONObject.parseObject(m.get("prescription").toString());
|
|
|
com.alibaba.fastjson.JSONArray array = jsonObject.getJSONArray("info");
|
|
|
com.alibaba.fastjson.JSONArray array = jsonObject.getJSONArray("inspect");
|
|
|
int j = i;
|
|
|
addCell(ws, i, 0,jsonObject.get("patientName")!=null?jsonObject.get("patientName").toString():n);
|
|
|
addCell(ws, i, 1,jsonObject.get("consumerName")!=null?jsonObject.get("consumerName").toString():n);
|
|
@ -16243,7 +16328,79 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 检查明细表导出
|
|
|
*
|
|
|
* @param ls
|
|
|
* @param startTime
|
|
|
* @param endTime
|
|
|
* @throws Exception
|
|
|
*/
|
|
|
public void pushListInspectDrugTotal(OutputStream os, List<Map<String, Object>> ls,String startTime,String endTime) throws Exception {
|
|
|
WritableWorkbook wwb = jxl.Workbook.createWorkbook(os);
|
|
|
try {
|
|
|
WritableSheet ws;
|
|
|
ws = wwb.createSheet("sheet", 1);
|
|
|
String[] header = {"互联网医院检查明细表","","","","","","","",""};//
|
|
|
int k = 0;
|
|
|
for (String h : header) {
|
|
|
addCell(ws, 0, k, h);//表名,行,列,header
|
|
|
k++;
|
|
|
}
|
|
|
|
|
|
String[] header1 = {"汇总日期:"+startTime+"至"+endTime,"","","","","","","",""};//
|
|
|
int k1 = 0;
|
|
|
for (String h : header1) {
|
|
|
addCell(ws, 1, k1, h);//表名,行,列,header
|
|
|
k1++;
|
|
|
}
|
|
|
String[] header2 = {"患者名称","代问诊人","检查项目","检查部位","执行院区","执行科室","总量","价格","开方时间","开方医生"};//
|
|
|
int k2 = 0;
|
|
|
for (String h : header2) {
|
|
|
addCell(ws, 2, k2, h);//表名,行,列,header
|
|
|
k2++;
|
|
|
}
|
|
|
|
|
|
int i = 3;
|
|
|
String n = " ";
|
|
|
|
|
|
for (Map<String, Object> m : ls) {
|
|
|
com.alibaba.fastjson.JSONObject jsonObject = com.alibaba.fastjson.JSONObject.parseObject(m.get("prescription").toString());
|
|
|
com.alibaba.fastjson.JSONArray array = jsonObject.getJSONArray("info");
|
|
|
int j = i;
|
|
|
addCell(ws, i, 0,jsonObject.get("patientName")!=null?jsonObject.get("patientName").toString():n);
|
|
|
addCell(ws, i, 1,jsonObject.get("consumerName")!=null?jsonObject.get("consumerName").toString():n);
|
|
|
DecimalFormat df = new DecimalFormat("#.00");
|
|
|
if(array!=null&&array.size()!=0){
|
|
|
for (int z=0;z<array.size();z++){
|
|
|
com.alibaba.fastjson.JSONObject object = array.getJSONObject(z);
|
|
|
addCell(ws, i, 2, object.get("name")!=null?object.get("name").toString():n);
|
|
|
addCell(ws, i, 3, object.get("checkPartName")!=null?object.get("checkPartName").toString():n);
|
|
|
addCell(ws, i, 4, object.get("orgName")!=null?object.get("orgName").toString():n);
|
|
|
addCell(ws, i, 5, object.get("deptName")!=null?object.get("deptName").toString():n);
|
|
|
addCell(ws, i, 6, object.get("quantity")!=null?object.get("quantity").toString():n);
|
|
|
addCell(ws, i, 7,object.get("chargeAmount")!=null?object.get("chargeAmount").toString():n);
|
|
|
addCell(ws, i, 8,jsonObject.get("createTime")!=null?DateUtil.stampToString(jsonObject.get("createTime").toString()):n);
|
|
|
addCell(ws, i, 9,jsonObject.get("doctorName")!=null?jsonObject.get("doctorName").toString():n);
|
|
|
i++;
|
|
|
}
|
|
|
|
|
|
ws.mergeCells(0,j,0,i-1);
|
|
|
ws.mergeCells(1,j,1,i-1);
|
|
|
}else {
|
|
|
i++;
|
|
|
}
|
|
|
}
|
|
|
ws.mergeCells(0,0,7,0);
|
|
|
ws.mergeCells(0,1,8,1);
|
|
|
wwb.write();
|
|
|
wwb.close();
|
|
|
} catch (IOException e) {
|
|
|
e.printStackTrace();
|
|
|
if (wwb != null) wwb.close();
|
|
|
throw e;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
|