@andes/fhir 1.13.0-beta.4 → 1.13.0-beta.6
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,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FhirIdentifierSystems = void 0;
|
|
4
|
+
exports.FhirIdentifierSystems = {
|
|
5
|
+
DNI: 'http://www.renaper.gob.ar/dni',
|
|
6
|
+
CUIL: 'http://www.renaper.gob.ar/cuil',
|
|
7
|
+
PASSPORT: 'http://andes.gob.ar/sid/passport',
|
|
8
|
+
FOREIGN_ID: 'http://andes.gob.ar/sid/foreign-id',
|
|
9
|
+
};
|
package/dist/lib/patient.js
CHANGED
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.verify = exports.decode = exports.encode = void 0;
|
|
4
4
|
const config_1 = require("./config");
|
|
5
5
|
const rankingMapping_1 = require("../utils/rankingMapping");
|
|
6
|
+
const identifier_systems_1 = require("../constants/identifier-systems");
|
|
6
7
|
/**
|
|
7
8
|
* Helpers
|
|
8
9
|
*/
|
|
@@ -116,26 +117,26 @@ function encode(patient) {
|
|
|
116
117
|
});
|
|
117
118
|
if (patient.documento) {
|
|
118
119
|
identificadores.push({
|
|
119
|
-
system:
|
|
120
|
+
system: identifier_systems_1.FhirIdentifierSystems.DNI,
|
|
120
121
|
value: patient.documento
|
|
121
122
|
});
|
|
122
123
|
}
|
|
123
124
|
if (patient.cuil) {
|
|
124
125
|
identificadores.push({
|
|
125
|
-
system:
|
|
126
|
+
system: identifier_systems_1.FhirIdentifierSystems.CUIL,
|
|
126
127
|
value: patient.cuil
|
|
127
128
|
});
|
|
128
129
|
}
|
|
129
130
|
if (patient.numeroIdentificacion) {
|
|
130
131
|
if (patient.tipoIdentificacion === 'dni extranjero') {
|
|
131
132
|
identificadores.push({
|
|
132
|
-
system:
|
|
133
|
+
system: identifier_systems_1.FhirIdentifierSystems.FOREIGN_ID,
|
|
133
134
|
value: patient.numeroIdentificacion
|
|
134
135
|
});
|
|
135
136
|
}
|
|
136
137
|
if (patient.tipoIdentificacion === 'pasaporte') {
|
|
137
138
|
identificadores.push({
|
|
138
|
-
system:
|
|
139
|
+
system: identifier_systems_1.FhirIdentifierSystems.PASSPORT,
|
|
139
140
|
value: patient.numeroIdentificacion
|
|
140
141
|
});
|
|
141
142
|
}
|
|
@@ -264,7 +265,7 @@ function decode(patient) {
|
|
|
264
265
|
const element = items.find(el => el.system === key);
|
|
265
266
|
return element?.value;
|
|
266
267
|
}
|
|
267
|
-
const tiposIdentificacion = [
|
|
268
|
+
const tiposIdentificacion = [identifier_systems_1.FhirIdentifierSystems.FOREIGN_ID, identifier_systems_1.FhirIdentifierSystems.PASSPORT];
|
|
268
269
|
const tipoAndes = ['dni extranjero', 'pasaporte'];
|
|
269
270
|
let tipoIdentificacion;
|
|
270
271
|
let numeroIdentificacion;
|
|
@@ -286,7 +287,7 @@ function decode(patient) {
|
|
|
286
287
|
: '';
|
|
287
288
|
const pacienteAndes = {
|
|
288
289
|
id: getValue(patient.identifier, (0, config_1.makeUrl)('Patient')) ?? patient.id,
|
|
289
|
-
documento: getValue(patient.identifier,
|
|
290
|
+
documento: getValue(patient.identifier, identifier_systems_1.FhirIdentifierSystems.DNI),
|
|
290
291
|
tipoIdentificacion,
|
|
291
292
|
numeroIdentificacion,
|
|
292
293
|
nombre,
|
package/dist/lib/patient.test.js
CHANGED
|
@@ -26,6 +26,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
26
26
|
const patient = __importStar(require("../data/patient.json"));
|
|
27
27
|
const patient_1 = require("./patient");
|
|
28
28
|
const patientFactory_1 = require("../helpers/patientFactory");
|
|
29
|
+
const identifier_systems_1 = require("../constants/identifier-systems");
|
|
29
30
|
const pacienteFhir = (0, patient_1.encode)(patient);
|
|
30
31
|
describe('encode patient from ANDES to FHIR R4', () => {
|
|
31
32
|
test('Verify basic data', () => {
|
|
@@ -98,17 +99,17 @@ describe('encode patient from ANDES to FHIR R4', () => {
|
|
|
98
99
|
const paciente = (0, patientFactory_1.createPatient)({ tipoIdentificacion: 'dni extranjero', numeroIdentificacion: 'ABC123' });
|
|
99
100
|
const fhir = (0, patient_1.encode)(paciente);
|
|
100
101
|
expect(fhir).not.toBeNull();
|
|
101
|
-
const id = fhir.identifier?.find(t => t.system ===
|
|
102
|
+
const id = fhir.identifier?.find(t => t.system === identifier_systems_1.FhirIdentifierSystems.FOREIGN_ID);
|
|
102
103
|
expect(id?.value).toBe('ABC123');
|
|
103
|
-
expect(id?.system).toBe('andes.gob.ar/sid/foreign-id');
|
|
104
|
+
expect(id?.system).toBe('http://andes.gob.ar/sid/foreign-id');
|
|
104
105
|
});
|
|
105
106
|
it('Verifica pasaporte', () => {
|
|
106
107
|
const paciente = (0, patientFactory_1.createPatient)({ tipoIdentificacion: 'pasaporte', numeroIdentificacion: 'ABC123CD' });
|
|
107
108
|
const fhir = (0, patient_1.encode)(paciente);
|
|
108
109
|
expect(fhir).not.toBeNull();
|
|
109
|
-
const id = fhir.identifier?.find(t => t.system ===
|
|
110
|
+
const id = fhir.identifier?.find(t => t.system === identifier_systems_1.FhirIdentifierSystems.PASSPORT);
|
|
110
111
|
expect(id?.value).toBe('ABC123CD');
|
|
111
|
-
expect(id?.system).toBe('andes.gob.ar/sid/passport');
|
|
112
|
+
expect(id?.system).toBe('http://andes.gob.ar/sid/passport');
|
|
112
113
|
});
|
|
113
114
|
});
|
|
114
115
|
describe('decode patient from FHIR R4 to ANDES', () => {
|
package/dist/lib/practitioner.js
CHANGED
|
@@ -124,8 +124,8 @@ function encode(practitioner) {
|
|
|
124
124
|
unaMatricula.code = {
|
|
125
125
|
coding: [{
|
|
126
126
|
system: 'http://www.saludneuquen.gob.ar/fiscalizacion.html',
|
|
127
|
-
code: String(datosPosgrado.especialidad.codigo ?? ''),
|
|
128
|
-
display: String(datosPosgrado.especialidad.
|
|
127
|
+
code: String(datosPosgrado.especialidad.codigo.sisa ?? ''),
|
|
128
|
+
display: String(datosPosgrado.especialidad.nombre ?? '')
|
|
129
129
|
}],
|
|
130
130
|
text: String(ultima.matriculaNumero ?? '')
|
|
131
131
|
};
|