Chapter 39 Exporting Data

There are two ways to get Provider data out of the Warehouse: 1) download a flat file; or 2) the API.

39.1 Download Data Collections

A User can download selected Provider data as flat comma-separated value (CSV) files. The download option is available for the Sample, Cervid facility, Processor, and Demography Data Collections.

The Download function can be found by navigating to the Data Collection’s list view, which is available in the Navigation Menu. The Download button is a round icon with an arrow pointing down. Clicking this button will download all data in the current view. Any filters applied to the view will also be applied to the download.

The CWD Data Warehouse stores data in a JSON-like data model in which data can be nested hierarchically. For instance, each Cervid Facility can have one or more Herds, which in turn can each have one or more Herd Surveys. While this data structure more accurately represents reality, the data cannot be simply exported as a typical flat file (such as a CSV). Therefore, the downloadable data are selective in the properties exported as follows:

39.1.1 Sample Data Download

Each Sample can have one or more test. In the downloaded Sample CSV, Samples with one test or no test will be represented by a single row in the exported file. Samples that have more than one test will be represented by a number of rows equal to the number of tests. Values are repeated for all sample properties except for the Test properties.

39.1.2 Cervid Facility Data Download

The Cervid Facility Data Collection has several nested data structures. Cervid Facilities can have one or more Herds, which can each have one or more Population Surveys. Cervid Facilities can also have one or more Business Status values and one or more Premises Surveys. An exported Cervid Facility will be represented by one row for each Herd. If a Herd has more than one Population Survey, only the most recent (by Survey Date) will be included in the export. Further, for a Cervid Facility only the most recent Business Status (by Business Status Date) is included.

39.1.3 Processor Data Download

The Processor Data Collection has two nested data structures: Business Status and Processor Surveys. For both, the exported Processor data includes only the most recent one. In the downloaded Processor data, each Processor is represented by one row.

39.2 Get data with the API

The CWD Data Warehouse has an Application Programming Interface (API) that allows for the creation, editing, and extraction of Provider data in the Warehouse. The API is described further in API documentation section.

The API is the second and more powerful way of getting Provider data out of the Warehouse. Using the API, a Provider can extract any data stored in the Warehouse. Because the API provides JSON data, unlike the direct Download links available through the GUI, the extracted data retains the complete hierarchical structure and all data elements present in the Data Collection. For example, using the API to retrieve Cervid Facility data, all Cervid Facility herds, all Population Surveys of all Herds, all Business Status entries, and all Premises Surveys are available. Therefore, a Provider can use the API to extract all of its data in its native data structures.