PHIMASK Library
Overview
The PHIMASK Library is an importable library containing a function that allows for obscuring HL7, FHIR and CDA data.
Import the PHIMASK library into your project. Only the PHIMASKhandler module is needed to be required in order to mask the data.
require "PHIMASK.PHIMASKhandler"
How it works:
Use the Translator's built in help to review how to use the one function.
PHIMASK - performs the obfuscation for the message.
Randomizes each character in specific fields for the incoming message and returns the output.
The fields to mask must be defined in a Lua table containing the relevant paths for CDA and FHIR, while HL7 requires a table of tables, where each row is a different segment.
See the example below on how to create the tables:
-- HL7 (Segment + field(s) e.g., PID.3, PID.5)
local hl7PHI = {
PID = {3, 5, 7, 11, 13, 14, 19}, -- ID, Name, DOB, Address, Phone, SSN
NK1 = {2, 4, 5, 6}, -- Name, Address, Phone, Contact Role
PV1 = {3, 7, 8, 19}, -- Location, Attending, Referring, Visit #
GT1 = {3, 5, 6, 7}, -- Guarantor Name, Address, Phone, SSN
IN1 = {2, 4, 16} -- Insurance ID, Company Name, Insured Name
}
-- CDA
local cdaPHI = {
"recordTarget.patientRole.id",
"recordTarget.patientRole.patient.name",
"recordTarget.patientRole.patient.birthTime",
"recordTarget.patientRole.addr",
"recordTarget.patientRole.telecom",
"author.assignedAuthor.id",
"custodian.assignedCustodian.representedCustodianOrganization.id"
}
-- FHIR
local fhirPHI = {
"identifier",
"name",
"birthDate",
"address",
"telecom",
"contact",
"managingOrganization",
"generalPractitioner"
}