|
@@ -37,10 +37,9 @@ public class KlDiagnoseDetailFacade extends KlDiagnoseDetailServiceImpl {
|
|
|
public void exportDiagnose(HttpServletResponse response) {
|
|
|
// 获取全部数据、分组
|
|
|
List<KlDiagnoseDetail> klDiagnoseDetailList = klDiagnoseDetailFacade.list(new QueryWrapper<KlDiagnoseDetail>()
|
|
|
-// .eq("dis_name", "下颌骨骨折")
|
|
|
+// .eq("dis_name", "急性化脓性扁桃体炎")
|
|
|
.eq("is_deleted", IsDeleteEnum.N.getKey()));
|
|
|
Map<String, List<KlDiagnoseDetail>> diagnoseDetailMap = EntityUtil.makeEntityListMap(klDiagnoseDetailList, "disName");
|
|
|
- // TODO 获取公式,分隔编码,替换编码,组装导出数据 Map<String, List<ExportDiagnoseDTO>>
|
|
|
Map<String, List<ExportDiagnoseDTO>> diagnoseDetails = processDiagnoseDetail(diagnoseDetailMap);
|
|
|
List<ExportDiagnoseDTO> res = new ArrayList<>();
|
|
|
for (String disName : diagnoseDetails.keySet()) {
|
|
@@ -96,6 +95,7 @@ public class KlDiagnoseDetailFacade extends KlDiagnoseDetailServiceImpl {
|
|
|
*/
|
|
|
public List<ExportDiagnoseDTO> packageData(Map<Integer, List<String>> exportDiagnoseDTOS,List<KlDiagnoseDetail> datats,Map<Integer, List<String>> typeCodeNewListMap){
|
|
|
List<ExportDiagnoseDTO> eds = Lists.newArrayList();
|
|
|
+ List<Integer> types = Lists.newArrayList(91, 92, 93);
|
|
|
|
|
|
Map<Integer, List<KlDiagnoseDetail>> typeDiagnoseDetails = EntityUtil.makeEntityListMap(datats, "type");
|
|
|
for (Map.Entry<Integer, List<String>> edd : exportDiagnoseDTOS.entrySet()) {
|
|
@@ -118,21 +118,19 @@ public class KlDiagnoseDetailFacade extends KlDiagnoseDetailServiceImpl {
|
|
|
|
|
|
}
|
|
|
Map<String,List<String>> typeCodeMap = new HashMap<>();//A --> [1.0,1.1,1.2,1.3]
|
|
|
+ Map<String,String> oldNewCodeMap = new HashMap<>();//1.0 -->A0
|
|
|
for (Map.Entry<Integer, List<KlDiagnoseDetail>> tdd : typeDiagnoseDetails.entrySet()) {
|
|
|
List<KlDiagnoseDetail> klDiagnoseDetails = tdd.getValue();
|
|
|
for (KlDiagnoseDetail kdl:klDiagnoseDetails) {
|
|
|
Integer type = kdl.getType();
|
|
|
String code = kdl.getCode();
|
|
|
+ String formula = kdl.getFormula();
|
|
|
String typeName = DiagnoseLexiconTypeEnum.getName(type);//A:症状
|
|
|
|
|
|
ExportDiagnoseDTO exportDiagnoseDTO = new ExportDiagnoseDTO();
|
|
|
BeanUtil.copyProperties(kdl, exportDiagnoseDTO);
|
|
|
|
|
|
- if (type == 91 || type == 92 || type == 93) {
|
|
|
- ReflectUtil.setProperty(exportDiagnoseDTO, "type", typeName);
|
|
|
- exportDiagnoseDTO.setRule(kdl.getFormula().replaceAll("/","、")
|
|
|
- .replaceAll("\\(","[").replaceAll("\\)","]"));
|
|
|
- }else {
|
|
|
+ if (!types.contains(type)) {
|
|
|
String tName = typeName.split(":")[1];//症状
|
|
|
String tType = typeName.split(":")[0];//A
|
|
|
String tCode = code.split("\\.")[1];
|
|
@@ -155,6 +153,7 @@ public class KlDiagnoseDetailFacade extends KlDiagnoseDetailServiceImpl {
|
|
|
}
|
|
|
ReflectUtil.setProperty(exportDiagnoseDTO, "type", tName);
|
|
|
ReflectUtil.setProperty(exportDiagnoseDTO, "orderNo", tType+String.valueOf(tCode));
|
|
|
+ oldNewCodeMap.put(code,tType+String.valueOf(tCode));
|
|
|
if (code.startsWith("3.") ) {
|
|
|
exportDiagnoseDTO.setRule(kdl.getRelation());
|
|
|
exportDiagnoseDTO.setRelation("");
|
|
@@ -166,6 +165,15 @@ public class KlDiagnoseDetailFacade extends KlDiagnoseDetailServiceImpl {
|
|
|
exportDiagnoseDTO.setRelation(kdl.getStandard());
|
|
|
}
|
|
|
exportDiagnoseDTO.setEq(kdl.getMidResult());
|
|
|
+ }else {
|
|
|
+ ReflectUtil.setProperty(exportDiagnoseDTO, "type", typeName);
|
|
|
+ for (Map.Entry<String,String> typeq:oldNewCodeMap.entrySet()){
|
|
|
+ String oldCode = typeq.getKey();
|
|
|
+ String newCode = typeq.getValue();
|
|
|
+ formula = formula.replace(oldCode,newCode);
|
|
|
+ }
|
|
|
+ exportDiagnoseDTO.setRule(formula.replaceAll("/","、")
|
|
|
+ .replaceAll("\\(","[").replaceAll("\\)","]"));
|
|
|
}
|
|
|
|
|
|
eds.add(exportDiagnoseDTO);
|