|
|
@@ -3,9 +3,11 @@ package org.jeecg.modules.medical.ruleengine.projectcache;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import org.jeecg.modules.medical.Constant;
|
|
|
+import org.jeecg.modules.medical.entity.DiagnoseItems;
|
|
|
import org.jeecg.modules.medical.entity.MaterialItems;
|
|
|
import org.jeecg.modules.medical.entity.MedicalInsuranceDrugs;
|
|
|
import org.jeecg.modules.medical.entity.TreatmentItems;
|
|
|
+import org.jeecg.modules.medical.service.IDiagnosesService;
|
|
|
import org.jeecg.modules.medical.service.IMaterialItemsService;
|
|
|
import org.jeecg.modules.medical.service.IMedicalInsuranceDrugsService;
|
|
|
import org.jeecg.modules.medical.service.ITreatmentItemsService;
|
|
|
@@ -29,6 +31,8 @@ public class HisMedicalProjectCache {
|
|
|
ITreatmentItemsService treatmentItemsService;
|
|
|
@Autowired
|
|
|
IMaterialItemsService materialItemsService;
|
|
|
+ @Autowired
|
|
|
+ IDiagnosesService diagnosesService;
|
|
|
|
|
|
@PostConstruct
|
|
|
public void initHisMedicalProjectCache(){
|
|
|
@@ -82,5 +86,23 @@ public class HisMedicalProjectCache {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+ count = diagnosesService.count();
|
|
|
+ if(count>0) {
|
|
|
+ long pageNum = count / 1000;
|
|
|
+ long modNum = count % 1000;
|
|
|
+ if (modNum > 0) {
|
|
|
+ pageNum = pageNum + 1;
|
|
|
+ }
|
|
|
+ for (int i = 1; i <= pageNum; i++) {
|
|
|
+ IPage page = new Page(i, 1000);
|
|
|
+ List<DiagnoseItems> diagnoseItemsList = diagnosesService.page(page).getRecords();
|
|
|
+ for (DiagnoseItems diagnoseItems : diagnoseItemsList) {
|
|
|
+ redisTemplate.opsForHash().put(Constant.HIS_MEDICAL_DICT_KEY, diagnoseItems.getDiagnoseCode(), diagnoseItems.getMedicalDiagnoseCode());
|
|
|
+ redisTemplate.opsForHash().put(Constant.MEDICAL_CODE_NAME_KEY, diagnoseItems.getMedicalDiagnoseCode(), diagnoseItems.getMedicalDiagnoseName());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|