Transaction log
Every message processed by JamBridge is recorded in the hie_transaction_log table in PostgreSQL.
Schema
CREATE TABLE hie_transaction_log (
transaction_id VARCHAR(64) PRIMARY KEY,
message_control_id VARCHAR(64) NOT NULL, -- MSH-10 (dedup key)
message_type VARCHAR(32) NOT NULL, -- ADT^A01, ORU^R01, etc.
facility_code VARCHAR(32) NOT NULL, -- MSH-4
status VARCHAR(32) NOT NULL, -- RECEIVED, PROCESSING, SUCCESS, CONSENT_NACK, ERROR
golden_patient_id VARCHAR(64), -- JamMPI golden record ID
fhir_resource_id VARCHAR(128), -- HAPI FHIR resource ID
duration_ms INTEGER, -- wall-clock pipeline time
started_at TIMESTAMPTZ NOT NULL,
completed_at TIMESTAMPTZ,
error_code VARCHAR(32), -- ERR-001 to ERR-006
error_message TEXT,
raw_hl7_sha256 VARCHAR(64) -- SHA-256 of raw HL7v2 (for audit)
);
CREATE INDEX idx_tx_message_control ON hie_transaction_log(message_control_id, started_at);
CREATE INDEX idx_tx_facility_status ON hie_transaction_log(facility_code, status, started_at);
CREATE INDEX idx_tx_golden ON hie_transaction_log(golden_patient_id);
Retention
Default retention is 90 days. Configure:
bridge:
transaction-log:
retention-days: 90
purge-cron: "0 2 * * *" # 2am daily
The purge job deletes records older than retention-days where status IN ('SUCCESS', 'CONSENT_NACK'). Records with status = 'ERROR' are retained indefinitely for audit purposes.