Sfoglia il codice sorgente

删除没有用的项目

xiaochan 1 mese fa
parent
commit
045150e84f

+ 0 - 1
pom.xml

@@ -41,7 +41,6 @@
         <module>thyy-thirdpart-api</module>
         <module>thyy-scheduled</module>
         <module>thyy-plugins</module>
-        <module>thyy-hospitalized</module>
         <module>thyy-medinsur</module>
     </modules>
     <dependencies>

+ 0 - 1
thyy-hospitalized/HELP.md

@@ -1 +0,0 @@
-# 住院服务

+ 0 - 40
thyy-hospitalized/pom.xml

@@ -1,40 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
-    <modelVersion>4.0.0</modelVersion>
-    <parent>
-        <groupId>org.thyy.business</groupId>
-        <artifactId>thyy-business</artifactId>
-        <version>0.0.1</version>
-    </parent>
-    <groupId>org.thyy.hospitalized</groupId>
-    <artifactId>thyy-hospitalized</artifactId>
-    <version>${thyy-hospitalized}</version>
-    <name>thyy-hospitalized</name>
-    <description>thyy-hospitalized</description>
-    <packaging>pom</packaging>
-
-    <modules>
-        <module>thyy-doctor</module>
-    </modules>
-
-    <properties>
-        <java.version>21</java.version>
-    </properties>
-    <dependencies>
-        <dependency>
-            <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-starter</artifactId>
-        </dependency>
-    </dependencies>
-
-    <build>
-        <plugins>
-            <plugin>
-                <groupId>org.springframework.boot</groupId>
-                <artifactId>spring-boot-maven-plugin</artifactId>
-            </plugin>
-        </plugins>
-    </build>
-
-</project>

+ 0 - 1
thyy-hospitalized/thyy-doctor/HELP.md

@@ -1 +0,0 @@
-# 住院医生服务

+ 0 - 68
thyy-hospitalized/thyy-doctor/pom.xml

@@ -1,68 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
-    <modelVersion>4.0.0</modelVersion>
-    <parent>
-        <groupId>org.thyy.hospitalized</groupId>
-        <artifactId>thyy-hospitalized</artifactId>
-        <version>0.0.1</version>
-    </parent>
-    <groupId>org.thyy.doctor</groupId>
-    <artifactId>thyy-doctor</artifactId>
-    <version>0.0.1-SNAPSHOT</version>
-    <name>thyy-doctor</name>
-    <description>thyy-doctor</description>
-
-    <properties>
-        <java.version>21</java.version>
-    </properties>
-    <dependencies>
-        <dependency>
-            <groupId>org.thyy</groupId>
-            <artifactId>thyy-gateway</artifactId>
-            <version>0.0.1</version>
-        </dependency>
-        <dependency>
-            <groupId>org.thyy.business</groupId>
-            <artifactId>thyy-utils</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-starter-validation</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>com.baomidou</groupId>
-            <artifactId>mybatis-plus-spring-boot3-starter</artifactId>
-        </dependency>
-    </dependencies>
-
-    <build>
-        <plugins>
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-compiler-plugin</artifactId>
-                <configuration>
-                    <annotationProcessorPaths>
-                        <path>
-                            <groupId>org.projectlombok</groupId>
-                            <artifactId>lombok</artifactId>
-                        </path>
-                    </annotationProcessorPaths>
-                </configuration>
-            </plugin>
-            <plugin>
-                <groupId>org.springframework.boot</groupId>
-                <artifactId>spring-boot-maven-plugin</artifactId>
-                <configuration>
-                    <excludes>
-                        <exclude>
-                            <groupId>org.projectlombok</groupId>
-                            <artifactId>lombok</artifactId>
-                        </exclude>
-                    </excludes>
-                </configuration>
-            </plugin>
-        </plugins>
-    </build>
-
-</project>

+ 0 - 257
thyy-hospitalized/thyy-doctor/src/main/java/org/thyy/doctor/controller/YizhuLuRuController.java

@@ -1,257 +0,0 @@
-package org.thyy.doctor.controller;
-
-import com.alibaba.fastjson2.JSONObject;
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import lombok.RequiredArgsConstructor;
-import org.springframework.validation.annotation.Validated;
-import org.springframework.web.bind.annotation.*;
-import org.thyy.doctor.service.YiZhuLuRuServer;
-import org.thyy.utils.result.R;
-import org.thyy.utils.result.ResultVo;
-import thyyxxk.webserver.config.auth.PassToken;
-import thyyxxk.webserver.config.exception.ExceptionEnum;
-import thyyxxk.webserver.dao.his.zhuyuanyisheng.YiZhuLuRuDao;
-import thyyxxk.webserver.entity.datamodify.GetDropdownBox;
-import thyyxxk.webserver.entity.datamodify.SelectV2;
-import thyyxxk.webserver.entity.datamodify.YzActOrder;
-import thyyxxk.webserver.entity.datamodify.ZyDetailCharge;
-import thyyxxk.webserver.entity.inpatient.patient.Overview;
-import thyyxxk.webserver.entity.inpatient.patient.Patient;
-import thyyxxk.webserver.entity.medicalinsurance.inpatient.SiLimitRequest;
-import thyyxxk.webserver.entity.zhuyuanyisheng.OneClickOrder;
-import thyyxxk.webserver.entity.zhuyuanyisheng.dto.doctorAuth.DoctorAuthParams;
-import thyyxxk.webserver.entity.zhuyuanyisheng.vo.doctorAuth.DoctorAuthRest;
-import thyyxxk.webserver.entity.zhuyuanyisheng.yizhuluru.*;
-import thyyxxk.webserver.utils.ResultVoUtil;
-import thyyxxk.webserver.utils.StringUtil;
-
-import java.math.BigDecimal;
-import java.util.List;
-import java.util.Map;
-
-/**
- * <p>
- * 描述: 医嘱录入
- * </p>
- *
- * @author xc
- * @date 2022-01-04 17:02
- */
-@RestController
-@RequestMapping("/yiZhuLuRu")
-@RequiredArgsConstructor
-public class YizhuLuRuController {
-    private final YiZhuLuRuServer server;
-    private final YiZhuLuRuDao dao;
-
-    @GetMapping("/getOrderNo")
-    public ResultVo<String> getOrderNo() {
-        return server.getOrderNo();
-    }
-
-    @GetMapping("/getMyPatient")
-    public ResultVo<List<Patient>> getMyPatient() {
-        return server.getMyPatient();
-    }
-
-    @PostMapping("/enterOrders")
-    public ResultVo<Map<String, Object>> enterOrders(@RequestBody XinZhenYiZhu param) {
-        return server.enterOrders(param);
-    }
-
-    @GetMapping("/toDeleteAnOrder")
-    public ResultVo<String> toDeleteAnOrder(@RequestParam("orderNo") String orderNo) {
-        return server.toDeleteAnOrder(orderNo);
-    }
-
-    @PostMapping("/confirmOrders")
-    public ResultVo<Map<String, Object>> confirmOrders(@RequestBody XinZhenYiZhu param) {
-        return server.confirmOrders(param);
-    }
-
-    @PostMapping("/huoQuYiZhuShuJu")
-    public ResultVo<List<XinZhenYzActOrder>> huoQuYiZhuShuJu(@RequestBody @Validated YiZhuFeiYongChaXunTiaoJian param) {
-        return server.huoQuYiZhuShuJu(param);
-    }
-
-    @GetMapping("/huoQuXiangMu")
-    @PassToken
-    public ResultVo<List<YiZhuMingChen>> huoQuXiangMu(@RequestParam("code") String code,
-                                                      @RequestParam("groupNo") String groupNo) {
-        return server.huoQuXiangMu(code, groupNo);
-    }
-
-    @GetMapping("/getFrequency")
-    @PassToken
-    public ResultVo<List<GetDropdownBox>> getFrequency() {
-        return server.getFrequency();
-    }
-
-    @GetMapping("/getSupplyType")
-    @PassToken
-    public ResultVo<List<SelectV2>> getSupplyType() {
-        return server.getSupplyType();
-    }
-
-    @GetMapping("/huoQuFeiYongXinXi")
-    @PassToken
-    public ResultVo<Map<String, Object>> huoQuFeiYongXinXi(@RequestParam("queryCode") String queryCode) {
-        if (queryCode == null) {
-            return ResultVoUtil.success();
-        }
-        String[] str = queryCode.split("_");
-        return server.huoQuFeiYongXinXi(str[0], str[1], str[2], str[3], str[4], str[5]);
-    }
-
-    @PostMapping("/deleteMultipleOrders")
-    public ResultVo<Map<String, String>> deleteMultipleOrders(@RequestBody XinZhenYiZhu param) {
-        if (StringUtil.isBlank(param.getInpatientNo())) {
-            return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "请选择患者.");
-        }
-        if (param.getList() == null) {
-            return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "请选择需要删除的医嘱");
-        }
-        return server.deleteMultipleOrders(param);
-    }
-
-    @PostMapping("/stopOrder")
-    public ResultVo<Map<BigDecimal, String>> stopOrder(@RequestBody XinZhenYiZhu param) {
-        return server.stopOrder(param);
-    }
-
-    @GetMapping("/huoQuZhiXinKeShi")
-    public ResultVo<List<GetDropdownBox>> huoQuZhiXinKeShi(String code) {
-        return server.huoQuZhiXinKeShi(code);
-    }
-
-    @PostMapping("/singleDataCheck")
-    public ResultVo<Map<String, Object>> singleDataCheck(@RequestBody XinZhenYiZhu param) {
-        return server.singleDataCheck(param);
-    }
-
-    @PostMapping("/insertTemplateOrder")
-    public ResultVo<JSONObject> insertTemplateOrder(@RequestBody XinZhenYiZhu param) {
-        return server.insertTemplateOrder(param);
-    }
-
-    @PostMapping("/saveTemplate")
-    public ResultVo<String> saveTemplate(@RequestBody YzOrderPattern param) {
-        return server.saveTemplate(param);
-    }
-
-    @GetMapping("/doesTheTemplateExist")
-    public ResultVo<String> doesTheTemplateExist(@RequestParam("name") String name) {
-        return server.doesTheTemplateExist(name);
-    }
-
-    @GetMapping("/huoQuYiZhuMuBan")
-    public ResultVo<IPage<YzOrderPattern>> huoQuYiZhuMuBan(@RequestParam("code") String code,
-                                                           @RequestParam("deptCode") String deptCode,
-                                                           @RequestParam("muBanLeiXing") Integer muBanLeiXing,
-                                                           @RequestParam("currentPage") long currentPage,
-                                                           @RequestParam("total") long total) {
-        return server.huoQuYiZhuMuBan(code, deptCode, muBanLeiXing, currentPage, total);
-    }
-
-
-    @GetMapping("/getDoctorSOrderTemplateMaxSortNo")
-    public ResultVo<Integer> getDoctorSOrderTemplateMaxSortNo() {
-        return server.getDoctorSOrderTemplateMaxSortNo();
-    }
-
-    @GetMapping("/huoQuMuBanShuJu")
-    public ResultVo<List<YzActOrder>> huoQuMuBanShuJu(@RequestParam("code") String code) {
-        return server.huoQuMuBanShuJu(code);
-    }
-
-    @DeleteMapping("/deleteADoctorSOrderTemplate")
-    public ResultVo<String> deleteADoctorsOrderTemplate(@RequestParam("patternCode") String patternCode) {
-        return server.deleteADoctorSOrderTemplate(patternCode);
-    }
-
-    @GetMapping("/collectDoctorSOrderTemplate")
-    public ResultVo<String> collectDoctorsOrderTemplate(@RequestParam("patternCode") String patternCode) {
-        return server.collectDoctorSOrderTemplate(patternCode);
-    }
-
-    @GetMapping("/muBanCaoZuo")
-    public ResultVo<String> muBanCaoZuo(@RequestParam("patternCode") String patternCode,
-                                        @RequestParam("patternName") String patternName,
-                                        @RequestParam("deptCode") String deptCode,
-                                        @RequestParam("sortNo") Integer sortNo,
-                                        @RequestParam("flag") Integer flag) {
-        return server.muBanCaoZuo(patternCode, patternName, deptCode, sortNo, flag);
-    }
-
-    @GetMapping("/expensesForGettingADoctorSOrder")
-    public ResultVo<Map<String, Object>> expensesForGettingADoctorSOrder(@RequestParam("patNo") String patNo,
-                                                                         @RequestParam("times") Integer times) {
-        return server.expensesForGettingADoctorSOrder(patNo, times);
-    }
-
-    @PostMapping("/saveTheThirdLevelDoctor")
-    public ResultVo<String> saveTheThirdLevelDoctor(@RequestBody Overview param) {
-        return server.saveTheThirdLevelDoctor(param);
-    }
-
-    @PostMapping("/associateOrders")
-    public ResultVo<List<XinZhenYzActOrder>> associateOrders(@RequestBody XinZhenYiZhu param) {
-        return server.associateOrders(param);
-    }
-
-
-    @GetMapping("/confirmTheDoctorSOrderWithMedicine")
-    public ResultVo<Map<String, Object>> confirmTheDoctorSOrderWithMedicine(@RequestParam("patNo") String patNo,
-                                                                            @RequestParam("times") Integer times) {
-        return server.confirmTheDoctorSOrderWithMedicine(patNo, times);
-    }
-
-    @PostMapping("/copyOrder")
-    public ResultVo<JSONObject> copyOrder(@RequestBody CopyOrder copyOrder) {
-        return server.copyOrder(copyOrder);
-    }
-
-    @GetMapping("/queryFeeByOrderNo")
-    public ResultVo<List<ZyDetailCharge>> queryFeeByOrderNo(@RequestParam("actOrderNo") BigDecimal actOrderNo) {
-        return server.queryFeeByOrderNo(actOrderNo);
-    }
-
-    @PostMapping("/oneClickStopOrder")
-    public ResultVo<String> oneClickStopOrder(@RequestBody OneClickOrder param) {
-        return server.oneClickStopOrder(param);
-    }
-
-    @PostMapping("/doctorAuthorizationLogin")
-    public ResultVo<DoctorAuthRest> doctorAuthorizationLogin(@RequestBody DoctorAuthParams userInfo) {
-        return server.doctorAuthorizationLogin(userInfo);
-    }
-
-    @GetMapping("/updateOrderInstruction")
-    public ResultVo<String> updateOrderInstruction(@RequestParam("orderNo") BigDecimal orderNo,
-                                                   @RequestParam("str") String str) {
-        return server.updateOrderInstruction(orderNo, str);
-    }
-
-    @PostMapping("/copyTableOrder")
-    public ResultVo<JSONObject> copyTableOrder(@RequestBody XinZhenYiZhu param) {
-        return server.copyTableOrder(param);
-    }
-
-    @GetMapping("/getItemInstructions")
-    public ResultVo<List<JSONObject>> getItemInstructions(@RequestParam(value = "code", defaultValue = "") String code) {
-        return R.success(dao.getItemInstructions(code));
-    }
-
-    @PostMapping("/analyzeSiChargeLimit")
-    public ResultVo<String> analyzeSiChargeLimit(@RequestBody SiLimitRequest request) {
-        return server.analyzeSiChargeLimit(request);
-    }
-
-    @GetMapping("/confirmYzCheck")
-    public ResultVo<String> confirmYzCheck(@RequestParam("patNo") String patNo,
-                                           @RequestParam("times") Integer times,
-                                           @RequestParam("ledgerSn") Integer ledgerSn) {
-        return server.confirmYzCheck(patNo, times, ledgerSn);
-    }
-
-}

+ 0 - 1482
thyy-hospitalized/thyy-doctor/src/main/java/org/thyy/doctor/dao/YiZhuLuRuDao.java

@@ -1,1482 +0,0 @@
-package org.thyy.doctor.dao;
-
-import com.baomidou.mybatisplus.core.conditions.Wrapper;
-import com.baomidou.mybatisplus.core.toolkit.Constants;
-import org.apache.ibatis.annotations.*;
-import thyyxxk.webserver.entity.zhuyuanyisheng.DoctorSOrderFee;
-import thyyxxk.webserver.entity.zhuyuanyisheng.OneClickOrder;
-import thyyxxk.webserver.entity.zhuyuanyisheng.ZyOrderZk;
-import thyyxxk.webserver.entity.zhuyuanyisheng.dto.doctorAuth.DoctorAuthParams;
-import thyyxxk.webserver.entity.zhuyuanyisheng.vo.doctorAuth.DoctorAuthRest;
-import thyyxxk.webserver.entity.zhuyuanyisheng.yizhuluru.*;
-
-import java.math.BigDecimal;
-import java.util.Date;
-import java.util.List;
-import java.util.Set;
-
-/**
- * <p>
- * 描述: 医嘱录入dao
- * </p>
- *
- * @author xc
- * &#064;date  2022-01-04 17:00
- */
-@Mapper
-public interface YiZhuLuRuDao {
-
-
-    @Select("SELECT " +
-            "RTRIM(a.bed_no) bedNo, " +
-            "RTRIM(a.inpatient_no) inpatientNo, " +
-            "a.admiss_times, " +
-            "RTRIM(a.name) as name, " +
-            "sex=isnull(a.sex, 9), " +
-            "mdtrtId=(select b.mdtrt_id from t_si_pat_info b where b.pat_no=a.inpatient_no " +
-            "and b.times=a.admiss_times and b.ledger_sn=a.times_billed), " +
-            "injurySerialNo=(select serial_no from t_injury_si_pat_info where pat_no=a.inpatient_no " +
-            "and times=a.admiss_times and ledger_sn=a.times_billed), " +
-            "medType=a.med_type, " +
-            "dismissOrder=(select count(1) from yz_act_order b where b.inpatient_no=a.inpatient_no " +
-            "and b.admiss_times=a.admiss_times and status_flag > '1' and isnull(group_no,'00')='00' " +
-            "and order_code in ('06026','06053','05973'))," +
-            "orderNoCount = (select count(1) " +
-            "                    from yz_act_order c " +
-            "                    where a.inpatient_no = c.inpatient_no " +
-            "                      and c.admiss_times = a.admiss_times " +
-            "                      and c.status_flag = '1' " +
-            "                      and c.enter_oper = #{userCode}), " +
-            "                   refer_physician, " +
-            "                   (select name from a_employee_mi where code = refer_physician) as refer_physician_name, " +
-            "                   consult_physician, " +
-            "                   (select name from a_employee_mi where code = refer_physician) as consult_physician_name, " +
-            "                   dept_director, " +
-            "                   (select name from a_employee_mi where code = refer_physician) as dept_director_name " +
-            "FROM zy_actpatient a with (NOLOCK) " +
-            "where refer_physician = #{code} " +
-            "ORDER BY cast(bed_no AS int) ")
-    List<Patient> getMyPatient(String code);
-
-
-    @Select("select isnull(balance,0) balance, " +
-            "       total_charge, " +
-            "       charge1, " +
-            "       charge2, " +
-            "       charge3, " +
-            "       charge4, " +
-            "       charge5, " +
-            "       charge6, " +
-            "       charge7, " +
-            "       charge8, " +
-            "       charge9, " +
-            "       charge10, " +
-            "       charge11, " +
-            "       charge12, " +
-            "       charge13, " +
-            "       charge14, " +
-            "       charge15, " +
-            "       charge16, " +
-            "       charge17, " +
-            "       charge18, " +
-            "       charge19, " +
-            "       charge20, " +
-            "       charge21, " +
-            "       charge22, " +
-            "       charge23, " +
-            "       charge24, " +
-            "       charge25, " +
-            "       charge26, " +
-            "       charge27, " +
-            "       charge28, " +
-            "       charge29, " +
-            "       charge30, " +
-            "       yp   = (isnull(charge1 + charge2 + charge28, 0))," +
-            "       jyjc = (isnull(charge8 + charge9 + charge11 + charge18 + charge13, 0))," +
-            "       isnull(charge_yb, 0) charge_yb " +
-            "from zy_ledger_file with (NOLOCK) " +
-            "where inpatient_no = #{inpatientNo} " +
-            "  and admiss_times = #{admissTimes} " +
-            "  and ledger_sn = #{ledgerSn} ")
-    HuanZheFeiYong feiYongXinXi(@Param("inpatientNo") String inpatientNo,
-                                @Param("admissTimes") Integer admissTimes,
-                                @Param("ledgerSn") Integer ledgerSn);
-
-
-    @Select("select                     cast(a.act_order_no as decimal) as act_order_no, " +
-            "                           cast(cast(a.act_order_no as decimal) as varchar) id, " +
-            "    newOrderFlag         = (select count(*) " +
-            "                            from new_act_order_recording " +
-            "                            where new_act_order_recording.act_order_no = a.act_order_no), " +
-            "                           order_code, " +
-            "                           order_name, " +
-            "                           rtrim(frequ_code)                                frequ_code, " +
-            "    frequ_code_name      = (select rtrim(comm) " +
-            "                            from yz_order_frequency " +
-            "                            where code = frequ_code), " +
-            "                           instruction, " +
-            "                           discription, " +
-            "                           infant_flag, " +
-            "                           order_time, " +
-            "                           physician, " +
-            "                           start_time, " +
-            "                           drug_specification, " +
-            "                           drug_quan, " +
-            "    mini_unit_name       = (select name " +
-            "                            from yp_zd_unit with (NOLOCK) " +
-            "                            where code = mini_unit), " +
-            "                           rtrim(supply_code)                               supply_code, " +
-            "    supply_code_name     = (select rtrim(supply_name) " +
-            "                            from yz_supply_type with (NOLOCK) " +
-            "                            where yz_supply_type.supply_code = a.supply_code), " +
-            "                           a.inpatient_no, " +
-            "                           a.admiss_times, " +
-            "                           drug_flag, " +
-            "                           enter_oper, " +
-            "    enter_oper_name      = (select top (1) rtrim(name) " +
-            "                            from a_employee_mi with (NOLOCK) " +
-            "                            where code = enter_oper) /* 录入人 */, " +
-            "                           enter_time, " +
-            "                           mini_unit, " +
-            "                           drug_weight, " +
-            "                           drug_weight_unit, " +
-            "                           rtrim(status_flag)                               status_flag, " +
-            "                           status_time, " +
-            "                           cast(a.parent_no as decimal) as parent_no," +
-            "                           cast(cast(a.parent_no as decimal) as varchar) as parent_no_str, " +
-            "    parent_no_name       = (select kfc.order_name from yz_act_order kfc where kfc.act_order_no = a.parent_no), " +
-            "                           self_buy, " +
-            "                           dose, " +
-            "                           dose_unit, " +
-            "    dose_unit_name       = (select name " +
-            "                            from yp_zd_unit with (NOLOCK) " +
-            "                            where dose_unit = code), " +
-            "                           drug_occ, " +
-            "                           drug_volume, " +
-            "                           drug_vol_unit, " +
-            "                           exclu_back_time, " +
-            "                           exclu_act_order_no, " +
-            "                           pay_self, " +
-            "                           serial, " +
-            "                           group_no, " +
-            "                           signer, " +
-            "                           cl_code, " +
-            "                           doctor_flag, " +
-            "                           emergency_flag, " +
-            "    exclu_type='', " +
-            "    end_time_b=end_time, " +
-            "    new_flag='0', " +
-            "    order_no_pattern=0, " +
-            "    suprice_flag='', " +
-            "    self_flag            ='', " +
-            "    pack_size=0.0, " +
-            "    parent_no_c=           -1000, " +
-            "                           reg_flag, " +
-            "    parent_flag='', " +
-            "                           rtrim(yb_self_flag) as yb_self_flag, " +
-            "                           kf_flag, " +
-            "                           refer_physician, " +
-            "                           consult_physician, " +
-            "    physician_name       = (select top (1) rtrim(name) " +
-            "                            from a_employee_mi with (NOLOCK) " +
-            "                            where code = physician) /* 开这个医嘱的医生 */,  " +
-            "                           exec_unit, " +
-            "    exec_unit_name       = (select top (1) rtrim(name) " +
-            "                            from zd_unit_code with (NOLOCK) " +
-            "                            where code = exec_unit), " +
-            "                           a.dept_code, " +
-            "    dept_name            = (select top (1) rtrim(name) " +
-            "                            from zd_unit_code with (NOLOCK) " +
-            "                            where code = dept_code), " +
-            "                           a.ward_code, " +
-            "    ward_name            = (select top (1) rtrim(name) " +
-            "                            from zd_unit_code with (NOLOCK) " +
-            "                            where code = a.ward_code), " +
-            "    /*管床医生*/ " +
-            "    refer_physician_name = (select rtrim(name) " +
-            "                            from a_employee_mi with (NOLOCK) " +
-            "                            where code = refer_physician), " +
-            "    group_no_name        = (select rtrim(group_name) " +
-            "                            from yp_zd_group_name with (NOLOCK) " +
-            "                            where a.group_no = group_no), " +
-            "    signer_name          = (select top (1) rtrim(name) " +
-            "                            from a_employee_mi with (NOLOCK) " +
-            "                            where code = signer) /*确认人*/, " +
-            "                           confirm_time /*确认时间*/, " +
-            "                           modifier, " +
-            "    modifier_name        = (select top (1) rtrim(name) " +
-            "                            from a_employee_mi with (NOLOCK) " +
-            "                            where code = modifier) /*停止人*/, " +
-            "                           end_time /*停止时间*/, " +
-            "                           b.new_ward as                                    zkWardCode, " +
-            "                           b.new_dept as                                    zkDeptCode, " +
-            "                           kss.yyfs, " +
-            "                           kss.ssqk, " +
-            "                           kss.yysj, " +
-            "    executer1            = (select name from a_employee_mi where code = executer1), " +
-            "    executer2=             (select name from a_employee_mi where code = executer2)," +
-            "    superiorDoctor = (select rtrim(authorized_doctor) from new_act_order_recording na where na.act_order_no = a.act_order_no) " +
-            "from view_xc_all_yz a  with (NOLOCK) left join " +
-            "zy_order_zk b with (NOLOCK) on (a.act_order_no = b.act_order_no) left join " +
-            "yz_act_record_kss kss on (a.act_order_no = kss.act_order_no) " +
-            " ${ew.customSqlSegment} ")
-    List<XinZhenYzActOrder> selectOrderNo(@Param(Constants.WRAPPER) Wrapper<?> wq);
-
-    @Select("select act_order_no, " +
-            "rtrim(status_flag) status_flag," +
-            "frequ_code," +
-            "enter_oper," +
-            "inpatient_no " +
-            "from yz_act_order with (NOLOCK) " +
-            "${ew.customSqlSegment}")
-    List<XinZhenYzActOrder> getOrdersToDelete(@Param(Constants.WRAPPER) Wrapper<?> wq);
-
-    @Update("update yz_act_order " +
-            "set " +
-            "    order_time  = #{order.orderTime,jdbcType=TIMESTAMP}, " +
-            "    start_time  = #{order.startTime,jdbcType=TIMESTAMP}, " +
-            "    end_time    = #{order.endTime,jdbcType=TIMESTAMP}, " +
-            "    supply_code = '044', " +
-            "    frequ_code  = #{order.frequCode}," +
-            "    group_no  = #{order.groupNo}," +
-            "    exec_unit  = #{order.execUnit}, " +
-            "    modifier = #{order.modifier} " +
-            "where act_order_no = ${orderNo} ")
-    void updateSubOrderStatus(BigDecimal orderNo, XinZhenYzActOrder order);
-
-    @Delete("delete yz_act_order ${ew.customSqlSegment} ")
-    void deleteMultipleOrders(@Param(Constants.WRAPPER) Wrapper<?> wq);
-
-    @Update("<script>" +
-            "update yz_act_order " +
-            "set parent_no = null " +
-            "where inpatient_no = #{patNo} " +
-            "  and admiss_times = #{times} " +
-            "  and parent_no in " +
-            "<foreach collection='list' item='item'  open='(' close=')' separator=','>" +
-            "#{item}" +
-            "</foreach>" +
-            "</script>")
-    void deleteParentChildRelationship(String patNo,
-                                       Integer times,
-                                       List<BigDecimal> list);
-
-    @Select("<script>" +
-            "<foreach collection=\"list\" item=\"item\" index=\"index\" separator=\";\">" +
-            "update yz_act_order " +
-            "set modifier = #{userCode}, " +
-            " end_time = #{item.endTime} " +
-            "where inpatient_no = #{patNo} " +
-            "  and admiss_times = #{times}" +
-            "  and (act_order_no = #{item.actOrderNo} or parent_no = #{item.actOrderNo}) " +
-            "  and end_time is null" +
-            "</foreach>" +
-            "</script>")
-    void setStopTime(List<XinZhenYzActOrder> list,
-                     String userCode,
-                     String patNo,
-                     Integer times);
-
-
-    @Select("SELECT         rtrim(a.code) + rtrim(serial) as id, " +
-            "               py_code=a.py_code, " +
-            "                d_code =a.d_code, " +
-            "                order_code =a.code, " +
-            "                order_name =a.name, " +
-            "                drug_specification=a.specification, " +
-            "                    drug_flag =case a.infusion_flag " +
-            "                    when '1' then 'i' " +
-            "                    else (case categories_flag " +
-            "                              when '0' " +
-            "                                  then 'd' " +
-            "                              else 'z' " +
-            "                        end) " +
-            "                           end, " +
-            "                parent_code=null, " +
-            "                exclu_group_type=null, " +
-            "                discription=case a.infusion_flag " +
-            "                                when '1' then '大输液' " +
-            "                                else (case " +
-            "                                          when a.code >= '30000' and a.code < '50000' then '中药' " +
-            "                                          else '西药  ' end) end + convert(char(10), a.pack_retprice) + '元' + '(医保类别:' + " +
-            "                            ltrim(rtrim(yb_flag_new)) + ';报销比例:' + ltrim(rtrim(yb_bl_new)) + ';医保说明:' + " +
-            "                            ltrim(rtrim(yb_comment_new)) + ')', " +
-            "                serial=a.serial, " +
-            "                group_no=a.group_no, " +
-            "                infusion_flag=a.infusion_flag, " +
-            "                group_name =a.group_name, " +
-            "                pack_size=a.pack_size," +
-            "                 (select name " +
-            "        from yp_zd_unit with (NOLOCK) " +
-            "        where code = pack_unit)  as pack_size_name, " +
-            "                order_class='Y', " +
-            "                spec_pack=a.spec_pack, " +
-            "                jsy_flag =a.jsy_flag, " +
-            "                xnh_flag, " +
-            "                yb_comment, " +
-            "                dosage = a.dosage, " +
-            "                yb_type, " +
-            "                yb_flag_new," +
-            "                father_flag, " +
-            "                manu_name=(select name from yp_zd_manufactory with (NOLOCK) where code = a.manu_code), " +
-            "                stock_amount=a.stock_amount, " +
-            "                national_code," +
-            "                national_name " +
-            "FROM view_yp_zd_dict_base_yf a with (NOLOCK) " +
-            "WHERE isnull(a.visible_flag_zy, '') <> '1' " +
-            "  and (a.py_code like #{code} or a.name like #{code} or code like #{code}) " +
-            "  and group_no = '${groupNo}' ")
-    List<YiZhuMingChen> yiZhuYaoPing(@Param("code") String code,
-                                     @Param("groupNo") String groupNo);
-
-    @Select("select act_order_no, " +
-            "rtrim(status_flag) as status_flag," +
-            "rtrim(frequ_code) as frequ_code," +
-            "rtrim(supply_code) as supply_code, " +
-            "inpatient_no," +
-            "admiss_times," +
-            "enter_oper," +
-            "rtrim(serial) as serial," +
-            "order_time," +
-            "start_time," +
-            "end_time," +
-            "group_no," +
-            "ward_code," +
-            "parent_no " +
-            "from yz_act_order with (NOLOCK) " +
-            "where act_order_no = #{orderNo} ")
-    XinZhenYzActOrder getActOrderNoOne(String orderNo);
-
-    @Select("select frequ_code from yz_act_order where act_order_no = ${orderNo} ")
-    String selectParentNo(String orderNo);
-
-    @Select("select cast(cast(act_order_no as decimal) as varchar) " +
-            "from yz_act_order with (NOLOCK) " +
-            "where parent_no = #{orderNo}")
-    List<String> getParentChildOrders(String orderNo);
-
-    @Select("<script>" +
-            "select * " +
-            "from zy_detail_charge with (NOLOCK) " +
-            "where inpatient_no = #{patNo} " +
-            "  and admiss_times = #{times} " +
-            "  and ori_detail_sn is null" +
-            "  and charge_fee > 0 " +
-            "  and order_no in " +
-            "<foreach collection='list' item='item' index='index' open='(' close=')' separator=','>" +
-            " #{item}" +
-            "</foreach>" +
-            "</script>")
-    List<ZyDetailCharge> getExpenseData(String patNo,
-                                        Integer times,
-                                        List<String> list);
-
-    @Update("<script>" +
-            "update zy_detail_charge " +
-            "set ori_detail_sn = -1 " +
-            "where inpatient_no = #{patNo} " +
-            "  and admiss_times = #{times} " +
-            "  and ori_detail_sn is null " +
-            "  and charge_fee > 0 " +
-            "  and order_no in " +
-            "<foreach collection='list' item='item' index='index' open='(' close=')' separator=','>" +
-            " #{item}" +
-            "</foreach>" +
-            "</script>")
-    void updateItemFlag(String patNo,
-                        Integer times,
-                        List<String> list);
-
-    @Update("update yz_act_order " +
-            "set status_flag = '-1', " +
-            "    end_time    = getdate(), " +
-            "    modifier    = #{userCode}, " +
-            "    instruction = #{reasonForCancellation}," +
-            "    order_name = cast('(作废)' + yz_act_order.order_name as char(100))" +
-            "where act_order_no = #{orderNo}")
-    void updateVoidedOrders(String orderNo,
-                            String userCode,
-                            String reasonForCancellation);
-
-    @Update("update yz_yp_zy_order set status_flag = 2 where act_order_no = #{order} and status_flag = 1")
-    void refusalToDispenseMedication(String order);
-
-    @Update("update yz_act_order " +
-            "set status_flag = '-1', " +
-            "    end_time    = getdate(), " +
-            "    modifier    = #{userCode}, " +
-            "    instruction = #{reasonForCancellation}, " +
-            "    order_name = cast('(作废)' + yz_act_order.order_name as char(100))" +
-            "where parent_no = #{orderNo}")
-    void updateChildOrders(String orderNo,
-                           String userCode,
-                           String reasonForCancellation);
-
-    /**
-     * @param deptCode 科室编码
-     * @return 获取医生下面的病区
-     */
-    @Select("select dept " +
-            "from zd_dept_all with (NOLOCK) " +
-            "where small_dept = #{deptCode} " +
-            "  and dept is not null")
-    List<String> getTheDoctorSDepartment(String deptCode);
-
-    /**
-     * @param orderNo 医嘱号
-     * @return 获取已经确认收费的医嘱
-     */
-    @Select("select count(*) " +
-            "from yz_zy_patient_fee with (NOLOCK) " +
-            "where " +
-            "inpatient_no = #{patNo} and " +
-            "admiss_times = #{times} and " +
-            "act_order_no = #{orderNo} and " +
-            "charge_status = '3'")
-    Integer getADoctorSOrderWithADefiniteFee(String patNo,
-                                             Integer times,
-                                             String orderNo);
-
-    @Select("select count(*) " +
-            "from zy_detail_charge with (NOLOCK) " +
-            "where inpatient_no = #{patNo} " +
-            "  and admiss_times = #{times} " +
-            "  and order_no = #{orderNo} " +
-            "  and ori_detail_sn is null" +
-            "  and charge_fee > 0 ")
-    Integer getDetailChargeFee(String patNo,
-                               Integer times,
-                               String orderNo);
-
-    @Update("UPDATE " +
-            "    yz_zy_patient_fee " +
-            "SET charge_status = '2', " +
-            "    op_id         =  #{userid}, " +
-            "    op_date       = GETDATE() " +
-            "WHERE act_order_no = #{orderNo} " +
-            "  AND inpatient_no = #{patNo} " +
-            "  AND admiss_times = #{times} ")
-    void cancelMedicalTechnologyAssuranceFee(String userid,
-                                             String orderNo,
-                                             String patNo,
-                                             Integer times);
-
-    /**
-     * 获取,有未确认和未执行的医嘱
-     *
-     * @param patNo   住院号
-     * @param times   住院次数
-     * @param orderNo 医嘱号
-     * @return 数据
-     */
-    @Select("select rtrim(status_flag) status_flag,order_name, act_order_no,frequ_code " +
-            "from yz_act_order with (NOLOCK) " +
-            "where inpatient_no = #{patNo} " +
-            "  and admiss_times = #{times} " +
-            "  and status_flag in ('1', '2')" +
-            "  and act_order_no <> #{orderNo} " +
-            "  and frequ_code = N'ONCE'" +
-            " union all " +
-            "select rtrim(status_flag) status_flag,order_name, act_order_no,frequ_code " +
-            "from yz_act_order with (NOLOCK) " +
-            "where inpatient_no = #{patNo} " +
-            "  and admiss_times = #{times} " +
-            "  and status_flag in ('1') " +
-            "  and act_order_no <> #{orderNo} " +
-            "  and frequ_code <> N'ONCE' ")
-    List<XinZhenYzActOrder> thereAreUnexecutedOrders(String patNo, Integer times, BigDecimal orderNo);
-
-    @Select("select count(1) " +
-            "from yz_act_order " +
-            "where inpatient_no = #{yz.inpatientNo} " +
-            "  and admiss_times = #{yz.admissTimes} " +
-            "  and status_flag = 1 " +
-            "  and isnull(self_buy, '0') <> '4' " +
-            "  and enter_oper = #{userCode} " +
-            "  and order_code in (select rtrim(order_code) " +
-            "                     from yz_zd_order_item_confirm " +
-            "                     where item_name = N'出院')")
-    int selectDischargeOrde(@Param("yz") XinZhenYiZhu yz,
-                            @Param("userCode") String userCode);
-
-    @Update("update yz_act_order set frequ_code = 'ONCE' WHERE act_order_no = #{orderNo};" +
-            "update yz_act_order " +
-            "set modifier           = #{userCode}, " +
-            "    end_time           = #{date}, " +
-            "    exclu_act_order_no = #{orderNo}, " +
-            "    status_flag = '5' " +
-            "where inpatient_no = #{patNo} " +
-            "  and admiss_times = #{times} " +
-            "  and status_flag in ('2','3','4') " +
-            "  and frequ_code != 'ONCE' " +
-            "  and act_order_no <> #{orderNo}" +
-            "  and (end_time >  #{date} or end_time is null )")
-    void stopOrder(String patNo, Integer times, Date date, String userCode, BigDecimal orderNo);
-
-    @Update("update yz_act_order " +
-            "set confirm_time = #{confirmDate}, " +
-            "    signer       = #{userCode}, " +
-            "    status_time  = #{confirmDate}, " +
-            "    status_flag  = '2'," +
-            "    supply_code  = case " +
-            "                      when parent_no is not null then (select isnull(nullif(supply_child, ''), '044') " +
-            "                                                       from yz_supply_type c " +
-            "                                                       where c.supply_code = (select supply_code " +
-            "                                                                              from yz_act_order b " +
-            "                                                                              where b.act_order_no = yz_act_order.parent_no)) " +
-            "                      else " +
-            "                          yz_act_order.supply_code end " +
-            " where act_order_no = #{decimal}")
-    void confirmOrders(BigDecimal decimal, String userCode, Date confirmDate);
-
-
-    @Update("update yz_act_order " +
-            "set confirm_time = #{confirmDate}, " +
-            "    signer       = #{userCode}, " +
-            "    status_time  = #{confirmDate}, " +
-            "    status_flag  = '2'," +
-            "    supply_code  = case " +
-            "                      when parent_no is not null then (select isnull(nullif(supply_child, ''), '044') " +
-            "                                                       from yz_supply_type c " +
-            "                                                       where c.supply_code = (select supply_code " +
-            "                                                                              from yz_act_order b " +
-            "                                                                              where b.act_order_no = yz_act_order.parent_no)) " +
-            "                      else " +
-            "                          yz_act_order.supply_code end," +
-            " enter_oper = #{userCode},physician = #{userCode}  " +
-            " where act_order_no = #{decimal}")
-    void confirmOrdersSuperiorDoctor(BigDecimal decimal, String userCode, Date confirmDate);
-
-    @Update("update yz_act_order " +
-            "set confirm_time = #{confirmDate}, " +
-            "    signer       = #{userCode}, " +
-            "    status_time  = #{confirmDate}, " +
-            "    status_flag  = '2'," +
-            "    modifier     = #{userCode}," +
-            "    end_time = #{confirmDate}, " +
-            "    frequ_code = 'ONCE'  " +
-            " where act_order_no = #{decimal} ")
-    void takeMedicineAfterDischargeStopOrder(BigDecimal decimal, String userCode, Date confirmDate);
-
-
-    @Update("update yz_act_order " +
-            "set confirm_time = #{confirmDate}, " +
-            "    signer       = #{userCode}, " +
-            "    status_time  = #{confirmDate}, " +
-            "    status_flag  = '2'," +
-            "    modifier     = #{userCode}," +
-            "    end_time = #{confirmDate}, " +
-            "    frequ_code = 'ONCE',enter_oper = #{userCode},physician = #{userCode}  " +
-            " where act_order_no = #{decimal} ")
-    void takeMedicineAfterDischargeStopOrderAndSuperiorDoctor(BigDecimal decimal, String userCode, Date confirmDate);
-
-    @Delete("delete yz_act_record_kss where act_order_no =#{orderNo}; " +
-            "delete zy_order_zk where act_order_no =#{orderNo};" +
-            "delete op_record where inpatient_no = #{patNo} and act_order_no =#{orderNo};" +
-            "delete ysh_yj_req where inpatient_no =#{patNo} and act_order_no =#{orderNo};" +
-            "DELETE FROM yz_act_order WHERE act_order_no = #{orderNo};   ")
-    void toDeleteAnOrder(String orderNo, String patNo);
-
-
-    @Update("UPDATE yz_act_order SET parent_no = NULL WHERE parent_no = #{orderNo} ")
-    void deleteGroup(String orderNo);
-
-
-    @Delete("delete yz_act_order where " +
-            "act_order_no = #{orderNo} ")
-    void deleteOrderNo(String orderNo);
-
-    @Insert("INSERT INTO yz_act_order (order_code, order_name, frequ_code, instruction, discription, infant_flag, order_time, " +
-            "    /*录入人*/physician, start_time, drug_specification, drug_quan, supply_code, act_order_no, inpatient_no, " +
-            "                          admiss_times, drug_flag/*药品中找这个是 药品的类型 a i d*/, enter_oper, /*录入时间*/ " +
-            "                          enter_time, " +
-            "                          mini_unit /*药品中找 最小包装规格*/, " +
-            "                          drug_weight/*药品的重量*/, drug_weight_unit/*药品重量单位*/, " +
-            "                          status_flag/*1*/, self_buy, dose, dose_unit, drug_occ, drug_volume/*药品中的 volum 找*/, " +
-            "                          drug_vol_unit/* 药品中的 vol_unit */, pay_self/*0*/, " +
-            "                          serial/*前端传*/, group_no/*药房 */, doctor_flag/*写死为 1*/, exec_unit, dept_code/* 在院病人表中的 dept */, " +
-            "                          ward_code /* 在院病人表中的 zk_ward*/, " +
-            "                          reg_flag/* 0 */, " +
-            "                          yb_self_flag/*医保自费标志*/, emergency_flag, " +
-            "                          kf_flag /*饭前饭后*/, parent_no, refer_physician/*患者的管床医生*/, end_time," +
-            "                          modifier) " +
-            "values (#{pa.orderCode}, #{pa.orderName}, #{pa.frequCode}, #{pa.instruction}, #{pa.discription}, #{patInfo.infantFlag}, " +
-            "        #{pa.orderTime}, #{userCode}, " +
-            "        #{pa.startTime}, cast(#{pa.drugSpecification} as varchar(16)), #{pa.drugQuan,jdbcType=REAL}, #{pa.supplyCode}, #{pa.actOrderNo,jdbcType=REAL}, #{patInfo.inpatientNo}, " +
-            "        #{patInfo.admissTimes}, #{pa.drugFlag}, #{userCode}, getdate(), " +
-            "        #{pa.miniUnit}, #{pa.drugWeight,jdbcType = REAL}, #{pa.drugWeightUnit,jdbcType=REAL}, '1', #{pa.selfBuy}, " +
-            "        #{pa.dose ,jdbcType = REAL}, #{pa.doseUnit}, #{pa.drugOcc ,jdbcType = REAL}, " +
-            "        #{pa.drugVolume,jdbcType=REAL}, #{pa.drugVolUnit}, '0', #{pa.serial}, #{pa.groupNo}, '1', #{pa.execUnit}, " +
-            "        #{patInfo.deptCode}, #{patInfo.deptCode}, '0', #{pa.ybSelfFlag}, #{pa.emergencyFlag}, " +
-            "        #{pa.kfFlag}, #{pa.parentNo,jdbcType=REAL}, #{patInfo.referPhysician}, #{pa.endTime}," +
-            "        #{pa.modifier})")
-    void insertEntryOrder(XinZhenYiZhu patInfo, XinZhenYzActOrder pa, String userCode);
-
-    @Update("update yz_act_order set " +
-            "frequ_code = #{pa.frequCode}," +
-            "supply_code = #{supplyCode}," +
-            "exec_unit = #{pa.execUnit}," +
-            "order_time = #{pa.orderTime}," +
-            "start_time = #{pa.startTime,jdbcType=TIMESTAMP}," +
-            "end_time = #{pa.endTime,jdbcType=TIMESTAMP}," +
-            "group_no = #{pa.groupNo}," +
-            "modifier = #{pa.modifier} " +
-            "where  inpatient_no = #{pa.inpatientNo} " +
-            " and admiss_times = #{pa.admissTimes}  " +
-            " and parent_no = #{pa.actOrderNo,jdbcType=REAL} ")
-    void howOftenTheSubPhysicianOrderIsModified(@Param("pa") XinZhenYzActOrder pa,
-                                                @Param("supplyCode") String supplyCode);
-
-    @Select("select isnull(nullif(supply_child, ''), '044') " +
-            "from yz_supply_type " +
-            "where supply_code = '${code}'")
-    String selectSupplyCode(String code);
-
-
-    @Select("SELECT rtrim(a.order_code) + '00' as id," +
-            "a.py_code, " +
-            "       a.d_code, " +
-            "       a.order_code , " +
-            "       rtrim(a.order_name) order_name, " +
-            "       drug_specification='诊疗项目', " +
-            "       drug_flag   = isnull(operation,'o') , " +
-            "       a.parent_code , " +
-            "       a.exclu_group_type, " +
-            "       discription=a.discription + '  ' + a.yb_comment, " +
-            "       serial       ='00', " +
-            "       group_no='00', " +
-            "       infusion_flag='', " +
-            "       group_name   ='', " +
-            "       pack_size=1, " +
-            "       order_class=a.order_class, " +
-            "       spec_pack='', " +
-            "       jsy_flag     ='', " +
-            "       xnh_flag='', " +
-            "       yb_comment   =null," +
-            "       exec_dept," +
-            "       exec_dept_name = (select rtrim(name) from zd_unit_code where code = exec_dept), " +
-            "       dosage='', " +
-            "       yb_type='', " +
-            "       father_flag='0', " +
-            "       manu_name='', " +
-            "       stock_amount=0 " +
-            "FROM yz_order_item a with (NOLOCK) " +
-            "WHERE isnull(a.del_flag, '') <> '1' " +
-            "  and (py_code like #{code} or order_name like #{code} or order_code like #{code}) " +
-            "  and order_code not in (select zy_order_code from jc_zd_item) " +
-            "  and isnull(exec_dept, '') <> '2010000' " +
-            "  and order_class not in ('B','C','D') ")
-    List<YiZhuMingChen> yiZhuXiangMu(String code);
-
-    @Select("SELECT a.py_code, " +
-            "       a.d_code, " +
-            "       a.pattern_code as order_code, " +
-            "       a.pattern_name as order_name, " +
-            "       specification='                ', " +
-            "       order_type ='t', " +
-            "       parent_code=space(7), " +
-            "       exclu_group_type=space(1), " +
-            "       discription='成组医嘱', " +
-            "       serial ='0000', " +
-            "       group_no='0000', " +
-            "       infusion_flag='', " +
-            "       drug_flag ='', " +
-            "       group_name ='', " +
-            "       pack_size =1, " +
-            "       order_class ='', " +
-            "       spec_pack='', " +
-            "       jsy_flag ='', " +
-            "       exclu_group_type='', " +
-            "       xnh_flag='', " +
-            "       yb_comment =null, " +
-            "       dosage = '', " +
-            "       yb_type='', " +
-            "       father_flag='0', " +
-            "       manu_name='', " +
-            "       stock_amount=0 " +
-            "FROM yz_OrderPattern a with (NOLOCK) " +
-            "where (py_code like #{code} or " +
-            "pattern_name like #{code} or " +
-            "d_code like  #{code}) and  dept_code = #{deptCode} ")
-    List<YiZhuMingChen> composeOrders(String code, String deptCode);
-
-
-    @Select("SELECT cast(rtrim(isnull(nullif(del_flag, " +
-            "                                ''), " +
-            "                         0)) as int) as del_flag, " +
-            "       national_code                 as national_code, " +
-            "       name                          as order_name " +
-            "FROM yz_order_occurence a with (NOLOCK), " +
-            "     zd_charge_item b with (NOLOCK) " +
-            "where a.occ_code = b.code " +
-            "  and a.order_code = #{code}")
-    List<XinZhenYzActOrder> huoQuXiangMu(String code);
-
-
-    @Select("select CAST(isnull(exclu_group_type, 0) AS INT)  " +
-            "from yz_order_item with (NOLOCK) where order_code = #{code}")
-    Integer shiFouPaiChiYiZhu(String code);
-
-
-    @Select("select                 drug_flag,\n" +
-            "                       categories_flag,\n" +
-            "                       a.serial,\n" +
-            "    /* 医保自费 */\n" +
-            "                       cast(isnull(NULLIF(self_flag_yb,\n" +
-            "                                          ''),\n" +
-            "                                   0) as int)                      as self_flag_yb,\n" +
-            "    /* 重量 */\n" +
-            "                       weight,\n" +
-            "    /* 重量单位 */\n" +
-            "                       weigh_unit,\n" +
-            "    weigh_unit_name  = (select name\n" +
-            "                        from yp_zd_unit with (NOLOCK)\n" +
-            "                        where code = weigh_unit),\n" +
-            "    /*体积*/\n" +
-            "                       volum,\n" +
-            "    /*体积单位*/\n" +
-            "                       vol_unit,\n" +
-            "    vol_unit_name    = (select name\n" +
-            "                        from yp_zd_unit with (NOLOCK)\n" +
-            "                        where code = vol_unit),\n" +
-            "    /*包装体积*/\n" +
-            "                       pack_size,\n" +
-            "    /*包装单位*/\n" +
-            "                       pack_unit,\n" +
-            "    pack_unit_name   = (select name\n" +
-            "                        from yp_zd_unit with (NOLOCK)\n" +
-            "                        where code = pack_unit),\n" +
-            "    /*最小单位*/\n" +
-            "                       mini_unit,\n" +
-            "    mini_unit_name   = (select name\n" +
-            "                        from yp_zd_unit with (NOLOCK)\n" +
-            "                        where code = mini_unit),\n" +
-            "    /* 需要判断医生的权限 在 select\n" +
-            "        doctor_xz_yp\n" +
-            "    from\n" +
-            "        a_employee_mi */\n" +
-            "                       cast(isnull(NULLIF(yp_level,\n" +
-            "                                          ''),\n" +
-            "                                   0) as int)                      as yp_level,\n" +
-            "    /*需要皮试*/\n" +
-            "                       cast(isnull(NULLIF(a.ps_flag,\n" +
-            "                                          ''),\n" +
-            "                                   0) as int)                      as ps_flag,\n" +
-            "                       cast(isnull(NULLIF(kss_flag,\n" +
-            "                                          ''),\n" +
-            "                                   0) as int)                      as kss_flag,\n" +
-            "                       cast(isnull(NULLIF(kjyw_flag,\n" +
-            "                                          ''),\n" +
-            "                                   0) as int)                      as kjyw_flag,\n" +
-            "                       code                                        as order_code,\n" +
-            "                       name                                        as order_name,\n" +
-            "                       frequency                                   as frequCode,\n" +
-            "                       (select isnull(rtrim(comm),\n" +
-            "                                      '')\n" +
-            "                        from yz_order_frequency\n" +
-            "                        where yz_order_frequency.code = frequency) as frequCodeName,\n" +
-            "                       supply_code                                 as supply_code,\n" +
-            "    supply_code_name =supply_name,\n" +
-            "                       national_code,\n" +
-            "                       rtrim(jb_flag) as jb_flag,\n" +
-            "                       high_warning_flag,\n" +
-            "                       winning_bidder_flag,\n" +
-            "                       focus_monitor_flag\n" +
-            "from yp_zd_dict a with (NOLOCK)\n" +
-            "         left join yz_supply_type c on (a.supply_type = c.supply_code)\n" +
-            "where rtrim(code) + rtrim(a.serial) = '${code}'\n" +
-            "  and cast(isnull(NULLIF(a.del_flag, ''), 0) as int) = 0;")
-    YaoPinXinXi huoQuYaoPin(@Param("code") String code);
-
-
-    @Select("select stock_amount, cast(isnull(nullif(visible_flag_zy, ''), 0) as int) as visible_flag_zy " +
-            "from yp_base_yf " +
-            "where rtrim(charge_code) + rtrim(serial) = '${code}' " +
-            "  and group_no = '${groupNo}'")
-    YaoPinXinXi huoQuJinYongXinXi(@Param("code") String code,
-                                  @Param("groupNo") String groupNo);
-
-    @Select("select count(1) " +
-            "from yp_zd_dept " +
-            "where charge_code = #{code}  " +
-            "  and dept_code = #{dept} ")
-    Integer restrictedUseInTheDepartment(@Param("code") String code,
-                                         @Param("dept") String dept);
-
-    @Select("select cast(isnull(NULLIF(doctor_xz_yp, ''), 0) as int) + 1  from a_employee_mi with (NOLOCK) where code = #{code}")
-    Integer huoQuYiShenDengJi(String code);
-
-    @Select("select cast(isnull(NULLIF(doctor_xz_yp, ''), 0) as int) + 1 as doctorLevel," +
-            "       doctor_zy as doctorZy, " +
-            "       dept_code," +
-            "       code " +
-            "from a_employee_mi with (NOLOCK) " +
-            "where code = #{code} ")
-    UserInfo selectedUserInfoByCode(String code);
-
-
-    @Select("select rtrim(supply_code) code,rtrim(supply_name) name " +
-            "from yz_supply_type with (NOLOCK) " +
-            "where ps_flag in ('1', '0')")
-    List<GetDropdownBox> piShiGeiYaoFangShi();
-
-    @Select("select rtrim(code) code, rtrim(comm) name " +
-            "from yz_order_frequency with (NOLOCK) " +
-            "where (code like #{code} or comm like #{code})")
-    List<GetDropdownBox> huoQuZhuYuanPinLv(String code);
-
-
-    @Select("select rtrim(code) as code, rtrim(code) name " +
-            "from yz_order_frequency")
-    List<GetDropdownBox> selectFrequency();
-
-    @Select("select rtrim(supply_code) code, " +
-            "       rtrim(supply_name) name, " +
-            "       py_code, " +
-            "       d_code as          w_code " +
-            "from yz_supply_type with (NOLOCK) where isnull(del_flag , '0') <> '1'")
-    List<SelectV2> selectSupplyType();
-
-
-    @Select("select rtrim(supply_code) code, rtrim(supply_name) name " +
-            "from yz_supply_type with (NOLOCK) " +
-            "where (supply_code like #{code} or supply_name like #{code} or py_code like #{code} )")
-    List<GetDropdownBox> huoQuGeiYaoFangShi(String code);
-
-
-    @Select("SELECT a.code code, " +
-            "       a.name name " +
-            "FROM zd_unit_code a with (NOLOCK), " +
-            "     zd_dept_all b with (NOLOCK) " +
-            "where isnull(a.del_flag, '0') <> '1' " +
-            "  and a.code = b.small_dept " +
-            "  and (a.code like #{code} or a.name like #{code} or py_code like #{code}) " +
-            "group by code,name")
-    List<GetDropdownBox> huoQuZhiXinKeShi(String code);
-
-
-    @Select("<script>" +
-            "select rtrim(code)                       order_code, " +
-            "       rtrim(a.serial)                   serial, " +
-            "       rtrim(group_no)                   group_no, " +
-            "       rtrim(name)                       order_name," +
-            "       case infusion_flag " +
-            "           when '1' then 'i' " +
-            "           else " +
-            "               (case " +
-            "                    when rtrim(code) &gt;= '30000' and rtrim(code) &lt; '50000' then 'z' " +
-            "                    else 'd' end) end as drug_flag, " +
-            "       mini_unit, " +
-            "       isnull(weight,1)                  drug_weight, " +
-            "       weigh_unit                        drug_weight_unit, " +
-            "       isnull(volum,1)                   drug_volume, " +
-            "       vol_unit                          drug_vol_unit," +
-            "       isnull(pack_size,1) pack_size,  " +
-            "       pack_unit," +
-            "       a.pack_retprice,  " +
-            "       national_code," +
-            "       cast(isnull(NULLIF(kjyw_flag, ''), 0) as int) as kjyw_flag," +
-            "       cast(isnull(NULLIF(yp_level, ''), 0) as int)  as yp_level," +
-            "       cast(isnull(NULLIF(del_flag, ''), 0) as int)  as del_flag,  " +
-            "       CASE " +
-            "                           WHEN isnull(b.open_virtual2, '') = '1' then isnull(b.stock_amount_virtual2, 0) " +
-            "                           else isnull(stock_amount,0) end as stock_amount," +
-            "       cast(isnull(nullif(visible_flag_zy, ''), 0) as int) as visible_flag_zy," +
-            "       deptRestrictions = (select count(1) from yp_zd_dept where code = yp_zd_dept.charge_code and dept_code = '${dept}')," +
-            "       a.bill_item_zy  " +
-            " from yp_zd_dict a with (NOLOCK)  " +
-            " left join yp_base_yf b on (code = b.charge_code and  a.serial = b.serial) " +
-            "where rtrim(code) + rtrim(a.serial) + rtrim(group_no) in " +
-            "<foreach collection='code' item='item' index='index' open='(' close=')' separator=','>" +
-            "#{item}" +
-            "</foreach>" +
-            "</script>")
-    List<XinZhenYzActOrder> huoQuYaoPinXinXi(@Param("code") Set<String> code,
-                                             @Param("dept") String dept);
-
-
-    @Select("<script>" +
-            "select          b.order_code, " +
-            "                rtrim(c.name)                 order_name, " +
-            "                national_code, " +
-            "                kjyw_flag = 0, " +
-            "                cast(rtrim(isnull(nullif(c.del_flag, " +
-            "                                         ''), " +
-            "                                  0)) as int) del_flag " +
-            " from " +
-            "     yz_order_occurence b with (NOLOCK) , " +
-            "     zd_charge_item c with (NOLOCK) " +
-            "where b.order_code in " +
-            "<foreach collection='code' item='item' index='index' open='(' close=')' separator=','>" +
-            "#{item}" +
-            "</foreach>" +
-            "  and b.occ_code = c.code" +
-            "</script>")
-    List<XinZhenYzActOrder> huoQuXiangMuXinXi(Set<String> code);
-
-    @Select("select          b.order_code, " +
-            "                rtrim(c.name)                    order_name, " +
-            "                national_code, " +
-            "    kjyw_flag = 0, " +
-            "                cast(rtrim(isnull(nullif(c.del_flag, " +
-            "                                         ''), " +
-            "                                  0)) as int) as del_flag " +
-            "from yz_order_occurence b with (NOLOCK), " +
-            "     zd_charge_item c with (NOLOCK) " +
-            "where b.order_code = #{code} " +
-            "  and b.occ_code = c.code")
-    List<XinZhenYzActOrder> itemDataOne(String code);
-
-
-    @Select("select                 rtrim(code)                                            order_code, " +
-            "                       rtrim(a.serial)                                     as serial, " +
-            "                       rtrim(group_no)                                     as group_no, " +
-            "                       rtrim(name)                                            order_name, " +
-            "                       case infusion_flag " +
-            "                           when '1' then 'i' " +
-            "                           else " +
-            "                               (case " +
-            "                                    when rtrim(code) >= '30000' and rtrim(code) < " +
-            "                                                                    '50000' then 'z' " +
-            "                                    else 'd' end) end                      as drug_flag, " +
-            "                       mini_unit, " +
-            "                       isnull(weight, 1)                                      drug_weight, " +
-            "                       weigh_unit                                             drug_weight_unit, " +
-            "                       isnull(volum, 1)                                       drug_volume, " +
-            "                       vol_unit                                               drug_vol_unit, " +
-            "                       isnull(pack_size, 1)                                as pack_size, " +
-            "                       pack_unit, " +
-            "                       a.pack_retprice, " +
-            "                       national_code, " +
-            "                       cast(isnull(NULLIF(kjyw_flag, ''), 0) as int)       as kjyw_flag, " +
-            "                       cast(isnull(NULLIF(yp_level, ''), 0) as int)        as yp_level, " +
-            "                       cast(isnull(NULLIF(del_flag, ''), 0) as int)        as del_flag, " +
-            "                       CASE " +
-            "                           WHEN isnull(b.open_virtual2, '') = '1' then isnull(b.stock_amount_virtual2, 0) " +
-            "                           else isnull(stock_amount, 0) end                as stock_amount, " +
-            "                       cast(isnull(nullif(visible_flag_zy, ''), 0) as int) as visible_flag_zy," +
-            "                       cast(isnull(NULLIF(kss_flag, ''), 0) as int)        as kss_flag, " +
-            "    deptRestrictions = (select count(1) from yp_zd_dept where code = yp_zd_dept.charge_code and dept_code = '${dept}')," +
-            "    supplyCode = ( select isnull(del_flag, 0) from yz_supply_type where supply_code = '${supplyCode}') " +
-            "from yp_zd_dict a " +
-            "         with (NOLOCK) " +
-            "         left join yp_base_yf b on (code = b.charge_code and a.serial = b.serial) " +
-            "where rtrim(code) + rtrim(a.serial) + rtrim(group_no) = #{code} ")
-    XinZhenYzActOrder drugDataOne(String code, String dept, String supplyCode);
-
-    @Select("select          rtrim(inpatient_no) as inpatient_no, " +
-            "                admiss_times, " +
-            "                rtrim(name)         as name, " +
-            "                rtrim(dept)         as dept_code, " +
-            "                rtrim(zk_ward)      as ward_code, " +
-            "                refer_physician,dept_director, " +
-            "                times_billed, " +
-            "                admiss_date, " +
-            "                small_dept, " +
-            "                bed_no," +
-            "                zk_ward, " +
-            "    ledger_sn = (select max(ledger_sn) " +
-            "                 from zy_ledger_file with (NOLOCK) " +
-            "                 where zy_actpatient.inpatient_no = zy_ledger_file.inpatient_no " +
-            "                   and zy_actpatient.admiss_times = zy_ledger_file.admiss_times)," +
-            "consult_physician,zy_serial_no " +
-            " from zy_actpatient with (NOLOCK) " +
-            "where inpatient_no = #{patNo} " +
-            "  and admiss_times = #{times} ")
-    XinZhenYiZhu queryPatientInfo(@Param("patNo") String patNo,
-                                  @Param("times") Integer times);
-
-    @Select("<script>" +
-            "select top 20 * from (" +
-            "SELECT row_number() over (order by pattern_code ) row_number," +
-            "       rtrim(pattern_code) pattern_code, " +
-            "       rtrim(pattern_name) pattern_name," +
-            "       rtrim(input_id) input_id," +
-            "       input_date," +
-            "       rtrim(input_type) input_type, " +
-            "       sort_no," +
-            "       yiBeiShouCang = (select count(1) from yz_OrderPattern b with (NOLOCK) where b.collect_code = a.pattern_code " +
-            "                           and b.input_id = #{inputId})," +
-            "       collect_code " +
-            "FROM yz_OrderPattern a with (NOLOCK) " +
-            "where 1=1 " +
-            "<if test=\"code != null and code != '' \">" +
-            "and (py_code like #{code} " +
-            "    or pattern_code like #{code} " +
-            "    or pattern_name like #{code}) " +
-            "</if>" +
-            "<if test=\"muBanLeiXing == 2 \">" +
-            " and dept_code = #{deptCode} AND input_type = '2' " +
-            "</if>" +
-            "<if test=\"muBanLeiXing == 3 \">" +
-            "  and input_id = #{inputId} AND input_type = '3' " +
-            "</if>" +
-            "<if test=\"muBanLeiXing == 1\">" +
-            " and input_type = '1' " +
-            "</if>" +
-            "<if test=\"muBanLeiXing == 4\">" +
-            " and input_id = #{inputId} AND input_type = '4' " +
-            "</if>" +
-            "<if test=\"muBanLeiXing == 0\">" +
-            " AND input_type &lt;&gt; '4' " +
-            "</if>" +
-            ") temp where row_number > (${currentPage} - 1) * 20 " +
-            "<if test=\"muBanLeiXing == 3 \">" +
-            " order by sort_no desc " +
-            "</if>" +
-            "</script>")
-    List<YzOrderPattern> huoQuMuBan(@Param("code") String code,
-                                    @Param("inputId") String inputId,
-                                    @Param("deptCode") String deptCode,
-                                    @Param("muBanLeiXing") Integer muBanLeiXing,
-                                    @Param("currentPage") long currentPage);
-
-
-    @Select("select max(sort_no + 1) " +
-            "from yz_OrderPattern " +
-            "where input_id = #{code}")
-    Integer getMyTemplateMaxSortNo(String code);
-
-    @Select("<script>" +
-            "SELECT count(*) " +
-            "FROM yz_OrderPattern with (NOLOCK) " +
-            "where 1=1 " +
-            "<if test=\"code != null and code != '' \">" +
-            "and (py_code like #{code} " +
-            "    or pattern_code like #{code} " +
-            "    or pattern_name like #{code}) " +
-            "</if>" +
-            "<if test=\"muBanLeiXing == 2 \">" +
-            " and dept_code = #{deptCode} AND input_type = '2' " +
-            "</if>" +
-            "<if test=\"muBanLeiXing == 3 \">" +
-            "  and input_id = #{inputId} AND input_type = '3' " +
-            "</if>" +
-            "<if test=\"muBanLeiXing == 1\">" +
-            " and input_type = '1' " +
-            "</if>" +
-            "<if test=\"muBanLeiXing == 4\">" +
-            " and input_id = #{inputId} AND input_type = '4' " +
-            "</if>" +
-            "<if test=\"muBanLeiXing == 0\">" +
-            " AND input_type &lt;&gt; '4' " +
-            "</if>" +
-            "</script>")
-    long huoQuMuBanTotal(@Param("code") String code,
-                         @Param("inputId") String inputId,
-                         @Param("deptCode") String deptCode,
-                         @Param("muBanLeiXing") Integer muBanLeiXing);
-
-
-    @Select("SELECT                 cast(cast(act_order_no as decimal) as varchar) id, " +
-            "                       act_order_no,  " +
-            "                       rtrim(a.order_name) order_name, " +
-            "                       rtrim(a.order_code) order_code, " +
-            "                       a.frequ_code, " +
-            "    frequ_code_name  = (select rtrim(comm) " +
-            "                        from yz_order_frequency with (NOLOCK) " +
-            "                        where yz_order_frequency.code = a.frequ_code), " +
-            "                       a.drug_specification, " +
-            "                       a.supply_code, " +
-            "    supply_code_name = (select rtrim(supply_name) " +
-            "                        from yz_supply_type with (NOLOCK) " +
-            "                        where yz_supply_type.supply_code = a.supply_code), " +
-            "                       a.drug_quan, " +
-            "                       a.instruction, " +
-            "                       a.mini_unit, " +
-            "    mini_unit_name   = (select rtrim(name) from yp_zd_unit with (NOLOCK) where code = mini_unit), " +
-            "                       a.drug_weight, " +
-            "                       a.drug_weight_unit, " +
-            "                       a.parent_no, " +
-            "                       a.drug_volume, " +
-            "                       a.drug_vol_unit, " +
-            "                       a.dose, " +
-            "                       a.dose_unit, " +
-            "    dose_unit_name   = (select rtrim(name) from yp_zd_unit with (NOLOCK) where code = dose_unit), " +
-            "                       a.exclu_act_order_no, " +
-            "                       a.discription, " +
-            "                       a.pattern_code, " +
-            "                       a.order_type, " +
-            "                       a.serial, " +
-            "    self_buy=isnull(a.self_buy, '0'), " +
-            "    del_flag=isnull(b.del_flag, ''), " +
-            "                       a.drug_flag, " +
-            "    suprice_flag='', " +
-            "    self_flag        ='', " +
-            "    parent_flag='', " +
-            "                       a.exec_unit, " +
-            "    exec_unit_name   = (select rtrim(name) from zd_unit_code with (NOLOCK) where code = exec_unit)," +
-            "    group_no         = '00', " +
-            "    group_no_name    = N'项目' " +
-            "FROM yz_pattern_order a with (NOLOCK), " +
-            "     yz_order_item b with (NOLOCK) " +
-            "WHERE a.pattern_code = #{code} " +
-            "  and isnull(a.group_no, '00') = '00' " +
-            "  and a.order_code = b.order_code " +
-            "  and b.order_class not in ('B','C','D')  " +
-            "UNION " +
-            "SELECT                 cast(cast(act_order_no as decimal) as varchar) id," +
-            "                       act_order_no,  " +
-            "                       a.order_name, " +
-            "                       a.order_code, " +
-            "                       a.frequ_code, " +
-            "    frequ_code_name  = (select rtrim(comm) " +
-            "                        from yz_order_frequency with (NOLOCK) " +
-            "                        where yz_order_frequency.code = a.frequ_code), " +
-            "                       a.drug_specification, " +
-            "                       a.supply_code, " +
-            "    supply_code_name = (select rtrim(supply_name) " +
-            "                        from yz_supply_type with (NOLOCK) " +
-            "                        where yz_supply_type.supply_code = a.supply_code), " +
-            "                       a.drug_quan, " +
-            "                       a.instruction, " +
-            "                       b.pack_unit as                                 mini_unit, " +
-            "    mini_unit_name   = (select rtrim(name) from yp_zd_unit with (NOLOCK) where code = b.pack_unit), " +
-            "                       a.drug_weight, " +
-            "                       a.drug_weight_unit, " +
-            "                       a.parent_no, " +
-            "                       a.drug_volume, " +
-            "                       a.drug_vol_unit, " +
-            "                       a.dose, " +
-            "                       a.dose_unit, " +
-            "    dose_unit_name   = (select rtrim(name) from yp_zd_unit with (NOLOCK) where code = dose_unit), " +
-            "                       a.exclu_act_order_no, " +
-            "                       a.discription, " +
-            "                       a.pattern_code, " +
-            "                       a.order_type, " +
-            "                       a.serial, " +
-            "    self_buy=isnull(a.self_buy, case when b.jsy_flag = '1' then '3' else '0' end), " +
-            "    del_flag=isnull(b.visible_flag_zy, ''), " +
-            "                       a.drug_flag, " +
-            "    suprice_flag=b.suprice_flag, " +
-            "    self_flag        =b.self_flag, " +
-            "    parent_flag='', " +
-            "                       a.exec_unit, " +
-            "    exec_unit_name   = (select rtrim(name) from zd_unit_code with (NOLOCK) where code = exec_unit)," +
-            "                       a.group_no, " +
-            "                       (select yp_zd_group_name.group_name " +
-            "                        from yp_zd_group_name " +
-            "                        where yp_zd_group_name.group_no = a.group_no) " +
-            "FROM yz_pattern_order a with (NOLOCK), " +
-            "     view_yp_zd_dict_base_yf b with (NOLOCK) " +
-            "WHERE a.pattern_code = #{code} " +
-            "  and a.group_no = b.group_no " +
-            "  and a.order_code = b.code " +
-            "  and a.serial = b.serial " +
-            "  and isnull(b.visible_flag_zy, '') <> '1'")
-    List<YzActOrder> huoQuMuBanShuJu(String code);
-
-
-    @Select("select pattern_code," +
-            "       rtrim(input_type) as input_type," +
-            "       input_id  " +
-            "from yz_OrderPattern with (NOLOCK) " +
-            "where pattern_name = #{patternName} " +
-            "  and input_id = #{inputId}" +
-            "  and input_type <> 4 ")
-    YzOrderPattern yuanLaiDeMuBanBianMa(@Param("patternName") String patternName,
-                                        @Param("inputId") String inputId);
-
-    @Delete("<script>" +
-            "delete yz_OrderPattern " +
-            "where pattern_code = #{patternCode}; " +
-            "delete yz_pattern_order " +
-            "where pattern_code = #{patternCode} " +
-            "</script>")
-    void shanChuLaoMuBan(@Param("patternCode") String patternCode);
-
-
-    @Insert("insert yz_OrderPattern (pattern_code, pattern_name, py_code, d_code, dept_code, " +
-            "                        ward_code, input_id, " +
-            "                        input_type, input_date, sort_no) " +
-            "values (#{patternCode},#{patternName},#{pyCode},#{dCode},#{deptCode},#{deptCode}," +
-            "#{inputId},#{inputType}," +
-            "getdate(),#{sortNo})")
-    void chaRuMuBan(YzOrderPattern param);
-
-
-    @Select("select count(1) " +
-            "from yz_OrderPattern " +
-            "where pattern_name = #{name} and input_id = #{userCode} ")
-    Integer duplicateTemplateName(@Param("name") String name,
-                                  @Param("userCode") String userCode);
-
-    @Insert("<script>" +
-            "INSERT INTO yz_pattern_order (act_order_no, order_code, frequ_code, drug_flag, supply_code, drug_quan, instruction, " +
-            "                              drug_specification, mini_unit, drug_weight, drug_weight_unit, parent_no, drug_volume, " +
-            "                              drug_vol_unit, dose, dose_unit, drug_occ,  order_name, discription, " +
-            "                              pattern_code, serial, self_buy, exec_unit,group_no) " +
-            "VALUES " +
-            "<foreach collection='list' item='item' separator=','>" +
-            "(#{item.actOrderNo}, #{item.orderCode}, #{item.frequCode}," +
-            "<if test=\"item.drugFlag !=null and item.drugFlag != '' \">" +
-            "#{item.drugFlag}," +
-            "</if>" +
-            "<if test=\"item.drugFlag == null or item.drugFlag == '' \">" +
-            "'o'," +
-            "</if>" +
-            " #{item.supplyCode}," +
-            "<if test=\"item.drugQuan != null \">" +
-            "#{item.drugQuan}," +
-            "</if>" +
-            "<if test=\"item.drugQuan == null \">" +
-            "null," +
-            "</if>" +
-            "#{item.instruction}, #{item.drugSpecification}, #{item.miniUnit}, " +
-            "<if test=\"item.drugWeight != null\">" +
-            "#{item.drugWeight}, " +
-            "</if>" +
-            "<if test=\"item.drugWeight == null\">" +
-            "null, " +
-            "</if>" +
-            "#{item.drugWeightUnit}, " +
-            "<if test=\"item.parentNo != null \">" +
-            "#{item.parentNo}," +
-            "</if>" +
-            "<if test=\"item.parentNo == null \">" +
-            "null," +
-            "</if>" +
-            "<if test=\"item.drugVolume != null\">" +
-            "cast(#{item.drugVolume,jdbcType=DECIMAL} as decimal(10,2))," +
-            "</if>" +
-            "<if test=\"item.drugVolume == null\">" +
-            "null," +
-            "</if>" +
-            " #{item.drugVolUnit}, " +
-            "<if test=\"item.dose != null\">" +
-            "cast(#{item.dose,jdbcType=DECIMAL} as decimal(10,2))," +
-            "</if>" +
-            "<if test=\"item.dose == null\">" +
-            "null," +
-            "</if>" +
-            "#{item.doseUnit}," +
-            "<if test=\"item.drugOcc != null \">" +
-            "cast(#{item.drugOcc,jdbcType=DECIMAL} as decimal(10,2))," +
-            "</if>" +
-            "<if test=\"item.drugOcc == null \">" +
-            "null," +
-            "</if>" +
-            " #{item.orderName},#{item.discription},#{patternCode},#{item.serial},#{item.selfBuy},#{item.execUnit},#{item.groupNo})" +
-            "</foreach>" +
-            "</script>")
-    void chaRuMuBanShuJu(List<XinZhenYzActOrder> list, String patternCode);
-
-
-    @Select("select * " +
-            "from yz_OrderPattern with (NOLOCK) " +
-            "where pattern_code = #{code}")
-    YzOrderPattern huoQuMuBanXinXi(@Param("code") String code);
-
-    @Update("update yz_OrderPattern " +
-            "set pattern_name = #{patternName}, " +
-            "    py_code      = #{pyCode}, " +
-            "    d_code       = #{dCode}, " +
-            "    input_date   = getdate()," +
-            "    sort_no = #{sortNo} " +
-            "where pattern_code = #{patternCode} ")
-    void genXingMuBan(@Param("patternName") String patternName,
-                      @Param("pyCode") String pyCode,
-                      @Param("dCode") String dCode,
-                      @Param("patternCode") String patternCode,
-                      @Param("sortNo") Integer sortNo);
-
-    @Select("select rtrim(dept_code) from a_employee_mi where code = '${code}'")
-    String userDeptCode(@Param("code") String code);
-
-    @Delete("/* 父模板 */  " +
-            "delete yz_OrderPattern " +
-            "where pattern_code = #{patternCode}; " +
-            "/* 模板下面的数据 */  " +
-            "delete yz_pattern_order " +
-            "where pattern_code = #{patternCode} ")
-    void shanChuMuBan(@Param("patternCode") String patternCode);
-
-    @Select("select pattern_code " +
-            "from yz_OrderPattern " +
-            "where collect_code = #{patternCode} and input_id = #{userId}")
-    String whetherToSaveTheDoctorSOrderTemplate(@Param("patternCode") String patternCode,
-                                                @Param("userId") String userId);
-
-    @Select("select collect_code " +
-            "from yz_OrderPattern with (NOLOCK) " +
-            "where input_id = #{inputId} " +
-            "  and collect_code = #{collectCode} ")
-    String chongFuShouCang(@Param("inputId") String inputId,
-                           @Param("collectCode") String collectCode);
-
-
-    @Insert("insert into yz_OrderPattern (pattern_code, pattern_name, py_code, d_code, dept_code, ward_code, " +
-            "                             input_id, input_type, input_date, sort_no, collect_code) " +
-            "values (#{patternCode},#{patternName},#{pyCode},#{dCode},#{deptCode},#{deptCode},#{inputId},'4',getdate(),0,#{collectCode});")
-    void chaRuShouCang(@Param("patternCode") String patternCode,
-                       @Param("patternName") String patternName,
-                       @Param("pyCode") String pyCode,
-                       @Param("dCode") String dCode,
-                       @Param("deptCode") String deptCode,
-                       @Param("inputId") String inputId,
-                       @Param("collectCode") String collectCode);
-
-    @Delete("delete yz_act_record_kss where act_order_no = #{orderNo}")
-    void deleteAntimicrobialInformation(String orderNo);
-
-    @Insert("insert into yz_act_record_kss " +
-            "(act_order_no, charge_code, input_id, inpatient_no, " +
-            "admiss_times, yyfs, ssqk, yysj)" +
-            "values " +
-            "(#{orderNo},#{kss.chargeCode},#{userCode},#{patNo}," +
-            "#{times},#{kss.yyfs},#{kss.ssqk},#{kss.yysj})")
-    void insertAntimicrobialInformation(String orderNo,
-                                        YzActRecordKss kss,
-                                        String userCode,
-                                        String patNo,
-                                        Integer times);
-
-    @Delete("delete zy_order_zk where act_order_no = #{orderNo}")
-    void deleteTransferOrder(String orderNo);
-
-    @Insert("insert into zy_order_zk (act_order_no, old_ward, " +
-            "old_dept, new_ward, new_dept) " +
-            "values (#{actOrderNo},#{oldWard},#{oldDept},#{newWard},#{newDept})")
-    void insertDoctorSOrder(ZyOrderZk zk);
-
-
-    @Select("execute dbo.xc_zy_order_fee;1 @in_no = #{patNo}, @in_times = #{times}")
-    List<DoctorSOrderFee> expensesForGettingADoctorSOrder(@Param("patNo") String patNo,
-                                                          @Param("times") Integer times);
-
-    @Update("UPDATE zy_actpatient " +
-            "SET refer_physician   = #{param.referPhysician}, " +
-            "    consult_physician = #{param.consultPhysician}, " +
-            "    dept_director     = #{param.deptDirector} " +
-            "WHERE inpatient_no = #{param.inpatientNo} " +
-            "  AND admiss_times = #{param.admissTimes} ")
-    void updateTheThirdLevelDoctor(@Param("param") Overview param);
-
-
-    @Update("update yz_act_order " +
-            "    set " +
-            "    parent_no   = ${order.actOrderNo}," +
-            "    order_time  = #{order.orderTime,jdbcType=TIMESTAMP}, " +
-            "    start_time  = #{order.startTime,jdbcType=TIMESTAMP}, " +
-            "    end_time    = #{order.endTime,jdbcType=TIMESTAMP}, " +
-            "    supply_code = dbo.get_child_supply(${order.actOrderNo}), " +
-            "    frequ_code  = #{order.frequCode}," +
-            "    group_no  = #{order.groupNo} " +
-            "where act_order_no = ${children} " +
-            "  and status_flag = '1' ")
-    void associateOrders(BigDecimal children, XinZhenYzActOrder order);
-
-
-    @Select("SELECT                 a.gen_time, " +
-            "                       inpatient_no, " +
-            "                       admiss_times, " +
-            "                       ledger_sn, " +
-            "                       a.detail_sn, " +
-            "                       a.charge_date, " +
-            "                       a.charge_code_mx, " +
-            "    charge_code_name = (case " +
-            "                            when serial = '99' or serial = '01' " +
-            "                                then (select top 1 rtrim(name) " +
-            "                                      from yp_zd_dict " +
-            "                                      where code = charge_code_mx " +
-            "                                        and yp_zd_dict.serial = a.serial) " +
-            "                            else (select rtrim(name) from zd_charge_item where code = charge_code_mx) end), " +
-            "                       a.charge_fee, " +
-            "                       a.charge_status, " +
-            "                       a.serial, " +
-            "    charge_amount=a.charge_amount, " +
-            "    exec_dept=(select name from zd_unit_code where code = a.exec_unit), " +
-            "    dept_code        = (select name from zd_unit_code where code = a.ward_code), " +
-            "                       isnull(a.ori_detail_sn, 0) as ori_detail_sn " +
-            "FROM zy_detail_charge a " +
-            "where abs(order_no) = #{yz.actOrderNo} " +
-            "  and inpatient_no  = #{yz.inpatientNo} " +
-            "  and admiss_times  = #{yz.admissTimes} " +
-            "order by charge_date desc ")
-    List<ZyDetailCharge> selectOrderFee(@Param("yz") XinZhenYzActOrder yz);
-
-    @Update("update yz_act_order " +
-            "set modifier           = #{userCode}, " +
-            "    end_time           = #{param.date}, " +
-            "    exclu_act_order_no = #{param.orderNo} " +
-            "where inpatient_no = #{param.patNo} " +
-            "  and admiss_times = #{param.times} " +
-            "  and status_flag in ('3', '4') " +
-            "  and frequ_code <> 'ONCE' " +
-            "  and end_time is null")
-    int oneClickStopOrder(@Param("param") OneClickOrder param,
-                          @Param("userCode") String userCode);
-
-    @Insert("insert into yz_act_order (act_order_no, inpatient_no, admiss_times, order_code, order_time, frequ_code, enter_time, " +
-            "                          enter_oper, start_time, end_time, infant_flag, drug_flag, " +
-            "                          physician, confirm_time, signer, modifier, status_flag, status_time, " +
-            "                          instruction, order_name, pay_self, serial, group_no, ward_code, " +
-            "                          doctor_flag, dept_code, exec_unit, zy_serial_no, refer_physician, consult_physician) " +
-            "values (#{one.orderNo}, #{one.patNo}, #{one.times}, '10507', #{one.nowDate}, 'ONCE', #{one.nowDate}," +
-            " #{one.userCode},#{one.nowDate}, null, #{p.infantFlag}, 'o'," +
-            " #{one.userCode}, #{one.nowDate}, #{one.userCode}, #{one.userCode}, '5', #{one.nowDate}," +
-            " '一键停止医嘱' +  N'${one.dateStr}'  , #{one.name}, '0','00', '00', #{p.deptCode}, '1', #{p.deptCode}, #{p.zkWard}, '', #{p.referPhysician}, #{p.consultPhysician})")
-    void insertOneClickStopOrder(@Param("one") OneClickOrder one,
-                                 @Param("p") XinZhenYiZhu p);
-
-
-    @Select("select rtrim(a.name) as name, a.code, a.code_rs, cast(isnull(NULLIF(doctor_xz_yp, ''), 0) as int) + 1 as doctorLevel  " +
-            "from dj_user_base dj, " +
-            "     a_employee_mi a " +
-            "where dj.code = a.code " +
-            "  and isnull(a.del_flag, '0') = '0' " +
-            "  and a.code = #{us.code} " +
-            "  and dj.password = #{us.password} ")
-    DoctorAuthRest doctorAuthorizationLogin(@Param("us") DoctorAuthParams us);
-
-    @Select("select code_rs, code, name, cast(isnull(NULLIF(doctor_xz_yp, ''), 0) as int) + 1 as doctorLevel\n" +
-            "from a_employee_mi\n" +
-            "where code = #{us.code}\n" +
-            "  and emr_sign_pwd = #{us.signCode}")
-    DoctorAuthRest doctorAuthorizationLoginByEmrSignPwd(@Param("us") DoctorAuthParams us);
-
-    @Select("select isnull(yp_level, 0) " +
-            "from yp_zd_dict " +
-            "where code + '_' + serial = '${code}'")
-    Integer selectYpLevel(@Param("code") String code);
-
-    @Select("update new_act_order_recording " +
-            "set authorized_doctor = #{userCode} " +
-            "where act_order_no = #{orderNo}")
-    void updateAuthorizedDoctor(@Param("orderNo") BigDecimal orderNo,
-                                @Param("userCode") String userCode);
-
-    @Update("update yz_act_order set instruction = cast('${str}' as char(100)) where act_order_no = #{order} ")
-    void updateOrderInstruction(@Param("order") BigDecimal order,
-                                @Param("str") String str);
-
-    @Select("select count(1) from yz_order_frequency where code = #{code}")
-    int getTheFrequency(@Param("code") String code);
-
-    @Select("select item_name, order_code , count from yz_zd_order_item_confirm ")
-    List<YzZdOrderItemConfirm> selectYzItemConfirm();
-
-    @Select("select count(1) from yz_act_order where inpatient_no = '${patNo}' and admiss_times = ${times} and " +
-            "order_code = '${orderCode}' and serial = '00'")
-    Integer selectCountByOrderCode(String patNo, Integer times, String orderCode);
-
-    @Select("SELECT 收费编码=a.occ_code ,          \n" +
-            "         项目名称=b.name ,  \n" +
-            "\t\t 数量=a.amount  ,\n" +
-            "         单价=b.charge_amount ,\n" +
-            "\t\t 个人自付比例=cast(cast(selfpay_prop as decimal(10,2))*100 as varchar)+'%',\n" +
-            "\t\t 医保说明=isnull(b.connotation,'无')+'|'+isnull(b.descriptions,'无'),\n" +
-            "\t\t 医保编码=national_code \n" +
-            "    FROM yz_order_occurence a  ,zd_charge_item b\n" +
-            "where    a.order_code='${code}' and \n" +
-            "         a.occ_code=b.code ")
-    List<JSONObject> getItemInstructions(String code);
-
-
-    @Select("select case when a.serial = '00' then c.occ_code else a.order_code end\n" +
-            "from yz_act_order a\n" +
-            "         left join yz_order_occurence c on (a.serial = '00' and a.order_code = c.order_code)" +
-            " ${ew.customSqlSegment} ")
-    Set<String> selectOrderCode(@Param(Constants.WRAPPER) Wrapper<?> qw);
-
-}

+ 0 - 67
thyy-hospitalized/thyy-doctor/src/main/java/org/thyy/doctor/entity/GetDropdownBox.java

@@ -1,67 +0,0 @@
-package org.thyy.doctor.entity;
-
-import cn.hutool.core.util.StrUtil;
-import com.fasterxml.jackson.annotation.JsonInclude;
-import lombok.Data;
-
-@Data
-public class GetDropdownBox {
-    private String code;
-    private String name;
-    @JsonInclude(JsonInclude.Include.NON_NULL)
-    private String pyCode;
-    @JsonInclude(JsonInclude.Include.NON_NULL)
-    private String wCode;
-    @JsonInclude(JsonInclude.Include.NON_NULL)
-    private String DCode;
-    @JsonInclude(JsonInclude.Include.NON_NULL)
-    private String ybCode;
-    @JsonInclude(JsonInclude.Include.NON_NULL)
-    private String deptName;
-    @JsonInclude(JsonInclude.Include.NON_NULL)
-    private String codeRs;
-    @JsonInclude(JsonInclude.Include.NON_NULL)
-    private String siCaty;
-    @JsonInclude(JsonInclude.Include.NON_NULL)
-    private String siCatyName;
-    @JsonInclude(JsonInclude.Include.NON_NULL)
-    private String empTitName;
-    @JsonInclude(JsonInclude.Include.NON_NULL)
-    private String parentCode;
-
-    public String getCode() {
-        if (StrUtil.isBlank(code)) {
-            return code;
-        }
-        return code.trim();
-    }
-
-    public String getName() {
-        if (StrUtil.isBlank(name)) {
-            return name;
-        }
-        return name.trim();
-    }
-
-    public String getPyCode() {
-        if (StrUtil.isBlank(pyCode)) {
-            return pyCode;
-        }
-        return pyCode.trim();
-    }
-
-    public String getWCode() {
-        if (StrUtil.isBlank(wCode)) {
-            return wCode;
-        }
-        return wCode.trim();
-    }
-
-    public String getValue() {
-        return getCode();
-    }
-
-    public String getLabel() {
-        return getName();
-    }
-}

+ 0 - 88
thyy-hospitalized/thyy-doctor/src/main/java/org/thyy/doctor/entity/Overview.java

@@ -1,88 +0,0 @@
-package org.thyy.doctor.entity;
-
-import cn.hutool.core.util.StrUtil;
-import lombok.Data;
-
-import java.math.BigDecimal;
-import java.util.Date;
-
-/**
- * @author dj
- */
-@Data
-public class Overview {
-    private String bedNo;
-    private String inpatientNo;
-    private Integer admissTimes;
-    private String name;
-    private Integer sex;
-    private String mdtrtId;
-    private String injurySerialNo;
-    private String medType;
-    private String sid;
-    private String staffId;
-    private Integer ledgerSn;
-    private Integer dismissOrder;
-    // 以下部分中间断账费用上传用
-    private Boolean midSetl;
-    private Date begntime;
-    private Date endtime;
-
-    private Integer status;
-
-    /**
-     * 未确认的医嘱
-     */
-    private Integer orderNoCount;
-
-    /**
-     * 管床医生
-     */
-    private String referPhysician;
-    private String referPhysicianName;
-
-    /**
-     * 主治医生
-     */
-    private String consultPhysician;
-    private String consultPhysicianName;
-
-    /**
-     * 主任医生
-     */
-    private String deptDirector;
-    private String deptDirectorName;
-
-    /**
-     * 总费用
-     */
-    private BigDecimal totalCharge;
-    /**
-     * 余额
-     */
-    private BigDecimal balance;
-    /**
-     * 入院诊断
-     */
-    private String admissDiagStr;
-    /**
-     * 临床诊断
-     */
-    private String clinicDiagStr;
-    /**
-     * 医保身份
-     */
-    private String responceTypeName;
-
-    private Date admissDate;
-
-    private String zkys;
-    private String zkysName;
-
-    public Integer getStatus() {
-        if (StrUtil.isNotBlank(mdtrtId) || StrUtil.isNotBlank(injurySerialNo)) {
-            return 1;
-        }
-        return 0;
-    }
-}

+ 0 - 249
thyy-hospitalized/thyy-doctor/src/main/java/org/thyy/doctor/entity/Patient.java

@@ -1,249 +0,0 @@
-package org.thyy.doctor.entity;
-
-import cn.hutool.core.date.DateUtil;
-import cn.hutool.core.util.StrUtil;
-import com.alibaba.fastjson2.JSONObject;
-import lombok.Data;
-
-import java.math.BigDecimal;
-import java.util.Date;
-
-@Data
-public class Patient {
-    private String table;
-    private String inpatientNo;
-    private String inOutStatusFlag;
-    private Integer admissTimes;
-
-    /**
-     * 出院日期
-     */
-    private Date disDate;
-    private Integer ledgerSn;
-    private String staffId;
-    private String psnCertType;
-    private String socialNo;
-    private String mzNo;
-    private String name;
-    private Integer sex;
-    private String birthDate;
-    private String homeTel;
-    private String icdCode;
-    private String icdText;
-    private String admissPhysician;
-    private String admissPhysicianName;
-    private String referPhysician;
-    private String referPhysicianName;
-    private String acctUsedFlag;
-    private String dutyNurse;
-    private String dutyNurseName;
-    private String country;
-    private String nation;
-    private String contactName;
-    private String contactRelation;
-    private String contactAddrName;
-    private String contactPhone;
-    private String admissDiagStr;
-    private String clinicDiagStr;
-    private String admissWard;
-    private String admissWardName;
-    private String admissDept;
-    private String smallDept;
-    private String smallDeptName;
-    private String deptCode;
-    private Date admissDate;
-    private Date ybRegisterDate;
-    private String responceType;
-    private String responceName;
-    private Integer dismissOrder;
-    private String zkWard;
-    private String zkWardName;
-    private String bedNo;
-    private String statusFlag;
-    private String totalCharge;
-    private String indiId;
-    private String zySerialNo;
-    private String centerId;
-    private String ward;
-    private String sid;
-    private String disDiagStatus;
-    private String operation;
-    private String chargeYb;
-    private Boolean midSetl; // 中间断账标志
-    private Date zjdzDatetime; // 中间断账时间
-    private Date dismissOrderDate; // 口腔科生成出院医嘱的出院时间
-    private String medType;
-    private String medTypeName;
-    private String insutype;
-    private String insutypeName;
-    private Integer admdvs;
-    private Integer[] admdvsCascader;
-    private String matnType; // 生育类别
-    private String latechbFlag; // 是否晚育
-    private String pretFlag; // 是否早产
-    private String mdtrtId;
-    private String injurySerialNo;
-    private String actIptDays; // 入院时间
-    private String revokeRemark;
-
-    /**
-     * 离院方式
-     */
-    private String zyDismissWay;
-    /**
-     * 患者居住地
-     */
-    private String homeStreet;
-    private Integer age;
-
-    /**
-     * 纬度
-     */
-    private BigDecimal latitude;
-
-    /**
-     * 经度
-     */
-    private BigDecimal longitude;
-
-    /**
-     * 转化成功标志
-     */
-    private Integer addrTransedFlag;
-
-    /**
-     * 同区域的人数
-     */
-    private Integer numberOfPeopleInTheSameArea;
-
-    /**
-     * 是否有出纳
-     */
-    private Integer timesBilled;
-
-    private String yp;
-    private String jyjc;
-    private String yb;
-    // 余额
-    private String balance;
-
-    private Date begntime;
-    private Date endtime;
-    private String diseCode;
-    private String diseName;
-    private String expContent;
-    private Boolean deathFlag;
-
-    private JSONObject drgGrouping;
-
-
-    /**
-     * DRG权重
-     */
-    private String groupInfoWeight;
-
-    /**
-     * 分组结果名称
-     */
-    private String groupInfoName;
-
-    /**
-     * 倍率(DRG)
-     */
-    private String groupInfoBl;
-
-    /**
-     * 盈亏额
-     */
-    private String groupInfoProfit;
-
-    /**
-     * 标杆费用
-     */
-    private String groupInfoFeeStand;
-    /**
-     * 病危状态
-     */
-    private String criticallyIllStatus;
-    /**
-     * 护理级别
-     */
-    private String nursingLevel;
-    /**
-     * 手术状态
-     */
-    private String oprtStatus;
-
-    /**
-     * 是否已经审核了
-     */
-    private Integer emrAudit;
-
-    /**
-     * 质控医生 来源 batj_ba2 zkys
-     */
-    private String zkys;
-
-    /**
-     * 主治医生
-     */
-    private String consultPhysician;
-    private String consultPhysicianName;
-
-    /**
-     * 主任医生
-     */
-    private String deptDirector;
-    private String deptDirectorName;
-
-    private Integer finalControl;
-
-    private String crmName;
-
-    private String disDeptName;
-    private String disMainDiag;
-
-    public String getSexName() {
-        if (sex == null) {
-            return "";
-        }
-        switch (sex) {
-            case 1:
-                return "男";
-            case 2:
-                return "女";
-            default:
-                return "未知";
-        }
-    }
-
-    public Integer getTempAge() {
-        if (birthDate != null && admissDate != null) {
-            try {
-                return DateUtil.age(DateUtil.parse(birthDate, "yyyy-MM-dd"), admissDate);
-            } catch (Exception ignored) {
-            }
-        }
-        return age;
-    }
-
-    public String getPatNo() {
-        return StrUtil.isBlank(inpatientNo) ? inpatientNo : inpatientNo.trim();
-    }
-
-    public Boolean getMidSetl() {
-        return null != midSetl && midSetl;
-    }
-
-    public String getTable() {
-        return null == table ? "zy_actpatient" : (table).trim();
-    }
-
-    public String mainInfo() {
-        return "姓名:" + name + ",住院号:" + inpatientNo + ",住院次数:" + admissTimes;
-    }
-
-    public String getPatId() {
-        return inpatientNo + "_" + admissTimes;
-    }
-}

+ 0 - 49
thyy-hospitalized/thyy-doctor/src/main/java/org/thyy/doctor/entity/SelectV2.java

@@ -1,49 +0,0 @@
-package org.thyy.doctor.entity;
-
-import cn.hutool.core.util.StrUtil;
-import lombok.Data;
-
-@Data
-public class SelectV2 {
-
-    private String code;
-    private String name;
-    private String pyCode;
-    private String wCode;
-
-    public String getCode() {
-        if (StrUtil.isBlank(code)) {
-            return code;
-        }
-        return code.trim();
-    }
-
-    public String getName() {
-        if (StrUtil.isBlank(name)) {
-            return name;
-        }
-        return name.trim();
-    }
-
-    public String getPyCode() {
-        if (StrUtil.isBlank(pyCode)) {
-            return pyCode;
-        }
-        return pyCode.trim();
-    }
-
-    public String getWCode() {
-        if (StrUtil.isBlank(wCode)) {
-            return wCode;
-        }
-        return wCode.trim();
-    }
-
-    public String getValue() {
-        return getCode();
-    }
-
-    public String getLabel() {
-        return getName();
-    }
-}

+ 0 - 198
thyy-hospitalized/thyy-doctor/src/main/java/org/thyy/doctor/entity/UserInfo.java

@@ -1,198 +0,0 @@
-package org.thyy.doctor.entity;
-
-import cn.hutool.core.util.StrUtil;
-import com.alibaba.fastjson2.JSONObject;
-import lombok.Data;
-import org.thyy.doctor.enums.RestrictedDrugLevels;
-import org.thyy.doctor.enums.Ysjb;
-
-import java.util.List;
-import java.util.Map;
-
-/**
- * @author dj
- */
-@Data
-public class UserInfo {
-
-    /**
-     * 编码
-     */
-    private String code;
-
-    /**
-     * 名字
-     */
-
-    private String name;
-    private String password;
-
-    /**
-     * 工号
-     */
-    private String codeRs;
-    /**
-     * 技术职称
-     */
-
-    private String empTitCode;
-    private String empTitName;
-    private String title;
-
-    /**
-     * 职务
-     */
-
-    private String empPoCode;
-    private String position;
-
-    private String avatar;
-    private String token;
-    private String sid;
-    private String ip;
-
-    /**
-     * 医保编码
-     */
-
-    private String ybCode;
-
-
-    private String deptCode;
-    private String deptName;
-
-    /**
-     * 在院标志
-     */
-
-    private String mark;
-    private String markName;
-
-    /**
-     * 干工标志
-     */
-
-    private String ifcadre;
-    private String ifcadreName;
-
-    /**
-     * 拼音 五笔码
-     */
-    private String pyCode;
-    private String dCode;
-    /**
-     * 医生处方权 1 普通处方权 2 毒麻药处方权
-     */
-
-    private String orderYn;
-    /**
-     * 病历级别
-     * {@link Ysjb}
-     */
-
-    private String ysjb;
-
-    /**
-     * 挂号号别
-     */
-
-    private String ghChargeType;
-    private String ghChargeTypeName;
-    /**
-     * 病区允许就诊 1 允许 2 不允许
-     */
-
-    private String loginFlag;
-    /**
-     * 限制药品级别
-     * {@link  }
-     */
-
-    private String doctorXzYp;
-
-    /**
-     * 停用标志
-     */
-
-    private String delFlag;
-
-    /**
-     * 身份证
-     */
-
-    private String socialNo;
-
-    /**
-     * 手机号码
-     */
-
-    private String phoneNo;
-
-
-    private List<Integer> roles;
-
-    /**
-     * 有权限的路由id
-     */
-    private List<Integer> menuId;
-
-    /**
-     * 医生用药等级
-     */
-    private Integer doctorLevel;
-
-    /**
-     * 药品编码
-     */
-    private String drugCode;
-
-    /**
-     * 医生兼职科室
-     */
-    private List<String> partTimeDept;
-    private String partTimeDeptCode;
-    private String partTimeDeptName;
-    private Map<String, String> partTimeDeptMap;
-
-    private String verificationCode;
-
-    /**
-     * 当前科室的人可以在会诊完成几天后,可以去到患者的医嘱录入界面
-     */
-    private Integer hzDay;
-
-    private String userConfig;
-
-
-    private Integer doctorZy;
-
-
-    private Integer doctorYpZl;
-    private String doctorYpZlName;
-
-
-    private Integer dualchnlFlag;
-
-    public JSONObject getUserConfigJson() {
-        return StrUtil.isBlank(userConfig) ? new JSONObject() : JSONObject.parseObject(userConfig);
-    }
-
-    public String getDoctorXzYpName() {
-        return RestrictedDrugLevels.getName(doctorXzYp);
-    }
-
-    public String getYsjbName() {
-        return Ysjb.getName(ysjb);
-    }
-
-    public String getOrderYnName() {
-        if (StrUtil.isNotBlank(orderYn)) {
-            if ("1".equals(orderYn)) {
-                return "普通处方权";
-            } else if ("2".equals(orderYn)) {
-                return "毒麻药处方权";
-            }
-        }
-        return "";
-    }
-}

+ 0 - 420
thyy-hospitalized/thyy-doctor/src/main/java/org/thyy/doctor/entity/XinZhenYzActOrder.java

@@ -1,420 +0,0 @@
-package org.thyy.doctor.entity;
-
-import com.fasterxml.jackson.annotation.JsonFormat;
-import lombok.Data;
-import org.springframework.format.annotation.DateTimeFormat;
-
-import java.math.BigDecimal;
-import java.util.Date;
-import java.util.List;
-
-/**
- * <p>
- * 描述: 医嘱信息
- * </p>
- *
- * @author xc
- * @date 2022-01-12 17:38
- */
-@Data
-public class XinZhenYzActOrder {
-
-
-    /**
-     * 可以用来做父子医嘱
-     * 以及 actOrderNo 的id
-     */
-    private String id;
-
-
-    private String inpatientNo;
-    private Integer admissTimes;
-
-    /**
-     * 医嘱号
-     */
-    private BigDecimal actOrderNo;
-
-    public String getActOrderNoStr() {
-        if (actOrderNo == null) {
-            return null;
-        }
-        return actOrderNo.stripTrailingZeros().toPlainString();
-    }
-
-    /**
-     * 费用的编码 药品或项目
-     */
-    private String orderCode;
-    /**
-     * 费用名称
-     */
-    private String orderName;
-
-    /**
-     * 医保编码
-     */
-    private String nationalCode;
-
-    /**
-     * 药品的包装单价
-     */
-    private BigDecimal packRetprice;
-
-    /**
-     * 频次
-     */
-    private String frequCode;
-    private String frequCodeName;
-    /**
-     * 医生嘱托
-     */
-    private String instruction;
-    /**
-     * 描述
-     */
-    private String discription;
-    /**
-     * 婴儿标志
-     */
-    private String infantFlag;
-    /**
-     * 医嘱时间
-     */
-    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
-    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss", shape = JsonFormat.Shape.STRING)
-    private Date orderTime;
-    /**
-     * 医嘱开始时间
-     */
-    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
-    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss", shape = JsonFormat.Shape.STRING)
-    private Date startTime;
-
-    /**
-     * 停止时间
-     */
-    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
-    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss", shape = JsonFormat.Shape.STRING)
-    private Date endTime;
-    /**
-     * 停止医嘱的时候用的
-     */
-    private String endTimeTemp;
-    /**
-     * 停止人 修改人
-     */
-    private String modifier;
-    private String modifierName;
-    /**
-     * 医生 这个也是开医嘱的医生
-     */
-    private String physician;
-    private String physicianName;
-
-    /**
-     * 药品规格
-     */
-    private String drugSpecification;
-
-    /**
-     * 领量
-     */
-    private BigDecimal drugQuan;
-    private String drugQuanName;
-
-    /**
-     * 给药方式
-     */
-    private String supplyCode;
-    private String supplyCodeName;
-
-
-    /**
-     * 药品类型
-     */
-    private String drugFlag;
-
-    /**
-     * 录入人
-     */
-    private String enterOper;
-    private String enterOperName;
-
-    /**
-     * 结束时间
-     */
-    private Date enterTime;
-
-    /**
-     * 确认人
-     */
-    private String signer;
-    private String signerName;
-    /**
-     * 确认时间
-     */
-    private Date confirmTime;
-
-    /**
-     * 最小单位
-     */
-    private String miniUnit;
-    private String miniUnitName;
-
-    /**
-     * 药品重量
-     */
-    private BigDecimal drugWeight;
-    /**
-     * 药品重量单位
-     */
-    private String drugWeightUnit;
-    private String drugWeightUnitName;
-    /**
-     * 录入状态 1-录入 2-确定 3-执行 4-执行 5-停止
-     */
-    private String statusFlag;
-    private Date statusTime;
-    /**
-     * 费用标志
-     * 1-自备 2-嘱托 3-基数药 4-出院带药
-     */
-    private String selfBuy;
-
-    public String getSelfBuyName() {
-        if (selfBuy == null) {
-            return "";
-        }
-        switch (selfBuy) {
-            case "1":
-                return "自备";
-            case "2":
-                return "嘱托";
-            case "3":
-                return "基数药";
-            case "4":
-                return "出院带药";
-            default:
-                return "";
-        }
-    }
-
-    /**
-     * 一次剂量
-     */
-    private BigDecimal dose;
-    /**
-     * 一次剂量 单位
-     */
-    private String doseUnit;
-    private String doseUnitName;
-
-    /**
-     * 执行用量 这个和 drug_quan 一样 ,这个就不是四舍五入了
-     */
-    private BigDecimal drugOcc;
-
-    /**
-     * 药品体积
-     */
-    private BigDecimal drugVolume;
-
-    /**
-     * 药品体积单位
-     */
-    private String drugVolUnit;
-    /**
-     * 父医嘱
-     */
-    private BigDecimal parentNo;
-
-    private String parentNoStr;
-
-    /**
-     * 父医嘱 的名称
-     */
-    private String parentNoName;
-    /**
-     * 包装体积
-     */
-    private BigDecimal packSize;
-    /**
-     * 包装单位体积
-     */
-    private String packUnit;
-    /**
-     * 0 普通 1 需住院确认
-     */
-    private String paySelf;
-    /**
-     * 00-项目 01-小包装 99-大包装
-     */
-    private String serial;
-    private String serialName;
-    /**
-     * 药房 序号
-     */
-    private String groupNo;
-    private String groupNoName;
-
-    /**
-     * 1:医生录入
-     */
-    private String doctorFlag;
-    /**
-     * 执行科室
-     */
-    private String execUnit;
-    private String execUnitName;
-    /**
-     * 申请已接收
-     */
-    private String regFlag;
-    /**
-     * 医保自费标志
-     */
-    private String ybSelfFlag;
-    /**
-     * 紧急标志
-     */
-    private String emergencyFlag;
-    /**
-     * 饭前饭后 标志
-     */
-    private String kfFlag;
-    /**
-     * 抗菌药物
-     */
-    private Integer kjywFlag;
-
-    /**
-     * 药房剩余库存
-     */
-    private BigDecimal stockAmount;
-
-    /**
-     * >0 这个患者的科室就不能这个药品
-     */
-    private Integer deptRestrictions;
-
-    /**
-     * 1= 禁止药房使用
-     */
-    private Integer visibleFlagZy;
-
-
-    /**
-     * exclu 返回时间  不知道是干什么的
-     */
-    private Date excluBackTime;
-    private BigDecimal excluActOrderNo;
-    private String excluType;
-
-    /**
-     * 不知道是干什么的
-     */
-    private String clCode;
-
-    private String endTimeB;
-
-    /**
-     * 患者的科室
-     */
-    private String deptCode;
-    private String deptName;
-    /**
-     * 患者病区
-     */
-    private String wardCode;
-    private String wardName;
-
-    /**
-     * 表里面的新增标志
-     */
-    private String newFlag;
-
-    /**
-     * 管床医生
-     */
-    private String referPhysician;
-    private String referPhysicianName;
-
-    private String consultPhysician;
-    private String consultPhysicianName;
-
-
-
-    /*
-     * 如果这个药是抗菌药物的话 就需要在 yz_act_record_kss中插入
-     * */
-    /**
-     * 用药方式
-     * 0-无
-     * 1-手术预防用药 2-非手术预防用药 3-治疗用药-标本已送检 4-治疗用药-标本未已送检
-     * 5-皮试用药
-     */
-    private Integer yyfs;
-    /**
-     * 手术切口
-     * 0-无
-     * 1-Ⅰ类切口 2-Ⅱ类切口  3-Ⅲ类切口
-     * 4-微创 5-介入 6-其他
-     */
-    private Integer ssqk;
-    /**
-     * 术前用药时间
-     * 0-无
-     * 1-0.5至1小时
-     * 2-2小时
-     * 3-其他
-     */
-    private Integer yysj;
-    /**
-     * 药品的等级
-     */
-    private Integer ypLevel;
-    /**
-     * 删除标志
-     */
-    private Integer delFlag;
-    /**
-     * 转科病房
-     */
-    private String zkWardCode;
-    /**
-     * 转科科室
-     */
-    private String zkDeptCode;
-
-    private List<XinZhenYzActOrder> children;
-
-    private String orderGroup;
-
-    private String executer1;
-    private String executer2;
-
-    private int newOrderFlag;
-
-    /**
-     * 普通医生有限制用药,上级医生可以临时给权限
-     */
-    private String superiorDoctor;
-    private String billItemZy;
-
-    public String getStatusFlagName() {
-        if (statusFlag == null) return "";
-        if (statusFlag.equals("1")) {
-            return "录入";
-        }
-        if (statusFlag.equals("2")) {
-            return "确认";
-        }
-        return "";
-    }
-
-    public String getYbSelfFlagName() {
-        if ("1".equals(ybSelfFlag)) return "是";
-        return "否";
-    }
-}

+ 0 - 396
thyy-hospitalized/thyy-doctor/src/main/java/org/thyy/doctor/entity/ZyDetailCharge.java

@@ -1,396 +0,0 @@
-package org.thyy.doctor.entity;
-
-import cn.hutool.core.util.StrUtil;
-import com.baomidou.mybatisplus.annotation.IdType;
-import com.baomidou.mybatisplus.annotation.TableField;
-import com.baomidou.mybatisplus.annotation.TableId;
-import com.fasterxml.jackson.annotation.JsonInclude;
-import jakarta.validation.constraints.Min;
-import jakarta.validation.constraints.NotBlank;
-import jakarta.validation.constraints.NotNull;
-import lombok.Data;
-import lombok.EqualsAndHashCode;
-
-import java.io.Serial;
-import java.io.Serializable;
-import java.math.BigDecimal;
-import java.util.Date;
-import java.util.List;
-
-/**
- * <p>
- *
- * </p>
- *
- * @author 肖蟾
- * @since 2021-03-13
- */
-@Data
-@EqualsAndHashCode(callSuper = false)
-@JsonInclude(JsonInclude.Include.NON_NULL)
-public class ZyDetailCharge implements Serializable {
-
-    @Serial
-    private static final long serialVersionUID = 1L;
-
-
-    /**
-     * 行 id
-     */
-    private String rowId;
-
-    public String getRowId() {
-        return inpatientNo + admissTimes + ledgerSn + detailSn;
-    }
-
-    public String getChargeCodeId() {
-        if (StrUtil.isNotBlank(chargeCodeMx) && StrUtil.isNotBlank(serial)) {
-            return chargeCodeMx + serial;
-        }
-        return null;
-    }
-
-    @TableId(value = "inpatient_no", type = IdType.NONE)
-    @NotNull(message = "住院号不能为空1")
-    @NotBlank(message = "住院号不能为空")
-    private String inpatientNo;
-
-    private Integer rowIndex;
-
-    @NotNull(message = "住院次数不能为空")
-    @Min(value = 1, message = "住院次数最小为1")
-    private Integer admissTimes;
-
-    private String startTime;
-    private String endTime;
-    private String riQiPaiXu = "DESC";
-
-    private String chargeCodeName;
-
-    private BigDecimal origChargeFee;
-
-    @NotNull(message = "账页号不能为空")
-    @Min(value = 1, message = "账页号最小为1")
-    private Integer ledgerSn;
-
-    private Integer detailSn;
-
-    private Date chargeDate;
-
-    private String opIdCode;
-
-    private String chargeCode;
-
-    private String infantFlag;
-
-    private String chargeStatus;
-
-    private float retprice;
-
-    private BigDecimal chargeAmount;
-
-    private BigDecimal chargeFee;
-
-    private BigDecimal newChargeFee;
-
-    private String selfFlag;
-
-    private String separateFlag;
-
-    private String suppressFlag;
-
-    private String wardCode;
-
-    private String deptCode;
-
-    private BigDecimal orderNo;
-    private BigDecimal newOrderNo;
-    private BigDecimal actOrderNo;
-
-    private String opeFlag;
-
-    private String execUnit;
-
-    private Date genTime;
-
-    private String oldGenTime;
-
-    /**
-     * 药品 库存
-     */
-    private Integer stockAmount;
-
-    private float payPercent;
-
-    private String zjFlag;
-
-    private float zfl;
-
-    private String chargeCodeMx;
-
-    /**
-     * 包装规格
-     */
-    private String serial;
-
-    /**
-     * 住院流水号
-     */
-    private String zySerialNo;
-
-    private String doctorCode;
-
-    private String ybSelfFlag;
-
-    private BigDecimal yiTuiFei;
-
-    private String confirmId;
-
-    private String transFlagYb;
-
-    private String ssCode;
-
-    private String gsFlag;
-
-    private String referPhysician;
-
-    private String consultPhysician;
-
-    /**
-     * 下面的都是 项目录入需要使用的字段
-     */
-
-    @TableField(exist = false)
-    private long pageSize;
-
-    @TableField(exist = false)
-    private long currentPage;
-
-    private long total;
-
-    @TableField(exist = false)
-    private Integer feiYongLeiXingCode;
-
-    private String billItemCode;
-
-    private String chargeName;
-
-    /**
-     * 单位
-     */
-    private String spec;
-
-    /**
-     * 规格
-     */
-    private String descriptions;
-
-    private String yblx;
-
-    private BigDecimal price;
-
-    private BigDecimal amount;
-
-    private String execDept;
-
-    private String groupNo;
-
-    private String drugname;
-
-    private String opName;
-
-    private Integer oriDetailSn;
-
-    private String chrgitmLv;
-
-    private String medChrgitmType;
-
-    private BigDecimal detItemFeeSumamt;
-
-    private BigDecimal cnt;
-    private BigDecimal pric;
-    private BigDecimal inscpScpAmt;
-
-
-    private BigDecimal selfpayProp;
-
-    /**
-     * 医保类型
-     */
-    private String responceType;
-
-    /**
-     * 床位
-     */
-    private String bedNo;
-
-    /**
-     * 余额
-     */
-    private BigDecimal balance;
-
-    /**
-     * 总费用
-     */
-    private BigDecimal totalCharge;
-
-    private BigDecimal chargeType;
-
-    private Integer timesBilled;
-
-    /**
-     * 入院诊断名称
-     */
-    private String admissDiagStr;
-
-    /**
-     * 入院诊断编码
-     */
-    private String admissDiag;
-
-    /**
-     * 入院时间
-     */
-    private Date admissDate;
-
-    /**
-     * 这里面是 存放需要退费
-     */
-    private List<ZyDetailCharge> list;
-
-
-    // 下面这些是获取 项目录入模板的
-
-    /**
-     * 模板 名称
-     */
-    private String name;
-
-    /**
-     * 创建模板的科室
-     */
-    private String opDept;
-
-    /**
-     * 模板名称
-     */
-    private String patternName;
-
-    /**
-     * 模板排序
-     */
-    private String defaultNo;
-
-    private String self;
-
-    private String supriceFlag;
-
-    private String infant;
-
-    private BigDecimal per1;
-    private BigDecimal per2;
-    private BigDecimal per3;
-    private BigDecimal per4;
-    private BigDecimal per5;
-
-    private String execUnitB;
-    private Integer itemNo;
-
-    /**
-     * 执行科室
-     */
-    private String execUnitName;
-    /**
-     * 拼音码
-     */
-    private String pyCode;
-    /**
-     * 五笔码
-     */
-    private String wbCode;
-
-    private String dCode;
-    private BigDecimal priceB;
-
-    /**
-     * 下面是单独查询的
-     */
-    private String billItemOut;
-
-    /**
-     * 医保 厂家
-     */
-    private String ybComment;
-
-    /**
-     * 申请科室
-     */
-    private String dept;
-    private String ward;
-
-
-    /**
-     * 费用类型 名称
-     */
-    private String billItemName;
-
-    /**
-     * 费用 类型
-     * 0 - 项目  1 - 药品
-     */
-    private Integer feiYongType;
-
-    /**
-     * 0:全部
-     * 1:未退费
-     * 2:退费
-     */
-    private Integer tuiFeiFlag;
-
-    /**
-     * 国家项目编码
-     */
-    private String nationalCode;
-    private String nationalName;
-
-    /**
-     * 药品类型 口服药是不能退的
-     */
-    private String drugClass;
-
-    /**
-     * 规格
-     */
-    private String specification;
-
-    /**
-     * 药品的类型 1 = 口服不能退
-     */
-    private String classCode;
-
-    /**
-     * refundOnly 药品仅退费标识
-     */
-    private String refundFlag;
-
-    /**
-     * 最小包装规格
-     */
-    private String miniUnit;
-
-    /**
-     * 厂家
-     */
-    private String manuName;
-
-
-    public BigDecimal getOrderNo() {
-        if (orderNo == null) {
-            return new BigDecimal(0);
-        } else {
-            return orderNo;
-        }
-    }
-
-
-}

+ 0 - 45
thyy-hospitalized/thyy-doctor/src/main/java/org/thyy/doctor/enums/RestrictedDrugLevels.java

@@ -1,45 +0,0 @@
-package org.thyy.doctor.enums;
-
-import cn.hutool.core.util.StrUtil;
-import lombok.extern.slf4j.Slf4j;
-
-@Slf4j
-public enum RestrictedDrugLevels {
-
-    UNRESTRICTED_USE_OF_MEDICINES("0", "非限制使用药品"),
-    RESTRICTED_USE_OF_MEDICINES("1", "限制使用药品"),
-    SPECIAL_USE_MEDICINES("2", "特殊使用药品");
-
-    private final String code;
-
-    private final String name;
-
-
-    RestrictedDrugLevels(String code, String name) {
-        this.code = code;
-        this.name = name;
-    }
-
-    public static String getName(String code) {
-        if (StrUtil.isBlank(code)) {
-            return "";
-        }
-        for (RestrictedDrugLevels value : RestrictedDrugLevels.values()) {
-            if (code.trim().equals(value.getCode())) {
-                return value.getName();
-            }
-        }
-        return null;
-    }
-
-
-    public String getCode() {
-        return code;
-    }
-
-    public String getName() {
-        return name;
-    }
-
-
-}

+ 0 - 43
thyy-hospitalized/thyy-doctor/src/main/java/org/thyy/doctor/enums/Ysjb.java

@@ -1,43 +0,0 @@
-package org.thyy.doctor.enums;
-
-
-import cn.hutool.core.util.StrUtil;
-
-public enum Ysjb {
-
-    RESIDENT_PHYSICIAN("1", "住院医师"),
-    ATTENDING_PHYSICIAN("2", "主治医师"),
-    DEPUTY_CHIEF_PHYSICIAN("3", "副主任医师"),
-    CHIEF_PHYSICIAN("4", "主任医师"),
-    TRAINING_PHYSICIAN("5", "进修医师"),
-    CHIEF_RESIDENT("6", "总住院医师"),
-    INTERN("9", "实习医师");
-
-    private final String code;
-    private final String name;
-
-    Ysjb(String code, String name) {
-        this.code = code;
-        this.name = name;
-    }
-
-    public static String getName(String code) {
-        if (StrUtil.isBlank(code)) {
-            return "";
-        }
-        for (Ysjb ysjb : Ysjb.values()) {
-            if (code.trim().equals(ysjb.getCode())) {
-                return ysjb.getName();
-            }
-        }
-        return null;
-    }
-
-    public String getCode() {
-        return code;
-    }
-
-    public String getName() {
-        return name;
-    }
-}

+ 0 - 1497
thyy-hospitalized/thyy-doctor/src/main/java/org/thyy/doctor/service/YiZhuLuRuServer.java

@@ -1,1497 +0,0 @@
-package org.thyy.doctor.service;
-
-import cn.hutool.core.util.StrUtil;
-import cn.hutool.crypto.SecureUtil;
-import cn.hutool.db.DbUtil;
-
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import lombok.RequiredArgsConstructor;
-import lombok.extern.slf4j.Slf4j;
-import org.apache.ibatis.session.ExecutorType;
-import org.apache.ibatis.session.SqlSession;
-import org.apache.ibatis.session.SqlSessionFactory;
-import org.springframework.stereotype.Service;
-import org.thyy.utils.result.ResultVo;
-import org.thyy.utils.result.R;
-import thyyxxk.webserver.config.exception.BizException;
-import thyyxxk.webserver.config.exception.ExceptionEnum;
-import thyyxxk.webserver.constants.sidicts.ChargeStatus;
-import thyyxxk.webserver.entity.RoleCode;
-import thyyxxk.webserver.entity.casefrontsheet.request.SheetOverview;
-import thyyxxk.webserver.entity.datamodify.GetDropdownBox;
-import thyyxxk.webserver.entity.datamodify.SelectV2;
-import thyyxxk.webserver.entity.datamodify.YzActOrder;
-import thyyxxk.webserver.entity.datamodify.ZyDetailCharge;
-import thyyxxk.webserver.entity.dictionary.CodeName;
-import thyyxxk.webserver.entity.inpatient.patient.Overview;
-import thyyxxk.webserver.entity.inpatient.patient.Patient;
-import thyyxxk.webserver.entity.login.UserInfo;
-import thyyxxk.webserver.entity.medicalinsurance.inpatient.SiLimitRequest;
-import thyyxxk.webserver.entity.zhuyuanyisheng.DoctorSOrderFee;
-import thyyxxk.webserver.entity.zhuyuanyisheng.OneClickOrder;
-import thyyxxk.webserver.entity.zhuyuanyisheng.ZyOrderZk;
-import thyyxxk.webserver.entity.zhuyuanyisheng.dto.doctorAuth.DoctorAuthParams;
-import thyyxxk.webserver.entity.zhuyuanyisheng.vo.doctorAuth.DoctorAuthRest;
-import thyyxxk.webserver.entity.zhuyuanyisheng.yizhuluru.*;
-import thyyxxk.webserver.service.PublicServer;
-import thyyxxk.webserver.service.externalhttp.DrgWebServices;
-import thyyxxk.webserver.service.inpatient.casefrontsheet.CaseFrontSheetMainService;
-import thyyxxk.webserver.service.medicalinsurance.SiChargeLimitService;
-import thyyxxk.webserver.service.redislike.RedisLikeService;
-import thyyxxk.webserver.service.zhuyuanyisheng.yizhuverify.Repel;
-import thyyxxk.webserver.service.zhuyuanyisheng.yizhuverify.YiZhuCheckData;
-
-import java.math.BigDecimal;
-import java.util.*;
-import java.util.stream.Collectors;
-
-/**
- * <p>
- * 描述: 医嘱录入
- * </p>
- *
- * @author xc
- * @date 2022-01-04 16:59
- */
-@Service
-@Slf4j
-@RequiredArgsConstructor
-public class YiZhuLuRuServer {
-    private final YiZhuLuRuDao dao;
-    private final PublicServer publicServer;
-    private final RedisLikeService redisLikeService;
-    private final DrgWebServices drgWebServices;
-    private final CaseFrontSheetMainService caseFrontSheetMainService;
-    private final SqlSessionFactory sqlSessionFactory;
-    private final SiChargeLimitService siChargeLimitService;
-
-    private static String CHU_YUAN = "06026";
-
-    private final String ITEM = "00";
-
-    public ResultVo<String> getOrderNo() {
-        return R.ok(publicServer.getActOrderNo().stripTrailingZeros().toPlainString());
-    }
-
-    public ResultVo<List<Patient>> getMyPatient() {
-        return R.ok(dao.getMyPatient(TokenUtil.getInstance().getTokenUserId()));
-    }
-
-    /**
-     * 获取患者的医嘱
-     *
-     * @param param 查询条件 住院号,住院时间
-     * @return 返回医嘱数据
-     */
-    public ResultVo<List<XinZhenYzActOrder>> huoQuYiZhuShuJu(YiZhuFeiYongChaXunTiaoJian param) {
-        return R.ok(getOrderList(dao.selectOrderNo(param.buildQw())));
-    }
-
-    /**
-     * 设置医嘱号的数状图
-     *
-     * @param yiZhuList 医嘱数据
-     * @return s
-     */
-    public static List<XinZhenYzActOrder> getOrderList(List<XinZhenYzActOrder> yiZhuList) {
-        if (ListUtil.isBlank(yiZhuList)) {
-            return new ArrayList<>();
-        }
-        // 还有那些没有被匹配的子级医嘱
-        Map<BigDecimal, XinZhenYzActOrder> wuFuJiYiZhu = yiZhuList.stream().collect(Collectors.toMap(XinZhenYzActOrder::getActOrderNo, a -> a, (k1, k2) -> k1));
-        // 做成树状图
-        Map<BigDecimal, XinZhenYzActOrder> map = new HashMap<>(yiZhuList.size());
-        List<XinZhenYzActOrder> tree = new ArrayList<>();
-        for (XinZhenYzActOrder item : yiZhuList) {
-            if (item.getParentNo() == null) {
-                tree.add(item);
-                wuFuJiYiZhu.remove(item.getActOrderNo());
-            }
-            map.put(item.getActOrderNo(), item);
-            EntityStringTrim.beanAttributeValueTrim(item);
-            if ("00".equals(item.getSerial())) {
-                item.setGroupNoName("项目");
-                item.setSerialName("项目");
-            } else {
-                if ("01".equals(item.getSerial())) {
-                    item.setSerialName("小包装");
-                } else if ("99".equals(item.getSerial())) {
-                    item.setSerialName("大包装");
-                }
-            }
-        }
-        for (XinZhenYzActOrder item : yiZhuList) {
-            XinZhenYzActOrder actOrder = map.get(item.getParentNo());
-            if (actOrder == null) {
-                continue;
-            }
-            if (actOrder.getParentNo() != null) {
-                item.setParentNo(null);
-                item.setOrderName("注意此医嘱成组有误,请重新选择父医嘱,父医嘱不能是其他医嘱的子医嘱。");
-                item.setStatusFlag("6");
-                continue;
-            }
-            wuFuJiYiZhu.remove(item.getActOrderNo());
-            if (actOrder.getChildren() == null) {
-                actOrder.setChildren(new ArrayList<>());
-                actOrder.setOrderGroup("┌");
-            }
-            item.setOrderGroup("└");
-            actOrder.getChildren().add(item);
-        }
-        if (!wuFuJiYiZhu.isEmpty()) {
-            tree.addAll(wuFuJiYiZhu.values());
-        }
-        List<XinZhenYzActOrder> list = new ArrayList<>();
-        for (XinZhenYzActOrder zy : tree) {
-            list.add(zy);
-            if (ListUtil.notBlank(zy.getChildren())) {
-                zy.getChildren().get(zy.getChildren().size() - 1).setOrderGroup("└");
-                list.addAll(zy.getChildren());
-                zy.setChildren(null);
-            }
-        }
-        return list;
-    }
-
-    /**
-     * 获取搜索的项目信息,如药品和项目
-     *
-     * @param code 拼音首字母,中文,编码来进行搜索
-     * @return 返回项目信息
-     */
-    public ResultVo<List<YiZhuMingChen>> huoQuXiangMu(String code, String groupNo) {
-        code = StringUtil.isContainChinese(code);
-        // 药品
-        List<YiZhuMingChen> list = dao.yiZhuYaoPing(code, groupNo);
-        // 项目
-        list.addAll(dao.yiZhuXiangMu(code));
-        // 模板
-        list.addAll(dao.composeOrders(code, redisLikeService.getUserInfoByToken().getDeptCode()));
-        EntityStringTrim.beanAttributeValueTrimList(list);
-        return R.ok(list);
-    }
-
-    /**
-     * 把有错误的子医嘱纠正回来,子医嘱要跟随父医嘱的频率 等
-     *
-     * @param list 患者的数据
-     */
-    public void correctSubOrders(List<XinZhenYzActOrder> list) {
-        // 父医嘱
-        Map<BigDecimal, XinZhenYzActOrder> parentOrder = new HashMap<>(list.size());
-        list.forEach(item -> parentOrder.put(item.getActOrderNo(), item));
-        list.forEach(item -> {
-            if (item.getParentNo() != null && parentOrder.containsKey(item.getParentNo())) {
-                XinZhenYzActOrder order = parentOrder.get(item.getParentNo());
-                // 判断是否需要更新
-                if (updateSubOrders(order, item)) {
-                    dao.updateSubOrderStatus(item.getActOrderNo(), order);
-                }
-            }
-        });
-    }
-
-    private boolean updateSubOrders(XinZhenYzActOrder parent, XinZhenYzActOrder children) {
-        if (!parent.getOrderTime().equals(children.getOrderTime())) {
-            return true;
-        }
-        if (!parent.getStartTime().equals(children.getStartTime())) {
-            return true;
-        }
-        if (parent.getEndTime() != null && !parent.getEndTime().equals(children.getEndTime())) {
-            return true;
-        }
-        if (!parent.getFrequCode().equals(children.getFrequCode())) {
-            return true;
-        }
-        return !parent.getGroupNo().equals(children.getGroupNo());
-    }
-
-    /**
-     * xc确认医嘱 , 这个是最新的正确的
-     *
-     * @param param 数据
-     * @return 返回提示
-     */
-    public ResultVo<Map<String, Object>> confirmOrders(XinZhenYiZhu param) {
-        QueryWrapper<?> qw = getConfirmQueryWrapper(param.getInpatientNo(), param.getAdmissTimes());
-
-        param.setList(dao.selectOrderNo(qw));
-
-        List<XinZhenYzActOrder> yiZhuList = param.getList();
-        if (ListUtil.isBlank(yiZhuList)) {
-            return R.fail(ExceptionEnum.LOGICAL_ERROR, "没有需要确认的医嘱.");
-        }
-        // 把错误的子医嘱更正回来
-        correctSubOrders(param.getList());
-        String userCode = TokenUtil.getInstance().getTokenUserId();
-        XinZhenYiZhu patInfo = dao.queryPatientInfo(param.getInpatientNo(), param.getAdmissTimes());
-
-        List<XinZhenYzActOrder> confirmYzList = new ArrayList<>();
-
-        YiZhuCheckData checkData = new YiZhuCheckData(dao);
-        checkData.init(yiZhuList, patInfo).judgeExclusion();
-
-        Map<String, Object> checkMap = checkData.startCheck(confirmYzList::add);
-
-        if (checkData.multipleExclusions()) {
-            return R.fail(ExceptionEnum.LOGICAL_ERROR, "一次性不能确认多条全排斥医嘱。");
-        }
-
-        if (checkData.getFailed()) {
-            return R.fail(ExceptionEnum.ERROR_MESSAGE, "请修改错误的医嘱", checkMap);
-        }
-
-        Repel repel = checkData.getRepel();
-
-        if (repel != null && repel.getCount() > 0) {
-            // 把全排斥医嘱变成临时防止给药方式错误,并且停止其他医嘱
-            dao.stopOrder(param.getInpatientNo(), param.getAdmissTimes(), repel.getDate(), userCode, repel.getOrderNo());
-        }
-
-        SqlSession sqlSession = sqlSessionFactory.openSession(ExecutorType.BATCH);
-        YiZhuLuRuDao mapper = sqlSession.getMapper(YiZhuLuRuDao.class);
-
-        Date now = new Date();
-        try {
-            ListUtil.partitionAndFunc(confirmYzList, 50, (list) -> {
-                for (XinZhenYzActOrder item : list) {
-                    if (StringUtil.notBlank(item.getSuperiorDoctor())) {
-                        mapper.confirmOrdersSuperiorDoctor(item.getActOrderNo(), item.getSuperiorDoctor(), now);
-                    } else {
-                        mapper.confirmOrders(item.getActOrderNo(), userCode, now);
-                    }
-                }
-                sqlSession.commit();
-            });
-        } finally {
-            sqlSession.close();
-        }
-        drgOrderUpdate(patInfo.getInpatientNo() + "_" + patInfo.getAdmissTimes() + "_" + patInfo.getLedgerSn());
-        sendAMessageToTheNurse(param, userCode, patInfo, "新增医嘱");
-        return R.ok(ExceptionEnum.SUCCESS_AND_EL_MESSAGE);
-    }
-
-    /**
-     * 出院医嘱质控校验
-     * 暂时废弃
-     *
-     * @param param 患者信息
-     */
-    @Deprecated
-    private void dischargeQCVerification(XinZhenYiZhu param) {
-        if (param.getInpatientNo().contains("$")) {
-            return;
-        }
-        if (dao.selectDischargeOrde(param, TokenUtil.getInstance().getTokenUserId()) > 0) {
-            SheetOverview overview = new SheetOverview();
-            overview.setBah(param.getInpatientNo());
-            overview.setTimes(param.getAdmissTimes());
-            overview.setInOutFlag(1);
-            ResultVo<Map<String, List<CodeName>>> result = caseFrontSheetMainService.sheetVerification(overview);
-            if (!result.getCode().equals(ExceptionEnum.SUCCESS.getCode())) {
-                throw new BizException(ExceptionEnum.LOGICAL_ERROR, result.getMessage());
-            }
-            if (!result.getData().get("force").isEmpty()) {
-                throw new BizException(ExceptionEnum.LOGICAL_ERROR, "未通过病案首页质控,无法确认出院医嘱。");
-            }
-        }
-    }
-
-    /**
-     * 在开医嘱时 drg 需要调用一下这个接口,接口已经做了异步的请求
-     *
-     * @param patientNo 患者id
-     */
-    public void drgOrderUpdate(String patientNo) {
-        try {
-            JSONObject jsonDrg = new JSONObject();
-            jsonDrg.put("visit_id", Collections.singletonList(patientNo));
-            jsonDrg.put("scene_type", 1);
-            drgWebServices.etlClient(jsonDrg);
-        } catch (Exception ignored) {
-        }
-    }
-
-    private void sendAMessageToTheNurse(XinZhenYiZhu param, String inputCode, XinZhenYiZhu patInfo, String name) {
-        List<String> content = new ArrayList<>();
-        for (XinZhenYzActOrder item : param.getList()) {
-            String sb = notificationStyle("医嘱名", "409eff", item.getOrderName()) +
-                        notificationStyle("医嘱时间", "409eff", DateUtil.formatDatetime(item.getStartTime())) +
-                        notificationStyle("床位", "409eff", patInfo.getBedNo()) +
-                        notificationStyle("患者姓名", "409eff", patInfo.getName()) +
-                        notificationStyle("频次", "409eff", item.getFrequCode());
-            content.add(sb);
-        }
-        publicServer.faSongXiaoXi(patInfo, content, name, inputCode);
-    }
-
-    private String notificationStyle(String name, String color, String content) {
-        return String.format("%s:<span style='color: #%s'>%s</span><br>", name, color, content);
-    }
-
-    /**
-     * 录入 单条医嘱  新的 下面的保存医嘱的都无效了
-     *
-     * @param param 参数
-     * @return 错误信息和提示
-     */
-    public ResultVo<Map<String, Object>> enterOrders(XinZhenYiZhu param) {
-        XinZhenYzActOrder oldOrderNo = dao.getActOrderNoOne(param.getActOrderNo());
-        String userCode = TokenUtil.getInstance().getTokenUserId();
-        if (oldOrderNo != null) {
-            if (!"1".equals(oldOrderNo.getStatusFlag().trim())) {
-                return R.fail(ExceptionEnum.LOGICAL_ERROR, "该医嘱不是录入状态无法保存.");
-            }
-            if (!oldOrderNo.getInpatientNo().trim().equals(param.getInpatientNo())) {
-                return R.fail(ExceptionEnum.LOGICAL_ERROR, "两次医嘱录入时患者不一致。");
-            }
-            if (!oldOrderNo.getEnterOper().equals(userCode)) {
-                return R.fail(ExceptionEnum.LOGICAL_ERROR, "医嘱录入人不是您,无法修改。");
-            }
-        }
-        XinZhenYiZhu huanZheXinXi = dao.queryPatientInfo(param.getInpatientNo(), param.getAdmissTimes());
-        XinZhenYzActOrder data = param.getData();
-        if (ITEM.equals(data.getSerial().trim())) {
-            data.setGroupNo("00");
-        }
-
-        YiZhuCheckData checkData = new YiZhuCheckData(dao);
-
-        Map<String, Object> errorMessageMap = checkData.init(data, huanZheXinXi)
-                .startCheck(null);
-
-        if (checkData.getFailed()) {
-            return R.fail(ExceptionEnum.ERROR_MESSAGE, "请修改有错误的医嘱。", errorMessageMap);
-        }
-
-        // 如果是 子医嘱 的话就拿到父医嘱的频率
-        if (data.getParentNo() != null) {
-            String frequCode = dao.selectParentNo(data.getParentNo().stripTrailingZeros().toPlainString());
-            if (StringUtil.notBlank(frequCode)) {
-                data.setFrequCode(frequCode);
-            }
-        }
-
-        if (checkData.getPassTheAudit()) {
-            String ZK_CODE = "06286"; //转科的医嘱编码
-            if (ZK_CODE.equals(data.getOrderCode())) {
-                ZyOrderZk transferData = new ZyOrderZk();
-                transferData
-                        .setActOrderNo(param.getActOrderNo())
-                        .setNewDept(data.getZkDeptCode())
-                        .setNewWard(data.getZkWardCode())
-                        .setOldWard(huanZheXinXi.getDeptCode())
-                        .setOldDept(huanZheXinXi.getZkWard());
-                // 先删除转科在插入
-                dao.deleteTransferOrder(param.getActOrderNo());
-                dao.insertDoctorSOrder(transferData);
-            }
-            // 判断是不是抗菌药物
-            XinZhenYzActOrder kssItem = checkData.getDrugData(data.getOrderCode().trim() + data.getSerial().trim() + data.getGroupNo().trim());
-            if (kssItem != null && kssItem.getKjywFlag() != null && kssItem.getKjywFlag() == 1) {
-                YzActRecordKss kss = new YzActRecordKss();
-                kss.setActOrderNo(data.getActOrderNo());
-                kss.setChargeCode(data.getOrderCode());
-                kss.setYyfs(data.getYyfs());
-                kss.setSsqk(data.getSsqk());
-                kss.setYysj(data.getYysj());
-                // 删除抗菌药物信息
-                dao.deleteAntimicrobialInformation(param.getActOrderNo());
-                dao.insertAntimicrobialInformation(param.getActOrderNo(),
-                        kss, userCode, param.getInpatientNo(), param.getAdmissTimes());
-            }
-        }
-
-        dao.deleteOrderNo(param.getActOrderNo());
-        dao.insertEntryOrder(huanZheXinXi, param.getData(), userCode);
-
-        // 更新授权医生
-        if (StringUtil.notBlank(param.getData().getSuperiorDoctor())) {
-            dao.updateAuthorizedDoctor(param.getData().getActOrderNo(), param.getData().getSuperiorDoctor());
-        }
-
-        // 项目不触发
-        if (param.getData().getParentNo() == null && !param.getData().getSerial().equals("00")) {
-            String selectSupplyCode = dao.selectSupplyCode(param.getData().getSupplyCode().trim());
-            if (StringUtil.isBlank(selectSupplyCode)) {
-                selectSupplyCode = "044";
-            }
-            // 子医嘱跟随父医嘱
-            dao.howOftenTheSubPhysicianOrderIsModified(param.getData(), selectSupplyCode);
-        }
-
-        QueryWrapper<?> qw = getQueryWrapper(param, data);
-
-        Map<String, Object> successMap = new HashMap<>();
-        successMap.put("code", 200);
-        successMap.put("data", getOrderList(dao.selectOrderNo(qw)));
-
-        return R.ok(ExceptionEnum.SUCCESS_AND_EL_MESSAGE, "添加成功。", successMap);
-    }
-
-    private static QueryWrapper<?> getQueryWrapper(XinZhenYiZhu param, XinZhenYzActOrder data) {
-        QueryWrapper<?> qw = new QueryWrapper<>();
-
-        qw.eq("a.inpatient_no", param.getInpatientNo());
-        qw.eq("a.admiss_times", param.getAdmissTimes());
-        qw.eq("a.status_flag", "1");
-
-        // 不是子节点,就需要查询 子节点
-        if (data.getParentNo() == null) {
-            qw.and(wrapper -> wrapper.eq("a.act_order_no", param.getActOrderNo())
-                    .or()
-                    .eq("a.parent_no", param.getActOrderNo())
-            );
-        } else {
-            // 如果是子节点就返回自己
-            qw.eq("a.act_order_no", data.getActOrderNo());
-        }
-
-        qw.orderByAsc("a.act_order_no");
-        return qw;
-    }
-
-    /**
-     * 把医嘱模板中的数据插入到 患者的医嘱表中
-     *
-     * @param param 参数
-     * @return 返回插入的医嘱
-     */
-    public ResultVo<JSONObject> insertTemplateOrder(XinZhenYiZhu param) {
-        if (StringUtil.isBlank(param.getInpatientNo())) {
-            return R.fail(ExceptionEnum.ERROR_MESSAGE, "请先选择患者.");
-        }
-
-        XinZhenYiZhu patInfo = dao.queryPatientInfo(param.getInpatientNo(), param.getAdmissTimes());
-        if (patInfo == null) {
-            return R.fail(ExceptionEnum.ERROR_MESSAGE, "请先选择患者.");
-        }
-
-        List<BigDecimal> returnOrderList = new ArrayList<>();
-        List<XinZhenYzActOrder> list = param.getList();
-
-        List<XinZhenYzActOrder> resList = new ArrayList<>();
-        Map<BigDecimal, XinZhenYzActOrder> map = new HashMap<>(list.size());
-        String userCode = TokenUtil.getInstance().getTokenUserId();
-
-
-        for (XinZhenYzActOrder item : list) {
-            if (item.getParentNo() == null) {
-                resList.add(item);
-            }
-            map.put(item.getActOrderNo(), item);
-        }
-
-        list.forEach(item -> {
-            if (item.getParentNo() != null) {
-                XinZhenYzActOrder mapItem = map.get(item.getParentNo());
-                if (mapItem != null) {
-                    if (mapItem.getChildren() == null) {
-                        mapItem.setChildren(new ArrayList<>());
-                    }
-                    mapItem.getChildren().add(item);
-                }
-            }
-        });
-
-        templateInsertToOrder(resList, patInfo, userCode, returnOrderList);
-        JSONObject js = getNewOrderData(returnOrderList);
-        return R.ok(ExceptionEnum.SUCCESS_AND_EL_MESSAGE, "插入模板数据成功。", js);
-    }
-
-
-    /**
-     * 把模板数据插入到医嘱中
-     *
-     * @param resList         医嘱数据
-     * @param patInfo         患者信息
-     * @param userCode        用户编码
-     * @param returnOrderList 返回的医嘱号
-     */
-    public void templateInsertToOrder(List<XinZhenYzActOrder> resList,
-                                      XinZhenYiZhu patInfo,
-                                      String userCode,
-                                      List<BigDecimal> returnOrderList) {
-
-        CacheOnce<XinZhenYzActOrder> drug = new CacheOnce<>();
-
-        SqlSession sqlSession = sqlSessionFactory.openSession(ExecutorType.BATCH);
-        YiZhuLuRuDao mapper = sqlSession.getMapper(YiZhuLuRuDao.class);
-
-        for (XinZhenYzActOrder item : resList) {
-            setTempInfo(drug, item, patInfo);
-            item.setActOrderNo(publicServer.getActOrderNo());
-            returnOrderList.add(item.getActOrderNo());
-            mapper.insertEntryOrder(patInfo, item, userCode);
-
-            if (ListUtil.notBlank(item.getChildren())) {
-                for (XinZhenYzActOrder children : item.getChildren()) {
-                    setTempInfo(drug, children, patInfo);
-                    children.setActOrderNo(publicServer.getActOrderNo());
-                    returnOrderList.add(children.getActOrderNo());
-                    children.setParentNo(item.getActOrderNo());
-                    mapper.insertEntryOrder(patInfo, children, userCode);
-                }
-            }
-        }
-
-        try {
-            sqlSession.commit();
-        } finally {
-            DbUtil.close(sqlSession);
-        }
-
-    }
-
-    private void setTempInfo(CacheOnce<XinZhenYzActOrder> drug, XinZhenYzActOrder data, XinZhenYiZhu patInfo) {
-        XinZhenYzActOrder feiYongXinXi = drug.get(
-                data.getOrderCode().trim() + data.getSerial().trim() + data.getGroupNo().trim(),
-                (temp) -> dao.drugDataOne(temp, patInfo.getZkWard(), null)
-        );
-        YiZhuCheckData.calculateDrugAmount(data, feiYongXinXi);
-    }
-
-
-    /**
-     * 删除单条医嘱
-     *
-     * @param orderNo 医嘱号
-     * @return 提示
-     */
-    public ResultVo<String> toDeleteAnOrder(String orderNo) {
-        XinZhenYzActOrder oldData = dao.getActOrderNoOne(orderNo);
-        String message = judgeWhetherItCanBeDeleted(oldData);
-        if (StringUtil.notBlank(message)) {
-            return R.fail(ExceptionEnum.ERROR_MESSAGE, message);
-        }
-        dao.toDeleteAnOrder(orderNo, oldData.getInpatientNo());
-        dao.deleteGroup(orderNo);
-        return R.ok(ExceptionEnum.SUCCESS_AND_EL_MESSAGE);
-    }
-
-
-    /**
-     * 删除多条录入的医嘱
-     *
-     * @param param 参数
-     * @return 返回提示
-     */
-    public ResultVo<Map<String, String>> deleteMultipleOrders(XinZhenYiZhu param) {
-        QueryWrapper<?> qw = new QueryWrapper<>();
-        List<BigDecimal> list = new ArrayList<>();
-        param.getList().forEach(item -> {
-            list.add(item.getActOrderNo());
-        });
-        qw.in("act_order_no", list);
-        List<XinZhenYzActOrder> deleteOrderList = dao.getOrdersToDelete(qw);
-        if (ListUtil.isBlank(deleteOrderList)) {
-            return R.fail(ExceptionEnum.LOGICAL_ERROR, "没有找到原医嘱可能已经被删除了");
-        }
-        Map<String, String> map = new HashMap<>();
-        deleteOrderList.forEach(item -> {
-            String error = judgeWhetherItCanBeDeleted(item);
-            if (StringUtil.notBlank(error)) {
-                map.put(item.getActOrderNo().stripTrailingZeros().toPlainString(), error);
-            }
-        });
-        if (map.isEmpty()) {
-            dao.deleteParentChildRelationship(param.getInpatientNo(), param.getAdmissTimes(), list);
-            dao.deleteMultipleOrders(qw);
-            return R.fail(ExceptionEnum.SUCCESS_AND_EL_MESSAGE);
-        }
-        return R.fail(ExceptionEnum.ERROR_MESSAGE, "删除失败", map);
-    }
-
-    private String judgeWhetherItCanBeDeleted(XinZhenYzActOrder oldData) {
-        StringBuilder str = new StringBuilder();
-        if (oldData == null) {
-            return "没有找到原医嘱可能已经被删除了";
-        }
-        if (!("1".equals(oldData.getStatusFlag()) || "2".equals(oldData.getStatusFlag()))) {
-            str.append("该医嘱不是录入或确认状态,无法删除");
-        }
-        if (!oldData.getEnterOper().equals(TokenUtil.getInstance().getTokenUserId())) {
-            str.append("该医嘱录入人不是您,无法删除.");
-        }
-        return str.toString();
-    }
-
-
-    public ResultVo<Map<BigDecimal, String>> stopOrder(XinZhenYiZhu param) {
-        if (ListUtil.isBlank(param.getList())) {
-            return R.fail(ExceptionEnum.LOGICAL_ERROR, "请先选择数据");
-        }
-        Map<BigDecimal, String> map = new HashMap<>();
-
-        param.getList().forEach(item -> {
-            BigDecimal id = item.getActOrderNo();
-            if (item.getEndTime() == null) {
-                map.put(id, "停止时间不能为空,或该医嘱已经停止了。");
-            } else {
-                if (DateUtil.shiJianDaXiao(item.getEndTime(), item.getStartTime(), "<")) {
-                    map.put(id, "停止时间不能小于医嘱的开始时间。");
-                }
-            }
-        });
-
-        if (map.isEmpty()) {
-            dao.setStopTime(param.getList(), TokenUtil.getInstance().getTokenUserId(), param.getInpatientNo(), param.getAdmissTimes());
-            return R.ok(ExceptionEnum.SUCCESS_AND_EL_MESSAGE);
-        }
-
-        return R.fail(ExceptionEnum.NULL_POINTER, "请修改错误", map);
-    }
-
-    /**
-     * 获取某一个费用的详细信息
-     *
-     * @param code         编码
-     * @param serial       00-项目 01-小包装的药品 99-大包装
-     * @param deptCode     科室编码
-     * @param groupNo      药房编码
-     * @param seniorDoctor 授权医生
-     * @param flag         医嘱状态标志
-     * @return 返回该费用的一些详细信息,以及一些提示信息。
-     */
-    public ResultVo<Map<String, Object>> huoQuFeiYongXinXi(String code, String serial,
-                                                           String deptCode,
-                                                           String groupNo,
-                                                           String seniorDoctor,
-                                                           String flag) {
-        Map<String, Object> map = new HashMap<>();
-        // 一些提示
-        List<String> prompt = new ArrayList<>();
-        boolean permissionPrompt = false;
-        // 加载项目信息
-        if (ITEM.equals(serial.trim())) {
-            List<XinZhenYzActOrder> xiangMu = dao.huoQuXiangMu(code);
-            for (XinZhenYzActOrder item : xiangMu) {
-                if (item.getDelFlag() == 1) {
-                    return R.fail(ExceptionEnum.LOGICAL_ERROR, String.format("该医嘱下的【%s】,已经被停用了,请联系物价科。", item.getOrderName()));
-                } else if (StringUtil.isBlank(item.getNationalCode())) {
-                    prompt.add(String.format("该医嘱下面的【%s】,没有医保编码,请注意。", item.getOrderName()));
-                } else {
-                    prompt.add(String.format("该医嘱下【%s】,医保码为:【%s】。", item.getOrderName(), item.getNationalCode()));
-                }
-            }
-            if (ListUtil.isBlank(xiangMu)) {
-                if ("1".equals(flag)) {
-                    Integer paiChiYiZhu = dao.shiFouPaiChiYiZhu(code);
-                    if (paiChiYiZhu != null) {
-                        switch (paiChiYiZhu) {
-                            case 1:
-                                prompt.add("全排斥医嘱");
-                                break;
-                            case 2:
-                                prompt.add("单组排斥医嘱");
-                                break;
-                            case 3:
-                                prompt.add("多组斥医嘱");
-                                break;
-                            default:
-                                break;
-                        }
-                    }
-                }
-            }
-        } else {
-            String key = code.trim() + serial.trim();
-            YaoPinXinXi yp = dao.huoQuYaoPin(key);
-            // 新开的医嘱才需要判断这个
-            if (flag.equals("1")) {
-                if (yp == null) {
-                    return R.fail(ExceptionEnum.NO_DATA_EXIST, "该医嘱下的药品,可能已经被停用了,请联系药剂科。");
-                }
-                yp.setDrugFlag(getDrugFlagByLargeCategories(yp.getCategoriesFlag()));
-
-                YaoPinXinXi disable = dao.huoQuJinYongXinXi(key, groupNo);
-
-                if (disable != null && disable.getVisibleFlagZy() == 1) {
-                    return R.fail(ExceptionEnum.NO_DATA_EXIST, "该药品禁止住院使用。");
-                }
-                if (StringUtil.notBlank(deptCode)) {
-                    if (dao.restrictedUseInTheDepartment(code.trim(), deptCode) > 0) {
-                        return R.fail(ExceptionEnum.NO_DATA_EXIST, "该药品禁止在患者所在的科室使用。");
-                    }
-                }
-                Integer yiShenDengJi = dao.huoQuYiShenDengJi(TokenUtil.getInstance().getTokenUserId());
-                int yiShen = yiShenDengJi == null ? 0 : yiShenDengJi;
-
-                int superior = 0;
-
-                if (StringUtil.notBlank(seniorDoctor) && !"null".equals(seniorDoctor)) {
-                    Integer superiorRank = dao.huoQuYiShenDengJi(seniorDoctor);
-                    superior = superiorRank == null ? 0 : superiorRank;
-                }
-
-                if (yp.getYpLevel() > yiShen && yp.getYpLevel() > superior) {
-                    permissionPrompt = true;
-                }
-
-                if (yp.getKjywFlag() == 1) {
-                    prompt.add("抗菌药物,需填写抗菌药物医嘱附注");
-                }
-                if (yp.getSelfFlagYb() == 1) {
-                    prompt.add("该药品医保自费药品,如符合条件请填写记账,不是请填写自费");
-                }
-                if (StringUtil.isBlank(yp.getNationalCode())) {
-                    prompt.add("该药品医保没有匹配医保码");
-                } else {
-                    prompt.add(String.format("药品医保码为:【%s】", yp.getNationalCode()));
-                }
-                if (disable != null && disable.getStockAmount() != null && BigUtils.bigXiaoYu(disable.getStockAmount(), 10)) {
-                    prompt.add(String.format("该药品剩余数量为:【%s】", disable.getStockAmount().stripTrailingZeros().toPlainString()));
-                }
-                if (yp.getPsFlag() == 1) {
-                    prompt.add("此药品为皮试药品");
-                }
-                flagEquals1AddPrompt(prompt, yp.getJbFlag(), "该药品为【国家基本药物】");
-                flagEquals1AddPrompt(prompt, yp.getHighWarningFlag(), "该药品为【高警示药品】");
-                flagEquals1AddPrompt(prompt, yp.getWinningBidderFlag(), "该药品为【国家组织药品集中采购中标药品】");
-                flagEquals1AddPrompt(prompt, yp.getFocusMonitorFlag(), "该药品为【重点监控药品】");
-            }
-            List<YaoPingJiLiang> yaoPingJiLiang = new ArrayList<>();
-            if (StringUtil.notBlank(yp.getWeighUnit())) {
-                yaoPingJiLiang.add(new YaoPingJiLiang(yp.getWeighUnit(), yp.getWeighUnitName(), yp.getWeight()));
-            }
-            if (StringUtil.notBlank(yp.getVolUnit())) {
-                yaoPingJiLiang.add(new YaoPingJiLiang(yp.getVolUnit(), yp.getVolUnitName(), yp.getVolum()));
-            }
-            if (StringUtil.notBlank(yp.getPackUnit())) {
-                yaoPingJiLiang.add(new YaoPingJiLiang(yp.getPackUnit(), yp.getPackUnitName(), yp.getPackSize()));
-            }
-            map.put("yaoPingJiLiang", yaoPingJiLiang);
-            map.put("data", yp);
-        }
-        map.put("prompt", prompt);
-        map.put("permissionPrompt", permissionPrompt);
-        return R.ok(map);
-    }
-
-    private void flagEquals1AddPrompt(List<String> prompt, String flag, String message) {
-        if ("1".equals(flag)) {
-            prompt.add(message);
-        }
-    }
-
-
-    private String getDrugFlagByLargeCategories(String val) {
-        if (StringUtil.isBlank(val)) {
-            return "z";
-        }
-        switch (val) {
-            case "0":
-                return "d";
-            case "1":
-                return "i";
-            default:
-                return "z";
-        }
-    }
-
-
-    /**
-     * 获取医嘱频率
-     *
-     * @return 返回频率
-     */
-    public ResultVo<List<GetDropdownBox>> getFrequency() {
-        return R.ok(dao.selectFrequency());
-    }
-
-    /**
-     * @return 给药方式
-     */
-    public ResultVo<List<SelectV2>> getSupplyType() {
-        return R.ok(dao.selectSupplyType());
-    }
-
-    /**
-     * 获取执行科室
-     *
-     * @param code 五笔,拼音,中文,编码
-     * @return 返回对应的数据
-     */
-    public ResultVo<List<GetDropdownBox>> huoQuZhiXinKeShi(String code) {
-        return R.ok(dao.huoQuZhiXinKeShi(StringUtil.isContainChinese(code)));
-    }
-
-    /**
-     * 这里是校验模板的数据
-     *
-     * @param param 模板数据
-     * @return 返回提示信息
-     */
-    public ResultVo<Map<String, Object>> singleDataCheck(XinZhenYiZhu param) {
-        param.getList().get(0).setActOrderNo(new BigDecimal(param.getList().get(0).getId()));
-        YiZhuCheckData checkData = new YiZhuCheckData(dao);
-        checkData.init(param.getList(), null);
-        Map<String, Object> errorMessage = checkData.startCheck(null);
-        Map<String, Object> returnMap = new HashMap<>();
-        returnMap.put("data", param.getList().get(0));
-        returnMap.put("message", errorMessage.get(param.getList().get(0).getId()));
-        return R.ok(returnMap);
-    }
-
-
-    public ResultVo<String> doesTheTemplateExist(String name) {
-        if (dao.duplicateTemplateName(name, TokenUtil.getInstance().getTokenUserId()) == 0) {
-            return R.ok();
-        }
-        return R.fail(ExceptionEnum.NO_DATA_EXIST, "模板名称重复");
-    }
-
-    /**
-     * 保存模板 数据
-     *
-     * @param param 模板数据
-     * @return 成功
-     */
-    public ResultVo<String> saveTemplate(YzOrderPattern param) {
-        // 如果名字重复了,那么就修改原来的模板
-        YzOrderPattern yzOrderPattern = dao.yuanLaiDeMuBanBianMa(param.getPatternName(), TokenUtil.getInstance().getTokenUserId());
-        UserInfo userInfo = redisLikeService.getUserInfoByCode(TokenUtil.getInstance().getTokenUserId());
-
-        if (null == yzOrderPattern) {
-            yzOrderPattern = new YzOrderPattern();
-        }
-
-        String patternCode = yzOrderPattern.getPatternCode();
-
-        // 有原来的模板名称而且 还要是自己创建的才能删除,否则就只能创建新的模板了
-        if (StringUtil.notBlank(patternCode) && userInfo.getCode().equals(yzOrderPattern.getInputId())) {
-            // 更新的时候先删除模板 原来的模板
-            dao.shanChuLaoMuBan(patternCode);
-            param.setPatternCode(patternCode);
-        } else {
-            // 设置新的模板号
-            param.setPatternCode(publicServer.getPatternCode());
-        }
-
-        String py = PingYinUtils.pyShouZiMuDaXie(param.getPatternName());
-        String wb = PingYinUtils.getWBCode(param.getPatternName());
-
-        param.setPyCode(py.length() > 9 ? py.substring(0, 9) : py);
-        param.setDCode(wb.length() > 9 ? wb.substring(0, 9) : wb);
-
-        param.setInputId(TokenUtil.getInstance().getTokenUserId());
-        param.setDeptCode(userInfo.getDeptCode());
-        dao.chaRuMuBan(param);
-
-        Map<String, XinZhenYzActOrder> map = param.getList().stream().collect(Collectors.toMap(XinZhenYzActOrder::getId, a -> a, (k1, k2) -> k1));
-
-        for (XinZhenYzActOrder item : param.getList()) {
-            // 设置模板号
-            item.setActOrderNo(publicServer.getPatternOrderCode());
-            if (item.getParentNo() != null && map.containsKey(item.getParentNo().stripTrailingZeros().toPlainString())) {
-                item.setParentNo(map.get(item.getParentNo().stripTrailingZeros().toPlainString()).getActOrderNo());
-            }
-        }
-        dao.chaRuMuBanShuJu(param.getList(), param.getPatternCode());
-        return R.ok();
-    }
-
-    /***
-     * 获取项目信息
-     * @param xiangMuCode 项目编码
-     * @return 返回数据
-     */
-    public Map<String, List<XinZhenYzActOrder>> getProjectInformation(Set<String> xiangMuCode) {
-        if (!xiangMuCode.isEmpty()) {
-            return dao.huoQuXiangMuXinXi(xiangMuCode).stream().collect(Collectors.groupingBy(item -> item.getOrderCode().trim()));
-        }
-        return new HashMap<>(0);
-    }
-
-    /**
-     * 获取药品信息
-     *
-     * @param yaoPingCode 药品编码
-     * @return 返回数据
-     */
-    public Map<String, XinZhenYzActOrder> getDrugInformation(Set<String> yaoPingCode, String dept) {
-        if (!yaoPingCode.isEmpty()) {
-            return dao.huoQuYaoPinXinXi(yaoPingCode, dept).stream().collect(Collectors.toMap(item -> item.getOrderCode().trim() + item.getSerial().trim() + item.getGroupNo(), a -> a, (k1, k2) -> k1));
-        }
-        return new HashMap<>(0);
-    }
-
-
-    /**
-     * 获取医嘱录入的模板
-     *
-     * @param code         模板编码
-     * @param deptCode     科室编码
-     * @param muBanLeiXing 项目类型
-     * @param currentPage  当前页
-     * @param total        总数
-     * @return 返回模板
-     */
-    public ResultVo<IPage<YzOrderPattern>> huoQuYiZhuMuBan(String code, String deptCode, Integer muBanLeiXing, long currentPage, long total) {
-        IPage<YzOrderPattern> page = new Page<>();
-        if (total == 0) {
-            page.setTotal(dao.huoQuMuBanTotal(StringUtil.isContainChinese(code), TokenUtil.getInstance().getTokenUserId(), deptCode, muBanLeiXing));
-        }
-        page.setRecords(dao.huoQuMuBan(StringUtil.isContainChinese(code), TokenUtil.getInstance().getTokenUserId(), deptCode, muBanLeiXing, currentPage));
-        return R.ok(page);
-    }
-
-    /**
-     * 获取 我的医嘱模板的最大医嘱码
-     *
-     * @return 最大排序码
-     */
-    public ResultVo<Integer> getDoctorSOrderTemplateMaxSortNo() {
-        Integer sortCode = dao.getMyTemplateMaxSortNo(TokenUtil.getInstance().getTokenUserId());
-        return R.ok(sortCode == null ? 0 : sortCode);
-    }
-
-
-    private String getActOrderNo() {
-        Random random = new Random();
-        String a = String.valueOf(random.nextInt(5) + 1);
-        String b = String.valueOf(random.nextInt(99999));
-        return a + b;
-    }
-
-    /**
-     * 获取模板数据
-     *
-     * @param code 模板的编码
-     * @return 返回数据
-     */
-    public ResultVo<List<YzActOrder>> huoQuMuBanShuJu(String code) {
-        List<YzActOrder> muBanShuJu = dao.huoQuMuBanShuJu(code);
-        Map<BigDecimal, YzActOrder> map = new HashMap<>(muBanShuJu.size());
-        List<YzActOrder> tree = new ArrayList<>();
-        for (YzActOrder item : muBanShuJu) {
-            item.setId(getActOrderNo());
-            if (item.getParentNo() == null) {
-                tree.add(item);
-            }
-            map.put(item.getActOrderNo(), item);
-        }
-        for (YzActOrder item : muBanShuJu) {
-            YzActOrder yzActOrder = map.get(item.getParentNo());
-            if (yzActOrder != null) {
-                item.setParentNo(new BigDecimal(yzActOrder.getId()));
-                item.setIsChildren(true);
-                if (yzActOrder.getChildren() == null) {
-                    yzActOrder.setChildren(new ArrayList<>());
-                }
-                yzActOrder.getChildren().add(item);
-                // 没有副医嘱的就返回到最上层
-            } else if (!tree.contains(item)) {
-                item.setParentNo(null);
-                tree.add(item);
-            }
-        }
-        return R.ok(tree);
-    }
-
-
-    /**
-     * 删除医嘱模板
-     *
-     * @param patternCode 模板的编码
-     * @return 提示
-     */
-    public ResultVo<String> deleteADoctorSOrderTemplate(String patternCode) {
-        if (StringUtil.isBlank(patternCode)) {
-            return R.fail(ExceptionEnum.LOGICAL_ERROR, "模板编号为空。");
-        }
-        YzOrderPattern yzOrderPattern = dao.huoQuMuBanXinXi(patternCode);
-        EntityStringTrim.beanAttributeValueTrim(yzOrderPattern);
-        if (yzOrderPattern == null) {
-            return R.fail(ExceptionEnum.NULL_POINTER, "没有查询到对应的模板信息。");
-        }
-        String userId = TokenUtil.getInstance().getTokenUserId();
-        List<Integer> role = publicServer.getRoleCode().getData();
-        if (publicServer.needRule(role, RoleCode.PHYSICIAN_S_ORDER_TEMPLATEEDIT)) {
-            return startDeletingTemplates(patternCode);
-        }
-        if (userId.equals(yzOrderPattern.getInputId())) {
-            return startDeletingTemplates(patternCode);
-        }
-        //   主任可以删除本科室的任意模板
-        if (publicServer.needRule(role, RoleCode.DIRECTOR) && dao.userDeptCode(userId).equals(yzOrderPattern.getDeptCode())) {
-            return startDeletingTemplates(patternCode);
-        }
-        return R.fail(ExceptionEnum.LOGICAL_ERROR, "您没有权限删除这个模板。");
-    }
-
-    /**
-     * 删除父模板以及下面的子模板 数据
-     *
-     * @param patternCode 模板编码
-     */
-    private ResultVo<String> startDeletingTemplates(String patternCode) {
-        dao.shanChuMuBan(patternCode);
-        return R.ok(ExceptionEnum.SUCCESS_AND_EL_MESSAGE, "删除成功。");
-    }
-
-    /**
-     * 收藏医嘱模板或者取消收藏
-     * 如果以及收藏了就删除,没有就收藏
-     *
-     * @param patternCode 模板号
-     * @return 提示
-     */
-    public ResultVo<String> collectDoctorSOrderTemplate(String patternCode) {
-        String userId = TokenUtil.getInstance().getTokenUserId();
-        String saveTheDoctorSOrderNumber = dao.whetherToSaveTheDoctorSOrderTemplate(patternCode, userId);
-        if (StringUtil.notBlank(saveTheDoctorSOrderNumber)) {
-            dao.shanChuMuBan(saveTheDoctorSOrderNumber);
-            return R.ok(ExceptionEnum.SUCCESS_AND_EL_MESSAGE, "已取消删除。");
-        } else {
-            YzOrderPattern yzOrderPattern = dao.huoQuMuBanXinXi(patternCode);
-            EntityStringTrim.beanAttributeValueTrim(yzOrderPattern);
-            dao.chaRuShouCang(publicServer.getPatternCode(), yzOrderPattern.getPatternName() + "(收藏)", yzOrderPattern.getPyCode(), yzOrderPattern.getDCode(), dao.userDeptCode(userId), userId, yzOrderPattern.getPatternCode());
-            return R.ok(ExceptionEnum.SUCCESS_AND_EL_MESSAGE, "收藏成功。");
-        }
-    }
-
-
-    /**
-     * 删除或修改模板
-     *
-     * @param patternCode 模板点吗
-     * @param patternName 模板名称
-     * @param sortNo      排序号
-     * @param flag        标志 1-修改 2- 删除 3-收藏和取消收藏
-     * @return 返回给前端提示
-     */
-    public ResultVo<String> muBanCaoZuo(String patternCode, String patternName, String deptCode, Integer sortNo, Integer flag) {
-        if (StringUtil.isBlank(patternCode)) {
-            return R.fail(ExceptionEnum.NULL_POINTER, "模板编码为空。");
-        }
-        YzOrderPattern yzOrderPattern = dao.huoQuMuBanXinXi(patternCode);
-        if (yzOrderPattern == null) {
-            return R.fail(ExceptionEnum.NULL_POINTER, "没有查询到对应的模板信息。");
-        }
-        EntityStringTrim.beanAttributeValueTrim(yzOrderPattern);
-        String inputId = TokenUtil.getInstance().getTokenUserId();
-        List<Integer> role = publicServer.getRoleCode().getData();
-        // 管理员 和 医务部的无视 规则
-        if (!role.contains(1) && !role.contains(38) && flag != 3) {
-            // 只有模板在不等于 自己的时候触发
-            if (!inputId.equals(yzOrderPattern.getInputId())) {
-                if ("2".equals(yzOrderPattern.getInputType()) && !role.contains(11)) {
-                    return R.fail(ExceptionEnum.LOGICAL_ERROR, "该模板为科室模板您没有权限修改或删除,请联系科主任进行修改。");
-                } else if ("1".equals(yzOrderPattern.getInputType())) {
-                    return R.fail(ExceptionEnum.LOGICAL_ERROR, "该模板为全院模板,无法删除或修改。");
-                }
-            }
-        }
-        if (flag == 1) {
-            if (StringUtil.isBlank(patternName)) {
-                return R.fail(ExceptionEnum.NULL_POINTER, "模板名称不能为空。");
-            }
-            if (patternName.trim().equals(yzOrderPattern.getPatternName().trim()) && sortNo.equals(yzOrderPattern.getSortNo())) {
-                return R.fail(ExceptionEnum.INTERNAL_SERVER_ERROR, "数据没有变化,请勿点击。");
-            }
-            dao.genXingMuBan(patternName.trim(), PingYinUtils.pyShouZiMuDaXie(patternName), PingYinUtils.getWBCode(patternName), yzOrderPattern.getPatternCode(), sortNo);
-            return R.ok(ExceptionEnum.SUCCESS_AND_EL_MESSAGE, "修改成功。");
-        } else if (flag == 2) {
-            // 删除父模板以及下面的子模板 数据
-            dao.shanChuMuBan(yzOrderPattern.getPatternCode());
-            return R.ok(ExceptionEnum.SUCCESS_AND_EL_MESSAGE, "删除成功。");
-        } else if (flag == 3) {
-            // 收藏模板
-            String collectCode = dao.chongFuShouCang(inputId, patternCode);
-            if (collectCode == null) {
-                dao.chaRuShouCang(publicServer.getPatternCode(), yzOrderPattern.getPatternName() + "(收藏)", yzOrderPattern.getPyCode(), yzOrderPattern.getDCode(), deptCode, inputId, yzOrderPattern.getPatternCode());
-                return R.ok(ExceptionEnum.SUCCESS_AND_EL_MESSAGE, "收藏成功。");
-            } else {
-                dao.shanChuMuBan(yzOrderPattern.getPatternCode());
-                return R.ok(ExceptionEnum.SUCCESS_AND_EL_MESSAGE, "已取消收藏。");
-            }
-        }
-        return R.ok();
-    }
-
-    /**
-     * 获取医嘱下面产生的费用
-     *
-     * @param patNo 住院号
-     * @param times 住院次数
-     * @return 返回
-     */
-    @Deprecated
-    public ResultVo<Map<String, Object>> expensesForGettingADoctorSOrder(String patNo, Integer times) {
-        List<DoctorSOrderFee> feeDate = dao.expensesForGettingADoctorSOrder(patNo, times);
-        // 这些编码的医嘱都是有问题的
-        List<String> problem = Arrays.asList("5", "6", "7", "9");
-
-        Map<String, String> problemDoctorSOrder = new HashMap<>();
-        Map<String, FeeSum> totalCost = new HashMap<>();
-
-        Map<String, List<DoctorSOrderFee>> map = new HashMap<>(feeDate.size());
-        for (DoctorSOrderFee fee : feeDate) {
-            // 如果这个没有就代表没有产生费用
-            if (fee.getOrderNoStr() == null) {
-                continue;
-            }
-            String chargeStatusName = ChargeStatus.getValue(fee.getChargeStatus());
-
-            String amount = fee.getChargeAmount().abs().stripTrailingZeros().toPlainString();
-            String money = fee.getChargeFee().stripTrailingZeros().toPlainString();
-
-            // 计算费用总和
-            if (totalCost.containsKey(fee.getOrderNoStr())) {
-                FeeSum sum = totalCost.get(fee.getOrderNoStr());
-                sum.setSum(DecimalUtil.add(money, sum.getSum()));
-                sum.setAmount(DecimalUtil.add(amount, sum.getAmount()));
-                totalCost.replace(fee.getOrderNoStr(), sum);
-            } else {
-                FeeSum sum = new FeeSum();
-                sum.setAmount(amount);
-                sum.setSum(money);
-                totalCost.put(fee.getOrderNoStr(), sum);
-            }
-
-            if (problem.contains(fee.getChargeStatus())) {
-
-                problemDoctorSOrder.put(fee.getOrderNoStr(), chargeStatusName);
-            }
-
-            fee.setChargeStatusName(chargeStatusName);
-
-            if (map.containsKey(fee.getOrderNoStr())) {
-                map.get(fee.getOrderNoStr()).add(fee);
-            } else {
-                List<DoctorSOrderFee> list = new ArrayList<>();
-                list.add(fee);
-                map.put(fee.getOrderNoStr(), list);
-            }
-        }
-
-        Map<String, Object> feeData = new HashMap<>(3);
-        feeData.put("data", map);
-        feeData.put("problem", problemDoctorSOrder);
-        feeData.put("totalCost", totalCost);
-
-        return R.ok(feeData);
-    }
-
-    /**
-     * 设置患者三级医生
-     *
-     * @param param 参数
-     * @return 返回值
-     */
-    public ResultVo<String> saveTheThirdLevelDoctor(Overview param) {
-        dao.updateTheThirdLevelDoctor(param);
-        return R.ok(ExceptionEnum.SUCCESS_AND_EL_MESSAGE);
-    }
-
-    /**
-     * 设置父子医嘱
-     *
-     * @param param 主医嘱 和 多个子医嘱
-     * @return 返回数据
-     */
-    public ResultVo<List<XinZhenYzActOrder>> associateOrders(XinZhenYiZhu param) {
-        XinZhenYzActOrder order = dao.getActOrderNoOne(param.getActOrderNo());
-        if (order.getParentNo() != null) {
-            return R.fail(ExceptionEnum.LOGICAL_ERROR, "操作失败,父医嘱不能为子医嘱。");
-        }
-        Set<BigDecimal> orderList = new HashSet<>();
-        orderList.add(order.getActOrderNo());
-
-        param.getAssociatedGroup().forEach(item -> {
-            dao.associateOrders(item, order);
-            orderList.add(item);
-        });
-
-        QueryWrapper<?> qw = new QueryWrapper<>();
-        qw.in("a.act_order_no", orderList);
-
-        return R.ok(ExceptionEnum.SUCCESS_AND_EL_MESSAGE, "关联成功。", dao.selectOrderNo(qw));
-    }
-
-    /**
-     * 确认 出院带药医嘱
-     *
-     * @param patNo 住院号
-     * @param times 住院次数
-     * @return
-     */
-    public ResultVo<Map<String, Object>> confirmTheDoctorSOrderWithMedicine(String patNo, Integer times) {
-        QueryWrapper<?> qw = new QueryWrapper<>();
-        String 出院带药 = "007";
-        qw.eq("a.inpatient_no", patNo)
-                .eq("a.admiss_times", times)
-                .eq("a.status_flag", "1")
-                .eq("a.enter_oper", TokenUtil.getInstance().getTokenUserId())
-                .eq("isnull(a.supply_code,'0')", 出院带药);
-        XinZhenYiZhu patInfo = dao.queryPatientInfo(patNo, times);
-        patInfo.setList(dao.selectOrderNo(qw));
-
-        if (ListUtil.isBlank(patInfo.getList())) {
-            return R.fail(ExceptionEnum.LOGICAL_ERROR, "未查询到医嘱。");
-        }
-
-        String userCode = TokenUtil.getInstance().getTokenUserId();
-        // 出院带药需要生成药单 key 是不同的药房。不同的药房就要
-
-        YiZhuCheckData checkData = new YiZhuCheckData(dao);
-        checkData.init(patInfo.getList(), patInfo);
-        Map<String, Object> map = checkData.startCheck(null);
-
-        if (checkData.getPassTheAudit()) {
-            sendAMessageToTheNurse(patInfo, userCode, patInfo, "出院带药");
-            Date now = new Date();
-            ListUtil.batchList(patInfo.getList(), YiZhuLuRuDao.class, (mapper, item) -> {
-                if (StringUtil.notBlank(item.getSuperiorDoctor())) {
-                    mapper.takeMedicineAfterDischargeStopOrderAndSuperiorDoctor(item.getActOrderNo(), item.getSuperiorDoctor(), now);
-                } else {
-                    // 出院带药 确认了直接停止医嘱
-                    mapper.takeMedicineAfterDischargeStopOrder(item.getActOrderNo(), userCode, now);
-                }
-
-            });
-            return R.ok(ExceptionEnum.SUCCESS_AND_EL_MESSAGE);
-        } else {
-            return R.fail(ExceptionEnum.ERROR_MESSAGE, "请修改有错误的医嘱。", map);
-        }
-
-    }
-
-    public void insertATemplate(List<XinZhenYzActOrder> list, XinZhenYiZhu patInfo) {
-        String userCode = TokenUtil.getInstance().getTokenUserId();
-        list.forEach(item -> {
-            dao.insertEntryOrder(patInfo, item, userCode);
-        });
-    }
-
-    private void revertToTheDefaultState(XinZhenYzActOrder param, UserInfo us, BigDecimal parentNo) {
-        param.setActOrderNo(publicServer.getActOrderNo());
-        param.setStatusFlag("1");
-        Date newDate = new Date();
-        param.setOrderTime(newDate);
-        param.setStartTime(newDate);
-        param.setEndTime(null);
-        param.setEnterOper(us.getCode());
-        param.setSigner("");
-        param.setModifier("");
-        param.setParentNo(parentNo);
-    }
-
-
-    public ResultVo<JSONObject> copyOrder(CopyOrder copyOrder) {
-        QueryWrapper<?> qw = new QueryWrapper<>();
-        qw.eq("a.act_order_no", copyOrder.getActOrderNo());
-        List<XinZhenYzActOrder> yiZhuList = dao.selectOrderNo(qw);
-        if (ListUtil.isBlank(yiZhuList)) {
-            return R.fail(ExceptionEnum.NULL_POINTER, "原医嘱已经不存在了。");
-        }
-        // 个人信息
-        UserInfo us = redisLikeService.getUserInfoByToken();
-
-        // 存放生成的医嘱容器
-        List<BigDecimal> orderList = new ArrayList<>();
-
-        // 原来的医嘱
-        XinZhenYzActOrder fatherOrder = yiZhuList.get(0);
-        // 设置默认值
-        revertToTheDefaultState(fatherOrder, us, null);
-        fatherOrder.setExecUnit(copyOrder.getDeptCode());
-        fatherOrder.setFrequCode(copyOrder.getFrequCode());
-        orderList.add(fatherOrder.getActOrderNo());
-        // 查询子医嘱
-        QueryWrapper<?> childQw = new QueryWrapper<>();
-        // 根据父医嘱的住院号和住院次数查询医嘱,设置默认值会重新生成 actOrderNo ,所以需要使用 CopyOrder 中的 actOrderNo
-        childQw.eq("a.parent_no", copyOrder.getActOrderNo());
-        childQw.eq("a.inpatient_no", fatherOrder.getInpatientNo());
-        childQw.eq("a.admiss_times", fatherOrder.getAdmissTimes());
-
-        // 保存的子医嘱
-        List<XinZhenYzActOrder> childOrderList = dao.selectOrderNo(childQw);
-
-        // 存放医嘱容器
-        List<XinZhenYzActOrder> addOrderList = new ArrayList<>();
-        // 存放父医嘱
-        addOrderList.add(fatherOrder);
-
-        // 设置子医嘱默认值
-        if (ListUtil.notBlank(childOrderList)) {
-            childOrderList.forEach(item -> {
-                item.setExecUnit(copyOrder.getDeptCode());
-                item.setFrequCode(copyOrder.getFrequCode());
-                revertToTheDefaultState(item, us, fatherOrder.getActOrderNo());
-                orderList.add(item.getActOrderNo());
-                addOrderList.add(item);
-            });
-        }
-
-        // 获取患者信息
-        XinZhenYiZhu patInfo = dao.queryPatientInfo(copyOrder.getInpatientNo(), copyOrder.getAdmissTimes());
-        insertATemplate(addOrderList, patInfo);
-
-        JSONObject js = getNewOrderData(orderList);
-        return R.ok(ExceptionEnum.SUCCESS_AND_EL_MESSAGE, "复制成功。", js);
-    }
-
-    private JSONObject getNewOrderData(List<BigDecimal> orderList) {
-        QueryWrapper<?> newList = new QueryWrapper<>();
-        newList.in("a.act_order_no", orderList);
-        newList.orderByAsc("a.act_order_no");
-        List<XinZhenYzActOrder> newOrderList = getOrderList(dao.selectOrderNo(newList));
-        JSONObject js = new JSONObject();
-        js.put("list", orderList);
-        js.put("data", newOrderList);
-        return js;
-    }
-
-
-    public ResultVo<List<ZyDetailCharge>> queryFeeByOrderNo(BigDecimal actOrderNo) {
-        XinZhenYzActOrder yz = dao.getActOrderNoOne(actOrderNo.stripTrailingZeros().toPlainString());
-        if (yz == null) {
-            return R.fail(ExceptionEnum.LOGICAL_ERROR, "该医嘱未产生费用。");
-        }
-        List<ZyDetailCharge> feeList = dao.selectOrderFee(yz);
-        return R.ok(feeList);
-    }
-
-    public ResultVo<String> oneClickStopOrder(OneClickOrder param) {
-        param.setOrderNo(publicServer.getActOrderNo());
-        param.setNowDate(new Date());
-        param.setUserCode(TokenUtil.getInstance().getTokenUserId());
-        return executeOneClickStopOrder(param);
-    }
-
-    public ResultVo<String> executeOneClickStopOrder(OneClickOrder param) {
-        // 10507 固定医嘱号
-        int count = dao.oneClickStopOrder(param, param.getUserCode());
-        if (count > 0) {
-            // 生成医嘱
-            XinZhenYiZhu patInfo = dao.queryPatientInfo(param.getPatNo(), param.getTimes());
-            dao.insertOneClickStopOrder(param, patInfo);
-            return R.ok(ExceptionEnum.SUCCESS_AND_EL_MESSAGE, "操作成功,正在执行的长期医嘱停止到了【" + param.getDateStr() + "】");
-        }
-        return R.fail(ExceptionEnum.LOGICAL_ERROR, "没有需要停止的长期医嘱操作失败。");
-    }
-
-    /**
-     * 上级医生登录
-     *
-     * @return 信息
-     */
-    public ResultVo<DoctorAuthRest> doctorAuthorizationLogin(DoctorAuthParams userInfo) {
-        DoctorAuthRest u;
-        if (StrUtil.isNotBlank(userInfo.getPassword())) {
-            userInfo.setPassword(SecureUtil.md5(userInfo.getPassword()));
-            u = dao.doctorAuthorizationLogin(userInfo);
-        } else {
-            u = dao.doctorAuthorizationLoginByEmrSignPwd(userInfo);
-        }
-
-        if (u == null) {
-            return R.fail(ExceptionEnum.LOGICAL_ERROR, "密码错误或用户不存在。");
-        }
-
-        // 如果是项目
-        if (userInfo.getDrugCode().endsWith("_00")) {
-            return R.ok(u);
-        }
-
-        Integer drugLeven = dao.selectYpLevel(userInfo.getDrugCode());
-
-        if (drugLeven > (u.getDoctorLevel() + 1)) {
-            return R.ok(ExceptionEnum.LOGICAL_ERROR, StrUtil.format("该医生等级不足,药品等级【{}】,医生等级:【{}】", drugLeven, u.getDoctorLevel()));
-        }
-
-        return R.ok(u);
-    }
-
-
-    public ResultVo<String> updateOrderInstruction(BigDecimal orderNo, String str) {
-        dao.updateOrderInstruction(orderNo, str);
-        return R.ok(ExceptionEnum.SUCCESS_AND_EL_MESSAGE, "更新成功。");
-    }
-
-    public ResultVo<JSONObject> copyTableOrder(XinZhenYiZhu param) {
-        if (StringUtil.isBlank(param.getInpatientNo())) {
-            return R.fail(ExceptionEnum.ERROR_MESSAGE, "请先选择患者.");
-        }
-
-        XinZhenYiZhu patInfo = dao.queryPatientInfo(param.getInpatientNo(), param.getAdmissTimes());
-        if (patInfo == null) {
-            return R.fail(ExceptionEnum.ERROR_MESSAGE, "请先选择患者.");
-        }
-
-        List<XinZhenYzActOrder> list = param.getList();
-        Queue<BigDecimal> queue = new LinkedList<>();
-        // 保存 老 新 医嘱
-        Map<BigDecimal, BigDecimal> map = new HashMap<>();
-
-        for (XinZhenYzActOrder item : list) {
-            BigDecimal orderNo = publicServer.getActOrderNo();
-            queue.offer(orderNo);
-            map.put(item.getActOrderNo(), orderNo);
-        }
-
-        List<BigDecimal> returnOrderList = new LinkedList<>();
-
-        String userCode = TokenUtil.getInstance().getTokenUserId();
-
-        ListUtil.batchList(list, YiZhuLuRuDao.class, (mapper, item) -> {
-            item.setActOrderNo(queue.poll());
-            if (item.getParentNo() != null) {
-                item.setParentNo(map.get(item.getParentNo()));
-            }
-            returnOrderList.add(item.getActOrderNo());
-            mapper.insertEntryOrder(patInfo, item, userCode);
-        });
-
-        JSONObject js = getNewOrderData(returnOrderList);
-        return R.ok(js);
-    }
-
-    public ResultVo<String> analyzeSiChargeLimit(SiLimitRequest request) {
-        return R.ok(siChargeLimitService.analyzeSiChargeLimit(request));
-    }
-
-    public QueryWrapper<?> getConfirmQueryWrapper(String patNo, Integer times) {
-        return new QueryWrapper<>().eq("a.inpatient_no", patNo)
-                .eq("a.admiss_times", times)
-                .eq("a.status_flag", "1")
-                .eq("a.enter_oper", TokenUtil.getInstance().getTokenUserId())
-                // 排除出院带药的医嘱
-                .ne("isnull(a.self_buy,'0')", "4")
-                .orderByAsc("a.act_order_no");
-    }
-
-    public ResultVo<String> confirmYzCheck(String patNo, Integer times, Integer ledgerSn) {
-        QueryWrapper<?> qw = getConfirmQueryWrapper(patNo, times);
-
-        Set<String> orderCode = dao.selectOrderCode(qw);
-
-        if (orderCode == null || orderCode.isEmpty()) {
-            return R.ok("OK");
-        }
-
-        List<String> collect = orderCode
-                .stream()
-                .filter(Objects::nonNull)
-                .collect(Collectors.toList());
-
-        if (collect.isEmpty()) {
-            return R.ok("OK");
-        }
-
-        SiLimitRequest request = SiLimitRequest.builder()
-                .patNo(patNo).times(times)
-                .ledgerSn(ledgerSn)
-                .chargeList(collect)
-                .build();
-
-        return R.ok(siChargeLimitService.analyzeSiChargeLimit(request));
-    }
-
-}