@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.
Files changed (127) hide show
  1. package/LICENSE +674 -674
  2. package/README.md +2 -2
  3. package/{src → dist}/data/patient.json +192 -192
  4. package/dist/helpers/patientFactory.d.ts +26 -0
  5. package/dist/{src/helpers → helpers}/patientFactory.js +35 -31
  6. package/dist/index.d.ts +15 -0
  7. package/dist/index.js +55 -52
  8. package/dist/lib/allergyIntolerance.d.ts +29 -0
  9. package/dist/{src/lib → lib}/allergyIntolerance.js +39 -40
  10. package/dist/lib/bundle.d.ts +14 -0
  11. package/dist/{src/lib → lib}/bundle.js +25 -26
  12. package/dist/lib/composition.d.ts +47 -0
  13. package/dist/{src/lib → lib}/composition.js +152 -152
  14. package/dist/lib/condition.d.ts +53 -0
  15. package/dist/{src/lib → lib}/condition.js +79 -80
  16. package/dist/lib/config.d.ts +9 -0
  17. package/dist/{src/lib → lib}/config.js +27 -21
  18. package/dist/lib/config.test.d.ts +1 -0
  19. package/dist/lib/config.test.js +19 -0
  20. package/dist/lib/device.d.ts +22 -0
  21. package/dist/{src/lib → lib}/device.js +38 -39
  22. package/dist/lib/device.test.d.ts +1 -0
  23. package/dist/lib/device.test.js +9 -0
  24. package/dist/lib/document-reference.d.ts +71 -0
  25. package/dist/{src/lib → lib}/document-reference.js +106 -107
  26. package/dist/lib/immunization.d.ts +44 -0
  27. package/dist/{src/lib → lib}/immunization.js +67 -68
  28. package/dist/lib/medication.d.ts +25 -0
  29. package/{src/lib/medication.ts → dist/lib/medication.js} +64 -61
  30. package/dist/lib/medicationRequest.d.ts +42 -0
  31. package/{src/lib/medicationRequest.ts → dist/lib/medicationRequest.js} +103 -100
  32. package/dist/lib/medicationStatement.d.ts +47 -0
  33. package/dist/{src/lib → lib}/medicationStatement.js +55 -56
  34. package/dist/lib/organization.d.ts +6 -0
  35. package/dist/lib/organization.js +93 -0
  36. package/dist/lib/patient.d.ts +14 -0
  37. package/dist/lib/patient.js +465 -0
  38. package/dist/lib/patient.test.d.ts +1 -0
  39. package/dist/{src/lib → lib}/patient.test.js +132 -113
  40. package/dist/lib/practitioner.d.ts +6 -0
  41. package/dist/lib/practitioner.js +186 -0
  42. package/dist/types/andes/organization.types.d.ts +39 -0
  43. package/dist/types/andes/organization.types.js +2 -0
  44. package/dist/types/andes/patient.types.d.ts +57 -0
  45. package/dist/types/andes/patient.types.js +2 -0
  46. package/dist/types/andes/practitioner.types.d.ts +72 -0
  47. package/dist/types/andes/practitioner.types.js +3 -0
  48. package/package.json +56 -45
  49. package/.circleci/config.yml +0 -72
  50. package/.editorconfig +0 -14
  51. package/.env.example +0 -2
  52. package/.gitattributes +0 -1
  53. package/.github/CODEOWNERS +0 -1
  54. package/.github/labeler.yml +0 -11
  55. package/.github/pull_request_template.md +0 -28
  56. package/.github/workflows/build_test.yml +0 -14
  57. package/.github/workflows/has_conflicts.yml +0 -13
  58. package/.vscode/settings.json +0 -2
  59. package/CHANGELOG.md +0 -351
  60. package/coverage/clover.xml +0 -209
  61. package/coverage/coverage-final.json +0 -5
  62. package/coverage/lcov-report/base.css +0 -224
  63. package/coverage/lcov-report/block-navigation.js +0 -87
  64. package/coverage/lcov-report/config.ts.html +0 -136
  65. package/coverage/lcov-report/device.ts.html +0 -193
  66. package/coverage/lcov-report/favicon.png +0 -0
  67. package/coverage/lcov-report/helpers/index.html +0 -116
  68. package/coverage/lcov-report/helpers/patientFactory.ts.html +0 -124
  69. package/coverage/lcov-report/index.html +0 -131
  70. package/coverage/lcov-report/lib/config.ts.html +0 -136
  71. package/coverage/lcov-report/lib/device.ts.html +0 -193
  72. package/coverage/lcov-report/lib/index.html +0 -146
  73. package/coverage/lcov-report/lib/patient.ts.html +0 -1318
  74. package/coverage/lcov-report/patient.ts.html +0 -1207
  75. package/coverage/lcov-report/prettify.css +0 -1
  76. package/coverage/lcov-report/prettify.js +0 -2
  77. package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  78. package/coverage/lcov-report/sorter.js +0 -210
  79. package/coverage/lcov.info +0 -425
  80. package/dist/index.js.map +0 -1
  81. package/dist/src/data/patient.json +0 -192
  82. package/dist/src/helpers/patientFactory.js.map +0 -1
  83. package/dist/src/lib/allergyIntolerance.js.map +0 -1
  84. package/dist/src/lib/bundle.js.map +0 -1
  85. package/dist/src/lib/composition.js.map +0 -1
  86. package/dist/src/lib/condition.js.map +0 -1
  87. package/dist/src/lib/config.js.map +0 -1
  88. package/dist/src/lib/config.test.js +0 -13
  89. package/dist/src/lib/config.test.js.map +0 -1
  90. package/dist/src/lib/device.js.map +0 -1
  91. package/dist/src/lib/device.test.js +0 -10
  92. package/dist/src/lib/device.test.js.map +0 -1
  93. package/dist/src/lib/document-reference.js.map +0 -1
  94. package/dist/src/lib/immunization.js.map +0 -1
  95. package/dist/src/lib/medication.js +0 -65
  96. package/dist/src/lib/medication.js.map +0 -1
  97. package/dist/src/lib/medicationRequest.js +0 -103
  98. package/dist/src/lib/medicationRequest.js.map +0 -1
  99. package/dist/src/lib/medicationStatement.js.map +0 -1
  100. package/dist/src/lib/organization.js +0 -91
  101. package/dist/src/lib/organization.js.map +0 -1
  102. package/dist/src/lib/patient.js +0 -397
  103. package/dist/src/lib/patient.js.map +0 -1
  104. package/dist/src/lib/patient.test.js.map +0 -1
  105. package/dist/src/lib/practitioner.js +0 -161
  106. package/dist/src/lib/practitioner.js.map +0 -1
  107. package/index.ts +0 -30
  108. package/jest.config.js +0 -12
  109. package/release.config.js +0 -74
  110. package/src/helpers/patientFactory.ts +0 -13
  111. package/src/lib/allergyIntolerance.ts +0 -36
  112. package/src/lib/bundle.ts +0 -19
  113. package/src/lib/composition.ts +0 -153
  114. package/src/lib/condition.ts +0 -80
  115. package/src/lib/config.test.ts +0 -13
  116. package/src/lib/config.ts +0 -17
  117. package/src/lib/device.test.ts +0 -9
  118. package/src/lib/device.ts +0 -36
  119. package/src/lib/document-reference.ts +0 -102
  120. package/src/lib/immunization.ts +0 -64
  121. package/src/lib/medicationStatement.ts +0 -52
  122. package/src/lib/organization.ts +0 -89
  123. package/src/lib/patient.test.ts +0 -101
  124. package/src/lib/patient.ts +0 -411
  125. package/src/lib/practitioner.ts +0 -157
  126. package/tsconfig.test.json +0 -18
  127. package/tslint.json +0 -139
@@ -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
- }
@@ -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
- }