Table of Contents
This project is used to generate example and test messages in various formats (including FHIR-json, FHIR-xml, HAPI bundle objects).
The library can be used as a CLI tool or as a direct dependency in a Java project.
<dependency>
<groupId>de.gematik.demis</groupId>
<artifactId>notification-builder-library</artifactId>
<version>X.Y.Z</version>
</dependency>
In principle, the individual builders can be used to create Fhir classes. The mandatory fields defined by the DEMIS data model are filled with standard information.
Using the NotifiedPersonDataBuilder as an example, the basic use of the builders will be shown: standardbuilder, what happens with setter, what does a setter need?
Patient patient = new PotifiedPersonDataBuilder().buildNotifiedPerson();
creates a patient resource that contains the data of the standard message as content and sets the necessary content for a data subject.
Setters can be used to set the data subject's fields to specific values. For example, the setAddress()
method sets the address of the data subject. Both other FHIR resources and primitive data types can be used as values. This is specified by the respective setter
of the respective DataBuilder
.
The following example shows the adaptation of the address and name of a data subject:
NotifiedPersonDataBuilder notifiedPersonDataBuilder = new NotifiedPersonDataBuilder();
Address someAddress = new AddressDataBuilder()
.setCity("City")
.setLine("Street 1")
.setPostalCode("12345")
.buildAddress();
notifiedPersonDataBuilder.setAddress(someAddress);
HumanName humanName = new HumanNameDataBuilder()
.setFamilyName("SURNAME")
.addGivenName("GIVENNAME")
.buildHumanName();
notifiedPersoNDataBuilder.setHumanName(humanName);
Patient patient = notifiedPersonDataBuilder.buildNotifiedPerson();
All DataBuilders work according to this principle. To generate a complete notification, the NotificationLaboratoryBundleDataBuilder
can be used, for example. The respective FHIR resources are transferred to it as content.
The following example shows the setting of the previously created data subject in a notification:
NotificationBundleLaboratoryDataBuilder notificationBundleLaboratoryDataBuilder =
new NotificationBundleLaboratoryDataBuilder();
notificationBundleLaboratoryDataBuilder.setNotifiedPerson(notifiedPerson);
Bundle bundle = notificationBundleLaboratoryDataBuilder.buildLaboratoryBundle();
Standard messages are sample messages that can be generated using the test data generator. They are available for the message types "Labormeldung" and "Arztmeldung" (specifically hospitalization message). Both messages refer to Covid19 or Sars Cov 2.
See ReleaseNotes for all information regarding the (newest) releases.
If you want to contribute, please check our CONTRIBUTING.md.
If you want to see the security policy, please check our SECURITY.md.
EUROPEAN UNION PUBLIC LICENCE v. 1.2
EUPL © the European Union 2007, 2016
- Copyright notice: Each published work result is accompanied by an explicit statement of the license conditions for use. These are regularly typical conditions in connection with open source or free software. Programs described/provided/linked here are free software, unless otherwise stated.
- Permission notice: Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions::
- The copyright notice (Item 1) and the permission notice (Item 2) shall be included in all copies or substantial portions of the Software.
- The software is provided "as is" without warranty of any kind, either express or implied, including, but not limited to, the warranties of fitness for a particular purpose, merchantability, and/or non-infringement. The authors or copyright holders shall not be liable in any manner whatsoever for any damages or other claims arising from, out of or in connection with the software or the use or other dealings with the software, whether in an action of contract, tort, or otherwise.
- The software is the result of research and development activities, therefore not necessarily quality assured and without the character of a liable product. For this reason, gematik does not provide any support or other user assistance (unless otherwise stated in individual cases and without justification of a legal obligation). Furthermore, there is no claim to further development and adaptation of the results to a more current state of the art.
- Gematik may remove published results temporarily or permanently from the place of publication at any time without prior notice or justification.
- Please note: Parts of this code may have been generated using AI-supported technology.’ Please take this into account, especially when troubleshooting, for security analyses and possible adjustments.
See LICENSE.
E-Mail to DEMIS Entwicklung