residency (n.) Look up residency at Dictionary.com
1570s, see resident + -cy. Hospital sense is from 1924.