While the character of Dr. Mindy Lahiri has the same job as Mindy Kaling's real life mother Swati (who sadly passed away on the same day her daughter was told by FOX that TMP was ordered for their schedule), Kaling has said that the character's personality and other details have nothing to do with what her mom was really like.
Because of the specific scheduling for the pilot/FOX pickup process, Mindy Kaling was only available to make a brief appearance in the premiere for the 9th (and final) season of her former show "The Office". When TMP wrapped its 1st season and got a 2nd season pickup, the timing allowed Kaling (along with BJ Novak, who worked on TMP's 1st season) to make return appearances when "The Office" filmed its series finale.
The series was originally given a pilot order by NBC, but the executives there decided not to continue with the series. When NBC gave up its rights, FOX quickly made a deal with Mindy Kaling to make a new pilot episode; after seeing the results, FOX made a 13-episode initial order and put the show on its 2012-13 schedule.
Richard Schiff was originally cast as the senior managing physician at the Shulman & Associates practice, and he can be seen briefly during the pilot. However, the role of Dr. Shulman was first re-cast with Stephen Tobolowsky, then phased out entirely so that the other doctors (Mindy, Danny and Jeremy) would be each others' bosses and colleagues instead of having a secondary character playing a boss role.
The show was originally picked up for a pilot by NBC, based on Kaling's deal with the network stemming from her years as a writer/producer/actress on "The Office". When NBC passed on the show, Fox TV chief executive Kevin Reilly--who had filled the same role at NBC when "The Office" began its hugely successful run--immediately moved to acquire it, and gave it a full 13-episode order to start the 2012-13 season.
The timing of the show's original--where NBC commissioned a script and then decided not to shoot a pilot, and Fox then stepped in to first OK the pilot and then green-light the series for the 2012-13 season--led to the departures from NBC's "The Office" of both Mindy Kaling and BJ Novak, in the latter case as a consulting producer who had not renewed his contract with NBC after the 8th season. As a result, their characters departed the world of "The Office" very abruptly in the show's 9th and last season premiere, but both were able to return for the series finale because Season 1 of TMP had wrapped up by that time.