Skip to content

angshu/fhir-pdf

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FHIR PDF

Description

Creates a PDF given a FHIR resource.

Pre-requisites

  • nodejs

Developed with node version - v22.2.0.
If you are developing with multiple nodejs versions, use NVM

Installation

  1. Install dependencies

npm install

  1. Run the server

node server.js

This will start the server on port 9000 by default

You may provide variables through the .env file

node --env-file=.env server.js

Development

The service first uses EJS templates to bind a HTML template with the data, and then uses Puppeteer to convert the generated HTML to PDF. FhirPath is used as expression insides the ejs templates. See fhirpath.js for help on how to evaluate expressions.

Usage

curl -X POST --data "@./tests/resources/prescription.json" http://localhost:9000/prescription --output prescription.pdf

.env file

property description example value
PORT server port to listen to 3000
CACHE_TEMPLATE if template content should be cached true
TMPL_BASE_URL base path of the templates. Can be http or file-path http://localhost:8000 or /Users/yourname/templates

About

Converts a fhir resource to a PDF using specific templates

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • JavaScript 100.0%