Pārlūkot izejas kodu

update dtp档案管理

wangshuangpan 3 nedēļas atpakaļ
vecāks
revīzija
a362adbe9c

+ 65 - 4
health-admin/src/main/java/com/bzd/web/controller/dtp/PharmaceuticalServiceController.java

@@ -6,6 +6,9 @@ import com.bzd.common.core.controller.BaseController;
 import com.bzd.common.core.domain.AjaxResult;
 import com.bzd.common.core.page.TableDataInfo;
 import com.bzd.common.enums.BusinessType;
+import com.bzd.common.utils.DateUtils;
+import com.bzd.common.utils.ServletUtils;
+import com.bzd.common.utils.StringUtils;
 import com.bzd.system.service.PharmaceuticalService;
 import org.apache.shiro.authz.annotation.RequiresPermissions;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -85,20 +88,73 @@ public class PharmaceuticalServiceController extends BaseController {
     }
 
     /**
-     * 档案管理数据修改
+     * 档案管理数据编辑
      *
      * @return
      * @throws Exception
      */
     @RequiresPermissions("dtp:pmService:edit")
-    @GetMapping("/archivesEdit/{archivesId}")
-    public String archivesView(@PathVariable("archivesId") Long archivesId, ModelMap mmap) throws Exception {
+    @GetMapping("/archivesEdit/{id}")
+    public String archivesView(@PathVariable("id") Long Id, ModelMap mmap) throws Exception {
         PageData pd = this.getPageData();
-        pd.put("archivesId", archivesId);
+        pd.put("id", Id);
         PageData pageData = pharmaceuticalService.findArchivesList(pd).get(0);
+        Object updatePatientBasicInfo =  pharmaceuticalService.findBasicInfoById(pd);
+        if(StringUtils.isNotNull(updatePatientBasicInfo)){
+            PageData BasicpageData = (PageData) updatePatientBasicInfo;
+            mmap.putAll(BasicpageData);
+        }
         mmap.putAll(pageData);
         return prefix_archives + "/archivesEdit";
     }
+    /**
+     * 档案管理数据编辑2
+     *
+     * @return
+     * @throws Exception
+     */
+    @RequiresPermissions("dtp:pmService:edit")
+    @GetMapping("/archivesyygyList")
+    public String archivesyygyList( ModelMap mmap) throws Exception {
+        PageData pd = this.getPageData();
+        return prefix_archives + "/archivesyygyList";
+    }
+    /**
+     * 患者建档
+     *
+     * @return
+     * @throws Exception
+     */
+    @RequiresPermissions("dtp:pmService:add")
+    @GetMapping("/archivesAdd")
+    public String archivesAdd(ModelMap mmap) {
+        mmap.put("posts", 1);
+        return prefix_archives + "/archivesAdd";
+    }
+
+    /**
+     * 患者建档新增保存
+     */
+    @Log(title = "患者建档新增保存", businessType = BusinessType.INSERT)
+    @PostMapping("/archivesAdd")
+    @ResponseBody
+    public AjaxResult addSave() throws Exception {
+        PageData pd = new PageData();
+        pd = this.getPageData();
+       String dateBirth= pd.get("dateBirth").toString();
+       if(!dateBirth.isEmpty()){
+          Integer age = ServletUtils.calculateAge(dateBirth);//根据出生日期字符串计算年龄
+           pd.put("age",age);
+       }
+
+        if (!pharmaceuticalService.checkPatientIsExist(pd))
+        {
+            return error("患者建档新增保存: '" + pd.getString("name") +"+"+ pd.getString("phoneNumber")+"'失败,患者姓名或电话已存在");
+        }
+        Integer integer = pharmaceuticalService.addArchives(pd);
+        return toAjax(integer);
+    }
+
 
     /**
      * 保存档案管理数据修改
@@ -111,7 +167,12 @@ public class PharmaceuticalServiceController extends BaseController {
         PageData pd = this.getPageData();
         pd.put("up", "up");
         try {
+            if(!pd.get("insuranceValue").toString().isEmpty()){
+                String insuranceValue=   pd.get("insuranceValue").toString();
+                pd.put("insurance",insuranceValue);
+            }
             Integer updateResult = pharmaceuticalService.updateArchives(pd);
+
             if (updateResult == 1) {
                 // 成功更新
                 return AjaxResult.success("修改成功");

+ 110 - 1
health-admin/src/main/resources/static/health/js/common.js

@@ -614,4 +614,113 @@ $.ajaxSetup({
             $.modal.closeLoading();
         }
     }
-});
+}
+);
+// 验证身份证号码的函数
+function validateIDCard(idCard) {
+    // 检查身份证号码长度
+    if (idCard.length !== 18) {
+        return false;
+    }
+
+    // 地址码、出生日期码、顺序码
+    var addressCode = idCard.substring(0, 6);
+    var birthDateCode = idCard.substring(6, 14);
+    var orderCode = idCard.substring(14, 17);
+    var checkCode = idCard.charAt(17).toUpperCase();
+
+    // 验证地址码是否合法(此处简化处理)
+    if (!isValidAddressCode(addressCode)) {
+        return false;
+    }
+
+    // 验证出生日期码是否合法
+    if (!isValidBirthDate(birthDateCode)) {
+        return false;
+    }
+
+    // 验证顺序码是否合法
+    if (orderCode % 2 === 0 && idCard.charAt(16) === '9') {
+        return false; // 顺序码为偶数时,第17位不能是9
+    }
+
+    // 校验码计算
+    var checkSum = 0;
+    var weightFactors = [7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2];
+    var checkCodeVerifiers = "10X98765432";
+
+    for (var i = 0; i < 17; i++) {
+        checkSum += parseInt(idCard.charAt(i), 10) * weightFactors[i];
+    }
+
+    var mod = checkSum % 11;
+    var expectedCheckCode = checkCodeVerifiers.charAt(mod);
+
+    return expectedCheckCode === checkCode;
+}
+
+// 验证地址码是否合法(简化处理)
+function isValidAddressCode(addressCode) {
+    // 这里可以添加具体的地址码验证逻辑
+    // 返回true表示合法,false表示非法
+    return true;
+}
+
+// 验证出生日期码是否合法
+function isValidBirthDate(birthDateCode) {
+    var year = birthDateCode.substring(0, 4);
+    var month = birthDateCode.substring(4, 6);
+    var day = birthDateCode.substring(6, 8);
+
+    if (isNaN(year) || isNaN(month) || isNaN(day)) {
+        return false;
+    }
+
+    var d = new Date(year, month - 1, day);
+    return d.getFullYear() == year &&
+        d.getMonth() + 1 == month &&
+        d.getDate() == day;
+}
+//根据"YYYY-MM-DD"日期格式计算年龄
+function calculateAge(birthDateString) {
+    const currentDate = new Date();
+    const birthDate = new Date(birthDateString);
+
+    if (isNaN(birthDate.getTime())) {
+        throw new Error("Invalid birth date string");
+    }
+
+    let age = currentDate.getFullYear() - birthDate.getFullYear();
+    const monthDifference = currentDate.getMonth() - birthDate.getMonth();
+
+    if (monthDifference < 0 || (monthDifference === 0 && currentDate.getDate() < birthDate.getDate())) {
+        age--;
+    }
+
+    return age;
+}
+
+//校验输入小数点
+function limitDecimalPlaces(input, decimalPlaces) {
+    var regex = new RegExp(`^-?\\d*(?:\\\\.[\\d]{1,${decimalPlaces}})?`);
+    input.value = input.value.replace(regex, '');
+    document.getElementById('displayValue').textContent = input.value;
+}
+
+
+
+// 定义一个计算BMI的函数
+function calculateBMI(heightInCm, weightInKg) {
+    if (weightInKg <= 0 || heightInCm <= 0) {
+        throw new Error('体重和身高必须大于0');
+    }
+    // 将身高从厘米转换为米
+    var heightInM = heightInCm / 100;
+
+    // 计算BMI
+    var bmi = weightInKg / (heightInM * heightInM);
+
+    return bmi;
+}
+
+

+ 109 - 0
health-admin/src/main/resources/templates/dtp/archives/archivesAdd.html

@@ -0,0 +1,109 @@
+<!DOCTYPE html>
+<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
+<head>
+    <th:block th:include="include :: header('新建档案')" />
+</head>
+<style>
+
+</style>
+<script>
+
+</script>
+<body>
+<div class="wrapper wrapper-content animated fadeInRight ibox-content">
+    <form id="form-server-add" class="customize-search-form">
+        <div class="customize-form-group-container">
+            <div class="customize-form-group">
+                <label class="col-sm-1 control-label">姓名:</label>
+                <input name="name" placeholder="请输入姓名" class="styled-input" type="text" maxlength="30" required>
+            </div>
+            <div class="customize-form-group">
+                <label class="col-sm-1 control-label">性别:</label>
+                <select name="gender" class="styled-input" th:with="type=${@dict.getType('sys_user_sex')}" required>
+                    <!--<option>所有</option>-->
+                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"
+                    ></option>
+                </select>
+            </div>
+            <div class="customize-form-group select-time">
+                <label class="col-sm-1 control-label">出生年月:</label>
+                <div class="input-group select-time">
+                    <input name="dateBirth" placeholder="出生年月" class="time-input time-input2" type="text" required>
+                </div>
+            </div>
+            <div class="customize-form-group">
+                <label class="col-sm-1 control-label">手机号:</label>
+                <input name="phoneNumber" placeholder="请输入手机号" class="styled-input isPhone" type="text" maxlength="11"  required>
+            </div>
+            <div class="customize-form-group">
+            <label class="col-sm-1 control-label">证件类型:</label>
+            <select name="documentType" id="documentType"  class="styled-input" th:with="type=${@dict.getType('sys_select_dtp_ysfw_zjlx')}" required>
+                <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictLabel}"
+                ></option>
+            </select>
+            </div>
+            <div class="customize-form-group">
+                <label class="col-sm-1 control-label">证件号码:</label>
+                <input name="documentNumber" id="documentNumber" placeholder="请输入证件号码" class="styled-input" type="text" maxlength="30"  required>
+            </div>
+            <div class="customize-form-group">
+                <label class="col-sm-1 control-label">联系人与患者关系:</label>
+                <select name="contactRelation" class="styled-input" th:with="type=${@dict.getType('sys_select_dtp_ysfw_lxryhzgx')}">
+                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"
+                    ></option>
+                </select>
+            </div>
+            <div class="customize-form-group">
+                <label class="col-sm-1 control-label">联系人姓名:</label>
+                <input name="contactName" placeholder="请输入联系人姓名" class="styled-input" type="text" maxlength="30"  required>
+            </div>
+            <div class="customize-form-group">
+                <label class="col-sm-1 control-label">联系人手机号:</label>
+                <input name="contactPhone" placeholder="请输入联系人手机号" class="styled-input isPhone" type="text" maxlength="11"  required>
+            </div>
+        </div>
+    </form>
+</div>
+	<th:block th:include="include :: footer" />
+<script th:src="@{/health/js/input-styles.js?v=4.7.9}"></script>
+</body>
+</html>
+
+<script>
+    // 示例使用
+    function submitHandler() {
+        var prefix = ctx + "dtp/pmService";
+        if ($.validate.form()) {
+            debugger
+            var documentType= $("#documentType").val()
+            if(documentType=="居民身份证") {
+               var IDCard= $("#documentNumber").val()
+                console.log(validateIDCard(IDCard)); // 假设这个身份证号码是有效的
+                if (validateIDCard(IDCard)==false) {
+                    $.modal.alert("身份证号码格式不正确,请重新输入!")
+                    return false
+                }
+            }
+            add();
+        }
+    }
+
+    function add() {
+        var data = $("#form-server-add").serializeArray();
+        $.ajax({
+            cache : true,
+            type : "POST",
+            url : ctx + "dtp/pmService/archivesAdd",
+            data : data,
+            async : false,
+            error : function(request) {
+                $.modal.alertError("系统错误");
+            },
+            success : function(data) {
+                $.operate.successCallback(data);
+            }
+        });
+    }
+
+
+</script>

+ 1754 - 216
health-admin/src/main/resources/templates/dtp/archives/archivesEdit.html

@@ -11,236 +11,1774 @@
 </script>
 <body>
     <div class="ui-layout-center">
-        <form class="form-horizontal" id="form-server-edit" th:object="${user}">
-            <h4 class="form-header h4">基本信息</h4>
-            <input type="hidden" id="id" name="id" th:value="${id}">
-            <div class="row">
+            <h4 class="form-header h4">档案详情</h4>
                 <div class="col-sm-12">
-                    <div class="form-group">
-                        <!--is-required 增加星号 显示为必填-->
-                        <label class="col-sm-1 control-label">姓名:</label>
-                        <div class="col-sm-2" >
-                            <div class="input-group">
-                                <input name="name" placeholder="请输入姓名" class="styled-input" type="text" maxlength="30" th:value="${name}" required>
-                            </div>
-                        </div>
-                        <label class="col-sm-1 control-label">性别:</label>
-                        <div class="col-sm-2" >
-                            <div class="input-group">
-                                <select name="sex" class="styled-input" th:with="type=${@dict.getType('sys_user_sex')}" >
-                                    <!--<option>所有</option>-->
-                                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"
-                                            th:selected="${dict.dictLabel} == ${gender}" ></option>
-                                </select>
-                                <!--<input name="gender" placeholder="请输入性别" class="styled-input" type="text" maxlength="30" th:value="${gender}" required>-->
-                            </div>
-                        </div>
-                        <label class="col-sm-1 control-label">年龄:</label>
-                        <div class="col-sm-2" >
-                            <div class="input-group">
-                                <input name="age" placeholder="请输入年龄" class="styled-input" type="text" maxlength="30" th:value="${age}" required>
-                            </div>
-                        </div>
-                        <label class="col-sm-1 control-label">手机号:</label>
-                        <div class="col-sm-2" >
-                            <div class="input-group">
-                                <input name="phoneNumber" placeholder="请输入手机号" class="styled-input" type="text" maxlength="30" th:value="${phoneNumber}" required>
-                            </div>
-                        </div>
-                    </div>
-                </div>
-                <div class="col-sm-12">
-                    <div class="form-group">
-                        <!--is-required 增加星号 显示为必填-->
-                        <label class="col-sm-1 control-label">证件类型:</label>
-                        <div class="col-sm-2" >
-                            <div class="input-group">
-                                <input name="documentType" placeholder="请输入证件类型" class="styled-input" type="text" maxlength="30" th:value="${documentType}" required>
-                            </div>
-                        </div>
-                        <label class="col-sm-1 control-label">证件号码:</label>
-                        <div class="col-sm-2" >
-                            <div class="input-group">
-                                <input name="documentNumber" placeholder="请输入证件号码" class="styled-input" type="text" maxlength="30" th:value="${documentNumber}" required>
-                            </div>
-                        </div>
-                        <label class="col-sm-1 control-label">实名状态:</label>
-                        <div class="col-sm-2" >
-                            <div class="input-group">
-                                <select name="realNameStatus" class="styled-input" th:with="type=${@dict.getType('sys_real_yes_no')}">
-                                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"
-                                            th:selected="${dict.dictLabel}==${realNameStatus}"></option>
-                                </select>
-                                <!--<input name="realNameStatus" placeholder="实名状态" class="styled-input" type="text" maxlength="30" th:value="${realNameStatus}" required>-->
-                            </div>
-                        </div>
-                        <label class="col-sm-1 control-label">上翻状态:</label>
-                        <div class="col-sm-2" >
-                            <div class="input-group">
-                                <select name="flipStatus" class="styled-input" th:with="type=${@dict.getType('sys_up_yes_no')}" >
-                                    <!--<option>所有</option>-->
-                                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"
-                                            th:selected="${dict.dictLabel} == ${flipStatus}" ></option>
-                                </select>
-                            </div>
-                        </div>
-                    </div>
-                </div>
-                <div class="col-sm-12">
-                    <div class="form-group">
-                        <!--is-required 增加星号 显示为必填-->
-                        <label class="col-sm-1 control-label">疾病:</label>
-                        <div class="col-sm-2" >
-                            <div class="input-group">
-                                <input name="disease" placeholder="请输入疾病" class="styled-input" type="text" maxlength="30" th:value="${disease}" required>
-                            </div>
-                        </div>
-                        <label class="col-sm-1 control-label">药品通用名:</label>
-                        <div class="col-sm-2" >
-                            <div class="input-group">
-                                <input name="genericName" placeholder="请输入药品通用名" class="styled-input" type="text" maxlength="30" th:value="${genericName}" required>
-                            </div>
-                        </div>
-                        <label class="col-sm-1 control-label">商品名:</label>
-                        <div class="col-sm-2" >
-                            <div class="input-group">
-                                <input name="productName" placeholder="请输入商品名" class="styled-input" type="text" maxlength="30" th:value="${productName}" required>
-                            </div>
-                        </div>
-                        <label class="col-sm-1 control-label">MDM编码:</label>
-                        <div class="col-sm-2" >
-                            <div class="input-group">
-                                <input name="mdmCode" placeholder="MDM编码" class="styled-input" type="text" maxlength="30" th:value="${mdmCode}" required>
-                            </div>
-                        </div>
-                    </div>
-                </div>
+                    <div class="tabs-container">
+                        <ul class="nav nav-tabs" id="myTabs3">
+                            <li class="active"><a data-toggle="tab" href="#tab-1" aria-expanded="true"> 基本信息</a>
+                            </li>
+                            <li class=""><a data-toggle="tab" href="#tab-2" aria-expanded="false">首患建档</a>
+                            </li>
+                            <li class=""><a data-toggle="tab" href="#tab-3" aria-expanded="false" > 用药购药</a>
+                            </li>
+                            <li class=""><a data-toggle="tab" href="#tab-4" aria-expanded="false">随访计划</a>
+                            </li>
+                            <li class=""><a data-toggle="tab" href="#tab-5" aria-expanded="false">任务跟进</a>
+                            </li>
+                        </ul>
+                        <div class="tab-content">
+                            <!-- 需要隐藏的div -->
+                            <div id="tab-1" class="tab-pane active">
+                                <form class="form-horizontal" id="form-server-edit1" >
+                                    <input type="hidden" id="id" name="id" th:value="${id}">
+                                <div class="row">
+                                 <div class="col-sm-12">
+                                           <div class="form-group">
+                                            <!--is-required 增加星号 显示为必填-->
+                                            <label class="col-sm-2 control-label is-required">姓名:</label>
+                                            <div class="col-sm-5" >
+                                                <div class="input-group">
+                                                    <input name="name" placeholder="请输入姓名" class="styled-input"  style="width: 400px;" type="text" maxlength="30" th:value="${name}" disabled="true">
+                                                    &nbsp; <i class="fa" th:class="${realNameStatus == 1 ? 'fa fa-check' : 'fa fa-close'}" id="checkName"  ></i>
+                                                    <input name="realNameStatus" id="realNameStatus" style="width: 50px; border: none" type="text"   th:value="${realNameStatus == 1 ? '已实名' : (realNameStatus == 0 ? '未实名' : '')}" readonly>
+                                                </div>
+                                            </div>
+                                            <label class="col-sm-1 control-label">性别:</label>
+                                            <div class="col-sm-4" >
+                                                <div class="input-group">
+                                                    <select name="gender" class="styled-input" th:with="type=${@dict.getType('sys_user_sex')}" style="width: 400px;" disabled="true">
+                                                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"
+                                                                th:selected="${dict.dictLabel} == ${gender}" ></option>
+                                                    </select>
+                                                </div>
+                                            </div>
+                                           </div>
+                                  </div>
+                                </div>
+                                <div class="row">
+                                    <div class="col-sm-12">
+                                        <div class="form-group">
+                                            <label class="col-sm-2 control-label">出生年月:</label>
+                                            <div class="col-sm-4" >
+                                            <div class="input-group">
+                                                <input name="dateBirth" id="dateBirth" placeholder="出生年月" class="styled-input" style="width: 400px;" type="text"    th:value="${dateBirth}" disabled="true">&nbsp;
+                                                <label> <input  name="age"  id="age" th:value="${age}" style="width: 20px;border: none">岁</label>
+                                            </div>
+                                            </div>
+                                            <label class="col-sm-2 control-label is-required">手机号:</label>
+                                            <div class="col-sm-4" >
+                                                <div class="input-group">
+                                                    <input name="phoneNumber" placeholder="请输入手机号" class="styled-input isPhone" style="width: 400px;" type="text" maxlength="30" th:value="${phoneNumber}" required>
+                                                </div>
+                                            </div>
 
-                <div class="col-sm-12">
-                    <div class="form-group">
-                        <!--is-required 增加星号 显示为必填-->
-                        <label class="col-sm-1 control-label">厂家:</label>
-                        <div class="col-sm-2" >
-                            <div class="input-group">
-                                <input name="manufacturer" placeholder="请输入厂家" class="styled-input" type="text" maxlength="30" th:value="${manufacturer}" required>
-                            </div>
-                        </div>
-                        <label class="col-sm-1 control-label">门店:</label>
-                        <div class="col-sm-2" >
-                            <div class="input-group">
-                                <input name="storeName" placeholder="请输入门店" class="styled-input" type="text" maxlength="30" th:value="${storeName}" required>
-                            </div>
-                        </div>
-                        <label class="col-sm-1 control-label">档案创建人:</label>
-                        <div class="col-sm-2" >
-                            <div class="input-group">
-                                <input name="archiveCreator" placeholder="档案创建人" class="styled-input" type="text" maxlength="30" th:value="${archiveCreator}" required>
-                            </div>
-                        </div>
-                        <label class="col-sm-1 control-label">档案完善人:</label>
-                        <div class="col-sm-2" >
-                            <div class="input-group">
-                                <input name="archiveCompleter" placeholder="档案完善人" class="styled-input" type="text" maxlength="30" th:value="${archiveCompleter}" required>
-                            </div>
-                        </div>
-                    </div>
-                </div>
-                <div class="col-sm-12">
-                    <div class="form-group">
-                        <!--is-required 增加星号 显示为必填-->
-                        <label class="col-sm-1 control-label">是否接受随访:</label>
-                        <div class="col-sm-2" >
-                            <div class="input-group">
-                                <select name="acceptFollowUp" class="styled-input" th:with="type=${@dict.getType('sys_select_yes_no')}">
-                                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"
-                                            th:selected="${dict.dictLabel}==${acceptFollowUp}"></option>
-                                </select>
-                                <!--<input name="acceptFollowUp" placeholder="是否接受随访" class="styled-input" type="text" maxlength="30" th:value="${acceptFollowUp}" required>-->
-                            </div>
-                        </div>
-                        <label class="col-sm-1 control-label">随访跟进人:</label>
-                        <div class="col-sm-2" >
-                            <div class="input-group">
-                                <input name="followUpPerson" placeholder="随访跟进人" class="styled-input" type="text" maxlength="30" th:value="${followUpPerson}" required>
-                            </div>
-                        </div>
-                        <label class="col-sm-1 control-label">档案是否完善:</label>
-                        <div class="col-sm-2" >
-                            <div class="input-group">
-                                <select name="archiveCompleteStatus" class="styled-input" th:with="type=${@dict.getType('sys_doc_yes_no')}">
-                                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"
-                                            th:selected="${dict.dictLabel}==${archiveCompleteStatus}"></option>
-                                </select>
-                                <!--<input name="archiveCompleteStatus" placeholder="档案是否完善" class="styled-input" type="text" maxlength="30" th:value="${archiveCompleteStatus}" required>-->
-                            </div>
-                        </div>
-                        <label class="col-sm-1 control-label">有无慈善援助:</label>
-                        <div class="col-sm-2" >
-                            <div class="input-group">
-                                <select name="charityAssistance" class="styled-input" th:with="type=${@dict.getType('sys_salvation_yes_no')}">
-                                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"
-                                            th:selected="${dict.dictLabel}==${charityAssistance}"></option>
-                                </select>
-                            </div>
+                                        </div>
+                                    </div>
+                                </div>
+
+                                <div class="row">
+                                    <div class="col-sm-12">
+                                        <div class="form-group">
+                                            <label class="col-sm-2 control-label">证件号码:</label>
+                                           <div class="col-sm-4" >
+                                                <div class="input-group">
+                                                 <input name="documentType" placeholder="证件类型" class="styled-input" style="width: 120px;" type="text"  th:value="${documentType}" disabled="true">
+                                                <input name="documentNumber" placeholder="请输入证件号码" class="styled-input" style="width: 280px;" type="text" maxlength="30" th:value="${documentNumber}" disabled="true">
+                                            </div>
+                                          </div>
+
+                                            <label class="col-sm-2 control-label">社保卡号:</label>
+                                            <div class="col-sm-4" >
+                                                <div class="input-group">
+                                                    <input name="socialSecurityCard" placeholder="社保卡号" class="styled-input" style="width: 400px;" type="text"   th:value="${socialSecurityCard}">
+                                                </div>
+                                            </div>
+
+                                        </div>
+                                    </div>
+                                </div>
+                                <div class="row">
+                                    <div class="col-sm-12">
+                                        <div class="form-group">
+                                            <label class="col-sm-2 control-label">身高:</label>
+                                            <div class="col-sm-4" >
+                                                <div class="input-group">
+                                            <input name="height" id="height" placeholder="请输入身高" class="styled-input" style="width: 400px;" type="number"  th:value="${height}">&nbsp; cm
+                                                </div>
+                                            </div>
+                                            <label class="col-sm-2 control-label">体重:</label>
+                                            <div class="col-sm-4" >
+                                                <div class="input-group">
+                                             <input name="weight" id="weight" placeholder="请输入体重" class="styled-input" style="width: 400px;" type="number"  th:value="${weight}">&nbsp; kg
+                                                </div>
+                                            </div>
+
+
+                                        </div>
+                                    </div>
+                                </div>
+
+                                <div class="row">
+                                    <div class="col-sm-12">
+                                        <div class="form-group">
+                                            <label class="col-sm-2 control-label">BMI:</label>
+                                            <div class="col-sm-4" >
+                                                <div class="input-group">
+                                                    <input name="BMI" id="BMI" placeholder="BMI值" class="styled-input" style="width: 400px;" type="text"  th:value="${BMI}" readonly>
+                                                </div>
+                                            </div>
+                                            <label class="col-sm-2 control-label">民族:</label>
+                                            <div class="col-sm-4" >
+                                                <div class="input-group">
+                                                    <select name="nation" class="styled-input" th:with="type=${@dict.getType('sys_select_dtp_ysfw_mz')}" style="width: 400px;">
+                                                        <option value="">请选择</option>
+                                                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"
+                                                                th:selected="${dict.dictLabel}==${nation}"></option>
+                                                    </select>
+                                                </div>
+                                            </div>
+
+
+                                        </div>
+                                    </div>
+                                </div>
+                                <div class="row">
+                                    <div class="col-sm-12">
+                                        <div class="form-group">
+                                            <!--is-required 增加星号 显示为必填-->
+                                            <label class="col-sm-2 control-label">籍贯:</label>
+                                            <div class="col-sm-4" >
+                                                <div class="input-group">
+                                                    <select name="nativePlace" class="styled-input" th:with="type=${@dict.getType('sys_select_dtp_ysfw_jg')}" style="width: 400px;">
+                                                        <option value="">请选择</option>
+                                                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"
+                                                                th:selected="${dict.dictLabel}==${nativePlace}"></option>
+                                                    </select>
+                                                </div>
+                                            </div>
+                                            <label class="col-sm-2 control-label">座机号码:</label>
+                                            <div class="col-sm-4" >
+                                                <div class="input-group">
+                                                    <input name="landlineNumber" placeholder="请输入座机号码" class="styled-input" style="width: 400px;" type="text" maxlength="30" th:value="${landlineNumber}">
+                                                </div>
+                                            </div>
+                                        </div>
+                                    </div>
+                                </div>
+
+                                <div class="row">
+                                    <div class="col-sm-12">
+                                        <div class="form-group">
+                                            <label class="col-sm-2 control-label is-required">慢病肿瘤类型:</label>
+                                            <div class="col-sm-4" >
+                                                <div class="input-group">
+                                                <select name="chronicTumorType" class="styled-input" th:with="type=${@dict.getType('sys_select_dtp_ysfw_mbzllx')}" style="width: 400px;" required>
+                                                    <option value="">请选择</option>
+                                                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"
+                                                            th:selected="${dict.dictLabel}==${chronicTumorType}"></option>
+                                                </select>
+                                                </div>
+                                            </div>
+                                            <label class="col-sm-2 control-label">首次确诊时间:</label>
+                                            <div class="col-sm-4" >
+                                                <div class="input-group select-time">
+                                                    <input name="timeFirstDiagnosis" placeholder="首次确诊时间" class="time-input-new styled-input"  style="width: 400px;" type="text"  th:value="${timeFirstDiagnosis}">
+                                                </div>
+                                            </div>
+
+
+                                        </div>
+                                    </div>
+                                </div>
+
+                                <div class="row">
+                                    <div class="col-sm-12">
+                                        <div class="form-group">
+
+                                            <label class="col-sm-2 control-label is-required">疾病类型:</label>
+                                            <div class="col-sm-4" >
+                                                <div class="input-group">
+                                                    <select name="diseaseType" class="styled-input" th:with="type=${@dict.getType('sys_select_dtp_ysfw_jblx')}" style="width: 400px;" required>
+                                                        <option value="">请选择</option>
+                                                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictLabel}"
+                                                                th:selected="${dict.dictLabel}==${diseaseType}"></option>
+                                                    </select>
+                                                </div>
+                                            </div>
+                                            <label class="col-sm-2 control-label">治疗线收集:</label>
+                                            <div class="col-sm-4" >
+                                                <div class="input-group">
+                                                    <div class="input-group" th:with="type=${@dict.getType('sys_select_dtp_ysfw_zlxsj')}">
+                                                        <label class="checkbox-inline check-box" th:each="dict : ${type}"  >
+                                                            <input type="radio"  th:text="${dict.dictLabel}" th:value="${dict.dictLabel}" th:checked="${dict.dictLabel}==${healingLineCollection}"  name="healingLineCollection"></label>
+                                                    </div>
+                                                </div>
+                                            </div>
+                                        </div>
+                                    </div>
+                                </div>
+                                <div class="row">
+                                    <div class="col-sm-12">
+                                        <div class="form-group">
+                                            <label class="col-sm-2 control-label">保险:</label>
+                                            <div class="selected-values" id="selected-values" style="display: none;"></div>
+                                            <div class="col-sm-4">
+                                                <div class="input-group">
+                                                    <select name="insurance" id="insurance" class="noselect2 selectpicker" style="width :400px" multiple  data-none-selected-text="请选择" th:with="type=${@dict.getType('sys_select_dtp_ysfw_bxlx')}">
+                                                        <option style="width :400px" th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictLabel}"
+                                                                th:selected="${dict.dictLabel}==${insurance}"></option>
+                                                    </select>
+                                                    <input type="hidden" id="insuranceValue" name="insuranceValue" value="">
+                                                </div>
+                                            </div>
+                                            <label class="col-sm-2 control-label">临床诊断:</label>
+                                            <div class="col-sm-4" >
+                                                <div class="input-group">
+                                                    <input name="disease" placeholder="请输入临床诊断信息" class="styled-input" style="width: 400px;" type="text"  th:value="${disease}">
+                                                </div>
+                                            </div>
+                                        </div>
+                                    </div>
+                                </div>
+
+                                <div class="row">
+                                    <div class="col-sm-12">
+                                        <div class="form-group">
+
+                                            <label class="col-sm-2 control-label">上翻状态:</label>
+                                            <div class="col-sm-4" >
+
+                                                <input name="flipStatus"  id="flipStatus" style="width: 50px; border: none" type="text"
+                                                       th:value="${flipStatus == 1 ? '已上翻' : (flipStatus == 2 ? '未上翻' : '')}" readonly>
+                                               <a href="#" onclick="">&nbsp;&nbsp;解绑</a>
+                                        </div>
+                                        </div>
+                                    </div>
+                                </div>
+                                </form>
                         </div>
-                    </div>
+                            <div id="tab-2" class="tab-pane">
+                             <form class="form-horizontal" id="form-server-edit">
+                                    <input type="hidden" id="id2" name="id" th:value="${id}">
+                                 <input type="hidden" id="basicInformation" name="basicInformation" value="true">
+                                <div class="panel-body">
+                                <ul class="nav nav-tabs" id="myTabs">
+                                    <li class="active"><a data-toggle="tab" href="#tab-21" aria-expanded="true"> 基础信息</a>
+                                    </li>
+                                    <li class=""><a data-toggle="tab" href="#tab-22" aria-expanded="false">疾病相关</a>
+                                    </li>
+                                    <li class=""><a data-toggle="tab" href="#tab-23" aria-expanded="false"> 基因免疫检测</a>
+                                    </li>
+                                    <li class=""><a data-toggle="tab" href="#tab-24" aria-expanded="false">患病史</a>
+                                    </li>
+                                    <li class=""><a data-toggle="tab" href="#tab-25" aria-expanded="false">治疗手段</a>
+                                    </li>
+                                    <li class=""><a data-toggle="tab" href="#tab-26" aria-expanded="false">用药情况</a>
+                                    </li>
+                                    <li class=""><a data-toggle="tab" href="#tab-27" aria-expanded="false">其他信息</a>
+                                    </li>
+                                </ul>
+                                </div>
+                                <div id="tab-21" class="tab-pane  fade in active">
+                                    <div class="panel-body">
+                                        <strong>基础信息</strong>
+                                        <div class="form-group">
+                                            <!--is-required 增加星号 显示为必填-->
+                                            <div class="col-sm-12">
+                                                <div class="form-group">
+                                                    <label class="col-sm-1 control-label">身高:</label>
+                                                    <div class="col-sm-3" >
+                                                        <div class="input-group">
+                                                            <input name="height" id="heighth" placeholder="请输入身高" class="styled-input" style="width: 290px;" type="number"  th:value="${height}">&nbsp; cm
+                                                        </div>
+                                                    </div>
+                                                    <label class="col-sm-1 control-label">体重:</label>
+                                                    <div class="col-sm-3" >
+                                                        <div class="input-group">
+                                                            <input name="weight" id="weightw" placeholder="请输入体重" class="styled-input" style="width: 290px;" type="number"  th:value="${weight}">&nbsp; kg
+                                                        </div>
+                                                    </div>
+
+                                                    <label class="col-sm-1 control-label">BMI:</label>
+                                                    <div class="col-sm-3" >
+                                                        <div class="input-group">
+                                                            <input name="BMI" id="BMI2" placeholder="" class="styled-input" style="width: 290px;" type="text"  th:value="${BMI}" readonly>
+                                                        </div>
+                                                    </div>
+                                                </div>
+                                            </div>
+                                         <div class="col-sm-12">
+                                             <label class="col-sm-1 control-label is-required">保险:</label>
+                                             <div class="col-sm-9" >
+                                                 <div class="form-group">
+                                                     <div class="input-group" th:with="type=${@dict.getType('sys_select_dtp_ysfw_bxlx')}">
+
+                                                         <label class="checkbox-inline check-box" th:each="dict : ${type}"  >
+                                                             <input type="checkbox"     th:text="${dict.dictLabel}" th:value="${dict.dictLabel}"   name="insurance2" id="insurance2">
+                                                         </label>
+                                                         <input type="hidden" id="insuranceValue2" name="insuranceValue">
+                                                     </div>
+                                                 </div>
+                                                 <div class="error-message" id="insurance-error">请选择至少一项保险</div>
+                                             </div>
+
+                                         </div>
+                                        <div class="col-sm-12">
+                                            <label class="col-sm-1 control-label">经济状况:</label>
+                                            <div class="col-sm-3" >
+                                                <div class="input-group">
+                                                    <div class="input-group" th:with="type=${@dict.getType('sys_select_dtp_ysfw_mqjjzt')}">
+                                                        <label class="checkbox-inline check-box" th:each="dict : ${type}"  >
+                                                            <input type="radio"  th:text="${dict.dictLabel}" th:value="${dict.dictLabel}"   th:checked="${dict.dictLabel}==${currentEconomicSituation}" name="currentEconomicSituation" ></label>
+                                                    </div>
+                                                </div>
+                                            </div>
+                                                <label class="col-sm-3 control-label is-required">患者是否知情:</label>
+                                                <div class="col-sm-3" >
+                                                    <div class="input-group">
+                                                        <select name="patientAwareness" class="styled-input" th:with="type=${@dict.getType('sys_yes_no')}" style="width: 300px;" required>
+                                                            <option value="">请选择</option>
+                                                            <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictLabel}"
+                                                                    th:selected="${dict.dictLabel}==${patientAwareness}"></option>
+                                                        </select>
+                                                    </div>
+                                                </div>
+                                        </div>
+                                            <div class="col-sm-12">
+                                                &nbsp;
+                                            </div>
+                                        <div class="col-sm-12">
+                                                <label class="col-sm-1 control-label">是否反馈医生:</label>
+                                                <div class="col-sm-3" >
+                                                    <div class="input-group">
+
+                                                        <div class="input-group" th:with="type=${@dict.getType('sys_yes_no')}">
+                                                            <label class="checkbox-inline check-box" th:each="dict : ${type}"  >
+                                                                <input type="radio"  th:text="${dict.dictLabel}" th:value="${dict.dictLabel}"  th:checked="${dict.dictLabel}==${followUpFeedbackDoctor}"  name="followUpFeedbackDoctor" ></label>
+                                                        </div>
+                                                    </div>
+                                                </div>
+                                                <label class="col-sm-1 control-label">心率:</label>
+                                                <div class="col-sm-3" >
+                                                    <div class="input-group">
+                                                        <select name="heartRate" class="styled-input" th:with="type=${@dict.getType('sys_yes_no')}" style="width: 300px;">
+                                                            <option value="">请选择</option>
+                                                            <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictLabel}"
+                                                                    th:selected="${dict.dictLabel}==${heartRate}"></option>
+                                                        </select>
+                                                    </div>
+                                                </div>
+                                                <label class="col-sm-1 control-label">血压:</label>
+                                                <div class="col-sm-3" >
+                                                    <div class="input-group">
+                                                        <select name="bloodPressureStatus" class="styled-input" th:with="type=${@dict.getType('sys_yes_no')}" style="width: 300px;">
+                                                            <option value="">请选择</option>
+                                                            <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictLabel}"
+                                                                    th:selected="${dict.dictLabel}==${bloodPressureStatus}"></option>
+                                                        </select>
+                                                    </div>
+                                                </div>
+                                         </div>
+                                            <div class="col-sm-12">
+                                                &nbsp;
+                                            </div>
+                                            <div class="col-sm-12">
+                                                <label class="col-sm-1 control-label">吸烟史:</label>
+                                                <div class="col-sm-3" >
+                                                    <div class="input-group">
+                                                        <div class="input-group" th:with="type=${@dict.getType('sys_yes_no')}">
+                                                            <label class="checkbox-inline check-box" th:each="dict : ${type}"  >
+                                                                <input type="radio"  th:text="${dict.dictLabel}" th:value="${dict.dictLabel}"  th:checked="${dict.dictLabel}==${smokingHistory}" name="smokingHistory" ></label>
+                                                        </div>
+                                                    </div>
+                                                </div>
+                                                <label class="col-sm-1 control-label">饮酒史:</label>
+                                                <div class="col-sm-3" >
+                                                    <div class="input-group">
+                                                        <div class="input-group" th:with="type=${@dict.getType('sys_yes_no')}">
+                                                            <label class="checkbox-inline check-box" th:each="dict : ${type}"  >
+                                                                <input type="radio"  th:text="${dict.dictLabel}" th:value="${dict.dictLabel}" th:checked="${dict.dictLabel}==${drinkingHistory}"   name="drinkingHistory" ></label>
+                                                        </div>
+                                                    </div>
+                                                </div>
+                                                <label class="col-sm-1 control-label">运动习惯:</label>
+                                                <div class="col-sm-3" >
+                                                    <div class="input-group">
+                                                        <div class="input-group" th:with="type=${@dict.getType('sys_yes_no')}">
+                                                            <label class="checkbox-inline check-box" th:each="dict : ${type}"  >
+                                                                <input type="radio"  th:text="${dict.dictLabel}" th:value="${dict.dictLabel}" th:checked="${dict.dictLabel}==${exerciseHabit}"  name="exerciseHabit" ></label>
+                                                        </div>
+                                                    </div>
+                                                </div>
+                                         </div>
+                                            <div class="col-sm-12">
+                                                &nbsp;
+                                            </div>
+                                            <div class="col-sm-12">
+                                                &nbsp;
+                                            </div>
+                                         <div class="col-sm-12">
+                                                <label class="col-sm-1 control-label">饮食偏好:</label>
+                                                <div class="col-sm-4" >
+                                                    <div class="input-group" th:with="type=${@dict.getType('sys_select_dtp_ysfw_bxlx')}">
+                                                        <label class="checkbox-inline check-box" th:each="dict : ${type}"  >
+                                                            <input type="checkbox"  th:text="${dict.dictLabel}" th:value="${dict.dictValue}"  th:checked="${dict.dictLabel}==${dietaryPreference}"  name="dietaryPreference" ></label>
+                                                    </div>
+                                                </div>
+                                                <label class="col-sm-1 control-label">睡眠状况:</label>
+                                                <div class="col-sm-5" >
+                                                    <div class="input-group">
+                                                        <div class="input-group" th:with="type=${@dict.getType('sys_select_dtp_ysfw_bxlx')}">
+                                                            <label class="checkbox-inline check-box" th:each="dict : ${type}"  >
+                                                                <input type="checkbox"  th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:checked="${dict.dictLabel}==${sleepCondition}"  name="sleepCondition" ></label>
+                                                        </div>
+                                                    </div>
+                                                </div>
+                                         </div>
+                                        </div>
+                                    </div>
+                                </div>
+                                <div id="tab-22" class="tab-pane fade in active">
+                                    <div class="panel-body">
+                                        <strong>疾病相关</strong>
+                                        <div class="form-group">
+                                            <!--is-required 增加星号 显示为必填-->
+                                            <div class="col-sm-12">
+                                                <label class="col-sm-1 control-label is-required">慢病肿瘤类型:</label>
+                                                <div class="col-sm-3" >
+                                                    <div class="input-group">
+                                                        <div class="input-group" th:with="type=${@dict.getType('sys_select_dtp_ysfw_mbzllx')}">
+                                                            <label class="checkbox-inline check-box" th:each="dict : ${type}"  >
+                                                                <input type="radio"  th:text="${dict.dictLabel}" th:value="${dict.dictLabel}"  th:checked="${dict.dictLabel}==${chronicTumorType}" name="chronicTumorType" required></label>
+                                                        </div>
+                                                    </div>
+                                                </div>
+                                                <label class="col-sm-1 control-label">疾病类型肿瘤:</label>
+                                                <div class="col-sm-3" >
+                                                    <div class="input-group">
+                                                        <select name="diseaseType" class="styled-input" th:with="type=${@dict.getType('sys_select_dtp_ysfw_jblx')}" style="width: 300px;" required>
+                                                            <option value="">请选择</option>
+                                                            <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictLabel}"
+                                                                    th:selected="${dict.dictLabel}==${diseaseType}"></option>
+                                                        </select>
+                                                    </div>
+                                                </div>
+                                                <label class="col-sm-1 control-label">临床诊断:</label>
+                                                <div class="col-sm-3" >
+                                                    <div class="input-group">
+                                                        <input name="disease" placeholder="请输入临床诊断" class="styled-input" style="width: 300px;" type="text" maxlength="30" th:value="${disease}">
+                                                    </div>
+                                                </div>
+                                            </div>
+                                            <div class="col-sm-12">
+                                                &nbsp;
+                                            </div>
+                                            <div class="col-sm-12">
+                                                <label class="col-sm-1 control-label is-required">病理分期:</label>
+                                                <div class="col-sm-3" >
+                                                    <div class="input-group">
+                                                        <select name="pathologicalStage" class="styled-input" th:with="type=${@dict.getType('sys_select_dtp_ysfw_mbzllx')}" style="width: 300px;" required>
+                                                            <option value="">请选择</option>
+                                                            <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictLabel}"
+                                                                    th:selected="${dict.dictLabel}==${pathologicalStage}"></option>
+                                                        </select>
+                                                    </div>
+                                                </div>
+                                                    <label class="col-sm-1 control-label is-required">治疗分期:</label>
+                                                    <div class="col-sm-3" >
+                                                        <div class="input-group">
+                                                            <select name="treatmentStage" class="styled-input" th:with="type=${@dict.getType('sys_select_dtp_ysfw_mbzllx')}" style="width: 300px;" required>
+                                                                <option value="">请选择</option>
+                                                                <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictLabel}"
+                                                                        th:selected="${dict.dictLabel}==${treatmentStage}"></option>
+                                                            </select>
+                                                        </div>
+                                                    </div>
+                                            </div>
+                                            <div class="col-sm-12">
+                                                &nbsp;
+                                            </div>
+                                            <div class="col-sm-12">
+                                                <label class="col-sm-1 control-label is-required">治疗线收集:</label>
+                                                <div class="col-sm-5" >
+                                                    <div class="input-group">
+                                                        <div class="input-group" th:with="type=${@dict.getType('sys_select_dtp_ysfw_zlxsj')}">
+                                                            <label class="checkbox-inline check-box" th:each="dict : ${type}"  >
+                                                                <input type="radio"  th:text="${dict.dictLabel}" th:value="${dict.dictLabel}"   th:checked="${dict.dictLabel}==${healingLineCollection}" name="healingLineCollection"></label>
+                                                        </div>
+
+                                                    </div>
+                                                </div>
+                                            </div>
+                                            </div>
+                                            <div class="col-sm-12">
+                                                <label class="col-sm-1 control-label is-required">首次确诊时间:</label>
+                                                <div class="col-sm-3" >
+                                                    <div class="input-group select-time">
+                                                        <input name="timeFirstDiagnosis" placeholder="首次确诊时间" class="time-input-new styled-input" style="width: 300px;" type="text"  th:value="${timeFirstDiagnosis}" required>
+                                                    </div>
+                                                </div>
+
+                                                <label class="col-sm-1 control-label">伴随症状:</label>
+                                                <div class="col-sm-3" >
+                                                    <div class="input-group">
+                                                    <textarea id="accompanyingSymptoms" name="accompanyingSymptoms" th:text="${accompanyingSymptoms}" placeholder="伴随症状..." rows="1.9" cols="112" ></textarea>
+                                                    </div>
+                                                </div>
+
+                                            </div>
+                                        </div>
+                                    </div>
+                                <div id="tab-23" class="tab-pane fade in active">
+                                  <div class="panel-body">
+                                        <strong>基因免疫检测</strong>
+                                    <div class="row">
+                                       <div class="col-sm-12">
+                                        <label class="col-sm-2 control-label is-required">是否有基因检测:</label>
+                                        <div class="col-sm-4">
+                                            <div class="input-group">
+                                                <div class="input-group" th:with="type=${@dict.getType('sys_yes_no')}">
+                                                    <label class="checkbox-inline check-box" th:each="dict : ${type}"  >
+                                                        <input type="radio"  th:text="${dict.dictLabel}" th:value="${dict.dictLabel}"  th:checked="${dict.dictLabel}==${hasGeneticTesting}" name="hasGeneticTesting" id="hasGeneticTesting" required></label>
+                                                </div>
+                                            </div>
+                                        </div>
+                                        <label class="col-sm-2 control-label is-required">是否有免疫检测:</label>
+                                        <div class="col-sm-4" >
+                                            <div class="input-group">
+                                                <div class="input-group" th:with="type=${@dict.getType('sys_yes_no')}">
+                                                    <label class="checkbox-inline check-box" th:each="dict : ${type}"  >
+                                                        <input type="radio"  th:text="${dict.dictLabel}" th:value="${dict.dictLabel}"   th:checked="${dict.dictLabel}==${hasImmuneTesting}" name="hasImmuneTesting" id="hasImmuneTesting" required></label>
+                                                </div>
+                                            </div>
+                                        </div>
+                                     </div>
+                                 </div>
+                               </div>
                 </div>
-                <div class="col-sm-12">
-                    <div class="form-group">
-                        <!--is-required 增加星号 显示为必填-->
-                        <label class="col-sm-1 control-label">是否参加共建项目:</label>
-                        <div class="col-sm-2" >
-                            <div class="input-group">
-                                <select name="joinProject" class="styled-input" th:with="type=${@dict.getType('sys_select_yes_no')}">
-                                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"
-                                            th:selected="${dict.dictLabel}==${joinProject}"></option>
-                                </select>
-                                <!--<input name="joinProject" placeholder="是否参加共建项目" class="styled-input" type="text" maxlength="30" th:value="${joinProject}" required>-->
+                                <div id="tab-24" class="tab-pane fade in active">
+                                   <div class="panel-body">
+                                       <strong>患病史</strong>
+                                     <div class="row">
+                                       <div class="col-sm-12">
+                                            <label class="col-sm-1 control-label">疾病史:</label>
+                                            <div class="col-sm-3" >
+                                                <div class="input-group">
+                                                    <select name="medicalHistory" class="styled-input" th:with="type=${@dict.getType('sys_select_dtp_ysfw_bxlx')}" style="width: 300px;">
+                                                        <option value="">请选择</option>
+                                                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictLabel}"
+                                                                th:selected="${dict.dictLabel}==${medicalHistory}"></option>
+                                                    </select>
+
+                                                </div>
+                                           </div>
+                                           <label class="col-sm-1 control-label">疾病史描述:</label>
+                                           <div class="col-sm-3" >
+                                               <div class="input-group">
+                                                   <input name="medicalHistoryDescription" placeholder="疾病史描述" class="styled-input" style="width: 300px;" type="text"  th:value="${medicalHistoryDescription}">
+                                               </div>
+                                           </div>
+                                           <label class="col-sm-1 control-label">传染病史:</label>
+                                           <div class="col-sm-3" >
+                                               <div class="input-group">
+                                                   <select name="infectiousDiseaseHistory" class="styled-input" th:with="type=${@dict.getType('sys_select_dtp_ysfw_bxlx')}" style="width: 300px;">
+                                                       <option value="">请选择</option>
+                                                       <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictLabel}"
+                                                               th:selected="${dict.dictLabel}==${infectiousDiseaseHistory}"></option>
+                                                   </select>
+                                               </div>
+                                           </div>
+                                      </div>
+                                         <div class="col-sm-12">
+                                             &nbsp;
+                                         </div>
+                                     <div class="col-sm-12">
+                                         <label class="col-sm-1 control-label">传染病史描述:</label>
+                                         <div class="col-sm-3" >
+                                             <div class="input-group">
+                                                 <input name="infectiousDiseaseHistoryDescription" placeholder="传染病史描述" class="styled-input" style="width: 300px;" type="text"  th:value="${infectiousDiseaseHistoryDescription}">
+                                             </div>
+                                         </div>
+                                         <label class="col-sm-1 control-label">过敏史:</label>
+                                         <div class="col-sm-3" >
+                                             <div class="input-group">
+                                                  <textarea id="allergyHistory" name="allergyHistory" placeholder="这里可以输入过敏史..." rows="1.9" cols="112" th:text="${allergyHistory}"></textarea>
+                                             </div>
+                                         </div>
+                                     </div>
+                                         <div class="col-sm-12">
+                                             <label class="col-sm-1 control-label">既往药物不良反应史:</label>
+                                             <div class="col-sm-3" >
+                                                 <div class="input-group">
+                                                     <input name="pastAdverseDrugReactionHistory" placeholder="既往药物不良反应史" class="styled-input" style="width: 300px;" type="text"  th:value="${pastAdverseDrugReactionHistory}">
+                                                 </div>
+                                             </div>
+                                             <label class="col-sm-3 control-label">是否有手术外伤史:</label>
+                                             <div class="col-sm-4" >
+                                                 <div class="input-group">
+                                                     <div class="input-group" th:with="type=${@dict.getType('sys_yes_no')}">
+                                                         <label class="checkbox-inline check-box" th:each="dict : ${type}"  >
+                                                             <input type="radio"  th:text="${dict.dictLabel}" th:value="${dict.dictLabel}" th:checked="${dict.dictLabel}==${hasSurgicalTraumaHistory}"  name="hasSurgicalTraumaHistory" id="hasSurgicalTraumaHistory"></label>
+                                                     </div>
+                                                 </div>
+                                             </div>
+                                         </div>
+                                         <div class="col-sm-12">
+                                             <label class="col-sm-1 control-label">家族史:</label>
+                                             <div class="col-sm-7" >
+                                                 <div class="input-group">
+                                                     <table id="familyHistoryTable">
+                                                         <thead>
+                                                         <tr>
+                                                             <th>序号</th>
+                                                             <th>疾病</th>
+                                                             <th>家庭成员</th>
+                                                             <th>操作</th>
+                                                         </tr>
+                                                         </thead>
+                                                         <tbody id="familyHistoryTableBody">
+                                                         <!-- 表格行将在这里动态添加 -->
+                                                         </tbody>
+                                                     </table>
+                                                     <div class="modal inmodal" id="myModal" tabindex="-1" role="dialog" aria-hidden="true">
+                                                         <div class="modal-dialog">
+                                                           <form class="form-horizontal" id="form-jzs-add">
+                                                             <div class="modal-content animated bounceInRight">
+                                                                 <div class="modal-header">
+                                                                     <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">关闭</span>
+                                                                     </button>
+                                                                     <h4 class="modal-title">家族史</h4>
+                                                                 </div>
+                                                                 <div class="modal-body">
+                                                                   <div class="row">
+                                                                     <div class="col-sm-12">
+                                                                      <div class="form-group">
+                                                                         <label class="col-sm-3 control-label">疾病</label>
+                                                                         <div class="col-sm-9" >
+                                                                             <div class="input-group">
+                                                                                 <input type="text" name="disease" placeholder="请输入疾病" class="styled-input"  style="width: 200px;" id="disease"> </div>
+                                                                            </div>
+                                                                          <div class="row">
+                                                                              <div class="col-sm-12">
+                                                                                  <label class="col-sm-3 control-label">家庭成员</label>
+                                                                                  <div class="col-sm-9" >
+                                                                                      <select name="member" class="styled-input"  style="width: 200px;" th:with="type=${@dict.getType('sys_select_dtp_ysfw_lxryhzgx')}" id="member">
+                                                                                          <option value="">请选择家庭成员</option>
+                                                                                          <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictLabel}"
+                                                                                                  th:selected="${dict.dictLabel}==${member}"></option>
+                                                                                      </select>
+                                                                                  </div>
+                                                                              </div>
+                                                                          </div>
+
+                                                                      </div>
+                                                                    </div>
+                                                                  </div>
+                                                                 </div>
+                                                                 <div class="modal-footer">
+                                                                     <button type="button" class="btn btn-white" data-dismiss="modal">关闭</button>
+                                                                     <button type="button" class="btn btn-primary" onclick="saveRow(1)">保存</button>
+                                                                 </div>
+                                                             </div>
+                                                           </form>
+                                                         </div>
+
+                                                     </div>
+                                                     <button type="button"  data-toggle="modal" data-target="#myModal">新增</button>
+                                                 </div>
+                                             </div>
+
+                                         </div>
+                                     </div>
+                                   </div>
+                                </div>
+                                <div id="tab-25" class="tab-pane fade in active">
+                                    <div class="panel-body">
+                                        <strong>治疗手段</strong>
+                                        <div class="row">
+                                            <div class="col-sm-12">
+                                                <label class="col-sm-1  control-label">多个治疗方案原因描述:</label>
+                                                <div class="col-sm-11" >
+                                                    <div class="input-group">
+                                                        <textarea id="multipleTreatmentReasonsDescription" name="multipleTreatmentReasonsDescription" placeholder="治疗方案原因描述"   rows="5" cols="185" th:text="${multipleTreatmentReasonsDescription}"></textarea>
+                                                    </div>
+                                                </div>
+                                            </div>
+                                        </div>
+                                     </div>
+                                </div>
+                                <div id="tab-26" class="tab-pane fade in active">
+                                    <div class="panel-body">
+                                        <strong>用药情况 </strong>
+                                        <div class="row">
+                                            <div class="col-sm-12">
+                                                <label class="col-sm-1 control-label">当前用药情况:</label>
+                                                <div class="col-sm-11" >
+                                                    <div class="input-group">
+                                                        <table id="yyqkTable">
+                                                            <thead>
+                                                            <tr>
+                                                                <th>序号</th>
+                                                                <th>用药情况</th>
+                                                                <th>用药类型</th>
+                                                                <th>操作</th>
+                                                            </tr>
+                                                            </thead>
+                                                            <tbody id="yyqkTableBody">
+                                                            <!-- 表格行将在这里动态添加 -->
+                                                            </tbody>
+                                                        </table>
+                                                        <div class="modal inmodal" id="myModal2" tabindex="-1" role="dialog" aria-hidden="true">
+                                                            <div class="modal-dialog">
+                                                                <form class="form-horizontal" id="form-yyqk-add">
+                                                                    <div class="modal-content animated bounceInRight">
+                                                                        <div class="modal-header">
+                                                                            <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">关闭</span>
+                                                                            </button>
+                                                                            <h4 class="modal-title">用药情况</h4>
+                                                                        </div>
+                                                                        <div class="modal-body">
+                                                                            <div class="row">
+                                                                                <div class="col-sm-12">
+                                                                                    <div class="form-group">
+                                                                                        <label class="col-sm-3 control-label">用药情况</label>
+                                                                                        <div class="col-sm-9" >
+                                                                                            <div class="input-group">
+                                                                                                <input type="text" name="medication_description" placeholder="请输入当前慢病用药名称" class="styled-input"  style="width: 200px;" id="medication_description"> </div>
+                                                                                        </div>
+                                                                                        <div class="row">
+                                                                                            <div class="col-sm-12">
+                                                                                                <label class="col-sm-3 control-label">用药类型</label>
+                                                                                                <div class="col-sm-9" >
+                                                                                                    <select name="medication_type" class="styled-input"  style="width: 200px;" th:with="type=${@dict.getType('sys_select_dtp_ysfw_lxryhzgx')}" id="medication_type">
+                                                                                                        <option value="">请选择家庭成员</option>
+                                                                                                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictLabel}"
+                                                                                                                th:selected="${dict.dictLabel}==${medication_type}"></option>
+                                                                                                    </select>
+                                                                                                </div>
+                                                                                            </div>
+                                                                                        </div>
+
+                                                                                    </div>
+                                                                                </div>
+                                                                            </div>
+                                                                        </div>
+                                                                        <div class="modal-footer">
+                                                                            <button type="button" class="btn btn-white" data-dismiss="modal">关闭</button>
+                                                                            <button type="button" class="btn btn-primary" onclick="saveRow(2)">保存</button>
+                                                                        </div>
+                                                                    </div>
+                                                                </form>
+                                                            </div>
+
+                                                        </div>
+                                                        <button type="button"  data-toggle="modal" data-target="#myModal2">新增</button>
+                                                    </div>
+                                                </div>
+                                            </div>
+                                        </div>
+                                    </div>
+                                </div>
+                                <div id="tab-27" class="tab-pane fade in active">
+                                    <div class="panel-body">
+                                        <strong>其他信息</strong>
+                                        <div class="row">
+                                            <div class="col-sm-12">
+                                                <label class="col-sm-1 control-label">联系人:</label>
+                                                <div class="col-sm-11" >
+                                                    <div class="input-group">
+                                                        <table id="relationTable">
+                                                            <thead>
+                                                            <tr>
+                                                                <th>序号</th>
+                                                                <th>联系人电话</th>
+                                                                <th>联系人姓名</th>
+                                                                <th>联系人关系</th>
+                                                                <th>操作</th>
+                                                            </tr>
+                                                            </thead>
+                                                            <tbody id="relationTableBody">
+                                                            <!-- 表格行将在这里动态添加 -->
+                                                            </tbody>
+                                                        </table>
+                                                        <div class="modal inmodal" id="myModal3" tabindex="-1" role="dialog" aria-hidden="true">
+                                                            <div class="modal-dialog">
+                                                                <form class="form-horizontal" id="form-relation-add">
+                                                                    <div class="modal-content animated bounceInRight">
+                                                                        <div class="modal-header">
+                                                                            <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">关闭</span>
+                                                                            </button>
+                                                                            <h4 class="modal-title">联系人</h4>
+                                                                        </div>
+                                                                        <div class="modal-body">
+                                                                            <div class="row">
+                                                                                <div class="col-sm-12">
+                                                                                    <div class="form-group">
+                                                                                 <div class="row">
+                                                                                   <div class="col-sm-12">
+                                                                                        <label class="col-sm-4 control-label">联系人电话</label>
+                                                                                        <div class="col-sm-6" >
+                                                                                            <div class="input-group">
+                                                                                                <input type="text" placeholder="请输入当联系人电话称"  class="styled-input isPhone" style="width: 200px;"  id="contact_phone" name="contact_phone" maxlength="11">
+                                                                                            </div>
+                                                                                        </div>
+                                                                                   </div>
+                                                                                </div>
+                                                                                  <div class="row">
+                                                                                       <div class="col-sm-12">
+                                                                                        <label class="col-sm-4 control-label">联系人姓名</label>
+                                                                                        <div class="col-sm-6" >
+                                                                                            <div class="input-group">
+                                                                                                <input type="text" placeholder="请输入联系人姓名" class="styled-input"  style="width: 200px;" id="contact_name" name="contact_name">
+                                                                                            </div>
+                                                                                        </div>
+                                                                                     </div>
+                                                                                   </div>
+                                                                                        <div class="row">
+                                                                                            <div class="col-sm-12">
+                                                                                                <label class="col-sm-4 control-label">联系人关系</label>
+                                                                                                <div class="col-sm-3" >
+                                                                                                    <select name="contact_relationship" class="styled-input"  style="width: 200px;" th:with="type=${@dict.getType('sys_select_dtp_ysfw_lxryhzgx')}" id="contact_relationship">
+                                                                                                        <option value="">请选择联系人关系</option>
+                                                                                                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictLabel}"
+                                                                                                                th:selected="${dict.dictLabel}==${contact_relationship}"></option>
+                                                                                                    </select>
+                                                                                                </div>
+                                                                                            </div>
+                                                                                        </div>
+
+                                                                                    </div>
+                                                                                </div>
+                                                                            </div>
+                                                                        </div>
+                                                                        <div class="modal-footer">
+                                                                            <button type="button" class="btn btn-white" data-dismiss="modal">关闭</button>
+                                                                            <button type="button" class="btn btn-primary" onclick="saveRow(3)">保存</button>
+                                                                        </div>
+                                                                    </div>
+                                                                </form>
+                                                            </div>
+
+                                                        </div>
+                                                        <button type="button"  data-toggle="modal" data-target="#myModal3">新增</button>
+                                                    </div>
+                                                </div>
+
+                                            </div>
+                                        </div>
+                                    </div>
+                                    <div class="row">
+                                        <div class="col-sm-12">
+                                            <label class="col-sm-1 control-label">陪护人:</label>
+                                            <div class="col-sm-11" >
+                                                <div class="input-group">
+                                                    <div class="input-group" th:with="type=${@dict.getType('sys_select_dtp_ysfw_phr')}">
+                                                        <label class="checkbox-inline check-box" th:each="dict : ${type}"  >
+                                                            <input type="checkbox"  th:text="${dict.dictLabel}" th:value="${dict.dictLabel}" th:checked="${dict.dictLabel}==${caregiver}"  name="caregiver" id="caregiver"></label>
+                                                    </div>
+
+                                                </div>
+                                            </div>
+                                        </div>
+                                    </div>
+                                </div>
+                              </form>
                             </div>
-                        </div>
-                        <label class="col-sm-1 control-label">随访状态:</label>
-                        <div class="col-sm-2" >
-                            <div class="input-group">
-                                <select name="followUpStatus" class="styled-input" th:with="type=${@dict.getType('sys_follow_up_visit')}">
-                                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"
-                                            th:selected="${dict.dictLabel}==${joinProject}"></option>
-                                </select>
+                            <div id="tab-3" class="tab-pane">
+                                <div class="panel-body">
+                                    <strong>用药购药</strong>
+                                    <div class="container-div">
+                                        <div class="row">
+                                            <div class="col-sm-12 select-table table-striped">
+                                                <table id="bootstrap-table-3"></table>
+                                            </div>
+                                        </div>
+                                    </div>
+                                </div>
+
                             </div>
-                        </div>
-                        <label class="col-sm-1 control-label">更新时间:</label>
-                        <div class="col-sm-2" >
-                            <div class="input-group">
-                                <input type="text" class="styled-input time-input-new" id="updateTime" placeholder="更新时间" name="updateTime" th:value="${updateTime2}" required/>
+                            <div id="tab-4" class="tab-pane">
+                                <div class="panel-body">
+                                    <strong>随访跟进人</strong>
+                                    <div class="row">
+                                        <div class="col-sm-12">
+                                            <label class="col-sm-1 control-label">随访跟进人:</label>
+                                            <span>无</span>
+                                            <div class="col-sm-2" >
+                                                <div class="input-group">
+                                                    <select name="healingLineCollection" class="styled-input" th:with="type=${@dict.getType('sys_yes_no')}">
+                                                        <option value="">请选择</option>
+                                                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"
+                                                                th:selected="${dict.dictLabel} == ${healingLineCollection}" ></option>
+                                                    </select>
+                                                </div>
+                                            </div>
+                                            <label class="col-sm-1 control-label">.</label>
+                                            <div class="col-sm-2" >
+                                                <div class="input-group">
+                                                    <span>脱落召回</span>
+                                                </div>
+                                            </div>
+                                            <div class="col-sm-2" >
+                                                <div class="input-group">
+                                                    <span>进行中</span>
+                                                </div>
+                                            </div>
+                                            <a>关闭计划</a>
+                                        </div>
+
+                                    </div>
+                                    <div class="row">
+                                        <div class="col-sm-12">
+                                            <label class="col-sm-1 control-label">创建人:</label>
+                                            <div class="col-sm-1" >
+                                                <div class="input-group">
+                                                    <span>系统订单</span>
+                                                </div>
+                                            </div>
+                                            <label class="col-sm-1 control-label">开启时间:</label>
+                                            <div class="col-sm-1" >
+                                                <div class="input-group">
+                                                    <span>2024-09-16</span>
+                                                </div>
+                                            </div>
+                                            <label class="col-sm-1 control-label">跟新人:</label>
+                                            <div class="col-sm-1" >
+                                                <div class="input-group">
+                                                    <span>admin</span>
+                                                </div>
+                                            </div>
+                                            <label class="col-sm-1 control-label">更新时间:</label>
+                                            <div class="col-sm-1" >
+                                                <div class="input-group">
+                                                    <span>2024-09-16</span>
+                                                </div>
+                                            </div>
+                                            <div class="col-sm-1" >
+                                                    <a>查看操作记录</a>
+                                            </div>
+                                        </div>
+
+                                    </div>
+                                    <div class="container-div">
+                                         <div class="row">
+                                            <div class="col-sm-12 select-table table-striped">
+                                                <table id="bootstrap-table-4"></table>
+                                            </div>
+                                        </div>
+                                    </div>
+                                </div>
+
                             </div>
-                        </div>
+                            <div id="tab-5" class="tab-pane">
+                                <ul class="nav nav-tabs">
+                                    <div class="panel-body">
+                                        <div class="container-div">
+                                         <div class="row">
+                                            <label class="col-sm-1 control-label">随访跟进人:</label>
+                                             <span>无</span>
+                                            <div class="col-sm-2" >
+                                                <div class="input-group">
+                                                    <select name="healingLineCollection" class="styled-input" th:with="type=${@dict.getType('sys_yes_no')}">
+                                                        <option value="">请选择</option>
+                                                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"
+                                                                th:selected="${dict.dictLabel} == ${healingLineCollection}" ></option>
+                                                    </select>
+                                                </div>
+                                            </div>
+                                          </div>
+                                            <div class="row">
+                                                <div class="col-sm-12 select-table table-striped">
+                                                    <table id="bootstrap-table-5"></table>
+                                                </div>
+                                            </div>
+                                        </div>
+                                    </div>
+                                </ul>
 
+                            </div>
                     </div>
-                </div>
+                 </div>
+             </div>
+        <div class="main-content" id="content-main">
+            <div class="col-sm-offset-5 col-sm-10">
+                <button type="button" class="btn btn-sm btn-primary" onclick="submitHandler()"><i class="fa fa-check"></i>保 存</button>&nbsp;
+                <button type="button" class="btn btn-sm btn-danger" onclick="closeItem()"><i class="fa fa-reply-all"></i>关 闭 </button>
             </div>
-        </form>
-    </div>
-    <div class="main-content">
-        <div class="col-sm-offset-5 col-sm-10">
-            <button type="button" class="btn btn-sm btn-primary" onclick="submitHandler()"><i class="fa fa-check"></i>保 存</button>&nbsp;
-            <button type="button" class="btn btn-sm btn-danger" onclick="closeItem()"><i class="fa fa-reply-all"></i>关 闭 </button>
         </div>
-    </div>
+  </div>
 	<th:block th:include="include :: footer" />
-</body>
+    <th:block th:include="include :: select2-css" />
+    <th:block th:include="include :: bootstrap-select-css" />
+</body>   <th:block th:include="include :: select2-js" />
+<th:block th:include="include :: bootstrap-select-js" />
 </html>
-
-<script>
+<script th:inline="javascript">
+    // 初始化数据
+    var contacts = [
+        { id: 1, phoneNumber: '18709869299', name: '', relation: '本人' },
+    ];
+    var prefix = ctx + "dtp/pmService";
+    var prefix2 = ctx + "demo/table";
+    var formSubmitted = true;
     function submitHandler() {
-        var prefix = ctx + "dtp/pmService";
-        if ($.validate.form()) {
-            var data = $("#form-server-edit").serializeArray();
-            /*var status = $("input[id='status']").is(':checked') == true ? 0 : 1;
-            var roleIds = $.form.selectCheckeds("role");
-            var postIds = $.form.selectSelects("post");
-            data.push({"name": "status", "value": status});
-            data.push({"name": "roleIds", "value": roleIds});
-            data.push({"name": "postIds", "value": postIds});*/
-            $.operate.saveTab(prefix + "/archivesEdit", data);
+        if(formSubmitted===true){
+            //表单 基本信息
+            // 获取选中的值
+            var selectedValues = $('#insurance').val();
+            if (selectedValues) {
+                // 将选中的值合并成一个字符串
+                var combinedValue = selectedValues.join(',');
+                // 设置隐藏字段的值
+                $('#insuranceValue').val(combinedValue);
+            } else {
+                // 如果没有选中任何值,设置为空字符串
+                $('#insuranceValue').val('');
+            }
+            if ($.validate.form("form-server-edit1")) {
+                var data = $("#form-server-edit1").serializeArray();
+                // 遍历 data 数组,查找 realNameStatus flipStatus 字段
+                var realNameStatus = null;
+                var flipStatus = null;
+                for (var i = 0; i < data.length; i++) {
+                    if (data[i].name === 'realNameStatus') {
+                        realNameStatus = data[i].value;
+                        break;
+                    }
+                }
+                for (var i = 0; i < data.length; i++) {
+                    if (data[i].name === 'flipStatus') {
+                        flipStatus = data[i].value;
+                        break;
+                    }
+                }
+                // 判断 flipStatus 的值
+                if (flipStatus === '已上翻') {
+                    flipStatus = 1;
+                    // 更新 data 数组中的 realNameStatus 值
+                    for (var i = 0; i < data.length; i++) {
+                        if (data[i].name === 'flipStatus') {
+                            data[i].value = flipStatus;
+                            break;
+                        }
+                    }
+                }
+                if (flipStatus === '未上翻') {
+                    flipStatus = 2;
+                    // 更新 data 数组中的 flipStatus 值
+                    for (var i = 0; i < data.length; i++) {
+                        if (data[i].name === 'flipStatus') {
+                            data[i].value = flipStatus;
+                            break;
+                        }
+                    }
+                }
+                // 判断 realNameStatus 的值
+                if (realNameStatus === '未实名') {
+                    realNameStatus = 0;
+                    // 更新 data 数组中的 realNameStatus 值
+                    for (var i = 0; i < data.length; i++) {
+                        if (data[i].name === 'realNameStatus') {
+                            data[i].value = realNameStatus;
+                            break;
+                        }
+                    }
+                }
+                if (realNameStatus === '已实名') {
+                    realNameStatus = 1;
+                    // 更新 data 数组中的 realNameStatus 值
+                    for (var i = 0; i < data.length; i++) {
+                        if (data[i].name === 'realNameStatus') {
+                            data[i].value = realNameStatus;
+                            break;
+                        }
+                    }
+                }
+                console.log(data)
+                $.operate.saveTab(prefix + "/archivesEdit", data);
+            }
+        } if(formSubmitted===false){
+            //表单  基础信息
+            //获取基本信息表单
+            var formData = new FormData(document.getElementById('form-server-edit1'));
+            // 获取需要禁用的字段
+            var hiddenDiv = document.getElementById('tab-1');
+            var inputsToDisable = hiddenDiv.querySelectorAll('input[name^="hiddenInput"]');
+            // 遍历并从FormData中删除这些字段
+            inputsToDisable.forEach(function(input) {
+                formData.delete(input.name);
+            });
+            // 获取所有 class 为 icheckbox-blue 并且包含 checked 类的 div
+            var divs = document.querySelectorAll('.icheckbox-blue.checked');
+            var checkedValues = [];
+
+            // 遍历所有符合条件的 div
+            divs.forEach(function(div) {
+                // 获取 div 内部的复选框
+                var checkbox = div.querySelector('input[type="checkbox"]');
+                if (checkbox) {
+                    // 如果复选框被选中,将其值添加到数组中
+                    checkedValues.push(checkbox.value);
+                }
+            });
+            if (divs.length === 0) {
+                $('#insurance-error').show();
+                return false;
+            } else {
+                $('#insurance-error').hide();
+            }
+
+            if (checkedValues) {
+                // 将选中的值合并成一个字符串
+                var combinedValue = checkedValues.join(',');
+                // 设置隐藏字段的值
+                $('#insuranceValue2').val(combinedValue);
+            } else {
+                // 如果没有选中任何值,设置为空字符串
+                $('#insuranceValue2').val('');
+            }
+            // var combinedValue = checkedValues.join(',');
+            // $('#insuranceValue2').val(combinedValue);
+
+            var valuexx= $('#insuranceValue2').val();
+            console.log(valuexx)
+            if ($.validate.form("form-server-edit")) {
+                var data = $("#form-server-edit").serializeArray();
+                // 获取 textarea 的值
+                var textareaValue = document.getElementById('multipleTreatmentReasonsDescription').value;
+                data.push({name:"multipleTreatmentReasonsDescription",value:textareaValue})
+                // 遍历 data 数组,查找 realNameStatus flipStatus 字段
+                var realNameStatus = null;
+                var flipStatus = null;
+                for (var i = 0; i < data.length; i++) {
+                    if (data[i].name === 'realNameStatus') {
+                        realNameStatus = data[i].value;
+                    }
+                }
+                const tableBody1 = document.getElementById('familyHistoryTableBody');
+                const rows1 = tableBody1.getElementsByTagName('tr');
+                const tableBody2 = document.getElementById('yyqkTableBody');
+                const rows2 = tableBody2.getElementsByTagName('tr');
+                const tableBody3 = document.getElementById('relationTableBody');
+                const rows3 = tableBody3.getElementsByTagName('tr');
+                if (rows1.length > 0) {
+                    const rowshbs = [];//患病史table
+                    $('#familyHistoryTableBody tr').each(function () {
+                        const row = {
+                            patient_archive_id:  $("#id").val(),
+                            disease: $(this).find('td:eq(1)').text(),
+                            member: $(this).find('td:eq(2)').text(),
+                        };
+                        rowshbs.push(row);
+                    });
+                    data.push({name:"rowshbs",value:JSON.stringify(rowshbs)})
+                }
+                if (rows2.length > 0) {
+                    const rowsRcords = [];//用药情况table
+                    $('#yyqkTableBody tr').each(function () {
+                        const row = {
+                            patient_archive_id:  $("#id").val(),
+                            medication_description: $(this).find('td:eq(1)').text(),
+                            medication_type: $(this).find('td:eq(2)').text(),
+                        };
+                        rowsRcords.push(row);
+                    });
+                    data.push({name:"rowsRcords",value:JSON.stringify(rowsRcords)})
+                }
+                if (rows3.length > 0) {
+                    const rowslxr = [];//联系人table
+                    $('#relationTableBody  tr').each(function () {
+                        const row = {
+                            patient_archive_id:  $("#id").val(),
+                            contactPhone: $(this).find('td:eq(1)').text(),
+                            contactName: $(this).find('td:eq(2)').text(),
+                            contactRelationship: $(this).find('td:eq(3)').text()
+                        };
+                        rowslxr.push(row);
+                    });
+                    data.push({name:"rowslxr",value:JSON.stringify(rowslxr)})
+                }
+
+
+                $.operate.saveTab(prefix + "/archivesEdit", data);
+            }
+            console.log("tab-1="+formSubmitted) // 阻止表单提交
+        }else{
+            console.log("当前在基本信息页面formSubmitted="+formSubmitted) // 阻止表单提交
+        }
+    }
+        $('#weight').on('blur', function() {
+            var inputValue1 = $('#weight').val().trim();
+            var inputValue2 = $('#height').val().trim();
+            var result = calculateBMI( inputValue2, inputValue1); // 身高1.75m 体重70kg,
+            // 显示输入框的值
+            $('#BMI').val(result);
+        });
+        $('#height').on('blur', function() {
+            var inputValue1 = $('#weight').val().trim();
+            var inputValue2 = $('#height').val().trim();
+            var result = calculateBMI(inputValue2,  inputValue1); // 身高1.75m 体重70kg,
+            // 显示输入框的值
+            $('#BMI').val(result);
+        });
+        $('#weightw').on('blur', function() {
+            var inputValuew = $('#weightw').val().trim();
+            var inputValueh = $('#heighth').val().trim();
+            var result = calculateBMI(inputValueh,inputValuew); // 身高1.75m 体重70kg,
+            // 显示输入框的值
+            $('#BMI2').val(result);
+        });
+        $('#heighth').on('blur', function() {
+            var inputValuew = $('#weightw').val().trim();
+            var inputValueh = $('#heighth').val().trim();
+            var result = calculateBMI(inputValueh, inputValuew); // 身高1.75m 体重70kg,
+            // 显示输入框的值
+            $('#BMI2').val(result);
+        });
+    $(document).ready(function() {
+        // 监听点击事件,激活指定的选项卡
+        $('#myTabs3 li a').click(function(e) {
+            // 阻止默认行为
+            //e.preventDefault();
+            // 获取当前点击的选项卡链接
+            var $this = $(this);
+            var x = document.getElementById("content-main");
+            var hiddenDiv = document.getElementById("hiddenDiv");
+            if($this.attr('href') === '#tab-1'){
+                formSubmitted=true;
+            }
+            if($this.attr('href') === '#tab-2'){
+                formSubmitted=false;
+                // 添加 active 类到当前点击的选项卡
+                $(this).addClass('active');
+                $this.attr('aria-expanded', 'true');
+
+            }
+            // 检查是否为“用药购药”选项卡
+            if ($this.attr('href') === '#tab-3' || $this.attr('href') === '#tab-4' || $this.attr('href') === '#tab-5') {
+                // 初始化表格
+                initializeTables();
+                x.style.display = "none";
+            } else {
+                x.style.display = "block";
+            }
+            // 初始化时回显已选中的值
+            function check(insuranceList) {
+                var insurances = insuranceList.split(',');
+                $.each(insurances, function(index, value) {
+                    var checkbox = $('input[name="insurance2"][value="'+value.trim()+'"]');
+                    checkbox.append('div class="icheckbox-blue"');
+                  checkbox.closest('.icheckbox-blue').addClass('checked');
+                });
+            }
+            /*<![CDATA[*/
+            var insuranceList = /*[[${insurance}]]*/ '';
+            /*]]>*/
+            if(insuranceList){
+                check(insuranceList);
+            }
+
+        });
+    });
+      //初始化加载
+     if(formSubmitted){
+        //基本信息页面1
+        function populateSelections(insuranceList) {
+            var insurances = insuranceList.split(',');
+            var selectedValuesDiv = $('#selected-values');
+            selectedValuesDiv.empty(); // 清空之前的选中值
+            $.each(insurances, function(index, value) {
+                $('#insurance option[value="' + value + '"]').prop('selected', true);
+                selectedValuesDiv.append('<span>' + value + '</span>');
+            });
         }
+        function updateSelectedValues() {
+            var selectedValues = $('#insurance').val();
+            var selectedValuesDiv = $('#selected-values');
+            selectedValuesDiv.empty(); // 清空之前的选中值
+
+            if (selectedValues) {
+                $.each(selectedValues, function(index, value) {
+                    selectedValuesDiv.append('<span>' + value + '</span>');
+                });
+            }
+        }
+         /*<![CDATA[*/
+         var insurance = /*[[${insurance}]]*/ '';
+         /*]]>*/
+         if(insurance){
+             populateSelections(insurance);
+         }
+
+        // 绑定事件监听,当选择发生变化时更新显示的选中值
+         $('#insurance').on('change', function() {
+             updateSelectedValues();
+         });
+     }
+    // 绑定事件监听,当复选框状态改变时更新错误提示
+    $('input[name="insurance2"]').on('change', function() {
+        if ($('input[name="insurance2"]:checked').length > 0) {
+            $('#insurance-error').hide();
+        }
+    });
+
+        // 监听点击事件,激活指定的选项卡
+        $('#myTabs li a').click(function(e) {
+            // 阻止默认行为
+             e.preventDefault();
+            // 获取当前点击的选项卡链接
+             var $this = $(this);
+            // 移除所有选项卡的 active 类
+              //$('#myTabs li').removeClass('active');
+              //$('.tab-pane').removeClass('active in');
+             $('#myTabs li a').addClass('active');
+            // 添加 active 类到当前点击的选项卡
+             $this.parent().addClass('active');
+            // 获取目标选项卡面板的 ID
+            var target = $this.attr('href');
+            // 展示对应的选项卡面板,并更新 aria-expanded
+            $(target).addClass('active in');
+            $this.attr('aria-expanded', 'true');
+            // 执行点击链接对应的动作
+            $this.tab('show');
+            // 移除所有选项卡的激活类
+            //$('.active').removeClass('active');
+            $(this).addClass('active');
+            // 滚动到目标选项卡位置
+            // 将目标内容区滚动到视口中央
+            $('html, body').animate({
+                scrollTop: $(target).offset().top - ($(window).height() / 2)
+            }, 500); // 500毫秒动画时间
+           // scrollToTab($this);
+            // 重新初始化当前选项卡内的表格
+            var tableId = target.replace('#', '');
+            initializeTableForTab(tableId);
+        });
+    function initializeTables() {
+        // 初始化所有表格
+        //initializeTableForTab('tab-1');
+        //initializeTableForTab('tab-2');
+        initializeTableForTab('tab-3');
+        initializeTableForTab('tab-4');
+        initializeTableForTab('tab-5');
+    }
+    function initializeTableForTab(tabId) {
+        var tableId = 'bootstrap-table-' + tabId.substring(4);
+        var tableElement = $('#' + tableId);
+        // 初始化表格
+        tableElement.bootstrapTable({
+            // 配置表格的相关属性
+            // 例如数据源、列定义等
+            // 示例配置
+            data: [
+                { id: 1, name: 'Row 1' },
+                { id: 2, name: 'Row 2' },
+                { id: 3, name: 'Row 3' }
+            ],
+            columns: [
+                [
+                    { field: 'id', title: 'ID' },
+                    { field: 'name', title: 'Name' }
+                ]
+            ]
+        });
+    }
+    function scrollToTab(tabLink) {
+        // 获取目标选项卡的位置
+        var tabPos = tabLink.offset().top;
+
+        //使用 scrollIntoView 方法滚动到目标位置
+        //选项 { behavior: 'smooth' } 使滚动平滑
+        window.scroll({
+            top: tabPos,
+            left: 0,
+            behavior: 'smooth' // 平滑滚动
+        });
+    }
+    $(function() {
+        var optionsyygy = {
+            url: prefix2 + "/list",
+            showSearch: false,
+            showRefresh: false,
+            showToggle: false,
+            showColumns: false,
+            pagination: false,
+            uniqueId: "userId",
+            height: 400,
+            columns: [{
+                checkbox: true
+            },
+                {
+                    field : 'userId',
+                    title : '用户ID'
+                },
+                {
+                    field : 'userCode',
+                    title : '用户编号'
+                },
+                {
+                    field : 'userName',
+                    title : '用户姓名'
+                },
+                {
+                    field : 'userPhone',
+                    title : '用户手机'
+                },
+                {
+                    field : 'userEmail',
+                    title : '用户邮箱'
+                },
+                {
+                    field : 'userBalance',
+                    title : '用户余额'
+                }]
+        };
+        $.table.init(optionsyygy);
+        var optionssfjh = {
+            url: prefix2 + "/list",
+            showSearch: false,
+            showRefresh: false,
+            showToggle: false,
+            showColumns: false,
+            pagination: false,
+            uniqueId: "userId",
+            height: 400,
+            columns: [{
+                checkbox: true
+            },
+                {
+                    field : 'userId',
+                    title : '用户ID'
+                },
+                {
+                    field : 'userCode',
+                    title : '用户编号'
+                },
+                {
+                    field : 'userName',
+                    title : '用户姓名'
+                },
+                {
+                    field : 'userPhone',
+                    title : '用户手机'
+                },
+                {
+                    field : 'userEmail',
+                    title : '用户邮箱'
+                },
+                {
+                    field : 'userBalance',
+                    title : '用户余额'
+                }]
+        };
+        $.table.init(optionssfjh);
+        var optionsregj = {
+            url: prefix2 + "/list",
+            showSearch: false,
+            showRefresh: false,
+            showToggle: false,
+            showColumns: false,
+            pagination: false,
+            uniqueId: "userId",
+            height: 400,
+            columns: [{
+                checkbox: true
+            },
+                {
+                    field : 'userId',
+                    title : '用户ID'
+                },
+                {
+                    field : 'userCode',
+                    title : '用户编号'
+                },
+                {
+                    field : 'userName',
+                    title : '用户姓名'
+                },
+                {
+                    field : 'userPhone',
+                    title : '用户手机'
+                },
+                {
+                    field : 'userEmail',
+                    title : '用户邮箱'
+                },
+                {
+                    field : 'userBalance',
+                    title : '用户余额'
+                }]
+        };
+        $.table.init(optionsregj);
+    });
+    /* 查询表格所有数据值 */
+    function getData(){
+        var data = $("#" + table.options.id).bootstrapTable('getData');
+        $.modal.alert(JSON.stringify(data))
+    }
+    /* 查询行ID值为1的数据 */
+    function getRowByUniqueId(){
+        var data = $("#" + table.options.id).bootstrapTable('getRowByUniqueId', 1);
+        $.modal.alert(JSON.stringify(data))
+    }
+    /* 查询表格选择行数据值 */
+    function getSelections(){
+        var data = $("#" + table.options.id).bootstrapTable('getSelections');
+        $.modal.alert(JSON.stringify(data))
+    }
+    function saveRow(button) {
+        if(button==1){
+            // 获取表单数据
+            var illness = document.getElementById('disease').value;
+            var familyMember = document.getElementById('member').value;
+            // 检查数据是否为空
+            if (!illness || !familyMember) {
+                $.modal.alert('请填写疾病和选择家庭成员!');
+                return;
+            }
+            // 创建新的表格行
+            var newRow = document.createElement('tr');
+            // 序号列
+            var serialNumberCell = document.createElement('td');
+            serialNumberCell.textContent = '1'; // 序号可以按需动态生成
+            newRow.appendChild(serialNumberCell);
+            // 疾病列
+            var illnessCell = document.createElement('td');
+            illnessCell.textContent = illness;
+            newRow.appendChild(illnessCell);
+            // 家庭成员列
+            var familyMemberCell = document.createElement('td');
+            familyMemberCell.textContent = familyMember;
+            newRow.appendChild(familyMemberCell);
+            // 修改 操作列
+            var actionCell = document.createElement('td');
+            // var editButton = document.createElement('button');
+            // editButton.textContent = '修改';
+            // editButton.onclick = function() { editRow(this);/* 复制逻辑 */ };
+            // actionCell.appendChild(editButton);
+            //
+            // var copyButton = document.createElement('button');
+            // copyButton.textContent = '复制';
+            // copyButton.onclick = function() { /* 复制逻辑 */ };
+            // actionCell.appendChild(copyButton);
+            var deleteButton = document.createElement('button');
+            deleteButton.textContent = '删除';
+            deleteButton.onclick = function() { deleteRow(this);/* 复制逻辑 */ };
+            actionCell.appendChild(deleteButton);
+            newRow.appendChild(actionCell);
+            // 将新行添加到表格的tbody中
+            var tableBody = document.querySelector('#familyHistoryTable tbody');
+            tableBody.appendChild(newRow);
+            // 清空表单输入框
+            document.getElementById('disease').value = '';
+            document.getElementById('member').selectedIndex = 0;
+            // 关闭模态框
+            $('#myModal').modal('hide');
+        }
+        if(button==2){
+            // 获取表单数据
+            var yyqk = document.getElementById('medication_description').value;
+            var yylx = document.getElementById('medication_type').value;
+            // 检查数据是否为空
+            if (!yyqk || !yylx) {
+                $.modal.alert('请填写用药情况和选择用药类型!');
+                return;
+            }
+            // 创建新的表格行
+            var newRow = document.createElement('tr');
+            // 序号列
+            var serialNumberCell = document.createElement('td');
+            serialNumberCell.textContent = '1'; // 序号可以按需动态生成
+            newRow.appendChild(serialNumberCell);
+            // 疾病列
+            var yyqkCell = document.createElement('td');
+            yyqkCell.textContent = yyqk;
+            newRow.appendChild(yyqkCell);
+            // 家庭成员列
+            var yylxCell = document.createElement('td');
+            yylxCell.textContent = yylx;
+            newRow.appendChild(yylxCell);
+            // 修改 操作列
+            var actionCell = document.createElement('td');
+            // var editButton = document.createElement('button');
+            // editButton.textContent = '修改';
+            // editButton.onclick = function() { editRow(this);/* 复制逻辑 */ };
+            // actionCell.appendChild(editButton);
+            //
+            // var copyButton = document.createElement('button');
+            // copyButton.textContent = '复制';
+            // copyButton.onclick = function() { /* 复制逻辑 */ };
+            // actionCell.appendChild(copyButton);
+            var deleteButton = document.createElement('button');
+            deleteButton.textContent = '删除';
+            deleteButton.onclick = function() { deleteRow(this);/* 复制逻辑 */ };
+            actionCell.appendChild(deleteButton);
+            newRow.appendChild(actionCell);
+            // 将新行添加到表格的tbody中
+            var tableBody = document.querySelector('#yyqkTable tbody');
+            tableBody.appendChild(newRow);
+
+            // 清空表单输入框
+            document.getElementById('medication_description').value = '';
+            document.getElementById('medication_type').selectedIndex = 0;
+            // 关闭模态框
+            $('#myModal2').modal('hide');
+        }
+        if(button==3){
+            // 获取表单数据 form-relation-add relationTable 联系人电话 lxrdh 联系人姓名 lxrxm 联系人关系 lxrgx
+            var lxrdh = document.getElementById('contact_phone').value;
+            var lxrxm = document.getElementById('contact_name').value;
+            var lxrgx = document.getElementById('contact_relationship').value;
+            // 检查数据是否为空
+            if (!lxrdh || !lxrxm || !lxrgx) {
+                $.modal.alert('请填写联系人姓名,联系人电话和选择家庭成员!');
+                return;
+            }
+            // 创建新的表格行
+            var newRow = document.createElement('tr');
+            // 序号列
+            var serialNumberCell = document.createElement('td');
+            serialNumberCell.textContent = '1'; // 序号可以按需动态生成
+            newRow.appendChild(serialNumberCell);
+
+            // 联系人电话列
+            var lxrdhCell = document.createElement('td');
+            lxrdhCell.textContent = lxrdh;
+            newRow.appendChild(lxrdhCell);
+            //联系人姓名列
+            var lxrxmCell = document.createElement('td');
+            lxrxmCell.textContent = lxrxm;
+            newRow.appendChild(lxrxmCell);
+            // 联系人关系列
+            var lxrgxCell = document.createElement('td');
+            lxrgxCell.textContent = lxrgx;
+            newRow.appendChild(lxrgxCell);
+            // 修改 操作列
+            var actionCell = document.createElement('td');
+            // var editButton = document.createElement('button');
+            // editButton.textContent = '修改';
+            // editButton.onclick = function() { editRow(this);/* 复制逻辑 */ };
+            // actionCell.appendChild(editButton);
+            //
+            // var copyButton = document.createElement('button');
+            // copyButton.textContent = '复制';
+            // copyButton.onclick = function() { /* 复制逻辑 */ };
+            // actionCell.appendChild(copyButton);
+
+            var deleteButton = document.createElement('button');
+            deleteButton.textContent = '删除';
+            deleteButton.onclick = function() { deleteRow(this);/* 复制逻辑 */ };
+            actionCell.appendChild(deleteButton);
+            newRow.appendChild(actionCell);
+            // 将新行添加到表格的tbody中
+            var tableBody = document.querySelector('#relationTable tbody');
+            tableBody.appendChild(newRow);
+            // 清空表单输入框
+            document.getElementById('contact_phone').value = '';
+            document.getElementById('contact_name').value = '';
+            document.getElementById('contact_relationship').selectedIndex = 0;
+            // 关闭模态框
+            $('#myModal3').modal('hide');
+        }
+
+    }
+    function cancelEdit(button) {
+        const row = button.parentNode.parentNode;
+        row.remove();
+    }
+    // 编辑模式标志
+    let isEditMode = false;
+    let currentRow = null;
+    function editRow(button) {
+        // 设置编辑模式标志
+        isEditMode = true;
+        // 阻止事件冒泡
+        // 获取当前按钮所在的行
+        currentRow = button.closest('tr');
+        // 获取行中的数据单元格
+        const illnessCell = currentRow.querySelector('td:nth-child(2)');
+        const familyMemberCell = currentRow.querySelector('td:nth-child(3)');
+        // 获取当前数据
+        const illness = illnessCell.textContent;
+        const familyMember = familyMemberCell.textContent;
+        // 将数据填充到表单中
+        document.getElementById('illnessInput').value = illness;
+        document.getElementById('familyMemberSelect').value = familyMember;
+        // 显示模态框
+        $('#myModal').modal('show');
+    }
+    function saveChanges() {
+        // 获取表单数据
+        const illness = document.getElementById('illnessInput').value;
+        const familyMember = document.getElementById('familyMemberSelect').value;
+        // 更新表格中的数据
+        const illnessCell = currentRow.querySelector('td:nth-child(2)');
+        const familyMemberCell = currentRow.querySelector('td:nth-child(3)');
+        illnessCell.textContent = illness;
+        familyMemberCell.textContent = familyMember;
+        // 清除编辑标志
+        isEditMode = false;
+        // 关闭模态框
+        $('#myModal').modal('hide');
+    }
+    function copyRow(button) {
+        const row = button.parentNode.parentNode.cloneNode(true);
+        document.getElementById("familyHistoryTable").getElementsByTagName("tbody")[0].appendChild(row);
+    }
+    function deleteRow(button) {
+        const row = button.parentNode.parentNode;
+        row.remove();
     }
 </script>
+<style>
+    /* 添加一些基础样式 */
+    body {
+        font-family: Arial, sans-serif;
+    }
+    table {
+        width: 100%;
+        border-collapse: collapse;
+    }
+    th, td {
+        text-align: left;
+        padding: 8px;
+        border-bottom: 1px solid #ddd;
+    }
+    tr:nth-child(even) {
+        background-color: #f2f2f2;
+    }
+    .modal {
+        display: none;
+        position: fixed;
+        z-index: 1;
+        left: 0;
+        top: 0;
+        width: 100%;
+        height: 100%;
+        overflow: auto;
+        background-color: rgba(0,0,0,0.4);
+    }
+    .modal-content {
+        background-color: #fefefe;
+        margin: 15% auto;
+        padding: 20px;
+        border: 1px solid #888;
+        width: 80%;
+    }
+    .close {
+        color: #aaa;
+        float: right;
+        font-size: 28px;
+        font-weight: bold;
+    }
+    .close:hover,
+    .close:focus {
+        color: black;
+        text-decoration: none;
+        cursor: pointer;
+    }
+    .error-message {
+        color: red;
+        display: none;
+    }
+</style>

+ 8 - 10
health-admin/src/main/resources/templates/dtp/archives/archivesList.html

@@ -54,21 +54,16 @@
 				</div>
 
 		        <div class="btn-group-sm" id="toolbar" role="group">
-		        	<!--<a class="btn btn-success" onclick="$.operate.addTab()" shiro:hasPermission="system:user:add">
-		                <i class="fa fa-plus"></i> 新增
+		        <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="system:user:add">
+		                <i class="fa fa-plus"></i> 患者建档(APP)
 		            </a>
 		             <a class="btn btn-primary single disabled" onclick="$.operate.editTab()" shiro:hasPermission="system:user:edit">
-			            <i class="fa fa-edit"></i> 修改
+			            <i class="fa fa-edit"></i> 完善档案
 			        </a>
 		            <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="system:user:remove">
 		                <i class="fa fa-remove"></i> 删除
 		            </a>
-		            <a class="btn btn-info" onclick="$.table.importExcel()" shiro:hasPermission="system:user:import">
-			            <i class="fa fa-upload"></i> 导入
-			        </a>
-		            <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="system:user:export">
-			            <i class="fa fa-download"></i> 导出
-			        </a>-->
+
 		        </div>
 
 				<div class="col-sm-12 select-table table-striped" style="width: 100%; overflow-x: auto;">
@@ -127,6 +122,9 @@
 				//fixedNumber: 3,
 				fixedRightNumber: 1,
 		        columns: [
+					{
+						checkbox: true
+					},
 				{field: 'name', title: '姓名', align: 'center'},
 				{field: 'gender', title: '性别', align: 'center'},
 				{field: 'age', title: '年龄', align: 'center'},
@@ -164,7 +162,7 @@
 		            formatter: function(value, row, index) {
 		                if (row.id) {
 		                	var actions = [];
-			                actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.editTab(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
+			                actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.editTab(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑档案</a> ');
 			                actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a> ');
 			                var more = [];
 			                /*more.push("<a class='btn btn-default btn-xs " + resetPwdFlag + "' href='javascript:void(0)' onclick='resetPwd(" + row.userId + ")'><i class='fa fa-key'></i>重置密码</a> ");

+ 23 - 0
health-common/src/main/java/com/bzd/common/utils/ServletUtils.java

@@ -4,6 +4,8 @@ import java.io.IOException;
 import java.io.UnsupportedEncodingException;
 import java.net.URLDecoder;
 import java.net.URLEncoder;
+import java.time.LocalDate;
+import java.time.Period;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import javax.servlet.http.HttpSession;
@@ -213,4 +215,25 @@ public class ServletUtils
             return StringUtils.EMPTY;
         }
     }
+
+
+    /**
+     * 根据出生日期字符串计算年龄。
+     *
+     * @param birthDateString 出生日期的字符串表示,格式为 "YYYY-MM-DD"
+     * @return 年龄
+     */
+    public static int calculateAge(String birthDateString) {
+        // 解析出生日期字符串为 LocalDate 对象
+        LocalDate birthDate = LocalDate.parse(birthDateString);
+
+        // 获取当前日期
+        LocalDate currentDate = LocalDate.now();
+
+        // 计算两个日期之间的间隔期
+        Period period = Period.between(birthDate, currentDate);
+
+        // 返回年龄
+        return period.getYears();
+    }
 }

+ 50 - 2
health-system/src/main/java/com/bzd/system/service/PharmaceuticalService.java

@@ -3,6 +3,8 @@ package com.bzd.system.service;
 import com.bzd.common.config.dao.DaoBase;
 import com.bzd.common.config.dao.DaoSupport;
 import com.bzd.common.config.dao.PageData;
+import com.bzd.common.utils.DateUtils;
+import com.bzd.common.utils.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
@@ -10,6 +12,8 @@ import org.springframework.transaction.annotation.Transactional;
 import javax.annotation.Resource;
 import java.util.List;
 
+import static com.bzd.common.utils.ShiroUtils.getSysUser;
+
 
 /**
  * 药事服务管理 service
@@ -24,16 +28,40 @@ public class PharmaceuticalService {
     private DaoSupport daoSupport;
 
     public List<PageData> findArchivesList(PageData pd) throws Exception{
-        return (List<PageData>) daoSupport.findForList("PharmaceuticalServiceMapper.selectArchivesList", pd);
+        List<PageData> list= (List<PageData>) daoSupport.findForList("PharmaceuticalServiceMapper.selectArchivesList", pd);
+        pd.put("archiveId", pd.get("id"));
+        List<PageData> listBasicInfomation= (List<PageData>) daoSupport.findForList("PharmaceuticalServiceMapper.selectPatientBasicInfo", pd);
+        list.addAll(listBasicInfomation);
+        return list;
 
     }
+    public List<PageData> findBasicInfomation(PageData pd) throws Exception{
+        pd.put("archiveId", pd.get("id"));
+        List<PageData> listBasicInfomation= (List<PageData>) daoSupport.findForList("PharmaceuticalServiceMapper.selectPatientBasicInfo", pd);
+        return listBasicInfomation;
 
+    }
     public Integer archivesRemove(PageData pd)throws Exception {
         return daoSupport.delete("PharmaceuticalServiceMapper.archivesRemove", pd);
     }
 
-
+    @Transactional(rollbackFor = Exception.class)
     public Integer updateArchives(PageData pd)throws Exception {
+        // 检查 basicInformation 是否为 null
+        Object basicInformation = pd.get("basicInformation");
+        if (basicInformation != null && "true".equals(basicInformation.toString())) {
+          Object updatePatientBasicInfo =  daoSupport.findForObject("PharmaceuticalServiceMapper.selectPatientBasicInfoById", pd);
+          if(StringUtils.isNull(updatePatientBasicInfo)){
+              pd.put("archiveId", pd.get("id"));
+              pd.put("createdBy", getSysUser().getLoginName());
+              pd.put("createdAt", DateUtils.getTime());
+              daoSupport.update("PharmaceuticalServiceMapper.insertPatientBasicInfo", pd);
+          }else {
+              pd.put("basicInfoCompleter", getSysUser().getLoginName());
+              pd.put("recordUpdateTimestamp", DateUtils.getTime());
+              daoSupport.update("PharmaceuticalServiceMapper.updatePatientBasicInfo", pd);
+          }
+        }
         return daoSupport.update("PharmaceuticalServiceMapper.updateArchives", pd);
     }
 
@@ -41,7 +69,10 @@ public class PharmaceuticalService {
         return (List<PageData>) daoSupport.findForList("PharmaceuticalServiceMapper.selectFollowUpList", pd);
 
     }
+    public Object findBasicInfoById(PageData pd) throws Exception{
+        return  daoSupport.findForObject("PharmaceuticalServiceMapper.selectPatientBasicInfoById", pd);
 
+    }
     public Integer followUpRemove(PageData pd)throws Exception {
         return daoSupport.delete("PharmaceuticalServiceMapper.followUpRemove", pd);
     }
@@ -93,4 +124,21 @@ public class PharmaceuticalService {
     public Integer updateFollowUpEvaluation(PageData pd)throws Exception {
         return daoSupport.update("PharmaceuticalServiceMapper.updateFindFollowUpEvaluation", pd);
     }
+
+    public boolean checkPatientIsExist(PageData pd) throws Exception{
+        Object PageData =daoSupport.findForObject("PharmaceuticalServiceMapper.checkPatientIsExist", pd);
+        return StringUtils.isNull(PageData);
+
+    }
+    /**
+     * 新建患者档案
+     */
+    public Integer addArchives(PageData pd)throws Exception {
+        pd.put("creator", getSysUser().getLoginName());//创建人
+        pd.put("createTime", DateUtils.getTime());//创建时间
+        pd.put("archiveCreator", getSysUser().getLoginName());//档案创建人
+        pd.put("archiveCompleteStatus", 0);//档案是否完善 1已完善 0未完善
+        pd.put("realNameStatus", 0);//是否实名 1已经实名 0未实名 待对接服务校验
+        return daoSupport.update("PharmaceuticalServiceMapper.insertArchiveRecord", pd);
+    }
 }

+ 823 - 85
health-system/src/main/resources/mapper/pmServiceMapper/PharmaceuticalServiceMapper.xml

@@ -7,9 +7,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 	<!--档案管理查询-->
 	<select id="selectArchivesList" parameterType="pd" resultType="pd">
 		select *,DATE_FORMAT(updateTime, '%Y-%m-%d %H:%i:%s') AS updateTime2 from s_dtp_ysfw_archive_management where 1=1
-		<if test="archivesId != null and archivesId!=''">
-			and id=#{archivesId}
-		</if>
 		<if test="serviceTypeNumber!= null and serviceTypeNumber!=''">
 			and serviceTypeNumber=#{serviceTypeNumber}
 		</if>
@@ -60,95 +57,282 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 		</if>
 
 	</select>
-
-	<!--档案管理修改-->
-	<update id="updateArchives" parameterType="pd" >
-		<if test="up != null and up!=''">
-			update s_dtp_ysfw_archive_management set
-		</if>
+	<!-- 检查患者是否存在 -->
+	<select id="checkPatientIsExist" parameterType="pd" resultType="pd">
+		select name,phoneNumber from s_dtp_ysfw_archive_management where 1=1
 		<if test="name!= null and name!=''">
-			name=#{name},
-		</if>
-		<if test="gender!= null and  gender!=''">
-			gender=#{gender},
-		</if>
-		<if test="age!= null and age!=''">
-			age=#{age},
-		</if>
-		<if test="phoneNumber!= null and  phoneNumber!=''">
-			phoneNumber=#{phoneNumber},
-		</if>
-		<if test="documentType!= null and documentType!=''">
-			documentType=#{documentType},
-		</if>
-		<if test="documentNumber!= null and documentNumber!=''">
-			documentNumber=#{documentNumber},
-		</if>
-		<if test="realNameStatus!= null and realNameStatus!=''">
-			realNameStatus=#{realNameStatus},
-		</if>
-		<if test="flipStatus!= null and flipStatus!=''">
-			flipStatus=#{flipStatus},
-		</if>
-		<if test="disease!= null and disease!=''">
-			disease=#{disease},
-		</if>
-		<if test="genericName!= null and genericName!=''">
-			genericName=#{genericName},
-		</if>
-		<if test="productName!= null and productName!=''">
-			productName=#{productName},
-		</if>
-		<if test="mdmCode!= null and mdmCode!=''">
-			mdmCode=#{mdmCode},
-		</if>
-		<if test="manufacturer!= null and manufacturer!=''">
-			manufacturer=#{manufacturer},
-		</if>
-		<if test="storeName!= null and storeName!=''">
-			storeName=#{storeName},
-		</if>
-		<!--<if test="归属门店!= null and 归属门店!=''">
-                 归属门店=#{归属门店},
-        </if>-->
-		<if test="archiveCreator!= null and archiveCreator!=''">
-			archiveCreator=#{archiveCreator},
-		</if>
-		<if test="archiveCompleter!= null and archiveCompleter!=''">
-			archiveCompleter=#{archiveCompleter},
-		</if>
-		<if test="acceptFollowUp!= null and acceptFollowUp!=''">
-			acceptFollowUp=#{acceptFollowUp},
-		</if>
-		<if test="followUpPerson!= null and followUpPerson!=''">
-			followUpPerson=#{followUpPerson},
-		</if>
-		<if test="archiveCompleteStatus!= null and archiveCompleteStatus!=''">
-			archiveCompleteStatus=#{archiveCompleteStatus},
-		</if>
-		<if test="charityAssistance!= null and charityAssistance!=''">
-			charityAssistance=#{charityAssistance},
-		</if>
-		<if test="joinProject!= null and joinProject!=''">
-			joinProject=#{joinProject},
-		</if>
-		<if test="followUpStatus!= null and followUpStatus!=''">
-			followUpStatus=#{followUpStatus},
+			and name=#{name}
 		</if>
-		<if test="updateTime!= null and updateTime!=''">
-			updateTime=#{updateTime}
+
+		<if test="phoneNumber!= null and phoneNumber!=''">
+			and phoneNumber=#{phoneNumber}
 		</if>
-		<!--<if test="createTime!= null and createTime!=''">
-			create_time=#{createTime}
-		</if>-->
+	</select>
+	<!-- 插入新的档案记录 -->
+	<insert id="insertArchiveRecord" parameterType="pd">
+		INSERT INTO s_dtp_ysfw_archive_management
+		<trim prefix="(" suffix=")" prefixOverrides="," suffixOverrides=",">
+			<if test="realNameStatus != null">realNameStatus,</if>
+			<if test="name != null and name != ''">name,</if>
+			<if test="gender != null">gender,</if>
+			<if test="age != null">age,</if>
+			<if test="dateBirth != null">dateBirth,</if>
+			<if test="phoneNumber != null and phoneNumber != ''">phoneNumber,</if>
+			<if test="documentNumber != null and documentNumber != ''">documentNumber,</if>
+			<if test="landlineNumber != null and landlineNumber != ''">landlineNumber,</if>
+			<if test="documentType != null and documentType != ''">documentType,</if>
+			<if test="createTime != null">createTime,</if>
+			<if test="archiveCreator != null and archiveCreator != ''">archiveCreator,</if>
+			<if test="creator != null and creator != ''">creator,</if>
+			<if test="archiveCompleteStatus != null">archiveCompleteStatus,</if>
+			<if test="contactRelation != null and contactRelation != ''">contactRelation,</if>
+			<if test="contactPhone != null and contactPhone != ''">contactPhone,</if>
+			<if test="contactName != null and contactName != ''">contactName,</if>
+			<if test="flipStatus != null">flipStatus,</if>
+			<if test="chronicTumorType != null and chronicTumorType != ''">chronicTumorType,</if>
+			<if test="nation != null and nation != ''">nation,</if>
+			<if test="nativePlace != null and nativePlace != ''">nativePlace,</if>
+			<if test="height != null">height,</if>
+			<if test="weight != null">weight,</if>
+			<if test="BMI != null and BMI != ''">BMI,</if>
+			<if test="insurance != null and insurance != ''">insurance,</if>
+			<if test="socialSecurityCard != null and socialSecurityCard != ''">socialSecurityCard,</if>
+			<if test="timeFirstDiagnosis != null">timeFirstDiagnosis,</if>
+			<if test="diseaseType != null and diseaseType != ''">diseaseType,</if>
+			<if test="healingLineCollection != null and healingLineCollection != ''">healingLineCollection,</if>
+			<if test="disease != null and disease != ''">disease,</if>
+			<if test="ownedStore != null and ownedStore != ''">ownedStore,</if>
+			<if test="archiveCompleter != null and archiveCompleter != ''">archiveCompleter,</if>
+			<if test="acceptFollowUp != null">acceptFollowUp,</if>
+			<if test="followUpPerson != null and followUpPerson != ''">followUpPerson,</if>
+			<if test="charityAssistance != null">charityAssistance,</if>
+			<if test="manufacturer != null and manufacturer != ''">manufacturer,</if>
+			<if test="joinProject != null">joinProject,</if>
+			<if test="mdmCode != null and mdmCode != ''">mdmCode,</if>
+			<if test="productName != null and productName != ''">productName,</if>
+			<if test="storeName != null and storeName != ''">storeName,</if>
+			<if test="followUpStatus != null">followUpStatus,</if>
+			<if test="genericName != null and genericName != ''">genericName,</if>
+			<if test="updateTime != null and updateTime != ''">updateTime</if>
+		</trim>
 
-		<if test="up != null and up!=''">
-			<if test="id!= null and id!=''">
-				where id=#{id}
+		<trim prefix=" VALUES (" suffix=")" prefixOverrides="," suffixOverrides=",">
+			<if test="realNameStatus != null">#{realNameStatus},</if>
+			<if test="name != null and name != ''">#{name},</if>
+			<if test="gender != null">#{gender},</if>
+			<if test="age != null">#{age},</if>
+			<if test="dateBirth != null">#{dateBirth},</if>
+			<if test="phoneNumber != null and phoneNumber != ''">#{phoneNumber},</if>
+			<if test="documentNumber != null and documentNumber != ''">#{documentNumber},</if>
+			<if test="landlineNumber != null and landlineNumber != ''">#{landlineNumber},</if>
+			<if test="documentType != null and documentType != ''">#{documentType},</if>
+			<if test="createTime != null">#{createTime},</if>
+			<if test="archiveCreator != null and archiveCreator != ''">#{archiveCreator},</if>
+			<if test="creator != null and creator != ''">#{creator},</if>
+			<if test="archiveCompleteStatus != null">#{archiveCompleteStatus},</if>
+			<if test="contactRelation != null and contactRelation != ''">#{contactRelation},</if>
+			<if test="contactPhone != null and contactPhone != ''">#{contactPhone},</if>
+			<if test="contactName != null and contactName != ''">#{contactName},</if>
+			<if test="flipStatus != null">#{flipStatus},</if>
+			<if test="chronicTumorType != null and chronicTumorType != ''">#{chronicTumorType},</if>
+			<if test="nation != null and nation != ''">#{nation},</if>
+			<if test="nativePlace != null and nativePlace != ''">#{nativePlace},</if>
+			<if test="height != null">#{height},</if>
+			<if test="weight != null">#{weight},</if>
+			<if test="BMI != null and BMI != ''">#{BMI},</if>
+			<if test="insurance != null and insurance != ''">#{insurance},</if>
+			<if test="socialSecurityCard != null and socialSecurityCard != ''">#{socialSecurityCard},</if>
+			<if test="timeFirstDiagnosis != null">#{timeFirstDiagnosis},</if>
+			<if test="diseaseType != null and diseaseType != ''">#{diseaseType},</if>
+			<if test="healingLineCollection != null and healingLineCollection != ''">#{healingLineCollection},</if>
+			<if test="disease != null and disease != ''">#{disease},</if>
+			<if test="ownedStore != null and ownedStore != ''">#{ownedStore},</if>
+			<if test="archiveCompleter != null and archiveCompleter != ''">#{archiveCompleter},</if>
+			<if test="acceptFollowUp != null">#{acceptFollowUp},</if>
+			<if test="followUpPerson != null and followUpPerson != ''">#{followUpPerson},</if>
+			<if test="charityAssistance != null">#{charityAssistance},</if>
+			<if test="manufacturer != null and manufacturer != ''">#{manufacturer},</if>
+			<if test="joinProject != null">#{joinProject},</if>
+			<if test="mdmCode != null and mdmCode != ''">#{mdmCode},</if>
+			<if test="productName != null and productName != ''">#{productName},</if>
+			<if test="storeName != null and storeName != ''">#{storeName},</if>
+			<if test="followUpStatus != null">#{followUpStatus},</if>
+			<if test="genericName != null and genericName != ''">#{genericName},</if>
+			<if test="updateTime != null and updateTime != ''">#{updateTime}</if>
+		</trim>
+
+	</insert>
+
+	<!-- 更新档案记录 -->
+	<update id="updateArchiveRecord" parameterType="pd">
+		UPDATE s_dtp_ysfw_archive_management
+		SET
+		<if test="realNameStatus != null and realNameStatus != ''">realNameStatus = #{realNameStatus},</if>
+		<if test="gender != null  and gender != ''">gender = #{gender},</if>
+		<if test="age != null and age != ''" >age = #{age},</if>
+		<if test="dateBirth != null and dateBirth != ''">dateBirth = #{dateBirth},</if>
+		<if test="landlineNumber != null and landlineNumber != ''">landlineNumber = #{landlineNumber},</if>
+		<if test="archiveCompleteStatus != null">archiveCompleteStatus = #{archiveCompleteStatus},</if>
+		<if test="contactRelation != null and contactRelation != ''">contactRelation = #{contactRelation},</if>
+		<if test="contactPhone != null and contactPhone != ''">contactPhone = #{contactPhone},</if>
+		<if test="contactName != null and contactName != ''">contactName = #{contactName},</if>
+		<if test="flipStatus != null">flipStatus = #{flipStatus},</if>
+		<if test="chronicTumorType != null and chronicTumorType != ''">chronicTumorType = #{chronicTumorType},</if>
+		<if test="nation != null and nation != ''">nation = #{nation},</if>
+		<if test="nativePlace != null and nativePlace != ''">nativePlace = #{nativePlace},</if>
+		<if test="height != null and height != ''">height = #{height},</if>
+		<if test="weight != null and weight != ''">weight = #{weight},</if>
+		<if test="BMI != null and BMI != ''">BMI = #{BMI},</if>
+		<if test="insurance != null and insurance != ''">insurance = #{insurance},</if>
+		<if test="socialSecurityCard != null and socialSecurityCard != ''">socialSecurityCard = #{socialSecurityCard},</if>
+		<if test="timeFirstDiagnosis != null">timeFirstDiagnosis = #{timeFirstDiagnosis},</if>
+		<if test="diseaseType != null and diseaseType != ''">diseaseType = #{diseaseType},</if>
+		<if test="healingLineCollection != null and healingLineCollection != ''">healingLineCollection = #{healingLineCollection},</if>
+		<if test="disease != null and disease != ''">disease = #{disease},</if>
+		<if test="ownedStore != null and ownedStore != ''">ownedStore = #{ownedStore},</if>
+		<if test="archiveCompleter != null and archiveCompleter != ''">archiveCompleter = #{archiveCompleter},</if>
+		<if test="acceptFollowUp != null">acceptFollowUp = #{acceptFollowUp},</if>
+		<if test="followUpPerson != null and followUpPerson != ''">followUpPerson = #{followUpPerson},</if>
+		<if test="charityAssistance != null">charityAssistance = #{charityAssistance},</if>
+		<if test="manufacturer != null and manufacturer != ''">manufacturer = #{manufacturer},</if>
+		<if test="joinProject != null and gender != ''">joinProject = #{joinProject},</if>
+		<if test="mdmCode != null and mdmCode != ''">mdmCode = #{mdmCode},</if>
+		<if test="productName != null and productName != ''">productName = #{productName},</if>
+		<if test="storeName != null and storeName != ''">storeName = #{storeName},</if>
+		<if test="followUpStatus != null and followUpStatus != ''">followUpStatus = #{followUpStatus},</if>
+		<if test="genericName != null and genericName != ''">genericName = #{genericName},</if>
+		updateTime = #{updateTime}
+		WHERE id = #{id}
+	</update>
+	<!--档案管理修改-->
+	<update id="updateArchives" parameterType="pd">
+		update s_dtp_ysfw_archive_management
+		<trim prefix="SET" suffixOverrides="," prefixOverrides=",">
+			<if test="realNameStatus != null">
+				realNameStatus = #{realNameStatus},
 			</if>
-		</if>
+			<if test="name != null and name != ''">
+				name = #{name},
+			</if>
+			<if test="gender != null and gender != ''">
+				gender = #{gender},
+			</if>
+			<if test="age != null and age != ''">
+				age = #{age},
+			</if>
+			<if test="dateBirth != null and dateBirth != ''">
+				dateBirth = #{dateBirth},
+			</if>
+			<if test="phoneNumber != null and phoneNumber != ''">
+				phoneNumber = #{phoneNumber},
+			</if>
+			<if test="documentNumber != null and documentNumber != ''">
+				documentNumber = #{documentNumber},
+			</if>
+			<if test="landlineNumber != null and landlineNumber != ''">
+				landlineNumber = #{landlineNumber},
+			</if>
+			<if test="documentType != null and documentType != ''">
+				documentType = #{documentType},
+			</if>
+			<if test="archiveCreator != null and archiveCreator != ''">
+				archiveCreator = #{archiveCreator},
+			</if>
+			<if test="creator != null and creator != ''">
+				creator = #{creator},
+			</if>
+			<if test="archiveCompleteStatus != null">
+				archiveCompleteStatus = #{archiveCompleteStatus},
+			</if>
+			<if test="contactRelation != null and contactRelation != ''">
+				contactRelation = #{contactRelation},
+			</if>
+			<if test="contactPhone != null and contactPhone != ''">
+				contactPhone = #{contactPhone},
+			</if>
+			<if test="contactName != null and contactName != ''">
+				contactName = #{contactName},
+			</if>
+			<if test="flipStatus != null and flipStatus != ''">
+				flipStatus = #{flipStatus},
+			</if>
+			<if test="chronicTumorType != null and chronicTumorType != ''">
+				chronicTumorType = #{chronicTumorType},
+			</if>
+			<if test="nation != null and nation != ''">
+				nation = #{nation},
+			</if>
+			<if test="nativePlace != null and nativePlace != ''">
+				nativePlace = #{nativePlace},
+			</if>
+			<if test="height != null and height != ''">
+				height = #{height},
+			</if>
+			<if test="weight != null and weight != ''">
+				weight = #{weight},
+			</if>
+			<if test="BMI != null and BMI != ''">
+				BMI = #{BMI},
+			</if>
+			<if test="insurance != null and insurance != ''">
+				insurance = #{insurance},
+			</if>
+			<if test="socialSecurityCard != null and socialSecurityCard != ''">
+				socialSecurityCard = #{socialSecurityCard},
+			</if>
+			<if test="timeFirstDiagnosis != null and timeFirstDiagnosis != ''">
+				timeFirstDiagnosis = #{timeFirstDiagnosis},
+			</if>
+			<if test="diseaseType != null and diseaseType != ''">
+				diseaseType = #{diseaseType},
+			</if>
+			<if test="healingLineCollection != null and healingLineCollection != ''">
+				healingLineCollection = #{healingLineCollection},
+			</if>
+			<if test="disease != null and disease != ''">
+				disease = #{disease},
+			</if>
+			<if test="ownedStore != null and ownedStore != ''">
+				ownedStore = #{ownedStore},
+			</if>
+			<if test="archiveCompleter != null and archiveCompleter != ''">
+				archiveCompleter = #{archiveCompleter},
+			</if>
+			<if test="acceptFollowUp != null and acceptFollowUp != ''">
+				acceptFollowUp = #{acceptFollowUp},
+			</if>
+			<if test="followUpPerson != null and followUpPerson != ''">
+				followUpPerson = #{followUpPerson},
+			</if>
+			<if test="charityAssistance != null and charityAssistance != ''">
+				charityAssistance = #{charityAssistance},
+			</if>
+			<if test="manufacturer != null and manufacturer != ''">
+				manufacturer = #{manufacturer},
+			</if>
+			<if test="joinProject != null and joinProject != ''">
+				joinProject = #{joinProject},
+			</if>
+			<if test="mdmCode != null and mdmCode != ''">
+				mdmCode = #{mdmCode},
+			</if>
+			<if test="productName != null and productName != ''">
+				productName = #{productName},
+			</if>
+			<if test="storeName != null and storeName != ''">
+				storeName = #{storeName},
+			</if>
+			<if test="followUpStatus != null and followUpStatus != ''">
+				followUpStatus = #{followUpStatus},
+			</if>
+			<if test="genericName != null and genericName != ''">
+				genericName = #{genericName},
+			</if>
+		</trim>
+		where id = #{id}
 	</update>
 
+
 	<!--档案管理删除-->
 	<delete id="archivesRemove" parameterType="pd">
 		<if test="ids != null">
@@ -673,4 +857,558 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 			</if>
 		</if>
 	</delete>
+
+	<!--查询患者基础信息-->
+	<select id="selectPatientBasicInfo" parameterType="pd" resultType="pd">
+		SELECT * FROM s_dtp_ysfw_patientbasicinfor WHERE 1=1
+		<if test="id != null and id != ''">
+			AND id = #{id}
+		</if>
+		<if test="currentEconomicSituation != null and currentEconomicSituation != ''">
+			AND currentEconomicSituation = #{currentEconomicSituation}
+		</if>
+		<if test="patientAwareness != null and patientAwareness != ''">
+			AND patientAwareness = #{patientAwareness}
+		</if>
+		<if test="followUpFeedbackDoctor != null and followUpFeedbackDoctor != ''">
+			AND followUpFeedbackDoctor = #{followUpFeedbackDoctor}
+		</if>
+		<if test="bloodPressureStatus != null and bloodPressureStatus != ''">
+			AND bloodPressureStatus = #{bloodPressureStatus}
+		</if>
+		<if test="heartRate != null and heartRate != ''">
+			AND heartRate = #{heartRate}
+		</if>
+		<if test="smokingHistory != null and smokingHistory != ''">
+			AND smokingHistory = #{smokingHistory}
+		</if>
+		<if test="drinkingHistory != null and drinkingHistory != ''">
+			AND drinkingHistory = #{drinkingHistory}
+		</if>
+		<if test="exerciseHabit != null and exerciseHabit != ''">
+			AND exerciseHabit = #{exerciseHabit}
+		</if>
+		<if test="dietaryPreference != null and dietaryPreference != ''">
+			AND dietaryPreference = #{dietaryPreference}
+		</if>
+		<if test="sleepCondition != null and sleepCondition != ''">
+			AND sleepCondition = #{sleepCondition}
+		</if>
+		<if test="pathologicalStage != null and pathologicalStage != ''">
+			AND pathologicalStage = #{pathologicalStage}
+		</if>
+		<if test="treatmentStage != null and treatmentStage != ''">
+			AND treatmentStage = #{treatmentStage}
+		</if>
+		<if test="accompanyingSymptoms != null and accompanyingSymptoms != ''">
+			AND accompanyingSymptoms = #{accompanyingSymptoms}
+		</if>
+		<if test="hasGeneticTesting != null and hasGeneticTesting != ''">
+			AND hasGeneticTesting = #{hasGeneticTesting}
+		</if>
+		<if test="hasImmuneTesting != null and hasImmuneTesting != ''">
+			AND hasImmuneTesting = #{hasImmuneTesting}
+		</if>
+		<if test="medicalHistory != null and medicalHistory != ''">
+			AND medicalHistory = #{medicalHistory}
+		</if>
+		<if test="medicalHistoryDescription != null and medicalHistoryDescription != ''">
+			AND medicalHistoryDescription = #{medicalHistoryDescription}
+		</if>
+		<if test="infectiousDiseaseHistory != null and infectiousDiseaseHistory != ''">
+			AND infectiousDiseaseHistory = #{infectiousDiseaseHistory}
+		</if>
+		<if test="infectiousDiseaseHistoryDescription != null and infectiousDiseaseHistoryDescription != ''">
+			AND infectiousDiseaseHistoryDescription = #{infectiousDiseaseHistoryDescription}
+		</if>
+		<if test="allergyHistory != null and allergyHistory != ''">
+			AND allergyHistory = #{allergyHistory}
+		</if>
+		<if test="pastAdverseDrugReactionHistory != null and pastAdverseDrugReactionHistory != ''">
+			AND pastAdverseDrugReactionHistory = #{pastAdverseDrugReactionHistory}
+		</if>
+		<if test="hasSurgicalTraumaHistory != null and hasSurgicalTraumaHistory != ''">
+			AND hasSurgicalTraumaHistory = #{hasSurgicalTraumaHistory}
+		</if>
+		<if test="multipleTreatmentReasonsDescription != null and multipleTreatmentReasonsDescription != ''">
+			AND multipleTreatmentReasonsDescription = #{multipleTreatmentReasonsDescription}
+		</if>
+		<if test="familyHistoryId != null and familyHistoryId != ''">
+			AND familyHistoryId = #{familyHistoryId}
+		</if>
+		<if test="previousMedicationId != null and previousMedicationId != ''">
+			AND previousMedicationId = #{previousMedicationId}
+		</if>
+		<if test="contactPersonId != null and contactPersonId != ''">
+			AND contactPersonId = #{contactPersonId}
+		</if>
+		<if test="archiveId != null and archiveId != ''">
+			AND archiveId = #{archiveId}
+		</if>
+		<if test="caregiver != null and caregiver != ''">
+			AND caregiver = #{caregiver}
+		</if>
+		<if test="createdBy != null and createdBy != ''">
+			AND createdBy = #{createdBy}
+		</if>
+		<if test="createdAt != null and createdAt != ''">
+			AND createdAt = #{createdAt}
+		</if>
+		<if test="basicInfoCompleter != null and basicInfoCompleter != ''">
+			AND basicInfoCompleter = #{basicInfoCompleter}
+		</if>
+		<if test="recordUpdateTimestamp != null and recordUpdateTimestamp != ''">
+			AND recordUpdateTimestamp = #{recordUpdateTimestamp}
+		</if>
+		<if test="status != null and status != ''">
+			AND status = #{status}
+		</if>
+		<if test="deleteMarker != null and deleteMarker != ''">
+			AND deleteMarker = #{deleteMarker}
+		</if>
+	</select>
+
+	<!--查询患者基础信息根据Id-->
+	<select id="selectPatientBasicInfoById" parameterType="pd" resultType="pd">
+		SELECT * FROM s_dtp_ysfw_patientbasicinfor WHERE 1=1
+		<if test="id != null and id != ''">
+			AND archiveId = #{id}
+		</if>
+
+	</select>
+
+	<!--添加患者基础信息-->
+	<insert id="insertPatientBasicInfo" parameterType="pd">
+		INSERT INTO s_dtp_ysfw_patientbasicinfor
+		<trim prefix="(" suffix=")" prefixOverrides="," suffixOverrides=",">
+			<if test="id != null and id != ''">id,</if>
+			<if test="currentEconomicSituation != null and currentEconomicSituation != ''">currentEconomicSituation,</if>
+			<if test="patientAwareness != null and patientAwareness != ''">patientAwareness,</if>
+			<if test="followUpFeedbackDoctor != null and followUpFeedbackDoctor != ''">followUpFeedbackDoctor,</if>
+			<if test="bloodPressureStatus != null and bloodPressureStatus != ''">bloodPressureStatus,</if>
+			<if test="heartRate != null and heartRate != ''">heartRate,</if>
+			<if test="smokingHistory != null and smokingHistory != ''">smokingHistory,</if>
+			<if test="drinkingHistory != null and drinkingHistory != ''">drinkingHistory,</if>
+			<if test="exerciseHabit != null and exerciseHabit != ''">exerciseHabit,</if>
+			<if test="dietaryPreference != null and dietaryPreference != ''">dietaryPreference,</if>
+			<if test="sleepCondition != null and sleepCondition != ''">sleepCondition,</if>
+			<if test="pathologicalStage != null and pathologicalStage != ''">pathologicalStage,</if>
+			<if test="treatmentStage != null and treatmentStage != ''">treatmentStage,</if>
+			<if test="accompanyingSymptoms != null and accompanyingSymptoms != ''">accompanyingSymptoms,</if>
+			<if test="hasGeneticTesting != null and hasGeneticTesting != ''">hasGeneticTesting,</if>
+			<if test="hasImmuneTesting != null and hasImmuneTesting != ''">hasImmuneTesting,</if>
+			<if test="medicalHistory != null and medicalHistory != ''">medicalHistory,</if>
+			<if test="medicalHistoryDescription != null and medicalHistoryDescription != ''">medicalHistoryDescription,</if>
+			<if test="infectiousDiseaseHistory != null and infectiousDiseaseHistory != ''">infectiousDiseaseHistory,</if>
+			<if test="infectiousDiseaseHistoryDescription != null and infectiousDiseaseHistoryDescription != ''">infectiousDiseaseHistoryDescription,</if>
+			<if test="allergyHistory != null and allergyHistory != ''">allergyHistory,</if>
+			<if test="pastAdverseDrugReactionHistory != null and pastAdverseDrugReactionHistory != ''">pastAdverseDrugReactionHistory,</if>
+			<if test="hasSurgicalTraumaHistory != null and hasSurgicalTraumaHistory != ''">hasSurgicalTraumaHistory,</if>
+			<if test="multipleTreatmentReasonsDescription != null and multipleTreatmentReasonsDescription != ''">multipleTreatmentReasonsDescription,</if>
+			<if test="familyHistoryId != null and familyHistoryId != ''">familyHistoryId,</if>
+			<if test="previousMedicationId != null and previousMedicationId != ''">previousMedicationId,</if>
+			<if test="contactPersonId != null and contactPersonId != ''">contactPersonId,</if>
+			<if test="archiveId != null and archiveId != ''">archiveId,</if>
+			<if test="caregiver != null and caregiver != ''">caregiver,</if>
+			<if test="createdBy != null and createdBy != ''">createdBy,</if>
+			<if test="createdAt != null and createdAt != ''">createdAt,</if>
+			<if test="basicInfoCompleter != null and basicInfoCompleter != ''">basicInfoCompleter,</if>
+			<if test="recordUpdateTimestamp != null and recordUpdateTimestamp != ''">recordUpdateTimestamp,</if>
+			<if test="status != null and status != ''">status,</if>
+			<if test="deleteMarker != null and deleteMarker != ''">deleteMarker</if>
+		</trim>
+
+		<trim prefix="VALUES (" suffix=")" prefixOverrides="," suffixOverrides=",">
+			<if test="id != null and id != ''">#{id},</if>
+			<if test="currentEconomicSituation != null and currentEconomicSituation != ''">#{currentEconomicSituation},</if>
+			<if test="patientAwareness != null and patientAwareness != ''">#{patientAwareness},</if>
+			<if test="followUpFeedbackDoctor != null and followUpFeedbackDoctor != ''">#{followUpFeedbackDoctor},</if>
+			<if test="bloodPressureStatus != null and bloodPressureStatus != ''">#{bloodPressureStatus},</if>
+			<if test="heartRate != null and heartRate != ''">#{heartRate},</if>
+			<if test="smokingHistory != null and smokingHistory != ''">#{smokingHistory},</if>
+			<if test="drinkingHistory != null and drinkingHistory != ''">#{drinkingHistory},</if>
+			<if test="exerciseHabit != null and exerciseHabit != ''">#{exerciseHabit},</if>
+			<if test="dietaryPreference != null and dietaryPreference != ''">#{dietaryPreference},</if>
+			<if test="sleepCondition != null and sleepCondition != ''">#{sleepCondition},</if>
+			<if test="pathologicalStage != null and pathologicalStage != ''">#{pathologicalStage},</if>
+			<if test="treatmentStage != null and treatmentStage != ''">#{treatmentStage},</if>
+			<if test="accompanyingSymptoms != null and accompanyingSymptoms != ''">#{accompanyingSymptoms},</if>
+			<if test="hasGeneticTesting != null and hasGeneticTesting != ''">#{hasGeneticTesting},</if>
+			<if test="hasImmuneTesting != null and hasImmuneTesting != ''">#{hasImmuneTesting},</if>
+			<if test="medicalHistory != null and medicalHistory != ''">#{medicalHistory},</if>
+			<if test="medicalHistoryDescription != null and medicalHistoryDescription != ''">#{medicalHistoryDescription},</if>
+			<if test="infectiousDiseaseHistory != null and infectiousDiseaseHistory != ''">#{infectiousDiseaseHistory},</if>
+			<if test="infectiousDiseaseHistoryDescription != null and infectiousDiseaseHistoryDescription != ''">#{infectiousDiseaseHistoryDescription},</if>
+			<if test="allergyHistory != null and allergyHistory != ''">#{allergyHistory},</if>
+			<if test="pastAdverseDrugReactionHistory != null and pastAdverseDrugReactionHistory != ''">#{pastAdverseDrugReactionHistory},</if>
+			<if test="hasSurgicalTraumaHistory != null and hasSurgicalTraumaHistory != ''">#{hasSurgicalTraumaHistory},</if>
+			<if test="multipleTreatmentReasonsDescription != null and multipleTreatmentReasonsDescription != ''">#{multipleTreatmentReasonsDescription},</if>
+			<if test="familyHistoryId != null and familyHistoryId != ''">#{familyHistoryId},</if>
+			<if test="previousMedicationId != null and previousMedicationId != ''">#{previousMedicationId},</if>
+			<if test="contactPersonId != null and contactPersonId != ''">#{contactPersonId},</if>
+			<if test="archiveId != null and archiveId != ''">#{archiveId},</if>
+			<if test="caregiver != null and caregiver != ''">#{caregiver},</if>
+			<if test="createdBy != null and createdBy != ''">#{createdBy},</if>
+			<if test="createdAt != null and createdAt != ''">#{createdAt},</if>
+			<if test="basicInfoCompleter != null and basicInfoCompleter != ''">#{basicInfoCompleter},</if>
+			<if test="recordUpdateTimestamp != null and recordUpdateTimestamp != ''">#{recordUpdateTimestamp},</if>
+			<if test="status != null and status != ''">#{status},</if>
+			<if test="deleteMarker != null and deleteMarker != ''">#{deleteMarker}</if>
+		</trim>
+	</insert>
+	<!--修改患者基础信息-->
+	<update id="updatePatientBasicInfo" parameterType="pd">
+		UPDATE s_dtp_ysfw_patientbasicinfor SET
+		<trim prefix="" suffixOverrides="," prefixOverrides=",">
+			<if test="currentEconomicSituation != null and currentEconomicSituation != ''">
+				currentEconomicSituation = #{currentEconomicSituation},
+			</if>
+			<if test="patientAwareness != null and patientAwareness != ''">
+				patientAwareness = #{patientAwareness},
+			</if>
+			<if test="followUpFeedbackDoctor != null and followUpFeedbackDoctor != ''">
+				followUpFeedbackDoctor = #{followUpFeedbackDoctor},
+			</if>
+			<if test="bloodPressureStatus != null and bloodPressureStatus != ''">
+				bloodPressureStatus = #{bloodPressureStatus},
+			</if>
+			<if test="heartRate != null and heartRate != ''">
+				heartRate = #{heartRate},
+			</if>
+			<if test="smokingHistory != null and smokingHistory != ''">
+				smokingHistory = #{smokingHistory},
+			</if>
+			<if test="drinkingHistory != null and drinkingHistory != ''">
+				drinkingHistory = #{drinkingHistory},
+			</if>
+			<if test="exerciseHabit != null and exerciseHabit != ''">
+				exerciseHabit = #{exerciseHabit},
+			</if>
+			<if test="dietaryPreference != null and dietaryPreference != ''">
+				dietaryPreference = #{dietaryPreference},
+			</if>
+			<if test="sleepCondition != null and sleepCondition != ''">
+				sleepCondition = #{sleepCondition},
+			</if>
+			<if test="pathologicalStage != null and pathologicalStage != ''">
+				pathologicalStage = #{pathologicalStage},
+			</if>
+			<if test="treatmentStage != null and treatmentStage != ''">
+				treatmentStage = #{treatmentStage},
+			</if>
+			<if test="accompanyingSymptoms != null and accompanyingSymptoms != ''">
+				accompanyingSymptoms = #{accompanyingSymptoms},
+			</if>
+			<if test="hasGeneticTesting != null and hasGeneticTesting != ''">
+				hasGeneticTesting = #{hasGeneticTesting},
+			</if>
+			<if test="hasImmuneTesting != null and hasImmuneTesting != ''">
+				hasImmuneTesting = #{hasImmuneTesting},
+			</if>
+			<if test="medicalHistory != null and medicalHistory != ''">
+				medicalHistory = #{medicalHistory},
+			</if>
+			<if test="medicalHistoryDescription != null and medicalHistoryDescription != ''">
+				medicalHistoryDescription = #{medicalHistoryDescription},
+			</if>
+			<if test="infectiousDiseaseHistory != null and infectiousDiseaseHistory != ''">
+				infectiousDiseaseHistory = #{infectiousDiseaseHistory},
+			</if>
+			<if test="infectiousDiseaseHistoryDescription != null and infectiousDiseaseHistoryDescription != ''">
+				infectiousDiseaseHistoryDescription = #{infectiousDiseaseHistoryDescription},
+			</if>
+			<if test="allergyHistory != null and allergyHistory != ''">
+				allergyHistory = #{allergyHistory},
+			</if>
+			<if test="pastAdverseDrugReactionHistory != null and pastAdverseDrugReactionHistory != ''">
+				pastAdverseDrugReactionHistory = #{pastAdverseDrugReactionHistory},
+			</if>
+			<if test="hasSurgicalTraumaHistory != null and hasSurgicalTraumaHistory != ''">
+				hasSurgicalTraumaHistory = #{hasSurgicalTraumaHistory},
+			</if>
+			<if test="multipleTreatmentReasonsDescription != null and multipleTreatmentReasonsDescription != ''">
+				multipleTreatmentReasonsDescription = #{multipleTreatmentReasonsDescription},
+			</if>
+			<if test="familyHistoryId != null and familyHistoryId != ''">
+				familyHistoryId = #{familyHistoryId},
+			</if>
+			<if test="previousMedicationId != null and previousMedicationId != ''">
+				previousMedicationId = #{previousMedicationId},
+			</if>
+			<if test="contactPersonId != null and contactPersonId != ''">
+				contactPersonId = #{contactPersonId},
+			</if>
+			<if test="archiveId != null and archiveId != ''">
+				archiveId = #{archiveId},
+			</if>
+			<if test="caregiver != null and caregiver != ''">
+				caregiver = #{caregiver},
+			</if>
+			<if test="createdBy != null and createdBy != ''">
+				createdBy = #{createdBy},
+			</if>
+			<if test="createdAt != null and createdAt != ''">
+				createdAt = #{createdAt},
+			</if>
+			<if test="basicInfoCompleter != null and basicInfoCompleter != ''">
+				basicInfoCompleter = #{basicInfoCompleter},
+			</if>
+			<if test="recordUpdateTimestamp != null and recordUpdateTimestamp != ''">
+				recordUpdateTimestamp = #{recordUpdateTimestamp},
+			</if>
+			<if test="status != null and status != ''">
+				status = #{status},
+			</if>
+			<if test="deleteMarker != null and deleteMarker != ''">
+				deleteMarker = #{deleteMarker}
+			</if>
+		</trim>
+		WHERE id = #{id}
+	</update>
+
+	<!--假删除患者基础信息表-->
+	<update id="deletePatientBasicInfo" parameterType="pd">
+		UPDATE s_dtp_ysfw_patientbasicinfor SET status = 0 ,deleteMarker =1 WHERE id = #{id}
+	</update>
+
+	<!--物理患者基础信息表-->
+	<update id="delPatientBasicInfo" parameterType="pd">
+		DELETE FROM s_dtp_ysfw_patientbasicinfor WHERE id = #{id}
+	</update>
+
+
+	<!--联系人信息查询-->
+	<select id="selectContacts" parameterType="pd" resultType="pd">
+		SELECT * FROM s_dtp_ysfw_contacts WHERE 1=1
+		<if test="id != null and id != ''">
+			AND id = #{id}
+		</if>
+		<if test="patient_archive_id != null and patient_archive_id != ''">
+			AND patient_archive_id = #{patient_archive_id}
+		</if>
+		<if test="contact_phone != null and contact_phone != ''">
+			AND contact_phone = #{contact_phone}
+		</if>
+		<if test="contact_name != null and contact_name != ''">
+			AND contact_name = #{contact_name}
+		</if>
+		<if test="contact_relationship != null and contact_relationship != ''">
+			AND contact_relationship = #{contact_relationship}
+		</if>
+		<if test="created_by != null and created_by != ''">
+			AND created_by = #{created_by}
+		</if>
+		<if test="status != null and status != ''">
+			AND status = #{status}
+		</if>
+	</select>
+
+	<!--联系人信息添加-->
+	<insert id="insertContact" parameterType="pd">
+		INSERT INTO s_dtp_ysfw_contacts
+		<trim prefix="(" suffix=")" prefixOverrides="," suffixOverrides=",">
+			<if test="id != null and id != ''">id,</if>
+			<if test="patient_archive_id != null and patient_archive_id != ''">patient_archive_id,</if>
+			<if test="contact_phone != null and contact_phone != ''">contact_phone,</if>
+			<if test="contact_name != null and contact_name != ''">contact_name,</if>
+			<if test="contact_relationship != null and contact_relationship != ''">contact_relationship,</if>
+			<if test="created_by != null and created_by != ''">created_by,</if>
+			<if test="created_at != null and created_at != ''">created_at,</if>
+			<if test="updated_at != null and updated_at != ''">updated_at,</if>
+			<if test="status != null and status != ''">status</if>
+		</trim>
+
+		<trim prefix="VALUES (" suffix=")" prefixOverrides="," suffixOverrides=",">
+			<if test="id != null and id != ''">#{id},</if>
+			<if test="patient_archive_id != null and patient_archive_id != ''">#{patient_archive_id},</if>
+			<if test="contact_phone != null and contact_phone != ''">#{contact_phone},</if>
+			<if test="contact_name != null and contact_name != ''">#{contact_name},</if>
+			<if test="contact_relationship != null and contact_relationship != ''">#{contact_relationship},</if>
+			<if test="created_by != null and created_by != ''">#{created_by},</if>
+			<if test="created_at != null and created_at != ''">#{created_at},</if>
+			<if test="updated_at != null and updated_at != ''">#{updated_at},</if>
+			<if test="status != null and status != ''">#{status}</if>
+		</trim>
+	</insert>
+	<!--联系人信息修改-->
+	<update id="updateContact" parameterType="pd">
+		UPDATE s_dtp_ysfw_contacts SET
+		<trim prefix="" suffixOverrides="," prefixOverrides=",">
+			<if test="patient_archive_id != null and patient_archive_id != ''">
+				patient_archive_id = #{patient_archive_id},
+			</if>
+			<if test="contact_phone != null and contact_phone != ''">
+				contact_phone = #{contact_phone},
+			</if>
+			<if test="contact_name != null and contact_name != ''">
+				contact_name = #{contact_name},
+			</if>
+			<if test="contact_relationship != null and contact_relationship != ''">
+				contact_relationship = #{contact_relationship},
+			</if>
+			<if test="created_by != null and created_by != ''">
+				created_by = #{created_by},
+			</if>
+			<if test="status != null and status != ''">
+				status = #{status}
+			</if>
+		</trim>
+		WHERE id = #{id}
+	</update>
+
+	<!--家族病史表信息查询-->
+	<select id="selectFamilyHistories" parameterType="pd" resultType="pd">
+		SELECT * FROM s_dtp_ysfw_family_history WHERE 1=1
+		<if test="id != null and id != ''">
+			AND id = #{id}
+		</if>
+		<if test="patient_archive_id != null and patient_archive_id != ''">
+			AND patient_archive_id = #{patient_archive_id}
+		</if>
+		<if test="disease != null and disease != ''">
+			AND disease = #{disease}
+		</if>
+		<if test="member != null and member != ''">
+			AND member = #{member}
+		</if>
+		<if test="created_by != null and created_by != ''">
+			AND created_by = #{created_by}
+		</if>
+		<if test="status != null and status != ''">
+			AND status = #{status}
+		</if>
+	</select>
+
+	<!--家族病史表信息添加-->
+	<insert id="insertFamilyHistory" parameterType="pd">
+		INSERT INTO s_dtp_ysfw_family_history
+		<trim prefix="(" suffix=")" prefixOverrides="," suffixOverrides=",">
+			<if test="id != null and id != ''">id,</if>
+			<if test="patient_archive_id != null and patient_archive_id != ''">patient_archive_id,</if>
+			<if test="disease != null and disease != ''">disease,</if>
+			<if test="member != null and member != ''">member,</if>
+			<if test="created_by != null and created_by != ''">created_by,</if>
+			<if test="created_at != null and created_at != ''">created_at,</if>
+			<if test="updated_at != null and updated_at != ''">updated_at,</if>
+			<if test="status != null and status != ''">status</if>
+		</trim>
+
+		<trim prefix="VALUES (" suffix=")" prefixOverrides="," suffixOverrides=",">
+			<if test="id != null and id != ''">#{id},</if>
+			<if test="patient_archive_id != null and patient_archive_id != ''">#{patient_archive_id},</if>
+			<if test="disease != null and disease != ''">#{disease},</if>
+			<if test="member != null and member != ''">#{member},</if>
+			<if test="created_by != null and created_by != ''">#{created_by},</if>
+			<if test="created_at != null and created_at != ''">#{created_at},</if>
+			<if test="updated_at != null and updated_at != ''">#{updated_at},</if>
+			<if test="status != null and status != ''">#{status}</if>
+		</trim>
+	</insert>
+	<!--家族病史表信息修改-->
+	<update id="updateFamilyHistory" parameterType="pd">
+		UPDATE s_dtp_ysfw_family_history SET
+		<trim prefix="" suffixOverrides="," prefixOverrides=",">
+			<if test="patient_archive_id != null and patient_archive_id != ''">
+				patient_archive_id = #{patient_archive_id},
+			</if>
+			<if test="disease != null and disease != ''">
+				disease = #{disease},
+			</if>
+			<if test="member != null and member != ''">
+				member = #{member},
+			</if>
+			<if test="created_by != null and created_by != ''">
+				created_by = #{created_by},
+			</if>
+			<if test="status != null and status != ''">
+				status = #{status}
+			</if>
+		</trim>
+		WHERE id = #{id}
+	</update>
+	 <!--用药情况表表信息查询-->
+	<select id="selectMedicationRecords" parameterType="pd" resultType="pd">
+		SELECT * FROM s_dtp_ysfw_medication_records WHERE 1=1
+		<if test="id != null and id != ''">
+			AND id = #{id}
+		</if>
+		<if test="patient_archive_id != null and patient_archive_id != ''">
+			AND patient_archive_id = #{patient_archive_id}
+		</if>
+		<if test="medication_description != null and medication_description != ''">
+			AND medication_description = #{medication_description}
+		</if>
+		<if test="medication_type != null and medication_type != ''">
+			AND medication_type = #{medication_type}
+		</if>
+		<if test="created_by != null and created_by != ''">
+			AND created_by = #{created_by}
+		</if>
+		<if test="status != null and status != ''">
+			AND status = #{status}
+		</if>
+	</select>
+	<!--用药情况表表信息添加-->
+	<insert id="insertMedicationRecord" parameterType="pd">
+		INSERT INTO s_dtp_ysfw_medication_records
+		<trim prefix="(" suffix=")" prefixOverrides="," suffixOverrides=",">
+			<if test="id != null and id != ''">id,</if>
+			<if test="patient_archive_id != null and patient_archive_id != ''">patient_archive_id,</if>
+			<if test="medication_description != null and medication_description != ''">medication_description,</if>
+			<if test="medication_type != null and medication_type != ''">medication_type,</if>
+			<if test="created_by != null and created_by != ''">created_by,</if>
+			<if test="created_at != null and created_at != ''">created_at,</if>
+			<if test="updated_at != null and updated_at != ''">updated_at,</if>
+			<if test="status != null and status != ''">status</if>
+		</trim>
+
+		<trim prefix="VALUES (" suffix=")" prefixOverrides="," suffixOverrides=",">
+			<if test="id != null and id != ''">#{id},</if>
+			<if test="patient_archive_id != null and patient_archive_id != ''">#{patient_archive_id},</if>
+			<if test="medication_description != null and medication_description != ''">#{medication_description},</if>
+			<if test="medication_type != null and medication_type != ''">#{medication_type},</if>
+			<if test="created_by != null and created_by != ''">#{created_by},</if>
+			<if test="created_at != null and created_at != ''">#{created_at},</if>
+			<if test="updated_at != null and updated_at != ''">#{updated_at},</if>
+			<if test="status != null and status != ''">#{status}</if>
+		</trim>
+	</insert>
+
+	<!--用药情况表表信息修改-->
+	<update id="updateMedicationRecord" parameterType="pd">
+		UPDATE s_dtp_ysfw_medication_records SET
+		<trim prefix="" suffixOverrides="," prefixOverrides=",">
+			<if test="patient_archive_id != null and patient_archive_id != ''">
+				patient_archive_id = #{patient_archive_id},
+			</if>
+			<if test="medication_description != null and medication_description != ''">
+				medication_description = #{medication_description},
+			</if>
+			<if test="medication_type != null and medication_type != ''">
+				medication_type = #{medication_type},
+			</if>
+			<if test="created_by != null and created_by != ''">
+				created_by = #{created_by},
+			</if>
+			<if test="status != null and status != ''">
+				status = #{status}
+			</if>
+		</trim>
+		WHERE id = #{id}
+	</update>
+
+
+	<!--物理删除家 联系人表,族病史表,用药情况表-->
+	<update id="physicalDeleteContact" parameterType="pd">
+		DELETE FROM s_dtp_ysfw_contacts WHERE id = #{id}
+	</update>
+
+	<update id="physicalDeleteFamilyHistory" parameterType="pd">
+		DELETE FROM s_dtp_ysfw_family_history WHERE id = #{id}
+	</update>
+
+	<update id="physicalDeleteMedicationRecord" parameterType="pd">
+		DELETE FROM s_dtp_ysfw_medication_records WHERE id = #{id}
+	</update>
+
 </mapper>

+ 9 - 12
health-system/src/main/resources/mapper/system/DTPMapper.xml

@@ -6,9 +6,9 @@
 <!--处方登记 -->
     <select id="RecipeRegisterList" parameterType="pd" resultType="pd">
         select id, orderId, saleOrderNumber, genericName, productName, specification, quantity, manufacturer, mdmCode,
-        posMemberName, posMemberPhone, prescriptionType, orderTime, prescriptionNumber, hospital, department,
+        posMemberName, posMemberPhone, prescriptionType, prescriptionNumber, hospital, department,
         doctor, patientName, patientPhone, storeName, registrar, completionTime,lastUpdated, deliveryMethod, paymentCode,
-        paymentMethod, status ,create_time as createTime  from s_dtp_cfdj_prescription
+        paymentMethod, status , createTime  from s_dtp_cfdj_prescription
         <where>
             <if test="id != null">AND id = #{id}</if>
             <if test="orderId != null and orderId!=''">AND orderId = #{orderId}</if>
@@ -23,7 +23,7 @@
             <if test="posMemberPhone != null and posMemberPhone!=''">AND posMemberPhone = #{posMemberPhone}</if>
             <if test="prescriptionType != null and prescriptionType!=''">AND prescriptionType=#{prescriptionType}</if>
             <if test="beginTime != null and beginTime!='' and endTime != null and endTime!=''">
-                and orderTime between #{beginTime} and #{endTime}
+                and createTime between #{beginTime} and #{endTime}
             </if>
             <if test="prescriptionNumber != null and prescriptionNumber!=''">AND prescriptionNumber = #{prescriptionNumber}</if>
             <if test="hospital != null and hospital!=''">AND hospital = #{hospital}</if>
@@ -40,10 +40,10 @@
             <if test="paymentCode != null and paymentCode!=''">AND paymentCode = #{paymentCode}</if>
             <if test="paymentMethod != null and paymentMethod!=''">AND paymentMethod = #{paymentMethod}</if>
             <if test="status != null  and status!=''">AND status = #{status}</if>
-            <if test="createTime != null and createTime!=''">AND create_time = #{createTime}</if>
+            <if test="createTime != null and createTime!=''">AND createTime = #{createTime}</if>
             and del_flag = '0'
         </where>
-        order by create_time desc
+        order by createTime desc
     </select>
 
     <insert id="insertRecipe" parameterType="pd">
@@ -60,7 +60,6 @@
             <if test="posMemberName != null and posMemberName!=''">posMemberName,</if>
             <if test="posMemberPhone != null and posMemberPhone!=''">posMemberPhone,</if>
             <if test="prescriptionType != null and prescriptionType!=''">prescriptionType,</if>
-            <if test="orderTime != null and orderTime!=''">orderTime,</if>
             <if test="prescriptionNumber != null and prescriptionNumber!=''">prescriptionNumber,</if>
             <if test="hospital != null and hospital!=''">hospital,</if>
             <if test="department != null and department!=''">department,</if>
@@ -75,7 +74,7 @@
             <if test="paymentMethod != null and paymentMethod!=''">paymentMethod,</if>
             <if test="status != null and status!=''">status},</if>
             <if test="lastUpdated != null and lastUpdated!=''">lastUpdated,</if>
-            <if test="createTime != null and createTime!=''">create_time,</if>
+            <if test="createTime != null and createTime!=''">createTime,</if>
         </trim>
         <trim prefix=" VALUES (" suffix=")" prefixOverrides="," suffixOverrides=",">
             <if test="orderId != null and orderId!=''">#{orderId},</if>
@@ -89,7 +88,6 @@
             <if test="posMemberName != null and posMemberName!=''">#{posMemberName},</if>
             <if test="posMemberPhone != null and posMemberPhone!=''">#{posMemberPhone},</if>
             <if test="prescriptionType != null and prescriptionType!=''">#{prescriptionType},</if>
-            <if test="orderTime != null and orderTime!=''">#{orderTime},</if>
             <if test="prescriptionNumber != null and prescriptionNumber!=''">#{prescriptionNumber},</if>
             <if test="hospital != null and hospital!=''">#{hospital},</if>
             <if test="department != null and department!=''">#{department},</if>
@@ -130,7 +128,6 @@
             <if test="posMemberName != null and posMemberName!=''">posMemberName=#{posMemberName},</if>
             <if test="posMemberPhone != null and posMemberPhone!=''">posMemberPhone=#{posMemberPhone},</if>
             <if test="prescriptionType != null and prescriptionType!=''">prescriptionType=#{prescriptionType},</if>
-            <if test="orderTime != null">orderTime=#{orderTime},</if>
             <if test="prescriptionNumber != null and prescriptionNumber!=''">prescriptionNumber=#{prescriptionNumber},</if>
             <if test="hospital != null">hospital=#{hospital},</if>
             <if test="department != null">department=#{department},</if>
@@ -145,7 +142,7 @@
             <if test="paymentMethod != null and paymentMethod!=''">paymentMethod=#{paymentMethod},</if>
             <if test="status != null and status!=''">status=#{status},</if>
             <if test="lastUpdated != null and lastUpdated!=''">lastUpdated=#{lastUpdated},</if>
-            <if test="createTime != null and createTime!=''">create_time=#{createTime},</if>
+            <if test="createTime != null and createTime!=''">createTime=#{createTime},</if>
         </trim>
         where id=#{id}
     </update>
@@ -154,9 +151,9 @@
     </select>
     <select id="selectOne" parameterType="pd" resultType="pd">
         select id, orderId, saleOrderNumber, genericName, productName, specification, quantity, manufacturer, mdmCode,
-        posMemberName, posMemberPhone, prescriptionType, orderTime, prescriptionNumber, hospital, department,
+        posMemberName, posMemberPhone, prescriptionType, prescriptionNumber, hospital, department,
         doctor, patientName, patientPhone, storeName, registrar, completionTime, lastUpdated,deliveryMethod, paymentCode,
-        paymentMethod, status ,create_time as createTime  from s_dtp_cfdj_prescription where id=#{id}
+        paymentMethod, status ,createTime  from s_dtp_cfdj_prescription where id=#{id}
     </select>