UNPKG

1.35 kBMarkdownView Raw
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
71. `npm install rmisjs`
82. Создать конфигурацию:
9```javascript
10var 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```
263. Подключить модули и установить конфигурацию:
27```javascript
28const rmisjs = require('rmisjs')(config);
29const rmis = rmisjs.rmis;
30const composer = rmisjs.composer;
31```
324. Вызвать необходимый модуль:
33```javascript
34rmis.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
45composer.getLocationsWithPortal()
46 .then(r => {
47 console.log(r);
48 })
49 .catch(e => { console.error(e); });
50```
\No newline at end of file