|
| |
|
Algorithm 2 Joining patient records with Sovereign Join: SCP side
| |
| Input: Request messages (MSG) | |
| Output: Matching results | |
| 1: | bufferCtr ← 0 |
| 2: | while TRUE do |
| 3: | wait for new message MSG in blocked state |
| 4: | if get_DB_ID(MSG) = “DB1” then |
| 5: | dataDB1 [bufferCtr] ← decrypt(get_record(MSG)) {buffer the record} |
| 6: | recordDB1 [bufferCtr] ← get_recordID(MSG) |
| 7: | bufferCtr ← bufferCtr + 1 {update buffer counter} |
| 8: | else |
| 9: | if get_DB_ID(MSG) = “DB2” then |
| 10: | dataDB2 ← decrypt(get_record(MSG)) |
| 11: | recordDB2 ← get_recordID(MSG) |
| 12: | for i = 0 to BUFFER_SIZE do |
| 13: | if distanceMetric(dataDB1[i], dataDB2) < 1 then |
| 14: | matchedDB1Id ← recordDBl [j] {send match result} |
| 15: | end if |
| 16: | matchedDB1Id ← “No match” |
| 17: | send_ACK2(matchedDB1Id) {no match found} |
| 18: | end for |
| 19: | bufferCtr ← 0 {reset buffer counter} |
| 20: | end if |
| 21: | end if |
| 22: | end while |
|
| |