Open dpdonohue opened 9 years ago
Dipak, I have written some code that should be usable or an example for the Profile page.
See lib/util/patientUtil.js. Ideally you would save the demographic info in the user's patient object. So each user would have a single associated patient object.
I am not happy with my current dialog upon loading the app. Instead let's test whether the current user has filled out this demographic info. If not then route to the profile page and capture this profile info. By default the current user is the patient. However the user can click the patient name at top and switch to another patient.
What determines whether a user may edit a patient's record? The user must be listed as one of the owners in the patient they wish to select.
I have a method for querying this in file
lib/query/subscriptionQueries.js:
getUserPatients = function(userid) {
if (! userid) return;
return Entities.find({etypes: "patient", owners: userid, valid: 1 });
};
I have a method in lib/util/patientUtil.js:
createPatientEntity = function(patientId, name) {
var entity = {
_id: patientId,
name: name,
etypes: ["patient"]
};
return entity;
};
};
Please switch your code to use my Entities collection to store Patients. To get the current selected patient from the session, you can use the getPatient() function. To set a new patient in the session, use the setPatient() function.
Hi David,
Personal Information
First Name Last Name Select your Sex Male
Female Date Of Birth Country Of Residence Postal Code
Capture email Capture key demographics: sex, date of birth, country of residence, postal code link accounts (Google, FB, etc.) Also capture avatar for the user - from FB or Google if available.