0

I am trying to solve a simple problem. We have a bunch of numeric fields (lab result values). I would like the users to be able to indicate some common scenarios about the fields:

  • Data not available ("no data")
  • Data not readable ("illegible")
  • Unkown. etc.

I can definitely create a sidecar field that goes with each field and storing a "null" in the original field which would indicate that the numeric value should be obtained from the sidecar field. This solution still enables me to perform numeric value operations on the field, and if needed, I can look in to the sidecar field to find out why the data was missing (null).

I would like to know how you might go about solving this problem, and what are the best ways to address metadata issues like this.

4

1 回答 1

1

真的,我认为你已经掌握了这种情况的最佳选择。如果您需要跟踪此元数据的 2 或 3 个以上的选项,您可能需要考虑创建一个单独的表来存储描述,以便为将来的代码省去麻烦。

TABLE lab_results
  id INT PK
  ...
  meta INT NULL
  meta_reason_id INT NULL

TABLE meta_reasons
  id INT PK
  desc VARCHAR
于 2012-10-26T21:50:44.073 回答