gugu 3 viikkoa sitten
vanhempi
commit
739c53fb1c

BIN
api_response.json


+ 142 - 19
src/main/java/org/example/entity/Patient.java

@@ -1,35 +1,59 @@
 package org.example.entity;
 
 public class Patient {
-    private String admissionDateTime;  // 入院时间
-    private String inpatientNo;        // 住院号
-    private String name;               // 患者姓名
-    private String sex;                // 性别
-    private Integer age;               // 年龄
-    private String deptCode;           // 所属科室
-    private String wardCode;           // 所属病区
-    private String roomNo;             // 房间号
-    private String bedNo;              // 床位号
-    private String nurseLevel;         // 护理级别
-    private String inpatientStatus;    // 在院状态
+    private String admissionDateTime;     // 入院时间
+    private String inpatientNo;           // 住院号
+    private String name;                  // 患者姓名
+    private String sex;                   // 性别
+    private Integer age;                  // 年龄
+    private String medicalInsuranceType;// 医保类型
+    private String deptCode;              // 所属科室
+    private String wardCode;              // 所属病区
+    private String roomNo;                // 房间号
+    private String bedNo;                 // 床位号
+    private String doctorCode;            // 责任医生
+    private String nurseCode;             // 责任护士
+    private String inpatientSerialNo;     // 住院流水号
+    private String deptDateTime;          // 入科时间
+    private String dischargedDateTime;    // 出院时间
+    private String inpatientStatus;       // 在院状态
+    private String diagnose;              // 入院诊断
+    private String conditionStatus;       // 病情状况
+    private String nurseLevel;            // 护理级别
+    private String allergen;              // 过敏信息
+    private String dietType;              // 饮食状况
+    private String notice;                // 安全防范
 
     // Constructors
     public Patient() {}
 
     public Patient(String admissionDateTime, String inpatientNo, String name, String sex, Integer age,
-                   String deptCode, String wardCode, String roomNo, String bedNo, String nurseLevel,
-                   String inpatientStatus) {
+                   String medicalInsuranceType, String deptCode, String wardCode, String roomNo, String bedNo,
+                   String doctorCode, String nurseCode, String inpatientSerialNo, String deptDateTime,
+                   String dischargedDateTime, String inpatientStatus, String diagnose, String conditionStatus,
+                   String nurseLevel, String allergen, String dietType, String notice) {
         this.admissionDateTime = admissionDateTime;
         this.inpatientNo = inpatientNo;
         this.name = name;
         this.sex = sex;
         this.age = age;
+        this.medicalInsuranceType = medicalInsuranceType;
         this.deptCode = deptCode;
         this.wardCode = wardCode;
         this.roomNo = roomNo;
         this.bedNo = bedNo;
-        this.nurseLevel = nurseLevel;
+        this.doctorCode = doctorCode;
+        this.nurseCode = nurseCode;
+        this.inpatientSerialNo = inpatientSerialNo;
+        this.deptDateTime = deptDateTime;
+        this.dischargedDateTime = dischargedDateTime;
         this.inpatientStatus = inpatientStatus;
+        this.diagnose = diagnose;
+        this.conditionStatus = conditionStatus;
+        this.nurseLevel = nurseLevel;
+        this.allergen = allergen;
+        this.dietType = dietType;
+        this.notice = notice;
     }
 
     // Getters and Setters
@@ -73,6 +97,14 @@ public class Patient {
         this.age = age;
     }
 
+    public String getMedicalInsuranceType() {
+        return medicalInsuranceType;
+    }
+
+    public void setMedicalInsuranceType(String medicalInsuranceType) {
+        this.medicalInsuranceType = medicalInsuranceType;
+    }
+
     public String getDeptCode() {
         return deptCode;
     }
@@ -105,12 +137,44 @@ public class Patient {
         this.bedNo = bedNo;
     }
 
-    public String getNurseLevel() {
-        return nurseLevel;
+    public String getDoctorCode() {
+        return doctorCode;
     }
 
-    public void setNurseLevel(String nurseLevel) {
-        this.nurseLevel = nurseLevel;
+    public void setDoctorCode(String doctorCode) {
+        this.doctorCode = doctorCode;
+    }
+
+    public String getNurseCode() {
+        return nurseCode;
+    }
+
+    public void setNurseCode(String nurseCode) {
+        this.nurseCode = nurseCode;
+    }
+
+    public String getInpatientSerialNo() {
+        return inpatientSerialNo;
+    }
+
+    public void setInpatientSerialNo(String inpatientSerialNo) {
+        this.inpatientSerialNo = inpatientSerialNo;
+    }
+
+    public String getDeptDateTime() {
+        return deptDateTime;
+    }
+
+    public void setDeptDateTime(String deptDateTime) {
+        this.deptDateTime = deptDateTime;
+    }
+
+    public String getDischargedDateTime() {
+        return dischargedDateTime;
+    }
+
+    public void setDischargedDateTime(String dischargedDateTime) {
+        this.dischargedDateTime = dischargedDateTime;
     }
 
     public String getInpatientStatus() {
@@ -121,6 +185,54 @@ public class Patient {
         this.inpatientStatus = inpatientStatus;
     }
 
+    public String getDiagnose() {
+        return diagnose;
+    }
+
+    public void setDiagnose(String diagnose) {
+        this.diagnose = diagnose;
+    }
+
+    public String getConditionStatus() {
+        return conditionStatus;
+    }
+
+    public void setConditionStatus(String conditionStatus) {
+        this.conditionStatus = conditionStatus;
+    }
+
+    public String getNurseLevel() {
+        return nurseLevel;
+    }
+
+    public void setNurseLevel(String nurseLevel) {
+        this.nurseLevel = nurseLevel;
+    }
+
+    public String getAllergen() {
+        return allergen;
+    }
+
+    public void setAllergen(String allergen) {
+        this.allergen = allergen;
+    }
+
+    public String getDietType() {
+        return dietType;
+    }
+
+    public void setDietType(String dietType) {
+        this.dietType = dietType;
+    }
+
+    public String getNotice() {
+        return notice;
+    }
+
+    public void setNotice(String notice) {
+        this.notice = notice;
+    }
+
     @Override
     public String toString() {
         return "Patient{" +
@@ -129,12 +241,23 @@ public class Patient {
                 ", name='" + name + '\'' +
                 ", sex='" + sex + '\'' +
                 ", age=" + age +
+                ", medicalInsuranceType='" + medicalInsuranceType + '\'' +
                 ", deptCode='" + deptCode + '\'' +
                 ", wardCode='" + wardCode + '\'' +
                 ", roomNo='" + roomNo + '\'' +
                 ", bedNo='" + bedNo + '\'' +
-                ", nurseLevel='" + nurseLevel + '\'' +
+                ", doctorCode='" + doctorCode + '\'' +
+                ", nurseCode='" + nurseCode + '\'' +
+                ", inpatientSerialNo='" + inpatientSerialNo + '\'' +
+                ", deptDateTime='" + deptDateTime + '\'' +
+                ", dischargedDateTime='" + dischargedDateTime + '\'' +
                 ", inpatientStatus='" + inpatientStatus + '\'' +
+                ", diagnose='" + diagnose + '\'' +
+                ", conditionStatus='" + conditionStatus + '\'' +
+                ", nurseLevel='" + nurseLevel + '\'' +
+                ", allergen='" + allergen + '\'' +
+                ", dietType='" + dietType + '\'' +
+                ", notice='" + notice + '\'' +
                 '}';
     }
 }

+ 32 - 11
src/main/java/org/example/mapper/PatientMapper.java

@@ -13,8 +13,12 @@ public interface PatientMapper {
      * @return 患者列表
      */
     @Select("SELECT admission_date_time AS admissionDateTime, inpatient_no AS inpatientNo, name, sex, age, " +
-            "dept_code AS deptCode, ward_code AS wardCode, room_no AS roomNo, bed_no AS bedNo, " +
-            "nurse_level AS nurseLevel, inpatient_status AS inpatientStatus FROM tb_hospital_patient")
+            "medical_insurance_type AS medicalInsuranceType, dept_code AS deptCode, ward_code AS wardCode, room_no AS roomNo, bed_no AS bedNo, " +
+            "doctor_code AS doctorCode, nurse_code AS nurseCode, inpatient_serial_no AS inpatientSerialNo, " +
+            "dept_date_time AS deptDateTime, discharged_date_time AS dischargedDateTime, " +
+            "inpatient_status AS inpatientStatus, diagnose, condition_status AS conditionStatus, " +
+            "nurse_level AS nurseLevel, allergen, diet_type AS dietType, notice " +
+            "FROM tb_hospital_patient")
     List<Patient> findAll();
     
     /**
@@ -24,15 +28,19 @@ public interface PatientMapper {
     @Select({
         "<script>",
         "SELECT admission_date_time AS admissionDateTime, inpatient_no AS inpatientNo, name, sex, age, " +
-        "dept_code AS deptCode, ward_code AS wardCode, room_no AS roomNo, bed_no AS bedNo, " +
-        "nurse_level AS nurseLevel, inpatient_status AS inpatientStatus FROM tb_hospital_patient",
+        "medical_insurance_type AS medicalInsuranceType, dept_code AS deptCode, ward_code AS wardCode, room_no AS roomNo, bed_no AS bedNo, " +
+        "doctor_code AS doctorCode, nurse_code AS nurseCode, inpatient_serial_no AS inpatientSerialNo, " +
+        "dept_date_time AS deptDateTime, discharged_date_time AS dischargedDateTime, " +
+        "inpatient_status AS inpatientStatus, diagnose, condition_status AS conditionStatus, " +
+        "nurse_level AS nurseLevel, allergen, diet_type AS dietType, notice " +
+        "FROM tb_hospital_patient",
         "WHERE 1=1",
         "<if test='name != null and name != \"\"'> AND name LIKE CONCAT('%', #{name}, '%')</if>",
         "<if test='department != null and department != \"\"'> AND dept_code = #{department}</if>",
         "<if test='ward != null and ward != \"\"'> AND ward_code = #{ward}</if>",
         "<if test='roomNo != null and roomNo != \"\"'> AND room_no = #{roomNo}</if>",
         "<if test='bedNo != null and bedNo != \"\"'> AND bed_no = #{bedNo}</if>",
-        "<if test='inpatientNo != null and inpatientNo != \"\"'> AND inpatient_no = #{inpatientNo}</if>",
+        "<if test='inpatientNo != null and inpatientNo != \"\"'> AND inpatient_no LIKE CONCAT('%', #{inpatientNo}, '%')</if>",
         "<if test='nurseLevel != null and nurseLevel != \"\"'> AND nurse_level = #{nurseLevel}</if>",
         "<if test='status != null and status != \"\"'> AND inpatient_status = #{status}</if>",
         "<if test='admissionDateTime != null and admissionDateTime != \"\"'> AND admission_date_time LIKE CONCAT('%', #{admissionDateTime}, '%')</if>",
@@ -64,8 +72,12 @@ public interface PatientMapper {
      * @return 患者信息
      */
     @Select("SELECT admission_date_time AS admissionDateTime, inpatient_no AS inpatientNo, name, sex, age, " +
-            "dept_code AS deptCode, ward_code AS wardCode, room_no AS roomNo, bed_no AS bedNo, " +
-            "nurse_level AS nurseLevel, inpatient_status AS inpatientStatus FROM tb_hospital_patient WHERE inpatient_no = #{inpatientNo}")
+            "medical_insurance_type AS medicalInsuranceType, dept_code AS deptCode, ward_code AS wardCode, room_no AS roomNo, bed_no AS bedNo, " +
+            "doctor_code AS doctorCode, nurse_code AS nurseCode, inpatient_serial_no AS inpatientSerialNo, " +
+            "dept_date_time AS deptDateTime, discharged_date_time AS dischargedDateTime, " +
+            "inpatient_status AS inpatientStatus, diagnose, condition_status AS conditionStatus, " +
+            "nurse_level AS nurseLevel, allergen, diet_type AS dietType, notice " +
+            "FROM tb_hospital_patient WHERE inpatient_no = #{inpatientNo}")
     Patient findByInpatientNo(String inpatientNo);
     
     /**
@@ -73,9 +85,13 @@ public interface PatientMapper {
      * @param patient 患者信息
      */
     @Insert("INSERT INTO tb_hospital_patient(admission_date_time, inpatient_no, name, sex, age, " +
-            "dept_code, ward_code, room_no, bed_no, nurse_level, inpatient_status) " +
+            "medical_insurance_type, dept_code, ward_code, room_no, bed_no, " +
+            "doctor_code, nurse_code, inpatient_serial_no, dept_date_time, discharged_date_time, " +
+            "inpatient_status, diagnose, condition_status, nurse_level, allergen, diet_type, notice) " +
             "VALUES(#{admissionDateTime}, #{inpatientNo}, #{name}, #{sex}, #{age}, " +
-            "#{deptCode}, #{wardCode}, #{roomNo}, #{bedNo}, #{nurseLevel}, #{inpatientStatus})")
+            "#{medicalInsuranceType}, #{deptCode}, #{wardCode}, #{roomNo}, #{bedNo}, " +
+            "#{doctorCode}, #{nurseCode}, #{inpatientSerialNo}, #{deptDateTime}, #{dischargedDateTime}, " +
+            "#{inpatientStatus}, #{diagnose}, #{conditionStatus}, #{nurseLevel}, #{allergen}, #{dietType}, #{notice})")
     void insert(Patient patient);
     
     /**
@@ -83,8 +99,13 @@ public interface PatientMapper {
      * @param patient 患者信息
      */
     @Update("UPDATE tb_hospital_patient SET admission_date_time=#{admissionDateTime}, name=#{name}, sex=#{sex}, age=#{age}, " +
-            "dept_code=#{deptCode}, ward_code=#{wardCode}, room_no=#{roomNo}, bed_no=#{bedNo}, " +
-            "nurse_level=#{nurseLevel}, inpatient_status=#{inpatientStatus} WHERE inpatient_no=#{inpatientNo}")
+            "medical_insurance_type=#{medicalInsuranceType}, dept_code=#{deptCode}, ward_code=#{wardCode}, " +
+            "room_no=#{roomNo}, bed_no=#{bedNo}, doctor_code=#{doctorCode}, nurse_code=#{nurseCode}, " +
+            "inpatient_serial_no=#{inpatientSerialNo}, dept_date_time=#{deptDateTime}, " +
+            "discharged_date_time=#{dischargedDateTime}, inpatient_status=#{inpatientStatus}, " +
+            "diagnose=#{diagnose}, condition_status=#{conditionStatus}, nurse_level=#{nurseLevel}, " +
+            "allergen=#{allergen}, diet_type=#{dietType}, notice=#{notice} " +
+            "WHERE inpatient_no=#{inpatientNo}")
     void update(Patient patient);
     
     /**

+ 696 - 58
src/main/resources/static/home.html

@@ -789,25 +789,23 @@
                                     </div>
                                     <div style="display: flex; align-items: center;">
                                         <label style="white-space: nowrap; margin-right: 10px;">所属科室:</label>
-                                        <select id="patientDepartment" style="padding: 6px; border: 1px solid #ddd; border-radius: 4px; width: 100px;">
+                                        <select id="patientDepartment" onchange="loadWardsByDepartment(this.value)" style="padding: 6px; border: 1px solid #ddd; border-radius: 4px; width: 100px;">
                                             <option value="">全部科室</option>
                                         </select>
                                     </div>
                                     <div style="display: flex; align-items: center;">
                                         <label style="white-space: nowrap; margin-right: 10px;">所属病区:</label>
-                                        <select id="patientWard" style="padding: 6px; border: 1px solid #ddd; border-radius: 4px; width: 100px;">
+                                        <select id="patientWard" onchange="loadRoomsByWard(this.value)" style="padding: 6px; border: 1px solid #ddd; border-radius: 4px; width: 100px;">
                                             <option value="">全部病区</option>
                                         </select>
                                     </div>
                                     <div style="display: flex; align-items: center;">
                                         <label style="white-space: nowrap; margin-right: 10px;">住院号:</label>
-                                        <select id="patientInpatientNo" style="padding: 6px; border: 1px solid #ddd; border-radius: 4px; width: 100px;">
-                                            <option value="">全部</option>
-                                        </select>
+                                        <input type="text" id="patientInpatientNo" placeholder="请输入住院号(模糊查询)" style="padding: 6px; border: 1px solid #ddd; border-radius: 4px; width: 100px;">
                                     </div>
                                     <div style="display: flex; align-items: center;">
                                         <label style="white-space: nowrap; margin-right: 10px;">房间号:</label>
-                                        <select id="patientRoomNo" style="padding: 6px; border: 1px solid #ddd; border-radius: 4px; width: 80px;">
+                                        <select id="patientRoomNo" onchange="loadBedsByRoom(this.value)" style="padding: 6px; border: 1px solid #ddd; border-radius: 4px; width: 80px;">
                                             <option value="">全部</option>
                                         </select>
                                     </div>
@@ -873,49 +871,369 @@
                                     <h2 style="margin-top: 0;">患者详情</h2>
                                 </div>
                                 <div style="overflow-y: auto; flex: 1; padding: 15px;">
-                                    <div class="form-group">
-                                        <label>入院时间:</label>
-                                        <input type="text" id="modalAdmissionTime" readonly style="width: 100%; padding: 6px;">
-                                    </div>
-                                    <div class="form-group">
-                                        <label>住院号:</label>
-                                        <input type="text" id="modalInpatientNo" readonly style="width: 100%; padding: 6px;">
-                                    </div>
-                                    <div class="form-group">
-                                        <label>患者姓名:</label>
-                                        <input type="text" id="modalName" readonly style="width: 100%; padding: 6px;">
-                                    </div>
-                                    <div class="form-group">
-                                        <label>性别:</label>
-                                        <input type="text" id="modalSex" readonly style="width: 100%; padding: 6px;">
-                                    </div>
-                                    <div class="form-group">
-                                        <label>年龄:</label>
-                                        <input type="text" id="modalAge" readonly style="width: 100%; padding: 6px;">
-                                    </div>
-                                    <div class="form-group">
-                                        <label>所属科室:</label>
-                                        <input type="text" id="modalDept" readonly style="width: 100%; padding: 6px;">
+                                    <!-- 标签页导航 -->
+                                    <div style="margin-bottom: 20px;">
+                                        <button class="btn btn-primary" onclick="showPatientTab('basic', this)" style="margin-right: 5px;">基本信息</button>
+                                        <button class="btn btn-secondary" onclick="showPatientTab('diagnosis', this)" style="margin-right: 5px;">诊断信息</button>
+                                        <button class="btn btn-secondary" onclick="showPatientTab('order', this)" style="margin-right: 5px;">医嘱信息</button>
+                                        <button class="btn btn-secondary" onclick="showPatientTab('fee', this)" style="margin-right: 5px;">费用信息</button>
+                                        <button class="btn btn-secondary" onclick="showPatientTab('exam', this)" style="margin-right: 5px;">检查检验</button>
                                     </div>
-                                    <div class="form-group">
-                                        <label>所属病区:</label>
-                                        <input type="text" id="modalWard" readonly style="width: 100%; padding: 6px;">
+
+                                    <!-- 基本信息标签页 -->
+                                    <div id="patientBasicTab">
+                                        <div class="form-group">
+                                            <label>患者姓名:</label>
+                                            <input type="text" id="modalName" readonly style="width: 100%; padding: 6px;">
+                                        </div>
+                                        <div class="form-group">
+                                            <label>性别:</label>
+                                            <input type="text" id="modalSex" readonly style="width: 100%; padding: 6px;">
+                                        </div>
+                                        <div class="form-group">
+                                            <label>年龄:</label>
+                                            <input type="text" id="modalAge" readonly style="width: 100%; padding: 6px;">
+                                        </div>
+                                        <div class="form-group">
+                                            <label>医保类型:</label>
+                                            <input type="text" id="modalInsuranceType" readonly style="width: 100%; padding: 6px;">
+                                        </div>
+                                        <div class="form-group">
+                                            <label>所属科室:</label>
+                                            <input type="text" id="modalDept" readonly style="width: 100%; padding: 6px;">
+                                        </div>
+                                        <div class="form-group">
+                                            <label>所属病区:</label>
+                                            <input type="text" id="modalWard" readonly style="width: 100%; padding: 6px;">
+                                        </div>
+                                        <div class="form-group">
+                                            <label>房间号:</label>
+                                            <input type="text" id="modalRoomNo" readonly style="width: 100%; padding: 6px;">
+                                        </div>
+                                        <div class="form-group">
+                                            <label>床位号:</label>
+                                            <input type="text" id="modalBedNo" readonly style="width: 100%; padding: 6px;">
+                                        </div>
+                                        <div class="form-group">
+                                            <label>责任医生:</label>
+                                            <input type="text" id="modalDoctor" readonly style="width: 100%; padding: 6px;">
+                                        </div>
+                                        <div class="form-group">
+                                            <label>责任护士:</label>
+                                            <input type="text" id="modalNurse" readonly style="width: 100%; padding: 6px;">
+                                        </div>
+                                        <div class="form-group">
+                                            <label>住院号:</label>
+                                            <input type="text" id="modalInpatientNo" readonly style="width: 100%; padding: 6px;">
+                                        </div>
+                                        <div class="form-group">
+                                            <label>住院流水号:</label>
+                                            <input type="text" id="modalSerialNumber" readonly style="width: 100%; padding: 6px;">
+                                        </div>
+                                        <div class="form-group">
+                                            <label>入院时间:</label>
+                                            <input type="text" id="modalAdmissionTime" readonly style="width: 100%; padding: 6px;">
+                                        </div>
+                                        <div class="form-group">
+                                            <label>入科时间:</label>
+                                            <input type="text" id="modalDepartmentTime" readonly style="width: 100%; padding: 6px;">
+                                        </div>
+                                        <div class="form-group">
+                                            <label>出院时间:</label>
+                                            <input type="text" id="modalDischargeTime" readonly style="width: 100%; padding: 6px;">
+                                        </div>
+                                        <div class="form-group">
+                                            <label>在院状态:</label>
+                                            <input type="text" id="modalInpatientStatus" readonly style="width: 100%; padding: 6px;">
+                                        </div>
+                                        <div class="form-group">
+                                            <label>入院诊断:</label>
+                                            <input type="text" id="modalAdmissionDiagnosis" readonly style="width: 100%; padding: 6px;">
+                                        </div>
+                                        <div class="form-group">
+                                            <label>病情状况:</label>
+                                            <input type="text" id="modalMedicalCondition" readonly style="width: 100%; padding: 6px;">
+                                        </div>
+                                        <div class="form-group">
+                                            <label>护理级别:</label>
+                                            <input type="text" id="modalNurseLevel" readonly style="width: 100%; padding: 6px;">
+                                        </div>
+                                        <div class="form-group">
+                                            <label>过敏信息:</label>
+                                            <input type="text" id="modalAllergyInfo" readonly style="width: 100%; padding: 6px;">
+                                        </div>
+                                        <div class="form-group">
+                                            <label>饮食状况:</label>
+                                            <input type="text" id="modalDietaryStatus" readonly style="width: 100%; padding: 6px;">
+                                        </div>
+                                        <div class="form-group">
+                                            <label>安全防范:</label>
+                                            <input type="text" id="modalSafetyPrecautions" readonly style="width: 100%; padding: 6px;">
+                                        </div>
                                     </div>
-                                    <div class="form-group">
-                                        <label>房间号:</label>
-                                        <input type="text" id="modalRoomNo" readonly style="width: 100%; padding: 6px;">
+
+                                    <!-- 诊断信息标签页 -->
+                                    <div id="patientDiagnosisTab" style="display: none;">
+                                        <div class="form-group">
+                                            <label>诊断时间:</label>
+                                            <input type="text" id="modalDiagnosisTime" readonly style="width: 100%; padding: 6px;">
+                                        </div>
+                                        <div class="form-group">
+                                            <label>诊断类型:</label>
+                                            <input type="text" id="modalDiagnosisType" readonly style="width: 100%; padding: 6px;">
+                                        </div>
+                                        <div class="form-group">
+                                            <label>诊断描述:</label>
+                                            <textarea id="modalDiagnosisDesc" readonly style="width: 100%; padding: 6px; height: 60px;"></textarea>
+                                        </div>
+                                        <div class="form-group">
+                                            <label>诊断状态:</label>
+                                            <input type="text" id="modalDiagnosisStatus" readonly style="width: 100%; padding: 6px;">
+                                        </div>
+                                        <div class="form-group">
+                                            <label>诊断医生:</label>
+                                            <input type="text" id="modalDiagnosisDoctor" readonly style="width: 100%; padding: 6px;">
+                                        </div>
+                                        <div class="form-group">
+                                            <label>备注:</label>
+                                            <textarea id="modalDiagnosisRemark" readonly style="width: 100%; padding: 6px; height: 60px;"></textarea>
+                                        </div>
                                     </div>
-                                    <div class="form-group">
-                                        <label>床位号:</label>
-                                        <input type="text" id="modalBedNo" readonly style="width: 100%; padding: 6px;">
+
+                                    <!-- 医嘱信息标签页 -->
+                                    <div id="patientOrderTab" style="display: none;">
+                                        <div class="form-group">
+                                            <label>医嘱类型:</label>
+                                            <input type="text" id="modalOrderType" readonly style="width: 100%; padding: 6px;">
+                                        </div>
+                                        <div class="form-group">
+                                            <label>医嘱名称:</label>
+                                            <input type="text" id="modalOrderName" readonly style="width: 100%; padding: 6px;">
+                                        </div>
+                                        <div class="form-group">
+                                            <label>药物:</label>
+                                            <input type="text" id="modalMedication" readonly style="width: 100%; padding: 6px;">
+                                        </div>
+                                        <div class="form-group">
+                                            <label>用量:</label>
+                                            <input type="text" id="modalDosage" readonly style="width: 100%; padding: 6px;">
+                                        </div>
+                                        <div class="form-group">
+                                            <label>单位:</label>
+                                            <input type="text" id="modalUnit" readonly style="width: 100%; padding: 6px;">
+                                        </div>
+                                        <div class="form-group">
+                                            <label>用药方式:</label>
+                                            <input type="text" id="modalAdministrationMethod" readonly style="width: 100%; padding: 6px;">
+                                        </div>
+                                        <div class="form-group">
+                                            <label>用药频率:</label>
+                                            <input type="text" id="modalFrequency" readonly style="width: 100%; padding: 6px;">
+                                        </div>
+                                        <div class="form-group">
+                                            <label>执行状态:</label>
+                                            <input type="text" id="modalExecutionStatus" readonly style="width: 100%; padding: 6px;">
+                                        </div>
+                                        <div class="form-group">
+                                            <label>开始时间:</label>
+                                            <input type="text" id="modalStartTime" readonly style="width: 100%; padding: 6px;">
+                                        </div>
+                                        <div class="form-group">
+                                            <label>结束时间:</label>
+                                            <input type="text" id="modalEndTime" readonly style="width: 100%; padding: 6px;">
+                                        </div>
+                                        <div class="form-group">
+                                            <label>开嘱医生:</label>
+                                            <input type="text" id="modalPrescribingDoctor" readonly style="width: 100%; padding: 6px;">
+                                        </div>
+                                        <div class="form-group">
+                                            <label>开嘱时间:</label>
+                                            <input type="text" id="modalPrescriptionTime" readonly style="width: 100%; padding: 6px;">
+                                        </div>
+                                        <div class="form-group">
+                                            <label>停嘱医生:</label>
+                                            <input type="text" id="modalStopDoctor" readonly style="width: 100%; padding: 6px;">
+                                        </div>
+                                        <div class="form-group">
+                                            <label>停嘱时间:</label>
+                                            <input type="text" id="modalStopTime" readonly style="width: 100%; padding: 6px;">
+                                        </div>
+                                        <div class="form-group">
+                                            <label>备注:</label>
+                                            <textarea id="modalOrderRemark" readonly style="width: 100%; padding: 6px; height: 60px;"></textarea>
+                                        </div>
                                     </div>
-                                    <div class="form-group">
-                                        <label>护理级别:</label>
-                                        <input type="text" id="modalNurseLevel" readonly style="width: 100%; padding: 6px;">
+
+                                    <!-- 费用信息标签页 -->
+                                    <div id="patientFeeTab" style="display: none;">
+                                        <div class="form-group">
+                                            <label>费用产生日期:</label>
+                                            <input type="text" id="modalFeeDate" readonly style="width: 100%; padding: 6px;">
+                                        </div>
+                                        <div class="form-group">
+                                            <label>项目名称:</label>
+                                            <input type="text" id="modalFeeItemName" readonly style="width: 100%; padding: 6px;">
+                                        </div>
+                                        <div class="form-group">
+                                            <label>金额:</label>
+                                            <input type="text" id="modalFeeAmount" readonly style="width: 100%; padding: 6px;">
+                                        </div>
+                                        <div class="form-group">
+                                            <label>数量:</label>
+                                            <input type="text" id="modalFeeQuantity" readonly style="width: 100%; padding: 6px;">
+                                        </div>
+                                        <div class="form-group">
+                                            <label>单位:</label>
+                                            <input type="text" id="modalFeeUnit" readonly style="width: 100%; padding: 6px;">
+                                        </div>
+                                        <div class="form-group">
+                                            <label>小计:</label>
+                                            <input type="text" id="modalFeeSubtotal" readonly style="width: 100%; padding: 6px;">
+                                        </div>
+                                        <div class="form-group">
+                                            <label>备注:</label>
+                                            <textarea id="modalFeeRemark" readonly style="width: 100%; padding: 6px; height: 60px;"></textarea>
+                                        </div>
+                                        <div class="form-group">
+                                            <label>是否缴费:</label>
+                                            <input type="text" id="modalFeePaid" readonly style="width: 100%; padding: 6px;">
+                                        </div>
+                                        <div class="form-group">
+                                            <label>缴费时间:</label>
+                                            <input type="text" id="modalPaymentTime" readonly style="width: 100%; padding: 6px;">
+                                        </div>
                                     </div>
-                                    <div class="form-group">
-                                        <label>在院状态:</label>
-                                        <input type="text" id="modalInpatientStatus" readonly style="width: 100%; padding: 6px;">
+
+                                    <!-- 检查检验标签页 -->
+                                    <div id="patientExamTab" style="display: none;">
+                                        <!-- 子标签页导航 -->
+                                        <div style="margin-bottom: 15px;">
+                                            <button class="btn btn-primary" onclick="showExamSubTab('examReport', this)" style="margin-right: 5px;">检查报告</button>
+                                            <button class="btn btn-secondary" onclick="showExamSubTab('testReport', this)" style="margin-right: 5px;">检验报告</button>
+                                        </div>
+                                        
+                                        <!-- 检查报告子标签页 -->
+                                        <div id="examReportTab">
+                                            <div class="form-group">
+                                                <label>检查名称:</label>
+                                                <input type="text" id="modalExamName" readonly style="width: 100%; padding: 6px;">
+                                            </div>
+                                            <div class="form-group">
+                                                <label>检查部位:</label>
+                                                <input type="text" id="modalExamPart" readonly style="width: 100%; padding: 6px;">
+                                            </div>
+                                            <div class="form-group">
+                                                <label>检查方式:</label>
+                                                <input type="text" id="modalExamMethod" readonly style="width: 100%; padding: 6px;">
+                                            </div>
+                                            <div class="form-group">
+                                                <label>光镜观察:</label>
+                                                <textarea id="modalExamMicroscope" readonly style="width: 100%; padding: 6px; height: 60px;"></textarea>
+                                            </div>
+                                            <div class="form-group">
+                                                <label>影像所见:</label>
+                                                <textarea id="modalExamImage" readonly style="width: 100%; padding: 6px; height: 60px;"></textarea>
+                                            </div>
+                                            <div class="form-group">
+                                                <label>临床诊断:</label>
+                                                <input type="text" id="modalExamClinicalDiagnosis" readonly style="width: 100%; padding: 6px;">
+                                            </div>
+                                            <div class="form-group">
+                                                <label>影像诊断:</label>
+                                                <input type="text" id="modalExamImageDiagnosis" readonly style="width: 100%; padding: 6px;">
+                                            </div>
+                                            <div class="form-group">
+                                                <label>检查医生:</label>
+                                                <input type="text" id="modalExamDoctor" readonly style="width: 100%; padding: 6px;">
+                                            </div>
+                                            <div class="form-group">
+                                                <label>检查时间:</label>
+                                                <input type="text" id="modalExamTime" readonly style="width: 100%; padding: 6px;">
+                                            </div>
+                                            <div class="form-group">
+                                                <label>审核者:</label>
+                                                <input type="text" id="modalExamReviewer" readonly style="width: 100%; padding: 6px;">
+                                            </div>
+                                            <div class="form-group">
+                                                <label>报告时间:</label>
+                                                <input type="text" id="modalExamReportTime" readonly style="width: 100%; padding: 6px;">
+                                            </div>
+                                            <div class="form-group">
+                                                <label>备注:</label>
+                                                <textarea id="modalExamRemark" readonly style="width: 100%; padding: 6px; height: 60px;"></textarea>
+                                            </div>
+                                        </div>
+                                        
+                                        <!-- 检验报告子标签页 -->
+                                        <div id="testReportTab" style="display: none;">
+                                            <div class="form-group">
+                                                <label>检验名称:</label>
+                                                <input type="text" id="modalTestName" readonly style="width: 100%; padding: 6px;">
+                                            </div>
+                                            <div class="form-group">
+                                                <label>样品名称:</label>
+                                                <input type="text" id="modalSampleName" readonly style="width: 100%; padding: 6px;">
+                                            </div>
+                                            <div class="form-group">
+                                                <label>样品编号:</label>
+                                                <input type="text" id="modalSampleCode" readonly style="width: 100%; padding: 6px;">
+                                            </div>
+                                            <div class="form-group">
+                                                <label>检验医生:</label>
+                                                <input type="text" id="modalTestDoctor" readonly style="width: 100%; padding: 6px;">
+                                            </div>
+                                            <div class="form-group">
+                                                <label>检验时间:</label>
+                                                <input type="text" id="modalTestTime" readonly style="width: 100%; padding: 6px;">
+                                            </div>
+                                            <div class="form-group">
+                                                <label>审核者:</label>
+                                                <input type="text" id="modalTestReviewer" readonly style="width: 100%; padding: 6px;">
+                                            </div>
+                                            <div class="form-group">
+                                                <label>报告时间:</label>
+                                                <input type="text" id="modalTestReportTime" readonly style="width: 100%; padding: 6px;">
+                                            </div>
+                                            <div class="form-group">
+                                                <label>备注:</label>
+                                                <textarea id="modalTestRemark" readonly style="width: 100%; padding: 6px; height: 60px;"></textarea>
+                                            </div>
+                                            <div class="form-group">
+                                                <button class="btn btn-primary" onclick="showTestDetails()">详情</button>
+                                            </div>
+                                            
+                                            <!-- 检验报告详情模态框 -->
+                                            <div id="testDetailsModal" style="display:none; position: fixed; z-index: 1000; left: 0; top: 0; width: 100%; height: 100%; background-color: rgba(0,0,0,0.4); overflow: auto; padding: 50px 0;">
+                                                <div style="background-color: #fff; margin: 0 auto; padding: 0; border: 1px solid #888; width: 80%; max-width: 1200px; border-radius: 5px; max-height: 80%; display: flex; flex-direction: column;">
+                                                    <div style="padding: 15px; border-bottom: 1px solid #eee; background-color: #007bff; color: white; display: flex; justify-content: space-between; align-items: center;">
+                                                        <h3 style="margin: 0;">检验报告详情</h3>
+                                                        <button class="btn btn-danger" onclick="closeTestDetailsModal()">×</button>
+                                                    </div>
+                                                    <div style="overflow-y: auto; flex: 1; padding: 15px;">
+                                                        <table class="data-table" style="width: 100%;">
+                                                            <thead>
+                                                                <tr>
+                                                                    <th style="width: 5%; text-align: center;">序号</th>
+                                                                    <th style="width: 15%; text-align: center;">项目名称</th>
+                                                                    <th style="width: 15%; text-align: center;">英文缩写</th>
+                                                                    <th style="width: 10%; text-align: center;">结果值</th>
+                                                                    <th style="width: 10%; text-align: center;">结果提示</th>
+                                                                    <th style="width: 10%; text-align: center;">单位</th>
+                                                                    <th style="width: 15%; text-align: center;">参考范围</th>
+                                                                    <th style="width: 15%; text-align: center;">备注</th>
+                                                                </tr>
+                                                            </thead>
+                                                            <tbody id="testDetailsTableBody">
+                                                                <!-- 数据将通过JS动态加载 -->
+                                                            </tbody>
+                                                        </table>
+                                                    </div>
+                                                    <div style="padding: 15px; border-top: 1px solid #eee; text-align: right;">
+                                                        <button class="btn btn-secondary" onclick="closeTestDetailsModal()">关闭</button>
+                                                    </div>
+                                                </div>
+                                            </div>
+                                        </div>
                                     </div>
                                 </div>
                                 <div style="padding: 20px; border-top: 1px solid #eee; text-align: right;">
@@ -930,6 +1248,8 @@
                         loadPatientDepartmentOptions();
                         // 加载病区下拉框数据
                         loadPatientWardOptions();
+                        // 加载房间号下拉框数据
+                        loadPatientRoomNoOptions();
                         // 加载患者数据
                         loadPatientData();
                         // 确保页面首次加载时也能显示所有患者数据
@@ -2680,6 +3000,42 @@
                 });
                 nurseLevelSelect.value = currentNurseLevelValue;
                 
+                // 获取唯一的病区列表并更新下拉框
+                const wards = [...new Set(data.map(patient => patient.wardCode).filter(ward => ward))];
+                const wardSelect = document.getElementById('patientWard');
+                const currentWardValue = wardSelect.value;
+                
+                // 保留当前选项,只更新选项列表
+                const defaultWardOption = wardSelect.options[0];
+                wardSelect.innerHTML = '';
+                wardSelect.appendChild(defaultWardOption);
+                
+                wards.forEach(ward => {
+                    const option = document.createElement('option');
+                    option.value = ward;
+                    option.textContent = ward;
+                    wardSelect.appendChild(option);
+                });
+                wardSelect.value = currentWardValue;
+                
+                // 获取唯一的房间号列表并更新下拉框
+                const roomNos = [...new Set(data.map(patient => patient.roomNo).filter(roomNo => roomNo))];
+                const roomNoSelect = document.getElementById('patientRoomNo');
+                const currentRoomNoValue = roomNoSelect.value;
+                
+                // 保留当前选项,只更新选项列表
+                const defaultRoomNoOption = roomNoSelect.options[0];
+                roomNoSelect.innerHTML = '';
+                roomNoSelect.appendChild(defaultRoomNoOption);
+                
+                roomNos.forEach(roomNo => {
+                    const option = document.createElement('option');
+                    option.value = roomNo;
+                    option.textContent = roomNo;
+                    roomNoSelect.appendChild(option);
+                });
+                roomNoSelect.value = currentRoomNoValue;
+                
                 // 获取唯一的床位号列表并更新下拉框
                 const bedNos = [...new Set(bedData.map(bed => bed.name).filter(bedNo => bedNo))];
                 const bedNoSelect = document.getElementById('patientBedNo');
@@ -3053,12 +3409,13 @@
             
             url += params.join('&');
             
-            // 并行获取患者数据和护理级别选项
+            // 并行获取患者数据、护理级别选项和在院状态选项
             Promise.all([
                 fetch(url).then(response => response.json()),
-                fetch('/shixian/api/patients/nurse-levels').then(response => response.json())
+                fetch('/shixian/api/patients/nurse-levels').then(response => response.json()),
+                fetch('/shixian/api/patients/inpatient-statuses').then(response => response.json())
             ])
-            .then(([data, nurseLevels]) => {
+            .then(([data, nurseLevels, inpatientStatuses]) => {
                 const tbody = document.getElementById('patientTableBody');
                 tbody.innerHTML = '';
                 
@@ -3080,6 +3437,24 @@
                 });
                 nurseLevelSelect.value = currentNurseLevelValue;
                 
+                // 更新在院状态下拉框
+                const inpatientStatusSelect = document.getElementById('patientStatus');
+                const currentInpatientStatusValue = inpatientStatusSelect.value;
+                
+                // 保留默认选项
+                const defaultInpatientStatusOption = inpatientStatusSelect.options[0];
+                inpatientStatusSelect.innerHTML = '';
+                inpatientStatusSelect.appendChild(defaultInpatientStatusOption);
+                
+                // 添加从数据库获取的真实在院状态选项
+                inpatientStatuses.forEach(status => {
+                    const option = document.createElement('option');
+                    option.value = status;
+                    option.textContent = status;
+                    inpatientStatusSelect.appendChild(option);
+                });
+                inpatientStatusSelect.value = currentInpatientStatusValue;
+                
                 // 处理患者数据
                 data.forEach(patient => {
                     const row = document.createElement('tr');
@@ -3130,21 +3505,35 @@
                 if (data.success) {
                     const patient = data.data;
                     
-                    // 填充弹窗内容
-                    document.getElementById('modalAdmissionTime').value = patient.admissionDateTime || '';
-                    document.getElementById('modalInpatientNo').value = patient.inpatientNo || '';
+                    // 填充弹窗内容 - 基本信息
                     document.getElementById('modalName').value = patient.name || '';
                     document.getElementById('modalSex').value = patient.sex || '';
                     document.getElementById('modalAge').value = patient.age || '';
+                    document.getElementById('modalInsuranceType').value = patient.medicalInsuranceType || '';
                     document.getElementById('modalDept').value = patient.deptCode || '';
                     document.getElementById('modalWard').value = patient.wardCode || '';
                     document.getElementById('modalRoomNo').value = patient.roomNo || '';
                     document.getElementById('modalBedNo').value = patient.bedNo || '';
-                    document.getElementById('modalNurseLevel').value = patient.nurseLevel || '';
+                    document.getElementById('modalDoctor').value = patient.doctorCode || '';
+                    document.getElementById('modalNurse').value = patient.nurseCode || '';
+                    document.getElementById('modalInpatientNo').value = patient.inpatientNo || '';
+                    document.getElementById('modalSerialNumber').value = patient.inpatientSerialNo || '';
+                    document.getElementById('modalAdmissionTime').value = patient.admissionDateTime || '';
+                    document.getElementById('modalDepartmentTime').value = patient.deptDateTime || '';
+                    document.getElementById('modalDischargeTime').value = patient.dischargedDateTime || '';
                     document.getElementById('modalInpatientStatus').value = patient.inpatientStatus || '';
+                    document.getElementById('modalAdmissionDiagnosis').value = patient.diagnose || '';
+                    document.getElementById('modalMedicalCondition').value = patient.conditionStatus || '';
+                    document.getElementById('modalNurseLevel').value = patient.nurseLevel || '';
+                    document.getElementById('modalAllergyInfo').value = patient.allergen || '';
+                    document.getElementById('modalDietaryStatus').value = patient.dietType || '';
+                    document.getElementById('modalSafetyPrecautions').value = patient.notice || '';
                     
                     // 显示弹窗
                     document.getElementById('patientModal').style.display = 'block';
+                    
+                    // 默认显示基本信息标签页
+                    showPatientTab('basic');
                 } else {
                     alert('获取患者信息失败: ' + data.message);
                 }
@@ -3185,7 +3574,7 @@
         
         // 加载患者管理病区下拉框数据
         function loadPatientWardOptions() {
-            fetch('/shixian/api/patients')
+            fetch('/shixian/api/wards')
             .then(response => response.json())
             .then(data => {
                 const wardSelect = document.getElementById('patientWard');
@@ -3193,14 +3582,11 @@
                 // 清空现有选项
                 wardSelect.innerHTML = '<option value="">全部病区</option>';
                 
-                // 获取唯一的病区列表
-                const wards = [...new Set(data.map(patient => patient.wardCode).filter(ward => ward))];
-                
                 // 添加新的选项
-                wards.forEach(ward => {
+                data.forEach(ward => {
                     const option = document.createElement('option');
-                    option.value = ward;
-                    option.textContent = ward;
+                    option.value = ward.name;
+                    option.textContent = ward.name;
                     wardSelect.appendChild(option);
                 });
             })
@@ -3209,6 +3595,177 @@
             });
         }
         
+        // 加载患者管理房间号下拉框数据
+        function loadPatientRoomNoOptions() {
+            fetch('/shixian/api/patients')
+            .then(response => response.json())
+            .then(data => {
+                const roomSelect = document.getElementById('patientRoomNo');
+                
+                // 清空现有选项
+                roomSelect.innerHTML = '<option value="">全部</option>';
+                
+                // 添加新的选项
+                data.forEach(patient => {
+                    const option = document.createElement('option');
+                    if (patient.roomNo) {
+                        option.value = patient.roomNo;
+                        option.textContent = patient.roomNo;
+                        // 避免重复添加相同的房间号
+                        if (!Array.from(roomSelect.options).some(opt => opt.value === patient.roomNo)) {
+                            roomSelect.appendChild(option);
+                        }
+                    }
+                });
+            })
+            .catch(error => {
+                console.error('加载房间号下拉框数据失败:', error);
+            });
+        }
+        
+        // 根据科室动态加载病区选项
+        function loadWardsByDepartment(department) {
+            const wardSelect = document.getElementById('patientWard');
+            
+            // 保存当前选择的病区值
+            const currentWardValue = wardSelect.value;
+            
+            // 清空现有选项,保留默认选项
+            wardSelect.innerHTML = '<option value="">全部病区</option>';
+            
+            if (department) {
+                // 如果选择了科室,则从患者数据中筛选出该科室关联的病区
+                fetch('/shixian/api/patients')
+                .then(response => response.json())
+                .then(data => {
+                    // 过滤出该科室的患者,并提取唯一的病区代码
+                    const wards = [...new Set(data
+                        .filter(patient => patient.deptCode === department)
+                        .map(patient => patient.wardCode)
+                        .filter(ward => ward))];
+                    
+                    // 添加选项
+                    wards.forEach(ward => {
+                        const option = document.createElement('option');
+                        option.value = ward;
+                        option.textContent = ward;
+                        wardSelect.appendChild(option);
+                    });
+                    
+                    // 恢复之前的病区选择(如果仍然有效)
+                    wardSelect.value = currentWardValue;
+                })
+                .catch(error => {
+                    console.error('加载病区下拉框数据失败:', error);
+                });
+            } else {
+                // 如果没有选择科室,则从所有患者数据中提取病区
+                fetch('/shixian/api/patients')
+                .then(response => response.json())
+                .then(data => {
+                    // 获取唯一的病区列表
+                    const wards = [...new Set(data.map(patient => patient.wardCode).filter(ward => ward))];
+                    
+                    // 添加选项
+                    wards.forEach(ward => {
+                        const option = document.createElement('option');
+                        option.value = ward;
+                        option.textContent = ward;
+                        wardSelect.appendChild(option);
+                    });
+                    
+                    // 恢复之前的病区选择(如果仍然有效)
+                    wardSelect.value = currentWardValue;
+                })
+                .catch(error => {
+                    console.error('加载病区下拉框数据失败:', error);
+                });
+            }
+        }
+        
+        // 根据房间号动态加载床位号选项
+        function loadBedsByRoom(room) {
+            const bedSelect = document.getElementById('patientBedNo');
+            
+            // 清空现有选项,保留默认选项
+            bedSelect.innerHTML = '<option value="">全部</option>';
+            
+            if (room) {
+                // 如果选择了房间,则从患者数据中筛选出该房间关联的床位号
+                fetch('/shixian/api/patients')
+                .then(response => response.json())
+                .then(data => {
+                    // 过滤出该房间的患者,并提取床位号
+                    const beds = [...new Set(data
+                        .filter(patient => patient.roomNo === room)
+                        .map(patient => patient.bedNo)
+                        .filter(bed => bed))];
+                    
+                    // 添加选项
+                    beds.forEach(bed => {
+                        const option = document.createElement('option');
+                        option.value = bed;
+                        option.textContent = bed;
+                        bedSelect.appendChild(option);
+                    });
+                })
+                .catch(error => {
+                    console.error('加载床位号下拉框数据失败:', error);
+                });
+            }
+        }
+
+        // 根据病区动态加载房间号选项
+        function loadRoomsByWard(ward) {
+            const roomSelect = document.getElementById('patientRoomNo');
+            
+            // 清空现有选项,保留默认选项
+            roomSelect.innerHTML = '<option value="">全部</option>';
+            
+            if (ward) {
+                // 如果选择了病区,则从患者数据中筛选出该病区关联的房间号
+                fetch('/shixian/api/patients')
+                .then(response => response.json())
+                .then(data => {
+                    // 过滤出该病区的患者,并提取房间号
+                    const rooms = [...new Set(data
+                        .filter(patient => patient.wardCode === ward)
+                        .map(patient => patient.roomNo)
+                        .filter(room => room))];
+                    
+                    // 添加选项
+                    rooms.forEach(room => {
+                        const option = document.createElement('option');
+                        option.value = room;
+                        option.textContent = room;
+                        roomSelect.appendChild(option);
+                    });
+                })
+                .catch(error => {
+                    console.error('加载房间号下拉框数据失败:', error);
+                });
+            } else {
+                // 如果没有选择病区,则从所有患者数据中提取房间号
+                fetch('/shixian/api/patients')
+                .then(response => response.json())
+                .then(data => {
+                    // 获取唯一的房间号列表
+                    const rooms = [...new Set(data.map(patient => patient.roomNo).filter(room => room))];
+                    
+                    // 添加选项
+                    rooms.forEach(room => {
+                        const option = document.createElement('option');
+                        option.value = room;
+                        option.textContent = room;
+                        roomSelect.appendChild(option);
+                    });
+                })
+                .catch(error => {
+                    console.error('加载房间号下拉框数据失败:', error);
+                });
+            }
+        }
+        
         // 关闭床位代码设置
         function closeBedCodeSetting() {
             document.getElementById('bedCodeSettingModal').style.display = 'none';
@@ -3628,6 +4185,87 @@
             document.getElementById('wardModal').style.display = 'none';
         }
         
+        // 患者详情标签页切换
+        function showPatientTab(tabName, element) {
+            // 隐藏所有标签页内容
+            document.getElementById('patientBasicTab').style.display = 'none';
+            document.getElementById('patientDiagnosisTab').style.display = 'none';
+            document.getElementById('patientOrderTab').style.display = 'none';
+            document.getElementById('patientFeeTab').style.display = 'none';
+            document.getElementById('patientExamTab').style.display = 'none';
+            
+            // 显示指定的标签页
+            switch(tabName) {
+                case 'basic':
+                    document.getElementById('patientBasicTab').style.display = 'block';
+                    break;
+                case 'diagnosis':
+                    document.getElementById('patientDiagnosisTab').style.display = 'block';
+                    break;
+                case 'order':
+                    document.getElementById('patientOrderTab').style.display = 'block';
+                    break;
+                case 'fee':
+                    document.getElementById('patientFeeTab').style.display = 'block';
+                    break;
+                case 'exam':
+                    document.getElementById('patientExamTab').style.display = 'block';
+                    // 默认显示检查报告子标签页
+                    showExamSubTab('examReport');
+                    break;
+            }
+            
+            // 更新标签按钮样式
+            const buttons = document.querySelectorAll('#patientModal .btn');
+            buttons.forEach(button => {
+                button.className = 'btn btn-secondary';
+            });
+            
+            // 设置当前激活按钮的样式
+            if (element) {
+                element.className = 'btn btn-primary';
+            }
+        }
+        
+        // 显示检验报告详情
+        function showTestDetails() {
+            // 显示模态框
+            document.getElementById('testDetailsModal').style.display = 'block';
+        }
+        
+        // 关闭检验报告详情模态框
+        function closeTestDetailsModal() {
+            document.getElementById('testDetailsModal').style.display = 'none';
+        }
+        
+        // 检查检验子标签页切换
+        function showExamSubTab(subTabName, element) {
+            // 隐藏所有子标签页内容
+            document.getElementById('examReportTab').style.display = 'none';
+            document.getElementById('testReportTab').style.display = 'none';
+            
+            // 显示指定的子标签页
+            switch(subTabName) {
+                case 'examReport':
+                    document.getElementById('examReportTab').style.display = 'block';
+                    break;
+                case 'testReport':
+                    document.getElementById('testReportTab').style.display = 'block';
+                    break;
+            }
+            
+            // 更新子标签按钮样式
+            const examButtons = document.querySelectorAll('#patientExamTab .btn');
+            examButtons.forEach(button => {
+                button.className = 'btn btn-secondary';
+            });
+            
+            // 设置当前激活按钮的样式
+            if (element) {
+                element.className = 'btn btn-primary';
+            }
+        }
+        
     </script>
 </body>
 </html>

+ 0 - 0
table_structure.txt