Data Types

Overview

https://www.hl7.org/fhir/structuredefinition-examples.html 以這裡 Primitive Types 的內容為基礎,並在value 的區塊加入下面內容。


Boolean

Comment

以XOR加密。

Encryption process

  1. 以ASCII排序value set後進行編碼轉換為數字表示(False=0|True=1)。
  2. 產生一個與編碼後等長的XOR金鑰。
  3. 將編碼後的內容與金鑰進行XOR運算得到密文。
  4. 將密文解碼回value set內容。

Decryption process

  1. 將密文的value set值進行編碼成數字。
  2. 提取出對應的XOR金鑰。
  3. 將編碼的數字與金鑰進行XOR運算解密。
  4. 將解密結果解碼回對應的value set值。

Time、date、dateTime、uuid

Comment

以XOR加密。

Detailed encryption process

  1. 將非格式相關的所有英數字明文提取出來。
  2. 產生一組與提取字元等長的XOR金鑰,並確保金鑰加密後仍為英數字。
  3. 透過XOR金鑰與提取出的明文進行加密運算獲得密文。
  4. 將密文對應回原提取明文的格式位置。

Detailed decryption process

  1. 將非格式相關的所有英數字密文提取出來。
  2. 提取出XOR金鑰
  3. 將密文與金鑰進行XOR運算解密獲得明文
  4. 將明文對應回原提取密文的格式位置。

decimal、Integer、unsignedInt、positiveInt

Comment

使用同態加密技術進行加解密。

url

Comment

Detailed encryption process

  1. 將url以AES-256進行加密並進行URL encode。
  2. 在編碼後的字串前加上https://以符合格式要求。

Detailed decryption process

  1. 將url的https://字串移除,並進行URL decode獲得密文。
  2. 以AES-256進行解密。

base64binary

Comment

使用AES-256加解密,但Provenance的signature element不需進行加密。

string、markdown、uri

Comment:

使用AES-256加解密。

code

Comment

Encryption process

  1. 先判斷是否屬於已定義value set,是則執行以下步驟,否則以AES-256進行加解密。
  2. 以ASCII排序value set後進行編碼轉換為數字表示。
  3. 產生一個與編碼後等長的XOR金鑰。
  4. 將編碼後的內容與金鑰進行XOR運算得到密文。
  5. 將密文解碼回value set內容。

Decryption process

  1. 將密文的value set值進行編碼成數字。
  2. 提取出對應的XOR金鑰。
  3. 將編碼的數字與金鑰進行XOR運算解密。
  4. 將解密結果解碼回對應的value set值。