The present invention relates to a method for exchanging data between at least two servers with use of a gateway. Preferably the method is applied to healthcare systems. Each server holds its own unique federated identifier for the same single subject (P). Thus, it is possible for the servers to communicate with each other without having to reveal the true identity of subject. By creating one session pseudonym for each pair of providing server (12) holding relevant subject data and a requesting server (10) and by formatting an inbound session identifier related to the requesting server and an outbound session identifier related to the providing server for each session pseudonym the servers may communicate anonymous data with each other. The subject data is transferred from the at least one providing server to the requesting server and all session pseudonyms are replaced, in the requesting server, with the identifier of the requesting server for the subj ect (P).