Skip to main content
. Author manuscript; available in PMC: 2014 Sep 5.
Published in final edited form as: IEEE Trans Inf Technol Biomed. 2011 Oct 17;16(1):166–175. doi: 10.1109/TITB.2011.2171701

Algorithm 1 Joining patient records with Sovereign Join: Server side
Input: DB1, DB2
Output: Matching records
 1: bufferCtr ← 0
 2: for rec1 in DB1 do
 3:  MSG ← “DB1”, recordID1, rec1 {Prepare message}
 4:  send_MSG(MSG) to SCP {send message}
 5:  get ACK1 from SCP {get acknowledgement}
 6:  bufferCtr ← bufferCtr + 1 {update buffer counter}
  7: if bufferCtr = BUFFER_SIZE then
 8:   for rec2 in DB2 do
 9:    MSG ← “DB2”, recordID2, rec2
10:    send_MSG(MSG) to SCP
11:    get ACK2 from SCP
12:    outputMatchedDB1Id(ACK2) {output match result}
13:   end for
14:   bufferCtr ← 0 {reset buffer counter}
15: end if
16: end for