SwissDRG Grouper Documentation

The JavaGrouper is a reimplementation of the older C based grouper kernel. The grouper logic remains the same. However there are some differences to the old grouper kernel, especially regarding non-functional features:

  • The new grouper kernel is fully based on Java and hence platform independent.
  • The new grouper kernel supports concurrent grouping of patient cases. Once loaded, a grouper kernel can be used in concurrent environments without further measures.
  • The old binary grouper specifications can no longer be used. The specifications will be released using a more open JSON based format.
  • The semantics for flagging used variables has slightly changed and been simplified. As used flags have been relevant in the PCCL algorithm prior to SwissDRG 3.0, this new behavior can lead to different grouping results in rare cases (< 1 in 100’000) for SwissDRG systems 1.0 and 2.0.
  • The Same Day Flag (SDF) has been removed as it was never relevant for grouping and was not properly entered in most setups. As a consequence the grouper kernel is no longer able to calculate an entry date based on the exit date and the length of stay. Hence the grouper cannot calculate an age based on an exit date, the length of stay and a birth date.

Release 1.4.0


This version is not binary compatible with earlier versions of the SwissDRG Java Grouper library.

Version 1.4.0 of the SwissDRG AG JavaGrouper adds support for the ST Reha tariff system. See 1.4.0 for more details.


Use the Loading specifications with SpecificationLoader API to load specifications SwissDRG V11.0 PV1 and up, TARPSY T4.0 PV1 and up, and ST Reha R1.0 PV1 and up. Directly using SpecificationReader will result in an Error!

Release 1.3.0


This version is not binary compatible with earlier versions of the SwissDRG Java Grouper library.

As of version 1.3.0, the SwissDRG Java Grouper is only compatible with Java versions 8 and newer. Please make sure that you develop against a Java 8+ SDK.

Notable features of version 1.3.0 include

  • new SpecificationLoader API to load specifications from URLs. See Loading specifications with SpecificationLoader for details.
  • new flexible output format for Batchgrouper. Use the Batchgrouper help to find out about usage.
  • removed some APIs previously annotated with @Deprecated

Release 1.2.0

With the release of Java Grouper 1.1.0 (and onward) we have extended the grouping functionality with the capability to calculate appropriate supplements for patient cases. As a consequence of this, we have introduced some changes to the grouper API compared to grouper versions 1.0.X.

Changes compared to 1.0.X

New public API package

You can now use all classes and interfaces in the org.swissdrg.zegrouper.api top level package.


Only classes and interfaces from the org.swissdrg.grouper and org.swissdrg.zegrouper.api packages are projected to be stable across releases.

Medications for PatientCase

Instances of the PatientCase class now offer methods to add medications. This change was necessary to facilitate the calculation of supplements based on ATC codes. See Supplement Grouping for an introduction to supplement grouping.

Potentially breaking changes for Applications

The following list states changes that potentially break applications built against grouper versions of the older 1.0.X branch. Please note that we only state potentially breaking changes to classes within the public API packages.

  • PatientCase#toString now returns a string representation in Batchgrouper 2017 format instead of the previous Batchgrouper format. If you have to use that particular format, you should use the PatientCase#toLegacyString method.
  • Due to the addition of medications, PatientCase#urlEncode now returns an extended URL compatible representation of a patient case.
  • PatientCaseParserFactory.getParserFor method with format InputFormat.URL will now return a Parser capable of parsing the extended URL format as explained above. If you need to parse the old URL format, use the InputFormat.URL_LEGACY input format.

Getting Started


If eligible, you can download the Grouper software from the Download Portal provided by SwissDRG AG. Please refer to the Grouper homepage if you need more information about the Grouping software and about how to get access to the Download portal.

In the following sections, we provide a user guide for users of the grouper software.