@andes/fhir 1.11.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/.circleci/config.yml +69 -0
- package/.editorconfig +14 -0
- package/.gitattributes +1 -0
- package/.github/CODEOWNERS +1 -0
- package/.github/labeler.yml +11 -0
- package/.github/pull_request_template.md +28 -0
- package/.github/workflows/build_test.yml +14 -0
- package/.github/workflows/has_conflicts.yml +13 -0
- package/CHANGELOG.md +306 -0
- package/LICENSE +674 -0
- package/README.md +2 -0
- package/dist/index.js +33 -0
- package/dist/index.js.map +1 -0
- package/dist/src/data/patient.json +185 -0
- package/dist/src/lib/allergyIntolerance.js +40 -0
- package/dist/src/lib/allergyIntolerance.js.map +1 -0
- package/dist/src/lib/bundle.js +23 -0
- package/dist/src/lib/bundle.js.map +1 -0
- package/dist/src/lib/composition.js +151 -0
- package/dist/src/lib/composition.js.map +1 -0
- package/dist/src/lib/condition.js +80 -0
- package/dist/src/lib/condition.js.map +1 -0
- package/dist/src/lib/config.js +23 -0
- package/dist/src/lib/config.js.map +1 -0
- package/dist/src/lib/config.test.js +13 -0
- package/dist/src/lib/config.test.js.map +1 -0
- package/dist/src/lib/device.js +39 -0
- package/dist/src/lib/device.js.map +1 -0
- package/dist/src/lib/device.test.js +10 -0
- package/dist/src/lib/device.test.js.map +1 -0
- package/dist/src/lib/document-reference.js +104 -0
- package/dist/src/lib/document-reference.js.map +1 -0
- package/dist/src/lib/immunization.js +68 -0
- package/dist/src/lib/immunization.js.map +1 -0
- package/dist/src/lib/medication.js +65 -0
- package/dist/src/lib/medication.js.map +1 -0
- package/dist/src/lib/medicationRequest.js +100 -0
- package/dist/src/lib/medicationRequest.js.map +1 -0
- package/dist/src/lib/medicationStatement.js +56 -0
- package/dist/src/lib/medicationStatement.js.map +1 -0
- package/dist/src/lib/organization.js +91 -0
- package/dist/src/lib/organization.js.map +1 -0
- package/dist/src/lib/patient.js +361 -0
- package/dist/src/lib/patient.js.map +1 -0
- package/dist/src/lib/patient.test.js +40 -0
- package/dist/src/lib/patient.test.js.map +1 -0
- package/dist/src/lib/practitioner.js +161 -0
- package/dist/src/lib/practitioner.js.map +1 -0
- package/index.ts +31 -0
- package/jest.config.js +12 -0
- package/package.json +54 -0
- package/src/data/patient.json +185 -0
- package/src/lib/allergyIntolerance.ts +36 -0
- package/src/lib/bundle.ts +19 -0
- package/src/lib/composition.ts +153 -0
- package/src/lib/condition.ts +80 -0
- package/src/lib/config.test.ts +13 -0
- package/src/lib/config.ts +17 -0
- package/src/lib/device.test.ts +9 -0
- package/src/lib/device.ts +36 -0
- package/src/lib/document-reference.ts +102 -0
- package/src/lib/immunization.ts +64 -0
- package/src/lib/medication.ts +61 -0
- package/src/lib/medicationRequest.ts +100 -0
- package/src/lib/medicationStatement.ts +52 -0
- package/src/lib/organization.ts +89 -0
- package/src/lib/patient.test.ts +38 -0
- package/src/lib/patient.ts +374 -0
- package/src/lib/practitioner.ts +157 -0
- package/tsconfig.test.json +18 -0
- package/tslint.json +139 -0
package/package.json
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@andes/fhir",
|
|
3
|
+
"version": "1.11.1",
|
|
4
|
+
"repository": {
|
|
5
|
+
"type": "git",
|
|
6
|
+
"url": "https://github.com/andes/fhir.git"
|
|
7
|
+
},
|
|
8
|
+
"author": "Red TICs",
|
|
9
|
+
"license": "GPL-3.0",
|
|
10
|
+
"jest": {
|
|
11
|
+
"verbose": true
|
|
12
|
+
},
|
|
13
|
+
"scripts": {
|
|
14
|
+
"lint": "tslint --project .",
|
|
15
|
+
"start": "node index.js",
|
|
16
|
+
"tsc": "tsc",
|
|
17
|
+
"test": "npx jest --coverage",
|
|
18
|
+
"tsc:w": "tsc -w",
|
|
19
|
+
"prepublishOnly": "rm -rf dist && tsc -p ./ --outDir dist/",
|
|
20
|
+
"semantic-release": "semantic-release"
|
|
21
|
+
},
|
|
22
|
+
"main": "./dist/index.js",
|
|
23
|
+
"devDependencies": {
|
|
24
|
+
"@semantic-release/changelog": "^3.0.6",
|
|
25
|
+
"@semantic-release/git": "^7.0.18",
|
|
26
|
+
"@types/jest": "^26.0.22",
|
|
27
|
+
"@types/moment": "^2.13.0",
|
|
28
|
+
"@types/node": "^6.0.117",
|
|
29
|
+
"jasmine-core": "~2.6.2",
|
|
30
|
+
"jasmine-spec-reporter": "~4.1.0",
|
|
31
|
+
"jest": "^26.6.3",
|
|
32
|
+
"semantic-release": "^17.0.2",
|
|
33
|
+
"ts-jest": "^26.5.4",
|
|
34
|
+
"ts-node": "~3.0.4",
|
|
35
|
+
"tslint": "^5.20.1",
|
|
36
|
+
"tslint-eslint-rules": "^5.4.0",
|
|
37
|
+
"typescript": "^3.9.9"
|
|
38
|
+
},
|
|
39
|
+
"dependencies": {
|
|
40
|
+
"@jest/types": "^26.6.2",
|
|
41
|
+
"moment": "^2.24.0"
|
|
42
|
+
},
|
|
43
|
+
"release": {
|
|
44
|
+
"branch": "master",
|
|
45
|
+
"plugins": [
|
|
46
|
+
"@semantic-release/commit-analyzer",
|
|
47
|
+
"@semantic-release/release-notes-generator",
|
|
48
|
+
"@semantic-release/changelog",
|
|
49
|
+
"@semantic-release/npm",
|
|
50
|
+
"@semantic-release/git",
|
|
51
|
+
"@semantic-release/github"
|
|
52
|
+
]
|
|
53
|
+
}
|
|
54
|
+
}
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
{
|
|
2
|
+
"_id": "58d30d6fgbb1a96b254d9877",
|
|
3
|
+
"entidadesValidadoras": [
|
|
4
|
+
"RENAPER",
|
|
5
|
+
"Sisa"
|
|
6
|
+
],
|
|
7
|
+
"documento": "42910660",
|
|
8
|
+
"apellido": "PERINGA PONCE",
|
|
9
|
+
"nombre": "HUGO AGUSTIN",
|
|
10
|
+
"sexo": "masculino",
|
|
11
|
+
"fechaNacimiento": "1979-11-14T03:00:00.000-03:00",
|
|
12
|
+
"estado": "validado",
|
|
13
|
+
"genero": "masculino",
|
|
14
|
+
"financiador": [
|
|
15
|
+
{
|
|
16
|
+
"codigoPuco": 921001,
|
|
17
|
+
"nombre": "O.S.P. NEUQUEN",
|
|
18
|
+
"financiador": "O.S.P. NEUQUEN"
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"codigoPuco": 921001,
|
|
22
|
+
"nombre": "O.S.P. NEUQUEN",
|
|
23
|
+
"financiador": "O.S.P. NEUQUEN"
|
|
24
|
+
}
|
|
25
|
+
],
|
|
26
|
+
"relaciones": [
|
|
27
|
+
{
|
|
28
|
+
"_id": "5b92dec9646d99436065cbfc",
|
|
29
|
+
"relacion": {
|
|
30
|
+
"_id": "59247c391ebf0273353b23c0",
|
|
31
|
+
"nombre": "hijo/a",
|
|
32
|
+
"opuesto": "progenitor/a"
|
|
33
|
+
},
|
|
34
|
+
"referencia": "5b92de583173b053ae88f2d0",
|
|
35
|
+
"nombre": "JOSEFINA",
|
|
36
|
+
"apellido": "PERINGA PONCE",
|
|
37
|
+
"documento": "333333333",
|
|
38
|
+
"fotoId": "5f9072d00254f253d9c7dd54"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"_id": "5b92dec9646d99436065cbfa",
|
|
42
|
+
"relacion": {
|
|
43
|
+
"_id": "59247c391ebf0273353b23c0",
|
|
44
|
+
"nombre": "hijo/a",
|
|
45
|
+
"opuesto": "progenitor/a"
|
|
46
|
+
},
|
|
47
|
+
"referencia": "5b9287f10394a225c25a150b",
|
|
48
|
+
"nombre": "IGNACIO",
|
|
49
|
+
"apellido": "PERINGA PONCE",
|
|
50
|
+
"documento": "222222222",
|
|
51
|
+
"fotoId": "5f9072d00254f253d9c7dd2c"
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
"_id": "5f00d31e044ef317c36fd4f8",
|
|
55
|
+
"relacion": {
|
|
56
|
+
"_id": "59247c391ebf0273353b23c0",
|
|
57
|
+
"nombre": "hijo/a",
|
|
58
|
+
"opuesto": "progenitor/a"
|
|
59
|
+
},
|
|
60
|
+
"referencia": "5f00d2f7acfe3a7e46a88227",
|
|
61
|
+
"nombre": "JUAN CRUZ",
|
|
62
|
+
"apellido": "PERINGA PONCE",
|
|
63
|
+
"documento": "11111111",
|
|
64
|
+
"fotoId": "5f9078ff0254f253d9dc7212"
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
"_id": "5f09f00d5cec191aa5908457",
|
|
68
|
+
"relacion": {
|
|
69
|
+
"_id": "59247e1c1ebf0273353b23c5",
|
|
70
|
+
"nombre": "otro",
|
|
71
|
+
"opuesto": "otro"
|
|
72
|
+
},
|
|
73
|
+
"referencia": "59cb176acd21ce293061b67b",
|
|
74
|
+
"nombre": "FLORENCIA INES",
|
|
75
|
+
"apellido": "YAMIL",
|
|
76
|
+
"documento": "15365478",
|
|
77
|
+
"fotoId": "5f9072b40254f253d9c79556"
|
|
78
|
+
}
|
|
79
|
+
],
|
|
80
|
+
"direccion": [
|
|
81
|
+
{
|
|
82
|
+
"geoReferencia": [
|
|
83
|
+
-38.9305707,
|
|
84
|
+
-68.0839758
|
|
85
|
+
],
|
|
86
|
+
"activo": true,
|
|
87
|
+
"_id": "58d90d6f0bb1a96b254d9878",
|
|
88
|
+
"valor": "Enrique Santos Discepolo 1856",
|
|
89
|
+
"codigoPostal": "8300",
|
|
90
|
+
"ubicacion": {
|
|
91
|
+
"_id": "58d90d6f0bb1a96b254d9879",
|
|
92
|
+
"pais": {
|
|
93
|
+
"_id": "57f3b5c469fe79a598e6281f",
|
|
94
|
+
"nombre": "Argentina"
|
|
95
|
+
},
|
|
96
|
+
"provincia": {
|
|
97
|
+
"_id": "57f3f3aacebd681cc2014c53",
|
|
98
|
+
"nombre": "Neuquén"
|
|
99
|
+
},
|
|
100
|
+
"localidad": {
|
|
101
|
+
"_id": "57f538a472325875a199a82d",
|
|
102
|
+
"nombre": "NEUQUEN"
|
|
103
|
+
},
|
|
104
|
+
"barrio": null
|
|
105
|
+
},
|
|
106
|
+
"ranking": 0,
|
|
107
|
+
"ultimaActualizacion": "2017-03-27T10:02:16.809-03:00"
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
"geoReferencia": null,
|
|
111
|
+
"activo": true,
|
|
112
|
+
"_id": "6046105ba4e2d85f81ad60f7",
|
|
113
|
+
"valor": "NORDENSTROM 1898 0 0",
|
|
114
|
+
"codigoPostal": "8300",
|
|
115
|
+
"ranking": 1,
|
|
116
|
+
"ubicacion": {
|
|
117
|
+
"_id": "6046105ba4e2d85f81ad60f8",
|
|
118
|
+
"pais": {
|
|
119
|
+
"_id": "57f3b5c469fe79a598e6281f",
|
|
120
|
+
"nombre": "Argentina"
|
|
121
|
+
},
|
|
122
|
+
"provincia": {
|
|
123
|
+
"_id": "57f3f3aacebd681cc2014c53",
|
|
124
|
+
"nombre": "Neuquén"
|
|
125
|
+
},
|
|
126
|
+
"localidad": {
|
|
127
|
+
"_id": "57f538a472325875a199a82d",
|
|
128
|
+
"nombre": "Neuquén"
|
|
129
|
+
},
|
|
130
|
+
"barrio": null
|
|
131
|
+
},
|
|
132
|
+
"ultimaActualizacion": "2021-03-08T08:54:04.089-03:00"
|
|
133
|
+
}
|
|
134
|
+
],
|
|
135
|
+
"contacto": [
|
|
136
|
+
{
|
|
137
|
+
"activo": true,
|
|
138
|
+
"_id": "5cabf8cc129519c9cd5bf6f2",
|
|
139
|
+
"tipo": "celular",
|
|
140
|
+
"valor": "4462221"
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
"activo": true,
|
|
144
|
+
"_id": "5cabf8cc129519c9cd5bf6f1",
|
|
145
|
+
"tipo": "email",
|
|
146
|
+
"valor": "hugoperingaponce@gmail.com"
|
|
147
|
+
}
|
|
148
|
+
],
|
|
149
|
+
"identificadores": [
|
|
150
|
+
{
|
|
151
|
+
"entidad": "RENAPER",
|
|
152
|
+
"valor": "241654536"
|
|
153
|
+
}
|
|
154
|
+
],
|
|
155
|
+
"estadoCivil": "soltero",
|
|
156
|
+
"reportarError": false,
|
|
157
|
+
"scan": "27381849",
|
|
158
|
+
"carpetaEfectores": [
|
|
159
|
+
{
|
|
160
|
+
"_id": "5992e06a0e3f6446112e9bd5",
|
|
161
|
+
"organizacion": {
|
|
162
|
+
"_id": "59650203d03019f919ea31ed",
|
|
163
|
+
"nombre": "CENTRO DE SALUD PARQUE INDUSTRIAL"
|
|
164
|
+
},
|
|
165
|
+
"nroCarpeta": ""
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
"_id": "5b57565dc0202168d3d5762d",
|
|
169
|
+
"organizacion": {
|
|
170
|
+
"_id": "57e9670e52df311059bc8964",
|
|
171
|
+
"nombre": "HOSPITAL PROVINCIAL NEUQUEN - DR. EDUARDO CASTRO RENDON"
|
|
172
|
+
},
|
|
173
|
+
"nroCarpeta": "PDR27381849"
|
|
174
|
+
}
|
|
175
|
+
],
|
|
176
|
+
"notas": [],
|
|
177
|
+
"cuil": "23273818499",
|
|
178
|
+
"foto": null,
|
|
179
|
+
"activo": true,
|
|
180
|
+
"notaError": "",
|
|
181
|
+
"tipoIdentificacion": null,
|
|
182
|
+
"fotoId": "6046105c18944f849e9fe315",
|
|
183
|
+
"documentos": [],
|
|
184
|
+
"fechaFallecimiento": null
|
|
185
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
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
|
+
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as 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
|
+
}
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
|
|
2
|
+
import * as 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
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
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
|
+
|
|
@@ -0,0 +1,13 @@
|
|
|
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
|
+
});
|
|
@@ -0,0 +1,17 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
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
|
+
}
|