doctor urine test

is the urine pregnancy test performed by a gyn more accurate? can it tell 2 weeks after having unprotected sex? (I've been on the pill for awhile now)