Validation | SD |
---|
patient_id - is sent
- validate patient_id is UUID
- validate patient exists in DB
- validate patient is active and is_active=true
|
|
id. Validate - is sent
- validate id is UUID
- validate that $.{collection}[*].id from the payload are all unique among themselves
- validate there is no entity with such id in the corresponding Medical events collection
|
|
based_on. Validate - as reference to medication_request
|
|
status. Validate - is sent
- by dictionary
|
|
medication_code. Validate - is sent
- as codeable_concept
- by dictionary "eHealth/medication_statement_medications"
|
|
context. Validate - is sent
- validate context is reference to encounter
- validate context is reference to the encounter in the same payload or existing encounter in DB
- validate encounter is made for the same patient_id
- validate encounter.managing_organization = client_id from token
- validate encounter is not in status 'entered_in_error'
|
|
effective_period. Validate as string(maxLength: 2000)
|
|
asserted_date. Validate - is sent
- as real date_time
|
|
primary_source. Validate - validate primary_source is boolean
- validate primary_source is sent
|
|
asserter. Validate - is reference to employee
- employee is active and is_active=true
- employee.legal_entity_id belong to MEDICATION_REQUEST_REQUEST_LEGAL_ENTITY_TYPES
- asserter is sent if primary_source=true
|
|
report_origin. Validate - validate report_origin is a codable concept
- validate report_origin is sent if primary_source=false
|
|
note. Validate - as string(maxLength: 2000)
|
|
dosage. Validate - as string(maxLength: 2000)
|
|