Skip to content

A comprehensive web application for radiologists featuring a worklist management system and medical image viewer. Built with ASP.NET Core for the backend, React.js for the frontend, and Microsoft SQL Server database.

Notifications You must be signed in to change notification settings

omarshata0/DICOMView.NET

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

8 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

DICOMView.NET

A comprehensive web application for radiologists featuring a worklist management system and medical image viewer. Built with ASP.NET Core for the backend, React.js for the frontend, and Microsoft SQL Server database.

πŸš€ Features

Core Functionality

  • Secure Authentication: JWT-based login system for radiologists
  • Exam Management: Create, update, and track patient exams
  • Patient Database: Comprehensive patient information management
  • Worklist Interface: Grid-based exam history with search capabilities
  • DICOM Viewer: Medical image viewing with basic measurement tools
  • Status Tracking: Real-time exam status updates (Scheduled, Arrived, Canceled, Completed)

Technical Features

  • RESTful API architecture
  • React-based responsive frontend
  • SQL Server database with Dapper ORM
  • BLOB storage for medical images
  • JWT authentication and authorization
  • Search and filtering capabilities

πŸ› οΈ Technology Stack

Backend

  • Framework: ASP.NET Core
  • Database: Microsoft SQL Server
  • ORM: Dapper
  • Authentication: JWT (JSON Web Tokens)
  • API: RESTful Web API

Frontend

  • Framework: React.js
  • Data Fetching: TanStack Query (React Query)
  • Form Management: React Hook Form
  • Styling: TailwindCSS
  • Build Tool: Vite

Database

  • Primary Database: Microsoft SQL Server
  • Image Storage: BLOB storage in SQL Server
  • Data Access: Dapper for efficient database operations

πŸ“ Project Structure

DICOMView.NET/
β”œβ”€β”€ frontend/                 # React frontend application
β”‚   β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ public/
β”‚   β”œβ”€β”€ package.json
β”‚   └── ...
β”œβ”€β”€ backend/                  # ASP.NET Core API
β”‚   β”œβ”€β”€ Controllers/
β”‚   β”œβ”€β”€ Models/
β”‚   β”œβ”€β”€ Services/
β”‚   β”œβ”€β”€ scripts/
β”‚   β”‚   β”œβ”€β”€ createTables.sql
β”‚   β”‚   β”œβ”€β”€ InsertDummyData.sql
β”‚   β”‚   └── dataSeed.py
β”‚   └── ...
β”œβ”€β”€ CT_data/                  # Sample CT scan data
β”‚   └── (DICOM files for testing)
└── README.md

πŸ“‹ Prerequisites

Before running the application, ensure you have the following installed:

  • .NET 6.0 or later
  • Node.js 16+ and npm
  • Microsoft SQL Server
  • Python 3.8+
  • Git

🚦 Getting Started

1. Clone the Repository

git clone https://github.com/yourusername/DICOMView.NET.git
cd DICOMView.NET

2. Database Setup

Create Database Tables

  1. Open SQL Server Management Studio (SSMS) or Azure Data Studio
  2. Connect to your SQL Server instance
  3. Execute the table creation script:
-- Create the WorkListTask database and tables
-- File location: /backend/scripts/createTables.sql

Insert Dummy Data

-- Execute the dummy data script
-- File location: /backend/scripts/InsertDummyData.sql

Seed CT Data

# Navigate to backend scripts directory
cd backend/scripts

# Install Python dependencies
pip install pyodbc pydicom

# Run the data seeding script to populate ExamBlob
python dataSeed.py

3. Backend Configuration

Update Connection String

  1. Navigate to /backend/appsettings.json
  2. Update the connection string:
{
  "ConnectionStrings": {
    "DefaultConnection": "Server=localhost;Database=WorkListTask;Trusted_Connection=true;TrustServerCertificate=true;"
  },
  "Jwt": {
    "Key": "your-secret-key-here",
    "Issuer": "DICOMView.NET",
    "Audience": "DICOMView.NET"
  }
}

Run Backend

# Navigate to backend directory
cd backend

# Restore NuGet packages
dotnet restore

# Build the project
dotnet build

# Run the application
dotnet run or dotnet watch run

The API will be available at https://localhost:5190 (or the port specified in your configuration).

4. Frontend Configuration

Install Dependencies

# Navigate to frontend directory
cd frontend

# Install npm packages
npm install or pnpm install

Configure API Endpoint

Update the API base URL in your frontend configuration (typically in a config file or environment variables):

// Example configuration
const API_BASE_URL = "https://localhost:5190/api";

Run Frontend

# Start the development server
npm run dev or npm run dev

The frontend will be available at http://localhost:5173.

πŸ“Š API Endpoints

Authentication

  • POST /api/auth/register - Register new user
  • POST /api/auth/login - User login
  • POST /api/auth/refresh-token - Refresh JWT token
  • GET /api/auth - Checks Authentication State
  • GET /api/auth/user - Get user details
  • POST /api/auth/logout - User logout

Exams

  • POST /api/exams/create - Create new exam
  • GET /api/exams/{examId} - Get one exam
  • PUT /api/exams/{examId} - Update exam
  • DELETE /api/exams/{examId} - Delete exam
  • GET /api/exams - Get all exams
  • GET /api/exams/{examId}/dicom - Get DICOM data

Patients

  • GET /api/patients - Get all patients

🎯 Usage

1. Login

  • Access the application at http://localhost:5173
  • Use the provided credentials from the dummy data or register a new account

2. Create New Exam

  • Click "Add New Exam"
  • Fill in patient details (ID, Name, Gender, Birthdate, Email)
  • Specify exam type (CT Brain, Chest X-Ray, etc.)
  • Set date and time
  • Select exam status

3. View Worklist

  • Access the worklist to see all patient exams
  • Use search functionality to filter by patient ID, name, or exam date
  • View exam details in grid format

4. DICOM Viewer

  • Double-click on any exam to open the viewer
  • View medical images with basic measurement tools
  • Navigate through image series

πŸ—„οΈ Database Schema

The application uses four main tables in the WorkListTask database:

Users Table

  • UserId (INT, Primary Key, Identity): Unique user identifier
  • Username (VARCHAR(50), Unique): User login name
  • PasswordHash (VARCHAR(255)): Hashed password for security
  • Email (VARCHAR(100), Unique): User email address
  • RefreshToken (VARCHAR(255), Nullable): Stores JWT refresh token
  • RefreshTokenExpiryTime (DATETIME, Nullable): Refresh token expiration timestamp
  • CreatedDate (DATETIME): Account creation timestamp

Patients Table

  • PatientId (INT, Primary Key, Identity): Unique patient identifier
  • PatientName (VARCHAR(100)): Patient's full name
  • Birthdate (DATE): Patient's date of birth
  • Gender (CHAR(1)): Patient gender (M/F)
  • Email (VARCHAR(100), Unique): Patient email address
  • CreatedDate (DATETIME): Record creation timestamp

Exams Table

  • ExamId (INT, Primary Key, Identity): Unique exam identifier
  • PatientId (INT, Foreign Key): Reference to Patients table
  • ExamType (VARCHAR(100)): Type of exam (CT Brain, Chest X-Ray, etc.)
  • ExamDate (DATETIME2): Scheduled exam date and time
  • Status (VARCHAR(20)): Exam status (Scheduled, Arrived, Cancelled, Completed)
  • Comments (TEXT): Additional exam notes
  • CreatedDate (DATETIME): Record creation timestamp

ExamBlob Table

  • ExamBlobId (INT, Primary Key, Identity): Unique identifier for DICOM blob
  • ExamId (INT, Foreign Key): Reference to Exams table
  • DicomStudyBlob (VARBINARY(MAX)): DICOM image data stored as binary blob
  • CreatedDate (DATETIME): Record creation timestamp

Note: This application is designed for educational and development purposes. For production use in healthcare environments, ensure compliance with relevant regulations (HIPAA, GDPR, etc.) and implement additional security measures.

About

A comprehensive web application for radiologists featuring a worklist management system and medical image viewer. Built with ASP.NET Core for the backend, React.js for the frontend, and Microsoft SQL Server database.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published