Bladeren bron

健康科普模块

yf 4 maanden geleden
bovenliggende
commit
b7167cc25d
2 gewijzigde bestanden met toevoegingen van 107 en 3 verwijderingen
  1. 2 1
      wisdom-app/.vscode/settings.json
  2. 105 2
      wisdom-prod/schema/schema.md

+ 2 - 1
wisdom-app/.vscode/settings.json

@@ -1,3 +1,4 @@
 {
-  "typescript.preferences.autoImportFileExcludePatterns": ["@ionic/angular/common", "@ionic/angular"]
+  "typescript.preferences.autoImportFileExcludePatterns": ["@ionic/angular/common", "@ionic/angular"],
+   "plantuml.server":"http://www.plantuml.com/plantuml"
 }

+ 105 - 2
wisdom-prod/schema/schema.md

@@ -3,7 +3,6 @@
 ## 1、医生问诊模块
 - 医生问诊模块描述
     - 医生问诊模块的主要功能包括患者根据自己的病状判断所需要的科室,并进行预约就诊,然后医生与其预约的人进行在线咨询,并通过患者提供的症状,给出相应的病症以及相应的药物等。
-根据您提供的描述,以下是针对医生问诊模块的 Parse Schema 设计,涵盖患者、医生、科室、预约和咨询等相关信息。我们将确保每个表符合设计范式,并使用 PlantUML 类图来表示这些表及其关系。
 
 ### Parse Schema 设计
 
@@ -114,4 +113,108 @@ Appointment "1" -- "1" Consultation : includes
 - **Appointment 表**:记录患者的预约信息,包括患者、医生、科室、预约时间和状态。
 - **Consultation 表**:记录在线咨询的信息,包括相关的预约、患者提供的症状、医生的诊断和处方药物。
 
-这种设计确保了患者和医生的角色分离,同时也符合数据库的范式要求。每个表都有唯一的 `objectId` 和 `createdAt` 字段,方便进行数据管理和跟踪。
+这种设计确保了患者和医生的角色分离,同时也符合数据库的范式要求。每个表都有唯一的 `objectId` 和 `createdAt` 字段,方便进行数据管理和跟踪。
+
+## 2、健康科普模块
+- 健康科普模块描述
+    - 健康科普模块的主要功能包括用户根据某一身体情况进行相关搜索相关病症或是身体需要的营养元素,同时每天还会推送与用户最近线上就诊的病情相关的的健康知识
+
+### Parse Schema 设计
+
+1. **User**
+   - objectId (默认)
+   - createdAt (默认)
+   - username: String
+   - email: String
+   - phoneNumber: String
+
+2. **Condition**
+   - objectId (默认)
+   - createdAt (默认)
+   - name: String
+   - description: String
+   - relatedNutrients: Array<Pointer<Nutrient>>
+
+3. **Nutrient**
+   - objectId (默认)
+   - createdAt (默认)
+   - name: String
+   - benefits: String
+
+4. **VisitRecord**
+   - objectId (默认)
+   - createdAt (默认)
+   - user: Pointer<User>
+   - condition: Pointer<Condition>
+   - visitDate: Date
+   - notes: String
+
+5. **HealthKnowledge**
+   - objectId (默认)
+   - createdAt (默认)
+   - title: String
+   - content: String
+   - relatedCondition: Pointer<Condition>
+   - pushDate: Date
+
+### PlantUML 类图表示
+
+```plantuml
+@startuml
+class User {
+    +objectId: String
+    +createdAt: Date
+    +username: String
+    +email: String
+    +phoneNumber: String
+}
+
+class Condition {
+    +objectId: String
+    +createdAt: Date
+    +name: String
+    +description: String
+    +relatedNutrients: Array<Pointer<Nutrient>>
+}
+
+class Nutrient {
+    +objectId: String
+    +createdAt: Date
+    +name: String
+    +benefits: String
+}
+
+class VisitRecord {
+    +objectId: String
+    +createdAt: Date
+    +user: Pointer<User>
+    +condition: Pointer<Condition>
+    +visitDate: Date
+    +notes: String
+}
+
+class HealthKnowledge {
+    +objectId: String
+    +createdAt: Date
+    +title: String
+    +content: String
+    +relatedCondition: Pointer<Condition>
+    +pushDate: Date
+}
+
+User "1" -- "0..*" VisitRecord : has
+Condition "1" -- "0..*" VisitRecord : is related to
+Condition "1" -- "0..*" HealthKnowledge : is related to
+Condition "1" -- "0..*" Nutrient : contains
+@enduml
+```
+
+### 说明
+
+- **User 表**:存储用户信息。
+- **Condition 表**:存储病症信息,并通过 `relatedNutrients` 字段与营养元素表关联。
+- **Nutrient 表**:存储营养元素信息。
+- **VisitRecord 表**:存储用户的就诊记录,关联用户和病症。
+- **HealthKnowledge 表**:存储健康知识,关联特定病症。
+
+这种设计确保了数据的规范化,避免了冗余,同时通过外键关联保持了数据的一致性和完整性。