1 (edited by borisavljevic 2020-06-25 00:02:50)

Topic: [SOLVED] Auto save Application User with additional info

Hi again,

I'm trying to create app for small medical clinic (still learning MVDB). Problem is, when doctor is filling medical exam report for patient, it should auto include logged in doctor in that report.
I know i can take Application.User.Last_name,  Application.User.First_name... from table _user but the problem is I need to auto include  additional data, for example Doctor Specialization (which need to be printed in report), or doctor phone number...
Anyone know what is the best way to do this?

Thanks in advance,

Vladimir

2 (edited by derek 2020-05-18 11:31:31)

Re: [SOLVED] Auto save Application User with additional info

Hi,
As always, a number of different ways with MVD.
I think the most straightforward would be to add your extra fields (phone no', specialism etc) to the _user table.  These can then simply be included in the report.
Have a look at the attachment and shout if anything isn't clear (passwords for the users are all '12345' except admin (which is 'admin').
Derek.

Post's attachments

Attachment icon boris3.zip 339.38 kb, 283 downloads since 2020-05-18 

Re: [SOLVED] Auto save Application User with additional info

derek wrote:

Hi,
As always, a number of different ways with MVD.
I think the most straightforward would be to add your extra fields (phone no', specialism etc) to the _user table.  These can then simply be included in the report.
Have a look at the attachment and shout if anything isn't clear (passwords for the users are all '12345' except admin (which is 'admin').
Derek.

Hi Derek,

Thank you for your time. I see what you did and things are more clear now. But in my case, there is no need for connection between _user and patient becouse every patioent can have (can be examined) by every doctor. What I need is, when I'm saving patient examination data, I need to auto take currently logged in user (doctor) and save it as part of examination, so later I can chech examination details with name and specialization of doctor who did that examination.


Thanks in advance.

Vladimir

Re: [SOLVED] Auto save Application User with additional info

Hi Vladimir,
In that case, I think I'd simply change the relationship from _user / patients to _user / examination.
In the attached example, it now saves the relevant records with the id of the doctor who has logged on.
Hope this helps,
Derek.

Post's attachments

Attachment icon boris5.zip 344.16 kb, 302 downloads since 2020-05-20 

Re: [SOLVED] Auto save Application User with additional info

Thats what I waned. Thank you very much Derek.

Vladimir