|
Algorithm 3 Attribute-based EHR Searching Algorithm |
-
Require:
Search Threshold , Search Parameters
-
Ensure:
Search Results (Blocks’ Information and Similarity Scores)
-
1:
Initialize Blockchain Database
-
2:
for each Search Parameter p do
-
3:
Let H be the set of hashes for parameter p
-
4:
Let S be an empty set for storing similarity scores
-
5:
if p is an EHR then
-
6:
HashCalcaulation(EHR’s attributes)
-
7:
else if p is an Attribute then
-
8:
-
9:
else if p is a set of Hashed Attribute Values then
-
10:
-
11:
end if
-
12:
for each block b in Blockchain do
-
13:
SimilarityScoreCalculation(H, b)
-
14:
Add to S
-
15:
end for
-
16:
Filter S to include only those with score
-
17:
end for
-
18:
return
S
|