explaingit

utzel-butzel/bmp-reader

Analysis updated 2026-05-18

1TypeScriptAudience · developerComplexity · 2/5Setup · easy

TLDR

A JavaScript library that decodes German Bundeseinheitlicher Medikationsplan barcode payloads into a structured object with patient data, medication entries, and warnings.

Mindmap

mindmap
  root((bmp-reader))
    What it decodes
      Patient information
      Medication entries
      Multi-page plans
    Input formats
      String payload
      Uint8Array bytes
      ArrayBuffer
    BMP versions
      v2.8 default
      v2.7 default
      v2.6 opt-in
    Error codes
      Unsupported version
      Missing page
      Malformed XML
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Parse the DataMatrix barcode output from a German medication plan scanner into a JavaScript object with patient and medication fields.

USE CASE 2

Handle multi-page BMP printouts by passing each page's scanner payload to decodeBmpPages to get one assembled plan.

USE CASE 3

Catch specific BMP decode errors such as unsupported version or missing page and handle them gracefully in a healthcare application.

USE CASE 4

Build a browser app that reads a medication plan from a webcam using zxing-wasm, then parses the payload with bmp-reader.

What is it built with?

TypeScriptNode.js

How does it compare?

utzel-butzel/bmp-readerabidoo22/pixelorama-mcpaditya-pandey/slate
Stars111
LanguageTypeScriptTypeScriptTypeScript
Setup difficultyeasymoderateeasy
Complexity2/53/52/5
Audiencedevelopervibe codergeneral

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · easy Time to first run · 5min

Requires Node.js 20+, you need a separate DataMatrix scanner or library (e.g. zxing-wasm) to produce the payload, this package only decodes it.

No license is stated in the README.

In plain English

This JavaScript package decodes the payload from German Bundeseinheitlicher Medikationsplan, or BMP, barcodes. BMP is a standardized medication plan format used in German healthcare. Pharmacies and doctors print patient medication plans as sheets containing a DataMatrix 2D barcode. When a scanner reads that barcode, it returns a compact XML string encoded in ISO-8859-1. This library takes that scanner output and converts it into a structured JavaScript object with patient information, medication entries, and any warnings from the data. The library does not do camera scanning or image processing. It starts after a barcode scanner or image library has already read the DataMatrix code and returned the raw text or bytes. Passing the scanner output to the decodeBmp function returns a plan object with fields for the patient's name, medications, and other sections from the BMP data. Multi-page BMP printouts are supported. Some medication plans span more than one page, each printed with its own DataMatrix code. The decodeBmpPages function accepts an array of scanned page payloads, validates that they belong to the same instance, sorts them, and merges the sections into one assembled plan. The package supports BMP versions 2.7 and 2.8 by default, which are the currently active versions. Older versions 2.6 and 2.3 can be parsed with an option flag but are not officially claimed as fully supported. The library throws an error with a stable error code when it encounters an unsupported version or malformed input, so integrators can catch and handle specific failure cases. A note on encoding: BMP payloads use ISO-8859-1, not UTF-8. If your scanner returns a text string, each byte must map directly to its character code or German characters such as umlauts will be corrupted. The library accepts raw bytes as Uint8Array or ArrayBuffer to avoid this problem, and the README recommends passing bytes directly where possible.

Copy-paste prompts

Prompt 1
Write Node.js code that accepts a BMP scanner payload string, decodes it with bmp-reader, and logs the patient's first name and list of medications.
Prompt 2
How do I handle a multi-page BMP medication plan where each page has a separate DataMatrix barcode? Show me how to use decodeBmpPages with an array of payloads.
Prompt 3
My scanner returns BMP payload bytes as a Uint8Array. How do I pass that to bmp-reader and why is this safer than passing a text string?
Prompt 4
bmp-reader is throwing UNSUPPORTED_VERSION for a v2.6 BMP payload. How do I opt into parsing it and what are the caveats of using allowUnknownVersion?

Frequently asked questions

What is bmp-reader?

A JavaScript library that decodes German Bundeseinheitlicher Medikationsplan barcode payloads into a structured object with patient data, medication entries, and warnings.

What language is bmp-reader written in?

Mainly TypeScript. The stack also includes TypeScript, Node.js.

What license does bmp-reader use?

No license is stated in the README.

How hard is bmp-reader to set up?

Setup difficulty is rated easy, with roughly 5min to a first successful run.

Who is bmp-reader for?

Mainly developer.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Scan in gitsafehub Deploy in gitdeployhub utzel-butzel on gitmyhub

Verify against the repo before relying on details.