[英]MySQL Access Control List
I am trying to implement a site where patients can access medical records. 我正在尝试建立一个可供患者访问医疗记录的站点。 My problem is where the clinicians have access to the records.
我的问题是临床医生可以访问这些记录。 So they should only be able to view the patient's record if they are on an Access Control List which states which doctors can view the patient's record.
因此,如果他们位于访问控制列表中,该列表说明哪些医生可以查看患者的记录,则他们只能查看患者的记录。 The question that I have is what type of relationship will the clinicians have to the access control list;
我的问题是临床医生将与访问控制列表建立什么样的关系? would it be many to one, many to many, etc.?
是多对一,多对多等等? Also I am not entirely sure about the foreign keys.
另外,我也不完全了解外键。
This is my image of what I think it would look like, any help would be awesome. 这是我的印象,任何帮助都会给我很大的帮助。
The AccessList
table represents the many-to-many relationship between patients in the Patient
table and clinicians in the Clinician
table. AccessList
表表示“ Patient
表中的Patient
与“临床Clinician
表中的Clinician
之间的多对多关系。 Thus one clinician from the Clinician
table will appear many times in the AccessList
table because they will have access to many patients' records, ie it's a one-to-many relationship between those tables. 因此,来自
Clinician
表的一位临床Clinician
将在AccessList
表中出现很多次,因为他们将可以访问许多患者的记录,即这是这些表之间的一对多关系。 The same is true of patients from the Patient
table having possibly several clinicians, ie a one-to-many relationship to the AccessList
table. 来自“
Patient
表的Patient
可能具有多个临床医生,即与AccessList
表具有一对多关系的情况也是如此。 Thus there should be foreign keys in the AccessList
table to idPatient
from the Patient
table and idClinician
from the Clinician
table. 因此,应该有外键
AccessList
表idPatient
从Patient
表和idClinician
从Clinician
表。
Issues: 问题:
Question: 题:
How I'd likely setup the data with the information to date: 我如何使用最新信息设置数据:
This allows the following: 这允许以下内容:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.