Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const fhirCommon = require('./fhir/common')(mongo)
const hooks = require('./fhir/hooks')()
const matchingQueue = require('./matching-queue/matching-queue')(mongo)
const matchingIndexes = require('../scripts/matching-indexes')(mongo)
const moduleLoader = require('./fhir/module-loader')(mongo)
const profileLoader = require('./fhir/profile-loader')()
const acceptedJSONContentTypes = ['application/json+fhir', 'application/fhir+json', 'application/json', 'text/json']
const acceptedXMLContentTypes = ['application/xml+fhir', 'application/fhir+xml', 'application/xml', 'text/xml']
process.title = 'Hearth'
let fhir = null
switch (config.getConf('server:fhirVersion')) {
case 'dstu1':
fhir = new FHIR(FHIR.DSTU1)
break
case 'dstu2':
fhir = new FHIR(FHIR.DSTU2)
break
case 'stu3':
fhir = new FHIR(FHIR.STU3)
break
}
if (config.getConf('createIndexes')) {
matchingIndexes.createMatchingIndexes((err) => {
if (err) {
logger.error(err)
}
logger.info('Matching Indexes created')
})
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree.
*/
'use strict'
const FHIR = require('fhir')
const config = require('../config')
const profileLoader = require('../fhir/profile-loader')()
let fhir = null
switch (config.getConf('server:fhirVersion')) {
case 'dstu1':
fhir = new FHIR(FHIR.DSTU1)
break
case 'dstu2':
fhir = new FHIR(FHIR.DSTU2)
break
case 'stu3':
fhir = new FHIR(FHIR.STU3)
break
}
module.exports = () => {
return {
hooks: {
before: [
{
resourceType: '*',
interactions: [ 'create', 'update' ],