|
@@ -1004,25 +1004,13 @@ public class YiZhuLuRuServer {
|
|
|
if (dao.dischargeWithMedicationAdministration(item.getSupplyCode()) == 0) {
|
|
|
errorMessage.add("出院带药给药方式不能包含费用。");
|
|
|
}
|
|
|
- int day = 1;
|
|
|
if (item.getStartTime() == null) {
|
|
|
errorMessage.add("出院带药请输入开始时间。");
|
|
|
}
|
|
|
if (item.getEndTime() == null) {
|
|
|
errorMessage.add("出院带药请输入结束时间。");
|
|
|
}
|
|
|
- if (item.getStartTime() != null && item.getEndTime() != null) {
|
|
|
- long cha = item.getEndTime().getTime() - item.getStartTime().getTime();
|
|
|
- long nd = 1000 * 24 * 60 * 60;
|
|
|
- day = (int) (cha / nd);
|
|
|
- if (day > 出院带药限制天数) {
|
|
|
- errorMessage.add("出院带药天数不得超过 15 天,计算方式结束时间减去开始时间。");
|
|
|
- }
|
|
|
- if (day == 0) {
|
|
|
- day = 1;
|
|
|
- }
|
|
|
- }
|
|
|
- dischargeWithMedicationCollection(getTotal(item, day), detailsOfDrugs, item);
|
|
|
+ item.setDrugOcc(item.getDrugQuan());
|
|
|
} else {
|
|
|
// 计算普通药品的领量 durg_quan durg_occ
|
|
|
calculateDrugAmount(item, detailsOfDrugs);
|
|
@@ -1154,6 +1142,22 @@ public class YiZhuLuRuServer {
|
|
|
return new BigDecimal((day <= 0 ? 1 : day) * times);
|
|
|
}
|
|
|
|
|
|
+ public ResultVo<JSONObject> getFrequencyCount(String code) {
|
|
|
+ // 计算出院带药的领量
|
|
|
+ Map<String, Short> numberOfTimesADay = dao.numberOfTimesADay(code);
|
|
|
+ int times = 0;
|
|
|
+ for (Map.Entry<String, Short> entry : numberOfTimesADay.entrySet()) {
|
|
|
+ if (entry.getValue() != null) {
|
|
|
+ times += entry.getValue();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ JSONObject js = new JSONObject();
|
|
|
+ // 一天几次
|
|
|
+ js.put("count", times);
|
|
|
+ js.put("code", code);
|
|
|
+ return ResultVoUtil.success(js);
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
/***
|
|
|
* 获取项目信息
|
|
@@ -1541,25 +1545,11 @@ public class YiZhuLuRuServer {
|
|
|
Map<String, List<XinZhenYzActOrder>> takeTheMedicineList = new HashMap<>(Capacity.TWO);
|
|
|
|
|
|
for (XinZhenYzActOrder item : patInfo.getList()) {
|
|
|
- XinZhenYzActOrder detailsOfDrugs = dao.getDrugOne(item.getOrderCode() + item.getSerial(), item.getGroupNo());
|
|
|
- int day = 1;
|
|
|
- // 如果是临时医嘱 开了就结束了.
|
|
|
- if ("ONCE".equals(item.getFrequCode())) {
|
|
|
- item.setEndTime(item.getStartTime());
|
|
|
- }
|
|
|
- if (item.getStartTime() != null && item.getEndTime() != null) {
|
|
|
- long cha = item.getEndTime().getTime() - item.getStartTime().getTime();
|
|
|
- long nd = 1000 * 24 * 60 * 60;
|
|
|
- day = (int) (cha / nd);
|
|
|
- if (day == 0) {
|
|
|
- day = 1;
|
|
|
- }
|
|
|
- }
|
|
|
// 计算出院带药的领量
|
|
|
- dischargeWithMedicationCollection(getTotal(item, day), detailsOfDrugs, item);
|
|
|
+// dischargeWithMedicationCollection(getTotal(item, day), detailsOfDrugs, item);
|
|
|
// 在这里更新出院带药领量
|
|
|
- dao.updateThePickup(item);
|
|
|
- // 费用标志为 4 的就是出院带药
|
|
|
+// dao.updateThePickup(item);
|
|
|
+// 费用标志为 4 的就是出院带药
|
|
|
if ("4".equals(item.getSelfBuy())) {
|
|
|
if (takeTheMedicineList.containsKey(item.getGroupNo())) {
|
|
|
takeTheMedicineList.get(item.getGroupNo()).add(item);
|