@andes/fhir 1.11.1 → 1.12.0-beta.2
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/.circleci/config.yml +71 -68
- package/.editorconfig +13 -13
- package/.env.example +2 -0
- package/.github/labeler.yml +10 -10
- package/.github/pull_request_template.md +28 -28
- package/.github/workflows/build_test.yml +14 -14
- package/.github/workflows/has_conflicts.yml +13 -13
- package/.vscode/settings.json +2 -0
- package/CHANGELOG.md +312 -291
- package/LICENSE +674 -674
- package/README.md +2 -2
- package/coverage/clover.xml +198 -0
- package/coverage/coverage-final.json +5 -0
- package/coverage/lcov-report/base.css +224 -0
- package/coverage/lcov-report/block-navigation.js +87 -0
- package/coverage/lcov-report/config.ts.html +136 -0
- package/coverage/lcov-report/device.ts.html +193 -0
- package/coverage/lcov-report/favicon.png +0 -0
- package/coverage/lcov-report/helpers/index.html +116 -0
- package/coverage/lcov-report/helpers/patientFactory.ts.html +124 -0
- package/coverage/lcov-report/index.html +131 -0
- package/coverage/lcov-report/lib/config.ts.html +136 -0
- package/coverage/lcov-report/lib/device.ts.html +193 -0
- package/coverage/lcov-report/lib/index.html +146 -0
- package/coverage/lcov-report/lib/patient.ts.html +1267 -0
- package/coverage/lcov-report/patient.ts.html +1207 -0
- package/coverage/lcov-report/prettify.css +1 -0
- package/coverage/lcov-report/prettify.js +2 -0
- package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/coverage/lcov-report/sorter.js +210 -0
- package/coverage/lcov.info +410 -0
- package/dist/index.js +51 -32
- package/dist/index.js.map +1 -1
- package/dist/src/data/patient.json +191 -185
- package/dist/src/helpers/patientFactory.js +31 -0
- package/dist/src/helpers/patientFactory.js.map +1 -0
- package/dist/src/lib/allergyIntolerance.js +39 -39
- package/dist/src/lib/allergyIntolerance.js.map +1 -1
- package/dist/src/lib/bundle.js +25 -22
- package/dist/src/lib/bundle.js.map +1 -1
- package/dist/src/lib/composition.js +151 -150
- package/dist/src/lib/composition.js.map +1 -1
- package/dist/src/lib/condition.js +79 -79
- package/dist/src/lib/condition.js.map +1 -1
- package/dist/src/lib/config.js +20 -22
- package/dist/src/lib/config.js.map +1 -1
- package/dist/src/lib/config.test.js +12 -12
- package/dist/src/lib/config.test.js.map +1 -1
- package/dist/src/lib/device.js +38 -38
- package/dist/src/lib/device.js.map +1 -1
- package/dist/src/lib/device.test.js +9 -9
- package/dist/src/lib/device.test.js.map +1 -1
- package/dist/src/lib/document-reference.js +106 -103
- package/dist/src/lib/document-reference.js.map +1 -1
- package/dist/src/lib/immunization.js +67 -67
- package/dist/src/lib/medication.js +64 -64
- package/dist/src/lib/medication.js.map +1 -1
- package/dist/src/lib/medicationRequest.js +102 -99
- package/dist/src/lib/medicationRequest.js.map +1 -1
- package/dist/src/lib/medicationStatement.js +55 -55
- package/dist/src/lib/medicationStatement.js.map +1 -1
- package/dist/src/lib/organization.js +90 -90
- package/dist/src/lib/organization.js.map +1 -1
- package/dist/src/lib/patient.js +378 -360
- package/dist/src/lib/patient.js.map +1 -1
- package/dist/src/lib/patient.test.js +78 -39
- package/dist/src/lib/patient.test.js.map +1 -1
- package/dist/src/lib/practitioner.js +160 -160
- package/dist/src/lib/practitioner.js.map +1 -1
- package/index.ts +31 -31
- package/jest.config.js +11 -11
- package/package.json +45 -54
- package/release.config.js +74 -0
- package/src/data/patient.json +190 -184
- package/src/helpers/patientFactory.ts +13 -0
- package/src/lib/allergyIntolerance.ts +36 -36
- package/src/lib/bundle.ts +19 -19
- package/src/lib/composition.ts +153 -153
- package/src/lib/condition.ts +80 -80
- package/src/lib/config.test.ts +13 -13
- package/src/lib/config.ts +17 -17
- package/src/lib/device.test.ts +9 -9
- package/src/lib/device.ts +36 -36
- package/src/lib/document-reference.ts +102 -102
- package/src/lib/immunization.ts +64 -64
- package/src/lib/medication.ts +61 -61
- package/src/lib/medicationRequest.ts +100 -100
- package/src/lib/medicationStatement.ts +52 -52
- package/src/lib/organization.ts +89 -89
- package/src/lib/patient.test.ts +62 -38
- package/src/lib/patient.ts +394 -374
- package/src/lib/practitioner.ts +157 -157
- package/tsconfig.test.json +17 -17
- package/tslint.json +138 -138
|
@@ -1,100 +1,103 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Encode medicationRequest from ANDES to FHIR
|
|
4
|
-
* @param {} medicationRequest
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
//
|
|
33
|
-
|
|
34
|
-
//
|
|
35
|
-
//
|
|
36
|
-
//
|
|
37
|
-
//
|
|
38
|
-
//
|
|
39
|
-
//
|
|
40
|
-
//
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
//
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
},
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
//
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
//
|
|
62
|
-
//
|
|
63
|
-
//
|
|
64
|
-
//
|
|
65
|
-
//
|
|
66
|
-
//
|
|
67
|
-
|
|
68
|
-
//
|
|
69
|
-
//
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
//
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Encode medicationRequest from ANDES to FHIR
|
|
4
|
+
* @param {} medicationRequest
|
|
5
|
+
*/
|
|
6
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
7
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
8
|
+
};
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.encode = void 0;
|
|
11
|
+
const moment_1 = __importDefault(require("moment"));
|
|
12
|
+
// Muy incompleto hay que mejorarlo mucho todavía
|
|
13
|
+
function encode(patientReference, practitionerReference, medicationFHIR, data) {
|
|
14
|
+
return {
|
|
15
|
+
resourceType: 'MedicationRequest',
|
|
16
|
+
id: data.registro._id,
|
|
17
|
+
text: {
|
|
18
|
+
status: 'generated',
|
|
19
|
+
},
|
|
20
|
+
contained: [
|
|
21
|
+
medicationFHIR
|
|
22
|
+
],
|
|
23
|
+
identifier: [
|
|
24
|
+
{
|
|
25
|
+
use: 'official',
|
|
26
|
+
system: 'http://app.andes.gob.ar/prescriptions',
|
|
27
|
+
value: data.registro.id
|
|
28
|
+
}
|
|
29
|
+
],
|
|
30
|
+
// active | on-hold | cancelled | completed | entered-in-error | stopped | draft | unknown
|
|
31
|
+
status: (data.prestacion.estadoActual.tipo === 'validada') ? 'active' : 'on-hold',
|
|
32
|
+
// intent: proposal | plan | order | original-order | reflex-order | filler-order | instance-order | option
|
|
33
|
+
intent: 'order',
|
|
34
|
+
// category: {
|
|
35
|
+
// coding: [
|
|
36
|
+
// {
|
|
37
|
+
// system: '',
|
|
38
|
+
// display: '',
|
|
39
|
+
// code: ''
|
|
40
|
+
// }
|
|
41
|
+
// ]
|
|
42
|
+
// },
|
|
43
|
+
// priority: routine | urgent | asap | stat
|
|
44
|
+
priority: 'routine',
|
|
45
|
+
doNotPerform: false,
|
|
46
|
+
// Se puede usar medicationCodeableConcept o medicationReference, vamos a usar esta última.
|
|
47
|
+
medicationReference: {
|
|
48
|
+
reference: medicationFHIR.id,
|
|
49
|
+
display: medicationFHIR.code.text
|
|
50
|
+
},
|
|
51
|
+
subject: {
|
|
52
|
+
reference: patientReference // podría ser una reference a un group también
|
|
53
|
+
},
|
|
54
|
+
// encounter: Por ahora lo dejo pendiente. Podría ponerse una referencia a otra prestación o al informe del encuentro.
|
|
55
|
+
authoredOn: moment_1.default(data.registro.createdAt).format('YYYY-MM-DD'),
|
|
56
|
+
// requester & performer: pueden ser Reference(Practitioner|PractitionerRole|Organization|Patient|Device|RelatedPerson|CareTeam)
|
|
57
|
+
// por el momento vamos a tomar al profesional porque no tenemos otra info en la prestación
|
|
58
|
+
requester: {
|
|
59
|
+
reference: practitionerReference
|
|
60
|
+
},
|
|
61
|
+
// performer: {
|
|
62
|
+
// reference: practitionerReference
|
|
63
|
+
// },
|
|
64
|
+
// performerType: Lo dejamos pendiente
|
|
65
|
+
// recorder: {
|
|
66
|
+
// reference: practitionerReference
|
|
67
|
+
// },
|
|
68
|
+
// instantiatesCanonical: null, // ["<canonical>"], // Instantiates FHIR protocol or definition
|
|
69
|
+
// instantiatesUri: null, // ["<uri>"], // Instantiates external protocol or definition
|
|
70
|
+
basedOn: data.prestacion.id,
|
|
71
|
+
// groupIdentifier: null, // { Identifier }, // Composite request this is part of
|
|
72
|
+
// courseOfTherapyType: null, // { CodeableConcept }, // Overall pattern of medication administration
|
|
73
|
+
// insurance: null, // [{ Reference(Coverage|ClaimResponse) }], // Associated insurance coverage
|
|
74
|
+
note: null,
|
|
75
|
+
dosageInstruction: null,
|
|
76
|
+
// Medication supply authorization: Hay que ver esta parte
|
|
77
|
+
/*
|
|
78
|
+
dispenseRequest: { // Medication supply authorization
|
|
79
|
+
initialFill: { // First fill details
|
|
80
|
+
quantity: { Quantity(SimpleQuantity) }, // First fill quantity
|
|
81
|
+
duration: { Duration } // First fill duration
|
|
82
|
+
},
|
|
83
|
+
dispenseInterval: { Duration }, // Minimum period of time between dispenses
|
|
84
|
+
validityPeriod: { Period }, // Time period supply is authorized for
|
|
85
|
+
numberOfRepeatsAllowed: "<unsignedInt>", // Number of refills authorized
|
|
86
|
+
quantity: { Quantity(SimpleQuantity) }, // Amount of medication to supply per dispense
|
|
87
|
+
expectedSupplyDuration: { Duration }, // Number of days supply per dispense
|
|
88
|
+
performer: { Reference(Organization) } // Intended dispenser
|
|
89
|
+
},
|
|
90
|
+
*/
|
|
91
|
+
substitution: {
|
|
92
|
+
// allowed[x]: Whether substitution is allowed or not. One of these 2:
|
|
93
|
+
allowedBoolean: true,
|
|
94
|
+
// "allowedCodeableConcept" : { CodeableConcept },
|
|
95
|
+
reason: null // { CodeableConcept } // Why should (not) substitution be made
|
|
96
|
+
},
|
|
97
|
+
priorPrescription: null,
|
|
98
|
+
detectedIssue: null,
|
|
99
|
+
eventHistory: null // [{ Reference(Provenance) }]
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
exports.encode = encode;
|
|
100
103
|
//# sourceMappingURL=medicationRequest.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"medicationRequest.js","sourceRoot":"","sources":["../../../src/lib/medicationRequest.ts"],"names":[],"mappings":";AAAA;;;GAGG
|
|
1
|
+
{"version":3,"file":"medicationRequest.js","sourceRoot":"","sources":["../../../src/lib/medicationRequest.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;AAEH,oDAA4B;AAE5B,iDAAiD;AAEjD,SAAgB,MAAM,CAAC,gBAAgB,EAAE,qBAAqB,EAAE,cAAc,EAAE,IAAI;IAChF,OAAO;QACH,YAAY,EAAE,mBAAmB;QACjC,EAAE,EAAE,IAAI,CAAC,QAAQ,CAAC,GAAG;QACrB,IAAI,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AC1D;;;;;;;;;;;;;UAaE;QACF,YAAY,EAAE;YACV,sEAAsE;YACtE,cAAc,EAAE,IAAI;YACpB,kDAAkD;YAClD,MAAM,EAAE,IAAI,CAAC,+DAA+D;SAC/E;QACD,iBAAiB,EAAE,IAAI;QACvB,aAAa,EAAE,IAAI;QACnB,YAAY,EAAE,IAAI,CAAA,8BAA8B;KACnD,CAAC;AACN,CAAC;AAzFD,wBAyFC"}
|
|
@@ -1,56 +1,56 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.encode = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* Encode de Medicamentos from ANDES to FHIR
|
|
6
|
-
* @param {} medicationStatement
|
|
7
|
-
*/
|
|
8
|
-
// Muy incompleto hay que mejorarlo mucho todavía
|
|
9
|
-
function encode(patientReference, medicationReference, prestacionMedicamento) {
|
|
10
|
-
return {
|
|
11
|
-
resourceType: 'MedicationStatement',
|
|
12
|
-
status: (prestacionMedicamento.valor.estado === 'activo') ? 'active' : 'inactive',
|
|
13
|
-
id: prestacionMedicamento._id,
|
|
14
|
-
effectiveDateTime: prestacionMedicamento.createdAt,
|
|
15
|
-
medicationCodeableConcept: {
|
|
16
|
-
coding: [
|
|
17
|
-
{
|
|
18
|
-
system: 'http://snomed.info/sct',
|
|
19
|
-
code: prestacionMedicamento.concepto.conceptId,
|
|
20
|
-
display: prestacionMedicamento.concepto.term
|
|
21
|
-
}
|
|
22
|
-
]
|
|
23
|
-
},
|
|
24
|
-
meta: {
|
|
25
|
-
profile: [
|
|
26
|
-
'http://hl7.org/fhir/uv/ips/StructureDefinition/medication-ips'
|
|
27
|
-
]
|
|
28
|
-
},
|
|
29
|
-
// extension: null,
|
|
30
|
-
// identifier: '', // Business identifier, not a resource identifier
|
|
31
|
-
subject: {
|
|
32
|
-
reference: patientReference
|
|
33
|
-
},
|
|
34
|
-
medicationReference: {
|
|
35
|
-
reference: medicationReference
|
|
36
|
-
},
|
|
37
|
-
// context: null, // Encounter | Episode of care (podría ser el informe del encuentro o lo que definamos que brinda más información sobre el por qué)
|
|
38
|
-
dosage: [
|
|
39
|
-
{
|
|
40
|
-
text: prestacionMedicamento.valor,
|
|
41
|
-
route: { coding: [{ system: 'http://standardterms.edqm.eu', code: prestacionMedicamento._id, display: prestacionMedicamento.nombre }] },
|
|
42
|
-
timing: { coding: { system: 'http://terminology.hl7.org/CodeSystem/v3-GTSAbbreviation', code: 'QD', display: 'Diario' } }
|
|
43
|
-
}
|
|
44
|
-
],
|
|
45
|
-
// effectivePeriod: { // Esta parte se podría calcular entre la fecha de la prestación y la cant. de tiempo que se indica, pero hay problemas
|
|
46
|
-
// en este registro ya que no siempre está la unidad de tiempo (dias, mes, etc) hay q ver si no es un bug.
|
|
47
|
-
// start: '2015-03'
|
|
48
|
-
// },
|
|
49
|
-
text: {
|
|
50
|
-
status: 'generated',
|
|
51
|
-
div:
|
|
52
|
-
}
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
exports.encode = encode;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.encode = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Encode de Medicamentos from ANDES to FHIR
|
|
6
|
+
* @param {} medicationStatement
|
|
7
|
+
*/
|
|
8
|
+
// Muy incompleto hay que mejorarlo mucho todavía
|
|
9
|
+
function encode(patientReference, medicationReference, prestacionMedicamento) {
|
|
10
|
+
return {
|
|
11
|
+
resourceType: 'MedicationStatement',
|
|
12
|
+
status: (prestacionMedicamento.valor.estado === 'activo') ? 'active' : 'inactive',
|
|
13
|
+
id: prestacionMedicamento._id,
|
|
14
|
+
effectiveDateTime: prestacionMedicamento.createdAt,
|
|
15
|
+
medicationCodeableConcept: {
|
|
16
|
+
coding: [
|
|
17
|
+
{
|
|
18
|
+
system: 'http://snomed.info/sct',
|
|
19
|
+
code: prestacionMedicamento.concepto.conceptId,
|
|
20
|
+
display: prestacionMedicamento.concepto.term
|
|
21
|
+
}
|
|
22
|
+
]
|
|
23
|
+
},
|
|
24
|
+
meta: {
|
|
25
|
+
profile: [
|
|
26
|
+
'http://hl7.org/fhir/uv/ips/StructureDefinition/medication-ips'
|
|
27
|
+
]
|
|
28
|
+
},
|
|
29
|
+
// extension: null,
|
|
30
|
+
// identifier: '', // Business identifier, not a resource identifier
|
|
31
|
+
subject: {
|
|
32
|
+
reference: patientReference
|
|
33
|
+
},
|
|
34
|
+
medicationReference: {
|
|
35
|
+
reference: medicationReference
|
|
36
|
+
},
|
|
37
|
+
// context: null, // Encounter | Episode of care (podría ser el informe del encuentro o lo que definamos que brinda más información sobre el por qué)
|
|
38
|
+
dosage: [
|
|
39
|
+
{
|
|
40
|
+
text: prestacionMedicamento.valor,
|
|
41
|
+
route: { coding: [{ system: 'http://standardterms.edqm.eu', code: prestacionMedicamento._id, display: prestacionMedicamento.nombre }] },
|
|
42
|
+
timing: { coding: { system: 'http://terminology.hl7.org/CodeSystem/v3-GTSAbbreviation', code: 'QD', display: 'Diario' } }
|
|
43
|
+
}
|
|
44
|
+
],
|
|
45
|
+
// effectivePeriod: { // Esta parte se podría calcular entre la fecha de la prestación y la cant. de tiempo que se indica, pero hay problemas
|
|
46
|
+
// en este registro ya que no siempre está la unidad de tiempo (dias, mes, etc) hay q ver si no es un bug.
|
|
47
|
+
// start: '2015-03'
|
|
48
|
+
// },
|
|
49
|
+
text: {
|
|
50
|
+
status: 'generated',
|
|
51
|
+
div: `<div xmlns=\"http://www.w3.org/1999/xhtml\"><p><b>Generated Narrative with Details</b></p><p><b>id</b>: Medicacion </p><p><b>meta</b>: </p><p><b>text</b>: ${prestacionMedicamento.concepto.term}</p></div>`
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
exports.encode = encode;
|
|
56
56
|
//# sourceMappingURL=medicationStatement.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"medicationStatement.js","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;SACJ;QACD,iJAAiJ;QACjJ,0GAA0G;QAC1G,uBAAuB;QACvB,KAAK;QACL,IAAI,EAAE;YACF,MAAM,EAAE,WAAW;YACnB,GAAG,EAAE,8JAA8J,qBAAqB,CAAC,QAAQ,CAAC,IAAI,YAAY;SACrN;KACJ,CAAC;AACN,CAAC;AA7CD,wBA6CC"}
|
|
@@ -1,91 +1,91 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.encode = void 0;
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Encode a organization from ANDES to FHIR
|
|
7
|
-
* @param {} organization
|
|
8
|
-
*/
|
|
9
|
-
function encode(organization) {
|
|
10
|
-
|
|
11
|
-
if (data) {
|
|
12
|
-
|
|
13
|
-
assigner: 'sisa',
|
|
14
|
-
value: data.codigo.sisa
|
|
15
|
-
}] : [];
|
|
16
|
-
if (data.codigo.cuie) {
|
|
17
|
-
identificadores.push({
|
|
18
|
-
assigner: 'cuie',
|
|
19
|
-
value: data.codigo.cuie
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
if (data.codigo.remediar) {
|
|
23
|
-
identificadores.push({
|
|
24
|
-
assigner: 'remediar',
|
|
25
|
-
value: data.codigo.remediar
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
if (data.codigo.sips) {
|
|
29
|
-
identificadores.push({
|
|
30
|
-
assigner: 'sips',
|
|
31
|
-
value: data.codigo.sips
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
identificadores.push({
|
|
35
|
-
system: config_1.makeUrl('Organization'),
|
|
36
|
-
value: data._id
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
resourceType: 'ContactPoint',
|
|
41
|
-
value: unContacto.valor,
|
|
42
|
-
rank: unContacto.ranking,
|
|
43
|
-
};
|
|
44
|
-
switch (unContacto.tipo) {
|
|
45
|
-
case 'fijo':
|
|
46
|
-
cont['system'] = 'phone';
|
|
47
|
-
break;
|
|
48
|
-
case 'celular':
|
|
49
|
-
cont['system'] = 'phone';
|
|
50
|
-
break;
|
|
51
|
-
case 'email':
|
|
52
|
-
cont['system'] = 'email';
|
|
53
|
-
break;
|
|
54
|
-
}
|
|
55
|
-
return cont;
|
|
56
|
-
}) : [];
|
|
57
|
-
// Parsea direcciones
|
|
58
|
-
|
|
59
|
-
resourceType: 'Address',
|
|
60
|
-
postalCode: data.direccion.codigoPostal ? data.direccion.codigoPostal : '',
|
|
61
|
-
line: [data.direccion.valor],
|
|
62
|
-
city: data.direccion.ubicacion.localidad ? data.direccion.ubicacion.localidad.nombre : '',
|
|
63
|
-
state: data.direccion.ubicacion.provincia ? data.direccion.ubicacion.provincia.nombre : '',
|
|
64
|
-
country: data.direccion.ubicacion.pais ? data.direccion.ubicacion.pais.nombre : '',
|
|
65
|
-
}] : [];
|
|
66
|
-
// Armamos la organizacion FHIR
|
|
67
|
-
|
|
68
|
-
id: data.id,
|
|
69
|
-
resourceType: 'Organization',
|
|
70
|
-
identifier: identificadores,
|
|
71
|
-
active: data.activo ? data.activo : null,
|
|
72
|
-
type: [{
|
|
73
|
-
resourceType: 'CodeableConcept',
|
|
74
|
-
text: data.tipoEstablecimiento ? data.tipoEstablecimiento.nombre : null,
|
|
75
|
-
}],
|
|
76
|
-
name: data.nombre ? data.nombre : null,
|
|
77
|
-
};
|
|
78
|
-
if (contactos.length > 0) { // A contact detail for the organization
|
|
79
|
-
organizacionFHIR['telecom'] = contactos;
|
|
80
|
-
}
|
|
81
|
-
if (direcciones) { // An address for the organization
|
|
82
|
-
organizacionFHIR['address'] = direcciones;
|
|
83
|
-
}
|
|
84
|
-
return organizacionFHIR;
|
|
85
|
-
}
|
|
86
|
-
else {
|
|
87
|
-
return null;
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
exports.encode = encode;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.encode = void 0;
|
|
4
|
+
const config_1 = require("./config");
|
|
5
|
+
/**
|
|
6
|
+
* Encode a organization from ANDES to FHIR
|
|
7
|
+
* @param {} organization
|
|
8
|
+
*/
|
|
9
|
+
function encode(organization) {
|
|
10
|
+
let data = organization;
|
|
11
|
+
if (data) {
|
|
12
|
+
let identificadores = data.codigo.sisa ? [{
|
|
13
|
+
assigner: 'sisa',
|
|
14
|
+
value: data.codigo.sisa
|
|
15
|
+
}] : [];
|
|
16
|
+
if (data.codigo.cuie) {
|
|
17
|
+
identificadores.push({
|
|
18
|
+
assigner: 'cuie',
|
|
19
|
+
value: data.codigo.cuie
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
if (data.codigo.remediar) {
|
|
23
|
+
identificadores.push({
|
|
24
|
+
assigner: 'remediar',
|
|
25
|
+
value: data.codigo.remediar
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
if (data.codigo.sips) {
|
|
29
|
+
identificadores.push({
|
|
30
|
+
assigner: 'sips',
|
|
31
|
+
value: data.codigo.sips
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
identificadores.push({
|
|
35
|
+
system: config_1.makeUrl('Organization'),
|
|
36
|
+
value: data._id
|
|
37
|
+
});
|
|
38
|
+
let contactos = data.contacto ? data.contacto.map(unContacto => {
|
|
39
|
+
let cont = {
|
|
40
|
+
resourceType: 'ContactPoint',
|
|
41
|
+
value: unContacto.valor,
|
|
42
|
+
rank: unContacto.ranking,
|
|
43
|
+
};
|
|
44
|
+
switch (unContacto.tipo) {
|
|
45
|
+
case 'fijo':
|
|
46
|
+
cont['system'] = 'phone';
|
|
47
|
+
break;
|
|
48
|
+
case 'celular':
|
|
49
|
+
cont['system'] = 'phone';
|
|
50
|
+
break;
|
|
51
|
+
case 'email':
|
|
52
|
+
cont['system'] = 'email';
|
|
53
|
+
break;
|
|
54
|
+
}
|
|
55
|
+
return cont;
|
|
56
|
+
}) : [];
|
|
57
|
+
// Parsea direcciones
|
|
58
|
+
let direcciones = data.direccion ? [{
|
|
59
|
+
resourceType: 'Address',
|
|
60
|
+
postalCode: data.direccion.codigoPostal ? data.direccion.codigoPostal : '',
|
|
61
|
+
line: [data.direccion.valor],
|
|
62
|
+
city: data.direccion.ubicacion.localidad ? data.direccion.ubicacion.localidad.nombre : '',
|
|
63
|
+
state: data.direccion.ubicacion.provincia ? data.direccion.ubicacion.provincia.nombre : '',
|
|
64
|
+
country: data.direccion.ubicacion.pais ? data.direccion.ubicacion.pais.nombre : '',
|
|
65
|
+
}] : [];
|
|
66
|
+
// Armamos la organizacion FHIR
|
|
67
|
+
let organizacionFHIR = {
|
|
68
|
+
id: data.id,
|
|
69
|
+
resourceType: 'Organization',
|
|
70
|
+
identifier: identificadores,
|
|
71
|
+
active: data.activo ? data.activo : null,
|
|
72
|
+
type: [{
|
|
73
|
+
resourceType: 'CodeableConcept',
|
|
74
|
+
text: data.tipoEstablecimiento ? data.tipoEstablecimiento.nombre : null,
|
|
75
|
+
}],
|
|
76
|
+
name: data.nombre ? data.nombre : null,
|
|
77
|
+
};
|
|
78
|
+
if (contactos.length > 0) { // A contact detail for the organization
|
|
79
|
+
organizacionFHIR['telecom'] = contactos;
|
|
80
|
+
}
|
|
81
|
+
if (direcciones) { // An address for the organization
|
|
82
|
+
organizacionFHIR['address'] = direcciones;
|
|
83
|
+
}
|
|
84
|
+
return organizacionFHIR;
|
|
85
|
+
}
|
|
86
|
+
else {
|
|
87
|
+
return null;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
exports.encode = encode;
|
|
91
91
|
//# sourceMappingURL=organization.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"organization.js","sourceRoot":"","sources":["../../../src/lib/organization.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"organization.js","sourceRoot":"","sources":["../../../src/lib/organization.ts"],"names":[],"mappings":";;;AAAA,qCAA+C;AAE/C;;;GAGG;AACH,SAAgB,MA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