Using 1 PDB as a link/linked and as a DB Popup

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

Using 1 PDB as a link/linked and as a DB Popup

Postby flame1carol » Fri May 07, 2010 9:50 pm

Is it possible to use a single database in a linked relationship and also as a DB Popup? I confess I'm confused on the link/linked concept so maybe this isn't possible but here's what I'm trying to do.

I have a Health database with a field called "Patient" for my mom, brother and myself. This main database consists of link fields to separate databases for lists of allergies, immunizations, medications, etc. for each patient. One of my link fields in Health.pdb is called "Medical" and links to H-MedCont.pdb containing medical contact fields (doctor's name, phone, address, specialty, etc.) That part seems to work okay.

I also have a field in the Health.pdb called "Appointments" that links to H-Appts.pdb with dates and times of appointments with specific doctors. Rather than entering the doctors' names, I want to make that a DB Popup field that connects to the H-MedCont.pdb to select the doctor's name from the existing contact database. Is this possible?

I have one other unrelated question. In the Health database, is it possible to display (in Health.pdb) the number of records in the linked databases? I'm picturing something like this.
Mom
Allergies 0
Immunizations 4
Medications 2

Up until now, I've only built very simple pdbs with no linked databases so any suggestions would be greatly appreciated!

Carol
flame1carol
 
Posts: 4
Joined: Fri May 07, 2010 8:47 pm

Re: Using 1 PDB as a link/linked and as a DB Popup

Postby dhaupert » Mon May 10, 2010 11:11 am

Is it possible to use a single database in a linked relationship and also as a DB Popup? I confess I'm confused on the link/linked concept so maybe this isn't possible but here's what I'm trying to do.

I have a Health database with a field called "Patient" for my mom, brother and myself. This main database consists of link fields to separate databases for lists of allergies, immunizations, medications, etc. for each patient. One of my link fields in Health.pdb is called "Medical" and links to H-MedCont.pdb containing medical contact fields (doctor's name, phone, address, specialty, etc.) That part seems to work okay.

I also have a field in the Health.pdb called "Appointments" that links to H-Appts.pdb with dates and times of appointments with specific doctors. Rather than entering the doctors' names, I want to make that a DB Popup field that connects to the H-MedCont.pdb to select the doctor's name from the existing contact database. Is this possible?


Hi there,

It sure is possible to use them- each table is accessible from the DB Popup field regardless of how those fields are being elsewhere. The only exception to this is the relationship field- I don't believe you can point to a relationship field within a db popup at this point. So as long as your contact database is set up within HanDBase, you should be able to point to it with a db popup field (or two or more if you use the group feature) and grab those values from the db popup selection.

I have one other unrelated question. In the Health database, is it possible to display (in Health.pdb) the number of records in the linked databases? I'm picturing something like this.
Mom
Allergies 0
Immunizations 4
Medications 2


You can do this by using a combination of a record count calculation field and a Relationship field in the health database. First:
In the linked database(s) add a calculated field which has the calculation of the prev record's same field + 1. This means for every record the value of this calculation will be one greater than the previous field's value, thus a counter.
Now in the health database, add a relationship field, point it to the link field in this database, and the linked field in the linked database and then choose to show the above calculated field you created. It asks whether to show the first or last one and in this case, choose the last.

The number won't be up to date until you follow the link for that database. When you click the link field to follow it, the subset of records will show and the calculation updated to count the number of records within the view. Now when you return that value will be up to date. As long as you never open the Allergies, Immunications, Medications, etc directly, but alwayrs via the link field, those calculations will be correct. If you open Allergies directly, it will show all records in allergies, and thus the counters will adjust to show the total number of records. Then when you are in your Health database, the total will not reflect only those subset of records that belong to the person (ie, Mom). I hope this makes sense- let me know if you have any questions after reading and trying this in your database.
dhaupert
 
Posts: 4111
Joined: Tue May 26, 2009 11:51 am

Re: Using 1 PDB as a link/linked and as a DB Popup

Postby flame1carol » Mon May 10, 2010 11:27 pm

Hi Dave,

I guess I'm still confused. I do see that if I make my "physician" field in the H-Appts.pdb a DB Popup, I do get the list of doctors that have been entered in the H-MedCont.pdb, however, I see all of them, not just the ones for the patient I'm working on. I read in one of the other forum posts that a DB Popup can't be filtered yet. Is that the situation I'm in now or is there some way that, when I'm setting up an appointment for Mom, I can see just her physicians in the DB Popup?

The "counter" sounds interesting. I'll give that a shot after I work out my DB Popup scenario.

Thanks for your help!
Carol
flame1carol
 
Posts: 4
Joined: Fri May 07, 2010 8:47 pm

Re: Using 1 PDB as a link/linked and as a DB Popup

Postby dhaupert » Tue May 11, 2010 12:38 pm

Hi Carol,

You're correct that you can't automatically filter a list for a DB Popup based on other field values. You can work around this in your case since you have a limited number of people (mom, you, etc). Here's how:

Create a field in the physicians db that shows the name of who that doctor is for. Fill this out as you add each doctor.
Create a view for each person (eg, Mom) that has a filter set on the field you created above.
Now when you select the DB Popup, choose the view of the person that you are looking for, and you'll only see their doctors.

Hope this helps!
dhaupert
 
Posts: 4111
Joined: Tue May 26, 2009 11:51 am

Re: Using 1 PDB as a link/linked and as a DB Popup

Postby flame1carol » Wed May 12, 2010 5:32 pm

Hi Dave,

Thanks for the answers; I think I understand. If you wouldn't mind indulging me in one more question, I want to be sure I understand the benefits of defining a secondary database as a link/linked pdb versus a DB popup - before I enter a lot of data. Since I have a lot of secondary databases for immunizations, appointments, family history, medications, etc., I would like to define them in the way that is the most efficient and that would make the most sense.

I'll use the family history pdb as an example. It contains fields for the patient (i.e., Mom), the name of the relative, the relationship (i.e., brother), year born, condition (i.e., cancer), age when condition started, a checkbox to be used if the condition was the cause of death, and a note field.

If I define Famhist.pdb as linked to the Health.pdb (through "family history" in Health.pdb and "patient" in Famhist.pdb), when I press the "family history button" in Health it takes me to the Famhist database where I can enter historical information. When I subsequently click the "family history button", the only records that will display in the Famhist database are for the particular patient ("Mom").

If I define the Famhist database as a DB Popup in Health.pdb, I can still enter the history for each relative, but when I subsequently click on the DB Popup field in Health, I will see records for all patients, unless I switch to a "view" that I create for each patient.

What I'm not clear on is this (and yes, I know I'm talking about something that hasn't been designed yet, but I'm trying to be sure I understand the concepts.) If, in the future, the ability to filter records in a DB Popup window is added, what would then be the benefit of using link/linked over DB Popup? Wouldn't it then accomplish the same thing?

I guess another benefit to using the DB Popup is the grouping feature that would allow me to pull more than one field from the DB Popup database into the parent database. Are there other benefits to using link/linked over DB Popup that I'm not picking up on?

Thanks so much for your patience and guidance.

Carol
flame1carol
 
Posts: 4
Joined: Fri May 07, 2010 8:47 pm

Re: Using 1 PDB as a link/linked and as a DB Popup

Postby dhaupert » Thu May 13, 2010 11:19 pm

Hi Carol,

While you're correct that there would be some possible overlap in functionality, and that indeed the filter option for DB Popups doesn't exist at this point, there would be a main differnce- the DB Popup when pressed would show a subset of records on the other side, but you'd not be able to edit those records, only select one to copy back data fields. So it's actually in essence quite a different animal!
dhaupert
 
Posts: 4111
Joined: Tue May 26, 2009 11:51 am

Re: Using 1 PDB as a link/linked and as a DB Popup

Postby flame1carol » Thu May 13, 2010 11:25 pm

Aha! I knew I was probably missing something. That certainly helps me make some decisions as to how to set this up. Thanks so much for your help!

Carol
flame1carol
 
Posts: 4
Joined: Fri May 07, 2010 8:47 pm


Return to HanDBase General Discussion

Who is online

Users browsing this forum: Google [Bot] and 1 guest