Purpose
This WS gives the opportunity to update external identifier and other fields of an unidentified person in eHealth, except the note fieldMethod enables to modify all the preperson fields except note and status.
Specification
Page Properties |
---|
|
Link | https://ehealthmisapi1.docs.apiary.io/#reference/public.-medical-service-provider-integration-layer/preperson/update-preperson | Посилання на Apiary або Swagger | Resource | /api/prepersons/{{id}} | Посилання на ресурс, наприклад: /api/persons/create | Scope | preperson:write | Scope для доступу | Components | Patient registry | Зазначається перелік бізнес компонентів, які використовують цей метод, наприклад: ePrescription | Microservices | API paragraph not found | mpi/api il/api (rpc) fe/admin-web | Перелік мікросервісів, які використовує метод API, наприклад: Auth, ABAC | Protocol type | REST | Тип протоколу, який використовується запитом, наприклад: SOAP | REST | Request type | PATCH | Тип запиту API, наприклад: GET, POST, PATCH… | Sync/Async | Sync | Метод є синхронним чи асинхронним? | Public/Private/Internal | Public | Потрібно зазначити тип методу за ступенем доступності |
|
Logic
Only authenticated and authorized SPECIALIST, ASSISTANT, RECEPTIONIST employees can update external_id of preperson.
Preperson can be updated only in OUTPATIENT or EMERGENCY legal entity type, if identifier of preperson is being known (returns after Create preperson).
Only note and status fields can not be updated.
Update allowed for prepersons with status = active.
...
Expand |
---|
|
Code Block |
---|
{
"external_id": "#1234-FDS-ab",
"first_name": "Петро",
"last_name": "Іванов",
"second_name": "Миколайович",
"gender": "MALE",
"birth_date": "1980-01-01",
"emergency_contact": {
"first_name": "Петро",
"last_name": "Іванов",
"second_name": "Миколайович",
"phones": [
{
"type": "MOBILE",
"number": "+380503410870"
}
]
},
"death_date": "2018-11-11",
"note": "Registered in SmartMed clinic at 01.01.2019 16:40. Male, 40 years old approximately, tatoo with sport motorcycle on the right forearm"
} |
|
Dictionaries
Authorize
Verify the validity of access token
Return 401 in case validation fails
Check user scopes in order to perform this action (scope = 'preperson:write')
Return 403 in case invalid scope(s)
...
Content-Type:application/json
Authorization:Bearer c2778f3064753ea70de870a53795f5c9api{{access_token}}
Api-key:uXhEczJ56adsfh3Ri9SUkc4en{{secret}}
Request data validation
Validate legal entity
...
Expand |
---|
|
Code Block |
---|
{
"meta": {
"code": 200,
"url": "https://example.com/resource",
"type": "object",
"request_id": "6617aeec-15e2-4d6f-b9bd-53559c358f97#17810"
},
"data": {
"id": "7c3da506-804d-4550-8993-bf17f9ee0402",
"external_id": "#1234-FDS-aa",
"first_name": "Петро",
"last_name": "Іванов",
"second_name": "Миколайович",
"gender": "MALE",
"birth_date": "1980-01-01",
"emergency_contact": {
"first_name": "Петро",
"last_name": "Іванов",
"second_name": "Миколайович",
"phones": [
{
"type": "MOBILE",
"number": "+380503410870"
}
]
},
"note": "Registered in SmartMed clinic at 01.01.2019 16:40. Male, 40 years old approximately, tatoo with sport motorcycle on the right forearm",
"status": "ACTIVE",
"death_date": "2018-11-11",
"inserted_at": "2017-04-20T19:14:13Z",
"inserted_by": "e1453f4c-1077-4e85-8c98-c13ffca0063e",
"updated_at": "2017-04-20T19:14:13Z",
"updated_by": "2922a240-63db-404e-b730-09222bfeb2dd"
}
} |
|
Post-processing processes
...
HTTP status codes
Page Properties |
---|
|
HTTP status code | Message | What caused the error |
---|
200 | Response | | 401 | | Access token validation failed | 403 | | Invalid scope(s) | 404 | | Validation failed | 409 | Legal entity must be ACTIVE | Validation failed | 422 | Preperson is not active Schema validation failed Birth date can't be in the future Death date can not be in future Death date should equal or greater than birth_date | Validation failed |
|