Stream: implementers
Topic: mapping User to Patient
Andrey Guzyuk (Dec 02 2019 at 22:01):
Hello!
What's the best option to have reference from User to Patient?
So say i have own server which can authenticate users by their username and password. On success i'll send back JWT token. And then with each request will check for it.
Question:
I would like to create User (username/password) and also Patient (name,phone etc). How to retrieve Patient info based on currently logged in user? And how to know which Patient is associated with User?
I was thinking to create Patient first and then set manually id on User table, but i think it's not that good idea.
Could somebody help how to make that happen?
Thanks!
Grahame Grieve (Dec 02 2019 at 22:05):
I use SCIM (simplecloud.info) for user management. I have a SCIM extension in the user object referring to the patient resource for the user. I don't know how relevant this is?
John Moehrke (Dec 03 2019 at 13:36):
It very much depends on what your goals are. The model Grahame has would likely be the model security architects would recommend as the user model is more closely related to security, where Patient is more closely related to healthcare information. That said, there are benefits to having Patient.identifier hold the userID (and system). The benefit of this is that even outside your need, the human can use that userID as a identifier. Others could look up the Patient based on the userID. However if this is not desirable then having it in Patient.identifier is a bad idea as it exposes information the human may not want exposed, or you may not want exposed. (Note many people are getting comfortable using their email address as their most used identifier.)
Last updated: Apr 12 2022 at 19:14 UTC