Skip to content

feat: MVP для формы №3-ДОЗ (стоматологическая клиника) - #1

Open
GraphSaf wants to merge 80 commits into
mainfrom
claude/radiation-dose-reporting-app-RM8Cf
Open

feat: MVP для формы №3-ДОЗ (стоматологическая клиника)#1
GraphSaf wants to merge 80 commits into
mainfrom
claude/radiation-dose-reporting-app-RM8Cf

Conversation

@GraphSaf

Copy link
Copy Markdown
Owner

Реализован минимально рабочий функционал для создания отчётов по коллективным дозам
облучения пациентов в стоматологических клиниках.

Основные возможности:

  • Создание отчётов с данными организации и ответственных лиц
  • Справочник из 6 базовых стоматологических процедур
  • Автоматический расчёт коллективных доз (чел·мГр)
  • Валидация по референсным уровням НРБ-99/2009
  • Экспорт готовых отчётов в формат Excel

Технологии:

  • React 18 + TypeScript
  • Vite для сборки
  • Zustand для управления состоянием
  • TailwindCSS для стилизации
  • xlsx для экспорта в Excel

Структура:

  • Все необходимые типы и интерфейсы
  • Переиспользуемые UI компоненты
  • Валидация и расчёты
  • Zustand store для состояния

Соответствует ТЗ и нормативной базе:

  • СП 2.6.1.2612-10
  • НРБ-99/2009
  • МУК 2.6.1.3584-19

Реализован минимально рабочий функционал для создания отчётов по коллективным дозам
облучения пациентов в стоматологических клиниках.

Основные возможности:
- Создание отчётов с данными организации и ответственных лиц
- Справочник из 6 базовых стоматологических процедур
- Автоматический расчёт коллективных доз (чел·мГр)
- Валидация по референсным уровням НРБ-99/2009
- Экспорт готовых отчётов в формат Excel

Технологии:
- React 18 + TypeScript
- Vite для сборки
- Zustand для управления состоянием
- TailwindCSS для стилизации
- xlsx для экспорта в Excel

Структура:
- Все необходимые типы и интерфейсы
- Переиспользуемые UI компоненты
- Валидация и расчёты
- Zustand store для состояния

Соответствует ТЗ и нормативной базе:
- СП 2.6.1.2612-10
- НРБ-99/2009
- МУК 2.6.1.3584-19
- Set base path to /xray/ in vite.config.ts
- Add GitHub Actions workflow for automatic deployment
- Add .nojekyll to prevent Jekyll processing
- Workflow triggers on push to main and feature branch
claude added 19 commits January 3, 2026 21:09
Добавлена интеграция с PocketBase для хранения отчетов в облаке:

- Установлен PocketBase SDK (pocketbase)
- Создан PocketBase client с конфигурацией через .env
- Реализован API service layer для CRUD операций с отчетами
- Обновлен Zustand store для работы с async API методами
- Добавлены loading states и error handling
- Упрощена структура типов DOZ3Report под MVP

Изменения в компонентах:
- ReportForm: добавлена поддержка async создания отчетов, обновлены поля (ОКПО вместо ИНН/лицензии)
- ProcedureTable: добавлена кнопка "Сохранить отчет", убрано поле "Возрастная группа"
- ExportButtons: исправлен расчет totalProcedures

Технические детали:
- Упрощены типы Organization и Responsible
- Удалены поля version, clinicType, equipment, totalProcedures из DOZ3Report
- Добавлен .env.example для конфигурации PocketBase URL
- Build проходит без ошибок (160KB gzipped)

Следующие шаги: настройка PocketBase сервера и создание коллекции doz3_reports
Скрипты для деплоя Frontend + PocketBase на одном сервере:

- full-deploy.sh: полная установка (PocketBase + Nginx + SSL)
- deployer.py: Python автодеплойер
- auto-deploy.sh: автоматическая загрузка файлов
- pb_schema.json: схема коллекции для PocketBase
- README.md: подробные инструкции

Структура на сервере:
- Frontend: /var/www/doz3 → https://xray.zubrdental.ru/
- PocketBase: /opt/pocketbase → https://xray.zubrdental.ru/api/
- Admin UI: https://xray.zubrdental.ru/_/

Обновлен .env.production для работы на одном домене
Автоматический деплой при push:
- Build проекта (npm run build)
- Установка PocketBase на сервер
- Загрузка frontend файлов через SSH
- Перезапуск сервисов
- Логи сохраняются в Artifacts

Требуется настройка SSH ключа в GitHub Secrets (см. deploy/GITHUB_ACTIONS_SETUP.md)
…mpatibility

Проблема: crypto.randomUUID() не работает через HTTP (только HTTPS/localhost)
Решение: создана утилита generateUUID() с fallback для HTTP

- Добавлен src/utils/uuid.ts с универсальным генератором UUID
- Обновлен useDOZ3Store для использования generateUUID()
- Теперь приложение работает без HTTPS
Финальная инструкция по деплою с учетом всех нюансов:

- UUID fix для работы через HTTP
- Правильная структура /xray/ для статических файлов
- Пошаговая настройка PocketBase коллекции
- Конфигурация Nginx с проксированием
- SSL установка с Let's Encrypt
- Troubleshooting для частых проблем
- GitHub Actions автодеплой (опционально)

Все протестировано и работает на Ubuntu 24.04
- Add AuthButton component with VK login/logout
- Integrate PocketBase OAuth2 flow
- Show user info when authenticated
- Handle OAuth redirect callback
- Update App layout with auth button in header
Major features:
- Added dose settings management for all X-ray types
- Created DoseSettings component with 3 tabs (Intraoral, Panoramic, CBCT)
- Implemented dose configuration by tooth groups (Russian dental standards)
- Added patient type categorization (children, slim, average, heavy)
- CBCT segmentation (single jaw, both jaws, full head)

Dose Settings Structure:
- Intraoral: Anterior teeth, Premolars, Upper/Lower molars
- Panoramic (OPTG): Children, Slim, Average, Heavy patients
- CBCT (3D): Full matrix by patient type and scan area
- All doses stored in localStorage with zustand persist
- Default values based on Kavo OP 3D Pro documentation

UI/UX Improvements:
- Redesigned DOZ3Page with black/white theme
- Added tabs: 'Journal' and 'Settings'
- Large text and buttons for elderly users
- Responsive design (mobile-first)
- Rounded corners (rounded-2xl, rounded-3xl)
- Clear visual hierarchy

Technical:
- Created types/doseSettings.ts with dose structure
- Created store/useDoseSettingsStore.ts with zustand persist
- Updated DOZ3Page with tab navigation
- Maintained existing report functionality
- Reduced padding from p-8 to p-2 on mobile (p-2 sm:p-4 md:p-8)
- Reduced viewer height from 800px to 600px for better mobile fit
- Made padding responsive for description section
- Updated note text to mention touch controls
- 3D viewer now uses almost full width on mobile screens
New Features:
- Created EquipmentGuidePage with search and filtering
- Added 3 initial equipment examples (Kodak 3500, Sirona Heliodent, KaVo OP 3D Pro)
- Equipment cards with type badges and placeholder images
- Search by name/manufacturer functionality
- Filter by equipment type (Intraoral, Panoramic, CBCT)

UI/UX:
- Black/white design matching site theme
- Responsive cards grid (1 col → 2 cols → 3 cols)
- Large search input with rounded corners
- Type filter tabs with active state
- Coming soon section for AI assistant features

Navigation:
- Added /equipment route in App.tsx
- Updated Navigation component (desktop + mobile menu)
- Updated Footer links
- Added equipment card to LandingPage (2nd position)
- New menu order: Positioning → Equipment → Patients → DOZ-3

Preparation for RAG:
- Mentioned AI assistant in coming soon section
- Listed planned features: PDF upload, RAG search, AI chat
- Structure ready for future PDF integration
@GraphSaf
GraphSaf force-pushed the claude/radiation-dose-reporting-app-RM8Cf branch from 2307048 to 3e0bcfe Compare January 23, 2026 16:07
claude added 26 commits January 24, 2026 10:19
Replace placeholder models with actual Blender GLB exports:
- Load teeth_upper.glb and teeth_lower.glb from S3
- Load xray_sensor.glb and xray_tubus.glb from S3
- Remove old procedural geometry (XRayMachine, FilmSensor)

Add real-time positioning editor:
- Show coordinate axes for each object
- Display position and rotation info labels
- Add control panel with X/Y/Z inputs for each model
- Add rotation angle controls (degrees)
- Toggle axes visibility
- All values editable in real-time

Features:
- Axes helpers with size proportional to object
- ObjectInfo labels showing position and rotation
- Collapsible settings panel with position/rotation inputs
- Separate controls for Teeth, Sensor, and Tubus
- Background and rotation controls preserved
Add realistic X-ray simulation lighting:
- SpotLight from tubus position to sensor with sharp shadows
- Adjustable intensity and angle controls
- Shadow mapping 2048x2048 for crisp shadows
- Teeth cast shadows, sensor receives them
- Green tint (#E5FFE5) for X-ray effect

Add rotating placeholder:
- Wireframe cube with rotation animation
- Shows while models are loading
- Green emissive material matching X-ray theme

Controls added:
- X-ray light intensity slider
- Beam angle adjustment (degrees)
- Real-time shadow updates
Major UI/UX redesign:
- Click on 3D model to select it
- Settings panel moved outside Canvas (always visible)
- Show settings only for selected object
- Green "ВЫБРАНО" label above selected model

Full 3-axis controls:
- Position X, Y, Z for all objects
- Rotation X, Y, Z for all objects (in radians)
- Separate controls for each model:
  - Teeth Upper
  - Teeth Lower
  - Sensor
  - Tubus
  - X-Ray Light (intensity & angle)

Removed:
- Old arrow rotation buttons (← →)
- Collapsible settings panel
- Single-axis rotation
- ObjectInfo labels

New layout:
- 3D viewer on left (flex-1)
- Settings panel on right (w-80)
- Object selector buttons
- Compact controls
Changes:
- Light now has independent position and rotation controls
- Added axes visualization for light source
- Light settings: position X/Y/Z, rotation X/Y/Z, intensity, angle
- Updated default positions from user adjustments:
  - Teeth Upper: pos [0, 0.9, 0], rot [-0.30, 0, 0]
  - Sensor: pos [0, 1.4, 0.1]
  - Tubus: pos [0, 1, 1.3]
  - Light: pos [0, 1, 1.3] (initially same as tubus)
- Improved shadow quality: 4096x4096 shadow map
- Light auto-targets sensor position

These default positions are now considered "zero" reference points.
Major changes:
- Upper teeth: now fixed (removed from settings)
- Lower teeth: only X rotation with pivot shifted to rear teeth (-1.2 Z)
- Sensor: only Z rotation with custom pivot (Y -0.4, Z 1)
- Light + Tubus: combined controls with distance adjustment
- Added "Link all to sensor" checkbox for unified movement

Updated defaults from user settings:
- Light: pos [0, -61, 6.8], rot X -8.50, intensity 220, angle 9°

UI improvements:
- Removed emoji icons, using text labels
- Black background for 3D viewer
- Simplified object selector (only 3 buttons)
- Cleaner settings panel with grouped controls
Major changes:
- Restored white background (was accidentally set to black)
- Moved all controls (camera reset, background, axes) to right panel
- Sensor: full control restored (position X,Y,Z + rotation X,Y,Z)
- Sensor: rotation center now inside sensor itself (no pivot offset)
- Replaced GLB tubus model with procedural geometry

Procedural Tubus features:
- Gray hollow cylinder around light source
- Direction vector visualization (arrow)
- Light cone outline (wireframe)
- All visualizations in gray

UI improvements:
- Cleaner 3D viewport (no floating controls)
- All settings in right panel
- Better organized controls section
- Text labels for background buttons
- Add coordinate display showing all pivot/object positions
- Fix mobile responsiveness (explicit height for 3D canvas)
- Fix TypeScript error in material handling
- Remove all emojis from documentation and UI
- Update README with dental simulator features
- Update MODELS_README with current project state
- Clean up EquipmentGuidePage (remove emojis)

All objects now support independent pivot and object transforms.
Build tested and passing.
- Restore lg:flex-row for desktop layout
- Canvas uses flex-1 on desktop, 400px on mobile
- Fixes broken visualization page layout
- Change lg:h-auto to lg:h-full for proper height in fixed-height container
- Fixes canvas rendering issue on production
- S3 bucket returns 403 Forbidden (public access not configured)
- Replace model loading with simple wireframe boxes as placeholders
- Add warning message about temporary placeholders
- Each model has unique color for identification
- Ready to restore real models once S3 access is configured
- Reduces bundle size from 2274KB to 2200KB
- Instructions for configuring public access on Beget S3
- Bucket policy and CORS examples
- Steps to restore real models after S3 is configured
- Alternative solution with local storage
- Change from path-style to bucket-style URL
- Old: https://s3.ru1.storage.beget.cloud/0f31e7f56d88-xrayhub/
- New: https://0f31e7f56d88-xrayhub.s3.ru1.storage.beget.cloud/
- Restore UniversalModel with real 3D model loading
- Remove placeholder geometry and warning message
- Add try-catch to UniversalModel component
- Show red wireframe cube if model fails to load
- Add info panel showing S3 URL and troubleshooting hint
- Console.error for debugging model load failures
- Helps diagnose CORS or S3 access issues
- Step-by-step diagnostics for common issues
- CORS and 403 error solutions
- Visual indicators (red/green cubes)
- Local testing instructions
- Quick S3 accessibility checks
- File ms_upper.glb was causing load error
- Try more logical naming: gums_upper.glb
- Matches naming pattern with gums_lower.glb
- Add sliders for light intensity, angle, distance, penumbra, decay
- Remove cone visualization, keep only direction vector (red arrow)
- Disable tongue model (132B file is broken/empty)
- Update spotLight to use new distance/penumbra/decay parameters
- Increase arrow length for better visibility
- Add lightPivotPos, lightPivotRot, lightObjPos, lightObjRot states
- Use nested group hierarchy: Pivot -> Object -> spotLight
- Update UI with color-coded controls (blue=pivot, green=object)
- Show light coordinates in P/O format like other objects
- Add axes helper at pivot center
- Now light has same transform system as all other objects
- Apply sensor coordinates: P[0,0,0.9], O[0,0.4,-3.3], R[-0.82,0,0]
- Apply teeth_lower coordinates: P[0,0,0], O[0,-0.8,-0.2], R[0.2,0,0]
- Remove arrowHelper from light visualization
- Add translucent yellow sphere indicator for light source position
- Clean up LightVisualization component
- Update component description
- Light pivot position: [0.00, 0.00, 0.00]
- Light object position: [0.00, -0.20, 5.50]
- Reorder axes helper in light group structure
- Lower gums: P[0,0,0], O[0,-0.9,-0.3], R[0.34,0,0]
- Throat: P[0,0,0], O[0,-0.6,-0.1], R[0.3,0,0]
- Fix light object position: O[0,0,5.5] (along Z axis)
- Link sensor and light into unified system (light as child of sensor)
- Add bisectrix technique toggle with adjustable angle
- Update light target to point at sensor object position
- Add UI controls for bisectrix technique in light settings
- Set showSoftTissues to false by default
- Fix upper gums rotation: R[-0.10, 0, 0]
- Light object position already correct: O[0, 0, 5.5]
- Remove double nesting that was hiding other objects
- Sensor uses normal UniversalModel structure
- Light shares sensor pivot (linked rotation)
- Light has independent object position (separate movement)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants