1 | ## JS-обертка для работы с [RMIS](https://www.rtlabs.ru/projects/regionalnaya-meditsinskaya-informatsionnaya-sistema-rmis/)
|
2 |
|
3 | ### Начиная с версии `0.1.1` требуется [node.js](ttps://nodejs.org) версии 8.0.0 и выше
|
4 |
|
5 | ### Как использовать:
|
6 |
|
7 | 1. `npm install rmisjs`
|
8 | 2. Создать конфигурацию:
|
9 | ```javascript
|
10 | var config = {
|
11 | rmis: {
|
12 | auth: {
|
13 | username: "username",
|
14 | password: "password"
|
15 | },
|
16 | path: "https://dev.is-mis.ru/",
|
17 | clinicId: clinicId,
|
18 | allowedServices: [
|
19 | "departments-ws/departments",
|
20 | "individuals-ws/individuals",
|
21 | "locations-ws/resources"
|
22 | ]
|
23 | }
|
24 | }
|
25 | ```
|
26 | 3. Подключить модули и установить конфигурацию:
|
27 | ```javascript
|
28 | const rmisjs = require('rmisjs')(config);
|
29 | const rmis = rmisjs.rmis;
|
30 | const composer = rmisjs.composer;
|
31 | ```
|
32 | 4. Вызвать необходимый модуль:
|
33 | ```javascript
|
34 | rmis.resource()
|
35 | .then(r => {
|
36 | return r.getLocations({ clinic: config.rmis.clinicId });
|
37 | })
|
38 | .then(r => {
|
39 | console.log(r);
|
40 | })
|
41 | .catch(e => {
|
42 | console.error(e);
|
43 | });
|
44 |
|
45 | composer.getLocationsWithPortal()
|
46 | .then(r => {
|
47 | console.log(r);
|
48 | })
|
49 | .catch(e => { console.error(e); });
|
50 | ``` |
\ | No newline at end of file |