feat(#44): Agregar relación entre análisis y tipos de muestra #45

Merged
luis_portillo merged 9 commits from feature/44-test-sample-relationship into dev 2025-07-15 04:16:03 +00:00

9 Commits

Author SHA1 Message Date
Luis Ernesto Portillo Zaldivar
f833595e4c feat(#44): Add verification script and complete documentation
- Created verify_sample_relationships.py script to validate implementation
- Updated ISSUE44_PLAN.md marking completed tasks
- Created ISSUE44_IMPLEMENTATION.md with complete summary
- Script verifies:
  - Analyses have sample type assignments
  - Sample types are properly configured
  - Stock.lot samples use new fields correctly
  - Field synchronization works properly

All tasks for Issue #44 completed successfully.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-14 21:09:34 -06:00
Luis Ernesto Portillo Zaldivar
d41f5eed5c feat(#44): Update demo data with test-sample relationships
- Added required_sample_type_id and sample_volume_ml to all demo analyses
- Updated demo samples to use new sample_type_product_id field
- Added demo_patient_3 for complete demo data
- Mapped analyses to appropriate sample types:
  - Hemograma → EDTA tube (3ml)
  - Perfil Lipídico → Serum tube (2ml)
  - Glucosa → Glucose tube (1ml)
  - Urocultivo → Urine container (20ml)
  - TP → Citrate tube (2.7ml)
  - Hemocultivo → Blood culture bottle (10ml)
  - Coprocultivo → Stool container (5ml)

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-14 21:06:45 -06:00
Luis Ernesto Portillo Zaldivar
40b5dabda7 feat(#44): Create initial sample types data
- Created sample_types.xml with 10 common laboratory sample containers
- Added product category for sample containers
- Defined sample types: serum, EDTA, citrate, heparin, glucose, urine, stool, swab, blood culture, CSF
- All sample types marked as consumable products with purchase_ok=True, sale_ok=False
- Added sample_types.xml to module manifest

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-14 20:58:14 -06:00
Luis Ernesto Portillo Zaldivar
59db50b907 feat(#44): Update stock lot views to include sample type product field
- Added sample_type_product_id to list view
- Added sample_type_product_id to form view with proper readonly states
- Made container_type optional in list view and invisible when product is selected
- Both fields synchronized through model's @api.onchange method

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-14 20:54:19 -06:00
Luis Ernesto Portillo Zaldivar
ec4795c4de docs: Add mandatory testing rule to CLAUDE.md
- Added critical rule requiring ephemeral instance testing after every task
- Specified exact commands to run for testing
- Emphasized checking logs for errors before proceeding

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-14 20:50:52 -06:00
Luis Ernesto Portillo Zaldivar
4632a95d83 feat(#44): Update product views to include sample type relationships
- Added required_sample_type_id and sample_volume_ml fields to analysis configuration page
- Created list view for analysis products showing sample type relationship
- Created list view for sample type products
- Added is_sample_type field to product form view
- Made sample_volume_ml visible only when sample type is selected

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-14 20:47:50 -06:00
Luis Ernesto Portillo Zaldivar
d240ba5de1 feat(#44): Add sample_type_product_id field to StockLot model
- Added sample_type_product_id Many2one field to reference sample type products
- Kept container_type field for backward compatibility (marked as legacy)
- Added @api.onchange method to synchronize fields
- Added get_container_name() method to retrieve container name from either field

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-14 20:44:43 -06:00
Luis Ernesto Portillo Zaldivar
dde56b907e feat(#44): Add required_sample_type_id field to ProductTemplate model
- Added required_sample_type_id Many2one field to link analyses with sample types
- Added sample_volume_ml field to specify required sample volume
- Added validation constraints to ensure fields are only used for analysis products
- Import api and ValidationError for field validations

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-14 20:35:41 -06:00
Luis Ernesto Portillo Zaldivar
88d3ded083 docs: Add ISSUE44_PLAN.md for test-sample relationship implementation
- Created detailed implementation plan for adding relationship between analyses and sample types
- Includes tasks for model updates, view modifications, data migration, and demo data
- Addresses compatibility concerns and preparation for automatic sample generation (Issue #32)

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-14 20:28:40 -06:00