@golemio/medical-institutions 1.2.1 → 1.2.3-dev.1568622909

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,79 @@
1
+ asyncapi: 3.0.0
2
+ info:
3
+ title: Medical Institutions
4
+ version: 1.0.0
5
+ description: This module saves data from medical institutions in the city of Prague
6
+ channels:
7
+ medicalinstitutions.refreshDataInDB:
8
+ address: dataplatform.medicalinstitutions.refreshDataInDB
9
+ description: saves data from medical institutions in the city of Prague and calls the updateGeoAndDistrict channel
10
+ bindings:
11
+ amqp:
12
+ is: queue
13
+ queue:
14
+ durable: true
15
+ messages:
16
+ empty:
17
+ $ref: "#/components/messages/emptyMessage"
18
+ medicalinstitutions.updateGeoAndDistrict:
19
+ address: dataplatform.medicalinstitutions.updateGeoAndDistrict
20
+ description: updates the district and geo-coordinates of a medical institution in the city of Prague
21
+ bindings:
22
+ amqp:
23
+ is: queue
24
+ queue:
25
+ durable: true
26
+ messages:
27
+ updateGeoAndDistrictMessage:
28
+ $ref: "#/components/messages/medicalinstitutions.updateGeoAndDistrictMessage"
29
+ operations:
30
+ medicalinstitutions.refreshDataInDB:
31
+ action: "send"
32
+ channel:
33
+ $ref: "#/channels/medicalinstitutions.refreshDataInDB"
34
+ medicalinstitutions.updateGeoAndDistrict:
35
+ action: "send"
36
+ channel:
37
+ $ref: "#/channels/medicalinstitutions.updateGeoAndDistrict"
38
+ components:
39
+ messages:
40
+ emptyMessage:
41
+ title: Empty message
42
+ medicalinstitutions.updateGeoAndDistrictMessage:
43
+ payload:
44
+ $ref: "#/components/schemas/medicalinstitutions.updateGeoAndDistrictMessage"
45
+ schemas:
46
+ medicalinstitutions.updateGeoAndDistrictMessage:
47
+ type: object
48
+ properties:
49
+ id:
50
+ type: string
51
+ examples:
52
+ - "173081-zdravpol-sro"
53
+ geometry:
54
+ type: object
55
+ properties:
56
+ type:
57
+ type: string
58
+ enum:
59
+ - Point
60
+ examples:
61
+ - "Point"
62
+ coordinates:
63
+ type: array
64
+ items:
65
+ type: number
66
+ minItems: 2
67
+ maxItems: 2
68
+ examples:
69
+ - [14.42076, 50.08804]
70
+ district:
71
+ type: string
72
+ examples:
73
+ - "Praha 1"
74
+ nullable: true
75
+ required:
76
+ - id
77
+ - geometry
78
+ - district
79
+ additionalProperties: false
@@ -1,10 +1,9 @@
1
- # Implementační dokumentace modulu *medical-institutions*
1
+ # Implementační dokumentace modulu _medical-institutions_
2
2
 
3
3
  ## Záměr
4
4
 
5
5
  Modul slouží k ukládání a poskytování informací o zdravotníckych zařízeních v Praze.
6
6
 
7
-
8
7
  ## Vstupní data
9
8
 
10
9
  **Dostupní poskytovatelé**:
@@ -14,81 +13,79 @@ Modul slouží k ukládání a poskytování informací o zdravotníckych zaří
14
13
 
15
14
  ### Data aktivně stahujeme
16
15
 
17
- #### *open data SUKL*
18
-
19
- - zdroj dat
20
- - url: [config.datasources.MedicalInstitutionsPharmacies](https://opendata.sukl.cz/soubory/SODERECEPT/LEKARNYAKTUALNI.zip)
21
- - formát dat
22
- - protokol: http
23
- - datový typ: zip csv ("lekarny_prac_doba.csv", "lekarny_seznam.csv", "lekarny_typ.csv")
24
- - validační schéma: [pharmaciesFilesJsonSchema](https://gitlab.com/operator-ict/golemio/code/modules/medical-institutions/-/blob/development/src/schema-definitions/datasources/PharmaciesFilesJsonSchema.ts)
25
- - příklad [vstupních dat](https://gitlab.com/operator-ict/golemio/code/modules/medical-institutions/-/blob/development/test/integration-engine/data/medicalinstitutions/)
26
-
27
- #### *open data MZCR*
16
+ #### _open data SUKL_
28
17
 
29
- - zdroj dat
30
- - url: [config.datasources.MedicalInstitutionsHealthCare](https://opendata.mzcr.cz/data/nrpzs/narodni-registr-poskytovatelu-zdravotnich-sluzeb.csv)
31
- - formát dat
32
- - protokol: http
33
- - datový typ: csv
34
- - validační schéma: [healthCareJsonSchema](https://gitlab.com/operator-ict/golemio/code/modules/medical-institutions/-/blob/development/src/schema-definitions/datasources/HealthCareJsonSchema.ts)
35
- - příklad [vstupních dat](https://gitlab.com/operator-ict/golemio/code/modules/medical-institutions/-/blob/development/test/integration-engine/data/healthcare-datasource.json)
18
+ - zdroj dat
19
+ - url: [config.datasources.MedicalInstitutionsPharmacies](https://opendata.sukl.cz/soubory/SODERECEPT/LEKARNYAKTUALNI.zip)
20
+ - formát dat
21
+ - protokol: http
22
+ - datový typ: zip csv ("lekarny_prac_doba.csv", "lekarny_seznam.csv", "lekarny_typ.csv")
23
+ - validační schéma: [pharmaciesFilesJsonSchema](https://gitlab.com/operator-ict/golemio/code/modules/medical-institutions/-/blob/development/src/schema-definitions/datasources/PharmaciesFilesJsonSchema.ts)
24
+ - příklad [vstupních dat](https://gitlab.com/operator-ict/golemio/code/modules/medical-institutions/-/blob/development/test/integration-engine/data/medicalinstitutions/)
36
25
 
26
+ #### _open data MZCR_
37
27
 
38
- - frekvence stahování
39
- - cron definice:
40
- - cron.dataplatform.medicalInstitutions.refreshDataInDB
41
- - rabin `0 31 7 * * *`
42
- - prod `0 25 2 1 * *`
43
- - název rabbitmq fronty
44
- - dataplatform.medicalinstitutions.refreshDataInDB
28
+ - zdroj dat
29
+ - url: [config.datasources.MedicalInstitutionsHealthCare](https://opendata.mzcr.cz/data/nrpzs/narodni-registr-poskytovatelu-zdravotnich-sluzeb.csv)
30
+ - formát dat
45
31
 
32
+ - protokol: http
33
+ - datový typ: csv
34
+ - validační schéma: [healthCareJsonSchema](https://gitlab.com/operator-ict/golemio/code/modules/medical-institutions/-/blob/development/src/schema-definitions/datasources/HealthCareJsonSchema.ts)
35
+ - příklad [vstupních dat](https://gitlab.com/operator-ict/golemio/code/modules/medical-institutions/-/blob/development/test/integration-engine/data/healthcare-datasource.json)
46
36
 
37
+ - frekvence stahování
38
+ - cron definice:
39
+ - cron.dataplatform.medicalInstitutions.refreshDataInDB
40
+ - rabin `0 31 7 * * *`
41
+ - prod `0 25 2 1 * *`
42
+ - název rabbitmq fronty
43
+ - dataplatform.medicalinstitutions.refreshDataInDB
47
44
 
48
45
  ## Zpracování dat / transformace
49
46
 
50
47
  Při transformaci data obohacujeme o atribut `district`, která vychází z polohy daného zařížení a získává se metodou `cityDistrictsModel.getDistrict` v modulu city-district.
51
- Data `SUKL` obohacujeme o geometrii z adresy z `GeocodeApi` metodou `getGeoByAddress`
52
-
53
- ### *MedicalInstitutionsWorker*
54
-
55
- #### *task: RefreshDataInDBTask*
56
-
57
- - vstupní rabbitmq fronta
58
- - název: dataplatform.medicalinstitutions.refreshDataInDB
59
- - bez parametrů
60
- - závislé fronty (do kterých jsou odesílány zprávy z metody workeru)
61
- - název: dataplatform.medicalinstitutions.updateGeoAndDistrict
62
- - parametry: `{ id: institution.id; geometry: institution.geometry; district: institution.district }`
63
- - datové zdroje
64
- - dataSource SUKL & MZCR
65
- - transformace
66
- - [HealthCareTransformation](https://gitlab.com/operator-ict/golemio/code/modules/medical-institutions/-/blob/development/src/integration-engine/transformations/HealthCareTransformation.ts)
67
- - [PharmaciesTransformation](https://gitlab.com/operator-ict/golemio/code/modules/medical-institutions/-/blob/development/src/integration-engine/transformations/PharmaciesTransformation.ts)
68
- - data modely
69
- - institutionsModel -> (schéma medical_institutions) `medical_institutions`
70
- - openingHoursModel -> (schéma medical_institutions) `opening_hours`
71
-
72
- #### *task: UpdateGeoAndDistrict*
73
-
74
- - vstupní rabbitmq fronta
75
- - název: dataplatform.medicalinstitutions.updateGeoAndDistrict
76
- - parametry: `{ id: institution.id; geometry: institution.geometry; district: institution.district }`
77
- - datové zdroje
78
- - `city-districts` module
79
- - `GeocodeApi`
80
- - data modely
81
- - institutionsModel -> (schéma medical_institutions) `institution.district`
48
+ Data `SUKL` obohacujeme o geometrii z adresy z `GeocodeApi` metodou `getGeoByAddress`
49
+
50
+ ### _MedicalInstitutionsWorker_
51
+
52
+ #### _task: RefreshDataInDBTask_
53
+
54
+ - vstupní rabbitmq fronta
55
+ - název: dataplatform.medicalinstitutions.refreshDataInDB
56
+ - bez parametrů
57
+ - závislé fronty (do kterých jsou odesílány zprávy z metody workeru)
58
+ - název: dataplatform.medicalinstitutions.updateGeoAndDistrict
59
+ - parametry: `{ id: institution.id; geometry: institution.geometry; district: institution.district }`
60
+ - datové zdroje
61
+ - dataSource SUKL & MZCR
62
+ - transformace
63
+ - [HealthCareTransformation](https://gitlab.com/operator-ict/golemio/code/modules/medical-institutions/-/blob/development/src/integration-engine/transformations/HealthCareTransformation.ts)
64
+ - [PharmaciesTransformation](https://gitlab.com/operator-ict/golemio/code/modules/medical-institutions/-/blob/development/src/integration-engine/transformations/PharmaciesTransformation.ts)
65
+ - data modely
66
+ - institutionsModel -> (schéma medical_institutions) `medical_institutions`
67
+ - openingHoursModel -> (schéma medical_institutions) `opening_hours`
68
+
69
+ #### _task: UpdateGeoAndDistrict_
70
+
71
+ - vstupní rabbitmq fronta
72
+ - název: dataplatform.medicalinstitutions.updateGeoAndDistrict
73
+ - parametry: `{ id: institution.id; geometry: institution.geometry; district: institution.district }`
74
+ - datové zdroje
75
+ - `city-districts` module
76
+ - `GeocodeApi`
77
+ - data modely
78
+ - institutionsModel -> (schéma medical_institutions) `institution.district`
82
79
 
83
80
  ## Uložení dat
84
81
 
85
- - typ databáze
86
- - PSQL
87
- - databázové schéma
88
- - ![medicalinstitutions er diagram](./assets/medicalinstitutions_erd.png)
89
- - retence dat
90
- - `institutionsModel` update
91
- - `openingHoursModel` replace
82
+ - typ databáze
83
+ - PSQL
84
+ - databázové schéma
85
+ - ![medicalinstitutions er diagram](./assets/medicalinstitutions_erd.png)
86
+ - retence dat
87
+ - `institutionsModel` update
88
+ - `openingHoursModel` replace
92
89
 
93
90
  ## Output API
94
91
 
@@ -96,24 +93,26 @@ Data `SUKL` obohacujeme o geometrii z adresy z `GeocodeApi` metodou `getGeoByAd
96
93
 
97
94
  ### Obecné
98
95
 
99
- - OpenAPI v3 dokumentace
100
- - [openapi.yaml](https://gitlab.com/operator-ict/golemio/code/modules/medical-institutions/-/blob/development/docs/openapi.yaml)
101
- - api je veřejné
102
- - postman kolekce
103
- - TBD
96
+ - OpenAPI v3 dokumentace
97
+ - [openapi.yaml](https://gitlab.com/operator-ict/golemio/code/modules/medical-institutions/-/blob/development/docs/openapi.yaml)
98
+ - api je veřejné
99
+ - postman kolekce
100
+ - TBD
101
+ - Asyncapi dokumentace RabbitMQ front
102
+ - [AsyncAPI](./asyncapi.yaml)
104
103
 
105
104
  #### _/medicalinstitutions_
106
105
 
107
- - zdrojové tabulky
108
- - `institutions`, `opening_hours`,
109
- - dodatečná transformace: Feature collection
106
+ - zdrojové tabulky
107
+ - `institutions`, `opening_hours`,
108
+ - dodatečná transformace: Feature collection
110
109
 
111
110
  #### _/medicalinstitutions/:id_
112
111
 
113
- - zdrojové tabulky
114
- - `institutions`, `opening_hours`,
115
- - dodatečná transformace: Feature
112
+ - zdrojové tabulky
113
+ - `institutions`, `opening_hours`,
114
+ - dodatečná transformace: Feature
116
115
 
117
116
  #### _/medicalinstitutions/types_
118
117
 
119
- - statické data
118
+ - statické data
package/docs/index.md ADDED
@@ -0,0 +1,3 @@
1
+ # @golemio/medical-institutions
2
+
3
+ This module is intended for use with Golemio services. Refer [here](https://gitlab.com/operator-ict/golemio/code/modules/core/-/blob/development/README.md) for further information on usage, local development and more.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@golemio/medical-institutions",
3
- "version": "1.2.1",
3
+ "version": "1.2.3-dev.1568622909",
4
4
  "description": "Golemio Medical Institutions Module",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",