relational other than integer

For HanDBase related topics that are not specific to one platform.

relational other than integer

Postby msreimol » Tue Mar 17, 2015 5:44 pm

Hi everybody,

I am trying to set up two databases: one for patients, another one for exams. I want both databases to be linked by an automatic ID created for each patient. To this end, I am using the field type "unique" within the patient database.

When listing all exams, I need the patients birth date to be displayed along with the exam data. I thought this could be easily done by creating the two fields "patient ID" and "date of birth" within the exam database with the latter being of type "relational". However, this seems to work only if the filed "patient ID" is of type integer.

But I do not want the user to enter an integer patient ID manually in order to connect exam and patient, I want to give the user the possibility to select the patient ID from the patients database. I was able to implement this by setting the patient ID field (within exam database) to field type "linked" or to "DB popup". But then, the DB lookup for birth date was no longer working. This lookup worked only as long as the patient ID field (within exam database) was set to field type "integer".

What am I doing wrong?

Thanks in advance!
Matthias
msreimol
 
Posts: 3
Joined: Tue Mar 17, 2015 7:15 am

Re: relational other than integer

Postby Brian_Houghton » Thu Mar 19, 2015 4:56 pm

Hi Matthias,

Thanks for writing.

Are you using HanDBase on an iOS device? If yes, my advice would be to forego using the actual unique field type in favor of a homegrown unique field using the concatenate feature of the external field.

You could use this to add the date of birth of a patient to their last name, creating something along the lines of "Houghton xx/xx/1977". The result of the concatenation would be saved into a text field, which can be used as the basis of a relationship.

The reasons against using the unique field type include that it won't work in relationships and that the default unique counter we use internally can generate falsities in certain circumstances. We are going to redo it in the next major revision.

Let me know if you have any additional questions!
Kind Regards,
Brian Houghton, DDH Software
Brian_Houghton
 
Posts: 2246
Joined: Wed May 20, 2009 8:30 am

Re: relational other than integer

Postby Ad!12 » Wed Apr 01, 2015 10:45 pm

When will be the revision be released?
Ada
Ad!12
 
Posts: 2
Joined: Wed Apr 01, 2015 10:34 pm

Re: relational other than integer

Postby Brian_Houghton » Fri Apr 03, 2015 10:04 am

Hi Ada,

Thanks for posting.

As a matter of practice we don't publicize release dates as far too many variables can occur.

With that said the next major revision is not in development at this time. I was noting that we would consider this for that update.
Kind Regards,
Brian Houghton, DDH Software
Brian_Houghton
 
Posts: 2246
Joined: Wed May 20, 2009 8:30 am

Re: relational other than integer

Postby Zinc Oianoid » Thu Apr 16, 2015 11:00 pm

So you have a one to many relationship which needs to access the DOB in the patient db when looking at an exam.

You might code it that the DOB is pulled from the patient record at the time the exam is created rather than getting it each time you look at the exam.

I know, it violates the rule of redundant info but it will work.

If you want to send me the 2 files with test info I will play with it.

disposall.001@gmail.com

I may even do it just for Jollies.
-----------------------------------------

Longtime MS Access / HanDBase programmer.

PC / Mac / Printer tech Since 1982
Zinc Oianoid
 
Posts: 26
Joined: Sun Jun 06, 2010 10:26 pm

Re: relational other than integer

Postby Zinc Oianoid » Fri Apr 17, 2015 12:26 am

Just did it now for Jollies.

Not knowing how you set up the db you have I can't say if you did anything wrong so here is a bare bones layout.

BTW, I can send you the 2 test files I made so you can see it work.

Patient file has:
ID Text
DOB Date
Exam Relational ID field in Patient to ID in Exam DB
Additional fields


Exam Db:
ID Text
DOB Relational ID field in Exam db to ID field in Patient db, show DOB
Additional fields

The exam relationship will logically come out as a one to one since there should only be one patient ID matching.
I assume that the ID is coming from some source that already has made the field unique.
Otherwise you will have to create a method.
-----------------------------------------

Longtime MS Access / HanDBase programmer.

PC / Mac / Printer tech Since 1982
Zinc Oianoid
 
Posts: 26
Joined: Sun Jun 06, 2010 10:26 pm


Return to HanDBase General Discussion

Who is online

Users browsing this forum: No registered users and 2 guests

cron