Import flat file (CSV)
Import flat file via REST
Last updated
Was this helpful?
Import flat file via REST
Last updated
Was this helpful?
If you have a terminology distributed as a flat file, for example CSV, you can use this API to import it as a set of resources and later use them with Terminology API.
Concepts
should have unique code
property. In this regard Aidbox follows . If there are multiple Concepts
with the
same code
, only the last one will be loaded.
Aidbox provides RPC API to load terminology from a flat file by url.
aidbox.terminology.import-flat/import-from-url
This method accepts an URL pointing to a flat file with a terminology, file format description, columns to mapping, CodeSystem
resource and ValueSet
resource. For hierarchical terminology it can build .
When upload is done, rows of the flat file are loaded as Concept
resources into Aidbox. Also CodeSystem
and ValueSet
resources are created, these resources describe the full terminology from the file, i.e. the ValueSet
composed of only this CodeSystem
and all Concept
s have system
set to the CodeSystem.url
.
Also check "Request with comments" and "Parameters" tabs for the full request structure description.
Here are 2 examples importing a fragment of ICD-10. The first one specifies as few parameters as possible and uses a CSV file without a header. The second one uses a CSV with a header and also specifies a deprecation criteria, hierarchy parameters and a concept properties mapping. Both examples have commentaries of used parameters and contents of imported CSV files.
CSV file delimiter is ;
.This file contains no quoted strings, but since :quote
parameter is required '
character is used
This file contains no header and data starts at the row 0
.
Concept.code
is mapped to the column with the index 2
Concept.display
is mapped to the column with the index 3
Request will create
a CodeSystem/icd10
resource with :url http://hl7.org/fhir/sid/icd-10
a ValueSet/icd10
resource with :url http://hl7.org/fhir/ValueSet/icd-10
Request
Response:
CSV file content
Imported Concept
resources
Loaded resources sample (some output parts are omitted)
File is also available
File is also available