Notifications
Clear all
Topic starter
Anyone know what the key is in sql to link the patientcontacts to the patientprofile?
I am not finding and way to link it and I need to be able to pull personal contacts from the patient contacts.
Thanks
Posted : July 22, 2013 1:33 am
I've never done much with the Patient Contacts table, it looks like the PatientRelations table ties into it. This appears to work, you could play around with this to pick up other types of contacts.
SELECT pp.PatientId, pc.* FROM PatientProfile pp INNER JOIN PatientRelationship pr ON pp.PatientProfileId = pr.PatientProfileId AND pr.Type = 5 INNER JOIN PatientContacts pc ON pr.RelatedPartyId = pc.PatientContactsId ORDER BY pp.PatientId
Posted : July 22, 2013 6:37 am
Topic starter
I was able to get that also. Thanks for the reply
Posted : July 23, 2013 3:45 am