@andes/fhir 1.12.0 → 1.12.1-beta.1

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.
Files changed (103) hide show
  1. package/{src → dist}/data/patient.json +192 -192
  2. package/dist/{src/helpers → helpers}/patientFactory.js +35 -31
  3. package/dist/{src/lib → lib}/allergyIntolerance.js +39 -40
  4. package/dist/{src/lib → lib}/bundle.js +25 -26
  5. package/dist/{src/lib → lib}/composition.js +152 -152
  6. package/dist/{src/lib → lib}/condition.js +79 -80
  7. package/dist/{src/lib → lib}/config.js +27 -21
  8. package/dist/lib/config.test.js +19 -0
  9. package/dist/{src/lib → lib}/device.js +38 -39
  10. package/dist/lib/device.test.js +9 -0
  11. package/dist/{src/lib → lib}/document-reference.js +106 -107
  12. package/dist/{src/lib → lib}/immunization.js +67 -68
  13. package/{src/lib/medication.ts → dist/lib/medication.js} +64 -61
  14. package/{src/lib/medicationRequest.ts → dist/lib/medicationRequest.js} +103 -100
  15. package/dist/{src/lib → lib}/medicationStatement.js +55 -56
  16. package/dist/lib/organization.js +93 -0
  17. package/dist/lib/patient.js +465 -0
  18. package/dist/{src/lib → lib}/patient.test.js +132 -113
  19. package/dist/lib/practitioner.js +186 -0
  20. package/dist/types/andes/organization.types.js +2 -0
  21. package/dist/types/andes/patient.types.js +2 -0
  22. package/dist/types/andes/practitioner.types.js +3 -0
  23. package/package.json +53 -44
  24. package/.circleci/config.yml +0 -72
  25. package/.editorconfig +0 -14
  26. package/.env.example +0 -2
  27. package/.gitattributes +0 -1
  28. package/.github/CODEOWNERS +0 -1
  29. package/.github/labeler.yml +0 -11
  30. package/.github/pull_request_template.md +0 -28
  31. package/.github/workflows/build_test.yml +0 -14
  32. package/.github/workflows/has_conflicts.yml +0 -13
  33. package/.vscode/settings.json +0 -2
  34. package/CHANGELOG.md +0 -351
  35. package/coverage/clover.xml +0 -209
  36. package/coverage/coverage-final.json +0 -5
  37. package/coverage/lcov-report/base.css +0 -224
  38. package/coverage/lcov-report/block-navigation.js +0 -87
  39. package/coverage/lcov-report/config.ts.html +0 -136
  40. package/coverage/lcov-report/device.ts.html +0 -193
  41. package/coverage/lcov-report/favicon.png +0 -0
  42. package/coverage/lcov-report/helpers/index.html +0 -116
  43. package/coverage/lcov-report/helpers/patientFactory.ts.html +0 -124
  44. package/coverage/lcov-report/index.html +0 -131
  45. package/coverage/lcov-report/lib/config.ts.html +0 -136
  46. package/coverage/lcov-report/lib/device.ts.html +0 -193
  47. package/coverage/lcov-report/lib/index.html +0 -146
  48. package/coverage/lcov-report/lib/patient.ts.html +0 -1318
  49. package/coverage/lcov-report/patient.ts.html +0 -1207
  50. package/coverage/lcov-report/prettify.css +0 -1
  51. package/coverage/lcov-report/prettify.js +0 -2
  52. package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  53. package/coverage/lcov-report/sorter.js +0 -210
  54. package/coverage/lcov.info +0 -425
  55. package/dist/index.js +0 -52
  56. package/dist/index.js.map +0 -1
  57. package/dist/src/data/patient.json +0 -192
  58. package/dist/src/helpers/patientFactory.js.map +0 -1
  59. package/dist/src/lib/allergyIntolerance.js.map +0 -1
  60. package/dist/src/lib/bundle.js.map +0 -1
  61. package/dist/src/lib/composition.js.map +0 -1
  62. package/dist/src/lib/condition.js.map +0 -1
  63. package/dist/src/lib/config.js.map +0 -1
  64. package/dist/src/lib/config.test.js +0 -13
  65. package/dist/src/lib/config.test.js.map +0 -1
  66. package/dist/src/lib/device.js.map +0 -1
  67. package/dist/src/lib/device.test.js +0 -10
  68. package/dist/src/lib/device.test.js.map +0 -1
  69. package/dist/src/lib/document-reference.js.map +0 -1
  70. package/dist/src/lib/immunization.js.map +0 -1
  71. package/dist/src/lib/medication.js +0 -65
  72. package/dist/src/lib/medication.js.map +0 -1
  73. package/dist/src/lib/medicationRequest.js +0 -103
  74. package/dist/src/lib/medicationRequest.js.map +0 -1
  75. package/dist/src/lib/medicationStatement.js.map +0 -1
  76. package/dist/src/lib/organization.js +0 -91
  77. package/dist/src/lib/organization.js.map +0 -1
  78. package/dist/src/lib/patient.js +0 -397
  79. package/dist/src/lib/patient.js.map +0 -1
  80. package/dist/src/lib/patient.test.js.map +0 -1
  81. package/dist/src/lib/practitioner.js +0 -161
  82. package/dist/src/lib/practitioner.js.map +0 -1
  83. package/index.ts +0 -30
  84. package/jest.config.js +0 -12
  85. package/release.config.js +0 -74
  86. package/src/helpers/patientFactory.ts +0 -13
  87. package/src/lib/allergyIntolerance.ts +0 -36
  88. package/src/lib/bundle.ts +0 -19
  89. package/src/lib/composition.ts +0 -153
  90. package/src/lib/condition.ts +0 -80
  91. package/src/lib/config.test.ts +0 -13
  92. package/src/lib/config.ts +0 -17
  93. package/src/lib/device.test.ts +0 -9
  94. package/src/lib/device.ts +0 -36
  95. package/src/lib/document-reference.ts +0 -102
  96. package/src/lib/immunization.ts +0 -64
  97. package/src/lib/medicationStatement.ts +0 -52
  98. package/src/lib/organization.ts +0 -89
  99. package/src/lib/patient.test.ts +0 -101
  100. package/src/lib/patient.ts +0 -411
  101. package/src/lib/practitioner.ts +0 -157
  102. package/tsconfig.test.json +0 -18
  103. package/tslint.json +0 -139
@@ -1,107 +1,106 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.encode = void 0;
7
- const moment_1 = __importDefault(require("moment"));
8
- const config_1 = require("./config");
9
- function encode(ID, author, organization, patient, binaryURL) {
10
- return {
11
- resourceType: 'DocumentReference',
12
- id: ID,
13
- meta: {
14
- lastUpdated: moment_1.default().format()
15
- },
16
- contained: [
17
- {
18
- resourceType: 'Practitioner',
19
- id: author.id,
20
- identifier: [{
21
- system: config_1.makeUrl('Device'),
22
- value: author.id
23
- }]
24
- },
25
- {
26
- resourceType: 'Organization',
27
- id: organization.id,
28
- identifier: [{
29
- system: config_1.makeUrl('Organization'),
30
- value: organization.id
31
- }]
32
- }
33
- ],
34
- custodian: {
35
- identifier: {
36
- system: 'https://federador.msal.gob.ar/uri',
37
- value: config_1.makeUrl('Organization', organization.id)
38
- }
39
- },
40
- masterIdentifier: {
41
- system: config_1.makeUrl('documentos_versiones'),
42
- value: ID
43
- },
44
- identifier: [{
45
- system: config_1.makeUrl('documentos'),
46
- value: ID
47
- }],
48
- status: 'current',
49
- type: {
50
- coding: [
51
- {
52
- system: 'http://loinc.org',
53
- code: '60591-5'
54
- }
55
- ]
56
- },
57
- subject: {
58
- reference: config_1.makeUrl('Patient', patient.id),
59
- },
60
- // author: [
61
- // {
62
- // reference: makeUrl('Device', author.id),
63
- // },
64
- // {
65
- // reference: makeUrl('Organization', organization.id),
66
- // }
67
- // ],
68
- securityLabel: [{
69
- coding: [{
70
- system: 'https://saludddigital.gob.ar/nivelesconfidencialidad',
71
- code: 'N'
72
- }]
73
- }],
74
- content: [{
75
- attachment: {
76
- id: 'PRINCIPAL',
77
- url: binaryURL
78
- }
79
- }],
80
- context: {
81
- event: [{
82
- coding: [{
83
- system: 'https://saludddigital.gob.ar/tiposevento',
84
- code: 'CIR'
85
- }]
86
- }],
87
- // period: {
88
- // start: '2019-04-03T10:30:00+03:00',
89
- // end: '2019-04-05T10:30:00+03:00'
90
- // },
91
- facilityType: {
92
- coding: [{
93
- system: 'https://saludddigital.gob.ar/tipoprestador',
94
- code: 'INI'
95
- }]
96
- },
97
- practiceSetting: {
98
- coding: [{
99
- system: 'https://saludddigital.gob.ar/especialidades',
100
- code: 'CLM'
101
- }]
102
- }
103
- }
104
- };
105
- }
106
- exports.encode = encode;
107
- //# sourceMappingURL=document-reference.js.map
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.encode = void 0;
7
+ const moment_1 = __importDefault(require("moment"));
8
+ const config_1 = require("./config");
9
+ function encode(ID, author, organization, patient, binaryURL) {
10
+ return {
11
+ resourceType: 'DocumentReference',
12
+ id: ID,
13
+ meta: {
14
+ lastUpdated: (0, moment_1.default)().format()
15
+ },
16
+ contained: [
17
+ {
18
+ resourceType: 'Practitioner',
19
+ id: author.id,
20
+ identifier: [{
21
+ system: (0, config_1.makeUrl)('Device'),
22
+ value: author.id
23
+ }]
24
+ },
25
+ {
26
+ resourceType: 'Organization',
27
+ id: organization.id,
28
+ identifier: [{
29
+ system: (0, config_1.makeUrl)('Organization'),
30
+ value: organization.id
31
+ }]
32
+ }
33
+ ],
34
+ custodian: {
35
+ identifier: {
36
+ system: 'https://federador.msal.gob.ar/uri',
37
+ value: (0, config_1.makeUrl)('Organization', organization.id)
38
+ }
39
+ },
40
+ masterIdentifier: {
41
+ system: (0, config_1.makeUrl)('documentos_versiones'),
42
+ value: ID
43
+ },
44
+ identifier: [{
45
+ system: (0, config_1.makeUrl)('documentos'),
46
+ value: ID
47
+ }],
48
+ status: 'current',
49
+ type: {
50
+ coding: [
51
+ {
52
+ system: 'http://loinc.org',
53
+ code: '60591-5'
54
+ }
55
+ ]
56
+ },
57
+ subject: {
58
+ reference: (0, config_1.makeUrl)('Patient', patient.id),
59
+ },
60
+ // author: [
61
+ // {
62
+ // reference: makeUrl('Device', author.id),
63
+ // },
64
+ // {
65
+ // reference: makeUrl('Organization', organization.id),
66
+ // }
67
+ // ],
68
+ securityLabel: [{
69
+ coding: [{
70
+ system: 'https://saludddigital.gob.ar/nivelesconfidencialidad',
71
+ code: 'N'
72
+ }]
73
+ }],
74
+ content: [{
75
+ attachment: {
76
+ id: 'PRINCIPAL',
77
+ url: binaryURL
78
+ }
79
+ }],
80
+ context: {
81
+ event: [{
82
+ coding: [{
83
+ system: 'https://saludddigital.gob.ar/tiposevento',
84
+ code: 'CIR'
85
+ }]
86
+ }],
87
+ // period: {
88
+ // start: '2019-04-03T10:30:00+03:00',
89
+ // end: '2019-04-05T10:30:00+03:00'
90
+ // },
91
+ facilityType: {
92
+ coding: [{
93
+ system: 'https://saludddigital.gob.ar/tipoprestador',
94
+ code: 'INI'
95
+ }]
96
+ },
97
+ practiceSetting: {
98
+ coding: [{
99
+ system: 'https://saludddigital.gob.ar/especialidades',
100
+ code: 'CLM'
101
+ }]
102
+ }
103
+ }
104
+ };
105
+ }
106
+ exports.encode = encode;
@@ -1,68 +1,67 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.encode = void 0;
4
- /**
5
- * Encode de Vacunas Nomivac from ANDES to FHIR
6
- * @param {} nomivac
7
- * [ASK] El code de extension puede ir en vaccineCode?
8
- * [ASk] Location no se sabe. Solo esta el texto
9
- */
10
- function encode(patientReference, nomivac) {
11
- return {
12
- resourceType: 'Immunization',
13
- id: nomivac.idvacuna,
14
- extension: [
15
- {
16
- url: 'http://sisa/fhir/esquema',
17
- valueCoding: {
18
- system: 'http://argentina.gob.ar/salud/NOMIVAC-esquemas',
19
- code: '0',
20
- display: nomivac.vacuna
21
- }
22
- },
23
- {
24
- url: 'http://sisa/fhir/condicionAplicacion',
25
- valueCoding: {
26
- system: 'http://argentina.gob.ar/salud/NOMIVAC-condicion',
27
- code: '17',
28
- display: 'Personal de Salud'
29
- }
30
- }
31
- ],
32
- status: 'completed',
33
- notGiven: false,
34
- vaccineCode: {
35
- coding: [
36
- {
37
- system: 'https://snomed.info/sct/11000221109/id/228100022110',
38
- code: nomivac.idvacuna,
39
- display: nomivac.vacuna
40
- }
41
- ]
42
- },
43
- patient: {
44
- reference: patientReference
45
- },
46
- date: nomivac.fechaAplicacion,
47
- primarySource: false,
48
- location: {
49
- reference: 'http://argentina.gob.ar/salud/refes/14999912399913'
50
- },
51
- // lotNumber: null,
52
- vaccinationProtocol: [
53
- {
54
- doseSequence: 1,
55
- doseStatus: {
56
- coding: [
57
- {
58
- system: 'http://hl7.org/fhir/vaccination-protocol-dose-status',
59
- code: nomivac.dosis
60
- }
61
- ]
62
- }
63
- }
64
- ]
65
- };
66
- }
67
- exports.encode = encode;
68
- //# sourceMappingURL=immunization.js.map
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.encode = void 0;
4
+ /**
5
+ * Encode de Vacunas Nomivac from ANDES to FHIR
6
+ * @param {} nomivac
7
+ * [ASK] El code de extension puede ir en vaccineCode?
8
+ * [ASk] Location no se sabe. Solo esta el texto
9
+ */
10
+ function encode(patientReference, nomivac) {
11
+ return {
12
+ resourceType: 'Immunization',
13
+ id: nomivac.idvacuna,
14
+ extension: [
15
+ {
16
+ url: 'http://sisa/fhir/esquema',
17
+ valueCoding: {
18
+ system: 'http://argentina.gob.ar/salud/NOMIVAC-esquemas',
19
+ code: '0', // [TODO] Ver que code ponemos acá
20
+ display: nomivac.vacuna
21
+ }
22
+ },
23
+ {
24
+ url: 'http://sisa/fhir/condicionAplicacion',
25
+ valueCoding: {
26
+ system: 'http://argentina.gob.ar/salud/NOMIVAC-condicion',
27
+ code: '17',
28
+ display: 'Personal de Salud'
29
+ }
30
+ }
31
+ ],
32
+ status: 'completed',
33
+ notGiven: false,
34
+ vaccineCode: {
35
+ coding: [
36
+ {
37
+ system: 'https://snomed.info/sct/11000221109/id/228100022110',
38
+ code: nomivac.idvacuna,
39
+ display: nomivac.vacuna
40
+ }
41
+ ]
42
+ },
43
+ patient: {
44
+ reference: patientReference
45
+ },
46
+ date: nomivac.fechaAplicacion,
47
+ primarySource: false,
48
+ location: {
49
+ reference: 'http://argentina.gob.ar/salud/refes/14999912399913'
50
+ },
51
+ // lotNumber: null,
52
+ vaccinationProtocol: [
53
+ {
54
+ doseSequence: 1,
55
+ doseStatus: {
56
+ coding: [
57
+ {
58
+ system: 'http://hl7.org/fhir/vaccination-protocol-dose-status',
59
+ code: nomivac.dosis
60
+ }
61
+ ]
62
+ }
63
+ }
64
+ ]
65
+ };
66
+ }
67
+ exports.encode = encode;
@@ -1,61 +1,64 @@
1
- /**
2
- * Encode de Medicamentos from ANDES to FHIR
3
- * @param {} medication
4
- */
5
- export function encode(medication) {
6
- // Falta completar con más detalle
7
- return {
8
- resourceType: 'Medication',
9
- id: medication.conceptId, // Es el id del medicamento, en este caso usamos el código de snomed (ver si sería correcto)
10
- meta: {
11
- profile: [
12
- 'http://hl7.org/fhir/uv/ips/StructureDefinition/medication-ips'
13
- ]
14
- },
15
- identifier: medication.moduleId, // Acá va el serial number del medicamento.
16
- code: {
17
- coding: [
18
- {
19
- system: 'http://snomed.info/sct',
20
- display: medication.term,
21
- code: medication.conceptId
22
- }
23
- ],
24
- text: medication.fsn
25
- },
26
- status: medication.active === true ? 'active' : 'inactive',
27
- // manufacturer: null,
28
- // form: null,
29
- // amount: null,
30
- // ingredient: null,
31
- // ingredient: [ // ejemplo
32
- // {
33
- // code: {
34
- // coding: [
35
- // {
36
- // system: "http://snomed.info/sct",
37
- // display: "salbutamol (sustancia)",
38
- // code: "372897005"
39
- // }
40
- // ]
41
- // },
42
- // isActive: true,
43
- // strength: {
44
- // numerator: {
45
- // value: 200,
46
- // unit: "mcg"
47
- // },
48
- // denominator: {
49
- // value: 1,
50
- // unit: "disparo"
51
- // }
52
- // }
53
- // }
54
- // ],
55
- text: {
56
- status: 'generated',
57
- div: `<div xmlns="http://www.w3.org/1999/xhtml"><p><b>Generated Narrative with Details</b></p><p><b>id</b>: Medicacion</p><p><b>meta</b>: </p><p><b>text</b>: ${medication.pt.term}</p></div>`
58
- }
59
- };
60
- }
61
-
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.encode = void 0;
4
+ /**
5
+ * Encode de Medicamentos from ANDES to FHIR
6
+ * @param {} medication
7
+ */
8
+ function encode(medication) {
9
+ // Falta completar con más detalle
10
+ return {
11
+ resourceType: 'Medication',
12
+ id: medication.conceptId, // Es el id del medicamento, en este caso usamos el código de snomed (ver si sería correcto)
13
+ meta: {
14
+ profile: [
15
+ 'http://hl7.org/fhir/uv/ips/StructureDefinition/medication-ips'
16
+ ]
17
+ },
18
+ identifier: medication.moduleId, // Acá va el serial number del medicamento.
19
+ code: {
20
+ coding: [
21
+ {
22
+ system: 'http://snomed.info/sct',
23
+ display: medication.term,
24
+ code: medication.conceptId
25
+ }
26
+ ],
27
+ text: medication.fsn
28
+ },
29
+ status: medication.active === true ? 'active' : 'inactive',
30
+ // manufacturer: null,
31
+ // form: null,
32
+ // amount: null,
33
+ // ingredient: null,
34
+ // ingredient: [ // ejemplo
35
+ // {
36
+ // code: {
37
+ // coding: [
38
+ // {
39
+ // system: "http://snomed.info/sct",
40
+ // display: "salbutamol (sustancia)",
41
+ // code: "372897005"
42
+ // }
43
+ // ]
44
+ // },
45
+ // isActive: true,
46
+ // strength: {
47
+ // numerator: {
48
+ // value: 200,
49
+ // unit: "mcg"
50
+ // },
51
+ // denominator: {
52
+ // value: 1,
53
+ // unit: "disparo"
54
+ // }
55
+ // }
56
+ // }
57
+ // ],
58
+ text: {
59
+ status: 'generated',
60
+ div: `<div xmlns="http://www.w3.org/1999/xhtml"><p><b>Generated Narrative with Details</b></p><p><b>id</b>: Medicacion</p><p><b>meta</b>: </p><p><b>text</b>: ${medication.pt.term}</p></div>`
61
+ }
62
+ };
63
+ }
64
+ exports.encode = encode;