Skip to main content

CodeSystem Import

Load codes and metadata into the database for a given CodeSystem. This is used to build large code systems with many thousands of codes, which would not fit inside a single FHIR resource.

[baseUrl]/CodeSystem/$import
[baseUrl]/CodeSystem/[id]/$import
Privileged Operation

This operation is only available to Super Admins.

Parameters

NameTypeDescriptionRequired
systemuriThe canonical URL of the code system to import intoNo*
conceptCodingA code, along with optional display text to add to the code systemNo
propertyPart[] (see below)Metadata about codes in the code system to be importedNo

* If system is not provided, the operation must be invoked on a specific CodeSystem instance by ID.

Each property parameter contains a part array with three nested parameters:

NameTypeDescriptionRequired
codecodeThe code to which the property appliesYes
propertycodeThe property nameYes
valuestringThe value of the propertyYes

Output

The operation returns the CodeSystem resource representing the code system into which the given concepts and properties were imported.

Examples

Request:

const result = await medplum.post(medplum.fhirUrl('CodeSystem', '$import').toString(), {
resourceType: 'Parameters',
parameter: [
{ name: 'system', valueUri: 'http://example.com/local-codes' },
{ name: 'concept', valueCoding: { code: 'VS', display: 'Vital signs' } },
{ name: 'concept', valueCoding: { code: 'HR', display: 'Heart rate' } },
{
name: 'property',
part: [
{ name: 'code', valueCode: 'VS' },
{ name: 'property', valueCode: 'child' },
{ name: 'value', valueString: 'HR' },
],
},
{
name: 'property',
part: [
{ name: 'code', valueCode: 'HR' },
{ name: 'property', valueCode: 'units' },
{ name: 'value', valueString: 'bpm' },
],
},
],
});