Correct
"An optometrist" is a modifier that must be offset from the rest of the sentence. Commas are the least intrusive way to do this.