Skip to main content
. 2024 Feb 29;24(5):1582. doi: 10.3390/s24051582
Algorithm 1 EHR Generation
  • Require: 

    Collected Health Information HI

  • Ensure: 

    Electronic Health Record EHR and Blockchain EHR Block BlockEHR

  •   1:

    EHR←∅

  •   2:

    BlockEHR←{Header,Body}

  •   3:

    Header←{Hashprev,Timestamp,MerkleRoot(EHR)}

  •   4:

    Body←∅

  •   5:

    for  HIi∈HI  do

  •   6:

        EHR←EHR∪{HIi}

  •   7:

    end for

  •   8:

    for  (attribute,value)∈EHR  do

  •   9:

        attributehash←Hash(attribute)

  • 10:

        valuehash←Hash(value)

  • 11:

        hashpair←Hash(attributehash,valuehash)

  • 12:

        signature←Sign(hashpair,SKuser)

  • 13:

        Body←Body∪{(hashpair,signature)}

  • 14:

    end for

  • 15:

    BlockEHR←{Header,Body}

  • 16:

    Broadcast BlockEHR to Blockchain Network

  • 17:

    Store EHR in Personal Storage