简体   繁体   English

MySQL访问控制列表

[英]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. 因此,应该有外键AccessListidPatientPatient表和idClinicianClinician表。

Issues: 问题:

  1. I don't see why you have both patient and medical records on the access list. 我不明白为什么您在访问列表中同时拥有患者和医疗记录。 (if 1:1 patient medical record) (如果1:1患者病历)
  2. I don't see why you have accessList info on Clinician. 我不明白您为什么拥有有关临床医生的accessList信息。 This means that a clinician can only have access to 1 access list? 这意味着临床医生只能访问1个访问列表? seems wrong. 似乎错了。

Question: 题:

  • Are you trying to setup the data so that you have ACL groups you assign a patient to a "group" and all Clinician's part of that group then have access so you don't have to manage the individual Patient Clinician associations? 您是否要设置数据,以便有一个将患者分配到一个“组”的ACL组,然后该组的所有临床医生部门都可以访问,因此您不必管理各个患者临床医生协会? If so we need a ACL_GROUP table and Clinician's should be assigned to a group; 如果是这样,我们需要一个ACL_GROUP表,并且应该将临床医生分配给一个组。 or you need a Hierarchy within your ACL table. 或者您在ACL表中需要一个层次结构。

How I'd likely setup the data with the information to date: 我如何使用最新信息设置数据:

Patient 患者

  • idPatient (PK) idPatient(PK)

Medicalrecords 病历

  • idMedicalrecord (PK) idMedicalrecord(PK)
  • Patient_idPatient (FK to patient) Patient_idPatient(患者的FK)

Clinician 临床医师

  • idClinician (PK) idClinician(PK)

AccessList 存取清单

  • idAccessList (PK) idAccessList(PK)
  • AccessListName (Group name or patient Name) AccessListName(组名或患者名)
  • Patient_idPatient (FK to patient) (COMPOSITE UNIQUE INDEX1) Patient_idPatient(患者的FK)(复合唯一索引1)
  • Clinician_idClinician (Fk to Clinician) (COMPOSITE UNIQUE INDEX1) Clinician_idClinician(从Fk到Clinician)(复合唯一索引1)
  • IdAccessList_Parent (Maybe... FK to AccessList_IDAccessList) used to manage "security groups") IdAccessList_Parent(也许... FK到AccessList_IDAccessList,用于管理“安全组”)

This allows the following: 这允许以下内容:

  1. A patient record could have 1:M Medical records 患者记录可能具有1:M医疗记录
  2. A medical record associates to 1 and only 1 patient 病历仅与1位患者相关
  3. A clinician may have access to a patient and all their medical history; 临床医生可以访问患者及其所有病史; but not specific medical records if multiple. 但如果有多个则没有特定的病历。 If you need to limit access to certain patient medical information then instead of having the accessList join to Patient, have it join to MedicalRecords; 如果您需要限制对某些患者医疗信息的访问,则不必将accessList加入到Patient中,而应将其加入到MedicalRecords中。 thereby allowing to you to limit to specific medical inforamtion; 从而使您限于特定的医疗信息; or keep both allowing access to the whole patient; 或两者都允许接触整个患者; or specific medical records if multiple exist. 或特定的医疗记录(如果存在)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM