@andes/fhir 1.13.0-beta.6 → 1.13.0-beta.7
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 +7 -0
- package/dist/constants/identifier-systems.js +7 -0
- package/dist/lib/config.js +3 -2
- package/dist/lib/config.test.js +5 -5
- package/dist/lib/medicationRequest.d.ts +1 -1
- package/dist/lib/medicationRequest.js +2 -1
- package/dist/lib/organization.js +5 -4
- package/package.json +1 -1
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
export declare const FhirIdentifierSystems: {
|
|
2
|
+
readonly ANDES_ID: "http://andes.gob.ar";
|
|
3
|
+
readonly MATRICULACIONES: "http://andes.gob.ar/matriculaciones";
|
|
2
4
|
readonly DNI: "http://www.renaper.gob.ar/dni";
|
|
3
5
|
readonly CUIL: "http://www.renaper.gob.ar/cuil";
|
|
4
6
|
readonly PASSPORT: "http://andes.gob.ar/sid/passport";
|
|
5
7
|
readonly FOREIGN_ID: "http://andes.gob.ar/sid/foreign-id";
|
|
8
|
+
readonly PRESCRIPTIONS: "http://app.andes.gob.ar/prescriptions";
|
|
9
|
+
readonly SISA: "https://andes.gob.ar/sisa";
|
|
10
|
+
readonly CUIE: "https://andes.gob.ar/cuie";
|
|
11
|
+
readonly REMEDIAR: "https://andes.gob.ar/remediar";
|
|
12
|
+
readonly SIPS: "https://andes.gob.ar/sips";
|
|
6
13
|
};
|
|
@@ -2,8 +2,15 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.FhirIdentifierSystems = void 0;
|
|
4
4
|
exports.FhirIdentifierSystems = {
|
|
5
|
+
ANDES_ID: 'http://andes.gob.ar',
|
|
6
|
+
MATRICULACIONES: 'http://andes.gob.ar/matriculaciones',
|
|
5
7
|
DNI: 'http://www.renaper.gob.ar/dni',
|
|
6
8
|
CUIL: 'http://www.renaper.gob.ar/cuil',
|
|
7
9
|
PASSPORT: 'http://andes.gob.ar/sid/passport',
|
|
8
10
|
FOREIGN_ID: 'http://andes.gob.ar/sid/foreign-id',
|
|
11
|
+
PRESCRIPTIONS: 'http://app.andes.gob.ar/prescriptions',
|
|
12
|
+
SISA: 'https://andes.gob.ar/sisa',
|
|
13
|
+
CUIE: 'https://andes.gob.ar/cuie',
|
|
14
|
+
REMEDIAR: 'https://andes.gob.ar/remediar',
|
|
15
|
+
SIPS: 'https://andes.gob.ar/sips',
|
|
9
16
|
};
|
package/dist/lib/config.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.__reset = exports.makeUrl = exports.getDominio = exports.initialize = void 0;
|
|
4
|
-
|
|
4
|
+
const identifier_systems_1 = require("../constants/identifier-systems");
|
|
5
|
+
let DOMINIO = identifier_systems_1.FhirIdentifierSystems.ANDES_ID;
|
|
5
6
|
function initialize(config) {
|
|
6
7
|
DOMINIO = config.dominio;
|
|
7
8
|
}
|
|
@@ -22,6 +23,6 @@ exports.makeUrl = makeUrl;
|
|
|
22
23
|
* Reseteo explícito para tests
|
|
23
24
|
*/
|
|
24
25
|
function __reset() {
|
|
25
|
-
DOMINIO =
|
|
26
|
+
DOMINIO = identifier_systems_1.FhirIdentifierSystems.ANDES_ID;
|
|
26
27
|
}
|
|
27
28
|
exports.__reset = __reset;
|
package/dist/lib/config.test.js
CHANGED
|
@@ -5,15 +5,15 @@ beforeEach(() => {
|
|
|
5
5
|
(0, config_1.__reset)(); // Resetea el dominio antes de cada test
|
|
6
6
|
});
|
|
7
7
|
test('Get default domain', () => {
|
|
8
|
-
expect((0, config_1.getDominio)()).toBe('andes.gob.ar');
|
|
8
|
+
expect((0, config_1.getDominio)()).toBe('http://andes.gob.ar');
|
|
9
9
|
});
|
|
10
10
|
test('Get default URL without id', () => {
|
|
11
|
-
expect((0, config_1.makeUrl)('patient')).toBe('andes.gob.ar/patient');
|
|
11
|
+
expect((0, config_1.makeUrl)('patient')).toBe('http://andes.gob.ar/patient');
|
|
12
12
|
});
|
|
13
13
|
test('Get default URL with id', () => {
|
|
14
|
-
expect((0, config_1.makeUrl)('patient', '123456')).toBe('andes.gob.ar/patient/123456');
|
|
14
|
+
expect((0, config_1.makeUrl)('patient', '123456')).toBe('http://andes.gob.ar/patient/123456');
|
|
15
15
|
});
|
|
16
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');
|
|
17
|
+
(0, config_1.initialize)({ dominio: 'http://nuevo-dominio.com' });
|
|
18
|
+
expect((0, config_1.getDominio)()).toBe('http://nuevo-dominio.com');
|
|
19
19
|
});
|
|
@@ -9,6 +9,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
10
|
exports.encode = void 0;
|
|
11
11
|
const moment_1 = __importDefault(require("moment"));
|
|
12
|
+
const identifier_systems_1 = require("../constants/identifier-systems");
|
|
12
13
|
// Muy incompleto hay que mejorarlo mucho todavía
|
|
13
14
|
function encode(patientReference, practitionerReference, medicationFHIR, data) {
|
|
14
15
|
return {
|
|
@@ -24,7 +25,7 @@ function encode(patientReference, practitionerReference, medicationFHIR, data) {
|
|
|
24
25
|
identifier: [
|
|
25
26
|
{
|
|
26
27
|
use: 'official',
|
|
27
|
-
system:
|
|
28
|
+
system: identifier_systems_1.FhirIdentifierSystems.PRESCRIPTIONS, // Es el id de la prestación completa
|
|
28
29
|
value: data.registro.id
|
|
29
30
|
}
|
|
30
31
|
],
|
package/dist/lib/organization.js
CHANGED
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
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
|
* Encode an ANDES Organization to FHIR Organization
|
|
8
9
|
*/
|
|
@@ -14,25 +15,25 @@ function encode(organization) {
|
|
|
14
15
|
const identificadores = [];
|
|
15
16
|
if (data.codigo?.sisa) {
|
|
16
17
|
identificadores.push({
|
|
17
|
-
system:
|
|
18
|
+
system: identifier_systems_1.FhirIdentifierSystems.SISA,
|
|
18
19
|
value: data.codigo.sisa
|
|
19
20
|
});
|
|
20
21
|
}
|
|
21
22
|
if (data.codigo?.cuie) {
|
|
22
23
|
identificadores.push({
|
|
23
|
-
system:
|
|
24
|
+
system: identifier_systems_1.FhirIdentifierSystems.CUIE,
|
|
24
25
|
value: data.codigo.cuie
|
|
25
26
|
});
|
|
26
27
|
}
|
|
27
28
|
if (data.codigo?.remediar) {
|
|
28
29
|
identificadores.push({
|
|
29
|
-
system:
|
|
30
|
+
system: identifier_systems_1.FhirIdentifierSystems.REMEDIAR,
|
|
30
31
|
value: data.codigo.remediar
|
|
31
32
|
});
|
|
32
33
|
}
|
|
33
34
|
if (data.codigo?.sips) {
|
|
34
35
|
identificadores.push({
|
|
35
|
-
system:
|
|
36
|
+
system: identifier_systems_1.FhirIdentifierSystems.SIPS,
|
|
36
37
|
value: data.codigo.sips
|
|
37
38
|
});
|
|
38
39
|
}
|