我目前正在开发一个医疗应用,患者和医生之间具有身份验证功能。
现在是患者的当前JSON结构&医生如下:
患者
"Patients": {
"w14FKo72BieZwbxwUouTpN7UQm02": {
"name": "Naseebullah Ahmadi",
"profession": "Student",
"gender": "Male",
"type": "Patient",
"doctors": ["Ernest"],
"age": "20",
"DOB": "02/06/1997",
"address": "122 Atherstone Court",
"contactNumber": "07473693312",
"profilePicture": "../Images/profile.jpg",
"history": {
"age": "22",
"weight": "53",
"height": "172",
"bmi": "20.4",
"thermometer": "36.7",
"calories": "537",
"bpm": "87",
"fat": "11",
"allergies": ["Peanuts", "Penicilin"]
},
"appointments": [{
"date": "25th Jul",
"time": "13:00",
"type": "Doctor",
"name": "Ernest Kamavuako"
}],
"ecg": [""],
"heartSound": [""]
},
如果每个患者都通过其ID标识的"示例:w14FKo72BieZwbxwUouTpN7UQm02
"
医生
"Doctors": {
"VoxHFgUEIwRFWg7JTKNXSSoFoMV2": {
"name": "Ernest Kamavuako",
"gender": "Male",
"type": "Doctor",
"Patients": ["Naseebullah"],
"age": "30",
"dob": "20/12/1970",
"address": "122 Harrow Street",
"contactNumber": "07473033312",
"profilePicture": "../Images/profile.jpg"
}
}
现在的问题是:每位医生都能阅读患者留给他们的评论,同样,每个患者都可以阅读每个医生留下的评论。
这两个原则都能具有50条评论的最大限制。
目前,我不确定如何表示"评论"对象以及如何布置它。
这个问题纯粹是为了理解正在扮演的演员之间的关系。
您可以有一个像这样的注释的JSON对象
"Comments": {
"<doctorsId>:<patientsId>": {
"doctorsComments" : '["comment1", "comment2"]',
"patientsComments": '["comment1", "comment2"]'
}
}
如果您有医生和患者ID,则可以直接访问评论对象。