|
@@ -13,10 +13,7 @@ import thyyxxk.webserver.entity.heliyongyao.RationalUsePatient;
|
|
|
import thyyxxk.webserver.entity.zhuyuanyisheng.yizhuluru.XinZhenYiZhu;
|
|
|
import thyyxxk.webserver.service.PublicServer;
|
|
|
import thyyxxk.webserver.service.externalhttp.RationalUseSrvc;
|
|
|
-import thyyxxk.webserver.utils.DateUtil;
|
|
|
-import thyyxxk.webserver.utils.JsonXmlUtils;
|
|
|
-import thyyxxk.webserver.utils.ResultVoUtil;
|
|
|
-import thyyxxk.webserver.utils.TokenUtil;
|
|
|
+import thyyxxk.webserver.utils.*;
|
|
|
|
|
|
import java.util.Date;
|
|
|
import java.util.Map;
|
|
@@ -49,16 +46,18 @@ public class RationalUseServer {
|
|
|
log.info("数据:{}", JSON.toJSONString(param));
|
|
|
String userCode = TokenUtil.getTokenUserId().equals("99999") ? param.getUserCode() : TokenUtil.getTokenUserId();
|
|
|
yiShenXinXi(userCode);
|
|
|
-
|
|
|
+ yaoPinXinXi(param.getInpatientNo(), param.getAdmissTimes());
|
|
|
return ResultVoUtil.success();
|
|
|
}
|
|
|
|
|
|
public String yiShenXinXi(String code) {
|
|
|
Map<String, String> yiShenXinXi = dao.yiShenXinXi(code);
|
|
|
+ if (yiShenXinXi == null || yiShenXinXi.isEmpty()) {
|
|
|
+ return "";
|
|
|
+ }
|
|
|
RationalUseBase base = new RationalUseBase();
|
|
|
base.setDept_code(yiShenXinXi.get("dept_code"));
|
|
|
base.setDept_name(yiShenXinXi.get("dept_name"));
|
|
|
-
|
|
|
// 放入医生信息
|
|
|
RationalUseDoct doct = new RationalUseDoct();
|
|
|
doct.setName(yiShenXinXi.get("name"));
|
|
@@ -68,24 +67,35 @@ public class RationalUseServer {
|
|
|
base.setDoct(doct);
|
|
|
// json 转成 xml
|
|
|
String json = JsonXmlUtils.json2Xml(JSON.toJSONString(base));
|
|
|
-
|
|
|
log.info("医生数据:{}", "<base_xml>" + json + "</base_xml>");
|
|
|
-
|
|
|
return json;
|
|
|
}
|
|
|
|
|
|
- public String huanZheXinXi(String patNo, Integer times) {
|
|
|
+ public String yaoPinXinXi(String patNo, Integer times) {
|
|
|
XinZhenYiZhu patient1 = yiZhuLuRuDao.huoQuHuanZheXinXi(patNo, times);
|
|
|
-
|
|
|
RationalUseDetails details = new RationalUseDetails();
|
|
|
+ // HIS系统时间
|
|
|
details.setHis_time(DateUtil.formatDatetime(new Date()));
|
|
|
+ // 就诊号
|
|
|
details.setTreat_code(patient1.getInpatientNo() + patient1.getAdmissTimes() + DateUtil.formatDatetime(new Date(), "YYYYMMDD"));
|
|
|
+ // 是否过渡重复分析
|
|
|
details.setIs_repeat("0");
|
|
|
+ // 床位号
|
|
|
details.setBed_no(patient1.getBedNo());
|
|
|
|
|
|
RationalUsePatient patient = new RationalUsePatient();
|
|
|
+ try {
|
|
|
+ EntityCopy.Copy(dao.huanZheXinXi(patNo, times), patient);
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ // 患者ID
|
|
|
+ patient.setPati_id(patNo);
|
|
|
+ // 是否婴幼儿
|
|
|
patient.setIs_infant(String.valueOf(publicServer.getInfantFlag(patient1.getInpatientNo())));
|
|
|
-
|
|
|
+ String patientJson = JsonXmlUtils.json2Xml(JSON.toJSONString(patient, JsonXmlUtils.filter));
|
|
|
+ log.info("患者数据:{}", patientJson);
|
|
|
+ details.setPatient(patientJson);
|
|
|
|
|
|
return "";
|
|
|
}
|