This is returning the location of the most recent admission/discharge/transfer, which is probably not right. I don't think you need to join on adt. You only need encounter and location.