@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.
- package/{src → dist}/data/patient.json +192 -192
- package/dist/{src/helpers → helpers}/patientFactory.js +35 -31
- package/dist/{src/lib → lib}/allergyIntolerance.js +39 -40
- package/dist/{src/lib → lib}/bundle.js +25 -26
- package/dist/{src/lib → lib}/composition.js +152 -152
- package/dist/{src/lib → lib}/condition.js +79 -80
- package/dist/{src/lib → lib}/config.js +27 -21
- package/dist/lib/config.test.js +19 -0
- package/dist/{src/lib → lib}/device.js +38 -39
- package/dist/lib/device.test.js +9 -0
- package/dist/{src/lib → lib}/document-reference.js +106 -107
- package/dist/{src/lib → lib}/immunization.js +67 -68
- package/{src/lib/medication.ts → dist/lib/medication.js} +64 -61
- package/{src/lib/medicationRequest.ts → dist/lib/medicationRequest.js} +103 -100
- package/dist/{src/lib → lib}/medicationStatement.js +55 -56
- package/dist/lib/organization.js +93 -0
- package/dist/lib/patient.js +465 -0
- package/dist/{src/lib → lib}/patient.test.js +132 -113
- package/dist/lib/practitioner.js +186 -0
- package/dist/types/andes/organization.types.js +2 -0
- package/dist/types/andes/patient.types.js +2 -0
- package/dist/types/andes/practitioner.types.js +3 -0
- package/package.json +53 -44
- package/.circleci/config.yml +0 -72
- package/.editorconfig +0 -14
- package/.env.example +0 -2
- package/.gitattributes +0 -1
- package/.github/CODEOWNERS +0 -1
- package/.github/labeler.yml +0 -11
- package/.github/pull_request_template.md +0 -28
- package/.github/workflows/build_test.yml +0 -14
- package/.github/workflows/has_conflicts.yml +0 -13
- package/.vscode/settings.json +0 -2
- package/CHANGELOG.md +0 -351
- package/coverage/clover.xml +0 -209
- package/coverage/coverage-final.json +0 -5
- package/coverage/lcov-report/base.css +0 -224
- package/coverage/lcov-report/block-navigation.js +0 -87
- package/coverage/lcov-report/config.ts.html +0 -136
- package/coverage/lcov-report/device.ts.html +0 -193
- package/coverage/lcov-report/favicon.png +0 -0
- package/coverage/lcov-report/helpers/index.html +0 -116
- package/coverage/lcov-report/helpers/patientFactory.ts.html +0 -124
- package/coverage/lcov-report/index.html +0 -131
- package/coverage/lcov-report/lib/config.ts.html +0 -136
- package/coverage/lcov-report/lib/device.ts.html +0 -193
- package/coverage/lcov-report/lib/index.html +0 -146
- package/coverage/lcov-report/lib/patient.ts.html +0 -1318
- package/coverage/lcov-report/patient.ts.html +0 -1207
- package/coverage/lcov-report/prettify.css +0 -1
- package/coverage/lcov-report/prettify.js +0 -2
- package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/coverage/lcov-report/sorter.js +0 -210
- package/coverage/lcov.info +0 -425
- package/dist/index.js +0 -52
- package/dist/index.js.map +0 -1
- package/dist/src/data/patient.json +0 -192
- package/dist/src/helpers/patientFactory.js.map +0 -1
- package/dist/src/lib/allergyIntolerance.js.map +0 -1
- package/dist/src/lib/bundle.js.map +0 -1
- package/dist/src/lib/composition.js.map +0 -1
- package/dist/src/lib/condition.js.map +0 -1
- package/dist/src/lib/config.js.map +0 -1
- package/dist/src/lib/config.test.js +0 -13
- package/dist/src/lib/config.test.js.map +0 -1
- package/dist/src/lib/device.js.map +0 -1
- package/dist/src/lib/device.test.js +0 -10
- package/dist/src/lib/device.test.js.map +0 -1
- package/dist/src/lib/document-reference.js.map +0 -1
- package/dist/src/lib/immunization.js.map +0 -1
- package/dist/src/lib/medication.js +0 -65
- package/dist/src/lib/medication.js.map +0 -1
- package/dist/src/lib/medicationRequest.js +0 -103
- package/dist/src/lib/medicationRequest.js.map +0 -1
- package/dist/src/lib/medicationStatement.js.map +0 -1
- package/dist/src/lib/organization.js +0 -91
- package/dist/src/lib/organization.js.map +0 -1
- package/dist/src/lib/patient.js +0 -397
- package/dist/src/lib/patient.js.map +0 -1
- package/dist/src/lib/patient.test.js.map +0 -1
- package/dist/src/lib/practitioner.js +0 -161
- package/dist/src/lib/practitioner.js.map +0 -1
- package/index.ts +0 -30
- package/jest.config.js +0 -12
- package/release.config.js +0 -74
- package/src/helpers/patientFactory.ts +0 -13
- package/src/lib/allergyIntolerance.ts +0 -36
- package/src/lib/bundle.ts +0 -19
- package/src/lib/composition.ts +0 -153
- package/src/lib/condition.ts +0 -80
- package/src/lib/config.test.ts +0 -13
- package/src/lib/config.ts +0 -17
- package/src/lib/device.test.ts +0 -9
- package/src/lib/device.ts +0 -36
- package/src/lib/document-reference.ts +0 -102
- package/src/lib/immunization.ts +0 -64
- package/src/lib/medicationStatement.ts +0 -52
- package/src/lib/organization.ts +0 -89
- package/src/lib/patient.test.ts +0 -101
- package/src/lib/patient.ts +0 -411
- package/src/lib/practitioner.ts +0 -157
- package/tsconfig.test.json +0 -18
- package/tslint.json +0 -139
|
@@ -1,152 +1,152 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
5
|
-
|
|
6
|
-
exports
|
|
7
|
-
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
let
|
|
18
|
-
let
|
|
19
|
-
let
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
...
|
|
96
|
-
...
|
|
97
|
-
...
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
//
|
|
126
|
-
//
|
|
127
|
-
//
|
|
128
|
-
//
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
3
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5
|
+
};
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.encode = void 0;
|
|
8
|
+
const moment_1 = __importDefault(require("moment"));
|
|
9
|
+
const config_1 = require("./config");
|
|
10
|
+
function getReference(url) {
|
|
11
|
+
return {
|
|
12
|
+
reference: url
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
function encode(ID, patientReference, custodianReference, deviceReference, medicationStatementReference, ImmunizationReferences, AllergyIntoleranceReferences, ConditionReferences) {
|
|
16
|
+
const now = (0, moment_1.default)();
|
|
17
|
+
let Immunization = [];
|
|
18
|
+
let conditions = [];
|
|
19
|
+
let medications = [];
|
|
20
|
+
let allergyIntolerance = [];
|
|
21
|
+
Immunization = [{
|
|
22
|
+
title: 'Vacunas',
|
|
23
|
+
text: {
|
|
24
|
+
status: 'generated',
|
|
25
|
+
div: '<div xmlns="http://www.w3.org/1999/xhtml">Sección referida a la vacunación del paciente </div>'
|
|
26
|
+
},
|
|
27
|
+
code: {
|
|
28
|
+
coding: [
|
|
29
|
+
{
|
|
30
|
+
system: 'http://loinc.org',
|
|
31
|
+
display: 'Immunization record',
|
|
32
|
+
code: '60484-3'
|
|
33
|
+
}
|
|
34
|
+
]
|
|
35
|
+
},
|
|
36
|
+
entry: ImmunizationReferences ? ImmunizationReferences.map(getReference) : []
|
|
37
|
+
}];
|
|
38
|
+
medications = [{
|
|
39
|
+
title: 'Medicamentos',
|
|
40
|
+
text: {
|
|
41
|
+
status: 'generated',
|
|
42
|
+
div: '<div xmlns="http://www.w3.org/1999/xhtml">Registro de medicamentos</div>'
|
|
43
|
+
},
|
|
44
|
+
code: {
|
|
45
|
+
coding: [
|
|
46
|
+
{
|
|
47
|
+
system: 'http://loinc.org',
|
|
48
|
+
display: 'Medication use',
|
|
49
|
+
code: '10160-0'
|
|
50
|
+
}
|
|
51
|
+
]
|
|
52
|
+
},
|
|
53
|
+
entry: medicationStatementReference ? medicationStatementReference.map(getReference) : [],
|
|
54
|
+
}];
|
|
55
|
+
allergyIntolerance = [{
|
|
56
|
+
title: 'Alergias o Intolerancias',
|
|
57
|
+
text: {
|
|
58
|
+
status: 'generated',
|
|
59
|
+
div: '<div xmlns="http://www.w3.org/1999/xhtml">Registro de Alergias</div>'
|
|
60
|
+
},
|
|
61
|
+
code: {
|
|
62
|
+
coding: [
|
|
63
|
+
{
|
|
64
|
+
system: 'http://loinc.org',
|
|
65
|
+
display: 'Allergies and/or adverse reactions',
|
|
66
|
+
code: '48765-2'
|
|
67
|
+
}
|
|
68
|
+
]
|
|
69
|
+
},
|
|
70
|
+
entry: AllergyIntoleranceReferences ? AllergyIntoleranceReferences.map(getReference) : [],
|
|
71
|
+
}];
|
|
72
|
+
conditions = [{
|
|
73
|
+
code: {
|
|
74
|
+
coding: [
|
|
75
|
+
{
|
|
76
|
+
system: 'http://loinc.org',
|
|
77
|
+
display: 'Problem list',
|
|
78
|
+
code: '11450-4'
|
|
79
|
+
}
|
|
80
|
+
]
|
|
81
|
+
},
|
|
82
|
+
entry: ConditionReferences ? ConditionReferences.map(getReference) : [],
|
|
83
|
+
title: 'Problemas activos',
|
|
84
|
+
text: {
|
|
85
|
+
status: 'generated',
|
|
86
|
+
div: '<div xmlns="http://www.w3.org/1999/xhtml">Lista de problemas activos (trastornos)</div>'
|
|
87
|
+
}
|
|
88
|
+
}];
|
|
89
|
+
return {
|
|
90
|
+
id: ID,
|
|
91
|
+
subject: {
|
|
92
|
+
reference: patientReference
|
|
93
|
+
},
|
|
94
|
+
section: [
|
|
95
|
+
...conditions,
|
|
96
|
+
...medications,
|
|
97
|
+
...Immunization,
|
|
98
|
+
...allergyIntolerance
|
|
99
|
+
],
|
|
100
|
+
resourceType: 'Composition',
|
|
101
|
+
author: [
|
|
102
|
+
{
|
|
103
|
+
identifier: {
|
|
104
|
+
system: 'https://federador.msal.gob.ar/uri',
|
|
105
|
+
value: deviceReference
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
],
|
|
109
|
+
confidentiality: 'N',
|
|
110
|
+
type: {
|
|
111
|
+
coding: [
|
|
112
|
+
{
|
|
113
|
+
system: 'http://loinc.org',
|
|
114
|
+
display: 'Patient Summary',
|
|
115
|
+
code: '60591-5'
|
|
116
|
+
}
|
|
117
|
+
]
|
|
118
|
+
},
|
|
119
|
+
title: 'Resumen del paciente al ' + now.format('DD/MM/YYYY, HH:mm'),
|
|
120
|
+
identifier: {
|
|
121
|
+
system: (0, config_1.makeUrl)('Composition'),
|
|
122
|
+
value: ID
|
|
123
|
+
},
|
|
124
|
+
date: now,
|
|
125
|
+
// meta: {
|
|
126
|
+
// profile: [
|
|
127
|
+
// 'http:\/\/hl7.org\/fhir\/uv\/ips\/StructureDefinition\/composition-uv-ips'
|
|
128
|
+
// ]
|
|
129
|
+
// },
|
|
130
|
+
text: {
|
|
131
|
+
status: 'generated',
|
|
132
|
+
div: '<div xmlns="http://www.w3.org/1999/xhtml">IPS Neuquen</div>'
|
|
133
|
+
},
|
|
134
|
+
custodian: {
|
|
135
|
+
identifier: {
|
|
136
|
+
system: 'https://federador.msal.gob.ar/uri',
|
|
137
|
+
value: custodianReference
|
|
138
|
+
}
|
|
139
|
+
},
|
|
140
|
+
attester: [
|
|
141
|
+
{
|
|
142
|
+
mode: 'legal',
|
|
143
|
+
time: now,
|
|
144
|
+
party: {
|
|
145
|
+
reference: custodianReference
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
],
|
|
149
|
+
status: 'final'
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
exports.encode = encode;
|
|
@@ -1,80 +1,79 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
function encode(patientReference, registro) {
|
|
9
|
-
return {
|
|
10
|
-
id: registro._id,
|
|
11
|
-
category: [
|
|
12
|
-
{
|
|
13
|
-
coding: [
|
|
14
|
-
{
|
|
15
|
-
system: 'http://loinc.org',
|
|
16
|
-
display: 'Problem',
|
|
17
|
-
code: '75326-9'
|
|
18
|
-
}
|
|
19
|
-
]
|
|
20
|
-
}
|
|
21
|
-
],
|
|
22
|
-
subject: {
|
|
23
|
-
reference: patientReference
|
|
24
|
-
},
|
|
25
|
-
onsetDateTime: registro.createdAt.getFullYear(),
|
|
26
|
-
resourceType: 'Condition',
|
|
27
|
-
// Por el momento ponemos 'confirmed'
|
|
28
|
-
verificationStatus: {
|
|
29
|
-
coding: [
|
|
30
|
-
{
|
|
31
|
-
system: 'http://terminology.hl7.org//CodeSystem//condition-ver-status',
|
|
32
|
-
code: 'confirmed'
|
|
33
|
-
}
|
|
34
|
-
]
|
|
35
|
-
},
|
|
36
|
-
code: {
|
|
37
|
-
coding: [
|
|
38
|
-
{
|
|
39
|
-
code: registro.concepto.conceptId,
|
|
40
|
-
system: 'http://snomed.info/sct',
|
|
41
|
-
display: registro.concepto.fsn
|
|
42
|
-
}
|
|
43
|
-
]
|
|
44
|
-
},
|
|
45
|
-
recordedDate: registro.createdAt,
|
|
46
|
-
meta: {
|
|
47
|
-
profile: [
|
|
48
|
-
'http://hl7.org/fhir/uv/ips/StructureDefinition/condition-uv-ips'
|
|
49
|
-
]
|
|
50
|
-
},
|
|
51
|
-
text: {
|
|
52
|
-
status: 'generated',
|
|
53
|
-
div: `<div xmlns="http://www.w3.org/1999/xhtml"><p><b>Generated Narrative with Details</b></p><p><b>id</b>: Problema: </p><p>${registro.nombre}</p></div>`
|
|
54
|
-
},
|
|
55
|
-
severity: {
|
|
56
|
-
coding: [
|
|
57
|
-
{
|
|
58
|
-
system: 'http://loinc.org',
|
|
59
|
-
display: 'Moderate',
|
|
60
|
-
code: 'LA6751-7'
|
|
61
|
-
}
|
|
62
|
-
]
|
|
63
|
-
},
|
|
64
|
-
clinicalStatus: {
|
|
65
|
-
coding: [
|
|
66
|
-
{
|
|
67
|
-
system: 'http://terminology.hl7.org/CodeSystem/condition-clinical',
|
|
68
|
-
code: registro.valor.estado // [TODO] Tenemos este dato.
|
|
69
|
-
},
|
|
70
|
-
{
|
|
71
|
-
system: 'http://terminology.hl7.org/CodeSystem/evolution',
|
|
72
|
-
// code: registro.valor.evolucion.replace('<p>','').replace('</p>','') // [TODO] Tenemos este dato.
|
|
73
|
-
code: registro.valor.evolucion // [TODO] Tenemos este dato.
|
|
74
|
-
}
|
|
75
|
-
]
|
|
76
|
-
}
|
|
77
|
-
};
|
|
78
|
-
}
|
|
79
|
-
exports.encode = encode;
|
|
80
|
-
//# sourceMappingURL=condition.js.map
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
*
|
|
4
|
+
* @param registro Registro RUP a transformar a FHIR
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.encode = void 0;
|
|
8
|
+
function encode(patientReference, registro) {
|
|
9
|
+
return {
|
|
10
|
+
id: registro._id,
|
|
11
|
+
category: [
|
|
12
|
+
{
|
|
13
|
+
coding: [
|
|
14
|
+
{
|
|
15
|
+
system: 'http://loinc.org',
|
|
16
|
+
display: 'Problem',
|
|
17
|
+
code: '75326-9'
|
|
18
|
+
}
|
|
19
|
+
]
|
|
20
|
+
}
|
|
21
|
+
],
|
|
22
|
+
subject: {
|
|
23
|
+
reference: patientReference
|
|
24
|
+
},
|
|
25
|
+
onsetDateTime: registro.createdAt.getFullYear(), // [TODO] No va solo el año
|
|
26
|
+
resourceType: 'Condition',
|
|
27
|
+
// Por el momento ponemos 'confirmed'
|
|
28
|
+
verificationStatus: {
|
|
29
|
+
coding: [
|
|
30
|
+
{
|
|
31
|
+
system: 'http://terminology.hl7.org//CodeSystem//condition-ver-status',
|
|
32
|
+
code: 'confirmed'
|
|
33
|
+
}
|
|
34
|
+
]
|
|
35
|
+
},
|
|
36
|
+
code: {
|
|
37
|
+
coding: [
|
|
38
|
+
{
|
|
39
|
+
code: registro.concepto.conceptId,
|
|
40
|
+
system: 'http://snomed.info/sct',
|
|
41
|
+
display: registro.concepto.fsn
|
|
42
|
+
}
|
|
43
|
+
]
|
|
44
|
+
},
|
|
45
|
+
recordedDate: registro.createdAt,
|
|
46
|
+
meta: {
|
|
47
|
+
profile: [
|
|
48
|
+
'http://hl7.org/fhir/uv/ips/StructureDefinition/condition-uv-ips'
|
|
49
|
+
]
|
|
50
|
+
},
|
|
51
|
+
text: {
|
|
52
|
+
status: 'generated',
|
|
53
|
+
div: `<div xmlns="http://www.w3.org/1999/xhtml"><p><b>Generated Narrative with Details</b></p><p><b>id</b>: Problema: </p><p>${registro.nombre}</p></div>`
|
|
54
|
+
},
|
|
55
|
+
severity: {
|
|
56
|
+
coding: [
|
|
57
|
+
{
|
|
58
|
+
system: 'http://loinc.org',
|
|
59
|
+
display: 'Moderate',
|
|
60
|
+
code: 'LA6751-7'
|
|
61
|
+
}
|
|
62
|
+
]
|
|
63
|
+
},
|
|
64
|
+
clinicalStatus: {
|
|
65
|
+
coding: [
|
|
66
|
+
{
|
|
67
|
+
system: 'http://terminology.hl7.org/CodeSystem/condition-clinical',
|
|
68
|
+
code: registro.valor.estado // [TODO] Tenemos este dato.
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
system: 'http://terminology.hl7.org/CodeSystem/evolution',
|
|
72
|
+
// code: registro.valor.evolucion.replace('<p>','').replace('</p>','') // [TODO] Tenemos este dato.
|
|
73
|
+
code: registro.valor.evolucion // [TODO] Tenemos este dato.
|
|
74
|
+
}
|
|
75
|
+
]
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
exports.encode = encode;
|
|
@@ -1,21 +1,27 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.makeUrl = exports.getDominio = exports.initialize = void 0;
|
|
4
|
-
let DOMINIO = 'andes.gob.ar';
|
|
5
|
-
function initialize(
|
|
6
|
-
DOMINIO = dominio;
|
|
7
|
-
}
|
|
8
|
-
exports.initialize = initialize;
|
|
9
|
-
function getDominio() {
|
|
10
|
-
return DOMINIO;
|
|
11
|
-
}
|
|
12
|
-
exports.getDominio = getDominio;
|
|
13
|
-
function makeUrl(resource, id
|
|
14
|
-
let url = `${DOMINIO}/${resource}`;
|
|
15
|
-
if (id) {
|
|
16
|
-
url += `/${id}`;
|
|
17
|
-
}
|
|
18
|
-
return url;
|
|
19
|
-
}
|
|
20
|
-
exports.makeUrl = makeUrl;
|
|
21
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.__reset = exports.makeUrl = exports.getDominio = exports.initialize = void 0;
|
|
4
|
+
let DOMINIO = 'andes.gob.ar';
|
|
5
|
+
function initialize(config) {
|
|
6
|
+
DOMINIO = config.dominio;
|
|
7
|
+
}
|
|
8
|
+
exports.initialize = initialize;
|
|
9
|
+
function getDominio() {
|
|
10
|
+
return DOMINIO;
|
|
11
|
+
}
|
|
12
|
+
exports.getDominio = getDominio;
|
|
13
|
+
function makeUrl(resource, id) {
|
|
14
|
+
let url = `${DOMINIO}/${resource}`;
|
|
15
|
+
if (id) {
|
|
16
|
+
url += `/${id}`;
|
|
17
|
+
}
|
|
18
|
+
return url;
|
|
19
|
+
}
|
|
20
|
+
exports.makeUrl = makeUrl;
|
|
21
|
+
/**
|
|
22
|
+
* Reseteo explícito para tests
|
|
23
|
+
*/
|
|
24
|
+
function __reset() {
|
|
25
|
+
DOMINIO = 'andes.gob.ar';
|
|
26
|
+
}
|
|
27
|
+
exports.__reset = __reset;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const config_1 = require("./config");
|
|
4
|
+
beforeEach(() => {
|
|
5
|
+
(0, config_1.__reset)(); // Resetea el dominio antes de cada test
|
|
6
|
+
});
|
|
7
|
+
test('Get default domain', () => {
|
|
8
|
+
expect((0, config_1.getDominio)()).toBe('andes.gob.ar');
|
|
9
|
+
});
|
|
10
|
+
test('Get default URL without id', () => {
|
|
11
|
+
expect((0, config_1.makeUrl)('patient')).toBe('andes.gob.ar/patient');
|
|
12
|
+
});
|
|
13
|
+
test('Get default URL with id', () => {
|
|
14
|
+
expect((0, config_1.makeUrl)('patient', '123456')).toBe('andes.gob.ar/patient/123456');
|
|
15
|
+
});
|
|
16
|
+
test('Initialize domain modifies getDominio', () => {
|
|
17
|
+
(0, config_1.initialize)({ dominio: 'nuevo-dominio.com' });
|
|
18
|
+
expect((0, config_1.getDominio)()).toBe('nuevo-dominio.com');
|
|
19
|
+
});
|
|
@@ -1,39 +1,38 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.encode = void 0;
|
|
4
|
-
const config_1 = require("./config");
|
|
5
|
-
function encode() {
|
|
6
|
-
/**
|
|
7
|
-
* HARDCODE DEVICE
|
|
8
|
-
*/
|
|
9
|
-
return {
|
|
10
|
-
resourceType: 'Device',
|
|
11
|
-
id: 'device-01',
|
|
12
|
-
identifier: [
|
|
13
|
-
{
|
|
14
|
-
system: config_1.makeUrl('Device'),
|
|
15
|
-
value: 'device-01'
|
|
16
|
-
}
|
|
17
|
-
],
|
|
18
|
-
type: {
|
|
19
|
-
coding: [
|
|
20
|
-
{
|
|
21
|
-
system: 'http://snomed.info/sct',
|
|
22
|
-
code: '462894001',
|
|
23
|
-
display: 'software de aplicación de sistema de información de historias clínicas de pacientes (objeto físico)'
|
|
24
|
-
}
|
|
25
|
-
]
|
|
26
|
-
},
|
|
27
|
-
owner: {
|
|
28
|
-
reference: 'http://argentina.gob.ar/salud/refes/14999912399913'
|
|
29
|
-
},
|
|
30
|
-
deviceName: [
|
|
31
|
-
{
|
|
32
|
-
name: 'Sistema de Aplicaciones Neuquinas de Salud (ANDES)',
|
|
33
|
-
type: 'manufacturer-name'
|
|
34
|
-
}
|
|
35
|
-
]
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
exports.encode = encode;
|
|
39
|
-
//# sourceMappingURL=device.js.map
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.encode = void 0;
|
|
4
|
+
const config_1 = require("./config");
|
|
5
|
+
function encode() {
|
|
6
|
+
/**
|
|
7
|
+
* HARDCODE DEVICE
|
|
8
|
+
*/
|
|
9
|
+
return {
|
|
10
|
+
resourceType: 'Device',
|
|
11
|
+
id: 'device-01',
|
|
12
|
+
identifier: [
|
|
13
|
+
{
|
|
14
|
+
system: (0, config_1.makeUrl)('Device'),
|
|
15
|
+
value: 'device-01'
|
|
16
|
+
}
|
|
17
|
+
],
|
|
18
|
+
type: {
|
|
19
|
+
coding: [
|
|
20
|
+
{
|
|
21
|
+
system: 'http://snomed.info/sct',
|
|
22
|
+
code: '462894001',
|
|
23
|
+
display: 'software de aplicación de sistema de información de historias clínicas de pacientes (objeto físico)'
|
|
24
|
+
}
|
|
25
|
+
]
|
|
26
|
+
},
|
|
27
|
+
owner: {
|
|
28
|
+
reference: 'http://argentina.gob.ar/salud/refes/14999912399913'
|
|
29
|
+
},
|
|
30
|
+
deviceName: [
|
|
31
|
+
{
|
|
32
|
+
name: 'Sistema de Aplicaciones Neuquinas de Salud (ANDES)',
|
|
33
|
+
type: 'manufacturer-name'
|
|
34
|
+
}
|
|
35
|
+
]
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
exports.encode = encode;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const device_1 = require("./device");
|
|
4
|
+
test('Device type 1', () => {
|
|
5
|
+
expect((0, device_1.encode)().id).toBe('device-01');
|
|
6
|
+
});
|
|
7
|
+
test('Device Name', () => {
|
|
8
|
+
expect((0, device_1.encode)().deviceName[0].name).toBe('Sistema de Aplicaciones Neuquinas de Salud (ANDES)');
|
|
9
|
+
});
|