{"action":"closed","issue":{"url":"https://api.github.com/repos/edenlabllc/ehealth.api/issues/2473","repository_url":"https://api.github.com/repos/edenlabllc/ehealth.api","labels_url":"https://api.github.com/repos/edenlabllc/ehealth.api/issues/2473/labels{/name}","comments_url":"https://api.github.com/repos/edenlabllc/ehealth.api/issues/2473/comments","events_url":"https://api.github.com/repos/edenlabllc/ehealth.api/issues/2473/events","html_url":"https://github.com/edenlabllc/ehealth.api/issues/2473","id":333147513,"node_id":"MDU6SXNzdWUzMzMxNDc1MTM=","number":2473,"title":"Change end date for declaration with family doctor","user":{"login":"svetavedmed","id":30794602,"node_id":"MDQ6VXNlcjMwNzk0NjAy","avatar_url":"https://avatars2.githubusercontent.com/u/30794602?v=4","gravatar_id":"","url":"https://api.github.com/users/svetavedmed","html_url":"https://github.com/svetavedmed","followers_url":"https://api.github.com/users/svetavedmed/followers","following_url":"https://api.github.com/users/svetavedmed/following{/other_user}","gists_url":"https://api.github.com/users/svetavedmed/gists{/gist_id}","starred_url":"https://api.github.com/users/svetavedmed/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/svetavedmed/subscriptions","organizations_url":"https://api.github.com/users/svetavedmed/orgs","repos_url":"https://api.github.com/users/svetavedmed/repos","events_url":"https://api.github.com/users/svetavedmed/events{/privacy}","received_events_url":"https://api.github.com/users/svetavedmed/received_events","type":"User","site_admin":false},"labels":[{"id":593171628,"node_id":"MDU6TGFiZWw1OTMxNzE2Mjg=","url":"https://api.github.com/repos/edenlabllc/ehealth.api/labels/epic/declaration","name":"epic/declaration","color":"fbca04","default":false},{"id":631308755,"node_id":"MDU6TGFiZWw2MzEzMDg3NTU=","url":"https://api.github.com/repos/edenlabllc/ehealth.api/labels/kind/change_request","name":"kind/change_request","color":"d4c5f9","default":false},{"id":593765968,"node_id":"MDU6TGFiZWw1OTM3NjU5Njg=","url":"https://api.github.com/repos/edenlabllc/ehealth.api/labels/status/test","name":"status/test","color":"fef2c0","default":false}],"state":"closed","locked":false,"assignee":{"login":"marinakr","id":8307760,"node_id":"MDQ6VXNlcjgzMDc3NjA=","avatar_url":"https://avatars3.githubusercontent.com/u/8307760?v=4","gravatar_id":"","url":"https://api.github.com/users/marinakr","html_url":"https://github.com/marinakr","followers_url":"https://api.github.com/users/marinakr/followers","following_url":"https://api.github.com/users/marinakr/following{/other_user}","gists_url":"https://api.github.com/users/marinakr/gists{/gist_id}","starred_url":"https://api.github.com/users/marinakr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marinakr/subscriptions","organizations_url":"https://api.github.com/users/marinakr/orgs","repos_url":"https://api.github.com/users/marinakr/repos","events_url":"https://api.github.com/users/marinakr/events{/privacy}","received_events_url":"https://api.github.com/users/marinakr/received_events","type":"User","site_admin":false},"assignees":[{"login":"marinakr","id":8307760,"node_id":"MDQ6VXNlcjgzMDc3NjA=","avatar_url":"https://avatars3.githubusercontent.com/u/8307760?v=4","gravatar_id":"","url":"https://api.github.com/users/marinakr","html_url":"https://github.com/marinakr","followers_url":"https://api.github.com/users/marinakr/followers","following_url":"https://api.github.com/users/marinakr/following{/other_user}","gists_url":"https://api.github.com/users/marinakr/gists{/gist_id}","starred_url":"https://api.github.com/users/marinakr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marinakr/subscriptions","organizations_url":"https://api.github.com/users/marinakr/orgs","repos_url":"https://api.github.com/users/marinakr/repos","events_url":"https://api.github.com/users/marinakr/events{/privacy}","received_events_url":"https://api.github.com/users/marinakr/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/edenlabllc/ehealth.api/milestones/28","html_url":"https://github.com/edenlabllc/ehealth.api/milestone/28","labels_url":"https://api.github.com/repos/edenlabllc/ehealth.api/milestones/28/labels","id":3448886,"node_id":"MDk6TWlsZXN0b25lMzQ0ODg4Ng==","number":28,"title":"Sprint 26 (Jun3-Jul1)","description":"","creator":{"login":"lymychp","id":5257001,"node_id":"MDQ6VXNlcjUyNTcwMDE=","avatar_url":"https://avatars2.githubusercontent.com/u/5257001?v=4","gravatar_id":"","url":"https://api.github.com/users/lymychp","html_url":"https://github.com/lymychp","followers_url":"https://api.github.com/users/lymychp/followers","following_url":"https://api.github.com/users/lymychp/following{/other_user}","gists_url":"https://api.github.com/users/lymychp/gists{/gist_id}","starred_url":"https://api.github.com/users/lymychp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lymychp/subscriptions","organizations_url":"https://api.github.com/users/lymychp/orgs","repos_url":"https://api.github.com/users/lymychp/repos","events_url":"https://api.github.com/users/lymychp/events{/privacy}","received_events_url":"https://api.github.com/users/lymychp/received_events","type":"User","site_admin":false},"open_issues":32,"closed_issues":2,"state":"open","created_at":"2018-06-25T08:51:34Z","updated_at":"2018-06-25T13:55:59Z","due_on":"2018-06-27T07:00:00Z","closed_at":null},"comments":0,"created_at":"2018-06-18T06:32:09Z","updated_at":"2018-06-25T13:55:59Z","closed_at":"2018-06-25T13:55:59Z","author_association":"CONTRIBUTOR","body":"Related to #https://github.com/ehealth-ua/api-spec/issues/414\r\n\r\nif (person.age < 18)&(doctor.speciality = PEDIATRICIAN) {\r\n  end_date = min(birth_date + 18y - 1d, start_date + declaration_term);\r\n} else {\r\n  end_date = start_date + declaration_term;\r\n}\r\n[spec](https://edenlab.atlassian.net/wiki/spaces/EH/pages/983335/IL.Create+declaration+request#end_date)\r\n\r\nDeclaration create (channel MIS)\r\n```\r\ncurl -X POST \\\r\n  https://api.dev.asclepius.com.ua/api/declaration_requests \\\r\n  -H 'Authorization: Bearer d2NZTXpWVW1QK2VOb1p5dTBndjNlQT09' \\\r\n  -H 'Cache-Control: no-cache' \\\r\n  -H 'Content-Type: application/json' \\\r\n  -H 'Postman-Token: 42ef8ab9-fa3b-4aa7-b428-de7d855f455b' \\\r\n  -H 'api-key: UXhEczJacXh3Ri9SUkc4enhHTVVpQT09' \\\r\n  -d '{\r\n  \"declaration_request\": {\r\n    \"person\": {\r\n      \"first_name\": \"ТестГУЕ\",\r\n      \"last_name\": \"ТестГУЕ\",\r\n      \"second_name\": \"ТестГУЕ\",\r\n      \"birth_date\": \"2000-08-19\",\r\n      \"birth_country\": \"Україна\",\r\n      \"birth_settlement\": \"Вінниця\",\r\n      \"gender\": \"MALE\",\r\n      \"email\": \"qq2234562qq@gmail.com\",\r\n      \"secret\": \"secret\",\r\n      \"documents\": [\r\n        {\r\n          \"type\": \"COMPLEMENTARY_PROTECTION_CERTIFICATE\",\r\n          \"number\": \"120518\",\r\n          \"issued_by\":\"1234\",\r\n          \"issued_at\":\"2013-08-19\"\r\n        },\r\n        {\r\n          \"type\": \"PASSPORT\",\r\n          \"number\": \"120518\",\r\n          \"issued_by\":\"1234\",\r\n          \"issued_at\":\"2013-08-19\"\r\n        },\r\n        {\r\n          \"type\": \"REFUGEE_CERTIFICATE\",\r\n          \"number\": \"120518\",\r\n          \"issued_by\":\"1234\",\r\n          \"issued_at\":\"2013-08-19\"\r\n        }\r\n      ],\r\n      \"addresses\": [\r\n      {\r\n        \"type\": \"REGISTRATION\",\r\n        \"country\": \"UA\",\r\n        \"area\": \"ЗАПОРІЗЬКА\",\r\n        \"region\": \"ЯКИМІВСЬКИЙ\",\r\n        \"settlement\": \"СОЛОНЕ\",\r\n        \"settlement_type\": \"CITY\",\r\n        \"settlement_id\": \"057413fb-2c2e-4f33-b2d6-433469212726\",\r\n        \"street_type\": \"STREET\",\r\n        \"street\": \"Верховинна\",\r\n        \"building\": \"34\",\r\n        \"apartment\": \"2145\",\r\n        \"zip\": \"02090\"\r\n      },\r\n      {\r\n        \"type\": \"RESIDENCE\",\r\n        \"country\": \"UA\",\r\n        \"area\": \"ЛЬВІВСЬКА\",\r\n        \"region\": \"ПУСТОМИТІВСЬКИЙ\",\r\n        \"settlement\": \"СОРОКИ-ЛЬВІВСЬКІ\",\r\n        \"settlement_type\": \"CITY\",\r\n        \"settlement_id\": \"707dbc55-cb6b-4aaa-97c1-2a1e03476100\",\r\n        \"street_type\": \"STREET\",\r\n        \"street\": \"Ніжинська\",\r\n        \"building\": \"15\",\r\n        \"apartment\": \"23\",\r\n        \"zip\": \"02090\"\r\n      }\r\n    ],\r\n      \"phones\": [\r\n        {\r\n          \"type\": \"MOBILE\",\r\n          \"number\": \"+380937407890\"\r\n        }\r\n      ],\r\n      \"authentication_methods\": [\r\n        {\r\n          \"type\": \"OTP\",\r\n          \"phone_number\": \"+380937404005\"\r\n        }\r\n      ],\r\n      \"emergency_contact\": {\r\n        \"first_name\": \"Петро\",\r\n        \"last_name\": \"Іванов\",\r\n        \"second_name\": \"Миколайович\",\r\n        \"phones\": [\r\n          {\r\n            \"type\": \"MOBILE\",\r\n            \"number\": \"+380503410870\"\r\n          }\r\n        ]\r\n      },\r\n      \"confidant_person\": [\r\n        {\r\n          \"relation_type\": \"PRIMARY\",\r\n          \"first_name\": \"Петро\",\r\n          \"last_name\": \"Іванов\",\r\n          \"second_name\": \"Миколайович\",\r\n          \"birth_date\": \"1991-08-19\",\r\n          \"birth_country\": \"Україна\",\r\n          \"birth_settlement\": \"Вінниця\",\r\n          \"gender\": \"MALE\",\r\n          \"tax_id\": \"2914950319\",\r\n          \"secret\": \"secret\",\r\n          \"documents_person\": [\r\n            {\r\n\t\t\t\t\"type\": \"PASSPORT\",\r\n\t\t\t\t\"number\": \"120518\",\r\n\t\t\t\t\"issued_by\":\"1234\",\r\n\t\t\t\t\"issued_at\":\"2000-08-19\"\r\n            }\r\n          ],\r\n          \"documents_relationship\": [\r\n            {\r\n\t\t\t\t\"type\": \"BIRTH_CERTIFICATE\",\r\n\t\t\t\t\"number\": \"120518\",\r\n\t\t\t\t\"issued_by\":\"1234\",\r\n\t\t\t\t\"issued_at\":\"2000-08-19\"\r\n            }\r\n          ],\r\n          \"phones\": [\r\n            {\r\n              \"type\": \"MOBILE\",\r\n              \"number\": \"+380503410870\"\r\n            }\r\n          ]\r\n        },\r\n        {\r\n          \"relation_type\": \"SECONDARY\",\r\n          \"first_name\": \"Оксана\",\r\n          \"last_name\": \"Іванова\",\r\n          \"second_name\": \"Сергеевна\",\r\n          \"birth_date\": \"1976-08-19\",\r\n          \"birth_country\": \"Україна\",\r\n          \"birth_settlement\": \"Вінниця\",\r\n          \"gender\": \"MALE\",\r\n          \"tax_id\": \"2983188654\",\r\n          \"secret\": \"secret\",\r\n          \"documents_person\": [\r\n            {\r\n\t\t\t\t\"type\": \"BIRTH_CERTIFICATE\",\r\n\t\t\t\t\"number\": \"120518\",\r\n\t\t\t\t\"issued_by\":\"1234\",\r\n\t\t\t\t\"issued_at\":\"2000-08-19\"\r\n            }\r\n          ],\r\n          \"documents_relationship\": [\r\n            {\r\n\t\t\t\t\"type\": \"COURT_DECISION\",\r\n\t\t\t\t\"number\": \"120518\",\r\n\t\t\t\t\"issued_by\":\"1234\",\r\n\t\t\t\t\"issued_at\":\"2015-11-19\"\r\n            }\r\n          ],\r\n          \"phones\": [\r\n            {\r\n              \"type\": \"MOBILE\",\r\n              \"number\": \"+380503410870\"\r\n            }\r\n          ]\r\n        }\r\n      ],\r\n      \"patient_signed\": false,\r\n      \"process_disclosure_data_consent\": true,\r\n      \"preferred_way_communication\": \"email\"\r\n    },\r\n    \"scope\": \"family_doctor\",\r\n    \"employee_id\" : \"8908d234-13a5-4b91-8307-2ca77c27fcfb\",\r\n    \"division_id\" : \"17c1dfb7-1f7c-4bd0-8854-98e7a87d5eba\"\r\n  }\r\n}'\r\n```\r\n\r\nDeclaration request (channel CABINET)\r\n```\r\ncurl -X POST \\\r\n  https://api.dev.asclepius.com.ua/api/cabinet/declaration_requests \\\r\n  -H 'Authorization: Bearer K25RQWVOQm5CM0tFcWttWVFDREZTdz09' \\\r\n  -H 'Cache-Control: no-cache' \\\r\n  -H 'Content-Type: application/json' \\\r\n  -H 'Postman-Token: 5d12441f-88ec-4c64-8a85-40fbbe288fad' \\\r\n  -d '{\r\n  \"person_id\": \"a80d85da-1a60-4979-9e56-99472140eebf\",\r\n  \"employee_id\": \"8908d234-13a5-4b91-8307-2ca77c27fcfb\",\r\n  \"division_id\": \"17c1dfb7-1f7c-4bd0-8854-98e7a87d5eba\"\r\n}'\r\n```"}}
{"actor":{"display_login":"svetavedmed"}}