Skip to main content
. 2024 Feb 29;24(5):1582. doi: 10.3390/s24051582
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:

            H HashCalcaulation(EHR’s attributes)

  •   7:

        else if p is an Attribute then

  •   8:

            H{Hash(p)}

  •   9:

        else if p is a set of Hashed Attribute Values then

  • 10:

            Hp

  • 11:

        end if

  • 12:

        for each block b in Blockchain do

  • 13:

            scoreSimilarityScoreCalculation(H, b)

  • 14:

            Add (b,score) to S

  • 15:

        end for

  • 16:

        Filter S to include only those with score >θ

  • 17:

    end for

  • 18:

    return  S