The Rabbis taught: One who enters to visit the sick says, "It is Shabbat, from crying out [one must refrain], and healing is soon to come by the merit of Shabbat," and he should broaden their minds with comforts (Rashi). And this refers to a sick person who is not in immediate danger today, for if he is in immediate danger today, it is permitted to cry out and supplicate on Shabbat, as written in siman 576. And Rabbi Meir says the visitor should say: "Shabbat is able (the Rif) to have mercy," if you honor it by not grieving on it (Rashi). Rabbi Yehuda says he should say: "May the Omnipresent have mercy upon you and upon the sick of Israel," for the merit of the many is great. Rabbi Yose says he should say: "May the Omnipresent have mercy upon you among the sick of Israel," for when he includes him with the others, it is much better. Shevna of Jerusalem, upon his entry to the sick person, says "Shalom," and upon his departure says: "It is Shabbat, from crying out [one must refrain], and healing is soon to come, and His mercies are many, and may His Shabbat be in peace." And the Rambam in chapter 24 wrote according to the wording of the first Tanna, and the Tur and the Shulchan Aruch wrote according to the wording of Shevna, for he did not come to disagree but only to add a little, and our custom is like the Rambam. And likewise when they make a "Mi Shebeirach" for the sick in the synagogue, one should not say as on a weekday: "May the Omnipresent send healing," but rather "It is Shabbat, from crying out etc." (the Gra"z). But among us they bless "and may He send him a complete healing... it is Shabbat, from crying out etc.," and so it is printed in the prayer books. And I do not know who permitted this to them, if not for a very dangerously sick person, who is in immediate danger today as I have written.
תנו רבנן: הנכנס לבקר את החולה - אומר 'שבת היא מלזעוק ורפואה קרובה לבא בזכות השבת', וירחיב דעתם בתנחומים (רש"י). ומיירי בחולה שאין בו סכנת היום, דא(י)לו יש בו סכנת היום - מותר לזעוק ולהתחנן בשבת, כמ"ש בסימן תקע"ו ורבי מאיר אומר שיאמר המבקר: 'יכולה היא שבת (רי"ף) שתרחם', אם תכבדוהו מלהצטער בה. (רש"י) רבי יהודה אומר שיאמר: 'המקום ירחם עליך ועל חולי ישראל', דזכות הרבים גדול. רבי יוסי אומר שיאמר: 'המקום ירחם עליך בכלל חולי ישראל', דכשכוללו עם האחרים - עדיף טפי. שבנא איש ירושלים בכניסתו להחולה אומר 'שלום', וביציאתו אומר: 'שבת היא מלזעוק ורפואה קרובה לבא, ורחמיו מרובין ושבתו בשלום'. והרמב"ם פרק כ"ד כתב כלשון התנא קמא, והטור והש"ע כתבו כלשון שבנא, דלא לחלוק בא אלא להוסיף קצת, ומנהג[י]נו כהרמב"ם. וכן כשעושין 'מי שבירך לחולה' בבית הכנסת, לא יאמר כמו בחול: 'המקום ישלח רפואה', אלא 'שבת היא מלזעוק וכו' (הגר"ז). אבל אצל[י]נו מברכים 'וישלח לו רפואה שלימה… שבת היא מלזעוק וכו', וכן נדפס בסידורים. ולא ידעתי מי התיר להם זה, אם לא בחולה מסוכן גדול, שיש בו סכנת היום כמ"ש.