Pārlūkot izejas kodu

门诊诊疗信息

lihong 4 mēneši atpakaļ
vecāks
revīzija
ff27e9ee07

+ 65 - 0
src/main/java/thyyxxk/webserver/controller/mzmedical/MzMedicalMainController.java

@@ -0,0 +1,65 @@
+package thyyxxk.webserver.controller.mzmedical;
+
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import thyyxxk.webserver.config.auth.PassToken;
+import thyyxxk.webserver.entity.ResultVo;
+import thyyxxk.webserver.entity.mzmedical.MzMedicalField;
+import thyyxxk.webserver.entity.mzmedical.MzMedicalMain;
+import thyyxxk.webserver.entity.mzmedical.MzMedicalMainParam;
+import thyyxxk.webserver.service.mzmedical.MzMedicalMainService;
+import thyyxxk.webserver.utils.ResultVoUtil;
+
+import javax.annotation.Resource;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @Description:
+ * @Author:lihong
+ * @Date: 2025/4/14
+ */
+@RestController
+@RequestMapping("/mzMedicalMain")
+public class MzMedicalMainController {
+    @Resource
+    private MzMedicalMainService service;
+
+    @GetMapping("/queryMzMedicalField")
+    public ResultVo<List<MzMedicalField>> queryMzMedicalField(){
+        return ResultVoUtil.success(service.queryMzMedicalField());
+    }
+
+    @GetMapping("/queryMzMedicalZd")
+    public ResultVo<Map<String,List<Map<String, Object>>>> queryMzMedicalZd(){
+        return ResultVoUtil.success(service.queryMzMedicalZd());
+    }
+
+
+    @PostMapping("/updateDelFlag")
+    public ResultVo<String> updateDelFlag(@RequestBody MzMedicalMain mzMedicalMain){
+        service.updateDelFlag(mzMedicalMain);
+        return ResultVoUtil.success();
+    }
+
+    @PostMapping("/queryMzMedicalMainPage")
+    public ResultVo<Map<String,Object>> queryMzMedicalMainPage(@RequestBody MzMedicalMainParam param){
+        return service.queryMzMedicalMainPage(param);
+    }
+    /**
+     * @description: 生成 几月的数据
+     * @author: lihong
+     * @date: 2025/4/14 11:46
+     * @param: param
+     * @return: thyyxxk.webserver.entity.ResultVo<java.util.Map<java.lang.String,java.lang.Object>>
+     **/
+    @PassToken
+    @PostMapping("/generateMzMedicalMainByMoth")
+    public ResultVo<String> generateMzMedicalMainByMoth(@RequestBody MzMedicalMainParam param){
+        return service.generateMzMedicalMainByMoth(param);
+    }
+
+}

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 28 - 0
src/main/java/thyyxxk/webserver/dao/his/mzmedical/MzMedicalMainDao.java


+ 15 - 0
src/main/java/thyyxxk/webserver/entity/mzmedical/MzMedicalField.java

@@ -0,0 +1,15 @@
+package thyyxxk.webserver.entity.mzmedical;
+
+import lombok.Data;
+
+/**
+ * @Description:
+ * @Author:lihong
+ * @Date: 2025/4/14
+ */
+@Data
+public class MzMedicalField {
+    private String code;
+    private String medicalCode;
+    private String reMark;
+}

+ 298 - 0
src/main/java/thyyxxk/webserver/entity/mzmedical/MzMedicalMain.java

@@ -0,0 +1,298 @@
+package thyyxxk.webserver.entity.mzmedical;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.math.BigDecimal;
+import java.util.Date;
+/**
+ * (MzMedicalMain)表实体类
+ *
+ * @author lihong
+ * @since 2025-04-14 10:19:49
+ */
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+@Builder
+public class MzMedicalMain  {
+
+    private String hospitalName;
+    //统一社会信用代码
+    private String socialCreditCode;
+    private String patientId;
+    private Integer times;
+    private String name;
+    //性别  1 男 2女
+    private Integer sex;
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
+    private Date birthDay;
+       //婚姻状态
+    private String marryCode;
+    //国籍
+    private String country;
+    //民族
+    private String nation;
+    //证件类型
+    private String certificateType;
+    //证件号
+    private String socialNo;
+    //现住址
+    private String adress;
+     //电话
+    private String phoneNo;
+    //过敏史 1 无 2有
+    private String gms;
+     //过敏药物
+    private String allergenName;
+     //其他过敏  1 无 2有
+    private String qtgms;
+    //其他过敏药物
+    private String qtgmy;
+    //挂号日期     yyyy-MM-dd HH:mm
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm")
+    private Date ghDate;
+    //报到日期 yyyy-MM-dd HH:mm
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm")
+    private Date bdDate;
+     //就诊日期    yyyy-MM-dd HH:mm
+     @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
+     @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm")
+    private Date visitDate;
+     //就诊科室
+    private String deptCode;
+    //接诊医师
+    private String doctorName;
+    //接诊医师职称
+    private String doctorZc;
+    //就诊类型
+    /**1	急诊
+     2	普通门诊
+     3	特需门诊
+     4	互联网诊疗
+     5	MDT门诊
+     9	其他*/
+    private String visitType;
+    //是否复诊 1 是 2 否
+    private String firstOrNot;
+    //是否 输液
+    private String syOrNot;
+    //是否为门诊慢特病患者
+    private String mzMtb;
+    //急诊患者分级 Ⅰ级	急危患者,需要立即得到救治
+    //Ⅱ级	急重患者,需要评估与救治同时进行
+    //Ⅲ级	急症患者,需要在短时间内得到救治
+    //Ⅳ级	亚急症或非急症患者
+    private String mzHzFj;
+    //急诊患者去向 1	医嘱离院
+    //2	医嘱转院
+    //3	医嘱转社区卫生服务机构/乡镇卫生院
+    //4	非医嘱离院
+    //5	死亡
+    //6	急诊留观
+    //7	急诊转入院
+    //9	其他
+    private String jzHzQx;
+     // 住院证开具时间
+     @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
+     @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm")
+    private Date zyzDate;
+    //患者主诉
+    private String emrChiefComplaint;
+    //诊断名称
+    private String icdName;
+     //诊断编码
+    private String icdCode;
+          
+    private String icdName1;
+          
+    private String icdCode1;
+          
+    private String icdName2;
+          
+    private String icdCode2;
+          
+    private String icdName3;
+          
+    private String icdCode3;
+          
+    private String icdName4;
+          
+    private String icdCode4;
+          
+    private String icdName5;
+          
+    private String icdCode5;
+          
+    private String icdName6;
+          
+    private String icdCode6;
+          
+    private String icdName7;
+          
+    private String icdCode7;
+          
+    private String icdName8;
+          
+    private String icdCode8;
+          
+    private String icdName9;
+          
+    private String icdCode9;
+          
+    private String icdName10;
+          
+    private String icdCode10;
+    //手术操作日期
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
+    private Date oprDate1;
+    //手术操作名称
+    private String oprName1;
+    //手术操作编码
+    private String oprCode1;
+    //手术操作医生
+    private String oprDoctor1;
+     //麻醉方式
+    private String mzfs1;
+    //麻醉医生
+    private String mzDoctor1;
+     //手术级别 1	一级手术:指风险较低、过程简单、技术难度低的普通手术
+     //2	二级手术:指有一定风险、过程复杂程度一般、有一定技术难度的手术
+     //3	三级手术:指风险较高、过程较复杂、难度较大的手术
+     //4	四级手术:指风险高、过程复杂、难度大的重大手术
+    private String oprScale1;
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
+    private Date oprDate2;
+          
+    private String oprName2;
+          
+    private String oprCode2;
+          
+    private String oprDoctor2;
+          
+    private String mzfs2;
+          
+    private String mzDoctor2;
+          
+    private Integer oprScale2;
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
+    private Date oprDate3;
+          
+    private String oprName3;
+          
+    private String oprCode3;
+          
+    private String oprDoctor3;
+          
+    private String mzfs3;
+          
+    private String mzDoctor3;
+          
+    private Integer oprScale3;
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
+    private Date oprDate4;
+          
+    private String oprName4;
+          
+    private String oprCode4;
+          
+    private String oprDoctor4;
+          
+    private String mzfs4;
+          
+    private String mzDoctor4;
+          
+    private Integer oprScale4;
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
+    private Date oprDate5;
+          
+    private String oprName5;
+          
+    private String oprCode5;
+          
+    private String oprDoctor5;
+          
+    private String mzfs5;
+          
+    private String mzDoctor5;
+          
+    private Integer oprScale5;
+          
+    private BigDecimal totalFee;
+          
+    private BigDecimal zfFee;
+          
+    private BigDecimal fee1;
+          
+    private BigDecimal fee2;
+          
+    private BigDecimal fee3;
+          
+    private BigDecimal fee4;
+          
+    private BigDecimal fee5;
+          
+    private BigDecimal fee6;
+          
+    private BigDecimal fee7;
+          
+    private BigDecimal fee8;
+          
+    private BigDecimal fee901;
+          
+    private BigDecimal fee902;
+          
+    private BigDecimal fee1001;
+          
+    private BigDecimal fee1002;
+          
+    private BigDecimal fee1003;
+          
+    private BigDecimal fee11;
+          
+    private BigDecimal fee12;
+          
+    private BigDecimal fee13;
+          
+    private BigDecimal fee14;
+          
+    private BigDecimal fee15;
+          
+    private BigDecimal fee16;
+          
+    private BigDecimal fee17;
+          
+    private BigDecimal fee18;
+          
+    private BigDecimal fee19;
+          
+    private BigDecimal fee20;
+          
+    private BigDecimal fee21;
+          
+    private BigDecimal fee22;
+          
+    private BigDecimal fee23;
+          
+    private BigDecimal fee24;
+          
+    private BigDecimal fee25;
+    private Integer delFlag;
+    //诊断
+    private String icdCodeNew;
+    private String icdTextNew;
+
+    }
+

+ 22 - 0
src/main/java/thyyxxk/webserver/entity/mzmedical/MzMedicalMainParam.java

@@ -0,0 +1,22 @@
+package thyyxxk.webserver.entity.mzmedical;
+
+import lombok.Data;
+
+/**
+ * @Description:
+ * @Author:lihong
+ * @Date: 2025/4/14
+ */
+@Data
+public class MzMedicalMainParam {
+    private String yearMoth;
+    private String keyWard;
+    private String startTime;
+    private String endTime;
+    private Integer pageSize;
+    private Integer currentPage;
+    private Integer delFlag;
+    //0 不覆盖 1覆盖已有的数据
+    private Integer overFlag;
+
+}

+ 209 - 0
src/main/java/thyyxxk/webserver/service/mzmedical/MzMedicalMainService.java

@@ -0,0 +1,209 @@
+package thyyxxk.webserver.service.mzmedical;
+
+import cn.hutool.core.bean.BeanUtil;
+import cn.hutool.core.collection.CollUtil;
+import cn.hutool.core.convert.Convert;
+import cn.hutool.core.date.DateUtil;
+import cn.hutool.core.util.RandomUtil;
+import cn.hutool.core.util.ReflectUtil;
+import cn.hutool.core.util.StrUtil;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+import thyyxxk.webserver.config.exception.BizException;
+import thyyxxk.webserver.config.exception.ExceptionEnum;
+import thyyxxk.webserver.dao.his.mzmedical.MzMedicalMainDao;
+import thyyxxk.webserver.entity.ResultVo;
+import thyyxxk.webserver.entity.executeItem.NumberEnum;
+import thyyxxk.webserver.entity.mzmedical.MzMedicalField;
+import thyyxxk.webserver.entity.mzmedical.MzMedicalMain;
+import thyyxxk.webserver.entity.mzmedical.MzMedicalMainParam;
+import thyyxxk.webserver.utils.AssertUtil;
+import thyyxxk.webserver.utils.ResultVoUtil;
+
+import javax.annotation.Resource;
+import java.math.BigDecimal;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.stream.Collectors;
+
+/**
+ * @Description:门诊诊疗信息页
+ * @Author:lihong
+ * @Date: 2025/4/14
+ */
+@Service
+@Slf4j
+public class MzMedicalMainService {
+    @Resource
+    private MzMedicalMainDao dao;
+
+    private final static String HOSPITAL_NAME = "长沙泰和医院";
+    private final static String SOCIAL_CREDIT_CODE = "430000150806";
+
+    public List<MzMedicalField> queryMzMedicalField() {
+        List<MzMedicalField> mzMedicalFields = dao.selectAllMzMedicalField();
+        for (MzMedicalField item : mzMedicalFields) {
+            item.setMedicalCode(StrUtil.toCamelCase(item.getMedicalCode()));
+        }
+        return mzMedicalFields;
+    }
+
+
+    public int updateDelFlag(MzMedicalMain mzMedicalMain) {
+        AssertUtil.isnotBlank(mzMedicalMain.getPatientId(), "门诊号不能为空!");
+        AssertUtil.isnotBlank(mzMedicalMain.getTimes(), "就诊次数不能为空!");
+        AssertUtil.isnotBlank(mzMedicalMain.getDelFlag(), "删除标识不能为空!");
+        return dao.updateDelFlag(mzMedicalMain);
+    }
+
+    public ResultVo queryMzMedicalMainPage(MzMedicalMainParam param) {
+        AssertUtil.isnotBlank(param.getYearMoth(), "请选择月份");
+        setStartAndEndTime(param);
+        IPage page = new Page(param.getCurrentPage(), param.getPageSize());
+        List list = dao.selectMzMedicalMainPage(page, param);
+        if (list.size() > 0) {
+            Map<String, Object> res = new HashMap<>(10);
+            res.put("data", list);
+            res.put("total", page.getTotal());
+            return ResultVoUtil.success(res);
+        }
+        return ResultVoUtil.fail(ExceptionEnum.NO_DATA_EXIST);
+    }
+
+    private void setStartAndEndTime(MzMedicalMainParam param) {
+        int lastDayOfMonth = DateUtil.getLastDayOfMonth(DateUtil.parseDate(param.getYearMoth() + "-01"));
+        param.setStartTime(param.getYearMoth() + "-01 00:00:00");
+        param.setEndTime(param.getYearMoth() + "-" + lastDayOfMonth + " 23:59:59");
+    }
+
+    @Transactional(rollbackFor = Exception.class)
+    public ResultVo<String> generateMzMedicalMainByMoth(MzMedicalMainParam param) {
+        AssertUtil.isnotBlank(param.getYearMoth(), "请选择月份");
+        setStartAndEndTime(param);
+        Integer count = dao.selectCount(param.getStartTime(), param.getEndTime());
+        if (count != null) {
+            if (Convert.toInt(param.getOverFlag(), 0) == 0) {
+                throw new BizException(ExceptionEnum.LOGICAL_ERROR, "已经有" + param.getYearMoth() + "月份数据了,不要重复生成!");
+            }
+            dao.delByVistDate(param.getStartTime(), param.getEndTime());
+        }
+        List<MzMedicalMain> mzMedicalMainSourceData = dao.selectMzMedicalSourceData(param.getStartTime(), param.getEndTime());
+        AssertUtil.isnotBlank(mzMedicalMainSourceData, "没有需要同步的数据");
+        List<MzMedicalMain> oprtSource = dao.selectOprtSource(param.getStartTime(), param.getEndTime());
+        Map<String, List<MzMedicalMain>> oprtMap = null;
+        if (CollUtil.isNotEmpty(oprtSource)) {
+            oprtMap = oprtSource.stream().collect(Collectors.groupingBy(item -> joinPatientIdAndTimes(item.getPatientId(), item.getTimes())));
+        }
+        List<MzMedicalMain> gmyData = dao.selectAllergenInfo();
+        Map<String, List<MzMedicalMain>> gmyMap = null;
+        if (CollUtil.isNotEmpty(gmyData)) {
+            gmyMap = gmyData.stream().collect(Collectors.groupingBy(MzMedicalMain::getPatientId));
+        }
+        for (MzMedicalMain mzMedicalMain : mzMedicalMainSourceData) {
+            BeanUtil.trimStrFields(mzMedicalMain);
+            mzMedicalMain.setHospitalName(HOSPITAL_NAME);
+            mzMedicalMain.setSocialCreditCode(SOCIAL_CREDIT_CODE);
+            mzMedicalMain.setCertificateType(getCertificateType(mzMedicalMain.getCertificateType()));
+            mzMedicalMain.setGms(NumberEnum.ONE.getCode());
+            mzMedicalMain.setQtgms(NumberEnum.ONE.getCode());
+            mzMedicalMain.setGhDate(DateUtil.offsetSecond(mzMedicalMain.getVisitDate(), -(60 * 2 + RandomUtil.randomInt(0, 40) * 60)));
+            mzMedicalMain.setFee25(BigDecimal.ZERO);
+            if (!NumberEnum.ONE.getCode().equals(mzMedicalMain.getVisitType())) {
+                if (mzMedicalMain.getDeptCode().contains("急诊")) {
+                    mzMedicalMain.setVisitType(NumberEnum.ONE.getCode());
+                }
+            }
+            if (CollUtil.isNotEmpty(gmyMap)) {
+                List<MzMedicalMain> gmYw = gmyMap.get(mzMedicalMain.getPatientId());
+                if (CollUtil.isNotEmpty(gmYw)) {
+                    Set<String> gmCollect = gmYw.stream().map(MzMedicalMain::getAllergenName).collect(Collectors.toSet());
+                    mzMedicalMain.setGms(NumberEnum.TWO.getCode());
+                    mzMedicalMain.setAllergenName(CollUtil.join(gmCollect, ","));
+                }
+            }
+            if (StrUtil.isNotBlank(mzMedicalMain.getIcdCodeNew())) {
+                String[] icdArr = mzMedicalMain.getIcdCodeNew().split(",");
+                for (int i = 0; i < icdArr.length; i++) {
+                    String icdCode = "icdCode" + (i == 0 ? "" : i);
+                    ReflectUtil.setFieldValue(mzMedicalMain, icdCode, icdArr[i]);
+                }
+            }
+            if (StrUtil.isNotBlank(mzMedicalMain.getIcdTextNew())) {
+                String[] icdArr = mzMedicalMain.getIcdTextNew().split(",");
+                for (int i = 0; i < icdArr.length; i++) {
+                    String icdName = "icdName" + (i == 0 ? "" : i);
+                    ReflectUtil.setFieldValue(mzMedicalMain, icdName, icdArr[i]);
+                }
+            }
+            if (CollUtil.isNotEmpty(oprtMap) && CollUtil.isNotEmpty(oprtMap.get(joinPatientIdAndTimes(mzMedicalMain.getPatientId(), mzMedicalMain.getTimes())))) {
+                List<MzMedicalMain> oprList = oprtMap.get(joinPatientIdAndTimes(mzMedicalMain.getPatientId(), mzMedicalMain.getTimes()));
+                for (int i = 0; i < oprList.size(); i++) {
+                    ReflectUtil.setFieldValue(mzMedicalMain, "oprDate" + (i + 1), oprList.get(i).getOprDate1());
+                    ReflectUtil.setFieldValue(mzMedicalMain, "oprName" + (i + 1), oprList.get(i).getOprName1());
+                    ReflectUtil.setFieldValue(mzMedicalMain, "oprCode" + (i + 1), oprList.get(i).getOprCode1());
+                    ReflectUtil.setFieldValue(mzMedicalMain, "oprDoctor" + (i + 1), oprList.get(i).getOprDoctor1());
+                    ReflectUtil.setFieldValue(mzMedicalMain, "mzfs" + (i + 1), oprList.get(i).getMzfs1());
+                    ReflectUtil.setFieldValue(mzMedicalMain, "mzDoctor" + (i + 1), oprList.get(i).getMzDoctor1());
+                    ReflectUtil.setFieldValue(mzMedicalMain, "oprScale" + (i + 1), oprList.get(i).getOprScale1());
+                }
+            }
+            BigDecimal totalFee = BigDecimal.ZERO;
+            for (int i = 1; i <= 24; i++) {
+                if (i == 9) {
+                    totalFee = totalFee.add(Convert.toBigDecimal(ReflectUtil.getFieldValue(mzMedicalMain, "fee901"), BigDecimal.ZERO));
+                    totalFee = totalFee.add(Convert.toBigDecimal(ReflectUtil.getFieldValue(mzMedicalMain, "fee902"), BigDecimal.ZERO));
+                } else if (i == 10) {
+                    totalFee = totalFee.add(Convert.toBigDecimal(ReflectUtil.getFieldValue(mzMedicalMain, "fee1001"), BigDecimal.ZERO));
+                    totalFee = totalFee.add(Convert.toBigDecimal(ReflectUtil.getFieldValue(mzMedicalMain, "fee1002"), BigDecimal.ZERO));
+                    totalFee = totalFee.add(Convert.toBigDecimal(ReflectUtil.getFieldValue(mzMedicalMain, "fee1003"), BigDecimal.ZERO));
+
+                } else {
+                    totalFee = totalFee.add(Convert.toBigDecimal(ReflectUtil.getFieldValue(mzMedicalMain, "fee" + i), BigDecimal.ZERO));
+                }
+            }
+            mzMedicalMain.setFee901(mzMedicalMain.getFee901().add(mzMedicalMain.getFee902()));
+            mzMedicalMain.setFee1001(mzMedicalMain.getFee1001().add(mzMedicalMain.getFee1002()).add(mzMedicalMain.getFee1003()));
+            mzMedicalMain.setTotalFee(totalFee);
+        }
+        List<List<MzMedicalMain>> split = CollUtil.split(mzMedicalMainSourceData, 15);
+        for (List<MzMedicalMain> temp : split) {
+            dao.batchInsertData(temp);
+        }
+        return ResultVoUtil.success(ExceptionEnum.SUCCESS_AND_EL_MESSAGE, "同步成功");
+    }
+
+    private String getCertificateType(String certificateType) {
+        String str = "9";
+        if ("1".equals(certificateType) || "01".equals(certificateType)) {
+            return "1";
+        } else if ("02".equals(certificateType)) {
+            return "2";
+        } else if ("03".equals(certificateType)) {
+            return "3";
+        } else if ("04".equals(certificateType) || "05".equals(certificateType)) {
+            return "4";
+        } else if ("08".equals(certificateType)) {
+            return "6";
+        } else if ("07".equals(certificateType)) {
+            return "7";
+        }
+        return str;
+    }
+
+    private String joinPatientIdAndTimes(String patientId, Integer times) {
+        return patientId + "_" + times;
+    }
+
+    public Map<String, List<Map<String, Object>>> queryMzMedicalZd() {
+        List<Map<String, Object>> list = dao.selectMzMedicalZd();
+        Map<String, List<Map<String, Object>>> typeCodeMap = list.stream().collect(Collectors.groupingBy(item -> (String) item.get("type_code")));
+        return typeCodeMap;
+    }
+
+
+}

Daži faili netika attēloti, jo izmaiņu fails ir pārāk liels