I would remove the referencedColumnName attribute in MedicalCompany because you are naming the primary key field of AccountEntity. I think it is only necessary if you if it references a non-primary-key field.
@JoinColumn(name = "medical_company_id", referencedColumnName = "account_entity_id")