Adjusted relationships for patients and images and history