0

Example first to make my question clear:

Tested old entity in Common Project: Posology entity (fields: unit, nuberperintake)

Entity in new Project: PatientMedication(fields: drugId, patientId)

PatientMedication may have multiple Posologies for a patient in different time.

I could add one field(column) 'PatientMedicationId' into Posology to have this many-to-one relation. But the thing is that it will change the entity in Common project and make it dependent on the new project.

So I am thinking that maybe I should use many-to-many to have this relation without introduce this dependency.

Is it a good solution? Is there any other idea?

Thanks in advance.

4

1 回答 1

0

使用多对多 - 并包括日期范围。

从长远来看,这将是最灵活的解决方案。

编辑:

example_link_table
----------------------
id_1
id_2
begin_date
end_date

这样,您可以指示该关系何时有效。

于 2012-07-17T15:23:29.250 回答