If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > Measurement

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-14-10, 10:59
pinkfloyd43 pinkfloyd43 is offline
Registered User
 
Join Date: Dec 2010
Posts: 39
Measurement

I am working on a health care system where physicians will be entering information. Much of the information entered will be numeric values with some type of corresponding 'Unit Of Value', ie Height can be measured in Feet/Inches, or meters or other types measure depending on the item.

My question, as I have not seen this before is how to store the unit of measure. Seems bad to have a table with column Height and another column HeightUnitOfMeasure?

Any input would be appreciated.
Reply With Quote
  #2 (permalink)  
Old 12-14-10, 11:25
r937 r937 is online now
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,534
Quote:
Originally Posted by pinkfloyd43 View Post
Seems bad to have a table with column Height and another column HeightUnitOfMeasure?
no, seems good

__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #3 (permalink)  
Old 12-14-10, 12:21
pinkfloyd43 pinkfloyd43 is offline
Registered User
 
Join Date: Dec 2010
Posts: 39
Quote:
Originally Posted by r937 View Post
no, seems good

Except I may hundreds of tables and so many additional columns to capture was thinking 'there may be a better method?'
Reply With Quote
  #4 (permalink)  
Old 12-14-10, 12:26
healdem healdem is offline
Jaded Developer
 
Join Date: Nov 2004
Location: out on a limb
Posts: 9,262
you will find similar issues with other units of measure, such as weight
the Metric world uses Kilograms, the US & Canada use pounds, the UK is all over the shop (could be pounds, stones and so on)
however you do need some mechanism of resolving what ever unit of measure to an internal reference point, assuming that you do need to compare such values even if the recorded units vary.
as a general rule I'd suggest using the metric system as your base system, and use the ISO base units for each measurement type
eg
Weight: Kilogram
Distance / length: metre
and so on
__________________
I'd rather be riding my Versys or my Tiger 800 let alone the Norton
Reply With Quote
  #5 (permalink)  
Old 12-14-10, 12:26
r937 r937 is online now
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,534
hundreds of tables with unit of measure???

what kind of tables are they? why so many?
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #6 (permalink)  
Old 12-14-10, 14:11
pinkfloyd43 pinkfloyd43 is offline
Registered User
 
Join Date: Dec 2010
Posts: 39
There could be hundreds of tables with values within them that would require a unit of measure. The requirements indicate that the physician should be given the ability to choose unit of measure that would be appropriate for the particular data element.

IE PatientWeight could be in lbs or kilos we need to store the unit of measure. With medicine there are ton's, and ton's, of these types of
information.

Original thought of having ColumnName and ColumnNameUnitOfMeasurement just seems to be wrong but may end up doing it that way.
Reply With Quote
  #7 (permalink)  
Old 12-14-10, 14:46
r937 r937 is online now
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,534
i understand the issue, but hundreds of tables with unit of measure?
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #8 (permalink)  
Old 12-14-10, 15:33
healdem healdem is offline
Jaded Developer
 
Join Date: Nov 2004
Location: out on a limb
Posts: 9,262
Quote:
Originally Posted by pinkfloyd43 View Post
....Original thought of having ColumnName and ColumnNameUnitOfMeasurement just seems to be wrong but may end up doing it that way.
what other way is there of modelling that requirement, unless you take the decision to convert the values before insertion into the db. If your assignment allows for such sophistry then do it. however my experience has usually been that people want the option to convert to the units of measure they are familiar with. they want to see data as they input it, they want to see other data in "their" format, even if it wasn't recorded in that format
so to me that means you need the value and a unit of measurement. arguably you could store the value as your internal base unit and change the display (if or as required), however you have a potential problem if someone decides to tinker with the base unit
__________________
I'd rather be riding my Versys or my Tiger 800 let alone the Norton
Reply With Quote
Reply

Tags
database design, table design

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On