Class PdfMedicationCardGenerator
java.lang.Object
org.projecthusky.fhir.emed.ch.epr.narrative.pdf.PdfMedicationCardGenerator
- Direct Known Subclasses:
ChEmedEprPdfMedicationCardGenerator
,EMediplanPdfMedicationCardGenerator
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final String
protected final HtmlNarrativeGenerator
The generator HTML narrative.protected final OpenHtmlToPdfAConverter
The converter of HTML to PDF/A.protected final PdfA12Validator
The validator of PDF documents to conformance level A-1 and A-2.protected final SoftwareProviderMetadata
protected final String
The custom template content. -
Constructor Summary
ConstructorsConstructorDescriptionPdfMedicationCardGenerator
(NarrativeFormat narrativeFormat, String template, SoftwareProviderMetadataProvider softwareProviderMetadataProvider) PdfMedicationCardGenerator
(NarrativeFormat narrativeFormat, SoftwareProviderMetadataProvider softwareProviderMetadataProvider) -
Method Summary
Modifier and TypeMethodDescriptionprotected static String
formatHumanName
(org.hl7.fhir.r4.model.HumanName name) Formats a human name.abstract byte[]
generate
(ChEmedEprDocumentPmlc pmlcDocument, NarrativeLanguage lang) static String
static String
protected String
protected void
validatePDF
(ChEmedEprDocumentPmlc pmlcDocument, byte[] pdf) Validates the generated document using a different PDF/A-1 PDF/A-2 validator (not from husky).
-
Field Details
-
FONT_FAMILY
- See Also:
-
htmlNarrativeGenerator
The generator HTML narrative. -
pdfConverter
The converter of HTML to PDF/A. -
template
The custom template content. -
pdfValidator
The validator of PDF documents to conformance level A-1 and A-2. -
softwareProviderMetadata
-
-
Constructor Details
-
PdfMedicationCardGenerator
public PdfMedicationCardGenerator(NarrativeFormat narrativeFormat, String template, SoftwareProviderMetadataProvider softwareProviderMetadataProvider) throws IOException, ParserConfigurationException -
PdfMedicationCardGenerator
public PdfMedicationCardGenerator(NarrativeFormat narrativeFormat, SoftwareProviderMetadataProvider softwareProviderMetadataProvider) throws IOException, ParserConfigurationException
-
-
Method Details
-
generate
public abstract byte[] generate(ChEmedEprDocumentPmlc pmlcDocument, NarrativeLanguage lang) throws Exception - Throws:
Exception
-
validatePDF
protected void validatePDF(ChEmedEprDocumentPmlc pmlcDocument, byte[] pdf) throws PdfValidationException Validates the generated document using a different PDF/A-1 PDF/A-2 validator (not from husky). If the document does not pass validation, an exception is thrown.- Parameters:
pmlcDocument
- The document for which the PDF has been generated.pdf
- The byte array of the generated PDF.- Throws:
PdfValidationException
- If the generated PDF failed to pass PDF/A-1 or A-2 validation.
-
getPdfAuthor
-
getDefaultChEmedEprPdfTemplate
- Throws:
IOException
-
getDefaultEmediplanPdfTemplate
-
formatHumanName
Formats a human name.
-