417 Commits

Author SHA1 Message Date
c49743bbf3 fix: expand patient check matching and stabilize tests\n\n- allow hyphens and dots in patient identifiers\n- support email and phone lookups in patient existence checks\n- update OpenAPI docs and feature tests for the new request contract\n- load .env during PHPUnit bootstrap so the test database config is available 2026-04-13 11:25:41 +07:00
c743049ed1 fix(testmap): align detail patch operation keys with API docs 2026-04-09 15:32:16 +07:00
7e38622070 remove serena on readme.md 2026-04-09 10:10:04 +07:00
99d5117bd9 fix(testmap): support flexible detail patch payloads and align patch route coverage 2026-04-09 09:02:50 +07:00
84cfff2201 todo : fixing testmap detail 2026-04-08 16:54:32 +07:00
OpenCode Bot
9946978487 chore: refresh CLQMS backend baseline
Re-synced controllers, configs, libraries, seeds, and docs with the latest API expectations and response helpers.
2026-04-08 16:07:19 +07:00
02a6a1f883 test: align account patch status expectation with update semantics
PATCH requests in this API now follow update semantics and return 200 instead of 201. Update the feature test assertion so it validates the standardized behavior and avoids false failures.
2026-04-08 04:18:16 +07:00
61ec0cbb8a fix: harden token handling and normalize ADT/result payload mapping
Ensure auth accepts cookie or bearer tokens while aligning ADT and result create/update flows with expected IDs and persisted fields.
2026-04-08 08:54:18 +07:00
84c81fe9c5 fix: standardize patch updates 2026-04-08 08:37:41 +07:00
945ea6d183 fix: allow patch routes for partial updates 2026-04-08 06:54:50 +07:00
c5c958b58e fix: support partial PATCH updates across controllers and PatVisit
Allow update endpoints to validate only provided fields, avoid overwriting unchanged data, and preserve existing PatDiag when omitted from PatVisit PATCH payloads.
2026-04-06 15:38:30 +07:00
e99a60fe93 feat: support partial patient patch updates
Implement true PATCH behavior so omitted fields stay unchanged, while null can explicitly clear nullable nested data. Align patient update tests and OpenAPI schemas/responses with the new 200/400/404 contract.
2026-04-06 14:21:46 +07:00
ae56e34885 fix: remove embedded testmap data from test testsite payloads
Keep test definition responses focused on core fields and update test-map OpenAPI contracts/tests to match the new mapping flow.
2026-04-06 11:24:58 +07:00
694c5a6211 fix: wrap test group members under testdefgrp
Align CALC/GROUP request and response payloads to use the testdefgrp.members structure in controller handling, feature tests, and OpenAPI schemas/examples for a consistent API contract.
2026-04-02 09:06:42 +07:00
eeaed768c9 fix: align test members payload with top-level API contract 2026-04-02 04:52:50 +07:00
399f4d615b feat: support flat test mapping payloads and align patient identifier validation 2026-04-01 20:28:12 +07:00
8aefeaca01 fix: preserve nullable test metadata and day-based age ranges
Avoid coercing missing SiteID, Decimal, and age boundaries to hardcoded defaults so payload intent is retained across test creation and reference range inserts. Align patient result age checks and OpenAPI examples with day-based age bounds, with feature coverage for create variants.
2026-04-01 13:28:44 +07:00
366572a0cb fix: preserve numeric ref range metadata 2026-03-26 14:48:49 +07:00
a73b88bc05 feat: add audit log query endpoint 2026-03-25 16:52:11 +07:00
51fa8c1949 fix: allow toggling test isRequestable flag 2026-03-25 15:42:52 +07:00
76c528564c fix: simplify test detail retrieval and clean tracked index artifacts
Use the base test row's RefType and ResultType to decide refnum/reftxt loading, and fetch discipline/department joins directly in getTestById to avoid redundant relation queries. Add feature coverage for show response behavior and include the related workspace cleanup changes so the branch state is consistent.
2026-03-25 14:06:00 +07:00
76ea22d841 refactor: standardize boolean field naming across API domains
Rename legacy boolean helpers to is* naming across test definitions, patient models, and infrastructure data to match rest of backend.

Update controllers, models, migrations, seeders, tests, and OpenAPI docs/bundled spec so contracts and runtime align.
2026-03-25 11:37:17 +07:00
7600989bed feat: expand audit logging service and docs 2026-03-25 10:41:22 +07:00
6ece30302f feat: update calc endpoints and rule docs 2026-03-17 16:50:57 +07:00
4bb5496073 feat: add two-argument result_set syntax for targeting tests by code
- result_set('CODE', value) now supported alongside legacy result_set(value)
- RuleEngineService: add resolveTestSiteIdByCode() helper
- RuleExpressionService: add splitTopLevel() and unquoteStringArgument() helpers
- Update docs/test-rule-engine.md with new syntax examples
- Delete completed issue from issues.md
2026-03-16 16:39:54 +07:00
aaadd593dd feat: require id params for update endpoints 2026-03-16 15:58:56 +07:00
root
2bcdf09b55 chore: repo-wide normalization + rules test coverage
Normalize formatting/line endings across configs, controllers, models, tests, and OpenAPI specs.

Update rule expression/rule engine implementation and remove obsolete RuleAction controller/model.

Add unit tests for rule expression syntax and multi-action behavior, and include docs updates.
2026-03-16 07:24:50 +07:00
c01786bb93 feat: add calc endpoint and rule engine compilation 2026-03-12 16:55:03 +07:00
88be3f3809 feat: add rules engine API and order-created hook
- Add /api/rules CRUD, nested actions, and expr validation

- Add rules migration, models, and RuleEngine/Expression services

- Run ORDER_CREATED rules after order create (non-blocking) and refresh tests

- Update OpenAPI tags/schemas/paths and bundled docs
2026-03-12 06:34:56 +07:00
911846592f feat: add calculator API support for test formulas and update docs 2026-03-11 16:45:16 +07:00
ad8e1cc977 Update site controller, organization & test models, migrations, and API docs 2026-03-10 16:40:37 +07:00
011a2456c2 Cleanup: Remove obsolete docs, opencode configs, and openspec files; update test models and API docs 2026-03-09 16:49:03 +07:00
282c642da6 feat: add OpenSpec workflow, Serena integration, User API, and Specimen delete endpoint
- Add OpenSpec experimental workflow with commands (opsx-apply, opsx-archive, opsx-explore, opsx-propose)
- Add Serena memory system for project context
- Implement User API (UserController, UserModel, routes)
- Add Specimen delete endpoint
- Update Test definitions and Routes
- Sync API documentation (OpenAPI)
- Archive completed 2026-03-08-backend-specs change
2026-03-09 07:00:12 +07:00
85c7e96405 feat: implement comprehensive result management and lab reporting system
- Add full CRUD operations for results (index, show, update, delete)
- Implement result validation with reference range checking (L/H flags)
- Add cumulative patient results retrieval across all orders
- Create ReportController for HTML lab report generation
- Add lab report view with patient info, order details, and test results
- Implement soft delete for results with transaction safety
- Update API routes with /api/results/* endpoints for CRUD
- Add /api/reports/{orderID} endpoint for report viewing
- Update OpenAPI docs with results and reports schemas/paths
- Add documentation for manual result entry and MVP plan
2026-03-04 16:48:12 +07:00
42006e1af9 feat: implement comprehensive order management with specimens and tests
Major updates to order system:
- Add specimen and test data to order responses (index, show, create, update, status update)
- Implement getOrderSpecimens() and getOrderTests() private methods in OrderTestController
- Support 'include=details' query parameter for expanded order data
- Update OrderTestModel with enhanced query capabilities and transaction handling

API documentation:
- Update OpenAPI specs for orders, patient-visits, and tests
- Add new schemas for order specimens and tests
- Regenerate bundled API documentation

Database:
- Add Requestable field to TestDefSite migration
- Create OrderSeeder and ClearOrderDataSeeder for test data
- Update DBSeeder to include order seeding

Patient visits:
- Add filtering by PatientID, PatientName, and date ranges
- Include LastLocation in visit queries

Testing:
- Add OrderCreateTest with comprehensive test coverage

Documentation:
- Update AGENTS.md with improved controller structure examples
2026-03-03 13:51:27 +07:00
e9c7beeb2b feat: update test management APIs and reference range models 2026-03-03 06:03:27 +07:00
49d3a69308 refactor: move TestsController to Test namespace and update routes
- Move TestsController from App\Controllers to App\Controllers\Test namespace

- Update routes from 'api/tests' to 'api/test' group

- Clean up empty lines in Routes.php

- Improve code formatting and indentation in TestsController
2026-03-02 07:02:51 +07:00
24e0293824 feat: add HostApp and CodingSys management APIs with CRUD operations 2026-02-27 16:31:55 +07:00
5e0a7f21f5 feat: add TestMapDetail controller, model and migration for test site mapping
- Add TestMapDetailController for managing test mapping details
- Create TestMapDetailModel with CRUD operations
- Add migration for TestSiteID column in testmap table
- Update TestMapController and TestMapModel
- Update routes, seeder and PatVisitModel
- Regenerate API documentation bundle
2026-02-26 16:48:10 +07:00
d3668fe2b3 feat: add equipment list management API with CRUD operations 2026-02-24 16:53:36 +07:00
3a30629e15 feat: add urine workstations and test specimen mappings to seeders 2026-02-24 06:11:18 +07:00
707d548db0 feat: implement test mapping functionality with TestMapController and model
- Add TestMapController for managing test-to-analyzer mappings
- Create TestMapModel with database operations for test mappings
- Update TestsController to support test mapping operations
- Add testmap API routes to Routes.php
- Create migration updates for test definitions table
- Add OpenAPI specification for test mapping endpoints
- Include unit tests for TestDef models
- Update bundled API documentation
2026-02-23 16:49:39 +07:00
98008d3172 docs: regenerate bundled OpenAPI spec 2026-02-23 13:16:06 +07:00
d5f1d9fc84 feat: update /api/valueset to return {value, label, count} format 2026-02-23 13:14:03 +07:00
5272efa7b9 reorganize database migrations with corrected numbering 2026-02-23 05:11:23 +07:00
d173098652 feat: implement audit logging and test management enhancements
Major Features:
- Add comprehensive audit logging system with AuditService
- Create AuditLogs database migration for tracking changes
- Implement TestValidationService for test data validation
- Add FRONTEND_TEST_MANAGEMENT_PROMPT.md documentation

Controllers:
- Update TestsController with improved test management

Models:
- Enhance PatientModel with additional functionality
- Update TestDefSiteModel for better site management

Database:
- Add CreateAuditLogs migration (2026-02-20-000011)
- Update TestSeeder with new test data

Services:
- Add AuditService for comprehensive audit trail logging

Documentation:
- Update AGENTS.md with improved guidelines
- Update audit-logging-plan.md with implementation details
- Add FRONTEND_TEST_MANAGEMENT_PROMPT.md for frontend guidance

API Documentation:
- Update api-docs.bundled.yaml
- Update tests.yaml schema definitions
- Update tests.yaml paths

Testing:
- Enhance TestsControllerTest with new test cases
- Update TestDefModelsTest for model coverage
2026-02-20 13:47:47 +07:00
b896c0aaf8 fix reftype 2026-02-19 15:28:04 +07:00
6be44e9421 add new reftype noref 2026-02-19 13:35:57 +07:00
2af95945a3 fix areageoseeder 2026-02-19 13:31:13 +07:00
5bfd71e7d7 fix areageoseeder to use env 2026-02-19 13:27:08 +07:00