|
@@ -1,8 +1,7 @@
|
|
package com.diagbot.facade;
|
|
package com.diagbot.facade;
|
|
|
|
|
|
import com.diagbot.dto.DictionaryInfoDTO;
|
|
import com.diagbot.dto.DictionaryInfoDTO;
|
|
-import com.diagbot.entity.node.EntityInfo;
|
|
|
|
-import com.diagbot.entity.node.LisName;
|
|
|
|
|
|
+import com.diagbot.entity.node.*;
|
|
import com.diagbot.enums.LabelTypeEnum;
|
|
import com.diagbot.enums.LabelTypeEnum;
|
|
import com.diagbot.exception.CommonErrorCode;
|
|
import com.diagbot.exception.CommonErrorCode;
|
|
import com.diagbot.exception.CommonException;
|
|
import com.diagbot.exception.CommonException;
|
|
@@ -198,6 +197,7 @@ public class EntityInfoFacade {
|
|
|
|
|
|
/**
|
|
/**
|
|
* 术语保存
|
|
* 术语保存
|
|
|
|
+ *
|
|
* @param entityInfo
|
|
* @param entityInfo
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
@@ -249,17 +249,12 @@ public class EntityInfoFacade {
|
|
entityInfo.getGender());
|
|
entityInfo.getGender());
|
|
}
|
|
}
|
|
break;
|
|
break;
|
|
- case "实验室检查套餐名":
|
|
|
|
- if (entityInfo.getId() != null) {
|
|
|
|
- lisSetRepository.update(entityInfo);
|
|
|
|
|
|
+ case "实验室检查名称":
|
|
|
|
+ if (entityInfo.getId() == null) {
|
|
|
|
+ lisNameRepository.create(entityInfo, entityInfo.getUnit(), entityInfo.getMaxval(), entityInfo.getMinval(), entityInfo.getRange());
|
|
} else {
|
|
} else {
|
|
- lisSetRepository.create(entityInfo);
|
|
|
|
|
|
+ lisNameRepository.update(entityInfo, entityInfo.getUnit(), entityInfo.getMaxval(), entityInfo.getMinval(), entityInfo.getRange());
|
|
}
|
|
}
|
|
- break;
|
|
|
|
- case "实验室检查名称":
|
|
|
|
- LisName lisName = new LisName();
|
|
|
|
- BeanUtil.copyProperties(entityInfo, lisName);
|
|
|
|
-
|
|
|
|
break;
|
|
break;
|
|
case "辅助检查名称":
|
|
case "辅助检查名称":
|
|
if (entityInfo.getId() != null) {
|
|
if (entityInfo.getId() != null) {
|
|
@@ -275,8 +270,6 @@ public class EntityInfoFacade {
|
|
pacsSubNameRepository.create(entityInfo, entityInfo.getGender());
|
|
pacsSubNameRepository.create(entityInfo, entityInfo.getGender());
|
|
}
|
|
}
|
|
break;
|
|
break;
|
|
- case "药品通用名称":
|
|
|
|
- break;
|
|
|
|
case "医保手术和操作名称":
|
|
case "医保手术和操作名称":
|
|
if (entityInfo.getOpgrade() == null) {
|
|
if (entityInfo.getOpgrade() == null) {
|
|
entityInfo.setOpgrade("0");
|
|
entityInfo.setOpgrade("0");
|
|
@@ -287,67 +280,272 @@ public class EntityInfoFacade {
|
|
yiBaoOperationNameRepository.create(entityInfo, entityInfo.getOpgrade());
|
|
yiBaoOperationNameRepository.create(entityInfo, entityInfo.getOpgrade());
|
|
}
|
|
}
|
|
break;
|
|
break;
|
|
- case "疾病":
|
|
|
|
- break;
|
|
|
|
case "实验室检查":
|
|
case "实验室检查":
|
|
|
|
+ if (entityInfo.getId() == null) {
|
|
|
|
+ lisRepository.create(entityInfo, entityInfo.getUnit());
|
|
|
|
+ } else {
|
|
|
|
+ lisRepository.update(entityInfo, entityInfo.getUnit());
|
|
|
|
+ }
|
|
break;
|
|
break;
|
|
case "化验细项及结果":
|
|
case "化验细项及结果":
|
|
|
|
+ //特殊处理
|
|
break;
|
|
break;
|
|
case "实验室检查危急值":
|
|
case "实验室检查危急值":
|
|
|
|
+ if (entityInfo.getId() == null) {
|
|
|
|
+ lisCriticalRepository.create(entityInfo, entityInfo.getUnit());
|
|
|
|
+ } else {
|
|
|
|
+ lisCriticalRepository.update(entityInfo, entityInfo.getUnit());
|
|
|
|
+ }
|
|
|
|
+ break;
|
|
|
|
+ case "药品代码通用名":
|
|
|
|
+ //特殊处理
|
|
|
|
+ break;
|
|
|
|
+ case "药品注册名称":
|
|
|
|
+ //特殊处理
|
|
|
|
+ break;
|
|
|
|
+ case "体征":
|
|
|
|
+ if (entityInfo.getId() == null) {
|
|
|
|
+ vitalRepository.create(entityInfo, entityInfo.getUnit());
|
|
|
|
+ } else {
|
|
|
|
+ vitalRepository.update(entityInfo, entityInfo.getUnit());
|
|
|
|
+ }
|
|
|
|
+ break;
|
|
|
|
+ case "药物过敏原":
|
|
|
|
+ if (StringUtil.isBlank(entityInfo.getMedtype())) {
|
|
|
|
+ throw new CommonException(CommonErrorCode.PARAM_IS_NULL, "请输入药品类型");
|
|
|
|
+ }
|
|
|
|
+ if (entityInfo.getId() == null) {
|
|
|
|
+ medAllergenRepository.create(entityInfo, entityInfo.getMedtype(), entityInfo.getResult(), entityInfo.getAlias());
|
|
|
|
+ } else {
|
|
|
|
+ medAllergenRepository.update(entityInfo, entityInfo.getMedtype(), entityInfo.getResult(), entityInfo.getAlias());
|
|
|
|
+ }
|
|
|
|
+ break;
|
|
|
|
+ case "实验室检查套餐名":
|
|
|
|
+ if (entityInfo.getId() == null) {
|
|
|
|
+ LisSet lisSet = new LisSet();
|
|
|
|
+ BeanUtil.copyProperties(entityInfo, lisSet);
|
|
|
|
+ lisSetRepository.save(lisSet);
|
|
|
|
+ } else {
|
|
|
|
+ entityInfoRepository.update(entityInfo);
|
|
|
|
+ }
|
|
|
|
+ break;
|
|
|
|
+ case "药品通用名称":
|
|
|
|
+ if (entityInfo.getId() == null) {
|
|
|
|
+ Medicine medicine = new Medicine();
|
|
|
|
+ BeanUtil.copyProperties(entityInfo, medicine);
|
|
|
|
+ medicineRepository.save(medicine);
|
|
|
|
+ } else {
|
|
|
|
+ entityInfoRepository.update(entityInfo);
|
|
|
|
+ }
|
|
|
|
+ break;
|
|
|
|
+ case "疾病":
|
|
|
|
+ if (entityInfo.getId() == null) {
|
|
|
|
+ Disease disease = new Disease();
|
|
|
|
+ BeanUtil.copyProperties(entityInfo, disease);
|
|
|
|
+ diseaseRepository.save(disease);
|
|
|
|
+ } else {
|
|
|
|
+ entityInfoRepository.update(entityInfo);
|
|
|
|
+ }
|
|
break;
|
|
break;
|
|
case "化验提醒指标":
|
|
case "化验提醒指标":
|
|
|
|
+ if (entityInfo.getId() == null) {
|
|
|
|
+ LisRemind lisRemind = new LisRemind();
|
|
|
|
+ BeanUtil.copyProperties(entityInfo, lisRemind);
|
|
|
|
+ lisRemindRepository.save(lisRemind);
|
|
|
|
+ } else {
|
|
|
|
+ entityInfoRepository.update(entityInfo);
|
|
|
|
+ }
|
|
break;
|
|
break;
|
|
case "化验套餐名称":
|
|
case "化验套餐名称":
|
|
|
|
+ if (entityInfo.getId() == null) {
|
|
|
|
+ LisBigName lisBigName = new LisBigName();
|
|
|
|
+ BeanUtil.copyProperties(entityInfo, lisBigName);
|
|
|
|
+ lisBigNameRepository.save(lisBigName);
|
|
|
|
+ } else {
|
|
|
|
+ entityInfoRepository.update(entityInfo);
|
|
|
|
+ }
|
|
break;
|
|
break;
|
|
case "辅助检查危急值":
|
|
case "辅助检查危急值":
|
|
|
|
+ if (entityInfo.getId() == null) {
|
|
|
|
+ PacsCritical pacsCritical = new PacsCritical();
|
|
|
|
+ BeanUtil.copyProperties(entityInfo, pacsCritical);
|
|
|
|
+ pacsCriticalRepository.save(pacsCritical);
|
|
|
|
+ } else {
|
|
|
|
+ entityInfoRepository.update(entityInfo);
|
|
|
|
+ }
|
|
break;
|
|
break;
|
|
case "辅助检查名称描述":
|
|
case "辅助检查名称描述":
|
|
|
|
+ if (entityInfo.getId() == null) {
|
|
|
|
+ PacsDescribe pacsDescribe = new PacsDescribe();
|
|
|
|
+ BeanUtil.copyProperties(entityInfo, pacsDescribe);
|
|
|
|
+ pacsDescribeRepository.save(pacsDescribe);
|
|
|
|
+ } else {
|
|
|
|
+ entityInfoRepository.update(entityInfo);
|
|
|
|
+ }
|
|
break;
|
|
break;
|
|
case "辅助检查名称结果":
|
|
case "辅助检查名称结果":
|
|
|
|
+ if (entityInfo.getId() == null) {
|
|
|
|
+ PacsResult pacsResult = new PacsResult();
|
|
|
|
+ BeanUtil.copyProperties(entityInfo, pacsResult);
|
|
|
|
+ pacsResultRepository.save(pacsResult);
|
|
|
|
+ } else {
|
|
|
|
+ entityInfoRepository.update(entityInfo);
|
|
|
|
+ }
|
|
break;
|
|
break;
|
|
case "辅检提醒指标":
|
|
case "辅检提醒指标":
|
|
- break;
|
|
|
|
- case "药品代码通用名":
|
|
|
|
- break;
|
|
|
|
- case "药品注册名称":
|
|
|
|
|
|
+ if (entityInfo.getId() == null) {
|
|
|
|
+ PacsRemind pacsRemind = new PacsRemind();
|
|
|
|
+ BeanUtil.copyProperties(entityInfo, pacsRemind);
|
|
|
|
+ pacsRemindRepository.save(pacsRemind);
|
|
|
|
+ } else {
|
|
|
|
+ entityInfoRepository.update(entityInfo);
|
|
|
|
+ }
|
|
break;
|
|
break;
|
|
case "药品类别":
|
|
case "药品类别":
|
|
|
|
+ if (entityInfo.getId() == null) {
|
|
|
|
+ MedClass medClass = new MedClass();
|
|
|
|
+ BeanUtil.copyProperties(entityInfo, medClass);
|
|
|
|
+ medClassRepository.save(medClass);
|
|
|
|
+ } else {
|
|
|
|
+ entityInfoRepository.update(entityInfo);
|
|
|
|
+ }
|
|
break;
|
|
break;
|
|
case "药品治疗学类别":
|
|
case "药品治疗学类别":
|
|
|
|
+ if (entityInfo.getId() == null) {
|
|
|
|
+ MedZhiLiaoClass medZhiLiaoClass = new MedZhiLiaoClass();
|
|
|
|
+ BeanUtil.copyProperties(entityInfo, medZhiLiaoClass);
|
|
|
|
+ medZhiLiaoClassRepository.save(medZhiLiaoClass);
|
|
|
|
+ } else {
|
|
|
|
+ entityInfoRepository.update(entityInfo);
|
|
|
|
+ }
|
|
break;
|
|
break;
|
|
case "药品药理学类别":
|
|
case "药品药理学类别":
|
|
|
|
+ if (entityInfo.getId() == null) {
|
|
|
|
+ MedYaoLiClass medYaoLiClass = new MedYaoLiClass();
|
|
|
|
+ BeanUtil.copyProperties(entityInfo, medYaoLiClass);
|
|
|
|
+ medYaoLiClassRepository.save(medYaoLiClass);
|
|
|
|
+ } else {
|
|
|
|
+ entityInfoRepository.update(entityInfo);
|
|
|
|
+ }
|
|
break;
|
|
break;
|
|
case "药品解剖学类别":
|
|
case "药品解剖学类别":
|
|
|
|
+ if (entityInfo.getId() == null) {
|
|
|
|
+ MedJiePouClass medJiePouClass = new MedJiePouClass();
|
|
|
|
+ BeanUtil.copyProperties(entityInfo, medJiePouClass);
|
|
|
|
+ medJiePouClassRepository.save(medJiePouClass);
|
|
|
|
+ } else {
|
|
|
|
+ entityInfoRepository.update(entityInfo);
|
|
|
|
+ }
|
|
break;
|
|
break;
|
|
case "药品化学物质类别":
|
|
case "药品化学物质类别":
|
|
|
|
+ if (entityInfo.getId() == null) {
|
|
|
|
+ MedChemClass medChemClass = new MedChemClass();
|
|
|
|
+ BeanUtil.copyProperties(entityInfo, medChemClass);
|
|
|
|
+ medChemClassRepository.save(medChemClass);
|
|
|
|
+ } else {
|
|
|
|
+ entityInfoRepository.update(entityInfo);
|
|
|
|
+ }
|
|
break;
|
|
break;
|
|
case "服用药品":
|
|
case "服用药品":
|
|
|
|
+ if (entityInfo.getId() == null) {
|
|
|
|
+ OralMedicine oralMedicine = new OralMedicine();
|
|
|
|
+ BeanUtil.copyProperties(entityInfo, oralMedicine);
|
|
|
|
+ oralMedicineRepository.save(oralMedicine);
|
|
|
|
+ } else {
|
|
|
|
+ entityInfoRepository.update(entityInfo);
|
|
|
|
+ }
|
|
break;
|
|
break;
|
|
case "禁忌医疗器械及物品":
|
|
case "禁忌医疗器械及物品":
|
|
|
|
+ if (entityInfo.getId() == null) {
|
|
|
|
+ ConflictDevice conflictDevice = new ConflictDevice();
|
|
|
|
+ BeanUtil.copyProperties(entityInfo, conflictDevice);
|
|
|
|
+ conflictDeviceRepository.save(conflictDevice);
|
|
|
|
+ } else {
|
|
|
|
+ entityInfoRepository.update(entityInfo);
|
|
|
|
+ }
|
|
break;
|
|
break;
|
|
case "性别":
|
|
case "性别":
|
|
- break;
|
|
|
|
- case "体征":
|
|
|
|
|
|
+ if (entityInfo.getId() == null) {
|
|
|
|
+ Gender gender = new Gender();
|
|
|
|
+ BeanUtil.copyProperties(entityInfo, gender);
|
|
|
|
+ genderRepository.save(gender);
|
|
|
|
+ } else {
|
|
|
|
+ entityInfoRepository.update(entityInfo);
|
|
|
|
+ }
|
|
break;
|
|
break;
|
|
case "症状":
|
|
case "症状":
|
|
|
|
+ if (entityInfo.getId() == null) {
|
|
|
|
+ Symptom symptom = new Symptom();
|
|
|
|
+ BeanUtil.copyProperties(entityInfo, symptom);
|
|
|
|
+ symptomNameRepository.save(symptom);
|
|
|
|
+ } else {
|
|
|
|
+ entityInfoRepository.update(entityInfo);
|
|
|
|
+ }
|
|
break;
|
|
break;
|
|
case "临床表现":
|
|
case "临床表现":
|
|
|
|
+ if (entityInfo.getId() == null) {
|
|
|
|
+ ClinicalFinding clinicalFinding = new ClinicalFinding();
|
|
|
|
+ BeanUtil.copyProperties(entityInfo, clinicalFinding);
|
|
|
|
+ clinicalFindingRepository.save(clinicalFinding);
|
|
|
|
+ } else {
|
|
|
|
+ entityInfoRepository.update(entityInfo);
|
|
|
|
+ }
|
|
break;
|
|
break;
|
|
case "科室":
|
|
case "科室":
|
|
|
|
+ if (entityInfo.getId() == null) {
|
|
|
|
+ Dept dept = new Dept();
|
|
|
|
+ BeanUtil.copyProperties(entityInfo, dept);
|
|
|
|
+ deptRepository.save(dept);
|
|
|
|
+ } else {
|
|
|
|
+ entityInfoRepository.update(entityInfo);
|
|
|
|
+ }
|
|
break;
|
|
break;
|
|
case "开单项互斥":
|
|
case "开单项互斥":
|
|
|
|
+ if (entityInfo.getId() == null) {
|
|
|
|
+ BillConflictItem billConflictItem = new BillConflictItem();
|
|
|
|
+ BeanUtil.copyProperties(entityInfo, billConflictItem);
|
|
|
|
+ billConflictItemRepository.save(billConflictItem);
|
|
|
|
+ } else {
|
|
|
|
+ entityInfoRepository.update(entityInfo);
|
|
|
|
+ }
|
|
break;
|
|
break;
|
|
case "禁忌人群":
|
|
case "禁忌人群":
|
|
|
|
+ if (entityInfo.getId() == null) {
|
|
|
|
+ Group group = new Group();
|
|
|
|
+ BeanUtil.copyProperties(entityInfo, group);
|
|
|
|
+ groupRepository.save(group);
|
|
|
|
+ } else {
|
|
|
|
+ entityInfoRepository.update(entityInfo);
|
|
|
|
+ }
|
|
break;
|
|
break;
|
|
case "建议输血提醒":
|
|
case "建议输血提醒":
|
|
- break;
|
|
|
|
- case "药物过敏原":
|
|
|
|
|
|
+ if (entityInfo.getId() == null) {
|
|
|
|
+ TransfusionSuggest transfusionSuggest = new TransfusionSuggest();
|
|
|
|
+ BeanUtil.copyProperties(entityInfo, transfusionSuggest);
|
|
|
|
+ transfusionSuggestRepository.save(transfusionSuggest);
|
|
|
|
+ } else {
|
|
|
|
+ entityInfoRepository.update(entityInfo);
|
|
|
|
+ }
|
|
break;
|
|
break;
|
|
case "过敏原":
|
|
case "过敏原":
|
|
|
|
+ if (entityInfo.getId() == null) {
|
|
|
|
+ Allergen allergen = new Allergen();
|
|
|
|
+ BeanUtil.copyProperties(entityInfo, allergen);
|
|
|
|
+ allergenRepository.save(allergen);
|
|
|
|
+ } else {
|
|
|
|
+ entityInfoRepository.update(entityInfo);
|
|
|
|
+ }
|
|
break;
|
|
break;
|
|
case "食物过敏原":
|
|
case "食物过敏原":
|
|
break;
|
|
break;
|
|
case "输血提醒指标":
|
|
case "输血提醒指标":
|
|
|
|
+ if (entityInfo.getId() == null) {
|
|
|
|
+ TransfusionRemind transfusionRemind = new TransfusionRemind();
|
|
|
|
+ BeanUtil.copyProperties(entityInfo, transfusionRemind);
|
|
|
|
+ transfusionRemindRepository.save(transfusionRemind);
|
|
|
|
+ } else {
|
|
|
|
+ entityInfoRepository.update(entityInfo);
|
|
|
|
+ }
|
|
break;
|
|
break;
|
|
default:
|
|
default:
|
|
break;
|
|
break;
|