biologio / biolog

The main Meteor app for biolog.io
MIT License
3 stars 0 forks source link

Profile page #20

Open dpdonohue opened 9 years ago

dpdonohue commented 9 years ago

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.

dpdonohue commented 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 });
};
dpdonohue commented 9 years ago

I have a method in lib/util/patientUtil.js:

createPatientEntity = function(patientId, name) {
    var entity = {
        _id: patientId,
        name: name,
        etypes: ["patient"]
    };
    return entity;
};
};
dpdonohue commented 9 years ago

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.

dipakyadav commented 9 years ago

Hi David,

1. for now if you login in to the applicaton (i removed the popup which was showing previously) you are redirected to the home page

2. to visit profile page you need to click the circle icon which is at the left of the Signout button from the top header bar.

3. below are the fields which are show, and are also saved in the users collections profile sub-document.

Personal Information

First Name Last Name Select your Sex Male

Female Date Of Birth Country Of Residence Postal Code

4. once you save the information, the prefilled profile page appears thereafter (excluding country field).

5. i have populated the country collection on metero startup, and working further.