AnonMed is a command-line Java application. When you have already downloaded and extracted AnonMed, you can use it:

  • throught command anonmed when deb package were installed (on GNU/Debian Linux);
  • use prepared script when used ZIP package;
  • directly from the command-line with respect to its syntax if you want co change e.g. output directory.

The most important part of configuration is the de-identification profile. Its real content depends on the goals you want achieve. The level of anonymization and file format leads to making a proper de-identification profile you need for the AnonMed. A sort of examples you can find at the profile page or in the downloaded AnonMed, which is not a comprehensive example, but can be useful for writting your own rules.

Command Line Syntax

This information you can see also with --help argument.

usage: java -jar anonmed-2018.7.jar [options] INPUT [INPUT...]

Options: [-d <file>] [--delete-original] [-h] -i <identFile> [-o <dir>]
         [--overwrite] -p <profileFile> [-r] -s <seqFile> [--strict-mode]
         -u <dir>

AnonMed Options

-d,--data file
Files to anonymize.
Delete original file.
Print this message.
-i,--identification-mapping identFile
Identification's mapping database file (required). The file (CSV format) maps private person's identification to an anonymization application's unique sequence number.
-o,--output dir
Output directory.
Overwrite file. Be careful an original or output file can be overwriten.
-p,--profiles profileFile
File with profiles description.
Rename a file on an output.
-s,--sequence-number seqFile
A file with next available sequence number (required). It contains single line with that number.
Enables strict mode. Data (attributes, elements, tags, cells) not mentioned in any rule are automatically removed. Use KEEP rule when no other rule is useful to keep data in the file in the strict mode. (experimental; not implemented in all anonymizers)
-u,--uncertain dir
Uncertain anonymization output directory.

AnonMed in the GNU/Debian Linux

You have command anonmed available when the anonmed_2018.7-1_all.deb package were installed.

Configuration is both, system and user, defined. The system configuration is in the /etc/mre/anonmed/ directory.

  • /etc/mre/anonmed/profile.d/ is directory with profiles separated by
  • /etc/mre/anonmed/profile concatenated files from the previous profile.d/ and this profile is used by AnonMed.
  • /etc/mre/anonmed/sequence new sequence number that will be assigned as the next anonymous ID.
  • /etc/mre/anonmed/ map with anonymous ID and the original person one. You should have this file in the secret and backup it regularly.
  • ~/.mre/anonmed/input the file with absolute path to the directory with input data that have to be de-identified.
  • ~/.mre/anonmed/output the file with absolute path to the directory where output de-identified files are stored.
  • ~/.mre/anonmed/uncertain the file with absolute path to the directory where uncertain files are stored. An uncertain file may still contain some personal information.

The per-user configuration is in the ~/.mre/anonmed/ directory.

  • ~/.mre/log/ log output, each day per file (e.g. ~/.mre/log/YYYYMMDD-anonmed.log where YYYY is the year, MM month and DD day
  • ~/.mre/anonmed/profile concatenated profiles.
  • ~/.mre/anonmed/sequence same as /etc/mre/anonmed/sequence.
  • ~/.mre/anonmed/ same as /etc/mre/anonmed/
  • ~/.mre/anonmed/input same as ~/.mre/anonmed/input.
  • ~/.mre/anonmed/output same as ~/.mre/anonmed/output.
  • ~/.mre/anonmed/uncertain same as ~/.mre/anonmed/uncertain.

The best practice is to use the per-user configuration files for your configuration in the production. AnonMed preffers a per-user configuration files. The system wide file is used only when the user file is missing.

AnonMed from the ZIP file

You have a script available when you just extract the archive.

First, execute the ./ script without arguments. It will produce output like this:

/tmp/anonmed-2018.7$ ./
Created <<<./data/>>> directory for your input files.

Please, place your data to the ./data/ directory and
re-run the command ./ again to de-identify them.
De-identified files will be created in the ./output/ directory.

Note: This information is shown only when the ./data/ directory is missing.

Well, it tells you, the ./data/ directory was created for the input files.

Next, you can copy your files to the ./data/ directory and execute the ./ again. It will de-identify the input files and the output files will be in the ./output/ directory.

Note: AnonMed will print a list of input files and all rules from the profile file when starts. Then the de-identification progress is shown.

Be carefull to the original data damage or lost, without --output argument it will rewrite the input files when --overwrite is set.