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
166 lines
3.6 KiB
YAML
166 lines
3.6 KiB
YAML
OrderTest:
|
|
type: object
|
|
properties:
|
|
InternalOID:
|
|
type: integer
|
|
description: Internal order ID
|
|
OrderID:
|
|
type: string
|
|
description: Order ID (e.g., 0025030300001)
|
|
PlacerID:
|
|
type: string
|
|
nullable: true
|
|
InternalPID:
|
|
type: integer
|
|
description: Patient internal ID
|
|
SiteID:
|
|
type: integer
|
|
PVADTID:
|
|
type: integer
|
|
description: Visit ADT ID
|
|
ReqApp:
|
|
type: string
|
|
nullable: true
|
|
Priority:
|
|
type: string
|
|
enum: [R, S, U]
|
|
description: |
|
|
R: Routine
|
|
S: Stat
|
|
U: Urgent
|
|
PriorityLabel:
|
|
type: string
|
|
description: Priority display text
|
|
TrnDate:
|
|
type: string
|
|
format: date-time
|
|
description: Transaction/Order date
|
|
EffDate:
|
|
type: string
|
|
format: date-time
|
|
description: Effective date
|
|
CreateDate:
|
|
type: string
|
|
format: date-time
|
|
OrderStatus:
|
|
type: string
|
|
enum: [ORD, SCH, ANA, VER, REV, REP]
|
|
description: |
|
|
ORD: Ordered
|
|
SCH: Scheduled
|
|
ANA: Analysis
|
|
VER: Verified
|
|
REV: Reviewed
|
|
REP: Reported
|
|
OrderStatusLabel:
|
|
type: string
|
|
description: Order status display text
|
|
Specimens:
|
|
type: array
|
|
items:
|
|
$ref: '#/OrderSpecimen'
|
|
description: Associated specimens for this order
|
|
Tests:
|
|
type: array
|
|
items:
|
|
$ref: '#/OrderTestItem'
|
|
description: Test results (patres) for this order
|
|
|
|
OrderSpecimen:
|
|
type: object
|
|
properties:
|
|
InternalSID:
|
|
type: integer
|
|
description: Internal specimen ID
|
|
SID:
|
|
type: string
|
|
description: Specimen ID (e.g., 0025030300001-S01)
|
|
SiteID:
|
|
type: integer
|
|
OrderID:
|
|
type: integer
|
|
description: Reference to internal order ID
|
|
ConDefID:
|
|
type: integer
|
|
description: Container Definition ID
|
|
nullable: true
|
|
ConCode:
|
|
type: string
|
|
description: Container code
|
|
nullable: true
|
|
ConName:
|
|
type: string
|
|
description: Container name
|
|
nullable: true
|
|
Qty:
|
|
type: integer
|
|
description: Quantity
|
|
Unit:
|
|
type: string
|
|
description: Unit of measurement
|
|
Status:
|
|
type: string
|
|
enum: [PENDING, COLLECTED, RECEIVED, PREPARED, REJECTED]
|
|
description: Current specimen status
|
|
GenerateBy:
|
|
type: string
|
|
description: Source that generated this specimen
|
|
CreateDate:
|
|
type: string
|
|
format: date-time
|
|
|
|
OrderTestItem:
|
|
type: object
|
|
properties:
|
|
ResultID:
|
|
type: integer
|
|
description: Unique result ID
|
|
OrderID:
|
|
type: integer
|
|
description: Reference to internal order ID
|
|
InternalSID:
|
|
type: integer
|
|
description: Reference to specimen
|
|
nullable: true
|
|
TestSiteID:
|
|
type: integer
|
|
description: Test definition site ID
|
|
TestSiteCode:
|
|
type: string
|
|
description: Test code
|
|
TestSiteName:
|
|
type: string
|
|
description: Test name
|
|
nullable: true
|
|
SID:
|
|
type: string
|
|
description: Order ID reference
|
|
SampleID:
|
|
type: string
|
|
description: Sample ID (same as OrderID)
|
|
Result:
|
|
type: string
|
|
description: Test result value
|
|
nullable: true
|
|
ResultDateTime:
|
|
type: string
|
|
format: date-time
|
|
description: Result timestamp
|
|
CreateDate:
|
|
type: string
|
|
format: date-time
|
|
|
|
OrderItem:
|
|
type: object
|
|
properties:
|
|
id:
|
|
type: integer
|
|
OrderID:
|
|
type: string
|
|
TestID:
|
|
type: integer
|
|
SpecimenID:
|
|
type: string
|
|
Status:
|
|
type: string
|