Import flat file (CSV)
Import flat file via REST
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 Concept resources and later use them with Terminology API.
Concepts
should have unique code
property. In this regard Aidbox follows FHIR constraints defined for CodeSystems. If there are multiple Concepts
with the
same code
, only the last one will be loaded.
Import by URL
Aidbox provides RPC API to load terminology from a flat file by url.
RPC aidbox.terminology.import-flat/import-from-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 concept mapping, CodeSystem
resource and ValueSet
resource. For hierarchical terminology it can build hierarchy materialized paths.
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.
Examples
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 usedThis file contains no header and data starts at the row
0
.Concept.code
is mapped to the column with the index2
Concept.display
is mapped to the column with the index3
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
File is also available here
Imported Concept
resources
Loaded resources sample (some output parts are omitted)
Last updated