Class EMediplanPdfMedicationCardGenerator
java.lang.Object
org.projecthusky.fhir.emed.ch.epr.narrative.pdf.ChEmedEprPdfGenerator
org.projecthusky.fhir.emed.ch.epr.narrative.pdf.PdfMedicationCardGenerator
org.projecthusky.fhir.emed.ch.epr.narrative.pdf.EMediplanPdfMedicationCardGenerator
A medication card PDF generator following eMediplan (CHMED16A or CHMED23A) paper layouts.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.projecthusky.fhir.emed.ch.epr.narrative.pdf.ChEmedEprPdfGenerator
ChEmedEprPdfGenerator.FontFamily -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final EMediplanQrCodeGeneratorstatic final Consumer<@NonNull ValidationIssue> protected Consumer<@NonNull ValidationIssue> The consumer for any encountered validation issues.Fields inherited from class org.projecthusky.fhir.emed.ch.epr.narrative.pdf.ChEmedEprPdfGenerator
htmlNarrativeGenerator, pdfConverter, pdfValidator, softwareProviderMetadata, template -
Constructor Summary
ConstructorsConstructorDescriptionEMediplanPdfMedicationCardGenerator(String template, SoftwareProviderMetadataProvider softwareProviderMetadataProvider) EMediplanPdfMedicationCardGenerator(NarrativeFormat narrativeFormat, SoftwareProviderMetadataProvider softwareProviderMetadataProvider) This constructor allows the caller to specify exactly which kind of eMediplan narrative format can be used, either the umbrellaNarrativeFormat.EMEDIPLANformat, which will use whatever it is considered as default by the library for generating the QR code content, or the more specific CHMED16A or CHMED23A codes.EMediplanPdfMedicationCardGenerator(SoftwareProviderMetadataProvider softwareProviderMetadataProvider) This constructor will use the umbrellaNarrativeFormat.EMEDIPLANcode for the narrative. -
Method Summary
Modifier and TypeMethodDescriptionbyte[]generate(ChEmedEprDocumentPmlc pmlcDocument, NarrativeLanguage lang) protected StringgenerateQrCode(ChEmedEprDocumentPmlc pmlcDocument) Gets the eMediplan QR code for the PMLC document content.protected EMediplanConverterMethods inherited from class org.projecthusky.fhir.emed.ch.epr.narrative.pdf.PdfMedicationCardGenerator
getDefaultChEmedEprPdfTemplate, getDefaultEmediplanPdfTemplateMethods inherited from class org.projecthusky.fhir.emed.ch.epr.narrative.pdf.ChEmedEprPdfGenerator
addFontFamily, formatHumanName, getPdfAuthor, validatePDF
-
Field Details
-
SLF4J_VALIDATION_RESULT_CONSUMER
-
validationIssueConsumer
The consumer for any encountered validation issues. By default, an Slf4 logger will log all encountered issues. -
qrCodeGenerator
-
-
Constructor Details
-
EMediplanPdfMedicationCardGenerator
public EMediplanPdfMedicationCardGenerator(String template, SoftwareProviderMetadataProvider softwareProviderMetadataProvider) throws IOException, ParserConfigurationException -
EMediplanPdfMedicationCardGenerator
public EMediplanPdfMedicationCardGenerator(SoftwareProviderMetadataProvider softwareProviderMetadataProvider) throws IOException, ParserConfigurationException This constructor will use the umbrellaNarrativeFormat.EMEDIPLANcode for the narrative.This has no implications for the paper layout, since it is shared for CHMED16A and CHMED23A, but it has the implication of deciding which eMediplan content will be created and hence conveyed within the QR code.
-
EMediplanPdfMedicationCardGenerator
public EMediplanPdfMedicationCardGenerator(NarrativeFormat narrativeFormat, SoftwareProviderMetadataProvider softwareProviderMetadataProvider) throws IOException, ParserConfigurationException This constructor allows the caller to specify exactly which kind of eMediplan narrative format can be used, either the umbrellaNarrativeFormat.EMEDIPLANformat, which will use whatever it is considered as default by the library for generating the QR code content, or the more specific CHMED16A or CHMED23A codes.Note that other codes are NOT supported.
-
-
Method Details
-
generate
- Specified by:
generatein classPdfMedicationCardGenerator
-
generateQrCode
protected String generateQrCode(ChEmedEprDocumentPmlc pmlcDocument) throws QrCodeGenerationException Gets the eMediplan QR code for the PMLC document content.- Parameters:
pmlcDocument- The 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 PMLC to a eMediplan format or while generating the QR code itself.
-
getEmediplanConverter
-