822 【住院护士站-医嘱校对】药品医嘱“总量”数据换算及单位错误,导致未校对列表总量放大(医生开立2盒显示为30盒
This commit is contained in:
@@ -269,9 +269,9 @@ public class AdviceProcessAppServiceImpl implements IAdviceProcessAppService {
|
||||
e.setSingleDose(doseStr + unitStr);
|
||||
}
|
||||
|
||||
// 总量:数量(总量就是数量,不需要乘以剂量,单位由前端显示)
|
||||
// 总量:药品请求数量按最小单位存储时,折算回当前展示单位。
|
||||
if (e.getQuantity() != null) {
|
||||
e.setTotalAmount(String.valueOf(e.getQuantity()));
|
||||
e.setTotalAmount(normalizeTotalAmount(e));
|
||||
}
|
||||
|
||||
// 频次/用法组合
|
||||
@@ -402,6 +402,28 @@ public class AdviceProcessAppServiceImpl implements IAdviceProcessAppService {
|
||||
return R.ok(inpatientAdvicePage);
|
||||
}
|
||||
|
||||
private String normalizeTotalAmount(InpatientAdviceDto advice) {
|
||||
BigDecimal quantity = advice.getQuantity();
|
||||
if (quantity == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (CommonConstants.TableName.MED_MEDICATION_REQUEST.equals(advice.getAdviceTable())
|
||||
&& advice.getPartPercent() != null
|
||||
&& advice.getPartPercent().compareTo(BigDecimal.ZERO) > 0
|
||||
&& advice.getUnitCode() != null
|
||||
&& advice.getMinUnitCode() != null
|
||||
&& !advice.getUnitCode().equals(advice.getMinUnitCode())) {
|
||||
BigDecimal partPercent = advice.getPartPercent();
|
||||
BigDecimal[] divideResult = quantity.divideAndRemainder(partPercent);
|
||||
if (quantity.compareTo(partPercent) >= 0 && BigDecimal.ZERO.compareTo(divideResult[1]) == 0) {
|
||||
quantity = divideResult[0];
|
||||
}
|
||||
}
|
||||
|
||||
return quantity.stripTrailingZeros().toPlainString();
|
||||
}
|
||||
|
||||
/**
|
||||
* 医嘱校对通过
|
||||
*
|
||||
|
||||
@@ -90,13 +90,18 @@ public class InpatientAdviceDto {
|
||||
private String lotNumber;
|
||||
|
||||
/** 请求数量 */
|
||||
private Integer quantity;
|
||||
private BigDecimal quantity;
|
||||
|
||||
/** 请求单位编码 */
|
||||
@Dict(dictCode = "unit_code")
|
||||
private String unitCode;
|
||||
private String unitCode_dictText;
|
||||
|
||||
/** 药品最小单位编码 */
|
||||
@Dict(dictCode = "unit_code")
|
||||
private String minUnitCode;
|
||||
private String minUnitCode_dictText;
|
||||
|
||||
/** 请求状态 */
|
||||
private Integer requestStatus;
|
||||
private String requestStatus_enumText;
|
||||
|
||||
@@ -127,6 +127,7 @@
|
||||
ii.lot_number,
|
||||
ii.quantity,
|
||||
ii.unit_code,
|
||||
ii.min_unit_code,
|
||||
ii.request_status,
|
||||
ii.method_code,
|
||||
ii.rate_code,
|
||||
@@ -181,6 +182,7 @@
|
||||
T1.lot_number AS lot_number,
|
||||
T1.quantity AS quantity,
|
||||
T1.unit_code AS unit_code,
|
||||
T2.min_unit_code AS min_unit_code,
|
||||
T1.status_enum AS request_status,
|
||||
T1.method_code AS method_code,
|
||||
T1.rate_code AS rate_code,
|
||||
@@ -329,6 +331,7 @@
|
||||
NULL::varchar AS lot_number,
|
||||
T1.quantity AS quantity,
|
||||
T1.unit_code AS unit_code,
|
||||
NULL::varchar AS min_unit_code,
|
||||
T1.status_enum AS request_status,
|
||||
NULL::varchar AS method_code,
|
||||
T1.rate_code AS rate_code,
|
||||
@@ -466,6 +469,7 @@
|
||||
T1.lot_number AS lot_number,
|
||||
T1.quantity AS quantity,
|
||||
T1.unit_code AS unit_code,
|
||||
NULL::varchar AS min_unit_code,
|
||||
T1.status_enum AS request_status,
|
||||
NULL::varchar AS method_code,
|
||||
T1.rate_code AS rate_code,
|
||||
@@ -583,4 +587,4 @@
|
||||
) AS ii
|
||||
${ew.customSqlSegment}
|
||||
</select>
|
||||
</mapper>
|
||||
</mapper>
|
||||
|
||||
Reference in New Issue
Block a user