|
@ -46,6 +46,7 @@ import org.apache.commons.lang3.StringUtils;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.jdbc.core.JdbcTemplate;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
@ -134,7 +135,6 @@ public class YkyyEntranceService {
|
|
|
private YkyyService ykyyService;
|
|
|
|
|
|
|
|
|
|
|
|
public List<Map<String, Object>> createSQLQuery(String sql, Map<String, Object> params, Integer page, Integer size){
|
|
|
return hibenateUtils.createSQLQuery(sql,params,page,size);
|
|
|
}
|
|
@ -395,8 +395,27 @@ public class YkyyEntranceService {
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
//KSSJ,h.BRID,h.BRXM,h.SJHM,h.JZKH,h.SFZH,h.BRXZ,h.YSDM,h.KDYS" +
|
|
|
// ",h.KSDM,h.KSMC,h.ZDMC,h.JZXH
|
|
|
JSONArray jsonArray = new JSONArray();
|
|
|
if (demoFlag){
|
|
|
JSONObject jsonObject = new JSONObject();
|
|
|
jsonObject.put("BRID","402803ff6b4ae7ae016b4b06a498025s6");
|
|
|
jsonObject.put("BRXM","张灵玉");
|
|
|
jsonObject.put("SJHM","8622");
|
|
|
jsonObject.put("SFZH","350529188526051213");
|
|
|
jsonObject.put("BRXZ","普通性质");
|
|
|
jsonObject.put("YSDM","A250545");
|
|
|
jsonObject.put("KDYS","张楚岚");
|
|
|
jsonObject.put("KSDM","062525");
|
|
|
jsonObject.put("KSMC","消化科");
|
|
|
jsonObject.put("ZDMC","消化不良");
|
|
|
jsonObject.put("JZXH","XM1231258225225442GK");
|
|
|
jsonArray.add(jsonObject);
|
|
|
}else {
|
|
|
jsonArray = findV_ZKSG_HZCX_HIS(patientMappingDO.getMappingCode(),conNo,startTime,endTime);
|
|
|
}
|
|
|
//查找眼科数据
|
|
|
JSONArray jsonArray = findV_ZKSG_HZCX_HIS(patientMappingDO.getMappingCode(),conNo,startTime,endTime);
|
|
|
if (jsonArray.size() == 0) {
|
|
|
return null;
|
|
|
}
|
|
@ -1355,7 +1374,7 @@ public class YkyyEntranceService {
|
|
|
* @return
|
|
|
* @throws Exception
|
|
|
*/
|
|
|
public JSONArray findHisPatient(String ssc) throws Exception {
|
|
|
public JSONArray findHisPatient(String ssc,boolean demoFlag) throws Exception {
|
|
|
String sql = "SELECT\n" +
|
|
|
"\tx.brid AS \"brid\",\n" +
|
|
|
"\tx.mzhm AS \"mzhm\",\n" +
|
|
@ -1378,14 +1397,31 @@ public class YkyyEntranceService {
|
|
|
Map<String,Object> params = new HashedMap();
|
|
|
params.put("sql",sql);
|
|
|
logger.info("idcard:"+sql);
|
|
|
HttpResponse response = HttpUtils.doGet(url,params);
|
|
|
String content = response.getContent();
|
|
|
logger.info("response:"+content);
|
|
|
JSONObject rs = JSON.parseObject(content);
|
|
|
Integer status = rs.getInteger("status");
|
|
|
if (status==200){
|
|
|
array = rs.getJSONArray("detailModelList");
|
|
|
if (demoFlag){
|
|
|
JSONObject jsonObject = new JSONObject();
|
|
|
jsonObject.put("BRID","f6ab67115413e4bba1523d6d4c35766a");
|
|
|
jsonObject.put("MZHM","0502452155");
|
|
|
jsonObject.put("BRXM","诸葛青也");
|
|
|
jsonObject.put("SFZH","450521199405092535");
|
|
|
jsonObject.put("BRXZ","一般");
|
|
|
jsonObject.put("BRXB","男");
|
|
|
jsonObject.put("CSNY","1994-05-09");
|
|
|
jsonObject.put("JZKH","DXM25631856");
|
|
|
jsonObject.put("JDSJ","2020-06-28 15:15:35");
|
|
|
jsonObject.put("GZZTMC","一般");
|
|
|
jsonObject.put("LXDZ","厦门市五缘湾");
|
|
|
array.add(jsonObject);
|
|
|
}else {
|
|
|
HttpResponse response = HttpUtils.doGet(url,params);
|
|
|
String content = response.getContent();
|
|
|
logger.info("response:"+content);
|
|
|
JSONObject rs = JSON.parseObject(content);
|
|
|
Integer status = rs.getInteger("status");
|
|
|
if (status==200){
|
|
|
array = rs.getJSONArray("detailModelList");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
return array;
|
|
|
}
|
|
|
|
|
@ -1437,7 +1473,7 @@ public class YkyyEntranceService {
|
|
|
|
|
|
|
|
|
|
|
|
public String findByRealOrder(String code) throws Exception {
|
|
|
public String findByRealOrder(String code,boolean demoFlag) throws Exception {
|
|
|
List<WlyyPrescriptionDO> wlyyPrescriptionDOs = prescriptionDao.findById(code);
|
|
|
if (wlyyPrescriptionDOs!=null&&wlyyPrescriptionDOs.size()!=0){
|
|
|
WlyyPrescriptionDO wlyyPrescriptionDO = wlyyPrescriptionDOs.get(0);
|
|
@ -1452,7 +1488,7 @@ public class YkyyEntranceService {
|
|
|
wlyyPrescriptionInfoVOS.add(prescriptionInfoVO);
|
|
|
}
|
|
|
//诊断
|
|
|
synPrescriptionDiagnosis(prescriptionVO,code);
|
|
|
synPrescriptionDiagnosis(prescriptionVO,code,demoFlag);
|
|
|
|
|
|
prescriptionVO.setInfoVOs(wlyyPrescriptionInfoVOS);
|
|
|
synPrecriptionHis(prescriptionVO,code);
|
|
@ -1564,7 +1600,7 @@ public class YkyyEntranceService {
|
|
|
* 诊断
|
|
|
* @param wlyyPrescriptionVO
|
|
|
*/
|
|
|
public void synPrescriptionDiagnosis(WlyyPrescriptionVO wlyyPrescriptionVO,String code) throws Exception{
|
|
|
public void synPrescriptionDiagnosis(WlyyPrescriptionVO wlyyPrescriptionVO,String code,boolean demoFlag) throws Exception{
|
|
|
String doctor = wlyyPrescriptionVO.getDoctor();
|
|
|
DoctorMappingDO doctorMappingDO = doctorMappingDao.findByDoctor(doctor);
|
|
|
String patient = wlyyPrescriptionVO.getPatientCode();
|
|
@ -1601,7 +1637,7 @@ public class YkyyEntranceService {
|
|
|
hlwGhmxDO.setYSDM(doctorMappingDO.getMappingCode());//医生代码
|
|
|
hlwGhmxDO.setJZYS(doctorMappingDO.getMappingCode());//接诊医生
|
|
|
//病人性质
|
|
|
JSONArray jsonArray = findHisPatient(patientMedicareCardDO.getCode());
|
|
|
JSONArray jsonArray = findHisPatient(patientMedicareCardDO.getCode(),demoFlag);
|
|
|
if(jsonArray!=null&&jsonArray.size()>0){
|
|
|
//获取居民信息
|
|
|
JSONObject json = jsonArray.getJSONObject(0);
|