@andes/fhir 1.13.0-beta.9 → 1.13.0
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/LICENSE +674 -674
- package/README.md +2 -2
- package/dist/lib/allergyIntolerance.d.ts +12 -0
- package/dist/lib/allergyIntolerance.js +17 -1
- package/dist/lib/bundle.d.ts +1 -1
- package/dist/lib/bundle.js +3 -2
- package/dist/lib/composition.d.ts +5 -9
- package/dist/lib/composition.js +183 -82
- package/dist/lib/condition.d.ts +1 -49
- package/dist/lib/condition.js +42 -37
- package/dist/lib/device.d.ts +5 -1
- package/dist/lib/device.js +7 -3
- package/dist/lib/immunization.d.ts +1 -38
- package/dist/lib/immunization.js +53 -40
- package/dist/lib/medicationStatement.js +1 -1
- package/dist/lib/organization.js +24 -7
- package/dist/lib/patient.js +21 -7
- package/dist/lib/practitioner.js +20 -7
- package/package.json +5 -2
package/dist/lib/immunization.js
CHANGED
|
@@ -8,59 +8,72 @@ exports.encode = encode;
|
|
|
8
8
|
* [ASk] Location no se sabe. Solo esta el texto
|
|
9
9
|
*/
|
|
10
10
|
function encode(patientReference, nomivac) {
|
|
11
|
-
|
|
11
|
+
const occurrenceDate = nomivac.fechaAplicacion
|
|
12
|
+
? new Date(nomivac.fechaAplicacion).toISOString()
|
|
13
|
+
: new Date().toISOString();
|
|
14
|
+
const immunization = {
|
|
12
15
|
resourceType: 'Immunization',
|
|
13
|
-
id: nomivac.idvacuna,
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
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
|
-
],
|
|
16
|
+
id: String(nomivac.idvacuna),
|
|
17
|
+
meta: {
|
|
18
|
+
profile: [
|
|
19
|
+
'http://hl7.org/fhir/uv/ips/StructureDefinition/Immunization-uv-ips'
|
|
20
|
+
]
|
|
21
|
+
},
|
|
22
|
+
text: {
|
|
23
|
+
status: 'generated',
|
|
24
|
+
div: `<div xmlns="http://www.w3.org/1999/xhtml"><p>${nomivac.vacuna || 'Vacuna'}</p></div>`
|
|
25
|
+
},
|
|
32
26
|
status: 'completed',
|
|
33
|
-
notGiven: false,
|
|
34
27
|
vaccineCode: {
|
|
35
28
|
coding: [
|
|
36
29
|
{
|
|
37
30
|
system: 'https://snomed.info/sct/11000221109/id/228100022110',
|
|
38
|
-
code: nomivac.idvacuna,
|
|
31
|
+
code: String(nomivac.idvacuna),
|
|
39
32
|
display: nomivac.vacuna
|
|
40
33
|
}
|
|
41
|
-
]
|
|
34
|
+
],
|
|
35
|
+
text: nomivac.vacuna
|
|
42
36
|
},
|
|
43
37
|
patient: {
|
|
44
38
|
reference: patientReference
|
|
45
39
|
},
|
|
46
|
-
|
|
47
|
-
primarySource: false
|
|
48
|
-
|
|
40
|
+
occurrenceDateTime: occurrenceDate,
|
|
41
|
+
primarySource: false
|
|
42
|
+
};
|
|
43
|
+
if (nomivac.vacuna || nomivac.condicion) {
|
|
44
|
+
immunization.extension = [];
|
|
45
|
+
if (nomivac.vacuna) {
|
|
46
|
+
immunization.extension.push({
|
|
47
|
+
url: 'http://sisa/fhir/esquema',
|
|
48
|
+
valueCoding: {
|
|
49
|
+
system: 'http://argentina.gob.ar/salud/NOMIVAC-esquemas',
|
|
50
|
+
code: '0',
|
|
51
|
+
display: nomivac.vacuna
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
if (nomivac.condicion) {
|
|
56
|
+
immunization.extension.push({
|
|
57
|
+
url: 'http://sisa/fhir/condicionAplicacion',
|
|
58
|
+
valueCoding: {
|
|
59
|
+
system: 'http://argentina.gob.ar/salud/NOMIVAC-condicion',
|
|
60
|
+
code: '17',
|
|
61
|
+
display: 'Personal de Salud'
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
if (nomivac.location) {
|
|
67
|
+
immunization.location = {
|
|
49
68
|
reference: 'http://argentina.gob.ar/salud/refes/14999912399913'
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
if (nomivac.dosis) {
|
|
72
|
+
immunization.protocolApplied = [
|
|
53
73
|
{
|
|
54
|
-
|
|
55
|
-
doseStatus: {
|
|
56
|
-
coding: [
|
|
57
|
-
{
|
|
58
|
-
system: 'http://hl7.org/fhir/vaccination-protocol-dose-status',
|
|
59
|
-
code: nomivac.dosis
|
|
60
|
-
}
|
|
61
|
-
]
|
|
62
|
-
}
|
|
74
|
+
doseNumberString: String(nomivac.dosis)
|
|
63
75
|
}
|
|
64
|
-
]
|
|
65
|
-
}
|
|
76
|
+
];
|
|
77
|
+
}
|
|
78
|
+
return immunization;
|
|
66
79
|
}
|
|
@@ -23,7 +23,7 @@ function encode(patientReference, medicationReference, prestacionMedicamento) {
|
|
|
23
23
|
},
|
|
24
24
|
meta: {
|
|
25
25
|
profile: [
|
|
26
|
-
'http://hl7.org/fhir/uv/ips/StructureDefinition/
|
|
26
|
+
'http://hl7.org/fhir/uv/ips/StructureDefinition/MedicationStatement-uv-ips'
|
|
27
27
|
]
|
|
28
28
|
},
|
|
29
29
|
// extension: null,
|
package/dist/lib/organization.js
CHANGED
|
@@ -63,18 +63,35 @@ function encode(organization) {
|
|
|
63
63
|
const direcciones = [];
|
|
64
64
|
if (data.direccion) {
|
|
65
65
|
const dir = data.direccion;
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
}
|
|
66
|
+
const address = {};
|
|
67
|
+
const city = dir.ubicacion?.localidad?.nombre;
|
|
68
|
+
const state = dir.ubicacion?.provincia?.nombre;
|
|
69
|
+
const country = dir.ubicacion?.pais?.nombre;
|
|
70
|
+
if (dir.valor?.trim()) {
|
|
71
|
+
address.line = [dir.valor.trim()];
|
|
72
|
+
}
|
|
73
|
+
if (dir.codigoPostal && String(dir.codigoPostal).trim()) {
|
|
74
|
+
address.postalCode = String(dir.codigoPostal).trim();
|
|
75
|
+
}
|
|
76
|
+
if (city?.trim()) {
|
|
77
|
+
address.city = city.trim();
|
|
78
|
+
}
|
|
79
|
+
if (state?.trim()) {
|
|
80
|
+
address.state = state.trim();
|
|
81
|
+
}
|
|
82
|
+
if (country?.trim()) {
|
|
83
|
+
address.country = country.trim();
|
|
84
|
+
}
|
|
85
|
+
direcciones.push(address);
|
|
73
86
|
}
|
|
74
87
|
// Organización FHIR
|
|
75
88
|
const organizacionFHIR = {
|
|
76
89
|
resourceType: 'Organization',
|
|
77
90
|
id: data._id ?? data.id,
|
|
91
|
+
text: {
|
|
92
|
+
status: 'generated',
|
|
93
|
+
div: `<div xmlns="http://www.w3.org/1999/xhtml"><p>${data.nombre || 'Organización'}</p></div>`
|
|
94
|
+
},
|
|
78
95
|
identifier: identificadores,
|
|
79
96
|
active: data.activo ?? undefined,
|
|
80
97
|
name: data.nombre ?? undefined,
|
package/dist/lib/patient.js
CHANGED
|
@@ -175,13 +175,23 @@ function encode(patient) {
|
|
|
175
175
|
const country = typeof unaDireccion.ubicacion.pais === 'object'
|
|
176
176
|
? unaDireccion.ubicacion.pais?.nombre
|
|
177
177
|
: unaDireccion.ubicacion.pais;
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
line
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
}
|
|
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;
|
|
185
195
|
});
|
|
186
196
|
// Relaciones → contact
|
|
187
197
|
const relacionesFHIR = (patient.relaciones ?? [])
|
|
@@ -207,6 +217,10 @@ function encode(patient) {
|
|
|
207
217
|
const pacienteFHIR = {
|
|
208
218
|
resourceType: 'Patient',
|
|
209
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
|
+
},
|
|
210
224
|
identifier: identificadores,
|
|
211
225
|
active: patient.activo ?? undefined,
|
|
212
226
|
name: [{
|
package/dist/lib/practitioner.js
CHANGED
|
@@ -52,13 +52,26 @@ function encode(practitioner) {
|
|
|
52
52
|
// Direcciones → address
|
|
53
53
|
// -----------------------------
|
|
54
54
|
const direcciones = (data.domicilios ?? []).map((unDomicilio) => {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
}
|
|
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;
|
|
62
75
|
});
|
|
63
76
|
// -----------------------------
|
|
64
77
|
// Relaciones (hoy no se usan en Practitioner)
|