Skip to content

Latest commit

 

History

History
94 lines (74 loc) · 3.7 KB

File metadata and controls

94 lines (74 loc) · 3.7 KB

Tasks

Phase 1: Project Setup

  • Fix Cargo.toml issues (duplicate edition, typos, wrong repository URL)
  • Add missing dependencies: base64, crc32fast
  • Verify cargo build compiles the skeleton

Phase 2: Core Data Structures

  • Create error.rs with MuseError enum
  • Create patient.rs with PatientDemographics struct
  • Create test_demographics.rs with TestDemographics struct
  • Create diagnosis.rs with Diagnosis and DiagnosisStatement structs
  • Create waveform.rs with Waveform and LeadData structs
  • Create measurements.rs with RestingEcgMeasurements struct
  • Create order.rs with OrderInformation struct
  • Create resting_ecg.rs with RestingEcg top-level struct

Phase 3: I/O Modules

  • Create io_xml.rs — read/write MUSE XML (windows-1252, DOCTYPE)
  • Create io_json.rs — read/write JSON
  • Create lib.rs — module declarations and re-exports

Phase 4: CLI

  • Create main.rs with clap subcommands: convert, info, validate
  • Implement format detection by file extension
  • Implement convert subcommand (xml <-> json)
  • Implement info subcommand (summary display)
  • Implement validate subcommand (CRC32 check)

Phase 5: Example Files

  • Create examples/example.xml — realistic MUSE XML sample
  • Create examples/example.json — same data in JSON
  • Create src/bin/generate_examples.rs — helper to regenerate examples

Phase 6: Unit Tests

  • Unit tests for patient.rs (4 tests)
  • Unit tests for test_demographics.rs (3 tests)
  • Unit tests for diagnosis.rs (3 tests)
  • Unit tests for waveform.rs (9 tests: base64, CRC32, XML deserialization)
  • Unit tests for measurements.rs (3 tests)
  • Unit tests for order.rs (3 tests)
  • Unit tests for io_xml.rs (6 tests)
  • Unit tests for io_json.rs (4 tests)
  • Unit tests for error.rs (7 tests)
  • Doc-tests for lib.rs, io_xml, io_json, resting_ecg (4 tests)

Phase 7: Integration Tests

  • Read example.xml, verify struct fields (5 tests)
  • Read example.json, verify struct fields
  • MUSE XML -> JSON, compare with example.json
  • JSON -> MUSE XML -> struct, compare
  • Round-trip: MUSE XML -> JSON -> MUSE XML structural equality
  • Waveform base64 decode/encode round-trip
  • CRC32 validation for all 24 leads
  • Cross-format equality: XML and JSON produce identical structs

Phase 8: Documentation & Polish

  • Add rustdoc comments to all public items
  • Verify cargo doc builds with zero warnings
  • Verify cargo clippy passes with zero warnings
  • Update README.md with install, CLI usage, library usage, format reference
  • Update index.md with overview and usage examples

Phase 9: Comprehensive Documentation

  • Create doc/index.md — documentation index
  • Create doc/getting-started.md — installation and quick start
  • Create doc/cli-reference.md — full CLI documentation
  • Create doc/library-api-guide.md — library usage guide
  • Create doc/data-structures.md — all structs, fields, serde mappings
  • Create doc/waveform-data.md — waveform encoding, CRC32, lead layout
  • Create doc/muse-xml-format.md — MUSE XML specification reference
  • Create doc/error-handling.md — error types and handling strategies
  • Create doc/examples.md — code examples for common tasks
  • Create doc/architecture.md — module layout, data flow, design decisions
  • Create doc/testing.md — test suite overview, running tests
  • Create doc/contributing.md — development setup and conventions

Summary

  • 56 tests total: 40 unit + 12 integration + 4 doc-tests
  • All tests pass
  • Zero clippy warnings
  • Zero cargo doc warnings
  • 12 source modules + 1 helper binary
  • 11 documentation guides in doc/