nunique | $.id not unique | 422 | + |
| Managing organization is not a legal_entity | $.managing_organization.identifier.type.coding.[0].code != "legal_entity" | 422 | + |
| Attempt to create episode for another legal_entity | $.managing_organization.identifier.value != token.client_id | 422 | + |
| Start date is not in future | $.period.start !<= current_date | 422 | + |
| End date is present in not request | end_date |
| + |
| Care_manager is not an employee | $.care_manager.identifier.type.coding.[0].code != "employee" | 422 | + |
| Care_manager is not a DOCTOR | PRM.employee.type != "DOCTOR" | 409 | + |
| Care_manager is not active | PRM.employee.status!= "active" | 409 | + |
| Care_manager is not from the same legal_entity | PRM.employee.legal_entity! = token.client_id | 409 | 404 |