labscript 0.1.0

Prescription PDF generator with e-signature and QR verification
labscript-0.1.0 is not a library.

labscript

Generate prescription PDFs with e-signatures and QR verification.

Star Follow @longevityboris Rust PDF License

A Rust CLI that turns structured prescription data into professional PDFs. Each document carries a digital signature and a QR code that anyone can scan to verify it has not been tampered with. Starts in about 2 milliseconds.

Install · Quick Start · Features · CLI Suite · Contributing


Why This Exists

Prescriptions are still written by hand or exported through clunky EMR interfaces. Neither fits into a modern clinical workflow.

labscript takes structured input -- a JSON file, stdin, or CLI flags -- and produces a clean, tamper-evident PDF. The QR code on each document encodes a SHA-256 hash of the prescription contents. Pharmacists or patients scan it to confirm nothing changed after signing.

One command. Deterministic output. No GUI, no cloud, no subscription.

Install

cargo install --git https://github.com/199-biotechnologies/labscript-cli

Requires Rust 1.70+. Builds to a single static binary.

How It Works

                    ┌──────────────────────────────┐
                    │      Structured Input         │
                    │  (JSON file / stdin / flags)  │
                    └──────────────┬───────────────┘
                                   │
                                   ▼
                    ┌──────────────────────────────┐
                    │      labscript generate       │
                    │                              │
                    │  • Validates all fields       │
                    │  • Renders prescription PDF   │
                    │  • Embeds e-signature (PNG)   │
                    │  • Generates QR verification  │
                    │  • SHA-256 content hash       │
                    └──────────────┬───────────────┘
                                   │
                                   ▼
                    ┌──────────────────────────────┐
                    │     prescription.pdf          │
                    │  Professional layout with     │
                    │  signature + scannable QR     │
                    └──────────────────────────────┘

Quick Start

From CLI flags:

labscript generate \
  --patient-name "Jane Doe" \
  --patient-dob "1985-03-15" \
  --prescriber-name "Dr. Boris Djordjevic" \
  --prescriber-credentials "MD" \
  --prescriber-license "MD-12345" \
  --drug "Metformin" \
  --strength "500mg" \
  --form "tablet" \
  --quantity 60 \
  --sig "Take one tablet twice daily with meals" \
  --refills 3 \
  --diagnosis "Type 2 Diabetes" \
  --signature ./signature.png \
  --output metformin-rx.pdf

From a JSON file:

labscript generate --file prescription.json --output rx.pdf

Piped from another tool:

cat prescription.json | labscript generate --stdin --output rx.pdf

Verify a prescription QR code:

labscript verify "labscript:v1:abc123..."

Output is JSON when piped, human-readable tables on a TTY. Force JSON with --json.

Features

PDF Generation

  • Professional prescription layout with patient and prescriber details
  • Drug name, strength, form, quantity, sig, refills, and diagnosis fields
  • Custom prescription date or automatic dating

E-Signatures

  • Embed a PNG signature image directly into the PDF
  • Prescriber credentials and license number on every document

QR Verification

  • Each PDF carries a QR code encoding a SHA-256 hash of the prescription content
  • labscript verify checks any scanned QR string against the expected hash
  • Tamper-evident: changing any field invalidates the QR

Input Flexibility

  • CLI flags for scripting and one-off use
  • JSON file input for batch workflows
  • Stdin for piping from other tools in the suite

Agent-Friendly

  • labscript agent-info exposes machine-readable capabilities
  • JSON output mode for AI agent consumption
  • Exit codes: 0 success, 1 error, 2 config, 3 parse failure

Part of the Longevity CLI Suite

labscript is one tool in a set of composable Rust CLIs built by 199 Biotechnologies for clinical biomarker analysis and longevity medicine.

Tool What it does
labparse Extract biomarkers from lab PDFs
labassess Score biomarkers against longevity-optimal ranges
labstore SQLite patient database for longitudinal tracking
labscript Generate prescription PDFs with e-signatures and QR

All tools communicate via JSON on stdout. Pipe them together.

Contributing

199 Biotechnologies owns this software. We are not accepting outside contributions right now. Found a bug or want a feature? Open an issue.

License

Proprietary. Copyright 2024-2025 199 Biotechnologies. All rights reserved.


Built by 199 Biotechnologies · Follow @longevityboris

Star this repo