|
@ -38,6 +38,7 @@ import com.yihu.jw.util.date.DateUtil;
|
|
import com.yihu.jw.util.http.HttpClientUtil;
|
|
import com.yihu.jw.util.http.HttpClientUtil;
|
|
import com.yihu.jw.utils.EntityUtils;
|
|
import com.yihu.jw.utils.EntityUtils;
|
|
import com.yihu.jw.utils.StringUtil;
|
|
import com.yihu.jw.utils.StringUtil;
|
|
|
|
import com.yihu.jw.utils.YkyySMSService;
|
|
import com.yihu.jw.utils.hibernate.HibenateUtils;
|
|
import com.yihu.jw.utils.hibernate.HibenateUtils;
|
|
import com.yihu.utils.network.HttpResponse;
|
|
import com.yihu.utils.network.HttpResponse;
|
|
import com.yihu.utils.network.HttpUtils;
|
|
import com.yihu.utils.network.HttpUtils;
|
|
@ -150,6 +151,8 @@ public class YkyyEntranceService {
|
|
private FileUploadService fileUploadService;
|
|
private FileUploadService fileUploadService;
|
|
@Autowired
|
|
@Autowired
|
|
private BaseNatAppointmentDao baseNatAppointmentDao;
|
|
private BaseNatAppointmentDao baseNatAppointmentDao;
|
|
|
|
@Autowired
|
|
|
|
private YkyySMSService ykyySMSService;
|
|
|
|
|
|
|
|
|
|
public List<Map<String, Object>> createSQLQuery(String sql, Map<String, Object> params, Integer page, Integer size){
|
|
public List<Map<String, Object>> createSQLQuery(String sql, Map<String, Object> params, Integer page, Integer size){
|
|
@ -1581,6 +1584,121 @@ public class YkyyEntranceService {
|
|
|
|
|
|
return array;
|
|
return array;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 获取his病人信息--身份证/卡号
|
|
|
|
* @param ssc
|
|
|
|
* @return
|
|
|
|
* @throws Exception
|
|
|
|
*/
|
|
|
|
public JSONArray findHisPatientBySscAndIdcard(String ssc,String idcard,boolean demoFlag) throws Exception {
|
|
|
|
String sql = "SELECT\n" +
|
|
|
|
"\tx.brid AS \"brid\",\n" +
|
|
|
|
"\tx.mzhm AS \"mzhm\",\n" +
|
|
|
|
"\tx.brxm AS \"brxm\",\n" +
|
|
|
|
"\tx.sfzh AS \"sfzh\",\n" +
|
|
|
|
"\tx.brxz AS \"brxz\",\n" +
|
|
|
|
"\tx.brxb AS \"brxb\",\n" +
|
|
|
|
"\tx.csny as \"csny\",\n" +
|
|
|
|
"\tx.jzkh AS \"jzkh\",\n" +
|
|
|
|
"\tx.jdsj AS \"jdsj\",\n" +
|
|
|
|
"\tx.sjhm AS \"sjhm\",\n" +
|
|
|
|
"\tx.fzxmc AS \"fzxmc\",\n" +
|
|
|
|
"\tx.gzztmc AS \"gzztmc\",\n" +
|
|
|
|
"\tx.lxdz AS \"lxdz\"\n" +
|
|
|
|
"FROM\n" +
|
|
|
|
"\tV_ZKSG_BRCX x\n" +
|
|
|
|
"WHERE\n" +
|
|
|
|
"\tx.jzkh = '"+ssc+"' and x.sfzh ='"+idcard+"'";
|
|
|
|
JSONArray array = new JSONArray();
|
|
|
|
Map<String,Object> params = new HashedMap();
|
|
|
|
params.put("sql",sql);
|
|
|
|
logger.info("idcard:"+sql);
|
|
|
|
if (demoFlag){
|
|
|
|
JSONObject jsonObject = new JSONObject();
|
|
|
|
jsonObject.put("brid","1168517");
|
|
|
|
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","2396501");
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 获取his病人信息
|
|
|
|
* @param idcard
|
|
|
|
* @return
|
|
|
|
* @throws Exception
|
|
|
|
*/
|
|
|
|
public JSONArray findHisPatientByIdCard(String idcard,boolean demoFlag) throws Exception {
|
|
|
|
String sql = "SELECT\n" +
|
|
|
|
"\tx.brid AS \"brid\",\n" +
|
|
|
|
"\tx.mzhm AS \"mzhm\",\n" +
|
|
|
|
"\tx.brxm AS \"brxm\",\n" +
|
|
|
|
"\tx.sfzh AS \"sfzh\",\n" +
|
|
|
|
"\tx.brxz AS \"brxz\",\n" +
|
|
|
|
"\tx.brxb AS \"brxb\",\n" +
|
|
|
|
"\tx.csny as \"csny\",\n" +
|
|
|
|
"\tx.jzkh AS \"jzkh\",\n" +
|
|
|
|
"\tx.jdsj AS \"jdsj\",\n" +
|
|
|
|
"\tx.sjhm AS \"sjhm\",\n" +
|
|
|
|
"\tx.fzxmc AS \"fzxmc\",\n" +
|
|
|
|
"\tx.gzztmc AS \"gzztmc\",\n" +
|
|
|
|
"\tx.lxdz AS \"lxdz\"\n" +
|
|
|
|
"FROM\n" +
|
|
|
|
"\tV_ZKSG_BRCX x\n" +
|
|
|
|
"WHERE\n" +
|
|
|
|
"\tx.sfzh = '"+idcard+"' ";
|
|
|
|
JSONArray array = new JSONArray();
|
|
|
|
Map<String,Object> params = new HashedMap();
|
|
|
|
params.put("sql",sql);
|
|
|
|
logger.info("idcard:"+sql);
|
|
|
|
if (demoFlag){
|
|
|
|
JSONObject jsonObject = new JSONObject();
|
|
|
|
jsonObject.put("brid","1168517");
|
|
|
|
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","2396501");
|
|
|
|
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;
|
|
|
|
}
|
|
/**
|
|
/**
|
|
* 获取his病人信息
|
|
* 获取his病人信息
|
|
* @param medicare
|
|
* @param medicare
|
|
@ -1743,6 +1861,13 @@ public class YkyyEntranceService {
|
|
//同步检查检验
|
|
//同步检查检验
|
|
if(null!=inspectionDOS&&inspectionDOS.size()>0){
|
|
if(null!=inspectionDOS&&inspectionDOS.size()>0){
|
|
synInspect(inspectionDOS);
|
|
synInspect(inspectionDOS);
|
|
|
|
WlyyOutpatientDO wlyyOutpatientDO = outpatientDao.findById(wlyyPrescriptionDO.getOutpatientId());
|
|
|
|
//向患者发送检查提醒短信
|
|
|
|
if (wlyyOutpatientDO!=null){
|
|
|
|
ykyySMSService.sendSmsByTempcode("inspection_remind",wlyyOutpatientDO,null,"");
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@ -1903,6 +2028,7 @@ public class YkyyEntranceService {
|
|
|
|
|
|
//挂号
|
|
//挂号
|
|
Map<String,Object> map = findYkDoctor(natAppointmentDO.getHospitalFlag());
|
|
Map<String,Object> map = findYkDoctor(natAppointmentDO.getHospitalFlag());
|
|
|
|
BasePatientDO patientDO = basePatientDao.findById(natAppointmentDO.getPatientId());
|
|
//PatientMappingDO patientMappingDO = patientMappingDao.findByPatient(natAppointmentDO.getPatientId());
|
|
//PatientMappingDO patientMappingDO = patientMappingDao.findByPatient(natAppointmentDO.getPatientId());
|
|
PatientMedicareCardDO patientMedicareCardDO = patientMedicareCardDao.findByTypeAndPatientCodeAndDel("A_01",natAppointmentDO.getPatientId(),"1");
|
|
PatientMedicareCardDO patientMedicareCardDO = patientMedicareCardDao.findByTypeAndPatientCodeAndDel("A_01",natAppointmentDO.getPatientId(),"1");
|
|
Integer brid= 0;
|
|
Integer brid= 0;
|
|
@ -1910,7 +2036,7 @@ public class YkyyEntranceService {
|
|
Integer GHXH = 0;
|
|
Integer GHXH = 0;
|
|
//挂号明细表HLW_GHMX
|
|
//挂号明细表HLW_GHMX
|
|
HlwGhmxDO hlwGhmxDO = new HlwGhmxDO();
|
|
HlwGhmxDO hlwGhmxDO = new HlwGhmxDO();
|
|
JSONArray jsonArray = findHisPatient(patientMedicareCardDO.getCode(),demoFlag);
|
|
|
|
|
|
JSONArray jsonArray = findHisPatientBySscAndIdcard(patientMedicareCardDO.getCode(),patientDO.getIdcard(),demoFlag);
|
|
if(jsonArray!=null&&jsonArray.size()>0){
|
|
if(jsonArray!=null&&jsonArray.size()>0){
|
|
//获取居民信息
|
|
//获取居民信息
|
|
JSONObject json = jsonArray.getJSONObject(0);
|
|
JSONObject json = jsonArray.getJSONObject(0);
|
|
@ -2070,11 +2196,16 @@ public class YkyyEntranceService {
|
|
YkEmrJcsqDO ykEmrJcsqDO = new YkEmrJcsqDO();
|
|
YkEmrJcsqDO ykEmrJcsqDO = new YkEmrJcsqDO();
|
|
ykEmrJcsqDO.setJzxh(jzxh);
|
|
ykEmrJcsqDO.setJzxh(jzxh);
|
|
ykEmrJcsqDO.setXmid(Integer.valueOf("12220"));
|
|
ykEmrJcsqDO.setXmid(Integer.valueOf("12220"));
|
|
JSONArray jsonArray1 = this.findZlxm(null, "12220");
|
|
|
|
String deptNo = null;
|
|
String deptNo = null;
|
|
|
|
/*JSONArray jsonArray1 = this.findZlxm(null, "12220");
|
|
if (jsonArray1 != null && jsonArray1.size() > 0) {
|
|
if (jsonArray1 != null && jsonArray1.size() > 0) {
|
|
JSONObject deptobject = jsonArray1.getJSONObject(0);
|
|
JSONObject deptobject = jsonArray1.getJSONObject(0);
|
|
deptNo = deptobject.getString("dept");
|
|
deptNo = deptobject.getString("dept");
|
|
|
|
}*/
|
|
|
|
if ("3".equalsIgnoreCase(natAppointmentDO.getHospitalFlag())){
|
|
|
|
deptNo = "96";
|
|
|
|
}else {
|
|
|
|
deptNo="1111";
|
|
}
|
|
}
|
|
ykEmrJcsqDO.setZxks(deptNo == null ? 0 : Integer.parseInt(deptNo));
|
|
ykEmrJcsqDO.setZxks(deptNo == null ? 0 : Integer.parseInt(deptNo));
|
|
ykEmrJcsqDO.setJcxm("新冠病毒核酸检测");
|
|
ykEmrJcsqDO.setJcxm("新冠病毒核酸检测");
|
|
@ -2092,7 +2223,7 @@ public class YkyyEntranceService {
|
|
Integer kdks = 0;
|
|
Integer kdks = 0;
|
|
/*Integer brid=0;*/
|
|
/*Integer brid=0;*/
|
|
String mzhm="0";
|
|
String mzhm="0";
|
|
JSONArray jsonArray3 = findHisPatient(patientMedicareCardDO.getCode(),demoFlag);
|
|
|
|
|
|
JSONArray jsonArray3 = findHisPatientBySscAndIdcard(patientMedicareCardDO.getCode(),patientDO.getIdcard(),demoFlag);
|
|
Map<String,Object> resultMap = new HashMap();
|
|
Map<String,Object> resultMap = new HashMap();
|
|
if(jsonArray3!=null&&jsonArray3.size()>0){
|
|
if(jsonArray3!=null&&jsonArray3.size()>0){
|
|
//获取居民信息
|
|
//获取居民信息
|
|
@ -2138,6 +2269,8 @@ public class YkyyEntranceService {
|
|
String yjxh = object.getString("yjxh");
|
|
String yjxh = object.getString("yjxh");
|
|
natAppointmentDO.setRealOrder(yjxh);
|
|
natAppointmentDO.setRealOrder(yjxh);
|
|
natAppointmentDO.setIsSuccess("1");
|
|
natAppointmentDO.setIsSuccess("1");
|
|
|
|
natAppointmentDO.setDoctorId(map.get("doctorCode").toString());
|
|
|
|
natAppointmentDO.setDoctorName(map.get("doctorName").toString());
|
|
baseNatAppointmentDao.save(natAppointmentDO);
|
|
baseNatAppointmentDao.save(natAppointmentDO);
|
|
}else {
|
|
}else {
|
|
}
|
|
}
|
|
@ -2204,7 +2337,7 @@ public class YkyyEntranceService {
|
|
hlwGhmxDO.setYSDM(doctorMappingDO.getMappingCode());//医生代码
|
|
hlwGhmxDO.setYSDM(doctorMappingDO.getMappingCode());//医生代码
|
|
hlwGhmxDO.setJZYS(doctorMappingDO.getMappingCode());//接诊医生
|
|
hlwGhmxDO.setJZYS(doctorMappingDO.getMappingCode());//接诊医生
|
|
//病人性质
|
|
//病人性质
|
|
JSONArray jsonArray = findHisPatient(patientMedicareCardDO.getCode(),demoFlag);
|
|
|
|
|
|
JSONArray jsonArray = findHisPatientBySscAndIdcard(patientMedicareCardDO.getCode(),patientDO.getIdcard(),demoFlag);
|
|
if(jsonArray!=null&&jsonArray.size()>0){
|
|
if(jsonArray!=null&&jsonArray.size()>0){
|
|
//获取居民信息
|
|
//获取居民信息
|
|
JSONObject json = jsonArray.getJSONObject(0);
|
|
JSONObject json = jsonArray.getJSONObject(0);
|
|
@ -2680,7 +2813,7 @@ public class YkyyEntranceService {
|
|
String sql = "select t.ztmc as\"ztmc\",t.ztid as\"ztid\"," +
|
|
String sql = "select t.ztmc as\"ztmc\",t.ztid as\"ztid\"," +
|
|
"t.gslb as\"gslb\",t.gsdm as\"gsdm\"," +
|
|
"t.gslb as\"gslb\",t.gsdm as\"gsdm\"," +
|
|
"t.pydm as\"pydm\",t.Mzsy as\"Mzsy\"" +
|
|
"t.pydm as\"pydm\",t.Mzsy as\"Mzsy\"" +
|
|
"from portal_his.emr_yzzt@ykzxtest t where 1=1";
|
|
|
|
|
|
"from portal_his.emr_yzzt@xec_link t where 1=1";
|
|
if(StringUtils.isNotEmpty(gslb)){
|
|
if(StringUtils.isNotEmpty(gslb)){
|
|
sql+=" and t.gslb = "+Integer.valueOf(gslb);
|
|
sql+=" and t.gslb = "+Integer.valueOf(gslb);
|
|
}
|
|
}
|
|
@ -2704,7 +2837,7 @@ public class YkyyEntranceService {
|
|
public JSONArray findZtmxByid(String ztId) throws Exception{
|
|
public JSONArray findZtmxByid(String ztId) throws Exception{
|
|
String sql = "select t.ztid as \"ztid\",t.xmdm as \"code\"," +
|
|
String sql = "select t.ztid as \"ztid\",t.xmdm as \"code\"," +
|
|
"t.xmmc as \"name\",t.mrsl as \"quantity\",t.zxks as \"dept\"" +
|
|
"t.xmmc as \"name\",t.mrsl as \"quantity\",t.zxks as \"dept\"" +
|
|
"from portal_his.emr_ztmx@ykzxtest t where 1=1";
|
|
|
|
|
|
"from portal_his.emr_ztmx@xec_link t where 1=1";
|
|
if (StringUtils.isNotEmpty(ztId)){
|
|
if (StringUtils.isNotEmpty(ztId)){
|
|
sql += " and t.ztid = '"+ztId+"'";
|
|
sql += " and t.ztid = '"+ztId+"'";
|
|
}
|
|
}
|
|
@ -2797,6 +2930,7 @@ public class YkyyEntranceService {
|
|
}
|
|
}
|
|
//门诊开单操作
|
|
//门诊开单操作
|
|
public Map<String,Object> outPatientOrder(List<YkEmrJcsqDO> surveys,Boolean demoFlag,String doctor,String patient) throws Exception{
|
|
public Map<String,Object> outPatientOrder(List<YkEmrJcsqDO> surveys,Boolean demoFlag,String doctor,String patient) throws Exception{
|
|
|
|
BasePatientDO patientDO = basePatientDao.findById(patient);
|
|
DoctorMappingDO doctorMappingDO = new DoctorMappingDO();
|
|
DoctorMappingDO doctorMappingDO = new DoctorMappingDO();
|
|
if (StringUtils.isNoneBlank(doctor)){
|
|
if (StringUtils.isNoneBlank(doctor)){
|
|
doctorMappingDO = doctorMappingDao.findByDoctor(doctor);
|
|
doctorMappingDO = doctorMappingDao.findByDoctor(doctor);
|
|
@ -2810,7 +2944,7 @@ public class YkyyEntranceService {
|
|
String doctorHis="";
|
|
String doctorHis="";
|
|
Integer kdks = 0;
|
|
Integer kdks = 0;
|
|
Integer brid=0;
|
|
Integer brid=0;
|
|
JSONArray jsonArray = findHisPatient(patientMedicareCardDO.getCode(),demoFlag);
|
|
|
|
|
|
JSONArray jsonArray = findHisPatientBySscAndIdcard(patientMedicareCardDO.getCode(),patientDO.getIdcard(),demoFlag);
|
|
Map<String,Object> resultMap = new HashMap();
|
|
Map<String,Object> resultMap = new HashMap();
|
|
if(jsonArray!=null&&jsonArray.size()>0){
|
|
if(jsonArray!=null&&jsonArray.size()>0){
|
|
//获取居民信息
|
|
//获取居民信息
|
|
@ -2921,6 +3055,7 @@ public class YkyyEntranceService {
|
|
|
|
|
|
|
|
|
|
public String outPatientOrderYk(String jsonDate,Boolean demoFlag,String doctor,String patient) throws Exception{
|
|
public String outPatientOrderYk(String jsonDate,Boolean demoFlag,String doctor,String patient) throws Exception{
|
|
|
|
BasePatientDO patientDO = basePatientDao.findById(patient);
|
|
List<YkEmrJcsqDO> surveys = EntityUtils.jsonToList(jsonDate,YkEmrJcsqDO.class);
|
|
List<YkEmrJcsqDO> surveys = EntityUtils.jsonToList(jsonDate,YkEmrJcsqDO.class);
|
|
DoctorMappingDO doctorMappingDO = new DoctorMappingDO();
|
|
DoctorMappingDO doctorMappingDO = new DoctorMappingDO();
|
|
if (StringUtils.isNotEmpty(doctor)){
|
|
if (StringUtils.isNotEmpty(doctor)){
|
|
@ -2934,7 +3069,7 @@ public class YkyyEntranceService {
|
|
String doctorHis="";
|
|
String doctorHis="";
|
|
Integer kdks = 0;
|
|
Integer kdks = 0;
|
|
Integer brid=0;
|
|
Integer brid=0;
|
|
JSONArray jsonArray = findHisPatient(patientMedicareCardDO.getCode(),demoFlag);
|
|
|
|
|
|
JSONArray jsonArray = findHisPatientBySscAndIdcard(patientMedicareCardDO.getCode(),patientDO.getIdcard(),demoFlag);
|
|
if(jsonArray!=null&&jsonArray.size()>0){
|
|
if(jsonArray!=null&&jsonArray.size()>0){
|
|
//获取居民信息
|
|
//获取居民信息
|
|
JSONObject json = jsonArray.getJSONObject(0);
|
|
JSONObject json = jsonArray.getJSONObject(0);
|
|
@ -3075,7 +3210,7 @@ public class YkyyEntranceService {
|
|
public void updatePatientJd(String patient,String address,String phone,Float zy, boolean demoFlag) throws Exception {
|
|
public void updatePatientJd(String patient,String address,String phone,Float zy, boolean demoFlag) throws Exception {
|
|
BasePatientDO basePatientDO = basePatientDao.findById(patient);
|
|
BasePatientDO basePatientDO = basePatientDao.findById(patient);
|
|
PatientMedicareCardDO patientMedicareCardDO = patientMedicareCardDao.findByTypeAndPatientCodeAndDel("A_01",patient,"1");
|
|
PatientMedicareCardDO patientMedicareCardDO = patientMedicareCardDao.findByTypeAndPatientCodeAndDel("A_01",patient,"1");
|
|
JSONArray jsonArray = findHisPatient(patientMedicareCardDO.getCode(),demoFlag);
|
|
|
|
|
|
JSONArray jsonArray = findHisPatientBySscAndIdcard(patientMedicareCardDO.getCode(),basePatientDO.getIdcard(),demoFlag);
|
|
if(jsonArray!=null&&jsonArray.size()>0){
|
|
if(jsonArray!=null&&jsonArray.size()>0){
|
|
//获取居民信息
|
|
//获取居民信息
|
|
JSONObject json = jsonArray.getJSONObject(0);
|
|
JSONObject json = jsonArray.getJSONObject(0);
|
|
@ -3107,6 +3242,9 @@ public class YkyyEntranceService {
|
|
public String updateJzkh(Float brid,String jzkh){
|
|
public String updateJzkh(Float brid,String jzkh){
|
|
return hibenateUtils.updateJzkh(brid,jzkh);
|
|
return hibenateUtils.updateJzkh(brid,jzkh);
|
|
}
|
|
}
|
|
|
|
public String updateSfzh(Float brid,String sfzh){
|
|
|
|
return hibenateUtils.updateSfzh(brid,sfzh);
|
|
|
|
}
|
|
|
|
|
|
public String findInfoBysql(String sql) throws Exception {
|
|
public String findInfoBysql(String sql) throws Exception {
|
|
Map<String,Object> params = new HashedMap();
|
|
Map<String,Object> params = new HashedMap();
|