@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.
@@ -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
  };
@@ -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
- let DOMINIO = 'andes.gob.ar';
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 = 'andes.gob.ar';
26
+ DOMINIO = identifier_systems_1.FhirIdentifierSystems.ANDES_ID;
26
27
  }
27
28
  exports.__reset = __reset;
@@ -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
  });
@@ -11,7 +11,7 @@ export declare function encode(patientReference: any, practitionerReference: any
11
11
  contained: any[];
12
12
  identifier: {
13
13
  use: string;
14
- system: string;
14
+ system: "http://app.andes.gob.ar/prescriptions";
15
15
  value: any;
16
16
  }[];
17
17
  status: string;
@@ -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: 'http://app.andes.gob.ar/prescriptions', // Es el id de la prestación completa
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
  ],
@@ -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: 'https://andes.gob.ar/sisa',
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: 'https://andes.gob.ar/cuie',
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: 'https://andes.gob.ar/remediar',
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: 'https://andes.gob.ar/sips',
36
+ system: identifier_systems_1.FhirIdentifierSystems.SIPS,
36
37
  value: data.codigo.sips
37
38
  });
38
39
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@andes/fhir",
3
- "version": "1.13.0-beta.6",
3
+ "version": "1.13.0-beta.7",
4
4
  "engines": {
5
5
  "node": ">=18.0.0"
6
6
  },