Smile CDR v2022.08.PRE
On this page:

35.8Map and Upload CSV Bulk Import File


The map-and-upload-csv-bulk-import-file command may be used to upload a CSV file to a FHIR Endpoint module, first converting each row in the CSV file to one or more FHIR resources using a JavaScript based mapping script.

This command performs CSV-to-FHIR mapping in the SmileUtil client process. See also Upload CSV Bulk Import File for an alternate command that performs the mapping in the Smile CDR server process.


bin/smileutil map-and-upload-csv-bulk-import-file --target http://fhir-server-url --basic-auth "admin:password" --batch-rows 10 --fhir-version r4 --input-file input-file-name.csv --delimiter '"' --mapper-script mapper-script-filename.js


  • -v [version] (or --fhir-version [version]) – The version of FHIR supported by the server.
  • -t [base URL] (or --target [base URL]) – This argument should point to the base URL of the target FHIR server endpoint.
  • --basic-auth [username:password](optional) This argument may provide a set of credentials to be sent to the target server via HTTP Basic Auth, in the form "username:password".
  • --bearer-token [token](optional) This argument provides a bearer token that will be supplied to the target server in an Authorization header.
  • --delimiter [delimiter](optional) The CSV delimiter character. Default is a comma (,) if not specified.
  • --mapper-script [filename] – The filename containing the CSV mapper script. This script must be in the format used by the ETL Import module Importing CSV Files format.
  • -hp [header] (or --header-passthrough [header]) – (optional, multiple) Additional headers added to generated http request.
  • --input-file [filename] – The filename containing the CSV file to upload.
  • --parse-quotes(optional) If enabled, quoted values will be parsed per the rules specified in RFC 4180. If this is disabled, quoted values will be parsed verbatim (and any quote marks will be included in the parsed values).
  • --thread-count [integer](optional) If specified, sets the number of worker threads to use. If not specified, the default value is 10. Each worker thread will process rows from the input file in parallel, and will individually make releated FHIR calls to the target server. This means that if this value is set to 5, then a maximum of 5 concurrent FHIR HTTP/REST requests will be made against the target FHIR server at any given time during the upload process.
  • --batch-rows [integer](optional) If specified, sets the number of rows to batch together into a single upload transaction. If not specified, the default value is 1 meaning no batching will occur.
  • --request-id(optional) This argument populates the value for the X-Request-Id header, and can be used for matching server logs against a specific smileutil invocation.