Skip to main content

HSMOD.CSVTable.Utils

abstract class HSMOD.CSVTable.Utils

Utilities for CSV tables.

This class is for internal InterSystems use only. This class is subject to change in future versions of HealthShare.

Method Inventory

Methods

classmethod ExportTablesToCSV(pTargetFolder As %String, pClassNames As %List, pOverwriteExisting=0, pAddHeaderRow As %Boolean = 0, pVerbose As %Boolean = 1)
CSV export method for a set of tables in a list. Each file will have a name of the form "tablename.csv" where "tablename" is the full SQL table name of the class, e.g. "web_HS_Clinigraphic_CodeCategorization.Categorization.csv". Arguments:
  • pTargetFolder is the destination folder for export.
  • pClassNames is a list of class names (not table names) to export.
  • pOverwriteExisting indicates whether to overwrite existing files. Default is 0 (no).
  • pAddHeaderRow indicates whether to include a header row (with column names) in the output file. Default is 0 (no).
  • pVerbose controls text output (for use in Terminal). Default is 1 (verbose).
@API.Method
classmethod ImportTablesFromCSV(pTargetFolder As %String, pClassNames As %List, pRemoveExistingValues As %Boolean = 1, pRelyOnHeaderRow As %Boolean = 0, pVerbose As %Boolean = 1) as %Status
CSV import method for a set of tables, using a set of CSV files in a common folder. Arguments:
  • pTargetFolder is the target folder where the files should be found. Each file should have a name of the form "tablename.csv" where "tablename" is the full SQL table name of the class, e.g. "web_HS_Clinigraphic_CodeCategorization.Categorization.csv".
  • pClassNames is a list of class names (not table names); the corresponding files are expected to have names consisting of the table (SQL) name, normalized, followed by the ".csv" suffix.
  • pRemoveExistingValues indicates whether the existing table data should be deleted prior to import; default is 1 (yes).
  • pRelyOnHeaderRow indicates whether the import code should look at the first file row as a "header" row with column names and use those column names as a guide (instead of expecting data to be in predicted column sequence). Default is 0 (no).
  • pVerbose controls text output (for use in Terminal). Default is 1 (verbose).
@API.Method
FeedbackOpens in a new tab