Skip to content

CDA CH EMED code generator

Quentin Ligier edited this page Nov 29, 2021 · 2 revisions

CDA-CH-EMED Code Generator

It is the main objective of this feature to generate Java code for a given ART-DECOR Document Template. ART-DECOR Document Templates are part of content profiles, such as IHE content profiles, Swiss exchange formats or Austrian implementation guides.

For more information about the underlying concept, see: ART-DECOR to Java: Concept for the implementation and API specification.

Note: Currently the mentioned Swiss exchange format examples are done correctly and are approved. If you create other document templates, the current release cannot guarantee that all circumstances are handled correctly. In case of exceptions, feel free to contribute.

Swiss exchange formats

In Switzerland, content profiles are known as exchange format. The Husky library provides java packages, representing Swiss exchange formats that base on HL7 CDA R2. Some of them are defined in the Federal Office of Public Health (FOPH) regulations for the Federal Act on the Electronic Patient Record (EPRO).

Currently, the only CDA-based exchange format is CDA-CH-EMED:

  • CDA-CH-EMED - Swiss eMedication, draft version V0.96.1 of May 18, 2020:
    • Module: husky-emed-cda
    • Generated Java classes: org.husky.emed.cda.generated.artdecor
    • Generated Java enums: org.husky.emed.cda.generated.artdecor.enums

The Swiss exchange formats are modelled in ART-DECOR and fully documented in English:

More information about the Swiss exchange formats can be found in German and French at:

How-to generate Java code for the CDA-CH-EMED profile

Pre Step

  1. Build the Husky library with Maven
  2. Build the code-generator with Maven
  3. Select or create a content profile configuration (see below for more details)

Generating the Java classes

  • Launch org.husky.codegenerator.CdaChEmedCodeGenerator as a Java application having the following args: <javaSourceDir>

    • javaSourceDir: The full path to the Husky project directory (e.g. D:/Java/husky)
  • Check console output

Post step

  1. Build the Husky library.
  2. Run the tests.
  3. Commit the modifications.

How-to configure the code generator for a content profile

The content profile configuration files are YAML files and they are located at code-generator/src/main/resources/cda/ContentProfilePackageConfigCdaChEmedVXXX.yml.

The configuration files describe themselves. Look at the commented lines (#comment).