• Something like this should do what you want:

    select

    a.*

    from

    OPENQUERY ( RHSQL ,

    '

    Select

    Brook2.dbo.GetCurrentAdmissionDate(1) as AdminDate,

    Brook2.dbo.GetDOTFromDOA(1),

    Brook2.dbo.GetCurrentAdmissionDate(1) as DischargeDate

    from

    Brook2.dbo.Admission

    ' ) a

    Note that you will have to build the whole query dynamically to pass the value of @PatientId.

    Not hard to do, but I just don't feel like doing it for you. 😛