There isn’t really much information there on what the function does, but skimming over that link it appears that you’re missing some steps
$product = get_product($doctor->ID);
after doing that, if I’m reading the page right, then you can call
$product->get_price_html();
But you need to find out how these functions work and for that you should be looking at WC documentation or getting help from WC.