I have two entities in CoreData
-- Doctors and Patients. Each patient can have several Doctors, and each Doctor can have several Patients (i.e. many-to-many relationship).
That's all easy. Now the juicy bit -- I want to track the times of all visits of Patients to Doctors.
In other words, I need to know that Patient A
visited Doctor X
at time 1
and Patient A
visited Doctor Y
at time 2
.
How can this be done?
I thought about adding an NSDictionary property to Patient
entity, where value
would be Doctor's objectID
and key
would be NSDate
time of visit, but it doesn't look like a good approach.
Any suggestions?