This application was developed to translate two different identifiers which are used to identify patient information in different data sets. Given the scenarios that we have multiple systems which generate and assign a new patient identifier for holding a patients information. This application can be used to translate between the two.
Data for patients can be exported into CSV format. We need a way to translate from one identifier in one data set, to another, in another data set, when given an id map.
The code below builds up a dictionary from the given id map. It can then be used to translate from id in one system to another.
A snippet of the code from the application is provided below.
This function creates two look up tables from the given 2 column csv file.
The first look up will be mapping from columnA to columnB
The second look up will be mapping columnB to columnA
with open(fileName, 'rb') as f:
reader = csv.reader(f)
fileLines = list(reader)
for line in fileLines:
mapAtoB[line] = line
mapBtoA[line] = line
return mapAtoB, mapBtoA
The full application can be provided on request.