|
@@ -80,11 +80,10 @@ public class RationalUseServer {
|
|
|
Map<String, String> doctMap = doctorInfo(userCode);
|
|
|
String baseXml = doctMap.get("baseXml");
|
|
|
String doctXml = doctMap.get("doct");
|
|
|
- List<XinZhenYzActOrder> yp = new ArrayList<>();
|
|
|
QueryWrapper<?> qw = new QueryWrapper<>();
|
|
|
List<String> drugList = new ArrayList<>();
|
|
|
- addTheDrugCode(param.getList(), yp, drugList);
|
|
|
- addTheDrugCode(historicalData, yp, drugList);
|
|
|
+ addTheDrugCode(param.getList(), drugList);
|
|
|
+ addTheDrugCode(historicalData, drugList);
|
|
|
|
|
|
if (ListUtil.isBlank(drugList)) {
|
|
|
return new JSONObject();
|
|
@@ -93,7 +92,7 @@ public class RationalUseServer {
|
|
|
Map<String, YaoPin> drugMap = dao.selectDrug(qw).stream().collect(
|
|
|
Collectors.toMap(YaoPin::getId, a -> a, (k1, k2) -> k1)
|
|
|
);
|
|
|
- String detailsXml = drugInfoFunc(param.getInpatientNo(), param.getAdmissTimes(), yp, doctXml, drugMap, historicalData);
|
|
|
+ String detailsXml = drugInfoFunc(param.getInpatientNo(), param.getAdmissTimes(), param.getList(), doctXml, drugMap, historicalData);
|
|
|
String js = String.format("{\"BaseXml\": \"%s\", \"DetailsXml\" : \"%s\"}", baseXml, detailsXml);
|
|
|
log.info("js:{}", js);
|
|
|
return http.rationalUse(js);
|
|
@@ -106,15 +105,12 @@ public class RationalUseServer {
|
|
|
* @param yp
|
|
|
* @param drugList
|
|
|
*/
|
|
|
- private static void addTheDrugCode(List<XinZhenYzActOrder> list, List<XinZhenYzActOrder> yp, List<String> drugList) {
|
|
|
+ private static void addTheDrugCode(List<XinZhenYzActOrder> list, List<String> drugList) {
|
|
|
for (XinZhenYzActOrder item : list) {
|
|
|
if (StringUtil.notBlank(item.getSerial())) {
|
|
|
- if (!"00".equals(item.getSerial())) {
|
|
|
- yp.add(item);
|
|
|
- String key = item.getOrderCode().trim() + item.getSerial().trim();
|
|
|
- if (!drugList.contains(key)) {
|
|
|
- drugList.add(key);
|
|
|
- }
|
|
|
+ String key = item.getOrderCode().trim() + item.getSerial().trim();
|
|
|
+ if (!drugList.contains(key)) {
|
|
|
+ drugList.add(key);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -252,23 +248,23 @@ public class RationalUseServer {
|
|
|
sb.append("</diagnose_data>")
|
|
|
.append("</patient>");
|
|
|
sb.append("<prescription_data>");
|
|
|
+ sb.append("<prescription>").append("<id>").append("0").append("</id>")
|
|
|
+ .append("<reason>").append("</reason>")
|
|
|
+ .append("<is_current>").append(1).append("</is_current>")
|
|
|
+ .append("<pres_type>").append("</pres_type>")
|
|
|
+ .append("<pres_time>").append(DateUtil.formatDatetime(new Date())).append("</pres_time>")
|
|
|
+ // 药品信息节点,可循环
|
|
|
+ .append("<medicine_data>");
|
|
|
// 循环处方节点
|
|
|
prescribingInformation(drugData, doct, drugMap, sb, 1);
|
|
|
prescribingInformation(historicalData, doct, drugMap, sb, 0);
|
|
|
-
|
|
|
+ sb.append("</medicine_data></prescription>");
|
|
|
sb.append("</prescription_data></details_xml>");
|
|
|
return sb.toString();
|
|
|
}
|
|
|
|
|
|
private void prescribingInformation(List<XinZhenYzActOrder> drugData, String doct, Map<String, YaoPin> drugMap, StringBuilder sb,
|
|
|
int current) {
|
|
|
- sb.append("<prescription>").append("<id>").append("0").append("</id>")
|
|
|
- .append("<reason>").append("</reason>")
|
|
|
- .append("<is_current>").append(current).append("</is_current>")
|
|
|
- .append("<pres_type>").append("</pres_type>")
|
|
|
- .append("<pres_time>").append(DateUtil.formatDatetime(new Date())).append("</pres_time>")
|
|
|
- // 药品信息节点,可循环
|
|
|
- .append("<medicine_data>");
|
|
|
for (XinZhenYzActOrder item : drugData) {
|
|
|
YaoPin yp = drugMap.get(item.getOrderCode().trim() + item.getSerial().trim());
|
|
|
if (null == yp) {
|
|
@@ -291,8 +287,8 @@ public class RationalUseServer {
|
|
|
.append("<reason>").append("</reason>")
|
|
|
.append("<dose_unit>").append(nullToBlank(item.getDoseUnitName())).append("</dose_unit>")
|
|
|
.append("<dose>").append(item.getDose()).append("</dose>")
|
|
|
- .append("<kyzl>").append(item.getDose()).append("</kyzl>")
|
|
|
- .append("<zl_unit>").append(item.getDoseUnit()).append("</zl_unit>")
|
|
|
+ .append("<kyzl>").append(item.getDrugQuan()).append("</kyzl>")
|
|
|
+ .append("<zl_unit>").append(item.getDrugQuanName()).append("</zl_unit>")
|
|
|
.append("<freq>").append("ZY").append(nullToBlank(item.getFrequCode())).append("</freq>")
|
|
|
.append("<administer>").append("ZY").append(item.getSupplyCode()).append("</administer>")
|
|
|
.append("<begin_time>").append(DateUtil.formatDatetime(item.getStartTime())).append("</begin_time>")
|
|
@@ -303,7 +299,6 @@ public class RationalUseServer {
|
|
|
.append("<money>").append(yp.getPackRetprice().multiply(item.getDrugQuan())).append("</money>")
|
|
|
.append("</medicine>");
|
|
|
}
|
|
|
- sb.append("</medicine_data></prescription>");
|
|
|
}
|
|
|
|
|
|
/**
|