@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
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
- }
@@ -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
- }
@@ -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
-
@@ -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
- }
@@ -1,9 +0,0 @@
1
- import { encode } from './device';
2
-
3
- test('Device type 1', () => {
4
- expect(encode().id).toBe('device-01');
5
- });
6
-
7
- test('Device Name', () => {
8
- expect(encode().deviceName[0].name).toBe('Sistema de Aplicaciones Neuquinas de Salud (ANDES)');
9
- });
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
- }
@@ -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
- }
@@ -1,52 +0,0 @@
1
- /**
2
- * Encode de Medicamentos from ANDES to FHIR
3
- * @param {} medicationStatement
4
- */
5
- // Muy incompleto hay que mejorarlo mucho todavía
6
- export function encode(patientReference, medicationReference, prestacionMedicamento) {
7
- return {
8
- resourceType: 'MedicationStatement',
9
- status: (prestacionMedicamento.valor.estado === 'activo') ? 'active' : 'inactive',
10
- id: prestacionMedicamento._id, // El código de la prestación donde está el registro del contexto de porque está consumiendo el medicamento
11
- effectiveDateTime: prestacionMedicamento.createdAt,
12
- medicationCodeableConcept: {
13
- coding: [
14
- {
15
- system: 'http://snomed.info/sct',
16
- code: prestacionMedicamento.concepto.conceptId,
17
- display: prestacionMedicamento.concepto.term
18
- }
19
- ]
20
- },
21
- meta: {
22
- profile: [
23
- 'http://hl7.org/fhir/uv/ips/StructureDefinition/medication-ips'
24
- ]
25
- },
26
- // extension: null,
27
- // identifier: '', // Business identifier, not a resource identifier
28
- subject: {
29
- reference: patientReference
30
- },
31
- medicationReference: {
32
- reference: medicationReference
33
- },
34
- // 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é)
35
- dosage: [
36
- {
37
- text: prestacionMedicamento.valor, // indicación
38
- route: { coding: [{ system: 'http://standardterms.edqm.eu', code: prestacionMedicamento._id, display: prestacionMedicamento.nombre }] },
39
- timing: { coding: { system: 'http://terminology.hl7.org/CodeSystem/v3-GTSAbbreviation', code: 'QD', display: 'Diario' } }
40
- }
41
- ],
42
- // 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
43
- // en este registro ya que no siempre está la unidad de tiempo (dias, mes, etc) hay q ver si no es un bug.
44
- // start: '2015-03'
45
- // },
46
- text: {
47
- status: 'generated',
48
- 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>`
49
- }
50
- };
51
- }
52
-