|
@ -26,11 +26,11 @@ import com.yihu.jw.entity.hospital.family.WlyyPatientFamilyMemberDO;
|
|
|
import com.yihu.jw.entity.hospital.healthCare.YlzMedicalMxDO;
|
|
|
import com.yihu.jw.entity.hospital.healthCare.YlzMedicalRelationDO;
|
|
|
import com.yihu.jw.entity.hospital.healthCare.YlzMedicalRelationInvoiceDO;
|
|
|
import com.yihu.jw.entity.hospital.httplog.WlyyHttpLogDO;
|
|
|
import com.yihu.jw.entity.hospital.mapping.DoctorMappingDO;
|
|
|
import com.yihu.jw.entity.hospital.mapping.PatientMappingDO;
|
|
|
import com.yihu.jw.entity.hospital.prescription.*;
|
|
|
import com.yihu.jw.entity.order.BusinessOrderDO;
|
|
|
import com.yihu.jw.entity.util.StringFStringEncryptConverter;
|
|
|
import com.yihu.jw.hospital.consult.dao.HospitalWaitingRoomDao;
|
|
|
import com.yihu.jw.hospital.dict.WlyyChargeDictDao;
|
|
|
import com.yihu.jw.hospital.dict.WlyyHospitalSysDictDao;
|
|
@ -52,7 +52,6 @@ import com.yihu.jw.patient.dao.BasePatientDao;
|
|
|
import com.yihu.jw.patient.dao.BasePatientMedicareCardDao;
|
|
|
import com.yihu.jw.restmodel.hospital.prescription.WlyyOutpatientVO;
|
|
|
import com.yihu.jw.restmodel.hospital.prescription.WlyyPrescriptionVO;
|
|
|
import com.yihu.jw.rm.base.BaseRequestMapping;
|
|
|
import com.yihu.jw.util.common.IdCardUtil;
|
|
|
import com.yihu.jw.util.date.DateUtil;
|
|
|
import com.yihu.jw.util.http.HttpClientUtil;
|
|
@ -64,13 +63,9 @@ import com.yihu.mysql.query.BaseJpaService;
|
|
|
import com.yihu.utils.network.HttpResponse;
|
|
|
import com.yihu.utils.network.HttpUtils;
|
|
|
import com.yihu.utils.security.MD5;
|
|
|
import jdk.nashorn.internal.ir.IfNode;
|
|
|
import nuonuo.open.sdk.NNOpenSDK;
|
|
|
import org.apache.commons.collections.map.HashedMap;
|
|
|
import org.apache.commons.lang.time.DateUtils;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.apache.http.NameValuePair;
|
|
|
import org.apache.http.message.BasicNameValuePair;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@ -78,7 +73,7 @@ import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
import java.net.URLEncoder;
|
|
|
import java.text.SimpleDateFormat;
|
|
|
import java.util.*;
|
|
|
|
|
|
/**
|
|
@ -152,6 +147,8 @@ public class YkyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
|
|
|
private PrescriptionDao prescriptionDao;
|
|
|
@Autowired
|
|
|
private PrescriptionLogDao prescriptionLogDao;
|
|
|
@Autowired
|
|
|
private PrescriptionEmrDao prescriptionEmrDao;
|
|
|
|
|
|
private final static String saveUrl = "http://192.168.20.55:10023/ykyy/save";
|
|
|
private final static String updateEntityUrl = "http://192.168.20.55:10023/ykyy/update";
|
|
@ -1824,6 +1821,81 @@ public class YkyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
|
|
|
|
|
|
//==========================视力报告结束====================================
|
|
|
|
|
|
/**
|
|
|
* 获取历史病历
|
|
|
* @param patientId
|
|
|
* @param eventNo
|
|
|
* @return
|
|
|
* @throws Exception
|
|
|
*/
|
|
|
public List<Map<String,Object>> selectHistoryEmrFromEntrance(String patientId,String eventNo) throws Exception {
|
|
|
JSONArray jsonArray = new JSONArray();
|
|
|
String sql = "SELECT\n" +
|
|
|
"\to.dept_name AS \"DEPT_NAME\",\n" +
|
|
|
"\tto_char (\n" +
|
|
|
"\t\to.register_date,\n" +
|
|
|
"\t\t'YYYY-MM-DD hh24:mi:ss'\n" +
|
|
|
"\t) AS \"TREAT_DATE_TIME\",\n" +
|
|
|
"\temr.id AS \"OPID\",\n" +
|
|
|
"\to.doctor_name AS \"TREAT_DOCTOR_NAME\"\n" +
|
|
|
"FROM\n" +
|
|
|
"\twlyy_outpatient o\n" +
|
|
|
"LEFT JOIN wlyy_prescription p ON o.id = p.outpatient_id\n" +
|
|
|
"LEFT JOIN wlyy_prescription_emr emr ON emr.prescription_id = p.id\n" +
|
|
|
"where emr.id is not null\n" +
|
|
|
"and o.PATIENT = '"+patientId+"' and emr.html_str is not null ";
|
|
|
sql+=" ORDER BY o.CREATE_TIME DESC ";
|
|
|
|
|
|
List<Map<String,Object>> maps = jdbcTemplate.queryForList(sql);
|
|
|
return maps;
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 查询病历文书html信息
|
|
|
* @param bstrEmrID
|
|
|
* @return
|
|
|
*/
|
|
|
public WlyyPrescriptionEmrDO selectBrowseSingleEMR(String bstrEmrID) throws Exception {
|
|
|
return prescriptionEmrDao.findOne(bstrEmrID);
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 同步门诊病历
|
|
|
* @return
|
|
|
*/
|
|
|
public WlyyPrescriptionEmrDO returnEmrHtmlByHLW(JSONObject jsonObject,WlyyPrescriptionEmrDO prescriptionEmrDO)throws Exception{
|
|
|
String htmlDeo = "";
|
|
|
if (null!=prescriptionEmrDO){
|
|
|
WlyyHospitalSysDictDO wlyyHospitalSysDictDO = hospitalSysDictDao.findById("EMRHTMLDEMO");
|
|
|
if (null!=wlyyHospitalSysDictDO){
|
|
|
htmlDeo = wlyyHospitalSysDictDO.getDictValue();
|
|
|
htmlDeo = replaceHtml(htmlDeo,"@patientName@",jsonObject.getString("patientName"));
|
|
|
htmlDeo = replaceHtml(htmlDeo,"@patientAge@",jsonObject.getString("patientAge"));
|
|
|
htmlDeo = replaceHtml(htmlDeo,"@patientsex@",jsonObject.getString("patientsex"));
|
|
|
htmlDeo = replaceHtml(htmlDeo,"@deptCode@",jsonObject.getString("deptCode"));
|
|
|
htmlDeo = replaceHtml(htmlDeo,"@baseSign@",jsonObject.getString("baseSign"));
|
|
|
htmlDeo = replaceHtml(htmlDeo,"@outpatientCode@",jsonObject.getString("outpatientCode"));
|
|
|
htmlDeo = replaceHtml(htmlDeo,"@patientClan@",jsonObject.getString("patientClan"));
|
|
|
htmlDeo = replaceHtml(htmlDeo,"@Special@",prescriptionEmrDO.getSpecialHistory());
|
|
|
SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
htmlDeo = replaceHtml(htmlDeo,"@createTime@",sf.format(prescriptionEmrDO.getCreateTime()));
|
|
|
htmlDeo = replaceHtml(htmlDeo,"@complaint@",prescriptionEmrDO.getComplaint());
|
|
|
htmlDeo = replaceHtml(htmlDeo,"@diseaseName@",jsonObject.getString("diseaseName"));
|
|
|
htmlDeo = replaceHtml(htmlDeo,"@medicalHistory@",prescriptionEmrDO.getMedicalHistory());
|
|
|
htmlDeo = replaceHtml(htmlDeo,"@popularHistory@",prescriptionEmrDO.getPopularHistory());
|
|
|
htmlDeo = replaceHtml(htmlDeo,"@pastHistory@",prescriptionEmrDO.getPastHistory());
|
|
|
htmlDeo = replaceHtml(htmlDeo,"@allergicHistory@",prescriptionEmrDO.getAllergicHistory());
|
|
|
htmlDeo = replaceHtml(htmlDeo,"@physicalExamination@",prescriptionEmrDO.getPhysicalExamination());
|
|
|
htmlDeo = replaceHtml(htmlDeo,"@assistExamination@",prescriptionEmrDO.getAssistExamination());
|
|
|
}
|
|
|
}
|
|
|
prescriptionEmrDO.setHtmlStr(htmlDeo);
|
|
|
return prescriptionEmrDao.save(prescriptionEmrDO);
|
|
|
}
|
|
|
|
|
|
/* public JSONObject select*/
|
|
|
public String replaceHtml(String demoData,String oldChar,String newChar){
|
|
|
return demoData.replace(oldChar,null==newChar?"无":newChar);
|
|
|
}
|
|
|
}
|