Asher Yatzar in middle of Davening:
Pesukei Dezimra: When one goes to the bathroom [to urinate] in middle of Davening, some Poskim rule he may say Asher Yatzar in middle Pesukei Dezimra [even if one is in middle of a paragraph]. Nonetheless, it is best to delay the Asher Yatzar and recite it between the paragraphs [i.e. Bein Haperakim] of Pesukei Dezimra. Certainly it may be recited between Yishtabach and Yotzer Or. Other Poskim however rule it may not be said during Pesukei Dezimra and is to be said either between Yishtabach and Yotzer Or or after Davening.
Birchas Shema: It is forbidden to recite Asher Yatzar during Birchas Shema, and hence if one urinated during Birchas Shema he is to delay the Asher Yatzar until after Shemoneh Esrei.
 According to Admur in the Siddur, it is forbidden to have a bowl movement from Baruch Sheamar until after Shemoneh Esrei, and rather one is to withhold himself. See our Sefer “Awaking like a Jew” chapter 7 Halacha 12
 Ginos Veradim 1/51; Beir Heiytiv 53/3; Makor Chaim 51/5; Kesher Gudal 7/33; Derech Hachaim; Birchas Habayis 39/4; Aruch Hashulchan 51/6; M”B 51/8; Ketzos Hashulchan 18/7; Luach of Dinei Hefsek Betfila [of Rav Y.Y. Eidalman]
 So is evident from Poskim ibid, however see Biur Halacha 53/3 “Ein Levareich” that only allows between Perakim
 The reason: As one may make any interval of praise during Pesukei Dezimra, as evident from the ruling that one may answer Amen. [M”B ibid] One should not delay it until after Davening as perhaps he will need to go to the bathroom a second time [or forget to say it]. [Biur Halacha 51/4 “Tzarich Lizaher”]
 Biur Halacha 51/4 “Tzarich Lizaher” and 53/3 “Ein Levareich”; Ketzos Hashulchan 18/7 footnote 28
 See Admur 53/3 and 54/3 and Michaber 53/3 that the blessing on Tallis/Tefillin may be said between Yishtabach and Yotzer as it is permitted to make an interval in that area for the sake of a Mitzvah
 Chayeh Adam 20/3, brought in Biur Halacha ibid; Kitzur SHU”A 14/1 “Say it afterwards” as explained in Lechem Hapanim “Say it in-between Yishtabach and Yotzer as rules Nishmas Adam”; Tehila Ledavid 53/1 leaves this matter in question; See Ashel Avraham Butchach 51 “If he accidently said Asher Yatzar during Pesukei Dezimra”; Kaf Hachaim 51/28; 53/7; Or Letziyon 2/85-2; Yabia Omer 8/6-7; Igros Moshe 4/14 negates ruling of M”B and he himself said it after Davening, although does not give final ruling and says one who desires to say it during Pesukei Dezimra may do so; Vayeishev Moshe 1/90 that so is custom; The Sefer Hefsek Betefila [Lemberg] p. 86 leaves this matter in question according to Admur;
 The reason: This is similar to the ruling that the blessings of Tallis/Tefillin are not to be said during Pesukei Dezimra being it is forbidden to make an interval during Pesukei Dezimra even for the sake of a Mitzvah. [Admur 53/3] Now, although one may answer Amen during Pesukei Dezimra being that Amen is a praise, this is because one cannot answer it later on, in contrast to Asher Yatzar that may be said even after Davening. [See Nishmas Adam ibid and Kitzur SHU”A ibid in Lechem Hapanim in negation of ruling of Ginas Veradim; Hefsek Betfila ibid]
 Chayeh Adam 20/3 as explained in Nishmas Adam 20 “Say it between Yishtabach and Yotzer” [This is unlike possible understanding of Biur Halacha ibid that Chayeh Adam rules it is to be delayed until after Davening]; Kitzur SHU”A 14/1 as explained in Lechem Hapanim “Say it in-between Yishtabach and Yotzer as rules Nishmas Adam”; Tehila Ledavid 53/1 “One may delay it until between Yishtabach and Yotzer Or or after Davening”; Kaf Hachaim 51/28; 53/7; Or Letziyon 2/85-2; Yabia Omer 8/6-7; The Sefer Hefsek Betefila [Lemberg] p. 86 leaves this matter in question according to Admur, which is clearly incorrect, as none of the above Poskim ever doubted the allowance to say it between Yishtabach and Yotzer, as clearly ruled in Admur that one may make an interval for the sake of a Mitzvah in-between.
The reason: As it is permitted to make an interval for the sake of a Mitzvah between Yishtabach and Yotzer. [Admur 53/3 and 54/3 and Michaber 53/3]
 Igros Moshe 4/14 said it after Davening; Tehila Ledavid 53/1 “One may delay it until between Yishtabach and Yotzer Or or after Davening”;
 See Admur in Siddur; 66/5; Ketzos 19/1