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"
}