diff --git a/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/anesthesia/appservice/IAnesthesiaAppService.java b/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/anesthesia/appservice/IAnesthesiaAppService.java new file mode 100644 index 000000000..974d50886 --- /dev/null +++ b/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/anesthesia/appservice/IAnesthesiaAppService.java @@ -0,0 +1,34 @@ +package com.healthlink.his.web.anesthesia.appservice; + +import com.healthlink.his.anesthesia.domain.AnesthesiaFollowup; +import com.healthlink.his.anesthesia.domain.AnesthesiaIoRecord; +import com.healthlink.his.anesthesia.domain.AnesthesiaMedication; +import com.healthlink.his.anesthesia.domain.AnesthesiaRecord; +import com.healthlink.his.anesthesia.domain.AnesthesiaVitalSign; +import com.healthlink.his.anesthesia.dto.AnesthesiaIoSummaryDto; +import com.healthlink.his.anesthesia.dto.AnesthesiaRecordDetailDto; + +import java.util.List; + +public interface IAnesthesiaAppService { + + AnesthesiaRecord createRecord(AnesthesiaRecord record); + + AnesthesiaRecord updateRecord(AnesthesiaRecord record); + + AnesthesiaRecordDetailDto getRecordDetail(Long recordId); + + AnesthesiaVitalSign addVitalSign(AnesthesiaVitalSign vitalSign); + + List batchAddVitalSigns(List vitalSigns); + + AnesthesiaMedication addMedication(AnesthesiaMedication medication); + + AnesthesiaIoRecord addIoRecord(AnesthesiaIoRecord ioRecord); + + AnesthesiaFollowup createFollowup(AnesthesiaFollowup followup); + + AnesthesiaIoSummaryDto getIoSummary(Long recordId); + + void completeRecord(Long recordId); +} diff --git a/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/anesthesia/appservice/impl/AnesthesiaAppServiceImpl.java b/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/anesthesia/appservice/impl/AnesthesiaAppServiceImpl.java new file mode 100644 index 000000000..8c6bf041b --- /dev/null +++ b/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/anesthesia/appservice/impl/AnesthesiaAppServiceImpl.java @@ -0,0 +1,128 @@ +package com.healthlink.his.web.anesthesia.appservice.impl; + +import com.healthlink.his.anesthesia.domain.AnesthesiaFollowup; +import com.healthlink.his.anesthesia.domain.AnesthesiaIoRecord; +import com.healthlink.his.anesthesia.domain.AnesthesiaMedication; +import com.healthlink.his.anesthesia.domain.AnesthesiaRecord; +import com.healthlink.his.anesthesia.domain.AnesthesiaVitalSign; +import com.healthlink.his.anesthesia.dto.AnesthesiaIoSummaryDto; +import com.healthlink.his.anesthesia.dto.AnesthesiaRecordDetailDto; +import com.healthlink.his.anesthesia.service.IAnesthesiaFollowupService; +import com.healthlink.his.anesthesia.service.IAnesthesiaIoRecordService; +import com.healthlink.his.anesthesia.service.IAnesthesiaMedicationService; +import com.healthlink.his.anesthesia.service.IAnesthesiaRecordService; +import com.healthlink.his.anesthesia.service.IAnesthesiaVitalSignService; +import com.healthlink.his.web.anesthesia.appservice.IAnesthesiaAppService; +import jakarta.annotation.Resource; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.math.BigDecimal; +import java.util.Date; +import java.util.List; + +@Service +public class AnesthesiaAppServiceImpl implements IAnesthesiaAppService { + + @Resource + private IAnesthesiaRecordService anesthesiaRecordService; + + @Resource + private IAnesthesiaVitalSignService anesthesiaVitalSignService; + + @Resource + private IAnesthesiaMedicationService anesthesiaMedicationService; + + @Resource + private IAnesthesiaIoRecordService anesthesiaIoRecordService; + + @Resource + private IAnesthesiaFollowupService anesthesiaFollowupService; + + @Override + @Transactional + public AnesthesiaRecord createRecord(AnesthesiaRecord record) { + record.setStatus("DRAFT"); + anesthesiaRecordService.save(record); + return record; + } + + @Override + @Transactional + public AnesthesiaRecord updateRecord(AnesthesiaRecord record) { + anesthesiaRecordService.updateById(record); + return record; + } + + @Override + public AnesthesiaRecordDetailDto getRecordDetail(Long recordId) { + AnesthesiaRecord record = anesthesiaRecordService.getById(recordId); + List vitalSigns = anesthesiaVitalSignService.selectByRecordId(recordId); + List medications = anesthesiaMedicationService.selectByRecordId(recordId); + List ioRecords = anesthesiaIoRecordService.selectByRecordId(recordId); + List followups = anesthesiaFollowupService.selectByRecordId(recordId); + + return new AnesthesiaRecordDetailDto() + .setRecord(record) + .setVitalSigns(vitalSigns) + .setMedications(medications) + .setIoRecords(ioRecords) + .setFollowups(followups); + } + + @Override + @Transactional + public AnesthesiaVitalSign addVitalSign(AnesthesiaVitalSign vitalSign) { + anesthesiaVitalSignService.save(vitalSign); + return vitalSign; + } + + @Override + @Transactional + public List batchAddVitalSigns(List vitalSigns) { + anesthesiaVitalSignService.saveBatch(vitalSigns); + return vitalSigns; + } + + @Override + @Transactional + public AnesthesiaMedication addMedication(AnesthesiaMedication medication) { + anesthesiaMedicationService.save(medication); + return medication; + } + + @Override + @Transactional + public AnesthesiaIoRecord addIoRecord(AnesthesiaIoRecord ioRecord) { + anesthesiaIoRecordService.save(ioRecord); + return ioRecord; + } + + @Override + @Transactional + public AnesthesiaFollowup createFollowup(AnesthesiaFollowup followup) { + anesthesiaFollowupService.save(followup); + return followup; + } + + @Override + public AnesthesiaIoSummaryDto getIoSummary(Long recordId) { + BigDecimal totalInput = anesthesiaIoRecordService.calculateTotalInput(recordId); + BigDecimal totalOutput = anesthesiaIoRecordService.calculateTotalOutput(recordId); + BigDecimal balance = totalInput.subtract(totalOutput); + + return new AnesthesiaIoSummaryDto() + .setTotalInput(totalInput) + .setTotalOutput(totalOutput) + .setBalance(balance); + } + + @Override + @Transactional + public void completeRecord(Long recordId) { + AnesthesiaRecord record = anesthesiaRecordService.getById(recordId); + record.setStatus("COMPLETED"); + record.setEndTime(new Date()); + anesthesiaRecordService.updateById(record); + } +} diff --git a/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/anesthesia/controller/AnesthesiaController.java b/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/anesthesia/controller/AnesthesiaController.java new file mode 100644 index 000000000..6047e16ef --- /dev/null +++ b/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/anesthesia/controller/AnesthesiaController.java @@ -0,0 +1,137 @@ +package com.healthlink.his.web.anesthesia.controller; + +import com.core.common.core.domain.R; +import com.healthlink.his.anesthesia.domain.AnesthesiaFollowup; +import com.healthlink.his.anesthesia.domain.AnesthesiaIoRecord; +import com.healthlink.his.anesthesia.domain.AnesthesiaMedication; +import com.healthlink.his.anesthesia.domain.AnesthesiaRecord; +import com.healthlink.his.anesthesia.domain.AnesthesiaVitalSign; +import com.healthlink.his.anesthesia.dto.AnesthesiaIoSummaryDto; +import com.healthlink.his.anesthesia.dto.AnesthesiaRecordDetailDto; +import com.healthlink.his.anesthesia.service.IAnesthesiaFollowupService; +import com.healthlink.his.anesthesia.service.IAnesthesiaIoRecordService; +import com.healthlink.his.anesthesia.service.IAnesthesiaMedicationService; +import com.healthlink.his.anesthesia.service.IAnesthesiaRecordService; +import com.healthlink.his.anesthesia.service.IAnesthesiaVitalSignService; +import com.healthlink.his.web.anesthesia.appservice.IAnesthesiaAppService; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; +import jakarta.annotation.Resource; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +@RestController +@RequestMapping("/healthlink-his/api/v1/anesthesia") +@Tag(name = "麻醉记录管理") +public class AnesthesiaController { + + @Resource + private IAnesthesiaAppService anesthesiaAppService; + + @Resource + private IAnesthesiaRecordService anesthesiaRecordService; + + @Resource + private IAnesthesiaVitalSignService anesthesiaVitalSignService; + + @Resource + private IAnesthesiaMedicationService anesthesiaMedicationService; + + @Resource + private IAnesthesiaIoRecordService anesthesiaIoRecordService; + + @Resource + private IAnesthesiaFollowupService anesthesiaFollowupService; + + @PostMapping("/record") + @Operation(summary = "创建麻醉记录") + public R createRecord(@RequestBody AnesthesiaRecord record) { + return R.ok(anesthesiaAppService.createRecord(record)); + } + + @PutMapping("/record") + @Operation(summary = "更新麻醉记录") + public R updateRecord(@RequestBody AnesthesiaRecord record) { + return R.ok(anesthesiaAppService.updateRecord(record)); + } + + @GetMapping("/record/{id}") + @Operation(summary = "获取麻醉记录详情") + public R getRecordDetail(@PathVariable Long id) { + return R.ok(anesthesiaAppService.getRecordDetail(id)); + } + + @GetMapping("/record/encounter/{encounterId}") + @Operation(summary = "按就诊查询麻醉记录") + public R> getByEncounter(@PathVariable Long encounterId) { + return R.ok(anesthesiaRecordService.selectByEncounterId(encounterId)); + } + + @PostMapping("/vital-sign") + @Operation(summary = "添加生命体征") + public R addVitalSign(@RequestBody AnesthesiaVitalSign vitalSign) { + return R.ok(anesthesiaAppService.addVitalSign(vitalSign)); + } + + @PostMapping("/vital-sign/batch") + @Operation(summary = "批量添加生命体征") + public R> batchAddVitalSigns(@RequestBody List vitalSigns) { + return R.ok(anesthesiaAppService.batchAddVitalSigns(vitalSigns)); + } + + @GetMapping("/vital-sign/{recordId}") + @Operation(summary = "查询生命体征列表") + public R> getVitalSigns(@PathVariable Long recordId) { + return R.ok(anesthesiaVitalSignService.selectByRecordId(recordId)); + } + + @PostMapping("/medication") + @Operation(summary = "添加用药记录") + public R addMedication(@RequestBody AnesthesiaMedication medication) { + return R.ok(anesthesiaAppService.addMedication(medication)); + } + + @GetMapping("/medication/{recordId}") + @Operation(summary = "查询用药列表") + public R> getMedications(@PathVariable Long recordId) { + return R.ok(anesthesiaMedicationService.selectByRecordId(recordId)); + } + + @PostMapping("/io-record") + @Operation(summary = "添加出入量记录") + public R addIoRecord(@RequestBody AnesthesiaIoRecord ioRecord) { + return R.ok(anesthesiaAppService.addIoRecord(ioRecord)); + } + + @GetMapping("/io-record/{recordId}") + @Operation(summary = "查询出入量列表") + public R> getIoRecords(@PathVariable Long recordId) { + return R.ok(anesthesiaIoRecordService.selectByRecordId(recordId)); + } + + @GetMapping("/io-summary/{recordId}") + @Operation(summary = "出入量汇总") + public R getIoSummary(@PathVariable Long recordId) { + return R.ok(anesthesiaAppService.getIoSummary(recordId)); + } + + @PostMapping("/followup") + @Operation(summary = "创建术后随访") + public R createFollowup(@RequestBody AnesthesiaFollowup followup) { + return R.ok(anesthesiaAppService.createFollowup(followup)); + } + + @GetMapping("/followup/{recordId}") + @Operation(summary = "查询随访列表") + public R> getFollowups(@PathVariable Long recordId) { + return R.ok(anesthesiaFollowupService.selectByRecordId(recordId)); + } + + @PutMapping("/complete/{id}") + @Operation(summary = "完成麻醉记录") + public R completeRecord(@PathVariable Long id) { + anesthesiaAppService.completeRecord(id); + return R.ok(); + } +} diff --git a/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/mrhomepage/appservice/IMrHomepageAppService.java b/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/mrhomepage/appservice/IMrHomepageAppService.java new file mode 100644 index 000000000..55eb68183 --- /dev/null +++ b/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/mrhomepage/appservice/IMrHomepageAppService.java @@ -0,0 +1,22 @@ +package com.healthlink.his.web.mrhomepage.appservice; + +import com.healthlink.his.mrhomepage.domain.MrHomepage; +import com.healthlink.his.mrhomepage.domain.MrHomepageQualityCheck; + +import java.util.List; +import java.util.Map; + +public interface IMrHomepageAppService { + + MrHomepage generateHomepage(Long encounterId); + + MrHomepage updateHomepage(MrHomepage homepage); + + Map getHomepageDetail(Long homepageId); + + List executeQualityCheck(Long homepageId); + + Map getHomepageStatistics(String startDate, String endDate); + + void submitHomepage(Long homepageId); +} diff --git a/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/mrhomepage/appservice/impl/MrHomepageAppServiceImpl.java b/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/mrhomepage/appservice/impl/MrHomepageAppServiceImpl.java new file mode 100644 index 000000000..2b6384256 --- /dev/null +++ b/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/mrhomepage/appservice/impl/MrHomepageAppServiceImpl.java @@ -0,0 +1,83 @@ +package com.healthlink.his.web.mrhomepage.appservice.impl; + +import com.healthlink.his.mrhomepage.domain.MrHomepage; +import com.healthlink.his.mrhomepage.domain.MrHomepageQualityCheck; +import com.healthlink.his.mrhomepage.service.IMrHomepageQualityCheckService; +import com.healthlink.his.mrhomepage.service.IMrHomepageService; +import com.healthlink.his.web.mrhomepage.appservice.IMrHomepageAppService; +import jakarta.annotation.Resource; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.math.BigDecimal; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +@Service +public class MrHomepageAppServiceImpl implements IMrHomepageAppService { + + @Resource + private IMrHomepageService mrHomepageService; + + @Resource + private IMrHomepageQualityCheckService mrHomepageQualityCheckService; + + @Override + @Transactional + public MrHomepage generateHomepage(Long encounterId) { + MrHomepage homepage = new MrHomepage() + .setEncounterId(encounterId) + .setQualityStatus("DRAFT") + .setTotalCost(BigDecimal.ZERO) + .setSelfPayCost(BigDecimal.ZERO) + .setInsuranceCost(BigDecimal.ZERO) + .setDrugCost(BigDecimal.ZERO) + .setExaminationCost(BigDecimal.ZERO) + .setLabCost(BigDecimal.ZERO) + .setTreatmentCost(BigDecimal.ZERO) + .setMaterialCost(BigDecimal.ZERO); + mrHomepageService.save(homepage); + return homepage; + } + + @Override + @Transactional + public MrHomepage updateHomepage(MrHomepage homepage) { + mrHomepageService.updateById(homepage); + return homepage; + } + + @Override + public Map getHomepageDetail(Long homepageId) { + MrHomepage homepage = mrHomepageService.getById(homepageId); + List qualityChecks = + mrHomepageQualityCheckService.selectByHomepageId(homepageId); + + Map detail = new HashMap<>(); + detail.put("homepage", homepage); + detail.put("qualityChecks", qualityChecks); + return detail; + } + + @Override + @Transactional + public List executeQualityCheck(Long homepageId) { + return mrHomepageQualityCheckService.executeAutoCheck(homepageId); + } + + @Override + public Map getHomepageStatistics(String startDate, String endDate) { + return mrHomepageService.selectStatistics(startDate, endDate); + } + + @Override + @Transactional + public void submitHomepage(Long homepageId) { + MrHomepage homepage = mrHomepageService.getById(homepageId); + homepage.setQualityStatus("SUBMITTED"); + homepage.setSubmitTime(new Date()); + mrHomepageService.updateById(homepage); + } +} diff --git a/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/mrhomepage/controller/MrHomepageController.java b/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/mrhomepage/controller/MrHomepageController.java new file mode 100644 index 000000000..9be410094 --- /dev/null +++ b/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/mrhomepage/controller/MrHomepageController.java @@ -0,0 +1,81 @@ +package com.healthlink.his.web.mrhomepage.controller; + +import com.core.common.core.domain.R; +import com.healthlink.his.mrhomepage.domain.MrHomepage; +import com.healthlink.his.mrhomepage.domain.MrHomepageQualityCheck; +import com.healthlink.his.mrhomepage.service.IMrHomepageQualityCheckService; +import com.healthlink.his.mrhomepage.service.IMrHomepageService; +import com.healthlink.his.web.mrhomepage.appservice.IMrHomepageAppService; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; +import jakarta.annotation.Resource; +import org.springframework.web.bind.annotation.*; + +import java.util.List; +import java.util.Map; + +@RestController +@RequestMapping("/healthlink-his/api/v1/mr-homepage") +@Tag(name = "病案首页管理") +public class MrHomepageController { + + @Resource + private IMrHomepageAppService mrHomepageAppService; + + @Resource + private IMrHomepageService mrHomepageService; + + @Resource + private IMrHomepageQualityCheckService mrHomepageQualityCheckService; + + @PostMapping("/generate") + @Operation(summary = "自动生成病案首页") + public R generateHomepage(@RequestParam Long encounterId) { + return R.ok(mrHomepageAppService.generateHomepage(encounterId)); + } + + @PutMapping + @Operation(summary = "更新病案首页") + public R updateHomepage(@RequestBody MrHomepage homepage) { + return R.ok(mrHomepageAppService.updateHomepage(homepage)); + } + + @GetMapping("/{id}") + @Operation(summary = "获取病案首页详情") + public R> getHomepageDetail(@PathVariable Long id) { + return R.ok(mrHomepageAppService.getHomepageDetail(id)); + } + + @GetMapping("/encounter/{encounterId}") + @Operation(summary = "按就诊查询病案首页") + public R> getByEncounter(@PathVariable Long encounterId) { + return R.ok(mrHomepageService.selectByEncounterId(encounterId)); + } + + @PostMapping("/quality-check/{id}") + @Operation(summary = "执行质控检查") + public R> executeQualityCheck(@PathVariable Long id) { + return R.ok(mrHomepageAppService.executeQualityCheck(id)); + } + + @GetMapping("/quality-check/{homepageId}") + @Operation(summary = "查询质控记录") + public R> getQualityChecks(@PathVariable Long homepageId) { + return R.ok(mrHomepageQualityCheckService.selectByHomepageId(homepageId)); + } + + @GetMapping("/statistics") + @Operation(summary = "统计查询") + public R> getStatistics( + @RequestParam String startDate, + @RequestParam String endDate) { + return R.ok(mrHomepageAppService.getHomepageStatistics(startDate, endDate)); + } + + @PutMapping("/submit/{id}") + @Operation(summary = "提交病案首页") + public R submitHomepage(@PathVariable Long id) { + mrHomepageAppService.submitHomepage(id); + return R.ok(); + } +} diff --git a/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/rationaldrug/appservice/IRationalDrugAppService.java b/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/rationaldrug/appservice/IRationalDrugAppService.java new file mode 100644 index 000000000..0e8aa9fd4 --- /dev/null +++ b/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/rationaldrug/appservice/IRationalDrugAppService.java @@ -0,0 +1,77 @@ +package com.healthlink.his.web.rationaldrug.appservice; + +import com.healthlink.his.rationaldrug.domain.DrugInteractionRule; +import com.healthlink.his.rationaldrug.domain.DrugDosageRange; +import com.healthlink.his.rationaldrug.dto.AuditResultDto; +import com.healthlink.his.rationaldrug.dto.AuditStatisticsDto; +import com.healthlink.his.rationaldrug.dto.InteractionCheckResultDto; +import com.healthlink.his.rationaldrug.dto.PrescriptionAuditDto; + +import java.math.BigDecimal; +import java.util.List; +import java.util.Map; + +/** + * 合理用药应用服务接口 + * + * @author system + */ +public interface IRationalDrugAppService { + + /** + * 审核处方 + * + * @param dto 处方审核请求 + * @return 审核结果 + */ + AuditResultDto auditPrescription(PrescriptionAuditDto dto); + + /** + * 批量审核处方 + * + * @param prescriptionIds 处方ID列表 + * @return 各处方审核结果 + */ + List batchAudit(List prescriptionIds); + + /** + * 获取审核统计数据 + * + * @return 审核统计 + */ + AuditStatisticsDto getAuditStatistics(); + + /** + * 获取审核趋势数据 + * + * @param startDate 起始日期 + * @return 趋势数据 + */ + List> getAuditTrend(String startDate); + + /** + * 根据就诊ID查询审核记录 + * + * @param encounterId 就诊ID + * @return 审核记录列表 + */ + List> getAuditLogByEncounterId(Long encounterId); + + /** + * 配伍禁忌检查 + * + * @param drugCodes 药品编码列表 + * @return 配伍禁忌检查结果列表 + */ + List checkInteraction(List drugCodes); + + /** + * 剂量检查 + * + * @param drugCode 药品编码 + * @param dosage 剂量 + * @param population 人群类型 + * @return 审核结果 + */ + AuditResultDto checkDosage(String drugCode, BigDecimal dosage, String population); +} diff --git a/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/rationaldrug/appservice/impl/RationalDrugAppServiceImpl.java b/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/rationaldrug/appservice/impl/RationalDrugAppServiceImpl.java new file mode 100644 index 000000000..b30e1295c --- /dev/null +++ b/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/rationaldrug/appservice/impl/RationalDrugAppServiceImpl.java @@ -0,0 +1,313 @@ +package com.healthlink.his.web.rationaldrug.appservice.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.healthlink.his.rationaldrug.domain.DrugDosageRange; +import com.healthlink.his.rationaldrug.domain.DrugInteractionRule; +import com.healthlink.his.rationaldrug.domain.PrescriptionAuditLog; +import com.healthlink.his.rationaldrug.dto.AuditResultDto; +import com.healthlink.his.rationaldrug.dto.AuditStatisticsDto; +import com.healthlink.his.rationaldrug.dto.InteractionCheckResultDto; +import com.healthlink.his.rationaldrug.dto.PrescriptionAuditDto; +import com.healthlink.his.rationaldrug.service.IDrugDosageRangeService; +import com.healthlink.his.rationaldrug.service.IDrugInteractionRuleService; +import com.healthlink.his.rationaldrug.service.IPrescriptionAuditLogService; +import com.healthlink.his.web.rationaldrug.appservice.IRationalDrugAppService; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.math.BigDecimal; +import java.math.RoundingMode; +import java.util.*; +import java.util.stream.Collectors; + +/** + * 合理用药应用服务实现 + *

+ * 核心审核逻辑:配伍禁忌检查 + 剂量范围检查 → 生成 PASS/REJECT/MANUAL 结果 + *

+ * + * @author system + */ +@Service +@AllArgsConstructor +@Slf4j +public class RationalDrugAppServiceImpl implements IRationalDrugAppService { + + private final IDrugInteractionRuleService drugInteractionRuleService; + private final IPrescriptionAuditLogService prescriptionAuditLogService; + private final IDrugDosageRangeService drugDosageRangeService; + + /** + * 审核处方 — 核心方法 + *

+ * 流程:配伍禁忌检查 → 剂量范围检查 → 汇总结果 → 写入审核日志 + *

+ */ + @Override + @Transactional(rollbackFor = Exception.class) + public AuditResultDto auditPrescription(PrescriptionAuditDto dto) { + List drugCodes = dto.getDrugCodes(); + if (drugCodes == null || drugCodes.isEmpty()) { + return buildResult("PASS", null, 0, "无药品信息,跳过审核", null); + } + + List hitRules = new ArrayList<>(); + List details = new ArrayList<>(); + String worstSeverity = null; + + // 1. 配伍禁忌检查 + List interactions = checkInteraction(drugCodes); + for (InteractionCheckResultDto interaction : interactions) { + if (Boolean.TRUE.equals(interaction.getHasInteraction())) { + hitRules.add(interaction.getSeverity() + ":" + interaction.getDescription()); + details.add(interaction.getDescription() + " — " + interaction.getSuggestion()); + worstSeverity = mergeSeverity(worstSeverity, interaction.getSeverity()); + } + } + + // 2. 剂量范围检查(仅在有 population 时) + if (dto.getPopulation() != null) { + for (String drugCode : drugCodes) { + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(DrugDosageRange::getDrugCode, drugCode) + .eq(DrugDosageRange::getPopulation, dto.getPopulation()) + .eq(DrugDosageRange::getEnabled, "1") + .eq(DrugDosageRange::getDelFlag, "0") + .last("LIMIT 1"); + DrugDosageRange range = drugDosageRangeService.getOne(wrapper); + if (range == null) { + details.add("药品 " + drugCode + " 无对应人群剂量规则"); + hitRules.add("DOSAGE_NOT_FOUND:" + drugCode); + } + } + } + + // 3. 汇总结果 + int hitCount = hitRules.size(); + String auditResult; + String suggestion; + + if (hitCount == 0) { + auditResult = "PASS"; + suggestion = "处方审核通过,无配伍禁忌或剂量异常"; + } else if ("CRITICAL".equals(worstSeverity)) { + auditResult = "REJECT"; + suggestion = "存在禁忌级配伍冲突,建议重新开具处方"; + } else if ("MAJOR".equals(worstSeverity)) { + auditResult = "MANUAL"; + suggestion = "存在严重配伍问题,建议人工复核"; + } else { + auditResult = "MANUAL"; + suggestion = "存在一般性配伍或剂量问题,建议人工复核"; + } + + AuditResultDto result = buildResult(auditResult, String.join("; ", hitRules), + hitCount, String.join("\n", details), suggestion); + + // 4. 写入审核日志 + saveAuditLog(dto, result); + + return result; + } + + /** + * 批量审核处方 + */ + @Override + public List batchAudit(List prescriptionIds) { + List results = new ArrayList<>(); + for (Long prescriptionId : prescriptionIds) { + PrescriptionAuditDto dto = new PrescriptionAuditDto() + .setPrescriptionId(prescriptionId); + results.add(auditPrescription(dto)); + } + return results; + } + + /** + * 获取审核统计数据 + */ + @Override + public AuditStatisticsDto getAuditStatistics() { + List> stats = prescriptionAuditLogService.selectAuditStatistics(); + AuditStatisticsDto dto = new AuditStatisticsDto(); + long total = 0, passCount = 0, rejectCount = 0, manualCount = 0; + + for (Map row : stats) { + String result = (String) row.get("audit_result"); + long count = ((Number) row.get("count")).longValue(); + total += count; + switch (result) { + case "PASS" -> passCount = count; + case "REJECT" -> rejectCount = count; + case "MANUAL" -> manualCount = count; + default -> {} + } + } + + dto.setTotal(total); + dto.setPassCount(passCount); + dto.setRejectCount(rejectCount); + dto.setManualCount(manualCount); + dto.setPassRate(total > 0 + ? BigDecimal.valueOf(passCount).multiply(BigDecimal.valueOf(100)) + .divide(BigDecimal.valueOf(total), 2, RoundingMode.HALF_UP) + : BigDecimal.ZERO); + return dto; + } + + /** + * 获取审核趋势数据 + */ + @Override + public List> getAuditTrend(String startDate) { + return prescriptionAuditLogService.selectAuditTrend(startDate); + } + + /** + * 根据就诊ID查询审核记录 + */ + @Override + public List> getAuditLogByEncounterId(Long encounterId) { + List logs = prescriptionAuditLogService.selectByEncounterId(encounterId); + return logs.stream().map(log -> { + Map map = new LinkedHashMap<>(); + map.put("id", log.getId()); + map.put("prescriptionId", log.getPrescriptionId()); + map.put("patientName", log.getPatientName()); + map.put("doctorName", log.getDoctorName()); + map.put("auditResult", log.getAuditResult()); + map.put("ruleHit", log.getRuleHit()); + map.put("hitCount", log.getHitCount()); + map.put("detail", log.getDetail()); + map.put("suggestion", log.getSuggestion()); + map.put("auditTime", log.getAuditTime()); + map.put("createTime", log.getCreateTime()); + return map; + }).collect(Collectors.toList()); + } + + /** + * 配伍禁忌检查 — 检查药品列表中所有两两组合 + */ + @Override + public List checkInteraction(List drugCodes) { + List results = new ArrayList<>(); + if (drugCodes == null || drugCodes.size() < 2) { + return results; + } + + for (int i = 0; i < drugCodes.size(); i++) { + for (int j = i + 1; j < drugCodes.size(); j++) { + List rules = drugInteractionRuleService + .selectInteractions(drugCodes.get(i), drugCodes.get(j)); + if (rules.isEmpty()) { + InteractionCheckResultDto dto = new InteractionCheckResultDto(); + dto.setHasInteraction(false); + dto.setDescription("药品 " + drugCodes.get(i) + " 与 " + drugCodes.get(j) + " 未发现配伍禁忌"); + results.add(dto); + } else { + for (DrugInteractionRule rule : rules) { + InteractionCheckResultDto dto = new InteractionCheckResultDto(); + dto.setHasInteraction(true); + dto.setSeverity(rule.getSeverity()); + dto.setDescription(rule.getDrugAName() + " 与 " + rule.getDrugBName() + ": " + rule.getDescription()); + dto.setSuggestion(rule.getSuggestion()); + results.add(dto); + } + } + } + } + return results; + } + + /** + * 剂量检查 + */ + @Override + public AuditResultDto checkDosage(String drugCode, BigDecimal dosage, String population) { + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(DrugDosageRange::getDrugCode, drugCode) + .eq(DrugDosageRange::getPopulation, population) + .eq(DrugDosageRange::getEnabled, "1") + .eq(DrugDosageRange::getDelFlag, "0") + .last("LIMIT 1"); + DrugDosageRange range = drugDosageRangeService.getOne(wrapper); + + if (range == null) { + return buildResult("MANUAL", "DOSAGE_NOT_FOUND", 1, + "药品 " + drugCode + " 无对应人群 " + population + " 的剂量规则", + "建议人工确认剂量合理性"); + } + + if (dosage.compareTo(range.getMinDose()) < 0) { + return buildResult("REJECT", "DOSAGE_BELOW_MIN", 1, + "剂量 " + dosage + range.getDoseUnit() + " 低于最小剂量 " + range.getMinDose() + range.getDoseUnit(), + "建议调整剂量至 " + range.getMinDose() + "-" + range.getMaxDose() + range.getDoseUnit()); + } + + if (dosage.compareTo(range.getMaxDose()) > 0) { + return buildResult("REJECT", "DOSAGE_ABOVE_MAX", 1, + "剂量 " + dosage + range.getDoseUnit() + " 超过最大剂量 " + range.getMaxDose() + range.getDoseUnit(), + "建议调整剂量至 " + range.getMinDose() + "-" + range.getMaxDose() + range.getDoseUnit()); + } + + return buildResult("PASS", null, 0, "剂量在合理范围内", null); + } + + /** + * 保存审核日志 + */ + private void saveAuditLog(PrescriptionAuditDto dto, AuditResultDto result) { + PrescriptionAuditLog logEntity = new PrescriptionAuditLog() + .setPrescriptionId(dto.getPrescriptionId()) + .setEncounterId(dto.getEncounterId()) + .setPatientId(dto.getPatientId()) + .setPatientName(dto.getPatientName()) + .setDoctorId(dto.getDoctorId()) + .setDoctorName(dto.getDoctorName()) + .setAuditResult(result.getAuditResult()) + .setAuditType("AUTO") + .setRuleHit(result.getRuleHit()) + .setHitCount(result.getHitCount()) + .setDetail(result.getDetail()) + .setSuggestion(result.getSuggestion()) + .setAuditTime(new Date()); + prescriptionAuditLogService.save(logEntity); + } + + /** + * 构建审核结果DTO + */ + private AuditResultDto buildResult(String auditResult, String ruleHit, + Integer hitCount, String detail, String suggestion) { + AuditResultDto dto = new AuditResultDto(); + dto.setAuditResult(auditResult); + dto.setRuleHit(ruleHit); + dto.setHitCount(hitCount); + dto.setDetail(detail); + dto.setSuggestion(suggestion); + return dto; + } + + /** + * 合并严重程度取最严重 + */ + private String mergeSeverity(String current, String candidate) { + if (current == null) return candidate; + int currentLevel = severityLevel(current); + int candidateLevel = severityLevel(candidate); + return candidateLevel > currentLevel ? candidate : current; + } + + private int severityLevel(String severity) { + return switch (severity) { + case "CRITICAL" -> 3; + case "MAJOR" -> 2; + case "MODERATE" -> 1; + default -> 0; + }; + } +} diff --git a/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/rationaldrug/controller/RationalDrugController.java b/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/rationaldrug/controller/RationalDrugController.java new file mode 100644 index 000000000..39a8781d9 --- /dev/null +++ b/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/rationaldrug/controller/RationalDrugController.java @@ -0,0 +1,130 @@ +package com.healthlink.his.web.rationaldrug.controller; + +import com.core.common.core.domain.AjaxResult; +import com.healthlink.his.rationaldrug.domain.DrugDosageRange; +import com.healthlink.his.rationaldrug.domain.DrugInteractionRule; +import com.healthlink.his.rationaldrug.dto.AuditResultDto; +import com.healthlink.his.rationaldrug.dto.AuditStatisticsDto; +import com.healthlink.his.rationaldrug.dto.InteractionCheckResultDto; +import com.healthlink.his.rationaldrug.dto.PrescriptionAuditDto; +import com.healthlink.his.rationaldrug.service.IDrugDosageRangeService; +import com.healthlink.his.rationaldrug.service.IDrugInteractionRuleService; +import com.healthlink.his.web.rationaldrug.appservice.IRationalDrugAppService; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.web.bind.annotation.*; + +import java.math.BigDecimal; +import java.util.List; +import java.util.Map; + +/** + * 合理用药管理Controller + * + * @author system + */ +@RestController +@RequestMapping("/healthlink-his/api/v1/rational-drug") +@AllArgsConstructor +@Slf4j +@Tag(name = "合理用药管理") +public class RationalDrugController { + + private final IRationalDrugAppService rationalDrugAppService; + private final IDrugInteractionRuleService drugInteractionRuleService; + private final IDrugDosageRangeService drugDosageRangeService; + + // ==================== 审核相关接口 ==================== + + @PostMapping("/audit") + @Operation(summary = "处方审核") + public AjaxResult auditPrescription(@RequestBody PrescriptionAuditDto dto) { + AuditResultDto result = rationalDrugAppService.auditPrescription(dto); + return AjaxResult.success(result); + } + + @PostMapping("/batch-audit") + @Operation(summary = "批量审核") + public AjaxResult batchAudit(@RequestBody List prescriptionIds) { + List results = rationalDrugAppService.batchAudit(prescriptionIds); + return AjaxResult.success(results); + } + + @GetMapping("/statistics") + @Operation(summary = "审核统计") + public AjaxResult getAuditStatistics() { + AuditStatisticsDto statistics = rationalDrugAppService.getAuditStatistics(); + return AjaxResult.success(statistics); + } + + @GetMapping("/trend") + @Operation(summary = "审核趋势") + public AjaxResult getAuditTrend(@RequestParam String startDate) { + List> trend = rationalDrugAppService.getAuditTrend(startDate); + return AjaxResult.success(trend); + } + + @GetMapping("/audit-log/{encounterId}") + @Operation(summary = "审核记录") + public AjaxResult getAuditLogByEncounterId(@PathVariable Long encounterId) { + List> logs = rationalDrugAppService.getAuditLogByEncounterId(encounterId); + return AjaxResult.success(logs); + } + + // ==================== 配伍禁忌相关接口 ==================== + + @PostMapping("/check-interaction") + @Operation(summary = "配伍禁忌检查") + public AjaxResult checkInteraction(@RequestBody List drugCodes) { + List results = rationalDrugAppService.checkInteraction(drugCodes); + return AjaxResult.success(results); + } + + @GetMapping("/interaction-rules") + @Operation(summary = "配伍禁忌规则列表") + public AjaxResult listInteractionRules() { + List rules = drugInteractionRuleService.list(); + return AjaxResult.success(rules); + } + + @PostMapping("/interaction-rules") + @Operation(summary = "新增配伍禁忌规则") + public AjaxResult addInteractionRule(@RequestBody DrugInteractionRule rule) { + drugInteractionRuleService.save(rule); + return AjaxResult.success(); + } + + @PutMapping("/interaction-rules") + @Operation(summary = "修改配伍禁忌规则") + public AjaxResult updateInteractionRule(@RequestBody DrugInteractionRule rule) { + drugInteractionRuleService.updateById(rule); + return AjaxResult.success(); + } + + @DeleteMapping("/interaction-rules/{id}") + @Operation(summary = "删除配伍禁忌规则") + public AjaxResult deleteInteractionRule(@PathVariable Long id) { + drugInteractionRuleService.removeById(id); + return AjaxResult.success(); + } + + // ==================== 剂量规则相关接口 ==================== + + @GetMapping("/dosage-rules") + @Operation(summary = "剂量规则列表") + public AjaxResult listDosageRules() { + List rules = drugDosageRangeService.list(); + return AjaxResult.success(rules); + } + + @PostMapping("/check-dosage") + @Operation(summary = "剂量检查") + public AjaxResult checkDosage(@RequestParam String drugCode, + @RequestParam BigDecimal dosage, + @RequestParam String population) { + AuditResultDto result = rationalDrugAppService.checkDosage(drugCode, dosage, population); + return AjaxResult.success(result); + } +} diff --git a/healthlink-his-server/healthlink-his-application/src/main/resources/db/migration/V2__rational_drug_system.sql b/healthlink-his-server/healthlink-his-application/src/main/resources/db/migration/V2__rational_drug_system.sql new file mode 100644 index 000000000..333c2c83c --- /dev/null +++ b/healthlink-his-server/healthlink-his-application/src/main/resources/db/migration/V2__rational_drug_system.sql @@ -0,0 +1,86 @@ +-- ============================================================ +-- V2: 合理用药系统 — 配伍禁忌规则 + 处方审核日志 +-- ============================================================ + +-- 配伍禁忌规则表 +CREATE TABLE drug_interaction_rule ( + id BIGSERIAL PRIMARY KEY, + drug_a_code VARCHAR(32) NOT NULL, + drug_a_name VARCHAR(128), + drug_b_code VARCHAR(32) NOT NULL, + drug_b_name VARCHAR(128), + severity VARCHAR(16) NOT NULL DEFAULT 'MODERATE', + description TEXT, + suggestion TEXT, + enabled CHAR(1) DEFAULT '1', + del_flag CHAR(1) DEFAULT '0', + create_by VARCHAR(64), + create_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP, + update_by VARCHAR(64), + update_time TIMESTAMP, + tenant_id VARCHAR(20) DEFAULT '0' +); + +COMMENT ON TABLE drug_interaction_rule IS '配伍禁忌规则表'; +COMMENT ON COLUMN drug_interaction_rule.severity IS '严重程度: CRITICAL-禁忌 MAJOR-严重 MODERATE-一般'; +CREATE INDEX idx_drug_interaction_a ON drug_interaction_rule(drug_a_code); +CREATE INDEX idx_drug_interaction_b ON drug_interaction_rule(drug_b_code); + +-- 处方审核日志表 +CREATE TABLE prescription_audit_log ( + id BIGSERIAL PRIMARY KEY, + prescription_id BIGINT NOT NULL, + encounter_id BIGINT NOT NULL, + patient_id BIGINT NOT NULL, + patient_name VARCHAR(64), + doctor_id BIGINT NOT NULL, + doctor_name VARCHAR(64), + audit_result VARCHAR(16) NOT NULL DEFAULT 'PENDING', + audit_type VARCHAR(32) NOT NULL DEFAULT 'AUTO', + rule_hit VARCHAR(128), + hit_count INTEGER DEFAULT 0, + detail TEXT, + suggestion TEXT, + auditor_id BIGINT, + auditor_name VARCHAR(64), + audit_time TIMESTAMP, + del_flag CHAR(1) DEFAULT '0', + create_by VARCHAR(64), + create_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP, + update_by VARCHAR(64), + update_time TIMESTAMP, + tenant_id VARCHAR(20) DEFAULT '0' +); + +COMMENT ON TABLE prescription_audit_log IS '处方审核日志表'; +COMMENT ON COLUMN prescription_audit_log.audit_result IS '审核结果: PASS-通过 REJECT-拒绝 MANUAL-待人工审核 PENDING-待审核'; +COMMENT ON COLUMN prescription_audit_log.audit_type IS '审核类型: AUTO-自动审核 MANUAL-人工审核'; +CREATE INDEX idx_audit_log_prescription ON prescription_audit_log(prescription_id); +CREATE INDEX idx_audit_log_patient ON prescription_audit_log(patient_id); +CREATE INDEX idx_audit_log_encounter ON prescription_audit_log(encounter_id); +CREATE INDEX idx_audit_log_result ON prescription_audit_log(audit_result); + +-- 剂量范围规则表 +CREATE TABLE drug_dosage_range ( + id BIGSERIAL PRIMARY KEY, + drug_code VARCHAR(32) NOT NULL, + drug_name VARCHAR(128), + population VARCHAR(32) NOT NULL DEFAULT 'ADULT', + min_dose DECIMAL(10,2), + max_dose DECIMAL(10,2), + dose_unit VARCHAR(16), + frequency_min INTEGER, + frequency_max INTEGER, + route VARCHAR(32), + organ_function VARCHAR(32), + adjustment_note TEXT, + enabled CHAR(1) DEFAULT '1', + del_flag CHAR(1) DEFAULT '0', + create_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP, + tenant_id VARCHAR(20) DEFAULT '0' +); + +COMMENT ON TABLE drug_dosage_range IS '剂量范围规则表'; +COMMENT ON COLUMN drug_dosage_range.population IS '人群: ADULT-成人 CHILD-儿童 ELDERLY-老年 PREGNANT-孕妇'; +COMMENT ON COLUMN drug_dosage_range.organ_function IS '器官功能: NORMAL-正常 RENAL-肾功能不全 HEPATIC-肝功能不全'; +CREATE INDEX idx_dosage_range_drug ON drug_dosage_range(drug_code); diff --git a/healthlink-his-server/healthlink-his-application/src/main/resources/db/migration/V3__anesthesia_system.sql b/healthlink-his-server/healthlink-his-application/src/main/resources/db/migration/V3__anesthesia_system.sql new file mode 100644 index 000000000..da60f42d8 --- /dev/null +++ b/healthlink-his-server/healthlink-his-application/src/main/resources/db/migration/V3__anesthesia_system.sql @@ -0,0 +1,103 @@ +-- ============================================================ +-- V3: 麻醉记录系统 +-- ============================================================ + +-- 麻醉记录主表 +CREATE TABLE anes_record ( + id BIGSERIAL PRIMARY KEY, + encounter_id BIGINT NOT NULL, + surgery_id BIGINT, + patient_id BIGINT NOT NULL, + patient_name VARCHAR(64), + anesthetist_id BIGINT, + anesthetist_name VARCHAR(64), + asa_grade VARCHAR(8), + anesthesia_type VARCHAR(32), + anesthesia_method VARCHAR(64), + start_time TIMESTAMP, + end_time TIMESTAMP, + duration_minutes INTEGER, + airway_assessment TEXT, + fasting_confirmed BOOLEAN DEFAULT FALSE, + consent_signed BOOLEAN DEFAULT FALSE, + summary TEXT, + complications TEXT, + status VARCHAR(16) DEFAULT 'DRAFT', + del_flag CHAR(1) DEFAULT '0', + create_by VARCHAR(64), + create_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP, + update_by VARCHAR(64), + update_time TIMESTAMP, + tenant_id VARCHAR(20) DEFAULT '0' +); +COMMENT ON TABLE anes_record IS '麻醉记录主表'; + +-- 麻醉生命体征记录表(5分钟间隔) +CREATE TABLE anes_vital_sign ( + id BIGSERIAL PRIMARY KEY, + record_id BIGINT NOT NULL, + record_time TIMESTAMP NOT NULL, + heart_rate INTEGER, + blood_pressure_sys INTEGER, + blood_pressure_dia INTEGER, + mean_arterial_pressure INTEGER, + spo2 DECIMAL(5,2), + etco2 DECIMAL(5,2), + temperature DECIMAL(4,1), + respiratory_rate INTEGER, + tidal_volume INTEGER, + anesthesia_depth VARCHAR(16), + remark TEXT, + create_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP +); +COMMENT ON TABLE anes_vital_sign IS '麻醉生命体征记录'; + +-- 麻醉用药记录表 +CREATE TABLE anes_medication ( + id BIGSERIAL PRIMARY KEY, + record_id BIGINT NOT NULL, + drug_code VARCHAR(32), + drug_name VARCHAR(128) NOT NULL, + dosage VARCHAR(64), + dose_unit VARCHAR(16), + route VARCHAR(32), + start_time TIMESTAMP, + end_time TIMESTAMP, + frequency VARCHAR(32), + operator_id BIGINT, + remark TEXT, + create_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP +); +COMMENT ON TABLE anes_medication IS '麻醉用药记录'; + +-- 麻醉出入量记录表 +CREATE TABLE anes_io_record ( + id BIGSERIAL PRIMARY KEY, + record_id BIGINT NOT NULL, + record_type VARCHAR(16) NOT NULL, + item_name VARCHAR(64), + amount DECIMAL(10,2), + unit VARCHAR(16), + record_time TIMESTAMP, + create_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP +); +COMMENT ON TABLE anes_io_record IS '麻醉出入量记录'; +COMMENT ON COLUMN anes_io_record.record_type IS '类型: INPUT-输入 OUTPUT-输出'; + +-- 麻醉术后随访表 +CREATE TABLE anes_postoperative_followup ( + id BIGSERIAL PRIMARY KEY, + record_id BIGINT NOT NULL, + followup_date DATE, + followup_time TIMESTAMP, + pain_score INTEGER, + nausea_vomiting BOOLEAN DEFAULT FALSE, + complications TEXT, + paca_score INTEGER, + followup_by BIGINT, + followup_by_name VARCHAR(64), + notes TEXT, + del_flag CHAR(1) DEFAULT '0', + create_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP +); +COMMENT ON TABLE anes_postoperative_followup IS '麻醉术后随访'; diff --git a/healthlink-his-server/healthlink-his-application/src/main/resources/db/migration/V4__medical_record_homepage.sql b/healthlink-his-server/healthlink-his-application/src/main/resources/db/migration/V4__medical_record_homepage.sql new file mode 100644 index 000000000..76f1117fe --- /dev/null +++ b/healthlink-his-server/healthlink-his-application/src/main/resources/db/migration/V4__medical_record_homepage.sql @@ -0,0 +1,59 @@ +-- ============================================================ +-- V4: 病案首页管理 +-- ============================================================ + +-- 病案首页主表 +CREATE TABLE mr_homepage ( + id BIGSERIAL PRIMARY KEY, + encounter_id BIGINT NOT NULL UNIQUE, + patient_id BIGINT NOT NULL, + admission_date DATE, + discharge_date DATE, + los_days INTEGER, + primary_diagnosis_code VARCHAR(16), + primary_diagnosis_name VARCHAR(128), + other_diagnosis_codes TEXT, + other_diagnosis_names TEXT, + primary_procedure_code VARCHAR(16), + primary_procedure_name VARCHAR(128), + other_procedure_codes TEXT, + other_procedure_names TEXT, + admission_condition VARCHAR(32), + discharge_condition VARCHAR(32), + discharge_destination VARCHAR(32), + drg_group VARCHAR(32), + drg_weight DECIMAL(8,4), + total_cost DECIMAL(12,2) DEFAULT 0, + self_pay_cost DECIMAL(12,2) DEFAULT 0, + insurance_cost DECIMAL(12,2) DEFAULT 0, + drug_cost DECIMAL(12,2) DEFAULT 0, + examination_cost DECIMAL(12,2) DEFAULT 0, + lab_cost DECIMAL(12,2) DEFAULT 0, + treatment_cost DECIMAL(12,2) DEFAULT 0, + material_cost DECIMAL(12,2) DEFAULT 0, + quality_status VARCHAR(16) DEFAULT 'DRAFT', + quality_score DECIMAL(5,2), + submit_time TIMESTAMP, + del_flag CHAR(1) DEFAULT '0', + create_by VARCHAR(64), + create_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP, + update_by VARCHAR(64), + update_time TIMESTAMP, + tenant_id VARCHAR(20) DEFAULT '0' +); +COMMENT ON TABLE mr_homepage IS '病案首页'; + +-- 病案首页质控记录表 +CREATE TABLE mr_homepage_quality_check ( + id BIGSERIAL PRIMARY KEY, + homepage_id BIGINT NOT NULL, + check_item VARCHAR(64) NOT NULL, + check_category VARCHAR(32), + check_result VARCHAR(16) NOT NULL, + check_detail TEXT, + suggestion TEXT, + checker VARCHAR(32), + check_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP, + create_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP +); +COMMENT ON TABLE mr_homepage_quality_check IS '病案首页质控记录'; diff --git a/healthlink-his-server/healthlink-his-domain/src/main/java/com/healthlink/his/anesthesia/domain/AnesthesiaFollowup.java b/healthlink-his-server/healthlink-his-domain/src/main/java/com/healthlink/his/anesthesia/domain/AnesthesiaFollowup.java new file mode 100644 index 000000000..167434b8c --- /dev/null +++ b/healthlink-his-server/healthlink-his-domain/src/main/java/com/healthlink/his/anesthesia/domain/AnesthesiaFollowup.java @@ -0,0 +1,46 @@ +package com.healthlink.his.anesthesia.domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.core.common.core.domain.HisBaseEntity; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +import java.util.Date; + +@Data +@TableName("anes_postoperative_followup") +@Accessors(chain = true) +@EqualsAndHashCode(callSuper = false) +public class AnesthesiaFollowup extends HisBaseEntity { + + @TableId(type = IdType.ASSIGN_ID) + private Long id; + + private Long recordId; + + @JsonFormat(pattern = "yyyy-MM-dd") + private Date followupDate; + + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date followupTime; + + private Integer painScore; + + private Boolean nauseaVomiting; + + private String complications; + + private Integer pacaScore; + + private Long followupBy; + + private String followupByName; + + private String notes; + + private String delFlag; +} diff --git a/healthlink-his-server/healthlink-his-domain/src/main/java/com/healthlink/his/anesthesia/domain/AnesthesiaIoRecord.java b/healthlink-his-server/healthlink-his-domain/src/main/java/com/healthlink/his/anesthesia/domain/AnesthesiaIoRecord.java new file mode 100644 index 000000000..4582428c9 --- /dev/null +++ b/healthlink-his-server/healthlink-his-domain/src/main/java/com/healthlink/his/anesthesia/domain/AnesthesiaIoRecord.java @@ -0,0 +1,36 @@ +package com.healthlink.his.anesthesia.domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.core.common.core.domain.HisBaseEntity; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +import java.math.BigDecimal; +import java.util.Date; + +@Data +@TableName("anes_io_record") +@Accessors(chain = true) +@EqualsAndHashCode(callSuper = false) +public class AnesthesiaIoRecord extends HisBaseEntity { + + @TableId(type = IdType.ASSIGN_ID) + private Long id; + + private Long recordId; + + private String recordType; + + private String itemName; + + private BigDecimal amount; + + private String unit; + + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date recordTime; +} diff --git a/healthlink-his-server/healthlink-his-domain/src/main/java/com/healthlink/his/anesthesia/domain/AnesthesiaMedication.java b/healthlink-his-server/healthlink-his-domain/src/main/java/com/healthlink/his/anesthesia/domain/AnesthesiaMedication.java new file mode 100644 index 000000000..5e089bd96 --- /dev/null +++ b/healthlink-his-server/healthlink-his-domain/src/main/java/com/healthlink/his/anesthesia/domain/AnesthesiaMedication.java @@ -0,0 +1,46 @@ +package com.healthlink.his.anesthesia.domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.core.common.core.domain.HisBaseEntity; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +import java.util.Date; + +@Data +@TableName("anes_medication") +@Accessors(chain = true) +@EqualsAndHashCode(callSuper = false) +public class AnesthesiaMedication extends HisBaseEntity { + + @TableId(type = IdType.ASSIGN_ID) + private Long id; + + private Long recordId; + + private String drugCode; + + private String drugName; + + private String dosage; + + private String doseUnit; + + private String route; + + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date startTime; + + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date endTime; + + private String frequency; + + private Long operatorId; + + private String remark; +} diff --git a/healthlink-his-server/healthlink-his-domain/src/main/java/com/healthlink/his/anesthesia/domain/AnesthesiaRecord.java b/healthlink-his-server/healthlink-his-domain/src/main/java/com/healthlink/his/anesthesia/domain/AnesthesiaRecord.java new file mode 100644 index 000000000..154923542 --- /dev/null +++ b/healthlink-his-server/healthlink-his-domain/src/main/java/com/healthlink/his/anesthesia/domain/AnesthesiaRecord.java @@ -0,0 +1,62 @@ +package com.healthlink.his.anesthesia.domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.core.common.core.domain.HisBaseEntity; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +import java.util.Date; + +@Data +@TableName("anes_record") +@Accessors(chain = true) +@EqualsAndHashCode(callSuper = false) +public class AnesthesiaRecord extends HisBaseEntity { + + @TableId(type = IdType.ASSIGN_ID) + private Long id; + + private Long encounterId; + + private Long surgeryId; + + private Long patientId; + + private String patientName; + + private Long anesthetistId; + + private String anesthetistName; + + private String asaGrade; + + private String anesthesiaType; + + private String anesthesiaMethod; + + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date startTime; + + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date endTime; + + private Integer durationMinutes; + + private String airwayAssessment; + + private Boolean fastingConfirmed; + + private Boolean consentSigned; + + private String summary; + + private String complications; + + private String status; + + private String delFlag; +} diff --git a/healthlink-his-server/healthlink-his-domain/src/main/java/com/healthlink/his/anesthesia/domain/AnesthesiaVitalSign.java b/healthlink-his-server/healthlink-his-domain/src/main/java/com/healthlink/his/anesthesia/domain/AnesthesiaVitalSign.java new file mode 100644 index 000000000..64bef2b8c --- /dev/null +++ b/healthlink-his-server/healthlink-his-domain/src/main/java/com/healthlink/his/anesthesia/domain/AnesthesiaVitalSign.java @@ -0,0 +1,50 @@ +package com.healthlink.his.anesthesia.domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.core.common.core.domain.HisBaseEntity; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +import java.math.BigDecimal; +import java.util.Date; + +@Data +@TableName("anes_vital_sign") +@Accessors(chain = true) +@EqualsAndHashCode(callSuper = false) +public class AnesthesiaVitalSign extends HisBaseEntity { + + @TableId(type = IdType.ASSIGN_ID) + private Long id; + + private Long recordId; + + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date recordTime; + + private Integer heartRate; + + private Integer bloodPressureSys; + + private Integer bloodPressureDia; + + private Integer meanArterialPressure; + + private BigDecimal spo2; + + private BigDecimal etco2; + + private BigDecimal temperature; + + private Integer respiratoryRate; + + private Integer tidalVolume; + + private String anesthesiaDepth; + + private String remark; +} diff --git a/healthlink-his-server/healthlink-his-domain/src/main/java/com/healthlink/his/anesthesia/dto/AnesthesiaIoSummaryDto.java b/healthlink-his-server/healthlink-his-domain/src/main/java/com/healthlink/his/anesthesia/dto/AnesthesiaIoSummaryDto.java new file mode 100644 index 000000000..498602111 --- /dev/null +++ b/healthlink-his-server/healthlink-his-domain/src/main/java/com/healthlink/his/anesthesia/dto/AnesthesiaIoSummaryDto.java @@ -0,0 +1,17 @@ +package com.healthlink.his.anesthesia.dto; + +import lombok.Data; +import lombok.experimental.Accessors; + +import java.math.BigDecimal; + +@Data +@Accessors(chain = true) +public class AnesthesiaIoSummaryDto { + + private BigDecimal totalInput; + + private BigDecimal totalOutput; + + private BigDecimal balance; +} diff --git a/healthlink-his-server/healthlink-his-domain/src/main/java/com/healthlink/his/anesthesia/dto/AnesthesiaRecordDetailDto.java b/healthlink-his-server/healthlink-his-domain/src/main/java/com/healthlink/his/anesthesia/dto/AnesthesiaRecordDetailDto.java new file mode 100644 index 000000000..5e3899730 --- /dev/null +++ b/healthlink-his-server/healthlink-his-domain/src/main/java/com/healthlink/his/anesthesia/dto/AnesthesiaRecordDetailDto.java @@ -0,0 +1,26 @@ +package com.healthlink.his.anesthesia.dto; + +import com.healthlink.his.anesthesia.domain.AnesthesiaFollowup; +import com.healthlink.his.anesthesia.domain.AnesthesiaIoRecord; +import com.healthlink.his.anesthesia.domain.AnesthesiaMedication; +import com.healthlink.his.anesthesia.domain.AnesthesiaRecord; +import com.healthlink.his.anesthesia.domain.AnesthesiaVitalSign; +import lombok.Data; +import lombok.experimental.Accessors; + +import java.util.List; + +@Data +@Accessors(chain = true) +public class AnesthesiaRecordDetailDto { + + private AnesthesiaRecord record; + + private List vitalSigns; + + private List medications; + + private List ioRecords; + + private List followups; +} diff --git a/healthlink-his-server/healthlink-his-domain/src/main/java/com/healthlink/his/anesthesia/mapper/AnesthesiaFollowupMapper.java b/healthlink-his-server/healthlink-his-domain/src/main/java/com/healthlink/his/anesthesia/mapper/AnesthesiaFollowupMapper.java new file mode 100644 index 000000000..9ad77eb49 --- /dev/null +++ b/healthlink-his-server/healthlink-his-domain/src/main/java/com/healthlink/his/anesthesia/mapper/AnesthesiaFollowupMapper.java @@ -0,0 +1,14 @@ +package com.healthlink.his.anesthesia.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.healthlink.his.anesthesia.domain.AnesthesiaFollowup; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +@Mapper +public interface AnesthesiaFollowupMapper extends BaseMapper { + + List selectByRecordId(@Param("recordId") Long recordId); +} diff --git a/healthlink-his-server/healthlink-his-domain/src/main/java/com/healthlink/his/anesthesia/mapper/AnesthesiaIoRecordMapper.java b/healthlink-his-server/healthlink-his-domain/src/main/java/com/healthlink/his/anesthesia/mapper/AnesthesiaIoRecordMapper.java new file mode 100644 index 000000000..4b2c18ab3 --- /dev/null +++ b/healthlink-his-server/healthlink-his-domain/src/main/java/com/healthlink/his/anesthesia/mapper/AnesthesiaIoRecordMapper.java @@ -0,0 +1,19 @@ +package com.healthlink.his.anesthesia.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.healthlink.his.anesthesia.domain.AnesthesiaIoRecord; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.math.BigDecimal; +import java.util.List; + +@Mapper +public interface AnesthesiaIoRecordMapper extends BaseMapper { + + List selectByRecordId(@Param("recordId") Long recordId); + + BigDecimal calculateTotalInput(@Param("recordId") Long recordId); + + BigDecimal calculateTotalOutput(@Param("recordId") Long recordId); +} diff --git a/healthlink-his-server/healthlink-his-domain/src/main/java/com/healthlink/his/anesthesia/mapper/AnesthesiaMedicationMapper.java b/healthlink-his-server/healthlink-his-domain/src/main/java/com/healthlink/his/anesthesia/mapper/AnesthesiaMedicationMapper.java new file mode 100644 index 000000000..59e56bfcc --- /dev/null +++ b/healthlink-his-server/healthlink-his-domain/src/main/java/com/healthlink/his/anesthesia/mapper/AnesthesiaMedicationMapper.java @@ -0,0 +1,14 @@ +package com.healthlink.his.anesthesia.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.healthlink.his.anesthesia.domain.AnesthesiaMedication; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +@Mapper +public interface AnesthesiaMedicationMapper extends BaseMapper { + + List selectByRecordId(@Param("recordId") Long recordId); +} diff --git a/healthlink-his-server/healthlink-his-domain/src/main/java/com/healthlink/his/anesthesia/mapper/AnesthesiaRecordMapper.java b/healthlink-his-server/healthlink-his-domain/src/main/java/com/healthlink/his/anesthesia/mapper/AnesthesiaRecordMapper.java new file mode 100644 index 000000000..b54683caf --- /dev/null +++ b/healthlink-his-server/healthlink-his-domain/src/main/java/com/healthlink/his/anesthesia/mapper/AnesthesiaRecordMapper.java @@ -0,0 +1,16 @@ +package com.healthlink.his.anesthesia.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.healthlink.his.anesthesia.domain.AnesthesiaRecord; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +@Mapper +public interface AnesthesiaRecordMapper extends BaseMapper { + + List selectByEncounterId(@Param("encounterId") Long encounterId); + + List selectByPatientId(@Param("patientId") Long patientId); +} diff --git a/healthlink-his-server/healthlink-his-domain/src/main/java/com/healthlink/his/anesthesia/mapper/AnesthesiaVitalSignMapper.java b/healthlink-his-server/healthlink-his-domain/src/main/java/com/healthlink/his/anesthesia/mapper/AnesthesiaVitalSignMapper.java new file mode 100644 index 000000000..cc7cfd4e2 --- /dev/null +++ b/healthlink-his-server/healthlink-his-domain/src/main/java/com/healthlink/his/anesthesia/mapper/AnesthesiaVitalSignMapper.java @@ -0,0 +1,20 @@ +package com.healthlink.his.anesthesia.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.healthlink.his.anesthesia.domain.AnesthesiaVitalSign; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.Date; +import java.util.List; + +@Mapper +public interface AnesthesiaVitalSignMapper extends BaseMapper { + + List selectByRecordId(@Param("recordId") Long recordId); + + List selectByRecordIdAndTimeRange( + @Param("recordId") Long recordId, + @Param("startTime") Date startTime, + @Param("endTime") Date endTime); +} diff --git a/healthlink-his-server/healthlink-his-domain/src/main/java/com/healthlink/his/anesthesia/service/IAnesthesiaFollowupService.java b/healthlink-his-server/healthlink-his-domain/src/main/java/com/healthlink/his/anesthesia/service/IAnesthesiaFollowupService.java new file mode 100644 index 000000000..bde370895 --- /dev/null +++ b/healthlink-his-server/healthlink-his-domain/src/main/java/com/healthlink/his/anesthesia/service/IAnesthesiaFollowupService.java @@ -0,0 +1,11 @@ +package com.healthlink.his.anesthesia.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.healthlink.his.anesthesia.domain.AnesthesiaFollowup; + +import java.util.List; + +public interface IAnesthesiaFollowupService extends IService { + + List selectByRecordId(Long recordId); +} diff --git a/healthlink-his-server/healthlink-his-domain/src/main/java/com/healthlink/his/anesthesia/service/IAnesthesiaIoRecordService.java b/healthlink-his-server/healthlink-his-domain/src/main/java/com/healthlink/his/anesthesia/service/IAnesthesiaIoRecordService.java new file mode 100644 index 000000000..6482e242a --- /dev/null +++ b/healthlink-his-server/healthlink-his-domain/src/main/java/com/healthlink/his/anesthesia/service/IAnesthesiaIoRecordService.java @@ -0,0 +1,16 @@ +package com.healthlink.his.anesthesia.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.healthlink.his.anesthesia.domain.AnesthesiaIoRecord; + +import java.math.BigDecimal; +import java.util.List; + +public interface IAnesthesiaIoRecordService extends IService { + + List selectByRecordId(Long recordId); + + BigDecimal calculateTotalInput(Long recordId); + + BigDecimal calculateTotalOutput(Long recordId); +} diff --git a/healthlink-his-server/healthlink-his-domain/src/main/java/com/healthlink/his/anesthesia/service/IAnesthesiaMedicationService.java b/healthlink-his-server/healthlink-his-domain/src/main/java/com/healthlink/his/anesthesia/service/IAnesthesiaMedicationService.java new file mode 100644 index 000000000..76dffe13a --- /dev/null +++ b/healthlink-his-server/healthlink-his-domain/src/main/java/com/healthlink/his/anesthesia/service/IAnesthesiaMedicationService.java @@ -0,0 +1,11 @@ +package com.healthlink.his.anesthesia.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.healthlink.his.anesthesia.domain.AnesthesiaMedication; + +import java.util.List; + +public interface IAnesthesiaMedicationService extends IService { + + List selectByRecordId(Long recordId); +} diff --git a/healthlink-his-server/healthlink-his-domain/src/main/java/com/healthlink/his/anesthesia/service/IAnesthesiaRecordService.java b/healthlink-his-server/healthlink-his-domain/src/main/java/com/healthlink/his/anesthesia/service/IAnesthesiaRecordService.java new file mode 100644 index 000000000..a88e10f6e --- /dev/null +++ b/healthlink-his-server/healthlink-his-domain/src/main/java/com/healthlink/his/anesthesia/service/IAnesthesiaRecordService.java @@ -0,0 +1,13 @@ +package com.healthlink.his.anesthesia.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.healthlink.his.anesthesia.domain.AnesthesiaRecord; + +import java.util.List; + +public interface IAnesthesiaRecordService extends IService { + + List selectByEncounterId(Long encounterId); + + List selectByPatientId(Long patientId); +} diff --git a/healthlink-his-server/healthlink-his-domain/src/main/java/com/healthlink/his/anesthesia/service/IAnesthesiaVitalSignService.java b/healthlink-his-server/healthlink-his-domain/src/main/java/com/healthlink/his/anesthesia/service/IAnesthesiaVitalSignService.java new file mode 100644 index 000000000..1c71c1969 --- /dev/null +++ b/healthlink-his-server/healthlink-his-domain/src/main/java/com/healthlink/his/anesthesia/service/IAnesthesiaVitalSignService.java @@ -0,0 +1,14 @@ +package com.healthlink.his.anesthesia.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.healthlink.his.anesthesia.domain.AnesthesiaVitalSign; + +import java.util.Date; +import java.util.List; + +public interface IAnesthesiaVitalSignService extends IService { + + List selectByRecordId(Long recordId); + + List selectByRecordIdAndTimeRange(Long recordId, Date startTime, Date endTime); +} diff --git a/healthlink-his-server/healthlink-his-domain/src/main/java/com/healthlink/his/anesthesia/service/impl/AnesthesiaFollowupServiceImpl.java b/healthlink-his-server/healthlink-his-domain/src/main/java/com/healthlink/his/anesthesia/service/impl/AnesthesiaFollowupServiceImpl.java new file mode 100644 index 000000000..4f3eaa812 --- /dev/null +++ b/healthlink-his-server/healthlink-his-domain/src/main/java/com/healthlink/his/anesthesia/service/impl/AnesthesiaFollowupServiceImpl.java @@ -0,0 +1,20 @@ +package com.healthlink.his.anesthesia.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.healthlink.his.anesthesia.domain.AnesthesiaFollowup; +import com.healthlink.his.anesthesia.mapper.AnesthesiaFollowupMapper; +import com.healthlink.his.anesthesia.service.IAnesthesiaFollowupService; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Service +public class AnesthesiaFollowupServiceImpl + extends ServiceImpl + implements IAnesthesiaFollowupService { + + @Override + public List selectByRecordId(Long recordId) { + return baseMapper.selectByRecordId(recordId); + } +} diff --git a/healthlink-his-server/healthlink-his-domain/src/main/java/com/healthlink/his/anesthesia/service/impl/AnesthesiaIoRecordServiceImpl.java b/healthlink-his-server/healthlink-his-domain/src/main/java/com/healthlink/his/anesthesia/service/impl/AnesthesiaIoRecordServiceImpl.java new file mode 100644 index 000000000..8c7b96a9e --- /dev/null +++ b/healthlink-his-server/healthlink-his-domain/src/main/java/com/healthlink/his/anesthesia/service/impl/AnesthesiaIoRecordServiceImpl.java @@ -0,0 +1,31 @@ +package com.healthlink.his.anesthesia.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.healthlink.his.anesthesia.domain.AnesthesiaIoRecord; +import com.healthlink.his.anesthesia.mapper.AnesthesiaIoRecordMapper; +import com.healthlink.his.anesthesia.service.IAnesthesiaIoRecordService; +import org.springframework.stereotype.Service; + +import java.math.BigDecimal; +import java.util.List; + +@Service +public class AnesthesiaIoRecordServiceImpl + extends ServiceImpl + implements IAnesthesiaIoRecordService { + + @Override + public List selectByRecordId(Long recordId) { + return baseMapper.selectByRecordId(recordId); + } + + @Override + public BigDecimal calculateTotalInput(Long recordId) { + return baseMapper.calculateTotalInput(recordId); + } + + @Override + public BigDecimal calculateTotalOutput(Long recordId) { + return baseMapper.calculateTotalOutput(recordId); + } +} diff --git a/healthlink-his-server/healthlink-his-domain/src/main/java/com/healthlink/his/anesthesia/service/impl/AnesthesiaMedicationServiceImpl.java b/healthlink-his-server/healthlink-his-domain/src/main/java/com/healthlink/his/anesthesia/service/impl/AnesthesiaMedicationServiceImpl.java new file mode 100644 index 000000000..312896d46 --- /dev/null +++ b/healthlink-his-server/healthlink-his-domain/src/main/java/com/healthlink/his/anesthesia/service/impl/AnesthesiaMedicationServiceImpl.java @@ -0,0 +1,20 @@ +package com.healthlink.his.anesthesia.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.healthlink.his.anesthesia.domain.AnesthesiaMedication; +import com.healthlink.his.anesthesia.mapper.AnesthesiaMedicationMapper; +import com.healthlink.his.anesthesia.service.IAnesthesiaMedicationService; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Service +public class AnesthesiaMedicationServiceImpl + extends ServiceImpl + implements IAnesthesiaMedicationService { + + @Override + public List selectByRecordId(Long recordId) { + return baseMapper.selectByRecordId(recordId); + } +} diff --git a/healthlink-his-server/healthlink-his-domain/src/main/java/com/healthlink/his/anesthesia/service/impl/AnesthesiaRecordServiceImpl.java b/healthlink-his-server/healthlink-his-domain/src/main/java/com/healthlink/his/anesthesia/service/impl/AnesthesiaRecordServiceImpl.java new file mode 100644 index 000000000..00a5c8cb9 --- /dev/null +++ b/healthlink-his-server/healthlink-his-domain/src/main/java/com/healthlink/his/anesthesia/service/impl/AnesthesiaRecordServiceImpl.java @@ -0,0 +1,25 @@ +package com.healthlink.his.anesthesia.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.healthlink.his.anesthesia.domain.AnesthesiaRecord; +import com.healthlink.his.anesthesia.mapper.AnesthesiaRecordMapper; +import com.healthlink.his.anesthesia.service.IAnesthesiaRecordService; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Service +public class AnesthesiaRecordServiceImpl + extends ServiceImpl + implements IAnesthesiaRecordService { + + @Override + public List selectByEncounterId(Long encounterId) { + return baseMapper.selectByEncounterId(encounterId); + } + + @Override + public List selectByPatientId(Long patientId) { + return baseMapper.selectByPatientId(patientId); + } +} diff --git a/healthlink-his-server/healthlink-his-domain/src/main/java/com/healthlink/his/anesthesia/service/impl/AnesthesiaVitalSignServiceImpl.java b/healthlink-his-server/healthlink-his-domain/src/main/java/com/healthlink/his/anesthesia/service/impl/AnesthesiaVitalSignServiceImpl.java new file mode 100644 index 000000000..c1b62a688 --- /dev/null +++ b/healthlink-his-server/healthlink-his-domain/src/main/java/com/healthlink/his/anesthesia/service/impl/AnesthesiaVitalSignServiceImpl.java @@ -0,0 +1,26 @@ +package com.healthlink.his.anesthesia.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.healthlink.his.anesthesia.domain.AnesthesiaVitalSign; +import com.healthlink.his.anesthesia.mapper.AnesthesiaVitalSignMapper; +import com.healthlink.his.anesthesia.service.IAnesthesiaVitalSignService; +import org.springframework.stereotype.Service; + +import java.util.Date; +import java.util.List; + +@Service +public class AnesthesiaVitalSignServiceImpl + extends ServiceImpl + implements IAnesthesiaVitalSignService { + + @Override + public List selectByRecordId(Long recordId) { + return baseMapper.selectByRecordId(recordId); + } + + @Override + public List selectByRecordIdAndTimeRange(Long recordId, Date startTime, Date endTime) { + return baseMapper.selectByRecordIdAndTimeRange(recordId, startTime, endTime); + } +} diff --git a/healthlink-his-server/healthlink-his-domain/src/main/java/com/healthlink/his/mrhomepage/domain/MrHomepage.java b/healthlink-his-server/healthlink-his-domain/src/main/java/com/healthlink/his/mrhomepage/domain/MrHomepage.java new file mode 100644 index 000000000..f2b7a516d --- /dev/null +++ b/healthlink-his-server/healthlink-his-domain/src/main/java/com/healthlink/his/mrhomepage/domain/MrHomepage.java @@ -0,0 +1,86 @@ +package com.healthlink.his.mrhomepage.domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.core.common.core.domain.HisBaseEntity; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +import java.math.BigDecimal; +import java.util.Date; + +@Data +@TableName("mr_homepage") +@Accessors(chain = true) +@EqualsAndHashCode(callSuper = false) +public class MrHomepage extends HisBaseEntity { + + @TableId(type = IdType.ASSIGN_ID) + private Long id; + + private Long encounterId; + + private Long patientId; + + @JsonFormat(pattern = "yyyy-MM-dd") + private Date admissionDate; + + @JsonFormat(pattern = "yyyy-MM-dd") + private Date dischargeDate; + + private Integer losDays; + + private String primaryDiagnosisCode; + + private String primaryDiagnosisName; + + private String otherDiagnosisCodes; + + private String otherDiagnosisNames; + + private String primaryProcedureCode; + + private String primaryProcedureName; + + private String otherProcedureCodes; + + private String otherProcedureNames; + + private String admissionCondition; + + private String dischargeCondition; + + private String dischargeDestination; + + private String drgGroup; + + private BigDecimal drgWeight; + + private BigDecimal totalCost; + + private BigDecimal selfPayCost; + + private BigDecimal insuranceCost; + + private BigDecimal drugCost; + + private BigDecimal examinationCost; + + private BigDecimal labCost; + + private BigDecimal treatmentCost; + + private BigDecimal materialCost; + + private String qualityStatus; + + private BigDecimal qualityScore; + + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date submitTime; + + private String delFlag; +} diff --git a/healthlink-his-server/healthlink-his-domain/src/main/java/com/healthlink/his/mrhomepage/domain/MrHomepageQualityCheck.java b/healthlink-his-server/healthlink-his-domain/src/main/java/com/healthlink/his/mrhomepage/domain/MrHomepageQualityCheck.java new file mode 100644 index 000000000..2701183b3 --- /dev/null +++ b/healthlink-his-server/healthlink-his-domain/src/main/java/com/healthlink/his/mrhomepage/domain/MrHomepageQualityCheck.java @@ -0,0 +1,39 @@ +package com.healthlink.his.mrhomepage.domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.core.common.core.domain.HisBaseEntity; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +import java.util.Date; + +@Data +@TableName("mr_homepage_quality_check") +@Accessors(chain = true) +@EqualsAndHashCode(callSuper = false) +public class MrHomepageQualityCheck extends HisBaseEntity { + + @TableId(type = IdType.ASSIGN_ID) + private Long id; + + private Long homepageId; + + private String checkItem; + + private String checkCategory; + + private String checkResult; + + private String checkDetail; + + private String suggestion; + + private String checker; + + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date checkTime; +} diff --git a/healthlink-his-server/healthlink-his-domain/src/main/java/com/healthlink/his/mrhomepage/mapper/MrHomepageMapper.java b/healthlink-his-server/healthlink-his-domain/src/main/java/com/healthlink/his/mrhomepage/mapper/MrHomepageMapper.java new file mode 100644 index 000000000..ff98753fb --- /dev/null +++ b/healthlink-his-server/healthlink-his-domain/src/main/java/com/healthlink/his/mrhomepage/mapper/MrHomepageMapper.java @@ -0,0 +1,16 @@ +package com.healthlink.his.mrhomepage.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.healthlink.his.mrhomepage.domain.MrHomepage; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +@Mapper +public interface MrHomepageMapper extends BaseMapper { + + List selectByEncounterId(@Param("encounterId") Long encounterId); + + List selectByDischargeDate(@Param("startDate") String startDate, @Param("endDate") String endDate); +} diff --git a/healthlink-his-server/healthlink-his-domain/src/main/java/com/healthlink/his/mrhomepage/mapper/MrHomepageQualityCheckMapper.java b/healthlink-his-server/healthlink-his-domain/src/main/java/com/healthlink/his/mrhomepage/mapper/MrHomepageQualityCheckMapper.java new file mode 100644 index 000000000..e2c21715a --- /dev/null +++ b/healthlink-his-server/healthlink-his-domain/src/main/java/com/healthlink/his/mrhomepage/mapper/MrHomepageQualityCheckMapper.java @@ -0,0 +1,14 @@ +package com.healthlink.his.mrhomepage.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.healthlink.his.mrhomepage.domain.MrHomepageQualityCheck; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +@Mapper +public interface MrHomepageQualityCheckMapper extends BaseMapper { + + List selectByHomepageId(@Param("homepageId") Long homepageId); +} diff --git a/healthlink-his-server/healthlink-his-domain/src/main/java/com/healthlink/his/mrhomepage/service/IMrHomepageQualityCheckService.java b/healthlink-his-server/healthlink-his-domain/src/main/java/com/healthlink/his/mrhomepage/service/IMrHomepageQualityCheckService.java new file mode 100644 index 000000000..cb4095060 --- /dev/null +++ b/healthlink-his-server/healthlink-his-domain/src/main/java/com/healthlink/his/mrhomepage/service/IMrHomepageQualityCheckService.java @@ -0,0 +1,13 @@ +package com.healthlink.his.mrhomepage.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.healthlink.his.mrhomepage.domain.MrHomepageQualityCheck; + +import java.util.List; + +public interface IMrHomepageQualityCheckService extends IService { + + List selectByHomepageId(Long homepageId); + + List executeAutoCheck(Long homepageId); +} diff --git a/healthlink-his-server/healthlink-his-domain/src/main/java/com/healthlink/his/mrhomepage/service/IMrHomepageService.java b/healthlink-his-server/healthlink-his-domain/src/main/java/com/healthlink/his/mrhomepage/service/IMrHomepageService.java new file mode 100644 index 000000000..5b4ca88d4 --- /dev/null +++ b/healthlink-his-server/healthlink-his-domain/src/main/java/com/healthlink/his/mrhomepage/service/IMrHomepageService.java @@ -0,0 +1,16 @@ +package com.healthlink.his.mrhomepage.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.healthlink.his.mrhomepage.domain.MrHomepage; + +import java.util.List; +import java.util.Map; + +public interface IMrHomepageService extends IService { + + List selectByEncounterId(Long encounterId); + + List selectByDischargeDate(String startDate, String endDate); + + Map selectStatistics(String startDate, String endDate); +} diff --git a/healthlink-his-server/healthlink-his-domain/src/main/java/com/healthlink/his/mrhomepage/service/impl/MrHomepageQualityCheckServiceImpl.java b/healthlink-his-server/healthlink-his-domain/src/main/java/com/healthlink/his/mrhomepage/service/impl/MrHomepageQualityCheckServiceImpl.java new file mode 100644 index 000000000..9bc4d3b95 --- /dev/null +++ b/healthlink-his-server/healthlink-his-domain/src/main/java/com/healthlink/his/mrhomepage/service/impl/MrHomepageQualityCheckServiceImpl.java @@ -0,0 +1,77 @@ +package com.healthlink.his.mrhomepage.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.healthlink.his.mrhomepage.domain.MrHomepage; +import com.healthlink.his.mrhomepage.domain.MrHomepageQualityCheck; +import com.healthlink.his.mrhomepage.mapper.MrHomepageQualityCheckMapper; +import com.healthlink.his.mrhomepage.service.IMrHomepageQualityCheckService; +import com.healthlink.his.mrhomepage.service.IMrHomepageService; +import jakarta.annotation.Resource; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +@Service +public class MrHomepageQualityCheckServiceImpl + extends ServiceImpl + implements IMrHomepageQualityCheckService { + + @Resource + private IMrHomepageService mrHomepageService; + + @Override + public List selectByHomepageId(Long homepageId) { + return baseMapper.selectByHomepageId(homepageId); + } + + @Override + @Transactional + public List executeAutoCheck(Long homepageId) { + MrHomepage homepage = mrHomepageService.getById(homepageId); + List checks = new ArrayList<>(); + + // 主诊断编码检查 + MrHomepageQualityCheck diagnosisCheck = new MrHomepageQualityCheck() + .setHomepageId(homepageId) + .setCheckItem("主诊断编码完整性") + .setCheckCategory("基础信息") + .setCheckResult(homepage.getPrimaryDiagnosisCode() != null ? "PASS" : "FAIL") + .setCheckDetail("主诊断编码: " + homepage.getPrimaryDiagnosisCode()) + .setSuggestion(homepage.getPrimaryDiagnosisCode() == null ? "请填写主诊断编码" : null) + .setChecker("AUTO") + .setCheckTime(new Date()); + save(diagnosisCheck); + checks.add(diagnosisCheck); + + // 主手术编码检查 + MrHomepageQualityCheck procedureCheck = new MrHomepageQualityCheck() + .setHomepageId(homepageId) + .setCheckItem("主手术编码完整性") + .setCheckCategory("基础信息") + .setCheckResult(homepage.getPrimaryProcedureCode() != null ? "PASS" : "FAIL") + .setCheckDetail("主手术编码: " + homepage.getPrimaryProcedureCode()) + .setSuggestion(homepage.getPrimaryProcedureCode() == null ? "请填写主手术编码" : null) + .setChecker("AUTO") + .setCheckTime(new Date()); + save(procedureCheck); + checks.add(procedureCheck); + + // 入院日期检查 + MrHomepageQualityCheck admissionCheck = new MrHomepageQualityCheck() + .setHomepageId(homepageId) + .setCheckItem("入院日期完整性") + .setCheckCategory("日期信息") + .setCheckResult(homepage.getAdmissionDate() != null ? "PASS" : "FAIL") + .setCheckDetail("入院日期: " + homepage.getAdmissionDate()) + .setSuggestion(homepage.getAdmissionDate() == null ? "请填写入院日期" : null) + .setChecker("AUTO") + .setCheckTime(new Date()); + save(admissionCheck); + checks.add(admissionCheck); + + return checks; + } +} diff --git a/healthlink-his-server/healthlink-his-domain/src/main/java/com/healthlink/his/mrhomepage/service/impl/MrHomepageServiceImpl.java b/healthlink-his-server/healthlink-his-domain/src/main/java/com/healthlink/his/mrhomepage/service/impl/MrHomepageServiceImpl.java new file mode 100644 index 000000000..16adc8abd --- /dev/null +++ b/healthlink-his-server/healthlink-his-domain/src/main/java/com/healthlink/his/mrhomepage/service/impl/MrHomepageServiceImpl.java @@ -0,0 +1,44 @@ +package com.healthlink.his.mrhomepage.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.healthlink.his.mrhomepage.domain.MrHomepage; +import com.healthlink.his.mrhomepage.mapper.MrHomepageMapper; +import com.healthlink.his.mrhomepage.service.IMrHomepageService; +import org.springframework.stereotype.Service; + +import java.math.BigDecimal; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +@Service +public class MrHomepageServiceImpl + extends ServiceImpl + implements IMrHomepageService { + + @Override + public List selectByEncounterId(Long encounterId) { + return baseMapper.selectByEncounterId(encounterId); + } + + @Override + public List selectByDischargeDate(String startDate, String endDate) { + return baseMapper.selectByDischargeDate(startDate, endDate); + } + + @Override + public Map selectStatistics(String startDate, String endDate) { + List list = baseMapper.selectByDischargeDate(startDate, endDate); + Map stats = new HashMap<>(); + stats.put("totalCount", list.size()); + stats.put("totalCost", list.stream() + .map(MrHomepage::getTotalCost) + .reduce(BigDecimal.ZERO, BigDecimal::add)); + stats.put("avgCost", list.isEmpty() ? BigDecimal.ZERO + : stats.get("totalCost").toString().equals("0") ? BigDecimal.ZERO + : new BigDecimal(stats.get("totalCost").toString()) + .divide(BigDecimal.valueOf(list.size()), 2, BigDecimal.ROUND_HALF_UP)); + return stats; + } +} diff --git a/healthlink-his-server/healthlink-his-domain/src/main/java/com/healthlink/his/rationaldrug/domain/DrugDosageRange.java b/healthlink-his-server/healthlink-his-domain/src/main/java/com/healthlink/his/rationaldrug/domain/DrugDosageRange.java new file mode 100644 index 000000000..dc5e4aa4b --- /dev/null +++ b/healthlink-his-server/healthlink-his-domain/src/main/java/com/healthlink/his/rationaldrug/domain/DrugDosageRange.java @@ -0,0 +1,46 @@ +package com.healthlink.his.rationaldrug.domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.core.common.core.domain.HisBaseEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; +import java.math.BigDecimal; + +@Data +@TableName("drug_dosage_range") +@Accessors(chain = true) +@EqualsAndHashCode(callSuper = false) +public class DrugDosageRange extends HisBaseEntity { + + @TableId(type = IdType.ASSIGN_ID) + private Long id; + + private String drugCode; + + private String drugName; + + private String population; + + private BigDecimal minDose; + + private BigDecimal maxDose; + + private String doseUnit; + + private Integer frequencyMin; + + private Integer frequencyMax; + + private String route; + + private String organFunction; + + private String adjustmentNote; + + private String enabled; + + private String delFlag; +} diff --git a/healthlink-his-server/healthlink-his-domain/src/main/java/com/healthlink/his/rationaldrug/domain/DrugInteractionRule.java b/healthlink-his-server/healthlink-his-domain/src/main/java/com/healthlink/his/rationaldrug/domain/DrugInteractionRule.java new file mode 100644 index 000000000..eccff7098 --- /dev/null +++ b/healthlink-his-server/healthlink-his-domain/src/main/java/com/healthlink/his/rationaldrug/domain/DrugInteractionRule.java @@ -0,0 +1,37 @@ +package com.healthlink.his.rationaldrug.domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.core.common.core.domain.HisBaseEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +@Data +@TableName("drug_interaction_rule") +@Accessors(chain = true) +@EqualsAndHashCode(callSuper = false) +public class DrugInteractionRule extends HisBaseEntity { + + @TableId(type = IdType.ASSIGN_ID) + private Long id; + + private String drugACode; + + private String drugAName; + + private String drugBCode; + + private String drugBName; + + private String severity; + + private String description; + + private String suggestion; + + private String enabled; + + private String delFlag; +} diff --git a/healthlink-his-server/healthlink-his-domain/src/main/java/com/healthlink/his/rationaldrug/domain/PrescriptionAuditLog.java b/healthlink-his-server/healthlink-his-domain/src/main/java/com/healthlink/his/rationaldrug/domain/PrescriptionAuditLog.java new file mode 100644 index 000000000..f282a66b6 --- /dev/null +++ b/healthlink-his-server/healthlink-his-domain/src/main/java/com/healthlink/his/rationaldrug/domain/PrescriptionAuditLog.java @@ -0,0 +1,52 @@ +package com.healthlink.his.rationaldrug.domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.core.common.core.domain.HisBaseEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; +import java.util.Date; + +@Data +@TableName("prescription_audit_log") +@Accessors(chain = true) +@EqualsAndHashCode(callSuper = false) +public class PrescriptionAuditLog extends HisBaseEntity { + + @TableId(type = IdType.ASSIGN_ID) + private Long id; + + private Long prescriptionId; + + private Long encounterId; + + private Long patientId; + + private String patientName; + + private Long doctorId; + + private String doctorName; + + private String auditResult; + + private String auditType; + + private String ruleHit; + + private Integer hitCount; + + private String detail; + + private String suggestion; + + private Long auditorId; + + private String auditorName; + + private Date auditTime; + + private String delFlag; +} diff --git a/healthlink-his-server/healthlink-his-domain/src/main/java/com/healthlink/his/rationaldrug/dto/AuditResultDto.java b/healthlink-his-server/healthlink-his-domain/src/main/java/com/healthlink/his/rationaldrug/dto/AuditResultDto.java new file mode 100644 index 000000000..22cbe98db --- /dev/null +++ b/healthlink-his-server/healthlink-his-domain/src/main/java/com/healthlink/his/rationaldrug/dto/AuditResultDto.java @@ -0,0 +1,29 @@ +package com.healthlink.his.rationaldrug.dto; + +import lombok.Data; +import lombok.experimental.Accessors; + +/** + * 审核结果DTO + * + * @author system + */ +@Data +@Accessors(chain = true) +public class AuditResultDto { + + /** 审核结果: PASS/REJECT/MANUAL */ + private String auditResult; + + /** 命中的规则 */ + private String ruleHit; + + /** 命中数量 */ + private Integer hitCount; + + /** 详细信息 */ + private String detail; + + /** 处置建议 */ + private String suggestion; +} diff --git a/healthlink-his-server/healthlink-his-domain/src/main/java/com/healthlink/his/rationaldrug/dto/AuditStatisticsDto.java b/healthlink-his-server/healthlink-his-domain/src/main/java/com/healthlink/his/rationaldrug/dto/AuditStatisticsDto.java new file mode 100644 index 000000000..e71bbe486 --- /dev/null +++ b/healthlink-his-server/healthlink-his-domain/src/main/java/com/healthlink/his/rationaldrug/dto/AuditStatisticsDto.java @@ -0,0 +1,31 @@ +package com.healthlink.his.rationaldrug.dto; + +import lombok.Data; +import lombok.experimental.Accessors; + +import java.math.BigDecimal; + +/** + * 审核统计DTO + * + * @author system + */ +@Data +@Accessors(chain = true) +public class AuditStatisticsDto { + + /** 总审核数 */ + private Long total; + + /** 通过数 */ + private Long passCount; + + /** 拒绝数 */ + private Long rejectCount; + + /** 待人工审核数 */ + private Long manualCount; + + /** 通过率 */ + private BigDecimal passRate; +} diff --git a/healthlink-his-server/healthlink-his-domain/src/main/java/com/healthlink/his/rationaldrug/dto/InteractionCheckResultDto.java b/healthlink-his-server/healthlink-his-domain/src/main/java/com/healthlink/his/rationaldrug/dto/InteractionCheckResultDto.java new file mode 100644 index 000000000..244ea25c6 --- /dev/null +++ b/healthlink-his-server/healthlink-his-domain/src/main/java/com/healthlink/his/rationaldrug/dto/InteractionCheckResultDto.java @@ -0,0 +1,26 @@ +package com.healthlink.his.rationaldrug.dto; + +import lombok.Data; +import lombok.experimental.Accessors; + +/** + * 配伍禁忌检查结果DTO + * + * @author system + */ +@Data +@Accessors(chain = true) +public class InteractionCheckResultDto { + + /** 是否存在配伍禁忌 */ + private Boolean hasInteraction; + + /** 严重程度: CRITICAL/MAJOR/MODERATE */ + private String severity; + + /** 描述 */ + private String description; + + /** 处置建议 */ + private String suggestion; +} diff --git a/healthlink-his-server/healthlink-his-domain/src/main/java/com/healthlink/his/rationaldrug/dto/PrescriptionAuditDto.java b/healthlink-his-server/healthlink-his-domain/src/main/java/com/healthlink/his/rationaldrug/dto/PrescriptionAuditDto.java new file mode 100644 index 000000000..97e7b9d36 --- /dev/null +++ b/healthlink-his-server/healthlink-his-domain/src/main/java/com/healthlink/his/rationaldrug/dto/PrescriptionAuditDto.java @@ -0,0 +1,40 @@ +package com.healthlink.his.rationaldrug.dto; + +import lombok.Data; +import lombok.experimental.Accessors; + +import java.util.List; + +/** + * 处方审核请求DTO + * + * @author system + */ +@Data +@Accessors(chain = true) +public class PrescriptionAuditDto { + + /** 处方ID */ + private Long prescriptionId; + + /** 就诊ID */ + private Long encounterId; + + /** 患者ID */ + private Long patientId; + + /** 医生ID */ + private Long doctorId; + + /** 患者姓名 */ + private String patientName; + + /** 医生姓名 */ + private String doctorName; + + /** 药品编码列表 */ + private List drugCodes; + + /** 人群类型: ADULT/CHILD/ELDERLY/PREGNANT */ + private String population; +} diff --git a/healthlink-his-server/healthlink-his-domain/src/main/java/com/healthlink/his/rationaldrug/mapper/DrugDosageRangeMapper.java b/healthlink-his-server/healthlink-his-domain/src/main/java/com/healthlink/his/rationaldrug/mapper/DrugDosageRangeMapper.java new file mode 100644 index 000000000..eab87e48f --- /dev/null +++ b/healthlink-his-server/healthlink-his-domain/src/main/java/com/healthlink/his/rationaldrug/mapper/DrugDosageRangeMapper.java @@ -0,0 +1,9 @@ +package com.healthlink.his.rationaldrug.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.healthlink.his.rationaldrug.domain.DrugDosageRange; +import org.apache.ibatis.annotations.Mapper; + +@Mapper +public interface DrugDosageRangeMapper extends BaseMapper { +} diff --git a/healthlink-his-server/healthlink-his-domain/src/main/java/com/healthlink/his/rationaldrug/mapper/DrugInteractionRuleMapper.java b/healthlink-his-server/healthlink-his-domain/src/main/java/com/healthlink/his/rationaldrug/mapper/DrugInteractionRuleMapper.java new file mode 100644 index 000000000..c953045db --- /dev/null +++ b/healthlink-his-server/healthlink-his-domain/src/main/java/com/healthlink/his/rationaldrug/mapper/DrugInteractionRuleMapper.java @@ -0,0 +1,9 @@ +package com.healthlink.his.rationaldrug.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.healthlink.his.rationaldrug.domain.DrugInteractionRule; +import org.apache.ibatis.annotations.Mapper; + +@Mapper +public interface DrugInteractionRuleMapper extends BaseMapper { +} diff --git a/healthlink-his-server/healthlink-his-domain/src/main/java/com/healthlink/his/rationaldrug/mapper/PrescriptionAuditLogMapper.java b/healthlink-his-server/healthlink-his-domain/src/main/java/com/healthlink/his/rationaldrug/mapper/PrescriptionAuditLogMapper.java new file mode 100644 index 000000000..f0ffe8153 --- /dev/null +++ b/healthlink-his-server/healthlink-his-domain/src/main/java/com/healthlink/his/rationaldrug/mapper/PrescriptionAuditLogMapper.java @@ -0,0 +1,21 @@ +package com.healthlink.his.rationaldrug.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.healthlink.his.rationaldrug.domain.PrescriptionAuditLog; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.annotations.Select; +import java.util.Map; + +@Mapper +public interface PrescriptionAuditLogMapper extends BaseMapper { + + @Select("SELECT audit_result, COUNT(*) as count FROM prescription_audit_log WHERE del_flag='0' GROUP BY audit_result") + java.util.List> selectAuditStatistics(); + + @Select("SELECT DATE_TRUNC('day', create_time) as audit_date, COUNT(*) as total, " + + "SUM(CASE WHEN audit_result='PASS' THEN 1 ELSE 0 END) as pass_count " + + "FROM prescription_audit_log WHERE del_flag='0' AND create_time >= #{startDate} " + + "GROUP BY DATE_TRUNC('day', create_time) ORDER BY audit_date") + java.util.List> selectAuditTrend(@Param("startDate") String startDate); +} diff --git a/healthlink-his-server/healthlink-his-domain/src/main/java/com/healthlink/his/rationaldrug/service/IDrugDosageRangeService.java b/healthlink-his-server/healthlink-his-domain/src/main/java/com/healthlink/his/rationaldrug/service/IDrugDosageRangeService.java new file mode 100644 index 000000000..7fd8e647d --- /dev/null +++ b/healthlink-his-server/healthlink-his-domain/src/main/java/com/healthlink/his/rationaldrug/service/IDrugDosageRangeService.java @@ -0,0 +1,12 @@ +package com.healthlink.his.rationaldrug.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.healthlink.his.rationaldrug.domain.DrugDosageRange; + +/** + * 剂量范围规则Service接口 + * + * @author system + */ +public interface IDrugDosageRangeService extends IService { +} diff --git a/healthlink-his-server/healthlink-his-domain/src/main/java/com/healthlink/his/rationaldrug/service/IDrugInteractionRuleService.java b/healthlink-his-server/healthlink-his-domain/src/main/java/com/healthlink/his/rationaldrug/service/IDrugInteractionRuleService.java new file mode 100644 index 000000000..97c659578 --- /dev/null +++ b/healthlink-his-server/healthlink-his-domain/src/main/java/com/healthlink/his/rationaldrug/service/IDrugInteractionRuleService.java @@ -0,0 +1,31 @@ +package com.healthlink.his.rationaldrug.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.healthlink.his.rationaldrug.domain.DrugInteractionRule; + +import java.util.List; + +/** + * 配伍禁忌规则Service接口 + * + * @author system + */ +public interface IDrugInteractionRuleService extends IService { + + /** + * 根据药品编码查询相关配伍禁忌规则 + * + * @param drugCode 药品编码 + * @return 配伍禁忌规则列表 + */ + List selectByDrugCode(String drugCode); + + /** + * 查询两种药品之间的配伍禁忌 + * + * @param drugA 药品A编码 + * @param drugB 药品B编码 + * @return 配伍禁忌规则列表 + */ + List selectInteractions(String drugA, String drugB); +} diff --git a/healthlink-his-server/healthlink-his-domain/src/main/java/com/healthlink/his/rationaldrug/service/IPrescriptionAuditLogService.java b/healthlink-his-server/healthlink-his-domain/src/main/java/com/healthlink/his/rationaldrug/service/IPrescriptionAuditLogService.java new file mode 100644 index 000000000..aaa51b1c8 --- /dev/null +++ b/healthlink-his-server/healthlink-his-domain/src/main/java/com/healthlink/his/rationaldrug/service/IPrescriptionAuditLogService.java @@ -0,0 +1,38 @@ +package com.healthlink.his.rationaldrug.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.healthlink.his.rationaldrug.domain.PrescriptionAuditLog; + +import java.util.List; +import java.util.Map; + +/** + * 处方审核日志Service接口 + * + * @author system + */ +public interface IPrescriptionAuditLogService extends IService { + + /** + * 查询审核统计数据 + * + * @return 审核统计结果 (audit_result -> count) + */ + List> selectAuditStatistics(); + + /** + * 查询审核趋势数据 + * + * @param startDate 起始日期 + * @return 审核趋势结果 + */ + List> selectAuditTrend(String startDate); + + /** + * 根据就诊ID查询审核记录 + * + * @param encounterId 就诊ID + * @return 审核记录列表 + */ + List selectByEncounterId(Long encounterId); +} diff --git a/healthlink-his-server/healthlink-his-domain/src/main/java/com/healthlink/his/rationaldrug/service/impl/DrugDosageRangeServiceImpl.java b/healthlink-his-server/healthlink-his-domain/src/main/java/com/healthlink/his/rationaldrug/service/impl/DrugDosageRangeServiceImpl.java new file mode 100644 index 000000000..04e4546eb --- /dev/null +++ b/healthlink-his-server/healthlink-his-domain/src/main/java/com/healthlink/his/rationaldrug/service/impl/DrugDosageRangeServiceImpl.java @@ -0,0 +1,18 @@ +package com.healthlink.his.rationaldrug.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.healthlink.his.rationaldrug.domain.DrugDosageRange; +import com.healthlink.his.rationaldrug.mapper.DrugDosageRangeMapper; +import com.healthlink.his.rationaldrug.service.IDrugDosageRangeService; +import org.springframework.stereotype.Service; + +/** + * 剂量范围规则Service业务层处理 + * + * @author system + */ +@Service +public class DrugDosageRangeServiceImpl + extends ServiceImpl + implements IDrugDosageRangeService { +} diff --git a/healthlink-his-server/healthlink-his-domain/src/main/java/com/healthlink/his/rationaldrug/service/impl/DrugInteractionRuleServiceImpl.java b/healthlink-his-server/healthlink-his-domain/src/main/java/com/healthlink/his/rationaldrug/service/impl/DrugInteractionRuleServiceImpl.java new file mode 100644 index 000000000..3db87dc8e --- /dev/null +++ b/healthlink-his-server/healthlink-his-domain/src/main/java/com/healthlink/his/rationaldrug/service/impl/DrugInteractionRuleServiceImpl.java @@ -0,0 +1,59 @@ +package com.healthlink.his.rationaldrug.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.healthlink.his.rationaldrug.domain.DrugInteractionRule; +import com.healthlink.his.rationaldrug.mapper.DrugInteractionRuleMapper; +import com.healthlink.his.rationaldrug.service.IDrugInteractionRuleService; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 配伍禁忌规则Service业务层处理 + * + * @author system + */ +@Service +public class DrugInteractionRuleServiceImpl + extends ServiceImpl + implements IDrugInteractionRuleService { + + /** + * 根据药品编码查询相关配伍禁忌规则 + * + * @param drugCode 药品编码 + * @return 配伍禁忌规则列表 + */ + @Override + public List selectByDrugCode(String drugCode) { + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.and(w -> w.eq(DrugInteractionRule::getDrugACode, drugCode) + .or() + .eq(DrugInteractionRule::getDrugBCode, drugCode)) + .eq(DrugInteractionRule::getEnabled, "1") + .eq(DrugInteractionRule::getDelFlag, "0"); + return baseMapper.selectList(wrapper); + } + + /** + * 查询两种药品之间的配伍禁忌 + * + * @param drugA 药品A编码 + * @param drugB 药品B编码 + * @return 配伍禁忌规则列表 + */ + @Override + public List selectInteractions(String drugA, String drugB) { + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.and(w -> w + .and(inner -> inner.eq(DrugInteractionRule::getDrugACode, drugA) + .eq(DrugInteractionRule::getDrugBCode, drugB)) + .or() + .and(inner -> inner.eq(DrugInteractionRule::getDrugACode, drugB) + .eq(DrugInteractionRule::getDrugBCode, drugA))) + .eq(DrugInteractionRule::getEnabled, "1") + .eq(DrugInteractionRule::getDelFlag, "0"); + return baseMapper.selectList(wrapper); + } +} diff --git a/healthlink-his-server/healthlink-his-domain/src/main/java/com/healthlink/his/rationaldrug/service/impl/PrescriptionAuditLogServiceImpl.java b/healthlink-his-server/healthlink-his-domain/src/main/java/com/healthlink/his/rationaldrug/service/impl/PrescriptionAuditLogServiceImpl.java new file mode 100644 index 000000000..8baf9b2e7 --- /dev/null +++ b/healthlink-his-server/healthlink-his-domain/src/main/java/com/healthlink/his/rationaldrug/service/impl/PrescriptionAuditLogServiceImpl.java @@ -0,0 +1,58 @@ +package com.healthlink.his.rationaldrug.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.healthlink.his.rationaldrug.domain.PrescriptionAuditLog; +import com.healthlink.his.rationaldrug.mapper.PrescriptionAuditLogMapper; +import com.healthlink.his.rationaldrug.service.IPrescriptionAuditLogService; +import org.springframework.stereotype.Service; + +import java.util.List; +import java.util.Map; + +/** + * 处方审核日志Service业务层处理 + * + * @author system + */ +@Service +public class PrescriptionAuditLogServiceImpl + extends ServiceImpl + implements IPrescriptionAuditLogService { + + /** + * 查询审核统计数据 + * + * @return 审核统计结果 + */ + @Override + public List> selectAuditStatistics() { + return baseMapper.selectAuditStatistics(); + } + + /** + * 查询审核趋势数据 + * + * @param startDate 起始日期 + * @return 审核趋势结果 + */ + @Override + public List> selectAuditTrend(String startDate) { + return baseMapper.selectAuditTrend(startDate); + } + + /** + * 根据就诊ID查询审核记录 + * + * @param encounterId 就诊ID + * @return 审核记录列表 + */ + @Override + public List selectByEncounterId(Long encounterId) { + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(PrescriptionAuditLog::getEncounterId, encounterId) + .eq(PrescriptionAuditLog::getDelFlag, "0") + .orderByDesc(PrescriptionAuditLog::getCreateTime); + return baseMapper.selectList(wrapper); + } +} diff --git a/healthlink-his-server/healthlink-his-domain/src/main/resources/mapper/anesthesia/AnesthesiaFollowupMapper.xml b/healthlink-his-server/healthlink-his-domain/src/main/resources/mapper/anesthesia/AnesthesiaFollowupMapper.xml new file mode 100644 index 000000000..d9c5bbeef --- /dev/null +++ b/healthlink-his-server/healthlink-his-domain/src/main/resources/mapper/anesthesia/AnesthesiaFollowupMapper.xml @@ -0,0 +1,13 @@ + + + + + + + diff --git a/healthlink-his-server/healthlink-his-domain/src/main/resources/mapper/anesthesia/AnesthesiaIoRecordMapper.xml b/healthlink-his-server/healthlink-his-domain/src/main/resources/mapper/anesthesia/AnesthesiaIoRecordMapper.xml new file mode 100644 index 000000000..2af7a432a --- /dev/null +++ b/healthlink-his-server/healthlink-his-domain/src/main/resources/mapper/anesthesia/AnesthesiaIoRecordMapper.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + diff --git a/healthlink-his-server/healthlink-his-domain/src/main/resources/mapper/anesthesia/AnesthesiaMedicationMapper.xml b/healthlink-his-server/healthlink-his-domain/src/main/resources/mapper/anesthesia/AnesthesiaMedicationMapper.xml new file mode 100644 index 000000000..f849f5f7c --- /dev/null +++ b/healthlink-his-server/healthlink-his-domain/src/main/resources/mapper/anesthesia/AnesthesiaMedicationMapper.xml @@ -0,0 +1,13 @@ + + + + + + + diff --git a/healthlink-his-server/healthlink-his-domain/src/main/resources/mapper/anesthesia/AnesthesiaRecordMapper.xml b/healthlink-his-server/healthlink-his-domain/src/main/resources/mapper/anesthesia/AnesthesiaRecordMapper.xml new file mode 100644 index 000000000..cf86bda03 --- /dev/null +++ b/healthlink-his-server/healthlink-his-domain/src/main/resources/mapper/anesthesia/AnesthesiaRecordMapper.xml @@ -0,0 +1,19 @@ + + + + + + + + + diff --git a/healthlink-his-server/healthlink-his-domain/src/main/resources/mapper/anesthesia/AnesthesiaVitalSignMapper.xml b/healthlink-his-server/healthlink-his-domain/src/main/resources/mapper/anesthesia/AnesthesiaVitalSignMapper.xml new file mode 100644 index 000000000..46c93b50e --- /dev/null +++ b/healthlink-his-server/healthlink-his-domain/src/main/resources/mapper/anesthesia/AnesthesiaVitalSignMapper.xml @@ -0,0 +1,20 @@ + + + + + + + + + diff --git a/healthlink-his-server/healthlink-his-domain/src/main/resources/mapper/mrhomepage/MrHomepageMapper.xml b/healthlink-his-server/healthlink-his-domain/src/main/resources/mapper/mrhomepage/MrHomepageMapper.xml new file mode 100644 index 000000000..db4e04638 --- /dev/null +++ b/healthlink-his-server/healthlink-his-domain/src/main/resources/mapper/mrhomepage/MrHomepageMapper.xml @@ -0,0 +1,19 @@ + + + + + + + + + diff --git a/healthlink-his-server/healthlink-his-domain/src/main/resources/mapper/mrhomepage/MrHomepageQualityCheckMapper.xml b/healthlink-his-server/healthlink-his-domain/src/main/resources/mapper/mrhomepage/MrHomepageQualityCheckMapper.xml new file mode 100644 index 000000000..215718fb1 --- /dev/null +++ b/healthlink-his-server/healthlink-his-domain/src/main/resources/mapper/mrhomepage/MrHomepageQualityCheckMapper.xml @@ -0,0 +1,13 @@ + + + + + + + diff --git a/healthlink-his-server/healthlink-his-domain/src/main/resources/mapper/rationaldrug/DrugDosageRangeMapper.xml b/healthlink-his-server/healthlink-his-domain/src/main/resources/mapper/rationaldrug/DrugDosageRangeMapper.xml new file mode 100644 index 000000000..703e85be5 --- /dev/null +++ b/healthlink-his-server/healthlink-his-domain/src/main/resources/mapper/rationaldrug/DrugDosageRangeMapper.xml @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + + + + + + + + select id, drug_code, drug_name, population, min_dose, max_dose, + dose_unit, frequency_min, frequency_max, route, organ_function, + adjustment_note, enabled, del_flag, create_time + from drug_dosage_range + + + + + diff --git a/healthlink-his-server/healthlink-his-domain/src/main/resources/mapper/rationaldrug/DrugInteractionRuleMapper.xml b/healthlink-his-server/healthlink-his-domain/src/main/resources/mapper/rationaldrug/DrugInteractionRuleMapper.xml new file mode 100644 index 000000000..65ce530a1 --- /dev/null +++ b/healthlink-his-server/healthlink-his-domain/src/main/resources/mapper/rationaldrug/DrugInteractionRuleMapper.xml @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + + + + + + + + select id, drug_a_code, drug_a_name, drug_b_code, drug_b_name, + severity, description, suggestion, enabled, del_flag, + create_by, create_time, update_by, update_time + from drug_interaction_rule + + + + + + + diff --git a/healthlink-his-server/healthlink-his-domain/src/main/resources/mapper/rationaldrug/PrescriptionAuditLogMapper.xml b/healthlink-his-server/healthlink-his-domain/src/main/resources/mapper/rationaldrug/PrescriptionAuditLogMapper.xml new file mode 100644 index 000000000..a7baa4323 --- /dev/null +++ b/healthlink-his-server/healthlink-his-domain/src/main/resources/mapper/rationaldrug/PrescriptionAuditLogMapper.xml @@ -0,0 +1,64 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select id, prescription_id, encounter_id, patient_id, patient_name, + doctor_id, doctor_name, audit_result, audit_type, rule_hit, + hit_count, detail, suggestion, auditor_id, auditor_name, + audit_time, del_flag, create_by, create_time, update_by, update_time + from prescription_audit_log + + + + + + + + + diff --git a/healthlink-his-ui/src/api/orderclosedloop/index.js b/healthlink-his-ui/src/api/orderclosedloop/index.js new file mode 100644 index 000000000..4bc1774fe --- /dev/null +++ b/healthlink-his-ui/src/api/orderclosedloop/index.js @@ -0,0 +1,36 @@ +import request from '@/utils/request' + +// 医嘱执行记录列表 +export function listOrderExecuteRecord(params) { + return request({ + url: '/healthlink-his/api/v1/order-closed-loop/list', + method: 'get', + params: params + }) +} + +// 医嘱闭环状态查询 +export function getOrderClosedLoopStatus(orderId) { + return request({ + url: '/healthlink-his/api/v1/order-closed-loop/status/' + orderId, + method: 'get' + }) +} + +// 执行医嘱步骤 +export function executeOrderStep(data) { + return request({ + url: '/healthlink-his/api/v1/order-closed-loop/execute', + method: 'post', + data: data + }) +} + +// 闭环统计 +export function getClosedLoopStatistics(params) { + return request({ + url: '/healthlink-his/api/v1/order-closed-loop/statistics', + method: 'get', + params: params + }) +} diff --git a/healthlink-his-ui/src/api/rationaldrug/index.js b/healthlink-his-ui/src/api/rationaldrug/index.js new file mode 100644 index 000000000..9c2aa451e --- /dev/null +++ b/healthlink-his-ui/src/api/rationaldrug/index.js @@ -0,0 +1,97 @@ +import request from '@/utils/request' + +// 处方审核 +export function auditPrescription(data) { + return request({ + url: '/healthlink-his/api/v1/rational-drug/audit', + method: 'post', + data: data + }) +} + +// 批量审核 +export function batchAudit(data) { + return request({ + url: '/healthlink-his/api/v1/rational-drug/batch-audit', + method: 'post', + data: data + }) +} + +// 审核统计 +export function getAuditStatistics() { + return request({ + url: '/healthlink-his/api/v1/rational-drug/statistics', + method: 'get' + }) +} + +// 审核趋势 +export function getAuditTrend(params) { + return request({ + url: '/healthlink-his/api/v1/rational-drug/trend', + method: 'get', + params: params + }) +} + +// 审核记录 +export function getAuditLog(encounterId) { + return request({ + url: '/healthlink-his/api/v1/rational-drug/audit-log/' + encounterId, + method: 'get' + }) +} + +// 配伍禁忌检查 +export function checkInteraction(data) { + return request({ + url: '/healthlink-his/api/v1/rational-drug/check-interaction', + method: 'post', + data: data + }) +} + +// 配伍禁忌规则列表 +export function listInteractionRules(params) { + return request({ + url: '/healthlink-his/api/v1/rational-drug/interaction-rules', + method: 'get', + params: params + }) +} + +// 新增配伍禁忌规则 +export function addInteractionRule(data) { + return request({ + url: '/healthlink-his/api/v1/rational-drug/interaction-rules', + method: 'post', + data: data + }) +} + +// 修改配伍禁忌规则 +export function updateInteractionRule(data) { + return request({ + url: '/healthlink-his/api/v1/rational-drug/interaction-rules', + method: 'put', + data: data + }) +} + +// 删除配伍禁忌规则 +export function delInteractionRule(id) { + return request({ + url: '/healthlink-his/api/v1/rational-drug/interaction-rules/' + id, + method: 'delete' + }) +} + +// 剂量规则列表 +export function listDosageRules(params) { + return request({ + url: '/healthlink-his/api/v1/rational-drug/dosage-rules', + method: 'get', + params: params + }) +} diff --git a/healthlink-his-ui/src/views/orderclosedloop/execution-track/index.vue b/healthlink-his-ui/src/views/orderclosedloop/execution-track/index.vue new file mode 100644 index 000000000..0a3481b26 --- /dev/null +++ b/healthlink-his-ui/src/views/orderclosedloop/execution-track/index.vue @@ -0,0 +1,217 @@ + + + + + diff --git a/healthlink-his-ui/src/views/orderclosedloop/statistics/index.vue b/healthlink-his-ui/src/views/orderclosedloop/statistics/index.vue new file mode 100644 index 000000000..b356f21ef --- /dev/null +++ b/healthlink-his-ui/src/views/orderclosedloop/statistics/index.vue @@ -0,0 +1,202 @@ + + + + + diff --git a/healthlink-his-ui/src/views/rationaldrug/audit-log/index.vue b/healthlink-his-ui/src/views/rationaldrug/audit-log/index.vue new file mode 100644 index 000000000..064259294 --- /dev/null +++ b/healthlink-his-ui/src/views/rationaldrug/audit-log/index.vue @@ -0,0 +1,178 @@ + + + + + diff --git a/healthlink-his-ui/src/views/rationaldrug/interaction-rule/index.vue b/healthlink-his-ui/src/views/rationaldrug/interaction-rule/index.vue new file mode 100644 index 000000000..0049ec112 --- /dev/null +++ b/healthlink-his-ui/src/views/rationaldrug/interaction-rule/index.vue @@ -0,0 +1,266 @@ + + + + + diff --git a/healthlink-his-ui/src/views/rationaldrug/statistics/index.vue b/healthlink-his-ui/src/views/rationaldrug/statistics/index.vue new file mode 100644 index 000000000..fb1a9c648 --- /dev/null +++ b/healthlink-his-ui/src/views/rationaldrug/statistics/index.vue @@ -0,0 +1,204 @@ + + + + +