|
@@ -279,7 +279,7 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
|
|
|
* @param analyzeVO
|
|
|
* @return
|
|
|
*/
|
|
|
- public QueryVo dealCommonData(Long hospitalId, AnalyzeVO analyzeVO) throws Exception {
|
|
|
+ public QueryVo dealCommonData(Long hospitalId, AnalyzeVO analyzeVO) {
|
|
|
// 获取质控条目
|
|
|
List<QcCasesEntryDTO> qcCasesEntryDTOList = qcCasesEntryFacade.getQcCasesEntry(analyzeVO);
|
|
|
if (ListUtil.isEmpty(qcCasesEntryDTOList)) {
|
|
@@ -844,12 +844,8 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
|
|
|
analyzeVO.setHospitalId(hospitalId);
|
|
|
|
|
|
// 处理公共数据
|
|
|
- QueryVo queryVo = null;
|
|
|
- try {
|
|
|
- queryVo = dealCommonData(hospitalId, analyzeVO);
|
|
|
- } catch (Exception e) {
|
|
|
- log.error(e.getMessage(),e);
|
|
|
- }
|
|
|
+
|
|
|
+ QueryVo queryVo = dealCommonData(hospitalId, analyzeVO);
|
|
|
queryVo.setUseCrfCache(analyzeVO.isUseCrfCache());
|
|
|
// 调用质控接口
|
|
|
Response<OutputInfo> response = qcServiceClient.extract(queryVo);
|
|
@@ -898,9 +894,8 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
|
|
|
* @param recMap
|
|
|
* @param medrecVoList
|
|
|
*/
|
|
|
- public void addData(String key, Map<String, List<RecordContentDTO>> recMap, List<MedrecVo> medrecVoList) throws Exception {
|
|
|
+ public void addData(String key, Map<String, List<RecordContentDTO>> recMap, List<MedrecVo> medrecVoList) {
|
|
|
List<RecordContentDTO> list = recMap.get(key);
|
|
|
- List<Map<String, Object>> returnData = new ArrayList<>();
|
|
|
if (ListUtil.isNotEmpty(list)) {
|
|
|
MedrecVo medrecVo = new MedrecVo();
|
|
|
String k = key;
|
|
@@ -916,13 +911,8 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
|
|
|
if ("输血/血制品病程记录".equals(key)) {
|
|
|
k = "输血记录";
|
|
|
}
|
|
|
-
|
|
|
Map<String, Object> content = new HashMap<>();
|
|
|
- for (RecordContentDTO recordContentDTO : list) {
|
|
|
- Map<String, Object> objectMap = MapUtil.objectToMap(recordContentDTO);
|
|
|
- returnData.add(objectMap);
|
|
|
- }
|
|
|
- content.put("content", returnData);
|
|
|
+ content.put("content", list);
|
|
|
medrecVo.setTitle(k);
|
|
|
medrecVo.setContent(content);
|
|
|
medrecVoList.add(medrecVo);
|
|
@@ -937,25 +927,12 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
|
|
|
* @param medrecVoList
|
|
|
*/
|
|
|
public void specialDataWithKey(String key, Map<String, List<RecordContentDTO>> recMap,
|
|
|
- List<MedrecVo> medrecVoList, String keyTagert, List<String> keyList) throws Exception {
|
|
|
+ List<MedrecVo> medrecVoList, String keyTagert, List<String> keyList) {
|
|
|
MedrecVo medrecVo = new MedrecVo();
|
|
|
- Map<String, Object> specialContent = new HashMap<String, Object>();
|
|
|
- List<Map<String, Object>> returnData = new ArrayList<>();
|
|
|
- List<Map<String, Object>> objectFile = new ArrayList<>();
|
|
|
- List<Map<String, Object>> applyFile = new ArrayList<>();
|
|
|
- List<Map<String, Object>> mapList = new ArrayList<>();
|
|
|
+ Map<String, List<RecordContentDTO>> specialContent = new HashMap<String, List<RecordContentDTO>>();
|
|
|
Map<String, Object> content = new HashMap<>();
|
|
|
Map<String, Object> Map = new HashMap<>();
|
|
|
- Map<String, Object> objectMap = new HashMap<>();
|
|
|
- Map<String, Object> applyMap = new HashMap<>();
|
|
|
Boolean flag = false;
|
|
|
- String m = key;
|
|
|
- if ("术前讨论、术前小结".equals(key)) {
|
|
|
- m = "术前讨论小结";
|
|
|
- }
|
|
|
- if ("术后首次病程及谈话记录".equals(key)) {
|
|
|
- m = "术后首程";
|
|
|
- }
|
|
|
if (ListUtil.isNotEmpty(keyList)) {
|
|
|
for (String k : keyList) {
|
|
|
if (ListUtil.isNotEmpty(recMap.get(k))) {
|
|
@@ -965,37 +942,25 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
|
|
|
|
|
|
}
|
|
|
List<RecordContentDTO> recordContentDTOS = recMap.get(keyTagert);
|
|
|
- if (ListUtil.isNotEmpty(recordContentDTOS)) {
|
|
|
- for (RecordContentDTO recordContentDTO : recordContentDTOS) {
|
|
|
- objectMap = MapUtil.objectToMap(recordContentDTO);
|
|
|
- objectFile.add(objectMap);
|
|
|
- }
|
|
|
- }
|
|
|
- if (ListUtil.isNotEmpty(keyList) && keyList.size() == 3) {
|
|
|
- List<RecordContentDTO> recordContentList = recMap.get("会诊申请单");
|
|
|
- for (RecordContentDTO contentDTO : recordContentList) {
|
|
|
- applyMap = MapUtil.objectToMap(contentDTO);
|
|
|
- applyFile.add(applyMap);
|
|
|
- }
|
|
|
- }
|
|
|
+ List<RecordContentDTO> recordContentList = recMap.get("会诊申请单");
|
|
|
|
|
|
for (MedrecVo medrec : medrecVoList) {
|
|
|
if (key.equals(medrec.getTitle())) {
|
|
|
Map<String, Object> keyContent = medrec.getContent();
|
|
|
+ specialContent = JSON.parseObject(JSON.toJSONString(keyContent.get("content")), new TypeReference<Map<String, List<RecordContentDTO>>>() {
|
|
|
+ });
|
|
|
if (ListUtil.isNotEmpty(keyList) && keyList.size() == 3) {
|
|
|
- if (Map.get("会诊申请单") != null && Map.get("会诊结果单") == null && !applyFile.isEmpty()) {
|
|
|
- specialContent.put(keyTagert, applyFile);
|
|
|
- } else if (Map.get("会诊结果单") != null && !objectFile.isEmpty()) {
|
|
|
- specialContent.put(keyTagert, objectFile);
|
|
|
+ if (Map.get("会诊申请单") != null && Map.get("会诊结果单") == null && ListUtil.isNotEmpty(recordContentDTOS)) {
|
|
|
+ specialContent.put(keyTagert, recordContentList);
|
|
|
+ } else if (Map.get("会诊结果单") != null && ListUtil.isNotEmpty(recordContentDTOS)) {
|
|
|
+ specialContent.put(keyTagert, recordContentDTOS);
|
|
|
}
|
|
|
} else {
|
|
|
- if (!objectFile.isEmpty()) {
|
|
|
- specialContent.put(keyTagert, objectFile);
|
|
|
+ if (ListUtil.isNotEmpty(recordContentDTOS)) {
|
|
|
+ specialContent.put(keyTagert, recordContentDTOS);
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
- specialContent = JSON.parseObject(JSON.toJSONString(keyContent.get("content")), new TypeReference<Map<String, Object>>() {
|
|
|
- });
|
|
|
+
|
|
|
if (!specialContent.isEmpty()) {
|
|
|
keyContent.put("content", specialContent);
|
|
|
flag = true;
|
|
@@ -1006,19 +971,19 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
|
|
|
|
|
|
if (!flag) {
|
|
|
if (ListUtil.isNotEmpty(keyList) && keyList.size() == 3) {
|
|
|
- if (Map.get("会诊申请单") != null && Map.get("会诊结果单") == null && !applyFile.isEmpty()) {
|
|
|
- specialContent.put(keyTagert, applyFile);
|
|
|
- } else if (Map.get("会诊结果单") != null && !objectFile.isEmpty()) {
|
|
|
- specialContent.put(keyTagert, objectFile);
|
|
|
+ if (Map.get("会诊申请单") != null && Map.get("会诊结果单") == null && ListUtil.isNotEmpty(recordContentDTOS)) {
|
|
|
+ specialContent.put(keyTagert, recordContentList);
|
|
|
+ } else if (Map.get("会诊结果单") != null && ListUtil.isNotEmpty(recordContentDTOS)) {
|
|
|
+ specialContent.put(keyTagert, recordContentDTOS);
|
|
|
}
|
|
|
} else {
|
|
|
- if (!objectFile.isEmpty()) {
|
|
|
- specialContent.put(keyTagert, objectFile);
|
|
|
+ if (ListUtil.isNotEmpty(recordContentDTOS)) {
|
|
|
+ specialContent.put(keyTagert, recordContentDTOS);
|
|
|
}
|
|
|
}
|
|
|
if (!specialContent.isEmpty()) {
|
|
|
content.put("content", specialContent);
|
|
|
- medrecVo.setTitle(m);
|
|
|
+ medrecVo.setTitle(key);
|
|
|
medrecVo.setContent(content);
|
|
|
medrecVoList.add(medrecVo);
|
|
|
}
|
|
@@ -1113,7 +1078,6 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
|
|
|
medrecVo.setTitle(key);
|
|
|
Map<String, Object> content = new HashMap<>();
|
|
|
List<RePlaceData> contents = new ArrayList<>();
|
|
|
- List<Map<String, Object>> returnData = new ArrayList<>();
|
|
|
String k = key;
|
|
|
|
|
|
if ("输血效果评价".equals(key)) {
|
|
@@ -1159,15 +1123,9 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
|
|
|
recordContentDTO.setIsParsed(1);
|
|
|
}
|
|
|
}
|
|
|
- try {
|
|
|
- Map<String, Object> objectMap = MapUtil.objectToMap(recordContentDTO);
|
|
|
- returnData.add(objectMap);
|
|
|
- } catch (Exception e) {
|
|
|
- e.printStackTrace();
|
|
|
- }
|
|
|
}
|
|
|
}
|
|
|
- content.put("content", returnData);
|
|
|
+ content.put("content", recordContentDTOS);
|
|
|
medrecVo.setContent(content);
|
|
|
medrecVoList.add(medrecVo);
|
|
|
}
|
|
@@ -1184,9 +1142,16 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
|
|
|
public <T> void specialData(String key, List<T> list, Map<String, List<RecordContentDTO>> recMap, List<MedrecVo> medrecVoList, String keyTagert) {
|
|
|
MedrecVo medrecVo = new MedrecVo();
|
|
|
Map<String, Object> content = new HashMap<String, Object>();
|
|
|
- Map<String, Object> specialContent = new HashMap<String, Object>();
|
|
|
- List<Map<String, Object>> specialFile = new ArrayList<>();
|
|
|
+ Map<String, List<RecordContentDTO>> specialContent = new HashMap<>();
|
|
|
List<RePlaceData> contents = new ArrayList<>();
|
|
|
+ String k = keyTagert;
|
|
|
+ if ("术前讨论小结".equals(keyTagert)) {
|
|
|
+ k = "术前讨论、术前小结";
|
|
|
+ }
|
|
|
+ if ("术后首程".equals(keyTagert)) {
|
|
|
+ k = "术后首次病程及谈话记录";
|
|
|
+ }
|
|
|
+
|
|
|
//从结构化表中取出应用数据
|
|
|
for (T bean : list) {
|
|
|
try {
|
|
@@ -1205,9 +1170,9 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
|
|
|
}
|
|
|
|
|
|
//将文书xml替换成结构化数据
|
|
|
- if (ListUtil.isNotEmpty(recMap.get(keyTagert))) {
|
|
|
+ if (ListUtil.isNotEmpty(recMap.get(k))) {
|
|
|
Boolean flag = true;
|
|
|
- List<RecordContentDTO> recordContentDTOS = recMap.get(keyTagert);
|
|
|
+ List<RecordContentDTO> recordContentDTOS = recMap.get(k);
|
|
|
for (RecordContentDTO recordContentDTO : recordContentDTOS) {
|
|
|
if (ListUtil.isNotEmpty(contents)) {
|
|
|
for (RePlaceData rePlaceData : contents) {
|
|
@@ -1218,21 +1183,15 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
|
|
|
recordContentDTO.setIsParsed(1);
|
|
|
}
|
|
|
}
|
|
|
- try {
|
|
|
- Map<String, Object> objectMap = MapUtil.objectToMap(recordContentDTO);
|
|
|
- specialFile.add(objectMap);
|
|
|
- } catch (Exception e) {
|
|
|
- e.printStackTrace();
|
|
|
- }
|
|
|
}
|
|
|
}
|
|
|
for (MedrecVo medrec : medrecVoList) {
|
|
|
if (key.equals(medrec.getTitle())) {
|
|
|
Map<String, Object> keyContent = medrec.getContent();
|
|
|
try {
|
|
|
- specialContent = JSON.parseObject(JSON.toJSONString(keyContent.get("content")), new TypeReference<Map<String, Object>>() {
|
|
|
+ specialContent = JSON.parseObject(JSON.toJSONString(keyContent.get("content")), new TypeReference<Map<String, List<RecordContentDTO>>>() {
|
|
|
});
|
|
|
- specialContent.put(keyTagert, specialFile);
|
|
|
+ specialContent.put(keyTagert, recordContentDTOS);
|
|
|
keyContent.put("content", specialContent);
|
|
|
flag = false;
|
|
|
} catch (Exception e) {
|
|
@@ -1242,7 +1201,7 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
|
|
|
}
|
|
|
if (flag) {
|
|
|
medrecVo.setTitle(key);
|
|
|
- specialContent.put(keyTagert, specialFile);
|
|
|
+ specialContent.put(keyTagert, recordContentDTOS);
|
|
|
content.put("content", specialContent);
|
|
|
medrecVo.setContent(content);
|
|
|
medrecVoList.add(medrecVo);
|
|
@@ -1578,12 +1537,7 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
|
|
|
Long hospitalId = analyzeVO.getHospitalId();
|
|
|
|
|
|
// 处理公共数据
|
|
|
- QueryVo queryVo = null;
|
|
|
- try {
|
|
|
- queryVo = dealCommonData(hospitalId, analyzeVO);
|
|
|
- } catch (Exception e) {
|
|
|
- log.error(e.getMessage(),e);
|
|
|
- }
|
|
|
+ QueryVo queryVo = dealCommonData(hospitalId, analyzeVO);
|
|
|
// 调用质控接口
|
|
|
Response<OutputInfo> response = qcServiceClient.extract(queryVo);
|
|
|
if (response == null || response.getData() == null) {
|