我正在创建一个诊所管理系统,在那里我需要为病人保存病史。用户可以为单个病人选择多个病史条件,但是每个诊所都有自己固定的一组病史字段。
例如:
Clinic 1:
DiseaseOne
DiseaseTwo
DiseaseThree
Clinic 2:
DiseaseFour
DiseaseFive
DiseaseSize对于我在一个特定诊所的病人访问,用户应该能够检查1或更多疾病的病人的病史,根据临床类型。
我想出了两种存储医学历史数据的方法:
第一种选择:
将这些字段添加到相应的门诊病人访问记录中:
PatientClinic1VisitRecord:
PatientClinic1VisitRecordId
VisitDate
MedHist_DiseaseOne
MedHist_DiseaseTwo
MedHist_DisearThree并根据用户输入填充每个MedHist字段的值"True/False“。
第二种选择:
有一个单一的MedicalHistory表,其中包含所有诊所的医疗史细节,以及另一个表格,以保存病人的医疗史,在其相应的访问。
MedicalHistory
ClinicId
MedicalHistoryFieldId
MedicalHistoryFieldName
MedicalHistoryPatientClinicVisit
VisitId
MedicalHistoryFieldId
MedicalHistoryFieldValue我不确定这些方法是否是好的实践,第三种方法是否可以更好地使用?
发布于 2015-07-05 16:31:57
如果你只对病人的疾病感兴趣,那么储存虚假/不存在的疾病是毫无意义的。并不是真正了解所有的细节并不能帮助获得最好的解决方案,但我可能会创建这样的东西:
人:
PersonID
Name
Address诊所:
ClinicID
Name
Address疾病:
DiseaseID
NameMedicalHistory:
HistoryID (identity, primary key)
PersonID
ClinicID
VisitDate (either date or datetime2 field depending what you need)
DiseaseID
Details, Notes etc我创建这个表是因为我的假设是,人们在一次访问中很可能只有1种疾病,所以有时可能会添加更多的行,而不是为访问创建单独的表,这使得查询变得非常复杂。
如果还需要跟踪疾病检查但结果为阴性的情况,则历史表需要新的状态字段。
如果你需要限制哪些疾病可以进入哪个诊所,你也需要单独的表格。
发布于 2015-07-06 04:56:06
创建一组关系表,以获得一个健壮和灵活的系统,使诊所能够添加任意数量的疾病、病人和访问。此外,根据不同的组标准构建查询对您来说也会变得更容易。
构建一个由4个表组成的集合,加上一个多对多(M2M)的“链接”表,如下所示。前3个表将是更新频率较低的表。每次病人到诊所就诊时,在就诊表中增加一行,包括除疾病信息外的全部访问细节。在M2M MedicalHistory表中为每一种疾病添加1行,病人将在该访问中对其进行咨询。
另外,请考虑使用表值参数将许多行从前端程序传递给Server存储过程(每种疾病1行)。
表[Clinics]
ClinicId Primary Key
ClinicName
-more columns -表[Diseases]
DiseaseId Primary Key
ClinicId Foreign Key into the [Clinics] table
DiseaseName
- more columns -表[Patients]
PatientId Primary Key
ClinicId Foreign Key into the [Clinics] table
PatientName
-more columns -表[Visits]
VisitId Primary Key
VisitDate
DoctorId Foreign Key into another table called [Doctor]
BillingAmount
- more columns -最后是M2M表:[MedicalHistory]。(重要的是--所有的FK字段都应该组合在一起,形成这个表的PK。)
ClinicId Foreign Key into the [Clinics] table
DiseaseId Foreign Key into the [Diseases] table
PatientId Foreign Key into the [Patients] table
VisitId Foreign Key into the [Visits] tablehttps://stackoverflow.com/questions/31231933
复制相似问题