@andes/fhir 1.13.0-beta.1 → 1.13.0-beta.11
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/dist/constants/identifier-systems.d.ts +13 -0
- package/dist/constants/identifier-systems.js +16 -0
- package/dist/index.js +17 -7
- package/dist/lib/allergyIntolerance.d.ts +12 -0
- package/dist/lib/allergyIntolerance.js +18 -3
- package/dist/lib/bundle.d.ts +1 -1
- package/dist/lib/bundle.js +4 -8
- package/dist/lib/composition.d.ts +7 -12
- package/dist/lib/composition.js +189 -92
- package/dist/lib/condition.d.ts +1 -49
- package/dist/lib/condition.js +43 -39
- package/dist/lib/config.js +7 -7
- package/dist/lib/device.d.ts +5 -1
- package/dist/lib/device.js +8 -5
- package/dist/lib/document-reference.js +2 -7
- package/dist/lib/immunization.d.ts +1 -38
- package/dist/lib/immunization.js +54 -42
- package/dist/lib/medication.js +1 -2
- package/dist/lib/medicationRequest.d.ts +2 -2
- package/dist/lib/medicationRequest.js +4 -8
- package/dist/lib/medicationStatement.js +2 -3
- package/dist/lib/organization.js +30 -13
- package/dist/lib/patient.js +31 -17
- package/dist/lib/practitioner.d.ts +0 -3
- package/dist/lib/practitioner.js +56 -30
- package/dist/types/andes/practitioner.types.d.ts +3 -2
- package/dist/utils/fhirDate.d.ts +3 -0
- package/dist/utils/fhirDate.js +24 -0
- package/dist/utils/rankingMapping.js +2 -3
- package/package.json +11 -13
- package/dist/data/patient.json +0 -192
- package/dist/helpers/patientFactory.d.ts +0 -26
- package/dist/helpers/patientFactory.js +0 -35
- package/dist/lib/config.test.d.ts +0 -1
- package/dist/lib/config.test.js +0 -19
- package/dist/lib/device.test.d.ts +0 -1
- package/dist/lib/device.test.js +0 -9
- package/dist/lib/patient.test.d.ts +0 -1
- package/dist/lib/patient.test.js +0 -132
package/dist/lib/patient.js
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.encode = encode;
|
|
4
|
+
exports.decode = decode;
|
|
5
|
+
exports.verify = verify;
|
|
4
6
|
const config_1 = require("./config");
|
|
5
7
|
const rankingMapping_1 = require("../utils/rankingMapping");
|
|
8
|
+
const identifier_systems_1 = require("../constants/identifier-systems");
|
|
6
9
|
/**
|
|
7
10
|
* Helpers
|
|
8
11
|
*/
|
|
@@ -116,26 +119,26 @@ function encode(patient) {
|
|
|
116
119
|
});
|
|
117
120
|
if (patient.documento) {
|
|
118
121
|
identificadores.push({
|
|
119
|
-
system:
|
|
122
|
+
system: identifier_systems_1.FhirIdentifierSystems.DNI,
|
|
120
123
|
value: patient.documento
|
|
121
124
|
});
|
|
122
125
|
}
|
|
123
126
|
if (patient.cuil) {
|
|
124
127
|
identificadores.push({
|
|
125
|
-
system:
|
|
128
|
+
system: identifier_systems_1.FhirIdentifierSystems.CUIL,
|
|
126
129
|
value: patient.cuil
|
|
127
130
|
});
|
|
128
131
|
}
|
|
129
132
|
if (patient.numeroIdentificacion) {
|
|
130
133
|
if (patient.tipoIdentificacion === 'dni extranjero') {
|
|
131
134
|
identificadores.push({
|
|
132
|
-
system:
|
|
135
|
+
system: identifier_systems_1.FhirIdentifierSystems.FOREIGN_ID,
|
|
133
136
|
value: patient.numeroIdentificacion
|
|
134
137
|
});
|
|
135
138
|
}
|
|
136
139
|
if (patient.tipoIdentificacion === 'pasaporte') {
|
|
137
140
|
identificadores.push({
|
|
138
|
-
system:
|
|
141
|
+
system: identifier_systems_1.FhirIdentifierSystems.PASSPORT,
|
|
139
142
|
value: patient.numeroIdentificacion
|
|
140
143
|
});
|
|
141
144
|
}
|
|
@@ -172,13 +175,23 @@ function encode(patient) {
|
|
|
172
175
|
const country = typeof unaDireccion.ubicacion.pais === 'object'
|
|
173
176
|
? unaDireccion.ubicacion.pais?.nombre
|
|
174
177
|
: unaDireccion.ubicacion.pais;
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
line
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
}
|
|
178
|
+
const address = {};
|
|
179
|
+
if (unaDireccion.valor?.trim()) {
|
|
180
|
+
address.line = [unaDireccion.valor.trim()];
|
|
181
|
+
}
|
|
182
|
+
if (unaDireccion.codigoPostal && String(unaDireccion.codigoPostal).trim()) {
|
|
183
|
+
address.postalCode = String(unaDireccion.codigoPostal).trim();
|
|
184
|
+
}
|
|
185
|
+
if (city?.trim()) {
|
|
186
|
+
address.city = city.trim();
|
|
187
|
+
}
|
|
188
|
+
if (state?.trim()) {
|
|
189
|
+
address.state = state.trim();
|
|
190
|
+
}
|
|
191
|
+
if (country?.trim()) {
|
|
192
|
+
address.country = country.trim();
|
|
193
|
+
}
|
|
194
|
+
return address;
|
|
182
195
|
});
|
|
183
196
|
// Relaciones → contact
|
|
184
197
|
const relacionesFHIR = (patient.relaciones ?? [])
|
|
@@ -204,6 +217,10 @@ function encode(patient) {
|
|
|
204
217
|
const pacienteFHIR = {
|
|
205
218
|
resourceType: 'Patient',
|
|
206
219
|
id: patient._id ?? patient.id,
|
|
220
|
+
text: {
|
|
221
|
+
status: 'generated',
|
|
222
|
+
div: `<div xmlns="http://www.w3.org/1999/xhtml"><p>${`${patient.nombre || ''} ${patient.apellido || ''}`.trim()}</p></div>`
|
|
223
|
+
},
|
|
207
224
|
identifier: identificadores,
|
|
208
225
|
active: patient.activo ?? undefined,
|
|
209
226
|
name: [{
|
|
@@ -248,7 +265,6 @@ function encode(patient) {
|
|
|
248
265
|
}
|
|
249
266
|
return pacienteFHIR;
|
|
250
267
|
}
|
|
251
|
-
exports.encode = encode;
|
|
252
268
|
/**
|
|
253
269
|
* Decode a patient from FHIR to ANDES
|
|
254
270
|
*/
|
|
@@ -264,7 +280,7 @@ function decode(patient) {
|
|
|
264
280
|
const element = items.find(el => el.system === key);
|
|
265
281
|
return element?.value;
|
|
266
282
|
}
|
|
267
|
-
const tiposIdentificacion = [
|
|
283
|
+
const tiposIdentificacion = [identifier_systems_1.FhirIdentifierSystems.FOREIGN_ID, identifier_systems_1.FhirIdentifierSystems.PASSPORT];
|
|
268
284
|
const tipoAndes = ['dni extranjero', 'pasaporte'];
|
|
269
285
|
let tipoIdentificacion;
|
|
270
286
|
let numeroIdentificacion;
|
|
@@ -286,7 +302,7 @@ function decode(patient) {
|
|
|
286
302
|
: '';
|
|
287
303
|
const pacienteAndes = {
|
|
288
304
|
id: getValue(patient.identifier, (0, config_1.makeUrl)('Patient')) ?? patient.id,
|
|
289
|
-
documento: getValue(patient.identifier,
|
|
305
|
+
documento: getValue(patient.identifier, identifier_systems_1.FhirIdentifierSystems.DNI),
|
|
290
306
|
tipoIdentificacion,
|
|
291
307
|
numeroIdentificacion,
|
|
292
308
|
nombre,
|
|
@@ -371,7 +387,6 @@ function decode(patient) {
|
|
|
371
387
|
}
|
|
372
388
|
return pacienteAndes;
|
|
373
389
|
}
|
|
374
|
-
exports.decode = decode;
|
|
375
390
|
/**
|
|
376
391
|
* Verify if a patient has a FHIR format
|
|
377
392
|
*/
|
|
@@ -440,7 +455,6 @@ function verify(patient) {
|
|
|
440
455
|
}
|
|
441
456
|
return respuesta;
|
|
442
457
|
}
|
|
443
|
-
exports.verify = verify;
|
|
444
458
|
/**
|
|
445
459
|
* Verify helpers
|
|
446
460
|
*/
|
|
@@ -1,6 +1,3 @@
|
|
|
1
1
|
import { Practitioner } from 'fhir/r4';
|
|
2
2
|
import { AndesPractitioner } from '../types/andes/practitioner.types';
|
|
3
|
-
/**
|
|
4
|
-
* Encode a practitioner from ANDES to FHIR
|
|
5
|
-
*/
|
|
6
3
|
export declare function encode(practitioner: AndesPractitioner | null | undefined): Practitioner | null;
|
package/dist/lib/practitioner.js
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.encode =
|
|
3
|
+
exports.encode = encode;
|
|
4
4
|
const config_1 = require("./config");
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
*/
|
|
5
|
+
const fhirDate_1 = require("../utils/fhirDate");
|
|
6
|
+
const rankingMapping_1 = require("../utils/rankingMapping");
|
|
8
7
|
function encode(practitioner) {
|
|
9
8
|
const data = practitioner;
|
|
10
9
|
if (!data) {
|
|
@@ -36,7 +35,7 @@ function encode(practitioner) {
|
|
|
36
35
|
const contactos = (data.contacto ?? []).map((unContacto) => {
|
|
37
36
|
const cont = {
|
|
38
37
|
value: unContacto.valor,
|
|
39
|
-
rank: unContacto.ranking
|
|
38
|
+
rank: (0, rankingMapping_1.mapAndesRankingToFhirRank)(unContacto.ranking)
|
|
40
39
|
};
|
|
41
40
|
switch (unContacto.tipo) {
|
|
42
41
|
case 'fijo':
|
|
@@ -53,13 +52,26 @@ function encode(practitioner) {
|
|
|
53
52
|
// Direcciones → address
|
|
54
53
|
// -----------------------------
|
|
55
54
|
const direcciones = (data.domicilios ?? []).map((unDomicilio) => {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
}
|
|
55
|
+
const address = {};
|
|
56
|
+
const city = unDomicilio.ubicacion?.localidad?.nombre;
|
|
57
|
+
const state = unDomicilio.ubicacion?.provincia?.nombre;
|
|
58
|
+
const country = unDomicilio.ubicacion?.pais?.nombre;
|
|
59
|
+
if (unDomicilio.valor?.trim()) {
|
|
60
|
+
address.line = [unDomicilio.valor.trim()];
|
|
61
|
+
}
|
|
62
|
+
if (unDomicilio.codigoPostal && String(unDomicilio.codigoPostal).trim()) {
|
|
63
|
+
address.postalCode = String(unDomicilio.codigoPostal).trim();
|
|
64
|
+
}
|
|
65
|
+
if (city?.trim()) {
|
|
66
|
+
address.city = city.trim();
|
|
67
|
+
}
|
|
68
|
+
if (state?.trim()) {
|
|
69
|
+
address.state = state.trim();
|
|
70
|
+
}
|
|
71
|
+
if (country?.trim()) {
|
|
72
|
+
address.country = country.trim();
|
|
73
|
+
}
|
|
74
|
+
return address;
|
|
63
75
|
});
|
|
64
76
|
// -----------------------------
|
|
65
77
|
// Relaciones (hoy no se usan en Practitioner)
|
|
@@ -78,7 +90,7 @@ function encode(practitioner) {
|
|
|
78
90
|
identifier: datosGrado.profesion.nombre
|
|
79
91
|
? [{
|
|
80
92
|
system: 'https://www.saludneuquen.gob.ar/matriculacionGrado',
|
|
81
|
-
value: datosGrado.profesion.nombre
|
|
93
|
+
value: String(datosGrado.profesion.nombre ?? '')
|
|
82
94
|
}]
|
|
83
95
|
: []
|
|
84
96
|
};
|
|
@@ -86,15 +98,22 @@ function encode(practitioner) {
|
|
|
86
98
|
unaMatricula.code = {
|
|
87
99
|
coding: [{
|
|
88
100
|
system: 'http://www.saludneuquen.gob.ar/fiscalizacion.html',
|
|
89
|
-
code: datosGrado.profesion.codigo,
|
|
90
|
-
display: datosGrado.profesion.tipoDeFormacion
|
|
101
|
+
code: String(datosGrado.profesion.codigo ?? ''),
|
|
102
|
+
display: String(datosGrado.profesion.tipoDeFormacion ?? '')
|
|
91
103
|
}],
|
|
92
|
-
text: ultima.matriculaNumero
|
|
93
|
-
};
|
|
94
|
-
unaMatricula.period = {
|
|
95
|
-
start: ultima.inicio ?? null,
|
|
96
|
-
end: ultima.fin ?? null
|
|
104
|
+
text: String(ultima.matriculaNumero ?? '')
|
|
97
105
|
};
|
|
106
|
+
const start = (0, fhirDate_1.formatFHIRDateTime)(ultima.inicio);
|
|
107
|
+
const end = (0, fhirDate_1.formatFHIRDateTime)(ultima.fin);
|
|
108
|
+
if (start || end) {
|
|
109
|
+
unaMatricula.period = {};
|
|
110
|
+
if (start) {
|
|
111
|
+
unaMatricula.period.start = start;
|
|
112
|
+
}
|
|
113
|
+
if (end) {
|
|
114
|
+
unaMatricula.period.end = end;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
98
117
|
}
|
|
99
118
|
return unaMatricula;
|
|
100
119
|
});
|
|
@@ -110,7 +129,7 @@ function encode(practitioner) {
|
|
|
110
129
|
identifier: datosPosgrado.especialidad.nombre
|
|
111
130
|
? [{
|
|
112
131
|
system: 'https://www.saludneuquen.gob.ar/matriculacionEspecialidad/',
|
|
113
|
-
value: datosPosgrado.especialidad.nombre
|
|
132
|
+
value: String(datosPosgrado.especialidad.nombre ?? '')
|
|
114
133
|
}]
|
|
115
134
|
: []
|
|
116
135
|
};
|
|
@@ -118,15 +137,22 @@ function encode(practitioner) {
|
|
|
118
137
|
unaMatricula.code = {
|
|
119
138
|
coding: [{
|
|
120
139
|
system: 'http://www.saludneuquen.gob.ar/fiscalizacion.html',
|
|
121
|
-
code: datosPosgrado.especialidad.codigo,
|
|
122
|
-
display: datosPosgrado.especialidad.
|
|
140
|
+
code: String(datosPosgrado.especialidad.codigo.sisa ?? ''),
|
|
141
|
+
display: String(datosPosgrado.especialidad.nombre ?? '')
|
|
123
142
|
}],
|
|
124
|
-
text: ultima.matriculaNumero
|
|
125
|
-
};
|
|
126
|
-
unaMatricula.period = {
|
|
127
|
-
start: ultima.inicio ?? null,
|
|
128
|
-
end: ultima.fin ?? null
|
|
143
|
+
text: String(ultima.matriculaNumero ?? '')
|
|
129
144
|
};
|
|
145
|
+
const start = (0, fhirDate_1.formatFHIRDateTime)(ultima.inicio);
|
|
146
|
+
const end = (0, fhirDate_1.formatFHIRDateTime)(ultima.fin);
|
|
147
|
+
if (start || end) {
|
|
148
|
+
unaMatricula.period = {};
|
|
149
|
+
if (start) {
|
|
150
|
+
unaMatricula.period.start = start;
|
|
151
|
+
}
|
|
152
|
+
if (end) {
|
|
153
|
+
unaMatricula.period.end = end;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
130
156
|
}
|
|
131
157
|
return unaMatricula;
|
|
132
158
|
});
|
|
@@ -155,6 +181,7 @@ function encode(practitioner) {
|
|
|
155
181
|
// -----------------------------
|
|
156
182
|
const profesionalFHIR = {
|
|
157
183
|
resourceType: 'Practitioner',
|
|
184
|
+
id: data._id,
|
|
158
185
|
identifier: identificadores,
|
|
159
186
|
active: data.habilitado ?? undefined,
|
|
160
187
|
name: [{
|
|
@@ -162,7 +189,7 @@ function encode(practitioner) {
|
|
|
162
189
|
given: data.nombre?.split(' ') ?? []
|
|
163
190
|
}],
|
|
164
191
|
gender: genero,
|
|
165
|
-
birthDate: data.fechaNacimiento,
|
|
192
|
+
birthDate: (0, fhirDate_1.formatFHIRDate)(data.fechaNacimiento),
|
|
166
193
|
};
|
|
167
194
|
if (contactos.length > 0) {
|
|
168
195
|
profesionalFHIR.telecom = contactos;
|
|
@@ -183,4 +210,3 @@ function encode(practitioner) {
|
|
|
183
210
|
}
|
|
184
211
|
return profesionalFHIR;
|
|
185
212
|
}
|
|
186
|
-
exports.encode = encode;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isValidFHIRDateTime = isValidFHIRDateTime;
|
|
4
|
+
exports.formatFHIRDateTime = formatFHIRDateTime;
|
|
5
|
+
exports.formatFHIRDate = formatFHIRDate;
|
|
6
|
+
function isValidFHIRDateTime(date) {
|
|
7
|
+
if (date === null || date === undefined || date === 0 || date === '0' || date === '') {
|
|
8
|
+
return false;
|
|
9
|
+
}
|
|
10
|
+
const d = new Date(date);
|
|
11
|
+
return !isNaN(d.getTime());
|
|
12
|
+
}
|
|
13
|
+
function formatFHIRDateTime(date) {
|
|
14
|
+
if (isValidFHIRDateTime(date)) {
|
|
15
|
+
return new Date(date).toISOString();
|
|
16
|
+
}
|
|
17
|
+
return undefined;
|
|
18
|
+
}
|
|
19
|
+
function formatFHIRDate(date) {
|
|
20
|
+
if (isValidFHIRDateTime(date)) {
|
|
21
|
+
return new Date(date).toISOString().split('T')[0];
|
|
22
|
+
}
|
|
23
|
+
return undefined;
|
|
24
|
+
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.mapAndesRankingToFhirRank = mapAndesRankingToFhirRank;
|
|
4
|
+
exports.mapFhirRankToAndesRanking = mapFhirRankToAndesRanking;
|
|
4
5
|
/**
|
|
5
6
|
* Mapea ANDES ranking base 1 a FHIR rank base 1
|
|
6
7
|
*/
|
|
@@ -9,7 +10,6 @@ function mapAndesRankingToFhirRank(andesRanking) {
|
|
|
9
10
|
? andesRanking + 1
|
|
10
11
|
: 1;
|
|
11
12
|
}
|
|
12
|
-
exports.mapAndesRankingToFhirRank = mapAndesRankingToFhirRank;
|
|
13
13
|
/**
|
|
14
14
|
* Mapea FHIR rank base 1 a ANDES ranking base 0
|
|
15
15
|
*/
|
|
@@ -18,4 +18,3 @@ function mapFhirRankToAndesRanking(fhirRank) {
|
|
|
18
18
|
? fhirRank - 1
|
|
19
19
|
: 0;
|
|
20
20
|
}
|
|
21
|
-
exports.mapFhirRankToAndesRanking = mapFhirRankToAndesRanking;
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@andes/fhir",
|
|
3
|
-
"version": "1.13.0-beta.
|
|
3
|
+
"version": "1.13.0-beta.11",
|
|
4
4
|
"engines": {
|
|
5
|
-
"node": ">=
|
|
5
|
+
"node": ">=24.0.0"
|
|
6
6
|
},
|
|
7
7
|
"engineStrict": true,
|
|
8
8
|
"main": "dist/index.js",
|
|
@@ -21,22 +21,20 @@
|
|
|
21
21
|
"release:prod:dry": "dotenv -e .env -- semantic-release --no-ci --branches master --dry-run"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
|
-
"@types/jest": "29.5.14",
|
|
25
|
-
"@types/node": "^
|
|
26
|
-
"@typescript-eslint/eslint-plugin": "^
|
|
27
|
-
"@typescript-eslint/parser": "^
|
|
24
|
+
"@types/jest": "^29.5.14",
|
|
25
|
+
"@types/node": "^24.0.0",
|
|
26
|
+
"@typescript-eslint/eslint-plugin": "^8.26.0",
|
|
27
|
+
"@typescript-eslint/parser": "^8.26.0",
|
|
28
28
|
"dotenv-cli": "^11.0.0",
|
|
29
|
-
"eslint": "^
|
|
30
|
-
"jest": "29.7.0",
|
|
29
|
+
"eslint": "^9.21.0",
|
|
30
|
+
"jest": "^29.7.0",
|
|
31
31
|
"rimraf": "^5.0.7",
|
|
32
32
|
"semantic-release": "^20.1.0",
|
|
33
|
-
"ts-jest": "29.2.5",
|
|
34
|
-
"
|
|
35
|
-
"typescript": "5.3.3"
|
|
33
|
+
"ts-jest": "^29.2.5",
|
|
34
|
+
"typescript": "^5.8.2"
|
|
36
35
|
},
|
|
37
36
|
"dependencies": {
|
|
38
|
-
"@types/fhir": "^0.0.41"
|
|
39
|
-
"moment": "2.29.4"
|
|
37
|
+
"@types/fhir": "^0.0.41"
|
|
40
38
|
},
|
|
41
39
|
"files": [
|
|
42
40
|
"dist/**/*"
|
package/dist/data/patient.json
DELETED
|
@@ -1,192 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"_id": "58d30d6fgbb1a96b254d9877",
|
|
3
|
-
"entidadesValidadoras": [
|
|
4
|
-
"RENAPER",
|
|
5
|
-
"Sisa"
|
|
6
|
-
],
|
|
7
|
-
"documento": "42910660",
|
|
8
|
-
"apellido": "PERINGA PONCE",
|
|
9
|
-
"nombre": "HUGO AGUSTIN",
|
|
10
|
-
"sexo": "masculino",
|
|
11
|
-
"fechaNacimiento": "1979-11-14T03:00:00.000-03:00",
|
|
12
|
-
"estado": "validado",
|
|
13
|
-
"genero": "masculino",
|
|
14
|
-
"financiador": [
|
|
15
|
-
{
|
|
16
|
-
"codigoPuco": 921001,
|
|
17
|
-
"nombre": "O.S.P. NEUQUEN",
|
|
18
|
-
"financiador": "O.S.P. NEUQUEN"
|
|
19
|
-
},
|
|
20
|
-
{
|
|
21
|
-
"codigoPuco": 921001,
|
|
22
|
-
"nombre": "O.S.P. NEUQUEN",
|
|
23
|
-
"financiador": "O.S.P. NEUQUEN"
|
|
24
|
-
}
|
|
25
|
-
],
|
|
26
|
-
"relaciones": [
|
|
27
|
-
{
|
|
28
|
-
"_id": "5b92dec9646d99436065cbfc",
|
|
29
|
-
"relacion": {
|
|
30
|
-
"_id": "59247c391ebf0273353b23c0",
|
|
31
|
-
"nombre": "hijo/a",
|
|
32
|
-
"opuesto": "progenitor/a"
|
|
33
|
-
},
|
|
34
|
-
"referencia": "5b92de583173b053ae88f2d0",
|
|
35
|
-
"nombre": "JOSEFINA",
|
|
36
|
-
"apellido": "PERINGA PONCE",
|
|
37
|
-
"documento": "333333333",
|
|
38
|
-
"fotoId": "5f9072d00254f253d9c7dd54"
|
|
39
|
-
},
|
|
40
|
-
{
|
|
41
|
-
"_id": "5b92dec9646d99436065cbfa",
|
|
42
|
-
"relacion": {
|
|
43
|
-
"_id": "59247c391ebf0273353b23c0",
|
|
44
|
-
"nombre": "hijo/a",
|
|
45
|
-
"opuesto": "progenitor/a"
|
|
46
|
-
},
|
|
47
|
-
"referencia": "5b9287f10394a225c25a150b",
|
|
48
|
-
"nombre": "IGNACIO",
|
|
49
|
-
"apellido": "PERINGA PONCE",
|
|
50
|
-
"documento": "222222222",
|
|
51
|
-
"fotoId": "5f9072d00254f253d9c7dd2c"
|
|
52
|
-
},
|
|
53
|
-
{
|
|
54
|
-
"_id": "5f00d31e044ef317c36fd4f8",
|
|
55
|
-
"relacion": {
|
|
56
|
-
"_id": "59247c391ebf0273353b23c0",
|
|
57
|
-
"nombre": "hijo/a",
|
|
58
|
-
"opuesto": "progenitor/a"
|
|
59
|
-
},
|
|
60
|
-
"referencia": "5f00d2f7acfe3a7e46a88227",
|
|
61
|
-
"nombre": "JUAN CRUZ",
|
|
62
|
-
"apellido": "PERINGA PONCE",
|
|
63
|
-
"documento": "11111111",
|
|
64
|
-
"fotoId": "5f9078ff0254f253d9dc7212"
|
|
65
|
-
},
|
|
66
|
-
{
|
|
67
|
-
"_id": "5f09f00d5cec191aa5908457",
|
|
68
|
-
"relacion": {
|
|
69
|
-
"_id": "59247e1c1ebf0273353b23c5",
|
|
70
|
-
"nombre": "otro",
|
|
71
|
-
"opuesto": "otro"
|
|
72
|
-
},
|
|
73
|
-
"referencia": "59cb176acd21ce293061b67b",
|
|
74
|
-
"nombre": "FLORENCIA INES",
|
|
75
|
-
"apellido": "YAMIL",
|
|
76
|
-
"documento": "15365478",
|
|
77
|
-
"fotoId": "5f9072b40254f253d9c79556"
|
|
78
|
-
}
|
|
79
|
-
],
|
|
80
|
-
"direccion": [
|
|
81
|
-
{
|
|
82
|
-
"geoReferencia": [
|
|
83
|
-
-38.9305707,
|
|
84
|
-
-68.0839758
|
|
85
|
-
],
|
|
86
|
-
"activo": true,
|
|
87
|
-
"_id": "58d90d6f0bb1a96b254d9878",
|
|
88
|
-
"valor": "Enrique Santos Discepolo 1856",
|
|
89
|
-
"codigoPostal": "8300",
|
|
90
|
-
"ubicacion": {
|
|
91
|
-
"_id": "58d90d6f0bb1a96b254d9879",
|
|
92
|
-
"pais": {
|
|
93
|
-
"_id": "57f3b5c469fe79a598e6281f",
|
|
94
|
-
"nombre": "Argentina"
|
|
95
|
-
},
|
|
96
|
-
"provincia": {
|
|
97
|
-
"_id": "57f3f3aacebd681cc2014c53",
|
|
98
|
-
"nombre": "Neuquén"
|
|
99
|
-
},
|
|
100
|
-
"localidad": {
|
|
101
|
-
"_id": "57f538a472325875a199a82d",
|
|
102
|
-
"nombre": "NEUQUEN"
|
|
103
|
-
},
|
|
104
|
-
"barrio": null
|
|
105
|
-
},
|
|
106
|
-
"ranking": 0,
|
|
107
|
-
"ultimaActualizacion": "2017-03-27T10:02:16.809-03:00"
|
|
108
|
-
},
|
|
109
|
-
{
|
|
110
|
-
"geoReferencia": null,
|
|
111
|
-
"activo": true,
|
|
112
|
-
"_id": "6046105ba4e2d85f81ad60f7",
|
|
113
|
-
"valor": "NORDENSTROM 1898 0 0",
|
|
114
|
-
"codigoPostal": "8300",
|
|
115
|
-
"ranking": 1,
|
|
116
|
-
"ubicacion": {
|
|
117
|
-
"_id": "6046105ba4e2d85f81ad60f8",
|
|
118
|
-
"pais": {
|
|
119
|
-
"_id": "57f3b5c469fe79a598e6281f",
|
|
120
|
-
"nombre": "Argentina"
|
|
121
|
-
},
|
|
122
|
-
"provincia": {
|
|
123
|
-
"_id": "57f3f3aacebd681cc2014c53",
|
|
124
|
-
"nombre": "Neuquén"
|
|
125
|
-
},
|
|
126
|
-
"localidad": {
|
|
127
|
-
"_id": "57f538a472325875a199a82d",
|
|
128
|
-
"nombre": "Neuquén"
|
|
129
|
-
},
|
|
130
|
-
"barrio": null
|
|
131
|
-
},
|
|
132
|
-
"ultimaActualizacion": "2021-03-08T08:54:04.089-03:00"
|
|
133
|
-
}
|
|
134
|
-
],
|
|
135
|
-
"contacto": [
|
|
136
|
-
{
|
|
137
|
-
"activo": true,
|
|
138
|
-
"_id": "5cabf8cc129519c9cd5bf6f2",
|
|
139
|
-
"tipo": "celular",
|
|
140
|
-
"valor": "4462221"
|
|
141
|
-
},
|
|
142
|
-
{
|
|
143
|
-
"activo": true,
|
|
144
|
-
"_id": "5cabf8cc129519c9cd5bf6f1",
|
|
145
|
-
"tipo": "email",
|
|
146
|
-
"valor": "hugoperingaponce@gmail.com"
|
|
147
|
-
}
|
|
148
|
-
],
|
|
149
|
-
"identificadores": [
|
|
150
|
-
{
|
|
151
|
-
"entidad": "RENAPER",
|
|
152
|
-
"valor": "241654536"
|
|
153
|
-
}
|
|
154
|
-
],
|
|
155
|
-
"estadoCivil": "soltero",
|
|
156
|
-
"reportarError": false,
|
|
157
|
-
"scan": "27381849",
|
|
158
|
-
"carpetaEfectores": [
|
|
159
|
-
{
|
|
160
|
-
"_id": "5992e06a0e3f6446112e9bd5",
|
|
161
|
-
"organizacion": {
|
|
162
|
-
"_id": "59650203d03019f919ea31ed",
|
|
163
|
-
"nombre": "CENTRO DE SALUD PARQUE INDUSTRIAL"
|
|
164
|
-
},
|
|
165
|
-
"nroCarpeta": ""
|
|
166
|
-
},
|
|
167
|
-
{
|
|
168
|
-
"_id": "5b57565dc0202168d3d5762d",
|
|
169
|
-
"organizacion": {
|
|
170
|
-
"_id": "57e9670e52df311059bc8964",
|
|
171
|
-
"nombre": "HOSPITAL PROVINCIAL NEUQUEN - DR. EDUARDO CASTRO RENDON"
|
|
172
|
-
},
|
|
173
|
-
"nroCarpeta": "PDR27381849"
|
|
174
|
-
}
|
|
175
|
-
],
|
|
176
|
-
"notas": [],
|
|
177
|
-
"cuil": "23273818499",
|
|
178
|
-
"foto": null,
|
|
179
|
-
"activo": true,
|
|
180
|
-
"notaError": "",
|
|
181
|
-
"tipoIdentificacion": null,
|
|
182
|
-
"numeroIdentificacion": null,
|
|
183
|
-
"fotoId": "6046105c18944f849e9fe315",
|
|
184
|
-
"documentos": [],
|
|
185
|
-
"fechaFallecimiento": null,
|
|
186
|
-
"createdBy": {
|
|
187
|
-
"organizacion": {
|
|
188
|
-
"id": "50580352367779",
|
|
189
|
-
"nombre": "LABORATORIO RAÑA - SERVICIOS MEDICOS"
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { AndesPatient } from '../types/andes/patient.types';
|
|
2
|
-
export type PartialDeep<T> = {
|
|
3
|
-
[K in keyof T]?: T[K] extends object ? PartialDeep<T[K]> : T[K];
|
|
4
|
-
};
|
|
5
|
-
export declare const createPatient: (overrides?: PartialDeep<AndesPatient>) => {
|
|
6
|
-
_id?: string | undefined;
|
|
7
|
-
id?: string | undefined;
|
|
8
|
-
documento?: string | undefined;
|
|
9
|
-
cuil?: string | undefined;
|
|
10
|
-
tipoIdentificacion?: string | null | undefined;
|
|
11
|
-
numeroIdentificacion?: string | null | undefined;
|
|
12
|
-
nombre: string;
|
|
13
|
-
apellido: string;
|
|
14
|
-
fechaNacimiento?: string | Date | undefined;
|
|
15
|
-
fechaFallecimiento?: string | Date | null | undefined;
|
|
16
|
-
genero?: string | undefined;
|
|
17
|
-
sexo?: string | undefined;
|
|
18
|
-
estado?: string | null | undefined;
|
|
19
|
-
activo?: boolean | undefined;
|
|
20
|
-
estadoCivil?: string | null | undefined;
|
|
21
|
-
contacto?: import("../types/andes/patient.types").AndesContacto[] | undefined;
|
|
22
|
-
direccion?: import("../types/andes/patient.types").AndesDireccion[] | undefined;
|
|
23
|
-
relaciones?: import("../types/andes/patient.types").AndesRelacion[] | undefined;
|
|
24
|
-
foto?: string | null | undefined;
|
|
25
|
-
createdBy?: import("../types/andes/patient.types").AndesCreatedBy | undefined;
|
|
26
|
-
};
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.createPatient = void 0;
|
|
27
|
-
const basePatient = __importStar(require("../data/patient.json"));
|
|
28
|
-
const createPatient = (overrides = {}) => {
|
|
29
|
-
const clone = JSON.parse(JSON.stringify(basePatient));
|
|
30
|
-
return {
|
|
31
|
-
...clone,
|
|
32
|
-
...overrides,
|
|
33
|
-
};
|
|
34
|
-
};
|
|
35
|
-
exports.createPatient = createPatient;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/lib/config.test.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
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
|
-
});
|