In a case management app I am working on I have a scenario where it is required that for each member of a household,
records are maintained for every change of address which may or may not be different from the others in the household.
In my form want to be able to link an address in a child table that may or may not be the same as the parent address.
And if the address is the same, I do not want to create an additional address record for the child:
the condition for this would be ASAME = .T.
However, since the parent record may have multiple address records as well, then the child would need to use the same
DATA_ID field that the parent is using for that address. This is where is gets complicated for me because the
DATA_ID field right now is auto increment and would thereby be unique for each address record in the address table.
All records for parent & child are in the same table which requires 2 keys: one is shared by all family members,
so they may be grouped together, while the other is unique to the member.
Ex: Common CLIENT_ID = "C000123", related MEMBER_ID = M000123.01, M000123.02, M000123.03, etc.
For the HOH member only, a flag is set to true.
It also has to be possible to move a member to another client_id either creating a new Client_ID for him, or by
changing it to that of another HOH client member. This can be handled by NOT allowing his original MEMB_ID to
be changed, so that the combined ID fields remain unique to the table. I created a calc field KEYLINK for this.
Over time, the members of the household may vary and I have an intermediary table to help handle this.
Each HOH Client may have more than one Case linked to which ever household members are present at that time.
So for a particular case, these links may be changed from any prior ones. Also it is possible that for a period
of time in one particular case, the HOH member may not be residing at the same address as the other members
and that change needs to be noted (Ex: Mental Health facility, VA Hospital, Long Term Care facility, etc.).
It's probably obvious that I could use some design help in how to handle the many to many relationships in this app.
But if someone could help me figure out this address scenario, I would be well on my way to wrapping it up.
Somehow I need to be able to lookup the Data_ID field and assign it to a household member without losing the ability
to auto increment that field in the address table when adding a new record. This is what has me stumped...
records are maintained for every change of address which may or may not be different from the others in the household.
In my form want to be able to link an address in a child table that may or may not be the same as the parent address.
And if the address is the same, I do not want to create an additional address record for the child:
the condition for this would be ASAME = .T.
However, since the parent record may have multiple address records as well, then the child would need to use the same
DATA_ID field that the parent is using for that address. This is where is gets complicated for me because the
DATA_ID field right now is auto increment and would thereby be unique for each address record in the address table.
All records for parent & child are in the same table which requires 2 keys: one is shared by all family members,
so they may be grouped together, while the other is unique to the member.
Ex: Common CLIENT_ID = "C000123", related MEMBER_ID = M000123.01, M000123.02, M000123.03, etc.
For the HOH member only, a flag is set to true.
It also has to be possible to move a member to another client_id either creating a new Client_ID for him, or by
changing it to that of another HOH client member. This can be handled by NOT allowing his original MEMB_ID to
be changed, so that the combined ID fields remain unique to the table. I created a calc field KEYLINK for this.
Over time, the members of the household may vary and I have an intermediary table to help handle this.
Each HOH Client may have more than one Case linked to which ever household members are present at that time.
So for a particular case, these links may be changed from any prior ones. Also it is possible that for a period
of time in one particular case, the HOH member may not be residing at the same address as the other members
and that change needs to be noted (Ex: Mental Health facility, VA Hospital, Long Term Care facility, etc.).
It's probably obvious that I could use some design help in how to handle the many to many relationships in this app.
But if someone could help me figure out this address scenario, I would be well on my way to wrapping it up.
Somehow I need to be able to lookup the Data_ID field and assign it to a household member without losing the ability
to auto increment that field in the address table when adding a new record. This is what has me stumped...
Comment