Merge remote-tracking branch 'origin/develop' into zhaoyun
This commit is contained in:
@@ -26,9 +26,11 @@ public class RegPrescriptionUtils {
|
|||||||
if (medicineList == null || medicineList.isEmpty()) {
|
if (medicineList == null || medicineList.isEmpty()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// 1. 按诊断ID分组(不同诊断必须分开)
|
// 1. 按诊断ID分组(不同诊断必须分开,null值归为一组)
|
||||||
Map<Long, List<RegAdviceSaveDto>> diagnosisGroups =
|
Map<Long, List<RegAdviceSaveDto>> diagnosisGroups =
|
||||||
medicineList.stream().collect(Collectors.groupingBy(RegAdviceSaveDto::getConditionDefinitionId));
|
medicineList.stream().collect(Collectors.groupingBy(dto ->
|
||||||
|
dto.getConditionDefinitionId() != null ? dto.getConditionDefinitionId() : 0L
|
||||||
|
));
|
||||||
// 2. 处理每个诊断组
|
// 2. 处理每个诊断组
|
||||||
diagnosisGroups.values().forEach(this::processDiagnosisGroup);
|
diagnosisGroups.values().forEach(this::processDiagnosisGroup);
|
||||||
}
|
}
|
||||||
@@ -40,14 +42,18 @@ public class RegPrescriptionUtils {
|
|||||||
if (diagnosisGroup.isEmpty()) {
|
if (diagnosisGroup.isEmpty()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// 1. 按药品性质分组
|
// 1. 按药品性质分组(null值归为普通药品)
|
||||||
Map<String, List<RegAdviceSaveDto>> pharmacologyGroups =
|
Map<String, List<RegAdviceSaveDto>> pharmacologyGroups =
|
||||||
diagnosisGroup.stream().collect(Collectors.groupingBy(RegAdviceSaveDto::getPharmacologyCategoryCode));
|
diagnosisGroup.stream().collect(Collectors.groupingBy(dto ->
|
||||||
|
dto.getPharmacologyCategoryCode() != null ? dto.getPharmacologyCategoryCode() : "0"
|
||||||
|
));
|
||||||
// 2. 处理每个药品性质组
|
// 2. 处理每个药品性质组
|
||||||
pharmacologyGroups.values().forEach(pharmaGroup -> {
|
pharmacologyGroups.values().forEach(pharmaGroup -> {
|
||||||
// 2.1 按治疗类型分组
|
// 2.1 按治疗类型分组
|
||||||
Map<Integer, List<RegAdviceSaveDto>> therapyGroups =
|
Map<Integer, List<RegAdviceSaveDto>> therapyGroups =
|
||||||
pharmaGroup.stream().collect(Collectors.groupingBy(RegAdviceSaveDto::getTherapyEnum));
|
pharmaGroup.stream().collect(Collectors.groupingBy(dto ->
|
||||||
|
dto.getTherapyEnum() != null ? dto.getTherapyEnum() : 0
|
||||||
|
));
|
||||||
// 2.2 为每组治疗类型生成唯一处方号
|
// 2.2 为每组治疗类型生成唯一处方号
|
||||||
therapyGroups.forEach((therapyEnum, group) -> {
|
therapyGroups.forEach((therapyEnum, group) -> {
|
||||||
String prescriptionNo = generatePrescriptionNo(pharmaGroup.get(0).getPharmacologyCategoryCode());
|
String prescriptionNo = generatePrescriptionNo(pharmaGroup.get(0).getPharmacologyCategoryCode());
|
||||||
@@ -60,6 +66,9 @@ public class RegPrescriptionUtils {
|
|||||||
* 根据药品性质生成处方号(前缀规则与原工具类一致)
|
* 根据药品性质生成处方号(前缀规则与原工具类一致)
|
||||||
*/
|
*/
|
||||||
private String generatePrescriptionNo(String pharmacologyCategoryCode) {
|
private String generatePrescriptionNo(String pharmacologyCategoryCode) {
|
||||||
|
if (pharmacologyCategoryCode == null || pharmacologyCategoryCode.isEmpty()) {
|
||||||
|
return assignSeqUtil.getSeq(AssignSeqEnum.PRESCRIPTION_COMMON_NO.getPrefix(), 8);
|
||||||
|
}
|
||||||
switch (pharmacologyCategoryCode) {
|
switch (pharmacologyCategoryCode) {
|
||||||
case "2": // 麻醉药品
|
case "2": // 麻醉药品
|
||||||
return assignSeqUtil.getSeq(AssignSeqEnum.PRESCRIPTION_NARCOTIC_NO.getPrefix(), 8);
|
return assignSeqUtil.getSeq(AssignSeqEnum.PRESCRIPTION_NARCOTIC_NO.getPrefix(), 8);
|
||||||
|
|||||||
Reference in New Issue
Block a user