Compare commits

..

2 Commits

3 changed files with 24 additions and 5 deletions

View File

@ -4,8 +4,8 @@ const config = require('../config');
const { getBusToken, createBusRequest } = require('../utils/busAuth');
const { searchPatient } = require('../services/patient');
const { postDocumentReference, fetchDocumentReference } = require('../services/documentReference');
const { logger } = require('../utils/logger')
const { logger } = require('../utils/logger');
const { uuidv4 } = require('uuid');
const DOCUMENT_REFERENCE_RESOURCE_TYPE = "DocumentReference";
@ -17,7 +17,7 @@ const LIST_RESOURCE_TYPE = 'List';
const NATIONAL_ID_SYSTEM = 'https://federador.msal.gob.ar/patient-id';
const DNI_SYSTEM = 'http://www.renaper.gob.ar/dni';
const CUSTODIAN_ID_SYSTEM = 'https://federador.msal.gob.ar/uri';
const MASTER_ID_SYSTEM = ''
/**
* Procesa una transacción y devuelve los recursos persistidos en el servidor HAPI FHIR
@ -90,6 +90,10 @@ async function createBusDocumentReference(token, localIPSDocument, localPatient)
const busDocumentReference = {
resourceType: 'DocumentReference',
status: 'current',
masterIdentifier: {
system: 'urn:ietf:rfc:3986',
value: `urn:uuid:${uuidv4()}`
},
type: {
coding: [
{

View File

@ -16,7 +16,8 @@
"http-errors": "~1.6.3",
"jade": "~1.11.0",
"morgan": "~1.9.1",
"pino": "^10.3.1"
"pino": "^10.3.1",
"uuid": "^14.0.0"
},
"devDependencies": {
"jest": "^30.3.0"
@ -5500,6 +5501,19 @@
"node": ">= 0.4.0"
}
},
"node_modules/uuid": {
"version": "14.0.0",
"resolved": "https://registry.npmjs.org/uuid/-/uuid-14.0.0.tgz",
"integrity": "sha512-Qo+uWgilfSmAhXCMav1uYFynlQO7fMFiMVZsQqZRMIXp0O7rR7qjkj+cPvBHLgBqi960QCoo/PH2/6ZtVqKvrg==",
"funding": [
"https://github.com/sponsors/broofa",
"https://github.com/sponsors/ctavan"
],
"license": "MIT",
"bin": {
"uuid": "dist-node/bin/uuid"
}
},
"node_modules/v8-to-istanbul": {
"version": "9.3.0",
"resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-9.3.0.tgz",

View File

@ -15,7 +15,8 @@
"http-errors": "~1.6.3",
"jade": "~1.11.0",
"morgan": "~1.9.1",
"pino": "^10.3.1"
"pino": "^10.3.1",
"uuid": "^14.0.0"
},
"devDependencies": {
"jest": "^30.3.0"