📋 IrbyImaging.Models.VaxTestData Documentation
Table of Contents
- Overview & Purpose
- Class Summary
- Properties
- Key Functional Areas
- Dependencies & Technologies
- UML Class Diagram
- Usage Examples
- Conclusion
1. Overview & Purpose
VaxTestData is a simple Data Model (also often used as a ViewModel or DTO) within the IrbyImaging.Models namespace. It encapsulates all relevant data for a single vaccination test record in the IrbyImaging.UI system.
🎯 **Primary Goals:
**
- Represent vaccination test metadata (date, kit information, supervisor details).
- Store images (byte arrays) for both the test kit and the test result.
- Serve as a transport model between UI layers, services, and potentially API boundaries.
2. Class Summary
namespace IrbyImaging.Models
{
/// <summary>
/// Class VaxTestData.
/// Encapsulates details for a single vaccination test.
/// </summary>
public class VaxTestData
{
public DateTime TestDate { get; set; }
public string TestKitName { get; set; }
public string TestKitId { get; set; }
public byte[] TestKitImage { get; set; }
public string Result { get; set; }
public string ResultNotes { get; set; }
public int SupervisorId { get; set; }
public string SupervisorName { get; set; }
public byte[] ResultImage { get; set; }
}
}
3. Properties
| Property Name | Type | Description |
|---|---|---|
| TestDate | DateTime | Date and time when the test was performed. |
| TestKitName | string | Human-readable name of the test kit (e.g. “COVID-19 Rapid”). |
| TestKitId | string | Unique identifier or batch code for the test kit. |
| TestKitImage | byte[] | Binary image data of the test kit packaging/label. |
| Result | string | The outcome of the test (e.g. “Positive”, “Negative”). |
| ResultNotes | string | Additional remarks or clinician notes. |
| SupervisorId | int | Identifier of the supervising user/technician. |
| SupervisorName | string | Full name of the supervisor. |
| ResultImage | byte[] | Binary image data showing the test result window. |
4. Key Functional Areas
- 📅 Test Metadata: Captures when (
TestDate) and how (TestKitName/TestKitId) the test was administered. - 🖼️ Imaging Support: Holds two images (
TestKitImage,ResultImage) for visual verification within the UI. - 📊 Result Handling: Stores both the primary result and any extended notes for auditing or further analysis.
- 👤 Supervisor Tracking: Links test records to a supervisor, facilitating accountability and reporting.
5. Dependencies & Technologies
- .NET Standard / .NET Core – POCO resides in a class library targeting .NET Standard compatibility.
- System namespaces – Utilizes
SystemforDateTime,System.Collections.Generic, etc. - Byte Arrays for Images – No direct imaging library dependency; images are handled as raw byte arrays for greatest flexibility.
6. UML Class Diagram
+-------------------------------------------------+
| VaxTestData |
+-------------------------------------------------+
| - TestDate : DateTime |
| - TestKitName : string |
| - TestKitId : string |
| - TestKitImage : byte[] |
| - Result : string |
| - ResultNotes : string |
| - SupervisorId : int |
| - SupervisorName : string |
| - ResultImage : byte[] |
+-------------------------------------------------+
| + (default constructor) |
| + Get/Set for each property |
+-------------------------------------------------+
7. Usage Examples
7.1 Creating a New Test Record
using IrbyImaging.Models;
using System;
using System.IO;
public class VaxTestService
{
public VaxTestData CreateSampleTest()
{
// Load images from disk or a stream
byte[] kitBytes = File.ReadAllBytes("kit.jpg");
byte[] resultBytes = File.ReadAllBytes("result.jpg");
return new VaxTestData
{
TestDate = DateTime.UtcNow,
TestKitName = "COVID-19 Rapid Antigen",
TestKitId = "KIT-2022-001",
TestKitImage = kitBytes,
Result = "Negative",
ResultNotes = "No antigens detected.",
SupervisorId = 42,
SupervisorName = "Dr. Alice Smith",
ResultImage = resultBytes
};
}
}
7.2 Binding to a Razor Page / WPF Form
<!-- Razor Page Example -->
<form method="post" enctype="multipart/form-data">
<input asp-for="TestKitImage" type="file" />
<input asp-for="ResultImage" type="file" />
<input asp-for="ResultNotes" type="text" />
<button type="submit">Submit Test</button>
</form>
// In PageModel
[BindProperty]
public VaxTestData TestData { get; set; }
public IActionResult OnPost()
{
if (!ModelState.IsValid) return Page();
// Save TestData to database or send to API
return RedirectToPage("Success");
}
8. Conclusion
VaxTestData is a lightweight, self-contained model designed to represent all facets of a vaccination test within the IrbyImaging UI ecosystem. It is:
- Versatile: Can be serialized for APIs, bound in UI frameworks, or persisted in databases.
- Straightforward: Only holds essential fields with clear, descriptive names.
- Extendable: Future properties (e.g., BatchNumber, PatientId) can be added with minimal impact.
🚀 Use VaxTestData as the foundation for any vaccination test workflows—be it data entry forms, reporting dashboards, or backend services.