Skip to content

Export Template Guide

Saurabh Parkhi edited this page Jun 10, 2024 · 5 revisions

Background:

Droid 6.8.0 has an ability to export the profile data using pre-created templates that can be setup to export the data as per requirements of any downstream processes.

Features:

The current syntax for the export template is referred to as version 1.0. This version of the export template, when exporting the data, gives better control for the following

  • Ordering the columns within the CSV as desired
  • Changing the header of a column
  • Adding columns with constant string values
  • Converting the data from an underlying column to uppercase or lowercase

Syntax:

Syntactically, the export template is simple to define. The details for defining various customisations are explained below.

  • version line: The very first line of the Export Template defines the version number. For now it simply needs to be version 1.0
  • Modifying a header: If you intend to use a different column header instead of one of the well-known column names used by Droid, you can do so by defining a line such as Identifier: $ID this instruction changes the header of the ID column to be “Identifier”
  • Adding a column: If you need to add a blank column to the export, it can be done by defining it with a header without any data. e.g. If you want to add a column named “ProcessDate”, but the date is actually populated using some other method later in the workflow, you can define a line in the template as
  • ProcessDate:
  • Adding a column and populating it with some value: If you need to add a column to the export and populate it with some value, it can be done by defining it with a header and the value in double quotes. e.g. If you want to add a column named “Submitter” and populate it with a value of “Librarian”, you can define a line in the template as Submitter: "Librarian" Please note that the value is enclosed in double quotes.
  • Modifying a header and data: If you intend to use same or different column header and want to modify the data that is populated from the profile results, you can do so by defining a modifier line such as: Path: LCASE($FILE_PATH) This line will export the value of FILE_PATH in lowercase.

    Please note: In version 1.0 the only supported modifications are conversion to uppercase or lowercase. Please also note that the LCASE or UCASE modifiers can only be used with the profile columns. These modifications are not supported on custom columns.

  • Order of the columns:

    When using an Export Template, Droid exports only those columns which appear in the template and in the the same order as they appear in the template. This gives you the control over ordering of columns in the export file.

Putting it all together:

Consider the following template

version 1.0
Identifier: $ID
Name: $NAME
LowerName: LCASE($NAME)
Language: "Simplified English"
Submitter: "Government Dept."
Background: 
FormatName: $FORMAT_NAME
FormatVersion: $FORMAT_VERSION
Export Tool:

It indicates the following:

  • The version of the template is 1.0

  • The desired order of columns in the export file is: Identifier, Name, LowerName, Language, Submitter, Background, FormatName, FormatVersion, Export Tool

  • Identifier, Name, FormatName and FormatVersion columns are populated with data from the ID, NAME, FORMAT_NAME and FORMAT_VERSION column respectively

  • LowerName column is populated with the data from NAME column after converting it to lower case.

  • Language and Submitter columns are populated with the string values of "Simplified English" and "Government Dept." respectively

  • Background and Export Tool columns are left blank.

The potential output, depending on actual data, may appear as :

Identifier Name LowerName Language Submitter Background FormatName FormatVersion Export Tool
2 GP-led-sites-may21.csv gp-led-sites-may21.csv Simplified English Government Dept. Comma Separated Values
3 Hospital-Hubs-may21.csv hospital-hubs-may21.csv Simplified English Government Dept. Comma Separated Values
4 Pharmacies-May21.csv pharmacies-may21.csv Simplified English Government Dept. Comma Separated Values
5 All-Sites.xlsx all-sites.xlsx Simplified English Government Dept. Microsoft Excel for Windows 2007 onwards

Appendix A: Table showing all the data column names from Droid results that can be used with Export Template

ID A unique id for each resource identified.
PARENT_ID The id of the parent resource
URI A URI for the resource, including locations inside archive files.
FILE_PATH The path to the resource in the file system
NAME The name of the resource
METHOD The method used to identify the resource.
STATUS The identification status of the resource.
SIZE The size in bytes of the resource.
TYPE The type of the resource
EXT The file extension of the resource
LAST_MODIFIED The last modified date/time of the resource.
EXTENSION_MISMATCH Whether there is a mismatch between the extension of the resource and its identification by signature
HASH The hash value of the resource.
FORMAT_COUNT The hash value of the resource.
PUID The number of identifications made to the resource.
MIME_TYPE The mime type of the resource where known.
FORMAT_NAME The name of the format the resource was identified as
FORMAT_VERSION The version of the format the resource was identified as

Appendix B: Data modification operations supported as of Droid v6.8.0

Droid 6.8.0 supports only two data modification operations. Both of these operations are useful to change the case of string data from the results. These 2 operations are

  • LCASE - converts data in the field to lowercase
  • UCASE - converts data in the field to uppercase