@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.
Files changed (71) hide show
  1. package/.circleci/config.yml +69 -0
  2. package/.editorconfig +14 -0
  3. package/.gitattributes +1 -0
  4. package/.github/CODEOWNERS +1 -0
  5. package/.github/labeler.yml +11 -0
  6. package/.github/pull_request_template.md +28 -0
  7. package/.github/workflows/build_test.yml +14 -0
  8. package/.github/workflows/has_conflicts.yml +13 -0
  9. package/CHANGELOG.md +306 -0
  10. package/LICENSE +674 -0
  11. package/README.md +2 -0
  12. package/dist/index.js +33 -0
  13. package/dist/index.js.map +1 -0
  14. package/dist/src/data/patient.json +185 -0
  15. package/dist/src/lib/allergyIntolerance.js +40 -0
  16. package/dist/src/lib/allergyIntolerance.js.map +1 -0
  17. package/dist/src/lib/bundle.js +23 -0
  18. package/dist/src/lib/bundle.js.map +1 -0
  19. package/dist/src/lib/composition.js +151 -0
  20. package/dist/src/lib/composition.js.map +1 -0
  21. package/dist/src/lib/condition.js +80 -0
  22. package/dist/src/lib/condition.js.map +1 -0
  23. package/dist/src/lib/config.js +23 -0
  24. package/dist/src/lib/config.js.map +1 -0
  25. package/dist/src/lib/config.test.js +13 -0
  26. package/dist/src/lib/config.test.js.map +1 -0
  27. package/dist/src/lib/device.js +39 -0
  28. package/dist/src/lib/device.js.map +1 -0
  29. package/dist/src/lib/device.test.js +10 -0
  30. package/dist/src/lib/device.test.js.map +1 -0
  31. package/dist/src/lib/document-reference.js +104 -0
  32. package/dist/src/lib/document-reference.js.map +1 -0
  33. package/dist/src/lib/immunization.js +68 -0
  34. package/dist/src/lib/immunization.js.map +1 -0
  35. package/dist/src/lib/medication.js +65 -0
  36. package/dist/src/lib/medication.js.map +1 -0
  37. package/dist/src/lib/medicationRequest.js +100 -0
  38. package/dist/src/lib/medicationRequest.js.map +1 -0
  39. package/dist/src/lib/medicationStatement.js +56 -0
  40. package/dist/src/lib/medicationStatement.js.map +1 -0
  41. package/dist/src/lib/organization.js +91 -0
  42. package/dist/src/lib/organization.js.map +1 -0
  43. package/dist/src/lib/patient.js +361 -0
  44. package/dist/src/lib/patient.js.map +1 -0
  45. package/dist/src/lib/patient.test.js +40 -0
  46. package/dist/src/lib/patient.test.js.map +1 -0
  47. package/dist/src/lib/practitioner.js +161 -0
  48. package/dist/src/lib/practitioner.js.map +1 -0
  49. package/index.ts +31 -0
  50. package/jest.config.js +12 -0
  51. package/package.json +54 -0
  52. package/src/data/patient.json +185 -0
  53. package/src/lib/allergyIntolerance.ts +36 -0
  54. package/src/lib/bundle.ts +19 -0
  55. package/src/lib/composition.ts +153 -0
  56. package/src/lib/condition.ts +80 -0
  57. package/src/lib/config.test.ts +13 -0
  58. package/src/lib/config.ts +17 -0
  59. package/src/lib/device.test.ts +9 -0
  60. package/src/lib/device.ts +36 -0
  61. package/src/lib/document-reference.ts +102 -0
  62. package/src/lib/immunization.ts +64 -0
  63. package/src/lib/medication.ts +61 -0
  64. package/src/lib/medicationRequest.ts +100 -0
  65. package/src/lib/medicationStatement.ts +52 -0
  66. package/src/lib/organization.ts +89 -0
  67. package/src/lib/patient.test.ts +38 -0
  68. package/src/lib/patient.ts +374 -0
  69. package/src/lib/practitioner.ts +157 -0
  70. package/tsconfig.test.json +18 -0
  71. package/tslint.json +139 -0
package/dist/index.js ADDED
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AllergyIntolerance = exports.MedicationRequest = exports.MedicationStatement = exports.Medication = exports.Device = exports.DocumentReference = exports.Bundle = exports.Composition = exports.Condition = exports.Immunization = exports.Organization = exports.Practitioner = exports.Patient = void 0;
4
+ var AllergyIntolerance = require("./src/lib/allergyIntolerance");
5
+ exports.AllergyIntolerance = AllergyIntolerance;
6
+ var Bundle = require("./src/lib/bundle");
7
+ exports.Bundle = Bundle;
8
+ var Composition = require("./src/lib/composition");
9
+ exports.Composition = Composition;
10
+ var Condition = require("./src/lib/condition");
11
+ exports.Condition = Condition;
12
+ var Device = require("./src/lib/device");
13
+ exports.Device = Device;
14
+ var DocumentReference = require("./src/lib/document-reference");
15
+ exports.DocumentReference = DocumentReference;
16
+ var Immunization = require("./src/lib/immunization");
17
+ exports.Immunization = Immunization;
18
+ var Medication = require("./src/lib/medication");
19
+ exports.Medication = Medication;
20
+ var MedicationRequest = require("./src/lib/medicationRequest");
21
+ exports.MedicationRequest = MedicationRequest;
22
+ var MedicationStatement = require("./src/lib/medicationStatement");
23
+ exports.MedicationStatement = MedicationStatement;
24
+ var Organization = require("./src/lib/organization");
25
+ exports.Organization = Organization;
26
+ var Patient = require("./src/lib/patient");
27
+ exports.Patient = Patient;
28
+ var Practitioner = require("./src/lib/practitioner");
29
+ exports.Practitioner = Practitioner;
30
+ var config_1 = require("./src/lib/config");
31
+ Object.defineProperty(exports, "getDominio", { enumerable: true, get: function () { return config_1.getDominio; } });
32
+ Object.defineProperty(exports, "initialize", { enumerable: true, get: function () { return config_1.initialize; } });
33
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";;;AAAA,iEAAmE;AA4B/D,gDAAkB;AA3BtB,yCAA2C;AAqBvC,wBAAM;AApBV,mDAAqD;AAmBjD,kCAAW;AAlBf,+CAAiD;AAiB7C,8BAAS;AAhBb,yCAA2C;AAoBvC,wBAAM;AAnBV,gEAAkE;AAkB9D,8CAAiB;AAjBrB,qDAAuD;AAanD,oCAAY;AAZhB,iDAAmD;AAkB/C,gCAAU;AAjBd,+DAAiE;AAmB7D,8CAAiB;AAlBrB,mEAAqE;AAiBjE,kDAAmB;AAhBvB,qDAAuD;AAQnD,oCAAY;AAPhB,2CAA6C;AAKzC,0BAAO;AAJX,qDAAuD;AAKnD,oCAAY;AAHhB,2CAA0D;AAAjD,oGAAA,UAAU,OAAA;AAAE,oGAAA,UAAU,OAAA"}
@@ -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,40 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.encode = void 0;
4
+ /**
5
+ * Encode de Alergias e Intolerancias from ANDES to FHIR
6
+ * @param {} AllergyIntolerance
7
+ */
8
+ function encode(patientReference, alergiaIntolerancia) {
9
+ return {
10
+ category: [
11
+ 'medication'
12
+ ],
13
+ criticality: 'high',
14
+ patient: {
15
+ reference: patientReference
16
+ },
17
+ id: alergiaIntolerancia._id,
18
+ code: {
19
+ coding: [
20
+ {
21
+ system: 'http://snomed.info/sct',
22
+ display: alergiaIntolerancia.concepto.term,
23
+ code: alergiaIntolerancia.concepto.conceptId,
24
+ }
25
+ ]
26
+ },
27
+ meta: {
28
+ profile: ['http://hl7.org/fhir/uv/ips/StructureDefinition/allergyintolerance-uv-ips']
29
+ },
30
+ text: {
31
+ status: 'generated',
32
+ 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>"
33
+ },
34
+ resourceType: 'AllergyIntolerance',
35
+ type: 'allergy',
36
+ onsetDateTime: alergiaIntolerancia.valor.fechaInicio
37
+ };
38
+ }
39
+ exports.encode = encode;
40
+ //# sourceMappingURL=allergyIntolerance.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"allergyIntolerance.js","sourceRoot":"","sources":["../../../src/lib/allergyIntolerance.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,SAAgB,MAAM,CAAC,gBAAgB,EAAE,mBAAmB;IACxD,OAAO;QACH,QAAQ,EAAE;YACN,YAAY;SACf;QACD,WAAW,EAAE,MAAM;QACnB,OAAO,EAAE;YACL,SAAS,EAAE,gBAAgB;SAC9B;QACD,EAAE,EAAE,mBAAmB,CAAC,GAAG;QAC3B,IAAI,EAAE;YACF,MAAM,EAAE;gBACJ;oBACI,MAAM,EAAE,wBAAwB;oBAChC,OAAO,EAAE,mBAAmB,CAAC,QAAQ,CAAC,IAAI;oBAC1C,IAAI,EAAE,mBAAmB,CAAC,QAAQ,CAAC,SAAS;iBAC/C;aACJ;SACJ;QACD,IAAI,EAAE;YACF,OAAO,EAAE,CAAC,0EAA0E,CAAC;SACxF;QACD,IAAI,EAAE;YACF,MAAM,EAAE,WAAW;YACnB,GAAG,EAAE,6JAAyJ,mBAAmB,CAAC,QAAQ,CAAC,WAAW,eAAY;SACrN;QACD,YAAY,EAAE,oBAAoB;QAClC,IAAI,EAAE,SAAS;QACf,aAAa,EAAE,mBAAmB,CAAC,KAAK,CAAC,WAAW;KACvD,CAAC;AACN,CAAC;AA9BD,wBA8BC"}
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.encode = void 0;
4
+ var moment = require("moment");
5
+ var config_1 = require("./config");
6
+ function encode(ID, resources) {
7
+ return {
8
+ resourceType: 'Bundle',
9
+ id: ID,
10
+ meta: {
11
+ lastUpdated: moment().format()
12
+ },
13
+ language: 'es-AR',
14
+ entry: resources,
15
+ type: 'document',
16
+ identifier: {
17
+ system: config_1.makeUrl('Bundle'),
18
+ value: ID
19
+ }
20
+ };
21
+ }
22
+ exports.encode = encode;
23
+ //# sourceMappingURL=bundle.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bundle.js","sourceRoot":"","sources":["../../../src/lib/bundle.ts"],"names":[],"mappings":";;;AAAA,+BAAiC;AACjC,mCAAmC;AAEnC,SAAgB,MAAM,CAAC,EAAE,EAAE,SAAS;IAChC,OAAO;QACH,YAAY,EAAE,QAAQ;QACtB,EAAE,EAAE,EAAE;QACN,IAAI,EAAE;YACF,WAAW,EAAE,MAAM,EAAE,CAAC,MAAM,EAAE;SACjC;QACD,QAAQ,EAAE,OAAO;QACjB,KAAK,EAAE,SAAS;QAChB,IAAI,EAAE,UAAU;QAChB,UAAU,EAAE;YACR,MAAM,EAAE,gBAAO,CAAC,QAAQ,CAAC;YACzB,KAAK,EAAE,EAAE;SACZ;KACJ,CAAC;AACN,CAAC;AAfD,wBAeC"}
@@ -0,0 +1,151 @@
1
+ "use strict";
2
+ var __spreadArrays = (this && this.__spreadArrays) || function () {
3
+ for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
4
+ for (var r = Array(s), k = 0, i = 0; i < il; i++)
5
+ for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
6
+ r[k] = a[j];
7
+ return r;
8
+ };
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.encode = void 0;
11
+ var moment = require("moment");
12
+ var config_1 = require("./config");
13
+ function getReference(url) {
14
+ return {
15
+ reference: url
16
+ };
17
+ }
18
+ function encode(ID, patientReference, custodianReference, deviceReference, medicationStatementReference, ImmunizationReferences, AllergyIntoleranceReferences, ConditionReferences) {
19
+ var now = moment();
20
+ var Immunization = [];
21
+ var conditions = [];
22
+ var medications = [];
23
+ var allergyIntolerance = [];
24
+ Immunization = [{
25
+ title: 'Vacunas',
26
+ text: {
27
+ status: 'generated',
28
+ div: '<div xmlns="http:\/\/www.w3.org\/1999\/xhtml">Sección referida a la vacunación del paciente <\/div>'
29
+ },
30
+ code: {
31
+ coding: [
32
+ {
33
+ system: 'http:\/\/loinc.org',
34
+ display: 'Immunization record',
35
+ code: '60484-3'
36
+ }
37
+ ]
38
+ },
39
+ entry: ImmunizationReferences ? ImmunizationReferences.map(getReference) : []
40
+ }];
41
+ medications = [{
42
+ title: 'Medicamentos',
43
+ text: {
44
+ status: 'generated',
45
+ div: '<div xmlns="http:\/\/www.w3.org\/1999\/xhtml">Registro de medicamentos<\/div>'
46
+ },
47
+ code: {
48
+ coding: [
49
+ {
50
+ system: 'http:\/\/loinc.org',
51
+ display: 'Medication use',
52
+ code: '10160-0'
53
+ }
54
+ ]
55
+ },
56
+ entry: medicationStatementReference ? medicationStatementReference.map(getReference) : [],
57
+ }];
58
+ allergyIntolerance = [{
59
+ title: 'Alergias o Intolerancias',
60
+ text: {
61
+ status: 'generated',
62
+ div: '<div xmlns="http:\/\/www.w3.org\/1999\/xhtml">Registro de Alergias<\/div>'
63
+ },
64
+ code: {
65
+ coding: [
66
+ {
67
+ system: 'http:\/\/loinc.org',
68
+ display: 'Allergies and/or adverse reactions',
69
+ code: '48765-2'
70
+ }
71
+ ]
72
+ },
73
+ entry: AllergyIntoleranceReferences ? AllergyIntoleranceReferences.map(getReference) : [],
74
+ }];
75
+ conditions = [{
76
+ code: {
77
+ coding: [
78
+ {
79
+ system: 'http:\/\/loinc.org',
80
+ display: 'Problem list',
81
+ code: '11450-4'
82
+ }
83
+ ]
84
+ },
85
+ entry: ConditionReferences ? ConditionReferences.map(getReference) : [],
86
+ title: 'Problemas activos',
87
+ text: {
88
+ status: 'generated',
89
+ div: '<div xmlns="http:\/\/www.w3.org\/1999\/xhtml">Lista de problemas activos (trastornos)<\/div>'
90
+ }
91
+ }];
92
+ return {
93
+ id: ID,
94
+ subject: {
95
+ reference: patientReference
96
+ },
97
+ section: __spreadArrays(conditions, medications, Immunization, allergyIntolerance),
98
+ resourceType: 'Composition',
99
+ author: [
100
+ {
101
+ identifier: {
102
+ system: 'https://federador.msal.gob.ar/uri',
103
+ value: deviceReference
104
+ }
105
+ }
106
+ ],
107
+ confidentiality: 'N',
108
+ type: {
109
+ coding: [
110
+ {
111
+ system: 'http:\/\/loinc.org',
112
+ display: 'Patient Summary',
113
+ code: '60591-5'
114
+ }
115
+ ]
116
+ },
117
+ title: 'Resumen del paciente al ' + now.format('DD/MM/YYYY, HH:mm'),
118
+ identifier: {
119
+ system: config_1.makeUrl('Composition'),
120
+ value: ID
121
+ },
122
+ date: now,
123
+ // meta: {
124
+ // profile: [
125
+ // 'http:\/\/hl7.org\/fhir\/uv\/ips\/StructureDefinition\/composition-uv-ips'
126
+ // ]
127
+ // },
128
+ text: {
129
+ status: 'generated',
130
+ div: '<div xmlns=\"http://www.w3.org/1999/xhtml\">IPS Neuquen</div>'
131
+ },
132
+ custodian: {
133
+ identifier: {
134
+ system: 'https://federador.msal.gob.ar/uri',
135
+ value: custodianReference
136
+ }
137
+ },
138
+ attester: [
139
+ {
140
+ mode: 'legal',
141
+ time: now,
142
+ party: {
143
+ reference: custodianReference
144
+ }
145
+ }
146
+ ],
147
+ status: 'final'
148
+ };
149
+ }
150
+ exports.encode = encode;
151
+ //# sourceMappingURL=composition.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"composition.js","sourceRoot":"","sources":["../../../src/lib/composition.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,80 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.encode = void 0;
4
+ /**
5
+ *
6
+ * @param registro Registro RUP a transformar a FHIR
7
+ */
8
+ function encode(patientReference, registro) {
9
+ return {
10
+ id: registro._id,
11
+ category: [
12
+ {
13
+ coding: [
14
+ {
15
+ system: 'http://loinc.org',
16
+ display: 'Problem',
17
+ code: '75326-9'
18
+ }
19
+ ]
20
+ }
21
+ ],
22
+ subject: {
23
+ reference: patientReference
24
+ },
25
+ onsetDateTime: registro.createdAt.getFullYear(),
26
+ resourceType: 'Condition',
27
+ // Por el momento ponemos 'confirmed'
28
+ verificationStatus: {
29
+ coding: [
30
+ {
31
+ system: 'http://terminology.hl7.org//CodeSystem//condition-ver-status',
32
+ code: 'confirmed'
33
+ }
34
+ ]
35
+ },
36
+ code: {
37
+ coding: [
38
+ {
39
+ code: registro.concepto.conceptId,
40
+ system: 'http://snomed.info/sct',
41
+ display: registro.concepto.fsn
42
+ }
43
+ ]
44
+ },
45
+ recordedDate: registro.createdAt,
46
+ meta: {
47
+ profile: [
48
+ 'http://hl7.org/fhir/uv/ips/StructureDefinition/condition-uv-ips'
49
+ ]
50
+ },
51
+ text: {
52
+ status: 'generated',
53
+ 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>"
54
+ },
55
+ severity: {
56
+ coding: [
57
+ {
58
+ system: 'http://loinc.org',
59
+ display: 'Moderate',
60
+ code: 'LA6751-7'
61
+ }
62
+ ]
63
+ },
64
+ clinicalStatus: {
65
+ coding: [
66
+ {
67
+ system: 'http://terminology.hl7.org/CodeSystem/condition-clinical',
68
+ code: registro.valor.estado // [TODO] Tenemos este dato.
69
+ },
70
+ {
71
+ system: 'http://terminology.hl7.org/CodeSystem/evolution',
72
+ // code: registro.valor.evolucion.replace('<p>','').replace('</p>','') // [TODO] Tenemos este dato.
73
+ code: registro.valor.evolucion // [TODO] Tenemos este dato.
74
+ }
75
+ ]
76
+ }
77
+ };
78
+ }
79
+ exports.encode = encode;
80
+ //# sourceMappingURL=condition.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"condition.js","sourceRoot":"","sources":["../../../src/lib/condition.ts"],"names":[],"mappings":";;;AAEA;;;GAGG;AAGH,SAAgB,MAAM,CAAC,gBAAgB,EAAE,QAAQ;IAC7C,OAAO;QACH,EAAE,EAAG,QAAQ,CAAC,GAAG;QACjB,QAAQ,EAAG;YACP;gBACI,MAAM,EAAG;oBACL;wBACI,MAAM,EAAG,kBAAkB;wBAC3B,OAAO,EAAG,SAAS;wBACnB,IAAI,EAAG,SAAS;qBACnB;iBACJ;aACJ;SACJ;QACD,OAAO,EAAG;YACN,SAAS,EAAG,gBAAgB;SAC/B;QACD,aAAa,EAAG,QAAQ,CAAC,SAAS,CAAC,WAAW,EAAE;QAChD,YAAY,EAAG,WAAW;QAC1B,qCAAqC;QACrC,kBAAkB,EAAG;YACjB,MAAM,EAAG;gBACL;oBACI,MAAM,EAAG,8DAA8D;oBACvE,IAAI,EAAG,WAAW;iBACrB;aACJ;SACJ;QACD,IAAI,EAAG;YACH,MAAM,EAAG;gBACL;oBACI,IAAI,EAAG,QAAQ,CAAC,QAAQ,CAAC,SAAS;oBAClC,MAAM,EAAG,wBAAwB;oBACjC,OAAO,EAAG,QAAQ,CAAC,QAAQ,CAAC,GAAG;iBAClC;aACJ;SACJ;QACD,YAAY,EAAG,QAAQ,CAAC,SAAS;QACjC,IAAI,EAAG;YACH,OAAO,EAAG;gBACN,iEAAiE;aACpE;SACJ;QACD,IAAI,EAAG;YACH,MAAM,EAAG,WAAW;YACpB,GAAG,EAAE,8HAA0H,QAAQ,CAAC,MAAM,eAAY;SAC7J;QACD,QAAQ,EAAG;YACP,MAAM,EAAG;gBACL;oBACI,MAAM,EAAG,kBAAkB;oBAC3B,OAAO,EAAG,UAAU;oBACpB,IAAI,EAAG,UAAU;iBACpB;aACJ;SACJ;QACD,cAAc,EAAG;YACb,MAAM,EAAG;gBACL;oBACI,MAAM,EAAE,0DAA0D;oBAClE,IAAI,EAAE,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC,6BAA6B;iBAC5D;gBACD;oBACI,MAAM,EAAE,iDAAiD;oBACzD,qGAAqG;oBACrG,IAAI,EAAE,QAAQ,CAAC,KAAK,CAAC,SAAS,CAAE,6BAA6B;iBAChE;aACJ;SACJ;KACJ,CAAC;AACN,CAAC;AAtED,wBAsEC"}
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.makeUrl = exports.getDominio = exports.initialize = void 0;
4
+ var DOMINIO = 'andes.gob.ar';
5
+ function initialize(_a) {
6
+ var dominio = _a.dominio;
7
+ DOMINIO = dominio;
8
+ }
9
+ exports.initialize = initialize;
10
+ function getDominio() {
11
+ return DOMINIO;
12
+ }
13
+ exports.getDominio = getDominio;
14
+ function makeUrl(resource, id) {
15
+ if (id === void 0) { id = null; }
16
+ var url = DOMINIO + "/" + resource;
17
+ if (id) {
18
+ url += "/" + id;
19
+ }
20
+ return url;
21
+ }
22
+ exports.makeUrl = makeUrl;
23
+ //# sourceMappingURL=config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.js","sourceRoot":"","sources":["../../../src/lib/config.ts"],"names":[],"mappings":";;;AAAA,IAAI,OAAO,GAAG,cAAc,CAAC;AAE7B,SAAgB,UAAU,CAAC,EAAW;QAAT,OAAO,aAAA;IAChC,OAAO,GAAG,OAAO,CAAC;AACtB,CAAC;AAFD,gCAEC;AAED,SAAgB,UAAU;IACtB,OAAO,OAAO,CAAC;AACnB,CAAC;AAFD,gCAEC;AAED,SAAgB,OAAO,CAAC,QAAQ,EAAE,EAAS;IAAT,mBAAA,EAAA,SAAS;IACvC,IAAI,GAAG,GAAM,OAAO,SAAI,QAAU,CAAC;IACnC,IAAI,EAAE,EAAE;QACJ,GAAG,IAAI,MAAI,EAAI,CAAC;KACnB;IACD,OAAO,GAAG,CAAC;AACf,CAAC;AAND,0BAMC"}
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ var config_1 = require("./config");
4
+ test('Get default domain', function () {
5
+ expect(config_1.getDominio()).toBe('andes.gob.ar');
6
+ });
7
+ test('Get default URL without id', function () {
8
+ expect(config_1.makeUrl('patient')).toBe('andes.gob.ar/patient');
9
+ });
10
+ test('Get default URL with id', function () {
11
+ expect(config_1.makeUrl('patient', '123456')).toBe('andes.gob.ar/patient/123456');
12
+ });
13
+ //# sourceMappingURL=config.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.test.js","sourceRoot":"","sources":["../../../src/lib/config.test.ts"],"names":[],"mappings":";;AAAA,mCAA+C;AAE/C,IAAI,CAAC,oBAAoB,EAAE;IACvB,MAAM,CAAC,mBAAU,EAAE,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;AAC9C,CAAC,CAAC,CAAC;AAEH,IAAI,CAAC,4BAA4B,EAAE;IAC/B,MAAM,CAAC,gBAAO,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC;AAC5D,CAAC,CAAC,CAAC;AAEH,IAAI,CAAC,yBAAyB,EAAE;IAC5B,MAAM,CAAC,gBAAO,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,6BAA6B,CAAC,CAAC;AAC7E,CAAC,CAAC,CAAC"}
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.encode = void 0;
4
+ var config_1 = require("./config");
5
+ function encode() {
6
+ /**
7
+ * HARDCODE DEVICE
8
+ */
9
+ return {
10
+ resourceType: 'Device',
11
+ id: 'device-01',
12
+ identifier: [
13
+ {
14
+ system: config_1.makeUrl('Device'),
15
+ value: 'device-01'
16
+ }
17
+ ],
18
+ type: {
19
+ coding: [
20
+ {
21
+ system: 'http://snomed.info/sct',
22
+ code: '462894001',
23
+ display: 'software de aplicación de sistema de información de historias clínicas de pacientes (objeto físico)'
24
+ }
25
+ ]
26
+ },
27
+ owner: {
28
+ reference: 'http://argentina.gob.ar/salud/refes/14999912399913'
29
+ },
30
+ deviceName: [
31
+ {
32
+ name: 'Sistema de Aplicaciones Neuquinas de Salud (ANDES)',
33
+ type: 'manufacturer-name'
34
+ }
35
+ ]
36
+ };
37
+ }
38
+ exports.encode = encode;
39
+ //# sourceMappingURL=device.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"device.js","sourceRoot":"","sources":["../../../src/lib/device.ts"],"names":[],"mappings":";;;AAAA,mCAAmC;AAEnC,SAAgB,MAAM;IAClB;;GAED;IAEC,OAAO;QACH,YAAY,EAAE,QAAQ;QACtB,EAAE,EAAE,WAAW;QACf,UAAU,EAAE;YACR;gBACI,MAAM,EAAE,gBAAO,CAAC,QAAQ,CAAC;gBACzB,KAAK,EAAE,WAAW;aACrB;SACJ;QACD,IAAI,EAAE;YACF,MAAM,EAAE;gBACJ;oBACI,MAAM,EAAE,wBAAwB;oBAChC,IAAI,EAAE,WAAW;oBACjB,OAAO,EAAE,qGAAqG;iBACjH;aACJ;SACJ;QACD,KAAK,EAAE;YACH,SAAS,EAAE,oDAAoD;SAClE;QACD,UAAU,EAAE;YACR;gBACI,IAAI,EAAE,oDAAoD;gBAC1D,IAAI,EAAE,mBAAmB;aAC5B;SACJ;KACJ,CAAC;AACN,CAAC;AAjCD,wBAiCC"}
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ var device_1 = require("./device");
4
+ test('Device type 1', function () {
5
+ expect(device_1.encode().id).toBe('device-01');
6
+ });
7
+ test('Device Name', function () {
8
+ expect(device_1.encode().deviceName[0].name).toBe('Sistema de Aplicaciones Neuquinas de Salud (ANDES)');
9
+ });
10
+ //# sourceMappingURL=device.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"device.test.js","sourceRoot":"","sources":["../../../src/lib/device.test.ts"],"names":[],"mappings":";;AAAA,mCAAkC;AAElC,IAAI,CAAC,eAAe,EAAE;IAClB,MAAM,CAAC,eAAM,EAAE,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;AAC1C,CAAC,CAAC,CAAC;AAEH,IAAI,CAAC,aAAa,EAAE;IAChB,MAAM,CAAC,eAAM,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,oDAAoD,CAAC,CAAC;AACnG,CAAC,CAAC,CAAC"}