@andes/fhir 1.11.1 → 1.12.0-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 (94) hide show
  1. package/.circleci/config.yml +71 -68
  2. package/.editorconfig +13 -13
  3. package/.env.example +2 -0
  4. package/.github/labeler.yml +10 -10
  5. package/.github/pull_request_template.md +28 -28
  6. package/.github/workflows/build_test.yml +14 -14
  7. package/.github/workflows/has_conflicts.yml +13 -13
  8. package/.vscode/settings.json +2 -0
  9. package/CHANGELOG.md +312 -291
  10. package/LICENSE +674 -674
  11. package/README.md +2 -2
  12. package/coverage/clover.xml +198 -0
  13. package/coverage/coverage-final.json +5 -0
  14. package/coverage/lcov-report/base.css +224 -0
  15. package/coverage/lcov-report/block-navigation.js +87 -0
  16. package/coverage/lcov-report/config.ts.html +136 -0
  17. package/coverage/lcov-report/device.ts.html +193 -0
  18. package/coverage/lcov-report/favicon.png +0 -0
  19. package/coverage/lcov-report/helpers/index.html +116 -0
  20. package/coverage/lcov-report/helpers/patientFactory.ts.html +124 -0
  21. package/coverage/lcov-report/index.html +131 -0
  22. package/coverage/lcov-report/lib/config.ts.html +136 -0
  23. package/coverage/lcov-report/lib/device.ts.html +193 -0
  24. package/coverage/lcov-report/lib/index.html +146 -0
  25. package/coverage/lcov-report/lib/patient.ts.html +1267 -0
  26. package/coverage/lcov-report/patient.ts.html +1207 -0
  27. package/coverage/lcov-report/prettify.css +1 -0
  28. package/coverage/lcov-report/prettify.js +2 -0
  29. package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  30. package/coverage/lcov-report/sorter.js +210 -0
  31. package/coverage/lcov.info +410 -0
  32. package/dist/index.js +51 -32
  33. package/dist/index.js.map +1 -1
  34. package/dist/src/data/patient.json +191 -185
  35. package/dist/src/helpers/patientFactory.js +31 -0
  36. package/dist/src/helpers/patientFactory.js.map +1 -0
  37. package/dist/src/lib/allergyIntolerance.js +39 -39
  38. package/dist/src/lib/allergyIntolerance.js.map +1 -1
  39. package/dist/src/lib/bundle.js +25 -22
  40. package/dist/src/lib/bundle.js.map +1 -1
  41. package/dist/src/lib/composition.js +151 -150
  42. package/dist/src/lib/composition.js.map +1 -1
  43. package/dist/src/lib/condition.js +79 -79
  44. package/dist/src/lib/condition.js.map +1 -1
  45. package/dist/src/lib/config.js +20 -22
  46. package/dist/src/lib/config.js.map +1 -1
  47. package/dist/src/lib/config.test.js +12 -12
  48. package/dist/src/lib/config.test.js.map +1 -1
  49. package/dist/src/lib/device.js +38 -38
  50. package/dist/src/lib/device.js.map +1 -1
  51. package/dist/src/lib/device.test.js +9 -9
  52. package/dist/src/lib/device.test.js.map +1 -1
  53. package/dist/src/lib/document-reference.js +106 -103
  54. package/dist/src/lib/document-reference.js.map +1 -1
  55. package/dist/src/lib/immunization.js +67 -67
  56. package/dist/src/lib/medication.js +64 -64
  57. package/dist/src/lib/medication.js.map +1 -1
  58. package/dist/src/lib/medicationRequest.js +102 -99
  59. package/dist/src/lib/medicationRequest.js.map +1 -1
  60. package/dist/src/lib/medicationStatement.js +55 -55
  61. package/dist/src/lib/medicationStatement.js.map +1 -1
  62. package/dist/src/lib/organization.js +90 -90
  63. package/dist/src/lib/organization.js.map +1 -1
  64. package/dist/src/lib/patient.js +378 -360
  65. package/dist/src/lib/patient.js.map +1 -1
  66. package/dist/src/lib/patient.test.js +78 -39
  67. package/dist/src/lib/patient.test.js.map +1 -1
  68. package/dist/src/lib/practitioner.js +160 -160
  69. package/dist/src/lib/practitioner.js.map +1 -1
  70. package/index.ts +31 -31
  71. package/jest.config.js +11 -11
  72. package/package.json +45 -54
  73. package/release.config.js +74 -0
  74. package/src/data/patient.json +190 -184
  75. package/src/helpers/patientFactory.ts +13 -0
  76. package/src/lib/allergyIntolerance.ts +36 -36
  77. package/src/lib/bundle.ts +19 -19
  78. package/src/lib/composition.ts +153 -153
  79. package/src/lib/condition.ts +80 -80
  80. package/src/lib/config.test.ts +13 -13
  81. package/src/lib/config.ts +17 -17
  82. package/src/lib/device.test.ts +9 -9
  83. package/src/lib/device.ts +36 -36
  84. package/src/lib/document-reference.ts +102 -102
  85. package/src/lib/immunization.ts +64 -64
  86. package/src/lib/medication.ts +61 -61
  87. package/src/lib/medicationRequest.ts +100 -100
  88. package/src/lib/medicationStatement.ts +52 -52
  89. package/src/lib/organization.ts +89 -89
  90. package/src/lib/patient.test.ts +62 -38
  91. package/src/lib/patient.ts +394 -374
  92. package/src/lib/practitioner.ts +157 -157
  93. package/tsconfig.test.json +17 -17
  94. package/tslint.json +138 -138
@@ -1,100 +1,103 @@
1
- "use strict";
2
- /**
3
- * Encode medicationRequest from ANDES to FHIR
4
- * @param {} medicationRequest
5
- */
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.encode = void 0;
8
- var moment = require("moment");
9
- // Muy incompleto hay que mejorarlo mucho todavía
10
- function encode(patientReference, practitionerReference, medicationFHIR, data) {
11
- return {
12
- resourceType: 'MedicationRequest',
13
- id: data.registro._id,
14
- text: {
15
- status: 'generated',
16
- },
17
- contained: [
18
- medicationFHIR
19
- ],
20
- identifier: [
21
- {
22
- use: 'official',
23
- system: 'http://app.andes.gob.ar/prescriptions',
24
- value: data.registro.id
25
- }
26
- ],
27
- // active | on-hold | cancelled | completed | entered-in-error | stopped | draft | unknown
28
- status: (data.prestacion.estadoActual.tipo === 'validada') ? 'active' : 'on-hold',
29
- // intent: proposal | plan | order | original-order | reflex-order | filler-order | instance-order | option
30
- intent: 'order',
31
- // category: {
32
- // coding: [
33
- // {
34
- // system: '',
35
- // display: '',
36
- // code: ''
37
- // }
38
- // ]
39
- // },
40
- // priority: routine | urgent | asap | stat
41
- priority: 'routine',
42
- doNotPerform: false,
43
- // Se puede usar medicationCodeableConcept o medicationReference, vamos a usar esta última.
44
- medicationReference: {
45
- reference: medicationFHIR.id,
46
- display: medicationFHIR.code.text
47
- },
48
- subject: {
49
- reference: patientReference // podría ser una reference a un group también
50
- },
51
- // encounter: Por ahora lo dejo pendiente. Podría ponerse una referencia a otra prestación o al informe del encuentro.
52
- authoredOn: moment(data.registro.createdAt).format('YYYY-MM-DD'),
53
- // requester & performer: pueden ser Reference(Practitioner|PractitionerRole|Organization|Patient|Device|RelatedPerson|CareTeam)
54
- // por el momento vamos a tomar al profesional porque no tenemos otra info en la prestación
55
- requester: {
56
- reference: practitionerReference
57
- },
58
- // performer: {
59
- // reference: practitionerReference
60
- // },
61
- // performerType: Lo dejamos pendiente
62
- // recorder: {
63
- // reference: practitionerReference
64
- // },
65
- // instantiatesCanonical: null, // ["<canonical>"], // Instantiates FHIR protocol or definition
66
- // instantiatesUri: null, // ["<uri>"], // Instantiates external protocol or definition
67
- basedOn: data.prestacion.id,
68
- // groupIdentifier: null, // { Identifier }, // Composite request this is part of
69
- // courseOfTherapyType: null, // { CodeableConcept }, // Overall pattern of medication administration
70
- // insurance: null, // [{ Reference(Coverage|ClaimResponse) }], // Associated insurance coverage
71
- note: null,
72
- dosageInstruction: null,
73
- // Medication supply authorization: Hay que ver esta parte
74
- /*
75
- dispenseRequest: { // Medication supply authorization
76
- initialFill: { // First fill details
77
- quantity: { Quantity(SimpleQuantity) }, // First fill quantity
78
- duration: { Duration } // First fill duration
79
- },
80
- dispenseInterval: { Duration }, // Minimum period of time between dispenses
81
- validityPeriod: { Period }, // Time period supply is authorized for
82
- numberOfRepeatsAllowed: "<unsignedInt>", // Number of refills authorized
83
- quantity: { Quantity(SimpleQuantity) }, // Amount of medication to supply per dispense
84
- expectedSupplyDuration: { Duration }, // Number of days supply per dispense
85
- performer: { Reference(Organization) } // Intended dispenser
86
- },
87
- */
88
- substitution: {
89
- // allowed[x]: Whether substitution is allowed or not. One of these 2:
90
- allowedBoolean: true,
91
- // "allowedCodeableConcept" : { CodeableConcept },
92
- reason: null // { CodeableConcept } // Why should (not) substitution be made
93
- },
94
- priorPrescription: null,
95
- detectedIssue: null,
96
- eventHistory: null // [{ Reference(Provenance) }]
97
- };
98
- }
99
- exports.encode = encode;
1
+ "use strict";
2
+ /**
3
+ * Encode medicationRequest from ANDES to FHIR
4
+ * @param {} medicationRequest
5
+ */
6
+ var __importDefault = (this && this.__importDefault) || function (mod) {
7
+ return (mod && mod.__esModule) ? mod : { "default": mod };
8
+ };
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.encode = void 0;
11
+ const moment_1 = __importDefault(require("moment"));
12
+ // Muy incompleto hay que mejorarlo mucho todavía
13
+ function encode(patientReference, practitionerReference, medicationFHIR, data) {
14
+ return {
15
+ resourceType: 'MedicationRequest',
16
+ id: data.registro._id,
17
+ text: {
18
+ status: 'generated',
19
+ },
20
+ contained: [
21
+ medicationFHIR
22
+ ],
23
+ identifier: [
24
+ {
25
+ use: 'official',
26
+ system: 'http://app.andes.gob.ar/prescriptions',
27
+ value: data.registro.id
28
+ }
29
+ ],
30
+ // active | on-hold | cancelled | completed | entered-in-error | stopped | draft | unknown
31
+ status: (data.prestacion.estadoActual.tipo === 'validada') ? 'active' : 'on-hold',
32
+ // intent: proposal | plan | order | original-order | reflex-order | filler-order | instance-order | option
33
+ intent: 'order',
34
+ // category: {
35
+ // coding: [
36
+ // {
37
+ // system: '',
38
+ // display: '',
39
+ // code: ''
40
+ // }
41
+ // ]
42
+ // },
43
+ // priority: routine | urgent | asap | stat
44
+ priority: 'routine',
45
+ doNotPerform: false,
46
+ // Se puede usar medicationCodeableConcept o medicationReference, vamos a usar esta última.
47
+ medicationReference: {
48
+ reference: medicationFHIR.id,
49
+ display: medicationFHIR.code.text
50
+ },
51
+ subject: {
52
+ reference: patientReference // podría ser una reference a un group también
53
+ },
54
+ // encounter: Por ahora lo dejo pendiente. Podría ponerse una referencia a otra prestación o al informe del encuentro.
55
+ authoredOn: moment_1.default(data.registro.createdAt).format('YYYY-MM-DD'),
56
+ // requester & performer: pueden ser Reference(Practitioner|PractitionerRole|Organization|Patient|Device|RelatedPerson|CareTeam)
57
+ // por el momento vamos a tomar al profesional porque no tenemos otra info en la prestación
58
+ requester: {
59
+ reference: practitionerReference
60
+ },
61
+ // performer: {
62
+ // reference: practitionerReference
63
+ // },
64
+ // performerType: Lo dejamos pendiente
65
+ // recorder: {
66
+ // reference: practitionerReference
67
+ // },
68
+ // instantiatesCanonical: null, // ["<canonical>"], // Instantiates FHIR protocol or definition
69
+ // instantiatesUri: null, // ["<uri>"], // Instantiates external protocol or definition
70
+ basedOn: data.prestacion.id,
71
+ // groupIdentifier: null, // { Identifier }, // Composite request this is part of
72
+ // courseOfTherapyType: null, // { CodeableConcept }, // Overall pattern of medication administration
73
+ // insurance: null, // [{ Reference(Coverage|ClaimResponse) }], // Associated insurance coverage
74
+ note: null,
75
+ dosageInstruction: null,
76
+ // Medication supply authorization: Hay que ver esta parte
77
+ /*
78
+ dispenseRequest: { // Medication supply authorization
79
+ initialFill: { // First fill details
80
+ quantity: { Quantity(SimpleQuantity) }, // First fill quantity
81
+ duration: { Duration } // First fill duration
82
+ },
83
+ dispenseInterval: { Duration }, // Minimum period of time between dispenses
84
+ validityPeriod: { Period }, // Time period supply is authorized for
85
+ numberOfRepeatsAllowed: "<unsignedInt>", // Number of refills authorized
86
+ quantity: { Quantity(SimpleQuantity) }, // Amount of medication to supply per dispense
87
+ expectedSupplyDuration: { Duration }, // Number of days supply per dispense
88
+ performer: { Reference(Organization) } // Intended dispenser
89
+ },
90
+ */
91
+ substitution: {
92
+ // allowed[x]: Whether substitution is allowed or not. One of these 2:
93
+ allowedBoolean: true,
94
+ // "allowedCodeableConcept" : { CodeableConcept },
95
+ reason: null // { CodeableConcept } // Why should (not) substitution be made
96
+ },
97
+ priorPrescription: null,
98
+ detectedIssue: null,
99
+ eventHistory: null // [{ Reference(Provenance) }]
100
+ };
101
+ }
102
+ exports.encode = encode;
100
103
  //# sourceMappingURL=medicationRequest.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"medicationRequest.js","sourceRoot":"","sources":["../../../src/lib/medicationRequest.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+BAAiC;AAEjC,iDAAiD;AAEjD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FAAuF;QACvF,OAAO,EAAE,IAAI,CAAC,UAAU,CAAC,EAAE;QAC3B,iFAAiF;QACjF,qGAAqG;QACrG,gGAAgG;QAChG,IAAI,EAAE,IAAI;QACV,iBAAiB,EAAE,IAAI;QACvB,0DAA0D;QAC1D;;;;;;;;;;;;;UAaE;QACF,YAAY,EAAE;YACV,sEAAsE;YACtE,cAAc,EAAE,IAAI;YACpB,kDAAkD;YAClD,MAAM,EAAE,IAAI,CAAC,+DAA+D;SAC/E;QACD,iBAAiB,EAAE,IAAI;QACvB,aAAa,EAAE,IAAI;QACnB,YAAY,EAAE,IAAI,CAAA,8BAA8B;KACnD,CAAC;AACN,CAAC;AAzFD,wBAyFC"}
1
+ {"version":3,"file":"medicationRequest.js","sourceRoot":"","sources":["../../../src/lib/medicationRequest.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;AAEH,oDAA4B;AAE5B,iDAAiD;AAEjD,SAAgB,MAAM,CAAC,gBAAgB,EAAE,qBAAqB,EAAE,cAAc,EAAE,IAAI;IAChF,OAAO;QACH,YAAY,EAAE,mBAAmB;QACjC,EAAE,EAAE,IAAI,CAAC,QAAQ,CAAC,GAAG;QACrB,IAAI,EAAE;YACF,MAAM,EAAE,WAAW;SAEtB;QACD,SAAS,EAAE;YACP,cAAc;SACjB;QACD,UAAU,EAAE;YACR;gBACI,GAAG,EAAE,UAAU;gBACf,MAAM,EAAE,uCAAuC;gBAC/C,KAAK,EAAE,IAAI,CAAC,QAAQ,CAAC,EAAE;aAC1B;SACJ;QACD,0FAA0F;QAC1F,MAAM,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,YAAY,CAAC,IAAI,KAAK,UAAU,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS;QACjF,2GAA2G;QAC3G,MAAM,EAAE,OAAO;QACf,cAAc;QACd,gBAAgB;QAChB,YAAY;QACZ,0BAA0B;QAC1B,2BAA2B;QAC3B,uBAAuB;QACvB,YAAY;QACZ,QAAQ;QACR,KAAK;QACL,2CAA2C;QAC3C,QAAQ,EAAE,SAAS;QACnB,YAAY,EAAE,KAAK;QACnB,2FAA2F;QAC3F,mBAAmB,EAAE;YACjB,SAAS,EAAE,cAAc,CAAC,EAAE;YAC5B,OAAO,EAAE,cAAc,CAAC,IAAI,CAAC,IAAI;SACpC;QACD,OAAO,EAAE;YACL,SAAS,EAAE,gBAAgB,CAAE,8CAA8C;SAC9E;QACD,sHAAsH;QACtH,UAAU,EAAE,gBAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,YAAY,CAAC;QAChE,iIAAiI;QACjI,2FAA2F;QAC3F,SAAS,EAAE;YACP,SAAS,EAAE,qBAAqB;SACnC;QACD,eAAe;QACf,uCAAuC;QACvC,KAAK;QACL,sCAAsC;QACtC,cAAc;QACd,uCAAuC;QACvC,KAAK;QACL,+FAA+F;QAC/F,uFAAuF;QACvF,OAAO,EAAE,IAAI,CAAC,UAAU,CAAC,EAAE;QAC3B,iFAAiF;QACjF,qGAAqG;QACrG,gGAAgG;QAChG,IAAI,EAAE,IAAI;QACV,iBAAiB,EAAE,IAAI;QACvB,0DAA0D;QAC1D;;;;;;;;;;;;;UAaE;QACF,YAAY,EAAE;YACV,sEAAsE;YACtE,cAAc,EAAE,IAAI;YACpB,kDAAkD;YAClD,MAAM,EAAE,IAAI,CAAC,+DAA+D;SAC/E;QACD,iBAAiB,EAAE,IAAI;QACvB,aAAa,EAAE,IAAI;QACnB,YAAY,EAAE,IAAI,CAAA,8BAA8B;KACnD,CAAC;AACN,CAAC;AAzFD,wBAyFC"}
@@ -1,56 +1,56 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.encode = void 0;
4
- /**
5
- * Encode de Medicamentos from ANDES to FHIR
6
- * @param {} medicationStatement
7
- */
8
- // Muy incompleto hay que mejorarlo mucho todavía
9
- function encode(patientReference, medicationReference, prestacionMedicamento) {
10
- return {
11
- resourceType: 'MedicationStatement',
12
- status: (prestacionMedicamento.valor.estado === 'activo') ? 'active' : 'inactive',
13
- id: prestacionMedicamento._id,
14
- effectiveDateTime: prestacionMedicamento.createdAt,
15
- medicationCodeableConcept: {
16
- coding: [
17
- {
18
- system: 'http://snomed.info/sct',
19
- code: prestacionMedicamento.concepto.conceptId,
20
- display: prestacionMedicamento.concepto.term
21
- }
22
- ]
23
- },
24
- meta: {
25
- profile: [
26
- 'http://hl7.org/fhir/uv/ips/StructureDefinition/medication-ips'
27
- ]
28
- },
29
- // extension: null,
30
- // identifier: '', // Business identifier, not a resource identifier
31
- subject: {
32
- reference: patientReference
33
- },
34
- medicationReference: {
35
- reference: medicationReference
36
- },
37
- // 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é)
38
- dosage: [
39
- {
40
- text: prestacionMedicamento.valor,
41
- route: { coding: [{ system: 'http://standardterms.edqm.eu', code: prestacionMedicamento._id, display: prestacionMedicamento.nombre }] },
42
- timing: { coding: { system: 'http://terminology.hl7.org/CodeSystem/v3-GTSAbbreviation', code: 'QD', display: 'Diario' } }
43
- }
44
- ],
45
- // 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
46
- // en este registro ya que no siempre está la unidad de tiempo (dias, mes, etc) hay q ver si no es un bug.
47
- // start: '2015-03'
48
- // },
49
- text: {
50
- status: 'generated',
51
- 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>"
52
- }
53
- };
54
- }
55
- exports.encode = encode;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.encode = void 0;
4
+ /**
5
+ * Encode de Medicamentos from ANDES to FHIR
6
+ * @param {} medicationStatement
7
+ */
8
+ // Muy incompleto hay que mejorarlo mucho todavía
9
+ function encode(patientReference, medicationReference, prestacionMedicamento) {
10
+ return {
11
+ resourceType: 'MedicationStatement',
12
+ status: (prestacionMedicamento.valor.estado === 'activo') ? 'active' : 'inactive',
13
+ id: prestacionMedicamento._id,
14
+ effectiveDateTime: prestacionMedicamento.createdAt,
15
+ medicationCodeableConcept: {
16
+ coding: [
17
+ {
18
+ system: 'http://snomed.info/sct',
19
+ code: prestacionMedicamento.concepto.conceptId,
20
+ display: prestacionMedicamento.concepto.term
21
+ }
22
+ ]
23
+ },
24
+ meta: {
25
+ profile: [
26
+ 'http://hl7.org/fhir/uv/ips/StructureDefinition/medication-ips'
27
+ ]
28
+ },
29
+ // extension: null,
30
+ // identifier: '', // Business identifier, not a resource identifier
31
+ subject: {
32
+ reference: patientReference
33
+ },
34
+ medicationReference: {
35
+ reference: medicationReference
36
+ },
37
+ // 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é)
38
+ dosage: [
39
+ {
40
+ text: prestacionMedicamento.valor,
41
+ route: { coding: [{ system: 'http://standardterms.edqm.eu', code: prestacionMedicamento._id, display: prestacionMedicamento.nombre }] },
42
+ timing: { coding: { system: 'http://terminology.hl7.org/CodeSystem/v3-GTSAbbreviation', code: 'QD', display: 'Diario' } }
43
+ }
44
+ ],
45
+ // 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
46
+ // en este registro ya que no siempre está la unidad de tiempo (dias, mes, etc) hay q ver si no es un bug.
47
+ // start: '2015-03'
48
+ // },
49
+ text: {
50
+ status: 'generated',
51
+ 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>`
52
+ }
53
+ };
54
+ }
55
+ exports.encode = encode;
56
56
  //# sourceMappingURL=medicationStatement.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"medicationStatement.js","sourceRoot":"","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0DAA0D,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE;aAC5H;SACJ;QACD,iJAAiJ;QACjJ,0GAA0G;QAC1G,uBAAuB;QACvB,KAAK;QACL,IAAI,EAAE;YACF,MAAM,EAAE,WAAW;YACnB,GAAG,EAAE,8JAA8J,qBAAqB,CAAC,QAAQ,CAAC,IAAI,YAAY;SACrN;KACJ,CAAC;AACN,CAAC;AA7CD,wBA6CC"}
@@ -1,91 +1,91 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.encode = void 0;
4
- var config_1 = require("./config");
5
- /**
6
- * Encode a organization from ANDES to FHIR
7
- * @param {} organization
8
- */
9
- function encode(organization) {
10
- var data = organization;
11
- if (data) {
12
- var identificadores = data.codigo.sisa ? [{
13
- assigner: 'sisa',
14
- value: data.codigo.sisa
15
- }] : [];
16
- if (data.codigo.cuie) {
17
- identificadores.push({
18
- assigner: 'cuie',
19
- value: data.codigo.cuie
20
- });
21
- }
22
- if (data.codigo.remediar) {
23
- identificadores.push({
24
- assigner: 'remediar',
25
- value: data.codigo.remediar
26
- });
27
- }
28
- if (data.codigo.sips) {
29
- identificadores.push({
30
- assigner: 'sips',
31
- value: data.codigo.sips
32
- });
33
- }
34
- identificadores.push({
35
- system: config_1.makeUrl('Organization'),
36
- value: data._id
37
- });
38
- var contactos = data.contacto ? data.contacto.map(function (unContacto) {
39
- var cont = {
40
- resourceType: 'ContactPoint',
41
- value: unContacto.valor,
42
- rank: unContacto.ranking,
43
- };
44
- switch (unContacto.tipo) {
45
- case 'fijo':
46
- cont['system'] = 'phone';
47
- break;
48
- case 'celular':
49
- cont['system'] = 'phone';
50
- break;
51
- case 'email':
52
- cont['system'] = 'email';
53
- break;
54
- }
55
- return cont;
56
- }) : [];
57
- // Parsea direcciones
58
- var direcciones = data.direccion ? [{
59
- resourceType: 'Address',
60
- postalCode: data.direccion.codigoPostal ? data.direccion.codigoPostal : '',
61
- line: [data.direccion.valor],
62
- city: data.direccion.ubicacion.localidad ? data.direccion.ubicacion.localidad.nombre : '',
63
- state: data.direccion.ubicacion.provincia ? data.direccion.ubicacion.provincia.nombre : '',
64
- country: data.direccion.ubicacion.pais ? data.direccion.ubicacion.pais.nombre : '',
65
- }] : [];
66
- // Armamos la organizacion FHIR
67
- var organizacionFHIR = {
68
- id: data.id,
69
- resourceType: 'Organization',
70
- identifier: identificadores,
71
- active: data.activo ? data.activo : null,
72
- type: [{
73
- resourceType: 'CodeableConcept',
74
- text: data.tipoEstablecimiento ? data.tipoEstablecimiento.nombre : null,
75
- }],
76
- name: data.nombre ? data.nombre : null,
77
- };
78
- if (contactos.length > 0) { // A contact detail for the organization
79
- organizacionFHIR['telecom'] = contactos;
80
- }
81
- if (direcciones) { // An address for the organization
82
- organizacionFHIR['address'] = direcciones;
83
- }
84
- return organizacionFHIR;
85
- }
86
- else {
87
- return null;
88
- }
89
- }
90
- exports.encode = encode;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.encode = void 0;
4
+ const config_1 = require("./config");
5
+ /**
6
+ * Encode a organization from ANDES to FHIR
7
+ * @param {} organization
8
+ */
9
+ function encode(organization) {
10
+ let data = organization;
11
+ if (data) {
12
+ let identificadores = data.codigo.sisa ? [{
13
+ assigner: 'sisa',
14
+ value: data.codigo.sisa
15
+ }] : [];
16
+ if (data.codigo.cuie) {
17
+ identificadores.push({
18
+ assigner: 'cuie',
19
+ value: data.codigo.cuie
20
+ });
21
+ }
22
+ if (data.codigo.remediar) {
23
+ identificadores.push({
24
+ assigner: 'remediar',
25
+ value: data.codigo.remediar
26
+ });
27
+ }
28
+ if (data.codigo.sips) {
29
+ identificadores.push({
30
+ assigner: 'sips',
31
+ value: data.codigo.sips
32
+ });
33
+ }
34
+ identificadores.push({
35
+ system: config_1.makeUrl('Organization'),
36
+ value: data._id
37
+ });
38
+ let contactos = data.contacto ? data.contacto.map(unContacto => {
39
+ let cont = {
40
+ resourceType: 'ContactPoint',
41
+ value: unContacto.valor,
42
+ rank: unContacto.ranking,
43
+ };
44
+ switch (unContacto.tipo) {
45
+ case 'fijo':
46
+ cont['system'] = 'phone';
47
+ break;
48
+ case 'celular':
49
+ cont['system'] = 'phone';
50
+ break;
51
+ case 'email':
52
+ cont['system'] = 'email';
53
+ break;
54
+ }
55
+ return cont;
56
+ }) : [];
57
+ // Parsea direcciones
58
+ let direcciones = data.direccion ? [{
59
+ resourceType: 'Address',
60
+ postalCode: data.direccion.codigoPostal ? data.direccion.codigoPostal : '',
61
+ line: [data.direccion.valor],
62
+ city: data.direccion.ubicacion.localidad ? data.direccion.ubicacion.localidad.nombre : '',
63
+ state: data.direccion.ubicacion.provincia ? data.direccion.ubicacion.provincia.nombre : '',
64
+ country: data.direccion.ubicacion.pais ? data.direccion.ubicacion.pais.nombre : '',
65
+ }] : [];
66
+ // Armamos la organizacion FHIR
67
+ let organizacionFHIR = {
68
+ id: data.id,
69
+ resourceType: 'Organization',
70
+ identifier: identificadores,
71
+ active: data.activo ? data.activo : null,
72
+ type: [{
73
+ resourceType: 'CodeableConcept',
74
+ text: data.tipoEstablecimiento ? data.tipoEstablecimiento.nombre : null,
75
+ }],
76
+ name: data.nombre ? data.nombre : null,
77
+ };
78
+ if (contactos.length > 0) { // A contact detail for the organization
79
+ organizacionFHIR['telecom'] = contactos;
80
+ }
81
+ if (direcciones) { // An address for the organization
82
+ organizacionFHIR['address'] = direcciones;
83
+ }
84
+ return organizacionFHIR;
85
+ }
86
+ else {
87
+ return null;
88
+ }
89
+ }
90
+ exports.encode = encode;
91
91
  //# sourceMappingURL=organization.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"organization.js","sourceRoot":"","sources":["../../../src/lib/organization.ts"],"names":[],"mappings":";;;AAAA,mCAA+C;AAE/C;;;GAGG;AACH,SAAgB,MAAM,CAAC,YAAY;IAC/B,IAAI,IAAI,GAAG,YAAY,CAAC;IACxB,IAAI,IAAI,EAAE;QACN,IAAI,eAAe,G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