Results 1 to 8 of 8

Thread: Measurement

  1. #1
    Join Date
    Dec 2010
    Posts
    39

    Unanswered: 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.

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    Quote Originally Posted by pinkfloyd43 View Post
    Seems bad to have a table with column Height and another column HeightUnitOfMeasure?
    no, seems good

    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  3. #3
    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?'

  4. #4
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    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 on the Tiger 800 or the Norton

  5. #5
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    hundreds of tables with unit of measure???

    what kind of tables are they? why so many?
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  6. #6
    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.

  7. #7
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    i understand the issue, but hundreds of tables with unit of measure?
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  8. #8
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    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 on the Tiger 800 or the Norton

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •