P
pietlinden
I'm trying to model a weird situation. I'm slapping together a
database that logs user needs. Kind of like NWind, but instead of
customer-invoice-lineitems-products-suppliers, I have
(guardian)-client-needsdetails-needs-providesneeds-agency.
the needs/providers stuff is worked out. It follows the basic NWind
structure for products and suppliers or whatever.
The problem I'm trying to work out is this:
The clients are customers of the county Mental Health/Mental
Retardation agency. Basically the mentally ill do not need a legal
guardian, while the mentally retarded do. (broadly speaking). In other
words, some of the clients can share a guardian, but not all of them
require one, so "Client/Patient" can't really be modeled as a weak
entity/child of "Guardian".
The fun part is that I need to store mailing address info for these
clients. The MR portion will have a guardian who receives their
paperwork, while the MH population don't need a guardian.
This screws up the standard 1-M relationship that would exist between
client and guardian. How do I deal with addresses in this case?
Guardian---(1,M)---MR_Client---(1,M)---ClientNeeds---(M,1)---Need.
(etc)
[No Guardian] MH_Client---(1,M)---ClientNeeds---(M,1)---Need.
do each of the MH clients have themselves as a guardian, so only the
address info is filled in (No actual Guardian info)?
Just wondering how to deal with this, that's all. Any ideas? I was
thinking about subclassing, but that's not really right either.
Rebecca's example on Accessweb is organization/individual, but that's
PartyType---(1,M)---Party----(1,1)-----Person
|----(1,1)---------Organization
with a disjoin between Party and Person, and Party and Organization. I
understand that fine, but my case is that in my case, the parent table
(Guardian) is optional. And in database terms, that means that some
records can be orphaned, which is a no-no. Is my only option to deal
with this in code?
Okay, so what's the hangup? (Yes, this is going somewhere!)
I'm trying to figure out where/how to store contact/address information
- for all the MR population, the address belongs to the guardian. For
the MH population, it belongs to the individual. I guess I could put
the MH individuals in both the Guardian and the Client tables, but that
seems weird too...
Any ideas how to model this? Or general outlines on how to deal with
this in code? (Don't need a huge example, but a pointer in the right
direction.)
If I've left out some key info, let me know.
Thanks,
Pieter
database that logs user needs. Kind of like NWind, but instead of
customer-invoice-lineitems-products-suppliers, I have
(guardian)-client-needsdetails-needs-providesneeds-agency.
the needs/providers stuff is worked out. It follows the basic NWind
structure for products and suppliers or whatever.
The problem I'm trying to work out is this:
The clients are customers of the county Mental Health/Mental
Retardation agency. Basically the mentally ill do not need a legal
guardian, while the mentally retarded do. (broadly speaking). In other
words, some of the clients can share a guardian, but not all of them
require one, so "Client/Patient" can't really be modeled as a weak
entity/child of "Guardian".
The fun part is that I need to store mailing address info for these
clients. The MR portion will have a guardian who receives their
paperwork, while the MH population don't need a guardian.
This screws up the standard 1-M relationship that would exist between
client and guardian. How do I deal with addresses in this case?
Guardian---(1,M)---MR_Client---(1,M)---ClientNeeds---(M,1)---Need.
(etc)
[No Guardian] MH_Client---(1,M)---ClientNeeds---(M,1)---Need.
do each of the MH clients have themselves as a guardian, so only the
address info is filled in (No actual Guardian info)?
Just wondering how to deal with this, that's all. Any ideas? I was
thinking about subclassing, but that's not really right either.
Rebecca's example on Accessweb is organization/individual, but that's
PartyType---(1,M)---Party----(1,1)-----Person
|----(1,1)---------Organization
with a disjoin between Party and Person, and Party and Organization. I
understand that fine, but my case is that in my case, the parent table
(Guardian) is optional. And in database terms, that means that some
records can be orphaned, which is a no-no. Is my only option to deal
with this in code?
Okay, so what's the hangup? (Yes, this is going somewhere!)
I'm trying to figure out where/how to store contact/address information
- for all the MR population, the address belongs to the guardian. For
the MH population, it belongs to the individual. I guess I could put
the MH individuals in both the Guardian and the Client tables, but that
seems weird too...
Any ideas how to model this? Or general outlines on how to deal with
this in code? (Don't need a huge example, but a pointer in the right
direction.)
If I've left out some key info, let me know.
Thanks,
Pieter