Table design about sets of data collection elements

穿精又带淫゛_ 提交于 2019-12-13 04:28:58

问题


Let me know if you need additional information as this is my first post to the forums.

The design is for clinical studies. Easiest way to explain would be to give an example to a scenario which applies to all studies/protocols in some shape or form. Say I have:

  • Study1, Study2, Study3
  • Study1 has Protocol1, Protocol2, Protocol3
  • Each protocol has "data collection" (set of forms, questions and sample collections, which can overlap across studies and/or protocols)
  • All these data collections are scheduled to be completed in clinic visits.

I can build all the relationships between Study, Protocol and Questions similar to a questionnaire/survey design structure. However this is where it gets tricky with the protocol definitions and how to link protocols back to the data collection items, some examples are:

  • Protocol1 has a form that needs to be filled every 3 months after enrollment to 24 months, then every 6 months.
  • Protocol1 has a sample collection at 6month, 15month, 27month and then annually.
  • Protocol1 has another sample collection which needs to happen at the age of 4, 5 and 6.
  • Some data collection items are at the enrollment, some are every visit, etc..

What I want is to have a "To-do list" for that clinic visit for a specific patient based on all the relationships between study-protocol-datacollection but I am not sure how to define these conditional criteria for protocols at the back-end to be able to query? or am I trying to do something unrealistic?

**I am using SQL Server by the way


回答1:


Having set up similar schemas myself I would recommend you take the approach of generating all future schedule dates and storing these in a table linked to patient rather than try to calculate these "on the fly". I think this will save you a lot of headaches and difficult queries. For example you could have a table defined like this:

CREATE TABLE PatientSchedule
(
     PatientId INT, /* foreign key into Patient table */
     ProtocolId INT, /* foreign key into Protocol table */
     StudyId INT,  /* foreign key into Study table */
     DataCollectionId INT, /* foreign key into DataCollection table */
     SampleCollectionId INT, /* Foreign key into sample table */
     ScheduleDate DATE
)

(you'll obviously need to adapt this based on your particular relationships but hopefully you get the idea).

This table can then be pre-populated for a particular patient when they enroll for a particular Study/Protocol inserting all scheduled dates upto whatever date is likely to be the realistic maximum in the future.

For a particular clinic visit the "To Do List" query should then be as simple as something like:

SELECT * FROM PatientSchedule
WHERE PatientId = ??
AND ScheduleDate = <clinic visit date>

If schedule dates are changed for any reason in the future it shouldn't be too difficult to update the PatientSchedule table.



来源:https://stackoverflow.com/questions/15512310/table-design-about-sets-of-data-collection-elements

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!