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.

user1532146
  • 184
  • 2
  • 14

1 Answers1

0

use many to many - and include the date range.

this will be the most flexible solution in the long run.

edit:

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

this way, you can indicate when that relationship was valid.

Randy
  • 16,480
  • 1
  • 37
  • 55
  • Hi Randy,Thanks for the reply. What do you mean the date range? Where do I put it? Could you give me an example? – user1532146 Jul 20 '12 at 17:27