Class EMediplanQrCodeGenerator

java.lang.Object
org.projecthusky.fhir.emed.ch.epr.narrative.pdf.EMediplanQrCodeGenerator

public class EMediplanQrCodeGenerator extends Object
This class generates a QR Code conveying an eMediplan object, as defined in the relevant CH Transmission Format specification, depending on the received EMediplanConverter.
  • Constructor Details

    • EMediplanQrCodeGenerator

      public EMediplanQrCodeGenerator(EMediplanConverter eMediplanConverter, Consumer<@NonNull ValidationIssue> validationIssueConsumer)
      Parameters:
      eMediplanConverter - The converter between CH EMED EPR documents and eMediplan objects, depending on the relevant specification.
      validationIssueConsumer - A consumer for encountered eMediplan validation issues.
  • Method Details

    • generateQrCode

      public String generateQrCode(ChEmedEprDocumentPmlc document) throws QrCodeGenerationException
      Gets the eMediplan QR code for the PRE document content.
      Parameters:
      document - The CH EMED EPR PMLC document for which to generate the eMediplan QR code.
      Returns:
      The Base64-encoded PNG image render of the QR code, as a string.
      Throws:
      QrCodeGenerationException - In case of error either transforming the PRE to an eMediplan format or while generating the QR code itself.
    • generateQrCode

      public String generateQrCode(ChEmedEprDocumentPre document) throws QrCodeGenerationException
      Gets the eMediplan QR code for the PRE document content.
      Parameters:
      document - The CH EMED EPR PRE document for which to generate the eMediplan QR code.
      Returns:
      The Base64-encoded PNG image render of the QR code, as a string.
      Throws:
      QrCodeGenerationException - In case of error either transforming the PRE to an eMediplan format or while generating the QR code itself.
    • generateQrCode

      public String generateQrCode(ChEmedEprDocumentPre document, int size)
      Gets the eMediplan QR code for the PRE document content.
      Parameters:
      document - The CH EMED EPR PRE document for which to generate the eMediplan QR code.
      size - The desired size (one side of the square) in pixels. This includes the mandatory white spacing.
      Returns:
      The Base64-encoded PNG image render of the QR code, as a string.
      Throws:
      QrCodeGenerationException - In case of error either transforming the PRE to an eMediplan format or while generating the QR code itself.
    • generateQrCode

      public String generateQrCode(EMediplan<?,?,?,?> emediplan) throws QrCodeGenerationException
      Gets the eMediplan QR code for the PRE document content.
      Parameters:
      emediplan - The eMediplan model object for which to generate the eMediplan QR code.
      Returns:
      The Base64-encoded PNG image render of the QR code, as a string, with the default size including margin.
      Throws:
      QrCodeGenerationException - In case of error either transforming the PRE to an eMediplan format or while generating the QR code itself.
    • generateQrCode

      public String generateQrCode(EMediplan<?,?,?,?> emediplan, int size) throws QrCodeGenerationException
      Gets the eMediplan QR code for the PRE document content.
      Parameters:
      emediplan - The eMediplan model object for which to generate the eMediplan QR code.
      size - The desired size (one side of the square) in pixels. This includes the mandatory white spacing.
      Returns:
      The Base64-encoded PNG image render of the QR code, as a string.
      Throws:
      QrCodeGenerationException - In case of error either transforming the PRE to an eMediplan format or while generating the QR code itself.