In 825, an office-rank system was instituted, consisting of a groom, an administrator, a secretary, a clerk and a doctor, and this system was described in the Engishiki (an ancient book for codes and procedures on national rites and prayers).
天長2年（825年）には、別当、院使、判官、主典、医師の各1名を置く職制が定められ、延喜式でも継続された。