Browse Source

.12.0代码合并

zdm 6 years ago
parent
commit
c9ebe4e42d

+ 35 - 37
src/main/java/com/yihu/ehr/profile/service/ProfileCDAService.java

@ -63,7 +63,7 @@ public class ProfileCDAService extends ProfileBasicService {
                List<Map<String, Object>> prescription = new ArrayList<>();
                for (ArchiveTemplate item : list) {
                    Map<String, Object> temp = new HashMap<>();
                    if (item.getTitle().contains("检查报告")) {
                    if (item.getTitle().contains("检查")) {
                        String subQ = "{\"q\":\"rowkey:" + profileId + "$HDSD00_79$*\"}";
                        Envelop subEnvelop = resource.getSubData(subQ, 1, 1000, null);
                        List<Map<String, Object>> subList = subEnvelop.getDetailModelList();
@ -86,7 +86,7 @@ public class ProfileCDAService extends ProfileBasicService {
                        temp.put("multi", true);
                        temp.put("data", new HashMap<>());
                        temp.put("records", data);
                    } else if (item.getTitle().contains("检验报告")) {
                    } else if (item.getTitle().contains("化验")) {
                        String subQ = "{\"q\":\"rowkey:" + profileId + "$HDSD00_77$*\"}";
                        Envelop subEnvelop = resource.getSubData(subQ, 1, 1000, null);
                        List<Map<String, Object>> subList = subEnvelop.getDetailModelList();
@ -109,7 +109,7 @@ public class ProfileCDAService extends ProfileBasicService {
                        temp.put("multi", true);
                        temp.put("data", new HashMap<>());
                        temp.put("records", data);
                    } else if (item.getTitle().contains("手术记录")) {
                    } else if (item.getTitle().contains("手术")) {
                        String subQ = "{\"q\":\"rowkey:" + profileId + "$HDSD00_06$*\"}";
                        Envelop subEnvelop = resource.getSubData(subQ, 1, 1000, null);
                        List<Map<String, Object>> subList = subEnvelop.getDetailModelList();
@ -132,40 +132,38 @@ public class ProfileCDAService extends ProfileBasicService {
                        temp.put("multi", true);
                        temp.put("data", new HashMap<>());
                        temp.put("records", data);
                    } else if (item.getTitle().contains("处方")) {
                        //中西药特殊处理
                        if (item.getTitle().contains("中药")) {
                            String subQ = "{\"q\":\"rowkey:" + profileId + "$HDSD00_83$*\"}";
                            Envelop subEnvelop = resource.getSubData(subQ, 1, 1, null);
                            if (subEnvelop.getDetailModelList() != null && subEnvelop.getDetailModelList().size() > 0) {
                                Map<String, Object> dataMap = new HashMap<>();
                                dataMap.put(ResourceCells.PROFILE_ID, profileId);
                                dataMap.put(ResourceCells.PROFILE_TYPE, event.get(ResourceCells.PROFILE_TYPE));
                                dataMap.put("cda_document_id", item.getCdaDocumentId());
                                dataMap.put("cda_code", item.getCdaCode());
                                dataMap.put("pc_template", item.getPcUrl());
                                dataMap.put("mobile_template", item.getMobileUrl());
                                dataMap.put("template_id", item.getId());
                                dataMap.put("name", "中药处方");
                                dataMap.put("mark", "01");
                                prescription.add(dataMap);
                            }
                        } else if (item.getTitle().contains("西药")) {
                            String subQ = "{\"q\":\"rowkey:" + profileId + "$HDSD00_84$*\"}";
                            Envelop subEnvelop = resource.getSubData(subQ, 1, 1, null);
                            if (subEnvelop.getDetailModelList() != null && subEnvelop.getDetailModelList().size() > 0) {
                                Map<String, Object> dataMap = new HashMap<>();
                                dataMap.put(ResourceCells.PROFILE_ID, profileId);
                                dataMap.put(ResourceCells.PROFILE_TYPE, event.get(ResourceCells.PROFILE_TYPE));
                                dataMap.put("cda_document_id", item.getCdaDocumentId());
                                dataMap.put("cda_code", item.getCdaCode());
                                dataMap.put("pc_template", item.getPcUrl());
                                dataMap.put("mobile_template", item.getMobileUrl());
                                dataMap.put("template_id", item.getId());
                                dataMap.put("name", "西药处方");
                                dataMap.put("mark", "02");
                                prescription.add(dataMap);
                            }
                    } else if  (item.getTitle().contains("中药")) { //中西药特殊处理
                        String subQ = "{\"q\":\"rowkey:" + profileId + "$HDSD00_83$*\"}";
                        Envelop subEnvelop = resource.getSubData(subQ, 1, 1, null);
                        if (subEnvelop.getDetailModelList() != null && subEnvelop.getDetailModelList().size() > 0) {
                            Map<String, Object> dataMap = new HashMap<>();
                            dataMap.put(ResourceCells.PROFILE_ID, profileId);
                            dataMap.put(ResourceCells.PROFILE_TYPE, event.get(ResourceCells.PROFILE_TYPE));
                            dataMap.put("cda_document_id", item.getCdaDocumentId());
                            dataMap.put("cda_code", item.getCdaCode());
                            dataMap.put("pc_template", item.getPcUrl());
                            dataMap.put("mobile_template", item.getMobileUrl());
                            dataMap.put("template_id", item.getId());
                            dataMap.put("name", item.getTitle());
                            dataMap.put("mark", "01");
                            prescription.add(dataMap);
                        }
                        continue;
                    } else if (item.getTitle().contains("西药")) { //中西药特殊处理
                        String subQ = "{\"q\":\"rowkey:" + profileId + "$HDSD00_84$*\"}";
                        Envelop subEnvelop = resource.getSubData(subQ, 1, 1, null);
                        if (subEnvelop.getDetailModelList() != null && subEnvelop.getDetailModelList().size() > 0) {
                            Map<String, Object> dataMap = new HashMap<>();
                            dataMap.put(ResourceCells.PROFILE_ID, profileId);
                            dataMap.put(ResourceCells.PROFILE_TYPE, event.get(ResourceCells.PROFILE_TYPE));
                            dataMap.put("cda_document_id", item.getCdaDocumentId());
                            dataMap.put("cda_code", item.getCdaCode());
                            dataMap.put("pc_template", item.getPcUrl());
                            dataMap.put("mobile_template", item.getMobileUrl());
                            dataMap.put("template_id", item.getId());
                            dataMap.put("name", item.getTitle());
                            dataMap.put("mark", "02");
                            prescription.add(dataMap);
                        }
                        continue;
                    } else {

+ 7 - 1
src/main/java/com/yihu/ehr/profile/service/ProfileEventService.java

@ -320,7 +320,13 @@ public class ProfileEventService extends ProfileBasicService {
                }
                resultMap.put("inResult", inResult); //入院诊断
                resultMap.put("outResult", outResult); //出院诊断
                resultMap.put("treatmentResults", temp.get("EHR_000299") == null ? "" : temp.get("EHR_000299")); //治疗结果
                String treatmentResults = "";
                if (temp.get("EHR_000166_VALUE") != null) {
                    treatmentResults = (String) temp.get("EHR_000166_VALUE");
                } else if (temp.get("EHR_000166") != null) {
                    treatmentResults = (String) temp.get("EHR_000166");
                }
                resultMap.put("treatmentResults", treatmentResults); //治疗结果
                resultMap.put("dischargeInstructions", temp.get("EHR_000157") == null ? "" :  temp.get("EHR_000157")); //出院医嘱
            }
            return resultMap;

+ 19 - 9
src/main/java/com/yihu/ehr/profile/service/ProfileInfoBaseService.java

@ -8,6 +8,7 @@ import com.yihu.ehr.util.datetime.DateUtil;
import com.yihu.ehr.util.http.HttpResponse;
import com.yihu.ehr.util.http.HttpUtils;
import com.yihu.ehr.util.rest.Envelop;
import com.yihu.ehr.util.validate.IdCardValidator;
import org.hibernate.FlushMode;
import org.hibernate.Query;
import org.hibernate.Session;
@ -22,6 +23,8 @@ import java.util.*;
@Service
public class ProfileInfoBaseService extends BaseJpaService {
    private final IdCardValidator idCardValidator = new IdCardValidator();
    @Autowired
    private ResourceClient resource;
    @Autowired
@ -111,15 +114,22 @@ public class ProfileInfoBaseService extends BaseJpaService {
            }
            patientMap.put("weight", weight);
            List<String> labels = new ArrayList<>();
            if (result.get(ResourceCells.DIAGNOSIS) != null && result.get(ResourceCells.DIAGNOSIS).toString().contains("Z37")) { //1 新生儿
                labels.add("新生儿");
                //出生身高
                patientMap.put("height", result.get("EHR_001256") == null ? "" : result.get("EHR_001256"));
                //出生体重
                patientMap.put("weight", result.get("EHR_001257") == null ? "" : result.get("EHR_001257")); //单位(g)
            } else if (result.get(ResourceCells.DIAGNOSIS) != null && result.get(ResourceCells.DIAGNOSIS).toString().contains("O80")) { //2 孕妇
                labels.add("孕妇");
            } else if (profileDiseaseService.getHealthProblem(demographicId).size() > 0){
            if (result.get(ResourceCells.DIAGNOSIS) != null) {
                if (result.get(ResourceCells.DIAGNOSIS).toString().contains("Z37") || result.get(ResourceCells.DIAGNOSIS).toString().contains("O80")) {
                    if (demographicId.length() == 18 && idCardValidator.is18Idcard(demographicId)) {
                        labels.add("孕妇");
                    } else if (demographicId.length() == 15 && idCardValidator.is15Idcard(demographicId)) {
                        labels.add("孕妇");
                    } else {
                        labels.add("新生儿");
                        //出生身高
                        patientMap.put("height", result.get("EHR_001256") == null ? "" : result.get("EHR_001256"));
                        //出生体重
                        patientMap.put("weight", result.get("EHR_001257") == null ? "" : result.get("EHR_001257")); //单位(g)
                    }
                }
            }
            if (profileDiseaseService.getHealthProblem(demographicId).size() > 0){
                labels.add("慢病");
            }
            Map<String, Object> params = new HashMap<>();