Adding Sample Data

You can quickly add test/sample data by copying dataset files into the /santedb/data directory of the docker container either using a custom dockerfile or by mounting a volume from the docker image.

Dataset Files

These dataset files can be generated from the sdbac command prompt with the cdr.query command to produce dataset files. Dataset files provide a 1:1 mapping to the underlying CDR storage engine and are expressed in XML RIM objects. Dataset files can include:

  • Infrastructure elements like Assigning Authorities, Concepts, Extension Types, etc.

  • Clinical elements like Entities or Acts

For example, to initialize an MPI with an identity domain, and an organization with a custom policy, for a particular use case, create a new dataset file containing the identity domain, organization and custom policy:

<?xml version="1.0"?>
<dataset id="Elbonia Identity Domains" xmlns:xsi="" xmlns:xsd="" xmlns="">
  <!-- National Health Identifier -->
  <insert skipIfError="false" skipIfExists="true">
    <AssigningAuthority xmlns="">
  <update insertIfNotExists="true">
    <Organization xmlns="">
          <value>Elbonia National Health Insurnace Corporation</value>
  <update insertIfNotExists="true">
    <SecurityPolicy xmlns="">
      <name>Elbonia Parlimentarian Health Record VIP Access Policy</name>

The file would be copied into the /santedb/data directory of the santedb-mpi or santedb-icdr container with the following Dockerfile.

FROM santedb-icdr:latest
COPY custom.dataset /santedb/data/custom.dataset

FHIR Resources

You can also seed data into the /santedb/data/fhir directory of the container using a custom dockerfile or by mounting the volume from the docker container.

FHIR resources are limited to only those resources which have a IFhirResourceHandler implementation registered and configured. (TODO: Insert link)

FHIR resources can be in JSON or in XML format, and are simply placed in the directory. The seeder then processes these files on application start and will generate two files:

  • A file with a .completed extension which indicates that the message contents were successfully processed and included into the SanteDB iCDR database.

  • A file with a .response extension which is the FHIR response that would have been sent via the REST API. This is useful for diagnosing issues with your FHIR message being seeded.

Seeding data via FHIR requires at least version 2.1.11 of the iCDR FHIR plugin.

Deploying on Container

You can deploy either dataset files or FHIR files onto your running iCDR container by either including the files in a custom Dockerfile such as:

FROM santedb-icdr:latest
COPY patients.json /santedb/data/fhir/patients.json
COPY identity.dataset /santedb/data/identity.dataset

Alternately , you can mount the /santedb/data directory as a volume for your container and copy the files, or you can use a command line interface and docker cp such as:

docker cp patients.json santedb-icdr:/santedb/data
docker cp identity.dataset santedb-icdr:/santedb/data

Last updated