@andes/fhir 1.12.1-beta.1 → 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/README.md CHANGED
@@ -1,2 +1,2 @@
1
- # FHIR
2
- Paquete Fhir para Andes
1
+ # FHIR
2
+ Paquete Fhir para Andes
@@ -0,0 +1,26 @@
1
+ import { AndesPatient } from '../types/andes/patient.types';
2
+ export type PartialDeep<T> = {
3
+ [K in keyof T]?: T[K] extends object ? PartialDeep<T[K]> : T[K];
4
+ };
5
+ export declare const createPatient: (overrides?: PartialDeep<AndesPatient>) => {
6
+ _id?: string | undefined;
7
+ id?: string | undefined;
8
+ documento?: string | undefined;
9
+ cuil?: string | undefined;
10
+ tipoIdentificacion?: string | null | undefined;
11
+ numeroIdentificacion?: string | null | undefined;
12
+ nombre: string;
13
+ apellido: string;
14
+ fechaNacimiento?: string | Date | undefined;
15
+ fechaFallecimiento?: string | Date | null | undefined;
16
+ genero?: string | undefined;
17
+ sexo?: string | undefined;
18
+ estado?: string | null | undefined;
19
+ activo?: boolean | undefined;
20
+ estadoCivil?: string | null | undefined;
21
+ contacto?: import("../types/andes/patient.types").AndesContacto[] | undefined;
22
+ direccion?: import("../types/andes/patient.types").AndesDireccion[] | undefined;
23
+ relaciones?: import("../types/andes/patient.types").AndesRelacion[] | undefined;
24
+ foto?: string | null | undefined;
25
+ createdBy?: import("../types/andes/patient.types").AndesCreatedBy | undefined;
26
+ };
@@ -0,0 +1,15 @@
1
+ import * as AllergyIntolerance from './lib/allergyIntolerance';
2
+ import * as Bundle from './lib/bundle';
3
+ import * as Composition from './lib/composition';
4
+ import * as Condition from './lib/condition';
5
+ import * as Device from './lib/device';
6
+ import * as DocumentReference from './lib/document-reference';
7
+ import * as Immunization from './lib/immunization';
8
+ import * as Medication from './lib/medication';
9
+ import * as MedicationRequest from './lib/medicationRequest';
10
+ import * as MedicationStatement from './lib/medicationStatement';
11
+ import * as Organization from './lib/organization';
12
+ import * as Patient from './lib/patient';
13
+ import * as Practitioner from './lib/practitioner';
14
+ export { getDominio, initialize } from './lib/config';
15
+ export { Patient, Practitioner, Organization, Immunization, Condition, Composition, Bundle, DocumentReference, Device, Medication, MedicationStatement, MedicationRequest, AllergyIntolerance };
package/dist/index.js ADDED
@@ -0,0 +1,55 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ 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 = exports.initialize = exports.getDominio = void 0;
27
+ const AllergyIntolerance = __importStar(require("./lib/allergyIntolerance"));
28
+ exports.AllergyIntolerance = AllergyIntolerance;
29
+ const Bundle = __importStar(require("./lib/bundle"));
30
+ exports.Bundle = Bundle;
31
+ const Composition = __importStar(require("./lib/composition"));
32
+ exports.Composition = Composition;
33
+ const Condition = __importStar(require("./lib/condition"));
34
+ exports.Condition = Condition;
35
+ const Device = __importStar(require("./lib/device"));
36
+ exports.Device = Device;
37
+ const DocumentReference = __importStar(require("./lib/document-reference"));
38
+ exports.DocumentReference = DocumentReference;
39
+ const Immunization = __importStar(require("./lib/immunization"));
40
+ exports.Immunization = Immunization;
41
+ const Medication = __importStar(require("./lib/medication"));
42
+ exports.Medication = Medication;
43
+ const MedicationRequest = __importStar(require("./lib/medicationRequest"));
44
+ exports.MedicationRequest = MedicationRequest;
45
+ const MedicationStatement = __importStar(require("./lib/medicationStatement"));
46
+ exports.MedicationStatement = MedicationStatement;
47
+ const Organization = __importStar(require("./lib/organization"));
48
+ exports.Organization = Organization;
49
+ const Patient = __importStar(require("./lib/patient"));
50
+ exports.Patient = Patient;
51
+ const Practitioner = __importStar(require("./lib/practitioner"));
52
+ exports.Practitioner = Practitioner;
53
+ var config_1 = require("./lib/config");
54
+ Object.defineProperty(exports, "getDominio", { enumerable: true, get: function () { return config_1.getDominio; } });
55
+ Object.defineProperty(exports, "initialize", { enumerable: true, get: function () { return config_1.initialize; } });
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Encode de Alergias e Intolerancias from ANDES to FHIR
3
+ * @param {} AllergyIntolerance
4
+ */
5
+ export declare function encode(patientReference: any, alergiaIntolerancia: any): {
6
+ category: string[];
7
+ criticality: string;
8
+ patient: {
9
+ reference: any;
10
+ };
11
+ id: any;
12
+ code: {
13
+ coding: {
14
+ system: string;
15
+ display: any;
16
+ code: any;
17
+ }[];
18
+ };
19
+ meta: {
20
+ profile: string[];
21
+ };
22
+ text: {
23
+ status: string;
24
+ div: string;
25
+ };
26
+ resourceType: string;
27
+ type: string;
28
+ onsetDateTime: any;
29
+ };
@@ -0,0 +1,14 @@
1
+ export declare function encode(ID: any, resources: any): {
2
+ resourceType: string;
3
+ id: any;
4
+ meta: {
5
+ lastUpdated: string;
6
+ };
7
+ language: string;
8
+ entry: any;
9
+ type: string;
10
+ identifier: {
11
+ system: string;
12
+ value: any;
13
+ };
14
+ };
@@ -0,0 +1,47 @@
1
+ import moment from 'moment';
2
+ export declare function encode(ID: any, patientReference: any, custodianReference: any, deviceReference: any, medicationStatementReference: any, ImmunizationReferences: any, AllergyIntoleranceReferences: any, ConditionReferences: any): {
3
+ id: any;
4
+ subject: {
5
+ reference: any;
6
+ };
7
+ section: any[];
8
+ resourceType: string;
9
+ author: {
10
+ identifier: {
11
+ system: string;
12
+ value: any;
13
+ };
14
+ }[];
15
+ confidentiality: string;
16
+ type: {
17
+ coding: {
18
+ system: string;
19
+ display: string;
20
+ code: string;
21
+ }[];
22
+ };
23
+ title: string;
24
+ identifier: {
25
+ system: string;
26
+ value: any;
27
+ };
28
+ date: moment.Moment;
29
+ text: {
30
+ status: string;
31
+ div: string;
32
+ };
33
+ custodian: {
34
+ identifier: {
35
+ system: string;
36
+ value: any;
37
+ };
38
+ };
39
+ attester: {
40
+ mode: string;
41
+ time: moment.Moment;
42
+ party: {
43
+ reference: any;
44
+ };
45
+ }[];
46
+ status: string;
47
+ };
@@ -0,0 +1,53 @@
1
+ /**
2
+ *
3
+ * @param registro Registro RUP a transformar a FHIR
4
+ */
5
+ export declare function encode(patientReference: any, registro: any): {
6
+ id: any;
7
+ category: {
8
+ coding: {
9
+ system: string;
10
+ display: string;
11
+ code: string;
12
+ }[];
13
+ }[];
14
+ subject: {
15
+ reference: any;
16
+ };
17
+ onsetDateTime: any;
18
+ resourceType: string;
19
+ verificationStatus: {
20
+ coding: {
21
+ system: string;
22
+ code: string;
23
+ }[];
24
+ };
25
+ code: {
26
+ coding: {
27
+ code: any;
28
+ system: string;
29
+ display: any;
30
+ }[];
31
+ };
32
+ recordedDate: any;
33
+ meta: {
34
+ profile: string[];
35
+ };
36
+ text: {
37
+ status: string;
38
+ div: string;
39
+ };
40
+ severity: {
41
+ coding: {
42
+ system: string;
43
+ display: string;
44
+ code: string;
45
+ }[];
46
+ };
47
+ clinicalStatus: {
48
+ coding: {
49
+ system: string;
50
+ code: any;
51
+ }[];
52
+ };
53
+ };
@@ -0,0 +1,9 @@
1
+ export declare function initialize(config: {
2
+ dominio: string;
3
+ }): void;
4
+ export declare function getDominio(): string;
5
+ export declare function makeUrl(resource: string, id?: string | null): string;
6
+ /**
7
+ * Reseteo explícito para tests
8
+ */
9
+ export declare function __reset(): void;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,22 @@
1
+ export declare function encode(): {
2
+ resourceType: string;
3
+ id: string;
4
+ identifier: {
5
+ system: string;
6
+ value: string;
7
+ }[];
8
+ type: {
9
+ coding: {
10
+ system: string;
11
+ code: string;
12
+ display: string;
13
+ }[];
14
+ };
15
+ owner: {
16
+ reference: string;
17
+ };
18
+ deviceName: {
19
+ name: string;
20
+ type: string;
21
+ }[];
22
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,71 @@
1
+ export declare function encode(ID: any, author: any, organization: any, patient: any, binaryURL: any): {
2
+ resourceType: string;
3
+ id: any;
4
+ meta: {
5
+ lastUpdated: string;
6
+ };
7
+ contained: {
8
+ resourceType: string;
9
+ id: any;
10
+ identifier: {
11
+ system: string;
12
+ value: any;
13
+ }[];
14
+ }[];
15
+ custodian: {
16
+ identifier: {
17
+ system: string;
18
+ value: string;
19
+ };
20
+ };
21
+ masterIdentifier: {
22
+ system: string;
23
+ value: any;
24
+ };
25
+ identifier: {
26
+ system: string;
27
+ value: any;
28
+ }[];
29
+ status: string;
30
+ type: {
31
+ coding: {
32
+ system: string;
33
+ code: string;
34
+ }[];
35
+ };
36
+ subject: {
37
+ reference: string;
38
+ };
39
+ securityLabel: {
40
+ coding: {
41
+ system: string;
42
+ code: string;
43
+ }[];
44
+ }[];
45
+ content: {
46
+ attachment: {
47
+ id: string;
48
+ url: any;
49
+ };
50
+ }[];
51
+ context: {
52
+ event: {
53
+ coding: {
54
+ system: string;
55
+ code: string;
56
+ }[];
57
+ }[];
58
+ facilityType: {
59
+ coding: {
60
+ system: string;
61
+ code: string;
62
+ }[];
63
+ };
64
+ practiceSetting: {
65
+ coding: {
66
+ system: string;
67
+ code: string;
68
+ }[];
69
+ };
70
+ };
71
+ };
@@ -0,0 +1,44 @@
1
+ /**
2
+ * Encode de Vacunas Nomivac from ANDES to FHIR
3
+ * @param {} nomivac
4
+ * [ASK] El code de extension puede ir en vaccineCode?
5
+ * [ASk] Location no se sabe. Solo esta el texto
6
+ */
7
+ export declare function encode(patientReference: any, nomivac: any): {
8
+ resourceType: string;
9
+ id: any;
10
+ extension: {
11
+ url: string;
12
+ valueCoding: {
13
+ system: string;
14
+ code: string;
15
+ display: any;
16
+ };
17
+ }[];
18
+ status: string;
19
+ notGiven: boolean;
20
+ vaccineCode: {
21
+ coding: {
22
+ system: string;
23
+ code: any;
24
+ display: any;
25
+ }[];
26
+ };
27
+ patient: {
28
+ reference: any;
29
+ };
30
+ date: any;
31
+ primarySource: boolean;
32
+ location: {
33
+ reference: string;
34
+ };
35
+ vaccinationProtocol: {
36
+ doseSequence: number;
37
+ doseStatus: {
38
+ coding: {
39
+ system: string;
40
+ code: any;
41
+ }[];
42
+ };
43
+ }[];
44
+ };
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Encode de Medicamentos from ANDES to FHIR
3
+ * @param {} medication
4
+ */
5
+ export declare function encode(medication: any): {
6
+ resourceType: string;
7
+ id: any;
8
+ meta: {
9
+ profile: string[];
10
+ };
11
+ identifier: any;
12
+ code: {
13
+ coding: {
14
+ system: string;
15
+ display: any;
16
+ code: any;
17
+ }[];
18
+ text: any;
19
+ };
20
+ status: string;
21
+ text: {
22
+ status: string;
23
+ div: string;
24
+ };
25
+ };
@@ -0,0 +1,42 @@
1
+ /**
2
+ * Encode medicationRequest from ANDES to FHIR
3
+ * @param {} medicationRequest
4
+ */
5
+ export declare function encode(patientReference: any, practitionerReference: any, medicationFHIR: any, data: any): {
6
+ resourceType: string;
7
+ id: any;
8
+ text: {
9
+ status: string;
10
+ };
11
+ contained: any[];
12
+ identifier: {
13
+ use: string;
14
+ system: string;
15
+ value: any;
16
+ }[];
17
+ status: string;
18
+ intent: string;
19
+ priority: string;
20
+ doNotPerform: boolean;
21
+ medicationReference: {
22
+ reference: any;
23
+ display: any;
24
+ };
25
+ subject: {
26
+ reference: any;
27
+ };
28
+ authoredOn: string;
29
+ requester: {
30
+ reference: any;
31
+ };
32
+ basedOn: any;
33
+ note: null;
34
+ dosageInstruction: null;
35
+ substitution: {
36
+ allowedBoolean: boolean;
37
+ reason: null;
38
+ };
39
+ priorPrescription: null;
40
+ detectedIssue: null;
41
+ eventHistory: null;
42
+ };
@@ -0,0 +1,47 @@
1
+ /**
2
+ * Encode de Medicamentos from ANDES to FHIR
3
+ * @param {} medicationStatement
4
+ */
5
+ export declare function encode(patientReference: any, medicationReference: any, prestacionMedicamento: any): {
6
+ resourceType: string;
7
+ status: string;
8
+ id: any;
9
+ effectiveDateTime: any;
10
+ medicationCodeableConcept: {
11
+ coding: {
12
+ system: string;
13
+ code: any;
14
+ display: any;
15
+ }[];
16
+ };
17
+ meta: {
18
+ profile: string[];
19
+ };
20
+ subject: {
21
+ reference: any;
22
+ };
23
+ medicationReference: {
24
+ reference: any;
25
+ };
26
+ dosage: {
27
+ text: any;
28
+ route: {
29
+ coding: {
30
+ system: string;
31
+ code: any;
32
+ display: any;
33
+ }[];
34
+ };
35
+ timing: {
36
+ coding: {
37
+ system: string;
38
+ code: string;
39
+ display: string;
40
+ };
41
+ };
42
+ }[];
43
+ text: {
44
+ status: string;
45
+ div: string;
46
+ };
47
+ };
@@ -0,0 +1,6 @@
1
+ import { Organization } from 'fhir/r4';
2
+ import { AndesOrganization } from '../types/andes/organization.types';
3
+ /**
4
+ * Encode an ANDES Organization to FHIR Organization
5
+ */
6
+ export declare function encode(organization: AndesOrganization | null | undefined): Organization | null;
@@ -0,0 +1,14 @@
1
+ import { Patient } from 'fhir/r4';
2
+ import { AndesPatient } from '../types/andes/patient.types';
3
+ /**
4
+ * Encode a patient from ANDES to FHIR
5
+ */
6
+ export declare function encode(patient: AndesPatient | null | undefined): Patient | null;
7
+ /**
8
+ * Decode a patient from FHIR to ANDES
9
+ */
10
+ export declare function decode(patient: Patient): AndesPatient;
11
+ /**
12
+ * Verify if a patient has a FHIR format
13
+ */
14
+ export declare function verify(patient: any): boolean;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,6 @@
1
+ import { Practitioner } from 'fhir/r4';
2
+ import { AndesPractitioner } from '../types/andes/practitioner.types';
3
+ /**
4
+ * Encode a practitioner from ANDES to FHIR
5
+ */
6
+ export declare function encode(practitioner: AndesPractitioner | null | undefined): Practitioner | null;
@@ -0,0 +1,39 @@
1
+ export interface AndesCodigoOrg {
2
+ sisa?: string;
3
+ cuie?: string;
4
+ remediar?: string;
5
+ sips?: string;
6
+ }
7
+ export interface AndesUbicacionOrg {
8
+ localidad?: {
9
+ nombre: string;
10
+ };
11
+ provincia?: {
12
+ nombre: string;
13
+ };
14
+ pais?: {
15
+ nombre: string;
16
+ };
17
+ }
18
+ export interface AndesDireccionOrg {
19
+ valor: string;
20
+ codigoPostal?: string;
21
+ ubicacion: AndesUbicacionOrg;
22
+ }
23
+ export interface AndesContactoOrg {
24
+ tipo: 'fijo' | 'celular' | 'email' | string;
25
+ valor: string;
26
+ ranking?: number;
27
+ }
28
+ export interface AndesOrganization {
29
+ _id?: string;
30
+ id?: string;
31
+ nombre?: string;
32
+ activo?: boolean;
33
+ tipoEstablecimiento?: {
34
+ nombre: string;
35
+ };
36
+ codigo: AndesCodigoOrg;
37
+ direccion?: AndesDireccionOrg;
38
+ contacto?: AndesContactoOrg[];
39
+ }
@@ -0,0 +1,57 @@
1
+ export type AndesSexo = 'femenino' | 'masculino' | 'otro' | string;
2
+ export type AndesGenero = 'mujer' | 'mujer trans' | 'varon' | 'varon trans' | 'no binario' | 'travesti' | 'masculinidad trans' | 'femenino' | 'masculino' | 'otro' | string;
3
+ export interface AndesContacto {
4
+ tipo: 'fijo' | 'celular' | 'email' | string;
5
+ valor: string;
6
+ ranking?: number;
7
+ }
8
+ export interface AndesUbicacionNombre {
9
+ nombre: string;
10
+ }
11
+ export interface AndesUbicacion {
12
+ localidad?: AndesUbicacionNombre | string;
13
+ provincia?: AndesUbicacionNombre | string;
14
+ pais?: AndesUbicacionNombre | string;
15
+ }
16
+ export interface AndesDireccion {
17
+ activo?: boolean;
18
+ valor: string;
19
+ codigoPostal?: string;
20
+ ubicacion: AndesUbicacion;
21
+ }
22
+ export interface AndesRelacion {
23
+ relacion: {
24
+ nombre: string;
25
+ };
26
+ nombre: string;
27
+ apellido: string;
28
+ }
29
+ export interface AndesCreatedByOrganizacion {
30
+ id: string;
31
+ nombre: string;
32
+ }
33
+ export interface AndesCreatedBy {
34
+ organizacion: AndesCreatedByOrganizacion;
35
+ }
36
+ export interface AndesPatient {
37
+ _id?: string;
38
+ id?: string;
39
+ documento?: string;
40
+ cuil?: string;
41
+ tipoIdentificacion?: string | null;
42
+ numeroIdentificacion?: string | null;
43
+ nombre: string;
44
+ apellido: string;
45
+ fechaNacimiento?: string | Date;
46
+ fechaFallecimiento?: string | Date | null;
47
+ genero?: AndesGenero;
48
+ sexo?: AndesSexo;
49
+ estado?: string | null;
50
+ activo?: boolean;
51
+ estadoCivil?: string | null;
52
+ contacto?: AndesContacto[];
53
+ direccion?: AndesDireccion[];
54
+ relaciones?: AndesRelacion[];
55
+ foto?: string | null;
56
+ createdBy?: AndesCreatedBy;
57
+ }