@andes/fhir 1.12.0 → 1.12.1-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/LICENSE +674 -674
- package/README.md +2 -2
- package/{src → dist}/data/patient.json +192 -192
- package/dist/helpers/patientFactory.d.ts +26 -0
- package/dist/{src/helpers → helpers}/patientFactory.js +35 -31
- package/dist/index.d.ts +15 -0
- package/dist/index.js +55 -52
- package/dist/lib/allergyIntolerance.d.ts +29 -0
- package/dist/{src/lib → lib}/allergyIntolerance.js +39 -40
- package/dist/lib/bundle.d.ts +14 -0
- package/dist/{src/lib → lib}/bundle.js +25 -26
- package/dist/lib/composition.d.ts +47 -0
- package/dist/{src/lib → lib}/composition.js +152 -152
- package/dist/lib/condition.d.ts +53 -0
- package/dist/{src/lib → lib}/condition.js +79 -80
- package/dist/lib/config.d.ts +9 -0
- package/dist/{src/lib → lib}/config.js +27 -21
- package/dist/lib/config.test.d.ts +1 -0
- package/dist/lib/config.test.js +19 -0
- package/dist/lib/device.d.ts +22 -0
- package/dist/{src/lib → lib}/device.js +38 -39
- package/dist/lib/device.test.d.ts +1 -0
- package/dist/lib/device.test.js +9 -0
- package/dist/lib/document-reference.d.ts +71 -0
- package/dist/{src/lib → lib}/document-reference.js +106 -107
- package/dist/lib/immunization.d.ts +44 -0
- package/dist/{src/lib → lib}/immunization.js +67 -68
- package/dist/lib/medication.d.ts +25 -0
- package/{src/lib/medication.ts → dist/lib/medication.js} +64 -61
- package/dist/lib/medicationRequest.d.ts +42 -0
- package/{src/lib/medicationRequest.ts → dist/lib/medicationRequest.js} +103 -100
- package/dist/lib/medicationStatement.d.ts +47 -0
- package/dist/{src/lib → lib}/medicationStatement.js +55 -56
- package/dist/lib/organization.d.ts +6 -0
- package/dist/lib/organization.js +93 -0
- package/dist/lib/patient.d.ts +14 -0
- package/dist/lib/patient.js +465 -0
- package/dist/lib/patient.test.d.ts +1 -0
- package/dist/{src/lib → lib}/patient.test.js +132 -113
- package/dist/lib/practitioner.d.ts +6 -0
- package/dist/lib/practitioner.js +186 -0
- package/dist/types/andes/organization.types.d.ts +39 -0
- package/dist/types/andes/organization.types.js +2 -0
- package/dist/types/andes/patient.types.d.ts +57 -0
- package/dist/types/andes/patient.types.js +2 -0
- package/dist/types/andes/practitioner.types.d.ts +72 -0
- package/dist/types/andes/practitioner.types.js +3 -0
- package/package.json +56 -45
- 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 -351
- package/coverage/clover.xml +0 -209
- 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 -1318
- 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 -425
- package/dist/index.js.map +0 -1
- package/dist/src/data/patient.json +0 -192
- 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 -397
- package/dist/src/lib/patient.js.map +0 -1
- 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 -101
- package/src/lib/patient.ts +0 -411
- package/src/lib/practitioner.ts +0 -157
- package/tsconfig.test.json +0 -18
- package/tslint.json +0 -139
package/src/lib/practitioner.ts
DELETED
|
@@ -1,157 +0,0 @@
|
|
|
1
|
-
import { getDominio, makeUrl } from './config';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Encode a practitioner from ANDES to FHIR
|
|
5
|
-
* @param {} practitioner
|
|
6
|
-
*/
|
|
7
|
-
export function encode(practitioner) {
|
|
8
|
-
let data = practitioner;
|
|
9
|
-
if (data) {
|
|
10
|
-
let identificadores = data.documento ? [{
|
|
11
|
-
system: 'http://www.renaper.gob.ar/dni',
|
|
12
|
-
value: data.documento
|
|
13
|
-
}] : [];
|
|
14
|
-
if (data.cuit) {
|
|
15
|
-
identificadores.push({
|
|
16
|
-
system: 'https://seti.afip.gob.ar/padron-puc-constancia-internet/ConsultaConstanciaAction.do',
|
|
17
|
-
value: data.cuit
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
identificadores.push({
|
|
21
|
-
system: getDominio(),
|
|
22
|
-
value: data._id
|
|
23
|
-
});
|
|
24
|
-
// Parsea contactos
|
|
25
|
-
let contactos = data.contacto ? data.contacto.map(unContacto => {
|
|
26
|
-
let cont = {
|
|
27
|
-
resourceType: 'ContactPoint',
|
|
28
|
-
value: unContacto.valor,
|
|
29
|
-
rank: unContacto.ranking,
|
|
30
|
-
};
|
|
31
|
-
switch (unContacto.tipo) {
|
|
32
|
-
case 'fijo':
|
|
33
|
-
cont['system'] = 'phone';
|
|
34
|
-
break;
|
|
35
|
-
case 'celular':
|
|
36
|
-
cont['system'] = 'phone';
|
|
37
|
-
break;
|
|
38
|
-
case 'email':
|
|
39
|
-
cont['system'] = 'email';
|
|
40
|
-
break;
|
|
41
|
-
}
|
|
42
|
-
return cont;
|
|
43
|
-
}) : [];
|
|
44
|
-
// Parsea direcciones
|
|
45
|
-
let direcciones = data.domicilios ? data.domicilios.map(unDomicilio => {
|
|
46
|
-
let direc = {
|
|
47
|
-
resourceType: 'Address',
|
|
48
|
-
postalCode: unDomicilio.codigoPostal ? unDomicilio.codigoPostal : '',
|
|
49
|
-
line: [unDomicilio.valor],
|
|
50
|
-
city: unDomicilio.ubicacion.localidad ? unDomicilio.ubicacion.localidad.nombre : '',
|
|
51
|
-
state: unDomicilio.ubicacion.provincia ? unDomicilio.ubicacion.provincia.nombre : '',
|
|
52
|
-
country: unDomicilio.ubicacion.pais ? unDomicilio.ubicacion.pais.nombre : ''
|
|
53
|
-
};
|
|
54
|
-
return direc;
|
|
55
|
-
}) : [];
|
|
56
|
-
// Parsea relaciones
|
|
57
|
-
let relaciones = data.relaciones ? data.relaciones.map(unaRelacion => {
|
|
58
|
-
let relacion = {
|
|
59
|
-
relationship: [{
|
|
60
|
-
text: unaRelacion.relacion.nombre
|
|
61
|
-
}],
|
|
62
|
-
name: {
|
|
63
|
-
resourceType: 'HumanName',
|
|
64
|
-
family: unaRelacion.apellido.split(' '),
|
|
65
|
-
given: unaRelacion.nombre.split(' '),
|
|
66
|
-
}
|
|
67
|
-
};
|
|
68
|
-
return relacion;
|
|
69
|
-
}) : [];
|
|
70
|
-
let matriculas = data.formacionGrado ? data.formacionGrado.map(datosGrado => {
|
|
71
|
-
let cantMatriculaciones = datosGrado.matriculacion ? datosGrado.matriculacion.length : 0;
|
|
72
|
-
let unaMatricula = {
|
|
73
|
-
identifier: datosGrado.profesion.nombre ? [{
|
|
74
|
-
system: 'https://www.saludneuquen.gob.ar/matriculacionGrado',
|
|
75
|
-
value: datosGrado.profesion.nombre
|
|
76
|
-
}] : [],
|
|
77
|
-
code: cantMatriculaciones > 0 ? {
|
|
78
|
-
coding: [{
|
|
79
|
-
system: 'http://www.saludneuquen.gob.ar/fiscalizacion.html',
|
|
80
|
-
code: datosGrado.profesion.codigo,
|
|
81
|
-
display: datosGrado.profesion.tipoDeFormacion
|
|
82
|
-
}],
|
|
83
|
-
text: datosGrado.matriculacion[cantMatriculaciones - 1].matriculaNumero
|
|
84
|
-
} : null,
|
|
85
|
-
period: cantMatriculaciones > 0 ? {
|
|
86
|
-
start: datosGrado.matriculacion[cantMatriculaciones - 1].inicio ? datosGrado.matriculacion[cantMatriculaciones - 1].inicio : null,
|
|
87
|
-
end: datosGrado.matriculacion[cantMatriculaciones - 1].fin ? datosGrado.matriculacion[cantMatriculaciones - 1].fin : null
|
|
88
|
-
} : null
|
|
89
|
-
};
|
|
90
|
-
return unaMatricula;
|
|
91
|
-
}) : null;
|
|
92
|
-
let matriculasEspecialidad = (data.formacionPosgrado ? data.formacionPosgrado.map(datosPosgrado => {
|
|
93
|
-
let cantMatriculacionesEsp = datosPosgrado.matriculacion ? datosPosgrado.matriculacion.length : 0;
|
|
94
|
-
let unaMatricula = {
|
|
95
|
-
identifier: datosPosgrado.especialidad.nombre ? [{
|
|
96
|
-
system: 'https://www.saludneuquen.gob.ar/matriculacionEspecialidad/',
|
|
97
|
-
value: datosPosgrado.especialidad.nombre
|
|
98
|
-
}] : [],
|
|
99
|
-
code: cantMatriculacionesEsp > 0 ? {
|
|
100
|
-
coding: [{
|
|
101
|
-
system: 'http://www.saludneuquen.gob.ar/fiscalizacion.html',
|
|
102
|
-
code: datosPosgrado.especialidad.codigo,
|
|
103
|
-
display: datosPosgrado.especialidad.tipo
|
|
104
|
-
}],
|
|
105
|
-
text: datosPosgrado.matriculacion[cantMatriculacionesEsp - 1].matriculaNumero
|
|
106
|
-
} : null,
|
|
107
|
-
period: cantMatriculacionesEsp > 0 ? {
|
|
108
|
-
start: datosPosgrado.matriculacion[cantMatriculacionesEsp - 1].inicio ? datosPosgrado.matriculacion[cantMatriculacionesEsp - 1].inicio : null,
|
|
109
|
-
end: datosPosgrado.matriculacion[cantMatriculacionesEsp - 1].fin ? datosPosgrado.matriculacion[cantMatriculacionesEsp - 1].fin : null
|
|
110
|
-
} : null
|
|
111
|
-
};
|
|
112
|
-
return unaMatricula;
|
|
113
|
-
}) : null);
|
|
114
|
-
let genero;
|
|
115
|
-
switch (data.sexo.toLowerCase()) {
|
|
116
|
-
case 'femenino':
|
|
117
|
-
genero = 'female';
|
|
118
|
-
break;
|
|
119
|
-
case 'masculino':
|
|
120
|
-
genero = 'male';
|
|
121
|
-
break;
|
|
122
|
-
case 'otro':
|
|
123
|
-
genero = 'other';
|
|
124
|
-
break;
|
|
125
|
-
}
|
|
126
|
-
let profesionalFHIR = {
|
|
127
|
-
resourceType: 'Practitioner',
|
|
128
|
-
identifier: identificadores,
|
|
129
|
-
active: data.habilitado ? data.habilitado : null,
|
|
130
|
-
name: [{
|
|
131
|
-
resourceType: 'HumanName',
|
|
132
|
-
family: data.apellido.split(' '),
|
|
133
|
-
given: data.nombre.split(' '),
|
|
134
|
-
}],
|
|
135
|
-
gender: genero,
|
|
136
|
-
birthDate: data.fechaNacimiento,
|
|
137
|
-
};
|
|
138
|
-
if (data.foto) {
|
|
139
|
-
profesionalFHIR['photo'] = [{
|
|
140
|
-
data: data.foto
|
|
141
|
-
}];
|
|
142
|
-
}
|
|
143
|
-
if (contactos.length > 0) {
|
|
144
|
-
profesionalFHIR['telecom'] = contactos;
|
|
145
|
-
}
|
|
146
|
-
if (direcciones.length > 0) {
|
|
147
|
-
profesionalFHIR['address'] = direcciones;
|
|
148
|
-
}
|
|
149
|
-
if (matriculas.length > 0) {
|
|
150
|
-
profesionalFHIR['qualification'] = matriculas.concat(matriculasEspecialidad);
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
return profesionalFHIR;
|
|
154
|
-
} else {
|
|
155
|
-
return null;
|
|
156
|
-
}
|
|
157
|
-
}
|
package/tsconfig.test.json
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": "../tsconfig.base.json",
|
|
3
|
-
"compilerOptions": {
|
|
4
|
-
"rootDir": "src",
|
|
5
|
-
"outDir": "build",
|
|
6
|
-
"declaration": true,
|
|
7
|
-
"target": "es2018",
|
|
8
|
-
"module": "commonjs",
|
|
9
|
-
"moduleResolution": "node"
|
|
10
|
-
},
|
|
11
|
-
"exclude": [
|
|
12
|
-
"build",
|
|
13
|
-
"node_modules",
|
|
14
|
-
"coverage",
|
|
15
|
-
"config",
|
|
16
|
-
"src/**/*.story.tsx"
|
|
17
|
-
]
|
|
18
|
-
}
|
package/tslint.json
DELETED
|
@@ -1,139 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": [
|
|
3
|
-
"tslint-eslint-rules"
|
|
4
|
-
],
|
|
5
|
-
"rules": {
|
|
6
|
-
"class-name": true,
|
|
7
|
-
"comment-format": [
|
|
8
|
-
true,
|
|
9
|
-
"check-space"
|
|
10
|
-
],
|
|
11
|
-
"curly": true,
|
|
12
|
-
"eofline": true,
|
|
13
|
-
"forin": false,
|
|
14
|
-
"indent": [
|
|
15
|
-
true,
|
|
16
|
-
"spaces"
|
|
17
|
-
],
|
|
18
|
-
"label-position": true,
|
|
19
|
-
"max-line-length": [
|
|
20
|
-
false,
|
|
21
|
-
140
|
|
22
|
-
],
|
|
23
|
-
"member-access": false,
|
|
24
|
-
"no-arg": true,
|
|
25
|
-
"no-bitwise": true,
|
|
26
|
-
"no-console": [
|
|
27
|
-
true
|
|
28
|
-
],
|
|
29
|
-
"no-construct": true,
|
|
30
|
-
"no-debugger": true,
|
|
31
|
-
"no-duplicate-variable": true,
|
|
32
|
-
"no-empty": false,
|
|
33
|
-
"no-eval": true,
|
|
34
|
-
"no-inferrable-types": true,
|
|
35
|
-
"no-shadowed-variable": true,
|
|
36
|
-
"no-string-literal": false,
|
|
37
|
-
"no-switch-case-fall-through": true,
|
|
38
|
-
"no-trailing-whitespace": true,
|
|
39
|
-
"object-literal-sort-keys": false,
|
|
40
|
-
"one-line": [
|
|
41
|
-
true,
|
|
42
|
-
"check-open-brace",
|
|
43
|
-
"check-catch",
|
|
44
|
-
"check-else",
|
|
45
|
-
"check-whitespace"
|
|
46
|
-
],
|
|
47
|
-
"quotemark": [
|
|
48
|
-
true,
|
|
49
|
-
"single"
|
|
50
|
-
],
|
|
51
|
-
"radix": true,
|
|
52
|
-
"semicolon": [
|
|
53
|
-
true,
|
|
54
|
-
"always"
|
|
55
|
-
],
|
|
56
|
-
"triple-equals": [
|
|
57
|
-
true,
|
|
58
|
-
"allow-null-check"
|
|
59
|
-
],
|
|
60
|
-
"typedef-whitespace": [
|
|
61
|
-
true,
|
|
62
|
-
{
|
|
63
|
-
"call-signature": "nospace",
|
|
64
|
-
"index-signature": "nospace",
|
|
65
|
-
"parameter": "nospace",
|
|
66
|
-
"property-declaration": "nospace",
|
|
67
|
-
"variable-declaration": "nospace"
|
|
68
|
-
}
|
|
69
|
-
],
|
|
70
|
-
"variable-name": false,
|
|
71
|
-
"whitespace": [
|
|
72
|
-
true,
|
|
73
|
-
"check-branch",
|
|
74
|
-
"check-decl",
|
|
75
|
-
"check-operator",
|
|
76
|
-
"check-separator",
|
|
77
|
-
"check-type",
|
|
78
|
-
"check-preblock"
|
|
79
|
-
],
|
|
80
|
-
"object-literal-key-quotes": [
|
|
81
|
-
true,
|
|
82
|
-
"as-needed"
|
|
83
|
-
],
|
|
84
|
-
"no-unnecessary-callback-wrapper": true,
|
|
85
|
-
"no-consecutive-blank-lines": [
|
|
86
|
-
true,
|
|
87
|
-
2
|
|
88
|
-
],
|
|
89
|
-
"align": [
|
|
90
|
-
true,
|
|
91
|
-
"parameters",
|
|
92
|
-
"statements",
|
|
93
|
-
"members"
|
|
94
|
-
],
|
|
95
|
-
"space-before-function-paren": [
|
|
96
|
-
true,
|
|
97
|
-
{
|
|
98
|
-
"anonymous": "always",
|
|
99
|
-
"named": "never",
|
|
100
|
-
"asyncArrow": "always"
|
|
101
|
-
}
|
|
102
|
-
],
|
|
103
|
-
"no-implicit-dependencies": [
|
|
104
|
-
true,
|
|
105
|
-
"dev"
|
|
106
|
-
],
|
|
107
|
-
"no-unused-expression": true,
|
|
108
|
-
"no-var-keyword": true,
|
|
109
|
-
"prefer-object-spread": true,
|
|
110
|
-
"import-spacing": true,
|
|
111
|
-
"object-literal-shorthand": true,
|
|
112
|
-
"only-arrow-functions": [
|
|
113
|
-
true,
|
|
114
|
-
"allow-declarations",
|
|
115
|
-
"allow-named-functions"
|
|
116
|
-
],
|
|
117
|
-
"ter-indent": [
|
|
118
|
-
true,
|
|
119
|
-
4,
|
|
120
|
-
{
|
|
121
|
-
"SwitchCase": 1
|
|
122
|
-
}
|
|
123
|
-
],
|
|
124
|
-
"array-bracket-spacing": [
|
|
125
|
-
true,
|
|
126
|
-
{
|
|
127
|
-
"singleValue": false,
|
|
128
|
-
"objectsInArrays": false,
|
|
129
|
-
"arraysInArrays": false
|
|
130
|
-
}
|
|
131
|
-
],
|
|
132
|
-
"no-constant-condition": [
|
|
133
|
-
true,
|
|
134
|
-
{
|
|
135
|
-
"checkLoops": false
|
|
136
|
-
}
|
|
137
|
-
]
|
|
138
|
-
}
|
|
139
|
-
}
|