Class EMediplanQrCodeGenerator
java.lang.Object
org.projecthusky.fhir.emed.ch.epr.narrative.pdf.EMediplanQrCodeGenerator
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 Summary
ConstructorsConstructorDescriptionEMediplanQrCodeGenerator(EMediplanConverter eMediplanConverter, Consumer<@NonNull ValidationIssue> validationIssueConsumer) -
Method Summary
Modifier and TypeMethodDescriptiongenerateQrCode(EMediplan<?, ?, ?, ?> emediplan) Gets the eMediplan QR code for the PRE document content.generateQrCode(EMediplan<?, ?, ?, ?> emediplan, int size) Gets the eMediplan QR code for the PRE document content.generateQrCode(ChEmedEprDocumentPmlc document) Gets the eMediplan QR code for the PRE document content.generateQrCode(ChEmedEprDocumentPre document) Gets the eMediplan QR code for the PRE document content.generateQrCode(ChEmedEprDocumentPre document, int size) Gets the eMediplan QR code for the PRE document content.
-
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
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
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
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
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<?, ?, throws QrCodeGenerationException?, ?> emediplan, int size) 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.
-