@andes/fhir 1.12.0-beta.4 → 1.12.1-beta.1
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/{src → dist}/data/patient.json +192 -191
- package/dist/{src/helpers → helpers}/patientFactory.js +35 -31
- package/dist/{src/lib → lib}/allergyIntolerance.js +39 -40
- package/dist/{src/lib → lib}/bundle.js +25 -26
- package/dist/{src/lib → lib}/composition.js +152 -152
- package/dist/{src/lib → lib}/condition.js +79 -80
- package/dist/{src/lib → lib}/config.js +27 -21
- package/dist/lib/config.test.js +19 -0
- package/dist/{src/lib → lib}/device.js +38 -39
- package/dist/lib/device.test.js +9 -0
- package/dist/{src/lib → lib}/document-reference.js +106 -107
- package/dist/{src/lib → lib}/immunization.js +67 -68
- package/{src/lib/medication.ts → dist/lib/medication.js} +64 -61
- package/{src/lib/medicationRequest.ts → dist/lib/medicationRequest.js} +103 -100
- package/dist/{src/lib → lib}/medicationStatement.js +55 -56
- package/dist/lib/organization.js +93 -0
- package/dist/lib/patient.js +465 -0
- package/dist/lib/patient.test.js +132 -0
- package/dist/lib/practitioner.js +186 -0
- package/dist/types/andes/organization.types.js +2 -0
- package/dist/types/andes/patient.types.js +2 -0
- package/dist/types/andes/practitioner.types.js +3 -0
- package/package.json +52 -43
- package/.circleci/config.yml +0 -72
- package/.editorconfig +0 -14
- package/.env.example +0 -2
- package/.gitattributes +0 -1
- package/.github/CODEOWNERS +0 -1
- package/.github/labeler.yml +0 -11
- package/.github/pull_request_template.md +0 -28
- package/.github/workflows/build_test.yml +0 -14
- package/.github/workflows/has_conflicts.yml +0 -13
- package/.vscode/settings.json +0 -2
- package/CHANGELOG.md +0 -335
- package/coverage/clover.xml +0 -198
- package/coverage/coverage-final.json +0 -5
- package/coverage/lcov-report/base.css +0 -224
- package/coverage/lcov-report/block-navigation.js +0 -87
- package/coverage/lcov-report/config.ts.html +0 -136
- package/coverage/lcov-report/device.ts.html +0 -193
- package/coverage/lcov-report/favicon.png +0 -0
- package/coverage/lcov-report/helpers/index.html +0 -116
- package/coverage/lcov-report/helpers/patientFactory.ts.html +0 -124
- package/coverage/lcov-report/index.html +0 -131
- package/coverage/lcov-report/lib/config.ts.html +0 -136
- package/coverage/lcov-report/lib/device.ts.html +0 -193
- package/coverage/lcov-report/lib/index.html +0 -146
- package/coverage/lcov-report/lib/patient.ts.html +0 -1240
- package/coverage/lcov-report/patient.ts.html +0 -1207
- package/coverage/lcov-report/prettify.css +0 -1
- package/coverage/lcov-report/prettify.js +0 -2
- package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/coverage/lcov-report/sorter.js +0 -210
- package/coverage/lcov.info +0 -410
- package/dist/index.js +0 -52
- package/dist/index.js.map +0 -1
- package/dist/src/data/patient.json +0 -191
- package/dist/src/helpers/patientFactory.js.map +0 -1
- package/dist/src/lib/allergyIntolerance.js.map +0 -1
- package/dist/src/lib/bundle.js.map +0 -1
- package/dist/src/lib/composition.js.map +0 -1
- package/dist/src/lib/condition.js.map +0 -1
- package/dist/src/lib/config.js.map +0 -1
- package/dist/src/lib/config.test.js +0 -13
- package/dist/src/lib/config.test.js.map +0 -1
- package/dist/src/lib/device.js.map +0 -1
- package/dist/src/lib/device.test.js +0 -10
- package/dist/src/lib/device.test.js.map +0 -1
- package/dist/src/lib/document-reference.js.map +0 -1
- package/dist/src/lib/immunization.js.map +0 -1
- package/dist/src/lib/medication.js +0 -65
- package/dist/src/lib/medication.js.map +0 -1
- package/dist/src/lib/medicationRequest.js +0 -103
- package/dist/src/lib/medicationRequest.js.map +0 -1
- package/dist/src/lib/medicationStatement.js.map +0 -1
- package/dist/src/lib/organization.js +0 -91
- package/dist/src/lib/organization.js.map +0 -1
- package/dist/src/lib/patient.js +0 -371
- package/dist/src/lib/patient.js.map +0 -1
- package/dist/src/lib/patient.test.js +0 -79
- package/dist/src/lib/patient.test.js.map +0 -1
- package/dist/src/lib/practitioner.js +0 -161
- package/dist/src/lib/practitioner.js.map +0 -1
- package/index.ts +0 -30
- package/jest.config.js +0 -12
- package/release.config.js +0 -74
- package/src/helpers/patientFactory.ts +0 -13
- package/src/lib/allergyIntolerance.ts +0 -36
- package/src/lib/bundle.ts +0 -19
- package/src/lib/composition.ts +0 -153
- package/src/lib/condition.ts +0 -80
- package/src/lib/config.test.ts +0 -13
- package/src/lib/config.ts +0 -17
- package/src/lib/device.test.ts +0 -9
- package/src/lib/device.ts +0 -36
- package/src/lib/document-reference.ts +0 -102
- package/src/lib/immunization.ts +0 -64
- package/src/lib/medicationStatement.ts +0 -52
- package/src/lib/organization.ts +0 -89
- package/src/lib/patient.test.ts +0 -62
- package/src/lib/patient.ts +0 -385
- package/src/lib/practitioner.ts +0 -157
- package/tsconfig.test.json +0 -18
- package/tslint.json +0 -139
package/index.ts
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import * as AllergyIntolerance from './src/lib/allergyIntolerance';
|
|
2
|
-
import * as Bundle from './src/lib/bundle';
|
|
3
|
-
import * as Composition from './src/lib/composition';
|
|
4
|
-
import * as Condition from './src/lib/condition';
|
|
5
|
-
import * as Device from './src/lib/device';
|
|
6
|
-
import * as DocumentReference from './src/lib/document-reference';
|
|
7
|
-
import * as Immunization from './src/lib/immunization';
|
|
8
|
-
import * as Medication from './src/lib/medication';
|
|
9
|
-
import * as MedicationRequest from './src/lib/medicationRequest';
|
|
10
|
-
import * as MedicationStatement from './src/lib/medicationStatement';
|
|
11
|
-
import * as Organization from './src/lib/organization';
|
|
12
|
-
import * as Patient from './src/lib/patient';
|
|
13
|
-
import * as Practitioner from './src/lib/practitioner';
|
|
14
|
-
|
|
15
|
-
export { getDominio, initialize } from './src/lib/config';
|
|
16
|
-
export {
|
|
17
|
-
Patient,
|
|
18
|
-
Practitioner,
|
|
19
|
-
Organization,
|
|
20
|
-
Immunization,
|
|
21
|
-
Condition,
|
|
22
|
-
Composition,
|
|
23
|
-
Bundle,
|
|
24
|
-
DocumentReference,
|
|
25
|
-
Device,
|
|
26
|
-
Medication,
|
|
27
|
-
MedicationStatement,
|
|
28
|
-
MedicationRequest,
|
|
29
|
-
AllergyIntolerance
|
|
30
|
-
};
|
package/jest.config.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
roots: ['./'],
|
|
3
|
-
transform: {
|
|
4
|
-
'^.+\\.tsx?$': 'ts-jest'
|
|
5
|
-
},
|
|
6
|
-
testRegex: '(/__tests__/.*|(\\.|/)(test|spec))\\.tsx?$',
|
|
7
|
-
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
|
|
8
|
-
testEnvironment: 'node',
|
|
9
|
-
moduleNameMapper: {
|
|
10
|
-
'@andes/unit-test': '<rootDir>/packages/unit-testing/index.ts'
|
|
11
|
-
}
|
|
12
|
-
}
|
package/release.config.js
DELETED
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
// release.config.js
|
|
2
|
-
module.exports = {
|
|
3
|
-
branches: [
|
|
4
|
-
// 🔹 Rama principal: versión estable
|
|
5
|
-
{ name: 'master' },
|
|
6
|
-
|
|
7
|
-
// 🔹 Rama de desarrollo: pre-release "beta"
|
|
8
|
-
{ name: 'develop', channel: 'beta', prerelease: 'beta' }
|
|
9
|
-
],
|
|
10
|
-
|
|
11
|
-
// Repositorio en GitHub
|
|
12
|
-
repositoryUrl: 'https://github.com/andes/fhir.git',
|
|
13
|
-
|
|
14
|
-
plugins: [
|
|
15
|
-
// 1️⃣ Analiza commits según Conv. Commits
|
|
16
|
-
[
|
|
17
|
-
'@semantic-release/commit-analyzer',
|
|
18
|
-
{
|
|
19
|
-
preset: 'conventionalcommits',
|
|
20
|
-
releaseRules: [
|
|
21
|
-
{ type: 'docs', scope: 'README', release: 'patch' },
|
|
22
|
-
{ type: 'refactor', release: 'patch' },
|
|
23
|
-
{ type: 'chore', release: false }
|
|
24
|
-
],
|
|
25
|
-
parserOpts: {
|
|
26
|
-
noteKeywords: ['BREAKING CHANGE', 'BREAKING CHANGES']
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
],
|
|
30
|
-
|
|
31
|
-
// 2️⃣ Genera notas de release automáticamente
|
|
32
|
-
'@semantic-release/release-notes-generator',
|
|
33
|
-
|
|
34
|
-
// 3️⃣ Actualiza el changelog solo en master
|
|
35
|
-
[
|
|
36
|
-
'@semantic-release/changelog',
|
|
37
|
-
{
|
|
38
|
-
changelogFile: 'CHANGELOG.md',
|
|
39
|
-
changelogTitle: '# Changelog'
|
|
40
|
-
}
|
|
41
|
-
],
|
|
42
|
-
|
|
43
|
-
// 4️⃣ Publica el paquete en npm
|
|
44
|
-
[
|
|
45
|
-
'@semantic-release/npm',
|
|
46
|
-
{
|
|
47
|
-
npmPublish: true,
|
|
48
|
-
pkgRoot: '.'
|
|
49
|
-
}
|
|
50
|
-
],
|
|
51
|
-
|
|
52
|
-
// 5️⃣ Actualiza package.json y changelog solo en master
|
|
53
|
-
[
|
|
54
|
-
'@semantic-release/git',
|
|
55
|
-
{
|
|
56
|
-
assets: ['package.json', 'CHANGELOG.md'],
|
|
57
|
-
message:
|
|
58
|
-
'chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}'
|
|
59
|
-
}
|
|
60
|
-
],
|
|
61
|
-
|
|
62
|
-
// 6️⃣ Publica release en GitHub (tags, changelog, etc.)
|
|
63
|
-
[
|
|
64
|
-
'@semantic-release/github',
|
|
65
|
-
{
|
|
66
|
-
successComment: false,
|
|
67
|
-
failComment: false,
|
|
68
|
-
assets: [
|
|
69
|
-
{ path: 'CHANGELOG.md', label: '📘 Changelog' }
|
|
70
|
-
]
|
|
71
|
-
}
|
|
72
|
-
]
|
|
73
|
-
]
|
|
74
|
-
};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import * as basePatient from '../data/patient.json';
|
|
2
|
-
|
|
3
|
-
export type PartialDeep<T> = {
|
|
4
|
-
[K in keyof T]?: T[K] extends object ? PartialDeep<T[K]> : T[K];
|
|
5
|
-
};
|
|
6
|
-
|
|
7
|
-
export const createPatient = (overrides: PartialDeep<typeof basePatient> = {}) => {
|
|
8
|
-
const clone = JSON.parse(JSON.stringify(basePatient));
|
|
9
|
-
return {
|
|
10
|
-
...clone,
|
|
11
|
-
...overrides,
|
|
12
|
-
};
|
|
13
|
-
};
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Encode de Alergias e Intolerancias from ANDES to FHIR
|
|
3
|
-
* @param {} AllergyIntolerance
|
|
4
|
-
*/
|
|
5
|
-
export function encode(patientReference, alergiaIntolerancia) {
|
|
6
|
-
return {
|
|
7
|
-
category: [
|
|
8
|
-
'medication'
|
|
9
|
-
],
|
|
10
|
-
criticality: 'high',
|
|
11
|
-
patient: {
|
|
12
|
-
reference: patientReference
|
|
13
|
-
},
|
|
14
|
-
id: alergiaIntolerancia._id,
|
|
15
|
-
code: {
|
|
16
|
-
coding: [
|
|
17
|
-
{
|
|
18
|
-
system: 'http://snomed.info/sct',
|
|
19
|
-
display: alergiaIntolerancia.concepto.term,
|
|
20
|
-
code: alergiaIntolerancia.concepto.conceptId,
|
|
21
|
-
}
|
|
22
|
-
]
|
|
23
|
-
},
|
|
24
|
-
meta: {
|
|
25
|
-
profile: ['http://hl7.org/fhir/uv/ips/StructureDefinition/allergyintolerance-uv-ips']
|
|
26
|
-
},
|
|
27
|
-
text: {
|
|
28
|
-
status: 'generated',
|
|
29
|
-
div: `<div xmlns="http://www.w3.org/1999/xhtml"><p><b>Generated Narrative with Details</b></p><p><b>id</b>: Alergia </p><p><b>meta</b>: </p><p><b>text</b>: ${alergiaIntolerancia.concepto.semanticTag}</p></div>`
|
|
30
|
-
},
|
|
31
|
-
resourceType: 'AllergyIntolerance',
|
|
32
|
-
type: 'allergy',
|
|
33
|
-
onsetDateTime: alergiaIntolerancia.valor.fechaInicio
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
|
package/src/lib/bundle.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import moment from 'moment';
|
|
2
|
-
import { makeUrl } from './config';
|
|
3
|
-
|
|
4
|
-
export function encode(ID, resources) {
|
|
5
|
-
return {
|
|
6
|
-
resourceType: 'Bundle',
|
|
7
|
-
id: ID,
|
|
8
|
-
meta: {
|
|
9
|
-
lastUpdated: moment().format()
|
|
10
|
-
},
|
|
11
|
-
language: 'es-AR',
|
|
12
|
-
entry: resources,
|
|
13
|
-
type: 'document',
|
|
14
|
-
identifier: {
|
|
15
|
-
system: makeUrl('Bundle'),
|
|
16
|
-
value: ID
|
|
17
|
-
}
|
|
18
|
-
};
|
|
19
|
-
}
|
package/src/lib/composition.ts
DELETED
|
@@ -1,153 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import moment from 'moment';
|
|
3
|
-
import { makeUrl } from './config';
|
|
4
|
-
|
|
5
|
-
function getReference(url) {
|
|
6
|
-
return {
|
|
7
|
-
reference: url
|
|
8
|
-
};
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export function encode(ID, patientReference, custodianReference, deviceReference, medicationStatementReference, ImmunizationReferences, AllergyIntoleranceReferences, ConditionReferences) {
|
|
12
|
-
const now = moment();
|
|
13
|
-
let Immunization: any = [];
|
|
14
|
-
let conditions: any = [];
|
|
15
|
-
let medications: any = [];
|
|
16
|
-
let allergyIntolerance = [];
|
|
17
|
-
|
|
18
|
-
Immunization = [{
|
|
19
|
-
title: 'Vacunas',
|
|
20
|
-
text: {
|
|
21
|
-
status: 'generated',
|
|
22
|
-
div: '<div xmlns="http:\/\/www.w3.org\/1999\/xhtml">Sección referida a la vacunación del paciente <\/div>'
|
|
23
|
-
},
|
|
24
|
-
code: {
|
|
25
|
-
coding: [
|
|
26
|
-
{
|
|
27
|
-
system: 'http:\/\/loinc.org',
|
|
28
|
-
display: 'Immunization record',
|
|
29
|
-
code: '60484-3'
|
|
30
|
-
}
|
|
31
|
-
]
|
|
32
|
-
},
|
|
33
|
-
entry: ImmunizationReferences ? ImmunizationReferences.map(getReference) : []
|
|
34
|
-
}];
|
|
35
|
-
|
|
36
|
-
medications = [{
|
|
37
|
-
title: 'Medicamentos',
|
|
38
|
-
text: {
|
|
39
|
-
status: 'generated',
|
|
40
|
-
div: '<div xmlns="http:\/\/www.w3.org\/1999\/xhtml">Registro de medicamentos<\/div>'
|
|
41
|
-
},
|
|
42
|
-
code: {
|
|
43
|
-
coding: [
|
|
44
|
-
{
|
|
45
|
-
system: 'http:\/\/loinc.org',
|
|
46
|
-
display: 'Medication use',
|
|
47
|
-
code: '10160-0'
|
|
48
|
-
}
|
|
49
|
-
]
|
|
50
|
-
},
|
|
51
|
-
entry: medicationStatementReference ? medicationStatementReference.map(getReference) : [],
|
|
52
|
-
}];
|
|
53
|
-
|
|
54
|
-
allergyIntolerance = [{
|
|
55
|
-
title: 'Alergias o Intolerancias',
|
|
56
|
-
text: {
|
|
57
|
-
status: 'generated',
|
|
58
|
-
div: '<div xmlns="http:\/\/www.w3.org\/1999\/xhtml">Registro de Alergias<\/div>'
|
|
59
|
-
},
|
|
60
|
-
code: {
|
|
61
|
-
coding: [
|
|
62
|
-
{
|
|
63
|
-
system: 'http:\/\/loinc.org',
|
|
64
|
-
display: 'Allergies and/or adverse reactions',
|
|
65
|
-
code: '48765-2'
|
|
66
|
-
}
|
|
67
|
-
]
|
|
68
|
-
},
|
|
69
|
-
entry: AllergyIntoleranceReferences ? AllergyIntoleranceReferences.map(getReference) : [],
|
|
70
|
-
}];
|
|
71
|
-
|
|
72
|
-
conditions = [{
|
|
73
|
-
code: {
|
|
74
|
-
coding: [
|
|
75
|
-
{
|
|
76
|
-
system: 'http:\/\/loinc.org',
|
|
77
|
-
display: 'Problem list',
|
|
78
|
-
code: '11450-4'
|
|
79
|
-
}
|
|
80
|
-
]
|
|
81
|
-
},
|
|
82
|
-
entry: ConditionReferences ? ConditionReferences.map(getReference) : [],
|
|
83
|
-
title: 'Problemas activos',
|
|
84
|
-
text: {
|
|
85
|
-
status: 'generated',
|
|
86
|
-
div: '<div xmlns="http:\/\/www.w3.org\/1999\/xhtml">Lista de problemas activos (trastornos)<\/div>'
|
|
87
|
-
}
|
|
88
|
-
}];
|
|
89
|
-
|
|
90
|
-
return {
|
|
91
|
-
id: ID,
|
|
92
|
-
subject: {
|
|
93
|
-
reference: patientReference
|
|
94
|
-
},
|
|
95
|
-
section: [
|
|
96
|
-
...conditions,
|
|
97
|
-
...medications,
|
|
98
|
-
...Immunization,
|
|
99
|
-
...allergyIntolerance
|
|
100
|
-
|
|
101
|
-
],
|
|
102
|
-
resourceType: 'Composition',
|
|
103
|
-
author: [
|
|
104
|
-
{
|
|
105
|
-
identifier: {
|
|
106
|
-
system: 'https://federador.msal.gob.ar/uri',
|
|
107
|
-
value: deviceReference
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
],
|
|
111
|
-
confidentiality: 'N',
|
|
112
|
-
type: {
|
|
113
|
-
coding: [
|
|
114
|
-
{
|
|
115
|
-
system: 'http:\/\/loinc.org',
|
|
116
|
-
display: 'Patient Summary',
|
|
117
|
-
code: '60591-5'
|
|
118
|
-
}
|
|
119
|
-
]
|
|
120
|
-
},
|
|
121
|
-
title: 'Resumen del paciente al ' + now.format('DD/MM/YYYY, HH:mm'),
|
|
122
|
-
identifier: {
|
|
123
|
-
system: makeUrl('Composition'),
|
|
124
|
-
value: ID
|
|
125
|
-
},
|
|
126
|
-
date: now,
|
|
127
|
-
// meta: {
|
|
128
|
-
// profile: [
|
|
129
|
-
// 'http:\/\/hl7.org\/fhir\/uv\/ips\/StructureDefinition\/composition-uv-ips'
|
|
130
|
-
// ]
|
|
131
|
-
// },
|
|
132
|
-
text: {
|
|
133
|
-
status: 'generated',
|
|
134
|
-
div: '<div xmlns=\"http://www.w3.org/1999/xhtml\">IPS Neuquen</div>'
|
|
135
|
-
},
|
|
136
|
-
custodian: {
|
|
137
|
-
identifier: {
|
|
138
|
-
system: 'https://federador.msal.gob.ar/uri',
|
|
139
|
-
value: custodianReference
|
|
140
|
-
}
|
|
141
|
-
},
|
|
142
|
-
attester: [
|
|
143
|
-
{
|
|
144
|
-
mode: 'legal',
|
|
145
|
-
time: now,
|
|
146
|
-
party: {
|
|
147
|
-
reference: custodianReference
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
],
|
|
151
|
-
status: 'final'
|
|
152
|
-
};
|
|
153
|
-
}
|
package/src/lib/condition.ts
DELETED
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
import { makeUrl } from './config';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
*
|
|
5
|
-
* @param registro Registro RUP a transformar a FHIR
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
export function encode(patientReference, registro) {
|
|
10
|
-
return {
|
|
11
|
-
id : registro._id,
|
|
12
|
-
category : [
|
|
13
|
-
{
|
|
14
|
-
coding : [
|
|
15
|
-
{
|
|
16
|
-
system : 'http://loinc.org',
|
|
17
|
-
display : 'Problem',
|
|
18
|
-
code : '75326-9'
|
|
19
|
-
}
|
|
20
|
-
]
|
|
21
|
-
}
|
|
22
|
-
],
|
|
23
|
-
subject : {
|
|
24
|
-
reference : patientReference
|
|
25
|
-
},
|
|
26
|
-
onsetDateTime : registro.createdAt.getFullYear(), // [TODO] No va solo el año
|
|
27
|
-
resourceType : 'Condition',
|
|
28
|
-
// Por el momento ponemos 'confirmed'
|
|
29
|
-
verificationStatus : {
|
|
30
|
-
coding : [
|
|
31
|
-
{
|
|
32
|
-
system : 'http://terminology.hl7.org//CodeSystem//condition-ver-status',
|
|
33
|
-
code : 'confirmed'
|
|
34
|
-
}
|
|
35
|
-
]
|
|
36
|
-
},
|
|
37
|
-
code : {
|
|
38
|
-
coding : [
|
|
39
|
-
{
|
|
40
|
-
code : registro.concepto.conceptId,
|
|
41
|
-
system : 'http://snomed.info/sct',
|
|
42
|
-
display : registro.concepto.fsn
|
|
43
|
-
}
|
|
44
|
-
]
|
|
45
|
-
},
|
|
46
|
-
recordedDate : registro.createdAt,
|
|
47
|
-
meta : {
|
|
48
|
-
profile : [
|
|
49
|
-
'http://hl7.org/fhir/uv/ips/StructureDefinition/condition-uv-ips'
|
|
50
|
-
]
|
|
51
|
-
},
|
|
52
|
-
text : {
|
|
53
|
-
status : 'generated',
|
|
54
|
-
div: `<div xmlns="http://www.w3.org/1999/xhtml"><p><b>Generated Narrative with Details</b></p><p><b>id</b>: Problema: </p><p>${registro.nombre}</p></div>`
|
|
55
|
-
},
|
|
56
|
-
severity : { // [TODO] Sacar esto porque no lo tenemos todavía. No hay un campo de severidad.
|
|
57
|
-
coding : [
|
|
58
|
-
{
|
|
59
|
-
system : 'http://loinc.org',
|
|
60
|
-
display : 'Moderate',
|
|
61
|
-
code : 'LA6751-7'
|
|
62
|
-
}
|
|
63
|
-
]
|
|
64
|
-
},
|
|
65
|
-
clinicalStatus : {
|
|
66
|
-
coding : [
|
|
67
|
-
{
|
|
68
|
-
system: 'http://terminology.hl7.org/CodeSystem/condition-clinical',
|
|
69
|
-
code: registro.valor.estado // [TODO] Tenemos este dato.
|
|
70
|
-
},
|
|
71
|
-
{
|
|
72
|
-
system: 'http://terminology.hl7.org/CodeSystem/evolution',
|
|
73
|
-
// code: registro.valor.evolucion.replace('<p>','').replace('</p>','') // [TODO] Tenemos este dato.
|
|
74
|
-
code: registro.valor.evolucion // [TODO] Tenemos este dato.
|
|
75
|
-
}
|
|
76
|
-
]
|
|
77
|
-
}
|
|
78
|
-
};
|
|
79
|
-
}
|
|
80
|
-
|
package/src/lib/config.test.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { getDominio, makeUrl } from './config';
|
|
2
|
-
|
|
3
|
-
test('Get default domain', () => {
|
|
4
|
-
expect(getDominio()).toBe('andes.gob.ar');
|
|
5
|
-
});
|
|
6
|
-
|
|
7
|
-
test('Get default URL without id', () => {
|
|
8
|
-
expect(makeUrl('patient')).toBe('andes.gob.ar/patient');
|
|
9
|
-
});
|
|
10
|
-
|
|
11
|
-
test('Get default URL with id', () => {
|
|
12
|
-
expect(makeUrl('patient', '123456')).toBe('andes.gob.ar/patient/123456');
|
|
13
|
-
});
|
package/src/lib/config.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
let DOMINIO = 'andes.gob.ar';
|
|
2
|
-
|
|
3
|
-
export function initialize({ dominio }) {
|
|
4
|
-
DOMINIO = dominio;
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
export function getDominio() {
|
|
8
|
-
return DOMINIO;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export function makeUrl(resource, id = null) {
|
|
12
|
-
let url = `${DOMINIO}/${resource}`;
|
|
13
|
-
if (id) {
|
|
14
|
-
url += `/${id}`;
|
|
15
|
-
}
|
|
16
|
-
return url;
|
|
17
|
-
}
|
package/src/lib/device.test.ts
DELETED
package/src/lib/device.ts
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { makeUrl } from './config';
|
|
2
|
-
|
|
3
|
-
export function encode() {
|
|
4
|
-
/**
|
|
5
|
-
* HARDCODE DEVICE
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
return {
|
|
9
|
-
resourceType: 'Device',
|
|
10
|
-
id: 'device-01',
|
|
11
|
-
identifier: [
|
|
12
|
-
{
|
|
13
|
-
system: makeUrl('Device'),
|
|
14
|
-
value: 'device-01'
|
|
15
|
-
}
|
|
16
|
-
],
|
|
17
|
-
type: {
|
|
18
|
-
coding: [
|
|
19
|
-
{
|
|
20
|
-
system: 'http://snomed.info/sct',
|
|
21
|
-
code: '462894001',
|
|
22
|
-
display: 'software de aplicación de sistema de información de historias clínicas de pacientes (objeto físico)'
|
|
23
|
-
}
|
|
24
|
-
]
|
|
25
|
-
},
|
|
26
|
-
owner: {
|
|
27
|
-
reference: 'http://argentina.gob.ar/salud/refes/14999912399913'
|
|
28
|
-
},
|
|
29
|
-
deviceName: [
|
|
30
|
-
{
|
|
31
|
-
name: 'Sistema de Aplicaciones Neuquinas de Salud (ANDES)',
|
|
32
|
-
type: 'manufacturer-name'
|
|
33
|
-
}
|
|
34
|
-
]
|
|
35
|
-
};
|
|
36
|
-
}
|
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
import moment from 'moment';
|
|
2
|
-
import { makeUrl } from './config';
|
|
3
|
-
|
|
4
|
-
export function encode(ID, author, organization, patient, binaryURL) {
|
|
5
|
-
return {
|
|
6
|
-
resourceType: 'DocumentReference',
|
|
7
|
-
id: ID,
|
|
8
|
-
meta: {
|
|
9
|
-
lastUpdated: moment().format()
|
|
10
|
-
},
|
|
11
|
-
contained: [
|
|
12
|
-
{
|
|
13
|
-
resourceType: 'Practitioner',
|
|
14
|
-
id: author.id,
|
|
15
|
-
identifier: [{
|
|
16
|
-
system: makeUrl('Device'),
|
|
17
|
-
value: author.id
|
|
18
|
-
}]
|
|
19
|
-
},
|
|
20
|
-
{
|
|
21
|
-
resourceType: 'Organization',
|
|
22
|
-
id: organization.id,
|
|
23
|
-
identifier: [{
|
|
24
|
-
system: makeUrl('Organization'),
|
|
25
|
-
value: organization.id
|
|
26
|
-
}]
|
|
27
|
-
}
|
|
28
|
-
],
|
|
29
|
-
custodian: {
|
|
30
|
-
identifier: {
|
|
31
|
-
system: 'https://federador.msal.gob.ar/uri',
|
|
32
|
-
value: makeUrl('Organization', organization.id)
|
|
33
|
-
}
|
|
34
|
-
},
|
|
35
|
-
masterIdentifier: {
|
|
36
|
-
system: makeUrl('documentos_versiones'),
|
|
37
|
-
value: ID
|
|
38
|
-
},
|
|
39
|
-
identifier: [{
|
|
40
|
-
system: makeUrl('documentos'),
|
|
41
|
-
value: ID
|
|
42
|
-
}],
|
|
43
|
-
status: 'current',
|
|
44
|
-
type: {
|
|
45
|
-
coding: [
|
|
46
|
-
{
|
|
47
|
-
system: 'http://loinc.org',
|
|
48
|
-
code: '60591-5'
|
|
49
|
-
}
|
|
50
|
-
]
|
|
51
|
-
},
|
|
52
|
-
subject: {
|
|
53
|
-
reference: makeUrl('Patient', patient.id),
|
|
54
|
-
},
|
|
55
|
-
// author: [
|
|
56
|
-
// {
|
|
57
|
-
// reference: makeUrl('Device', author.id),
|
|
58
|
-
// },
|
|
59
|
-
// {
|
|
60
|
-
// reference: makeUrl('Organization', organization.id),
|
|
61
|
-
// }
|
|
62
|
-
// ],
|
|
63
|
-
securityLabel: [{
|
|
64
|
-
coding: [{
|
|
65
|
-
system: 'https://saludddigital.gob.ar/nivelesconfidencialidad',
|
|
66
|
-
code: 'N'
|
|
67
|
-
}]
|
|
68
|
-
}],
|
|
69
|
-
content: [{
|
|
70
|
-
attachment: {
|
|
71
|
-
id: 'PRINCIPAL',
|
|
72
|
-
url: binaryURL
|
|
73
|
-
}
|
|
74
|
-
}],
|
|
75
|
-
context: {
|
|
76
|
-
event: [{
|
|
77
|
-
coding: [{
|
|
78
|
-
system: 'https://saludddigital.gob.ar/tiposevento',
|
|
79
|
-
code: 'CIR'
|
|
80
|
-
}]
|
|
81
|
-
}],
|
|
82
|
-
// period: {
|
|
83
|
-
// start: '2019-04-03T10:30:00+03:00',
|
|
84
|
-
// end: '2019-04-05T10:30:00+03:00'
|
|
85
|
-
|
|
86
|
-
// },
|
|
87
|
-
facilityType: {
|
|
88
|
-
coding: [{
|
|
89
|
-
system: 'https://saludddigital.gob.ar/tipoprestador',
|
|
90
|
-
code: 'INI'
|
|
91
|
-
}]
|
|
92
|
-
},
|
|
93
|
-
practiceSetting: {
|
|
94
|
-
coding: [{
|
|
95
|
-
system: 'https://saludddigital.gob.ar/especialidades',
|
|
96
|
-
code: 'CLM'
|
|
97
|
-
}]
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
};
|
|
102
|
-
}
|
package/src/lib/immunization.ts
DELETED
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
/**
|
|
3
|
-
* Encode de Vacunas Nomivac from ANDES to FHIR
|
|
4
|
-
* @param {} nomivac
|
|
5
|
-
* [ASK] El code de extension puede ir en vaccineCode?
|
|
6
|
-
* [ASk] Location no se sabe. Solo esta el texto
|
|
7
|
-
*/
|
|
8
|
-
export function encode(patientReference, nomivac) {
|
|
9
|
-
return {
|
|
10
|
-
resourceType: 'Immunization',
|
|
11
|
-
id: nomivac.idvacuna,
|
|
12
|
-
extension: [
|
|
13
|
-
{
|
|
14
|
-
url: 'http://sisa/fhir/esquema',
|
|
15
|
-
valueCoding: {
|
|
16
|
-
system: 'http://argentina.gob.ar/salud/NOMIVAC-esquemas',
|
|
17
|
-
code: '0', // [TODO] Ver que code ponemos acá
|
|
18
|
-
display: nomivac.vacuna
|
|
19
|
-
}
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
url: 'http://sisa/fhir/condicionAplicacion',
|
|
23
|
-
valueCoding: {
|
|
24
|
-
system: 'http://argentina.gob.ar/salud/NOMIVAC-condicion',
|
|
25
|
-
code: '17',
|
|
26
|
-
display: 'Personal de Salud'
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
],
|
|
30
|
-
status: 'completed',
|
|
31
|
-
notGiven: false,
|
|
32
|
-
vaccineCode: {
|
|
33
|
-
coding: [
|
|
34
|
-
{
|
|
35
|
-
system: 'https://snomed.info/sct/11000221109/id/228100022110',
|
|
36
|
-
code: nomivac.idvacuna,
|
|
37
|
-
display: nomivac.vacuna
|
|
38
|
-
}
|
|
39
|
-
]
|
|
40
|
-
},
|
|
41
|
-
patient: {
|
|
42
|
-
reference: patientReference
|
|
43
|
-
},
|
|
44
|
-
date: nomivac.fechaAplicacion,
|
|
45
|
-
primarySource: false,
|
|
46
|
-
location: {
|
|
47
|
-
reference: 'http://argentina.gob.ar/salud/refes/14999912399913'
|
|
48
|
-
},
|
|
49
|
-
// lotNumber: null,
|
|
50
|
-
vaccinationProtocol: [
|
|
51
|
-
{
|
|
52
|
-
doseSequence: 1,
|
|
53
|
-
doseStatus: {
|
|
54
|
-
coding: [
|
|
55
|
-
{
|
|
56
|
-
system: 'http://hl7.org/fhir/vaccination-protocol-dose-status',
|
|
57
|
-
code: nomivac.dosis
|
|
58
|
-
}
|
|
59
|
-
]
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
]
|
|
63
|
-
};
|
|
64
|
-
}
|