wvandenberg
Technical User
I am still trying to work out a few design issues before I start loading data into my db. I included this question as part of another thread but did not receive any feedback. So, I am, posting just this issue.
I have a table that stores lab test names (analytes) and associated information:
tblAnalytes:
pkAnalyte_ID
fkLab_Group_ID
fkReporting_Units_ID
Analyte_Name
Detection_Limit
fkAnalysis_Method_ID
I would like to be able to "link" similar analyte names to a standard analyte group and analyte name that my company uses. tblAnalytes.Analyte_Name will contain data like:
Mercury (Hg)
Mercury
LL Mercury
Trace Mercury
Hg DISSOLVED
EthylBenzene
Ethyl benzene
ethylbenzene
Tin (Sn)
Tin
I would like to store the original Analyte_Name (so we always have a record of the original). However, if the analyte is a variation of one of the company's standard analytes, the analyte name should always be displayed (viewing/exporting) with a standard spelling, capitalization, etc. For the above sample data,
Analyte_Name[tab][tab]Standard_Analyte_Name
Mercury (Hg)[tab][tab]Mercury
Mercury[tab][tab]Mercury
LL Mercury[tab][tab]Mercury
Trace Mercury[tab][tab]Mercury
Hg DISSOLVED[tab][tab]Mercury
EthylBenzene[tab][tab]EthylBenzene
Ethyl benzene[tab][tab]EthylBenzene
ethylbenzene[tab][tab]EthylBenzene
Tin (Sn)
Tin
All the standard analyte names will be in tblAnalytes (in addition to all the non-standard iterations) so I was thinking I could add a field in tblAnalytes that would reference the pkAnalyte_ID of the matching iteration that is the standard Analyte_Name. Like this:
tblAnalytes:
pkAnalyte_ID
fkLab_Group_ID
fkReporting_Units_ID
Analyte_Name
Std_Analyte_ID
Detection_Limit
fkAnalysis_Method_ID
Not all analyte names are in the standard list, so Std_Analyte_ID would be null for these non-standard analytes. For the analyte iteration that is the standard, it would reference itself.
Here is how the data would look:
pkAnalyte_ID Analyte_Name Std_Analyte_ID
1 Mercury (Hg) 2
2 Mercury 2
3 LL Mercury 2
4 Trace Mercury 2
5 Hg DISSOLVED 2
6 EthylBenzene 6
7 Ethyl benzene 6
8 ethylbenzene 6
9 Tin (Sn) Null
10 Tin Null
Am I totally going at this problem incorrectly or will this work? By "work" I mean, will it allow me to display and export all the different Analyte_Name iterations as one standard Analyte_Name?
Any advice or criticism is greatly appreciated.
Wendy
I have a table that stores lab test names (analytes) and associated information:
tblAnalytes:
pkAnalyte_ID
fkLab_Group_ID
fkReporting_Units_ID
Analyte_Name
Detection_Limit
fkAnalysis_Method_ID
I would like to be able to "link" similar analyte names to a standard analyte group and analyte name that my company uses. tblAnalytes.Analyte_Name will contain data like:
Mercury (Hg)
Mercury
LL Mercury
Trace Mercury
Hg DISSOLVED
EthylBenzene
Ethyl benzene
ethylbenzene
Tin (Sn)
Tin
I would like to store the original Analyte_Name (so we always have a record of the original). However, if the analyte is a variation of one of the company's standard analytes, the analyte name should always be displayed (viewing/exporting) with a standard spelling, capitalization, etc. For the above sample data,
Analyte_Name[tab][tab]Standard_Analyte_Name
Mercury (Hg)[tab][tab]Mercury
Mercury[tab][tab]Mercury
LL Mercury[tab][tab]Mercury
Trace Mercury[tab][tab]Mercury
Hg DISSOLVED[tab][tab]Mercury
EthylBenzene[tab][tab]EthylBenzene
Ethyl benzene[tab][tab]EthylBenzene
ethylbenzene[tab][tab]EthylBenzene
Tin (Sn)
Tin
All the standard analyte names will be in tblAnalytes (in addition to all the non-standard iterations) so I was thinking I could add a field in tblAnalytes that would reference the pkAnalyte_ID of the matching iteration that is the standard Analyte_Name. Like this:
tblAnalytes:
pkAnalyte_ID
fkLab_Group_ID
fkReporting_Units_ID
Analyte_Name
Std_Analyte_ID
Detection_Limit
fkAnalysis_Method_ID
Not all analyte names are in the standard list, so Std_Analyte_ID would be null for these non-standard analytes. For the analyte iteration that is the standard, it would reference itself.
Here is how the data would look:
pkAnalyte_ID Analyte_Name Std_Analyte_ID
1 Mercury (Hg) 2
2 Mercury 2
3 LL Mercury 2
4 Trace Mercury 2
5 Hg DISSOLVED 2
6 EthylBenzene 6
7 Ethyl benzene 6
8 ethylbenzene 6
9 Tin (Sn) Null
10 Tin Null
Am I totally going at this problem incorrectly or will this work? By "work" I mean, will it allow me to display and export all the different Analyte_Name iterations as one standard Analyte_Name?
Any advice or criticism is greatly appreciated.
Wendy