d2Parser: General purpose parsing function for different formats of...

Description Usage Arguments Value Note

View source: R/d2Parser.R

Description

d2Parser will parse a compliant DHIS2 XML,JSON or CSV file and transform it into a standard data frame which can be used in subsequent DATIM validation routines

Usage

1
2
d2Parser(filename, type, organisationUnit = NA, dataElementIdScheme = "id",
  orgUnitIdScheme = "id", idScheme = "id", invalidData = FALSE)

Arguments

filename

Location of the payload to be imported. Should be a valid DHIS2 import file

type

Type of the file. Should be either xml, json or csv

organisationUnit

Organisation unit UID of the operating unit. If left blank, assumed to be global.

dataElementIdScheme

Should be one of either code, name, shortName or id. If this paramater is "id", then the Data elements are assumed to be already specififed as UIDs.

orgUnitIdScheme

Should be one of either code, name, shortName or id. If this paramater is "id", then the organisation units are assumed to be already specififed as UIDs

idScheme

Remapping scheme for category option combos

invalidData

Exclude any (NA or missing) data from the parsed file?

Value

Returns a data frame of at least "dataElement","period","orgUnit","categoryOptionCombo","attributeOptionCombo","value"

Note

function(filename="/home/me/foo.xml",type="xml",dataElementIdScheme="code",orgUnitIdScheme="code",idScheme="id") Note that all values will be returned as characters.


jason-p-pickering/datim-validation documentation built on Nov. 8, 2018, 3:30 p.m.