sims2Parser: Special purpose parsing function for SIMS2 aggregate data...

Description Usage Arguments Value Note

View source: R/sims2Parser.R

Description

sims2Parser will parse a semi-compliant DHIS2 CSV file and transform it into a standard data frame which can be used in subsequent DATIM validation routines. The difference with d2Parser is that an extra (non-standard) field will be introduced to record the SIMS visit. This will in turn be used to deduplicate visits which occur at the same site + mechanism + date combination. This function will automatically decollide these types of visits

Usage

1
2
3
sims2Parser(filename, dataElementIdScheme = "code", orgUnitIdScheme = "id",
  idScheme = "id", invalidData = FALSE, hasHeader = TRUE,
  isoPeriod = NA)

Arguments

filename

Location of the payload to be imported. Should be a valid SIMS2 aggregate file. See the separate spec for details

dataElementIdScheme

Should be one of either code, name, shortName or id. The default is "code". 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?

hasHeader

TRUE by default. Should be set to FALSE if the file does not contain header information.

isoPeriod

period to be used for date shift boundaries. If not provided, no boundaries are set.

Value

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

Note

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


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