|
@ -2255,7 +2255,7 @@ public class YkyyEntranceService {
|
|
|
* @throws Exception
|
|
|
*/
|
|
|
public JSONArray findHisDoctor(String idcard) throws Exception{
|
|
|
String sql ="select y.code AS \"code\",y.ygbh,y.name AS \"name\",y.expertise AS \"expertise\",y.introduce AS \"introduce\",y.mobile AS \"mobile\",y.idCard AS \"idcard\",y.jobtitlecode AS \"jobTitleCode\",y.jobTitleName AS \"jobTitleName\",y.dept AS \"dept\",y.deptName AS \"deptName\" from v_Hlw_Ysxx y where y.idcard ='"+idcard+"'";
|
|
|
String sql ="select y.code AS \"code\",y.ygbh,y.name AS \"name\",y.expertise AS \"expertise\",y.introduce AS \"introduce\",y.mobile AS \"mobile\",y.idCard AS \"idcard\",y.jobtitlecode AS \"jobTitleCode\",y.jobTitleName AS \"jobTitleName\",y.dept AS \"dept\",y.deptName AS \"deptName\",y.ksdm as \"ksdm\" from v_Hlw_Ysxx y where y.idcard ='"+idcard+"'";
|
|
|
JSONArray array = new JSONArray();
|
|
|
Map<String,Object> params = new HashedMap();
|
|
|
params.put("sql",sql);
|
|
@ -2385,6 +2385,16 @@ public class YkyyEntranceService {
|
|
|
hlwGhmxDO.setBRXZ(json.getInteger("brxz"));
|
|
|
brid = json.getInteger("brid");
|
|
|
}
|
|
|
String doctor = map.get("doctorCode").toString();
|
|
|
DoctorMappingDO doctorMappingDO = doctorMappingDao.findByDoctor(doctor);
|
|
|
String ksdm = "";
|
|
|
//操作工号
|
|
|
JSONArray jsonArray1 = findHisDoctor(doctorMappingDO.getIdcard());
|
|
|
if(jsonArray1!=null&&jsonArray1.size()>0){
|
|
|
//获取医生信息
|
|
|
JSONObject json = jsonArray1.getJSONObject(0);
|
|
|
ksdm=json.getString("ksdm");
|
|
|
}
|
|
|
hlwGhmxDO.setSBXH(0);
|
|
|
hlwGhmxDO.setGHCS(1);
|
|
|
hlwGhmxDO.setGHJE(0);
|
|
@ -2403,7 +2413,7 @@ public class YkyyEntranceService {
|
|
|
hlwGhmxDO.setSFFS(0);
|
|
|
hlwGhmxDO.setJZZT(2);
|
|
|
hlwGhmxDO.setJZXH(0);
|
|
|
hlwGhmxDO.setKSDM(map.get("deptCode").toString());
|
|
|
hlwGhmxDO.setKSDM(ksdm);
|
|
|
hlwGhmxDO.setBRID(brid);
|
|
|
hlwGhmxDO.setGHSJ(new Date());//挂号时间
|
|
|
hlwGhmxDO.setGHLB(1);//挂号类别
|
|
@ -2463,7 +2473,7 @@ public class YkyyEntranceService {
|
|
|
hlwYsMzJzLsDO.setJZXH(0);
|
|
|
hlwYsMzJzLsDO.setGHXH(GHXH);
|
|
|
hlwYsMzJzLsDO.setBRBH(brid);
|
|
|
hlwYsMzJzLsDO.setKSDM(Integer.parseInt(map.get("deptCode").toString()));
|
|
|
hlwYsMzJzLsDO.setKSDM(Integer.parseInt(ksdm));
|
|
|
hlwYsMzJzLsDO.setYSDM(map.get("doctorCode").toString());
|
|
|
hlwYsMzJzLsDO.setKSSJ(DateUtil.getNowDate());
|
|
|
hlwYsMzJzLsDO.setJSSJ(DateUtil.getNight23());
|
|
@ -2694,7 +2704,6 @@ public class YkyyEntranceService {
|
|
|
hlwGhmxDO.setSFFS(0);
|
|
|
hlwGhmxDO.setJZZT(2);
|
|
|
hlwGhmxDO.setJZXH(0);
|
|
|
hlwGhmxDO.setKSDM(wlyyPrescriptionVO.getDept());
|
|
|
hlwGhmxDO.setBRID(Integer.parseInt(patientMappingDO.getMappingCode()));
|
|
|
hlwGhmxDO.setGHSJ(new Date());//挂号时间
|
|
|
hlwGhmxDO.setGHLB(1);//挂号类别
|
|
@ -2709,12 +2718,16 @@ public class YkyyEntranceService {
|
|
|
}else {
|
|
|
throw new Exception("患者信息有误!");
|
|
|
}
|
|
|
String ksdm = "";
|
|
|
//操作工号
|
|
|
JSONArray jsonArray1 = findHisDoctor(doctorMappingDO.getIdcard());
|
|
|
if(jsonArray1!=null&&jsonArray1.size()>0){
|
|
|
//获取医生信息
|
|
|
JSONObject json = jsonArray1.getJSONObject(0);
|
|
|
hlwGhmxDO.setCZGH(json.getString("YGBH"));
|
|
|
hlwGhmxDO.setKSDM(json.getString("ksdm"));
|
|
|
ksdm=json.getString("ksdm");
|
|
|
/* hlwGhmxDO.set*/
|
|
|
}
|
|
|
|
|
|
// 同一个医生同一个病人,一天一条挂号记录。
|
|
@ -2781,7 +2794,7 @@ public class YkyyEntranceService {
|
|
|
hlwYsMzJzLsDO.setJZXH(0);
|
|
|
hlwYsMzJzLsDO.setGHXH(GHXH);
|
|
|
hlwYsMzJzLsDO.setBRBH(Integer.parseInt(patientMappingDO.getMappingCode()));
|
|
|
hlwYsMzJzLsDO.setKSDM(Integer.parseInt(wlyyPrescriptionVO.getDept()));
|
|
|
hlwYsMzJzLsDO.setKSDM(Integer.parseInt(ksdm));
|
|
|
hlwYsMzJzLsDO.setYSDM(doctorMappingDO.getMappingCode());
|
|
|
hlwYsMzJzLsDO.setKSSJ(DateUtil.strToDate(DateUtil.dateToStr(wlyyPrescriptionVO.getCreateTime(),"yyyy-MM-dd HH:mm:ss")));
|
|
|
hlwYsMzJzLsDO.setJSSJ(DateUtil.getNight23());
|
|
@ -2884,13 +2897,23 @@ public class YkyyEntranceService {
|
|
|
logger.info("开始===================");
|
|
|
if (wlyyPrescriptionVO!=null&&wlyyPrescriptionVO.getInfoVOs()!=null){
|
|
|
try {
|
|
|
String doctor = wlyyPrescriptionVO.getDoctor();
|
|
|
DoctorMappingDO doctorMappingDO = doctorMappingDao.findByDoctor(doctor);
|
|
|
String ksdm = "";
|
|
|
//操作工号
|
|
|
JSONArray jsonArray1 = findHisDoctor(doctorMappingDO.getIdcard());
|
|
|
if(jsonArray1!=null&&jsonArray1.size()>0){
|
|
|
//获取医生信息
|
|
|
JSONObject json = jsonArray1.getJSONObject(0);
|
|
|
ksdm=json.getString("ksdm");
|
|
|
}
|
|
|
|
|
|
hlwCf01DO.setSPZT(0);
|
|
|
hlwCf01DO.setFKZT(wlyyPrescriptionVO.getPayStatus());
|
|
|
if (StringUtils.isNoneBlank(drugCode)){
|
|
|
Integer yfsb = Integer.parseInt(drugCode);
|
|
|
hlwCf01DO.setYFSB(yfsb);
|
|
|
}
|
|
|
|
|
|
hlwCf01DO.setCFLX(wlyyPrescriptionVO.getType());
|
|
|
hlwCf01DO.setKFRQ(DateUtil.strToDate(DateUtil.dateToStr(wlyyPrescriptionVO.getCreateTime(),"yyyy-MM-dd HH:mm:ss")));
|
|
|
hlwCf01DO.setZFPB(0);
|
|
@ -2919,9 +2942,7 @@ public class YkyyEntranceService {
|
|
|
}
|
|
|
hlwCf01DO.setBRID(Integer.parseInt(patientMappingDO.getMappingCode()));
|
|
|
hlwCf01DO.setBRXM(wlyyPrescriptionVO.getPatientName());
|
|
|
hlwCf01DO.setKSDM(Integer.parseInt(wlyyPrescriptionVO.getDept()));
|
|
|
String doctor = wlyyPrescriptionVO.getDoctor();
|
|
|
DoctorMappingDO doctorMappingDO = doctorMappingDao.findByDoctor(doctor);
|
|
|
hlwCf01DO.setKSDM(Integer.parseInt(ksdm));
|
|
|
hlwCf01DO.setYSDM(doctorMappingDO.getMappingCode());
|
|
|
hlwCf01DO.setJZKH(wlyyPrescriptionVO.getSsc());
|
|
|
hlwCf01DO.setGUID(getCode());
|
|
@ -3364,7 +3385,7 @@ public class YkyyEntranceService {
|
|
|
if(jsonArray1!=null&&jsonArray1.size()>0){
|
|
|
JSONObject json = jsonArray1.getJSONObject(0);
|
|
|
doctorHis=json.getString("code");
|
|
|
kdks = Integer.parseInt(json.getString("dept"));
|
|
|
kdks = Integer.parseInt(json.getString("ksdm"));
|
|
|
}
|
|
|
if (surveys!=null){
|
|
|
for (YkEmrJcsqDO ykEmrJcsqDO:surveys){
|