use crate::types::{GenerateResult, VerifyResult};
pub fn render_generate_result(result: &GenerateResult) {
eprintln!("Prescription generated successfully");
eprintln!(" {:<18} {}", "Rx ID:", result.prescription_id);
eprintln!(" {:<18} {}", "Output:", result.output_file);
eprintln!(" {:<18} {}", "Patient:", result.patient_name);
eprintln!(" {:<18} {}", "Prescriber:", result.prescriber_name);
eprintln!(" {:<18} {}", "Medications:", result.medication_count);
eprintln!(" {:<18} {}", "Hash:", &result.verification_hash[..16]);
eprintln!(" {:<18} {}", "Generated:", result.generated_at);
}
pub fn render_verify_result(result: &VerifyResult) {
if result.valid {
eprintln!("QR code parsed successfully");
} else {
eprintln!("QR code is INVALID");
}
eprintln!(" {:<18} {}", "Version:", result.version);
eprintln!(" {:<18} {}", "Rx ID:", result.prescription_id);
eprintln!(" {:<18} {}", "Hash:", result.hash);
eprintln!(" {:<18} {}", "Timestamp:", result.timestamp);
}