|
@ -21,6 +21,7 @@ import com.yihu.jw.entity.base.score.BaseEvaluateScoreDO;
|
|
|
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.hospital.survey.WlyySurveyQuestionDO;
|
|
|
import com.yihu.jw.evaluate.score.dao.BaseEvaluateDao;
|
|
|
import com.yihu.jw.evaluate.score.dao.BaseEvaluateScoreDao;
|
|
|
import com.yihu.jw.hospital.dict.YkDictIcd10Dao;
|
|
@ -37,6 +38,7 @@ import com.yihu.jw.restmodel.hospital.prescription.*;
|
|
|
import com.yihu.jw.util.common.IdCardUtil;
|
|
|
import com.yihu.jw.util.date.DateUtil;
|
|
|
import com.yihu.jw.util.http.HttpClientUtil;
|
|
|
import com.yihu.jw.utils.EntityUtils;
|
|
|
import com.yihu.jw.utils.StringUtil;
|
|
|
import com.yihu.jw.utils.hibernate.HibenateUtils;
|
|
|
import com.yihu.utils.network.HttpResponse;
|
|
@ -69,6 +71,7 @@ public class YkyyEntranceService {
|
|
|
// private final static String url="http://localhost:10023/ykyy/createSQLQuery";
|
|
|
|
|
|
private final static String saveUrl="http://192.168.20.55:10023/ykyy/save";
|
|
|
private final static String orderUrl="http://192.168.20.55:10023/ykyy/outPatientOrder";
|
|
|
|
|
|
private final static String updateUrl="http://192.168.20.55:10023/ykyy/updateBySql";
|
|
|
|
|
@ -1312,7 +1315,7 @@ public class YkyyEntranceService {
|
|
|
* @param kusl
|
|
|
* @return
|
|
|
*/
|
|
|
public JSONArray findYkYpxx(String ypdm,String ypmc,String kusl,String pydm) throws Exception {
|
|
|
public JSONArray findYkYpxx(String ypdm,String ypmc,String kusl,String pydm ,String hisCode) throws Exception {
|
|
|
String sql ="SELECT yp.ypxh AS \"ypxh\", yp.ypdm AS \"ypdm\", yp.ypmc AS \"ypmc\", yp.yfgg AS \"yfgg\"," +
|
|
|
"yp.yfdw AS \"yfdw\"," +
|
|
|
"yp.yfbz AS \"yfbz\"," +
|
|
@ -1332,7 +1335,8 @@ public class YkyyEntranceService {
|
|
|
"yp.ydyp AS \"ydyp\"," +
|
|
|
"yp.ypmc2 AS \"ypmc2\"," +
|
|
|
"yp.gyffmc as \"gyffmc\"," +
|
|
|
"yp.pzwh as \"pzwh\""+ " FROM " +
|
|
|
"yp.pzwh as \"pzwh\","+
|
|
|
"yp.yfsb as \"yfsb\""+" FROM " +
|
|
|
"V_ZKSG_MZ_YPXX yp where 1=1 ";
|
|
|
if (StringUtils.isNoneBlank(ypdm)){
|
|
|
sql+=" and lower(yp.ypdm) like '%"+ypdm.toLowerCase()+"%' ";
|
|
@ -1347,6 +1351,9 @@ public class YkyyEntranceService {
|
|
|
if (StringUtils.isNoneBlank(pydm)){
|
|
|
sql+=" and lower(yp.pydm) like '%"+pydm.toLowerCase()+"%' ";
|
|
|
}
|
|
|
if (StringUtils.isNoneBlank(hisCode)){
|
|
|
sql+=" and lower(yp.yfsb) like '%"+hisCode.toLowerCase()+"%' ";
|
|
|
}
|
|
|
JSONArray array = new JSONArray();
|
|
|
Map<String,Object> params = new HashedMap();
|
|
|
params.put("sql",sql);
|
|
@ -2207,6 +2214,149 @@ public class YkyyEntranceService {
|
|
|
return "推送成功";
|
|
|
}
|
|
|
}
|
|
|
//查询组套项目
|
|
|
public JSONObject findYzztByGslb(String gslb) throws Exception {
|
|
|
String sql = "select t.ztmc as\"ztmc\",t.ztid as\"ztid\"," +
|
|
|
"t.gslb as\"gslb\",t.gsdm as\"gsdm\"," +
|
|
|
"t.pydm as\"pydm\",t.Mzsy as\"Mzsy\"" +
|
|
|
"from portal_his.emr_yzzt@ykzxtest t where 1=1";
|
|
|
if(StringUtils.isNotEmpty(gslb)){
|
|
|
sql+=" and t.gslb = "+Integer.valueOf(gslb);
|
|
|
}
|
|
|
Map<String,Object> params = new HashedMap();
|
|
|
params.put("sql",sql);
|
|
|
logger.info("findYzztByGslb:"+sql);
|
|
|
HttpResponse response = HttpUtils.doGet(jdbcUrl,params);
|
|
|
String content = response.getContent();
|
|
|
logger.info("response:"+content);
|
|
|
JSONObject rs = JSON.parseObject(content);
|
|
|
Integer status = rs.getInteger("status");
|
|
|
if (status!=null&&status == 200){
|
|
|
return rs;
|
|
|
}else {
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
}
|
|
|
//根据组套项目id查询组套明细
|
|
|
public JSONObject findZtmxByid(String ztId) throws Exception{
|
|
|
String sql = "select t.ztid as \"ztid\",t.xmdm as \"xmdm\"," +
|
|
|
"t.xmmc as \"xmmc\",t.mrsl as \"mrsl\",t.zxks as \"zxks\"" +
|
|
|
"from portal_his.emr_ztmx@ykzxtest t where 1=1";
|
|
|
if (StringUtils.isNotEmpty(ztId)){
|
|
|
sql += " and t.ztid = '"+ztId+"'";
|
|
|
}
|
|
|
Map<String,Object> params = new HashedMap();
|
|
|
params.put("sql",sql);
|
|
|
logger.info("findZtmxByid:"+sql);
|
|
|
HttpResponse response = HttpUtils.doGet(jdbcUrl,params);
|
|
|
String content = response.getContent();
|
|
|
logger.info("response:"+content);
|
|
|
JSONObject rs = JSON.parseObject(content);
|
|
|
Integer status = rs.getInteger("status");
|
|
|
if (status!=null&&status == 200){
|
|
|
return rs;
|
|
|
}else {
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
}
|
|
|
//查询诊疗项目视图
|
|
|
public JSONObject findZlxm(String itemName) throws Exception{
|
|
|
String sql = "select t.item_code as \"itemCode\",t.item_name as \"itemName\"," +
|
|
|
"t.price as \"price\",t.total_unit as \"totalUnit\"," +
|
|
|
"t. from VEMR_ORDER_ITEM t where 1=1";
|
|
|
if (StringUtils.isNotEmpty(itemName)){
|
|
|
sql+=" and t.ITEM_NAME like '%"+itemName+"%'";
|
|
|
}
|
|
|
Map<String,Object> params = new HashedMap();
|
|
|
params.put("sql",sql);
|
|
|
logger.info("findZlxm:"+sql);
|
|
|
HttpResponse response = HttpUtils.doGet(jdbcUrl,params);
|
|
|
String content = response.getContent();
|
|
|
logger.info("response:"+content);
|
|
|
JSONObject rs = JSON.parseObject(content);
|
|
|
Integer status = rs.getInteger("status");
|
|
|
if (status!=null&&status == 200){
|
|
|
return rs;
|
|
|
}else {
|
|
|
return null;
|
|
|
}
|
|
|
}
|
|
|
//查询诊疗项目明细视图
|
|
|
public JSONObject findZlxmMx(String zlxmId) throws Exception{
|
|
|
String sql = "select t.zlxmid as \"zlxmid\",t.fyxh as \"fyxh\",t.fysl \"fysl\"" +
|
|
|
" from VEMR_ORDER_ITEM_MX t where 1=1";
|
|
|
if (StringUtils.isNotEmpty(zlxmId)){
|
|
|
sql+=" and t.item_name like '%"+zlxmId+"%'";
|
|
|
}
|
|
|
Map<String,Object> params = new HashedMap();
|
|
|
params.put("sql",sql);
|
|
|
logger.info("findZlxmMx:"+sql);
|
|
|
HttpResponse response = HttpUtils.doGet(jdbcUrl,params);
|
|
|
String content = response.getContent();
|
|
|
logger.info("response:"+content);
|
|
|
JSONObject rs = JSON.parseObject(content);
|
|
|
Integer status = rs.getInteger("status");
|
|
|
if (status!=null&&status == 200){
|
|
|
return rs;
|
|
|
}else {
|
|
|
return null;
|
|
|
}
|
|
|
}
|
|
|
//his.gy_ylsf明细查询
|
|
|
public JSONObject findGyYlsf(String fyxh) throws Exception{
|
|
|
String sql = "select t.xmlx as \"xmlx\",t.fydj as \"fydj\",t.fygb as \"fygb\"" +
|
|
|
"from portal_his.GY_YLSF@ykzxtest t where 1=1";
|
|
|
if (StringUtils.isNotEmpty(fyxh)){
|
|
|
sql+=" and t.fyxh = '"+fyxh+"'";
|
|
|
}
|
|
|
Map<String,Object> params = new HashedMap();
|
|
|
params.put("sql",sql);
|
|
|
logger.info("findZlxmMx:"+sql);
|
|
|
HttpResponse response = HttpUtils.doGet(jdbcUrl,params);
|
|
|
String content = response.getContent();
|
|
|
logger.info("response:"+content);
|
|
|
JSONObject rs = JSON.parseObject(content);
|
|
|
Integer status = rs.getInteger("status");
|
|
|
if (status!=null&&status == 200){
|
|
|
return rs;
|
|
|
}else {
|
|
|
return null;
|
|
|
}
|
|
|
}
|
|
|
//门诊开单操作
|
|
|
public String outPatientOrder(String jsonDate) throws Exception{
|
|
|
List<YkEmrJcsqDO> surveys = EntityUtils.jsonToList(jsonDate, YkEmrJcsqDO.class);
|
|
|
if (surveys!=null){
|
|
|
for (YkEmrJcsqDO ykEmrJcsqDO:surveys){
|
|
|
ykEmrJcsqDO.setJjbc(0);
|
|
|
ykEmrJcsqDO.setJczt(1);
|
|
|
ykEmrJcsqDO.setZfpb(0);
|
|
|
ykEmrJcsqDO.setQxbz(0);
|
|
|
}
|
|
|
String jsonString = JSONObject.toJSONString(surveys);
|
|
|
Map<String,Object> params = new HashedMap();
|
|
|
params.put("json",jsonString);
|
|
|
params.put("table","ykEmrJcsqDO");
|
|
|
logger.info("ykEmrJcsqDO:"+jsonString);
|
|
|
HttpResponse response = HttpUtils.doGet(orderUrl,params);
|
|
|
String content = response.getContent();
|
|
|
logger.info("response:"+content);
|
|
|
JSONObject rs = JSON.parseObject(content);
|
|
|
Integer status = rs.getInteger("status");
|
|
|
if (status!=null&&status == 200){
|
|
|
return rs.toString();
|
|
|
}else {
|
|
|
return "failed";
|
|
|
}
|
|
|
|
|
|
}else {
|
|
|
return "failed";
|
|
|
}
|
|
|
|
|
|
}
|
|
|
/*//查询检查单
|
|
|
public JSONObject findOrderBy*/
|
|
|
|
|
|
}
|