Skip to content

mikepatraw/rx-guard

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

76 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RXsignal

RXsignal is a Prompt Opinion-published, A2A-enabled prescribing safety agent for controlled-substance workflows. It reviews synthetic prescribing encounters, identifies documentation gaps and contextual risk factors, and returns explainable clinician-support guidance before a prescription is finalized.

Why this project exists

Controlled-substance prescribing workflows are high-friction and high-stakes. Clinicians often need to combine note content, medication context, risk factors, and policy expectations under time pressure. RXsignal is designed to make that review faster, clearer, and more defensible.

Hackathon framing

This project is being scoped for the Agents Assemble: The Healthcare AI Endgame challenge.

RXsignal is intentionally framed as:

  • an interoperable healthcare agent
  • human-in-the-loop decision support
  • synthetic/de-identified data only
  • FHIR-context-aware
  • focused on documentation quality and prescribing safety review

RXsignal is intentionally not framed as:

  • an autonomous prescribing decision-maker
  • a live EHR/PDMP integration product for day one
  • a fraud accusation engine
  • a replacement for clinician judgment

MVP

The current MVP:

  • ingests a synthetic prescribing encounter
  • inspects note text and structured clinical context
  • flags missing documentation and prescribing risk signals
  • generates hybrid rule-based and AI-style review output
  • explains why each issue matters
  • suggests chart-ready language for clinician review

Inputs

  • synthetic patient context
  • encounter summary
  • note text
  • medication request
  • active medications
  • diagnoses / conditions
  • allergies
  • optional prior-fill or monitoring summary

Outputs

  • risk summary
  • missing documentation checklist
  • explainable findings
  • suggested documentation language
  • structured review result for downstream agent/tool use

Initial repository structure

rx-guard/
├── README.md
├── docs/
│   ├── product/
│   ├── architecture/
│   └── research/
├── agent/
│   ├── prompts/
│   ├── schemas/
│   └── examples/
├── data/
│   ├── synthetic/
│   └── fixtures/
├── src/
│   ├── api/
│   ├── cli/
│   ├── engine/
│   ├── fhir/
│   └── types/
└── .gitignore

Current status

RXsignal now has:

  • a working hybrid MVP review engine
  • synthetic demo cases
  • Prompt Opinion marketplace publication
  • A2A enabled on the published agent
  • free-tier Prompt Opinion model configuration validated
  • repo docs aligned to the Prompt Opinion chat/A2A path
  • a provisional BYO/A2A wrapper endpoint for local shaping
  • a local CLI adapter that accepts realistic encounter fields, resolves the synthetic case key, and renders Prompt Opinion-style decision support
  • a connected static EHR-style demo UI that reads the local adapter's generated Tamera164 Wisozk929 payload, renders deterministic PDMP rows, and drives workflow buttons
  • a public Vercel staging UI for low-friction partner testing on phone or desktop: https://rx-guard-iota.vercel.app

Current MVP status

The repository now includes a working hybrid MVP foundation with:

  • request and response schemas
  • synthetic demo cases
  • a Prompt Opinion submission checklist and wrapper plan
  • a prompt spec for the AI review layer
  • a TypeScript rules engine skeleton
  • AI-style explanation synthesis layered on top of rules
  • a simple local HTTP server
  • a provisional BYO/A2A adapter endpoint for shaping external invocation
  • CLI-style case runners for demo review
  • a local CLI adapter for the realistic encounter → synthetic key → Prompt Opinion-safe JSON → RXsignal-rendered PDMP flow
  • basic test coverage for the review core
  • demo script and Devpost draft
  • Prompt Opinion chat/A2A calibration guidance

Repo docs

  • Product requirements: docs/product/PRD.md
  • Architecture: docs/architecture/ARCHITECTURE.md
  • Prompt Opinion wrapper plan: docs/architecture/PROMPT-OPINION-WRAPPER-SPEC.md
  • BYO/A2A integration plan: docs/architecture/BYO-A2A-INTEGRATION-PLAN.md
  • Submission checklist: docs/product/SUBMISSION-CHECKLIST.md
  • Competition rules and compliance review: docs/product/COMPETITION-RULES-AND-COMPLIANCE.md
  • Demo script: docs/product/DEMO-SCRIPT.md
  • Local UI test walkthrough: docs/product/LOCAL-TEST-GUIDE.md
  • Prompt Opinion chat test prompt: docs/product/PROMPT-OPINION-CHAT-TEST-PROMPT.md
  • Prompt Opinion chat calibration: docs/product/PROMPT-OPINION-CHAT-CALIBRATION.md
  • Prompt Opinion BYO Agent configuration: docs/product/PROMPT-OPINION-BYO-AGENT-CONFIG.md
  • Prompt Opinion copy-paste System Prompt: docs/product/PROMPT-OPINION-SYSTEM-PROMPT.md
  • Staging test guide: docs/product/STAGING-TEST-GUIDE.md
  • Final submission evidence guide: docs/product/FINAL-SUBMISSION-EVIDENCE.md
  • Devpost draft: docs/product/DEVPOST-DRAFT.md

Public staging test

Reviewers can test the synthetic RXsignal workflow without cloning the repo:

https://rx-guard-iota.vercel.app

See docs/product/STAGING-TEST-GUIDE.md for partner instructions and synthetic-only safety notes.

The staging site is aligned to the Prompt Opinion A2A/agent contract, but it is not a live Prompt Opinion API integration. It is a public, read-only synthetic workflow renderer generated from the RXsignal local adapter. Prompt Opinion remains the published agent layer for the submission; RXsignal owns the synthetic clinical data adapter and EHR-style workflow UI.

Run locally

For a clone-to-local-test walkthrough with both macOS and Windows instructions, see docs/product/LOCAL-TEST-GUIDE.md.

Fast path after install

npm install

Run the local Prompt Opinion adapter test:

./scripts/run-local-demo.sh

Launch the static EHR local test UI:

./scripts/start-ui-demo.sh

Then open:

http://localhost:4173

Windows users can run the matching PowerShell wrappers:

powershell -ExecutionPolicy Bypass -File .\scripts\run-local-demo.ps1
powershell -ExecutionPolicy Bypass -File .\scripts\start-ui-demo.ps1

The local adapter demonstrates the intended handoff without requiring a live Prompt Opinion API call: RXsignal accepts realistic EHR-style encounter fields, resolves the synthetic patient to the Tamera Prompt Opinion patient scope / PO_PATIENT_TAMERA_WISOZK overlay, sends only the synthetic key and clinical facts through the Prompt Opinion-safe payload, then renders compact decision-support JSON together with deterministic local PDMP rows.

The UI opens on a synthetic eCW-style medication page. The UI wrapper builds public/demo-data.js from the same local adapter used by the CLI demo, then the page reads that payload to render the Tamera164 Wisozk929 RXsignal analysis, deterministic local PDMP rows, and Proceed / Proceed with Caution / Do Not Prescribe workflow buttons. Use docs/product/LOCAL-TEST-GUIDE.md as the local test link.

Developer checks

npm test

Optional API server

npm start

Review endpoint:

http://localhost:8787/review

Health endpoint:

http://localhost:8787/health

Prompt Opinion demo path

The current intended live/demo path is:

  1. enter realistic encounter fields locally for the synthetic Tamera164 Wisozk929 scenario
  2. let the RXsignal CLI/local adapter resolve the encounter to RXG-TW-001
  3. send the synthetic key and clinical facts through the Prompt Opinion-safe compact JSON contract
  4. render the deterministic local PDMP rows and EHR-style controlled-substance risk modal in RXsignal
  5. click the appropriate workflow action for the synthetic case, usually Do Not Prescribe for the high-risk Tamera164 Wisozk929 scenario
  6. reinforce that the output is clinician-support guidance, not an autonomous prescribing decision

The public Vercel staging path uses the same generated static data and can be used for partner UI feedback. It should be described as Prompt Opinion-compatible staging, not as a live Prompt Opinion-connected app.

Remaining work

  1. Validate and record the end-user Prompt Opinion chat/A2A invocation path on the synthetic Tamera case.
  2. Capture the final marketplace listing URL/details and fold them into Devpost materials.
  3. Record the final under-3-minute in-platform demo.
  4. Improve normalization for FHIR-like inputs after submission scope is stable.
  5. Replace the local deterministic explanation synthesis with a production model-backed layer when platform/runtime details are finalized.

Current Prompt Opinion findings

Recent platform validation changed the expected integration path:

  • A free Prompt Opinion account is sufficient to begin setup
  • Free-tier model configuration works with Google Gemini (FREE TIER) using Gemini 3 Flash Preview
  • Native Po Agents are useful for learning the platform, but the final publishable path is the A2A-enabled BYO Agent flow
  • RXsignal is now published in Prompt Opinion Marketplace
  • RXsignal has A2A enabled and is intended to be used through the chat/A2A agent path, not as a custom MCP-tools surface
  • No custom MCP tools are exposed beyond built-in patient helpers
  • The Vercel staging UI is public and partner-testable at https://rx-guard-iota.vercel.app
  • The remaining live validation gap is recording/confirming a clean synthetic-case invocation flow from Prompt Opinion chat for final submission evidence

Known live endpoints:

  • A2A agent URL: https://app.promptopinion.ai/api/workspaces/[REDACTED_WORKSPACE_ID]/ai-agents/[REDACTED_AGENT_ID]
  • A2A HTTP+JSON interface URL: https://app.promptopinion.ai/api/workspaces/[REDACTED_WORKSPACE_ID]/ai-agents/[REDACTED_AGENT_ID]/a2a-http-json
  • MCP URL: https://app.promptopinion.ai/api/workspaces/[REDACTED_WORKSPACE_ID]/ai-agents/[REDACTED_AGENT_ID]/mcp
  • A2A agent card URL: https://app.promptopinion.ai/api/workspaces/[REDACTED_WORKSPACE_ID]/ai-agents/[REDACTED_AGENT_ID]/.well-known/agent-card.json

That means the current best submission path is:

  1. finish the core RXsignal prompt/behavior
  2. validate chat selection and synthetic-case invocation against the published BYO/A2A agent
  3. capture the marketplace listing URL/details
  4. record the in-platform demo against that final published path

License

TBD

Portfolio snapshot

  • Problem: Controlled-substance prescribing reviews are high-stakes and documentation-heavy under time pressure.
  • Core capability: FHIR-aware safety review with explainable guidance before finalizing a prescription.
  • Primary stack: TypeScript agent workflow + healthcare data context.
  • Status: Active MVP development.

Related projects

About

FHIR-aware prescribing safety agent for controlled-substance workflow review

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors