{"_id":"@bluehalo/fhir-qb","_rev":"8-886c6633b8ee08d7e254f904d1d88eac","name":"@bluehalo/fhir-qb","dist-tags":{"latest":"0.13.0"},"versions":{"0.12.6":{"name":"@bluehalo/fhir-qb","version":"0.12.6","author":{"name":"Sumeet-S","email":"sshah@asymmetrik.com"},"license":"MIT","_id":"@bluehalo/fhir-qb@0.12.6","maintainers":[{"name":"ashin-bluehalo","email":"andrew.shin@bluehalo.com"},{"name":"ekoon121","email":"ekoon@asymmetrik.com"},{"name":"reblace","email":"reblace@gmail.com"}],"contributors":[{"name":"Shane O'Neill","email":"soneill@asymmetrik.com"},{"name":"Sumeet-S","email":"sshah@asymmetrik.com"},{"name":"Tracy Nguyen","email":"tnguyen@asymmetrik.com"}],"homepage":"https://github.com/BlueHalo/node-fhir-server-core","dist":{"shasum":"92a70beb9e75307253988bebee938f3b76d7f9ee","tarball":"https://registry.npmjs.org/@bluehalo/fhir-qb/-/fhir-qb-0.12.6.tgz","fileCount":16,"integrity":"sha512-4KM+7DBcdpg9rOHui4blcIFlZjHO7uFIQVeHDB4rb7PTZhRUmMzbmPHR6cw+j9vB5Zrj6ZsgdXZCaw8NSUTDQQ==","signatures":[{"sig":"MEQCIFMMwrrLlJ4u0xLEJ5bJv5iR0BYBLHolSF8WZac08eleAiAx5a/OX865U1z59zK5qO9sbp+gBpRCVMevR/bS0t+WbA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":564948},"jest":{"verbose":true,"collectCoverage":false,"testEnvironment":"node","coverageReporters":["text","lcov","json"],"coveragePathIgnorePatterns":["<rootDir>/src/testutils/"]},"main":"index.js","gitHead":"717c4ad053a5034563d778318b9ccb673d025930","scripts":{"test":"jest"},"_npmUser":{"name":"ashin-bluehalo","email":"andrew.shin@bluehalo.com"},"repository":{"type":"git","directory":"packages/fhir-qb"},"_npmVersion":"8.5.0","description":"FHIR query builder","directories":{},"_nodeVersion":"16.14.2","dependencies":{"mathjs":"^9.5.1","moment":"^2.24.0","xregexp":"^4.4.1","sequelize":"^6.8.0","@bluehalo/fhir-qb-mongo":"^0.12.3","@bluehalo/fhir-sanitize-param":"^1.1.6"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/fhir-qb_0.12.6_1708113885814_0.14822990249796097","host":"s3://npm-registry-packages"}},"0.13.0":{"name":"@bluehalo/fhir-qb","version":"0.13.0","author":{"name":"Sumeet-S","email":"sshah@asymmetrik.com"},"license":"MIT","_id":"@bluehalo/fhir-qb@0.13.0","maintainers":[{"name":"ekdeveloper","email":"eugene.koon@bluehalo.com"},{"name":"shane-bh","email":"shane.oneill@bluehalo.com"},{"name":"ashin-bluehalo","email":"andrew.shin@bluehalo.com"},{"name":"reblace","email":"reblace@gmail.com"}],"contributors":[{"name":"Shane O'Neill","email":"soneill@asymmetrik.com"},{"name":"Sumeet-S","email":"sshah@asymmetrik.com"},{"name":"Tracy Nguyen","email":"tnguyen@asymmetrik.com"}],"homepage":"https://github.com/Bluehalo/node-fhir-server-core","dist":{"shasum":"2b2ade74b284cda6ec1a94dd6a9f03a09b3d47a4","tarball":"https://registry.npmjs.org/@bluehalo/fhir-qb/-/fhir-qb-0.13.0.tgz","fileCount":6,"integrity":"sha512-PbEV/1SoM03KoKhZT0IRfqO+bFstMqYnuJXLSeoE5Z6fSyyUvkW+wHCRBEHJipjpGGjWZ8r1pJF+lyJHvt0IMw==","signatures":[{"sig":"MEQCIAzV4da91cbsVUGCVlsez1It1InLEgoj4FcBw1tvC5qRAiAwEYZbeXc7jEpMqV3gPO5UzaR4sK6WuB+BlxeGJjrwJg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":394231},"jest":{"verbose":true,"collectCoverage":false,"testEnvironment":"node","coverageReporters":["text","lcov","json"],"coveragePathIgnorePatterns":["<rootDir>/src/testutils/"]},"main":"index.js","gitHead":"717c4ad053a5034563d778318b9ccb673d025930","scripts":{"test":"jest"},"_npmUser":{"name":"ekdeveloper","email":"eugene.koon@bluehalo.com"},"repository":{"type":"git","directory":"packages/fhir-qb"},"description":"FHIR query builder","directories":{},"dependencies":{"mathjs":"^13.1.1","moment":"^2.30.1","xregexp":"^5.1.1","sequelize":"^6.37.3","@bluehalo/fhir-qb-mongo":"^0.13.0","@bluehalo/fhir-sanitize-param":"^1.2.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0"},"_npmOperationalInternal":{"tmp":"tmp/fhir-qb_0.13.0_1726061225084_0.8657574951391336","host":"s3://npm-registry-packages"}}},"time":{"created":"2024-02-16T20:04:45.725Z","modified":"2026-03-25T20:10:56.528Z","0.12.6":"2024-02-16T20:04:45.983Z","0.13.0":"2024-09-11T13:27:05.217Z"},"author":{"name":"Sumeet-S","email":"sshah@asymmetrik.com"},"license":"MIT","homepage":"https://github.com/Bluehalo/node-fhir-server-core","repository":{"type":"git","directory":"packages/fhir-qb"},"description":"FHIR query builder","contributors":[{"name":"Shane O'Neill","email":"soneill@asymmetrik.com"},{"name":"Sumeet-S","email":"sshah@asymmetrik.com"},{"name":"Tracy Nguyen","email":"tnguyen@asymmetrik.com"}],"maintainers":[{"email":"reblace@gmail.com","name":"reblace"},{"email":"eugene.koon@bluehalo.com","name":"ekdeveloper"},{"email":"andrew.shin@bluehalo.com","name":"ashin-bluehalo"},{"email":"shane.oneill@bluehalo.com","name":"shane-bh"},{"email":"rnmercado@gmail.com","name":"rodmercad"}],"readme":"# FHIR-QB\n\n> Utility for standard rest API's to build search queries from incoming requests.\n\n## Install\n\n```shell\nyarn add @bluehalo/fhir-qb\n```\n\n## Arguments\n\n`@bluehalo/fhir-qb` exports a single class called QueryBuilder. The QueryBuilder constructor takes 4 arguments:\n\n#### `packageName`\n\nQuery builder implementation package to be required. Default: `@bluehalo/fhir-qb-mongo`\n\n#### `globalParameterDefinitions`\n\nParameter definitions for global parameters that apply to all resources. Defined by the fhir 'resource' resource\nparameters. Default: `{}`\n\n#### `pageParam`\n\nQuery parameter used to indicate which page of results is being requested. Default: `page`\n\n#### `resultsPerPage`\n\nHow many results should be returned per page. Default: `10`\n\n#### `implementationParameters`\n\nObject to be passed through to the DB-specific implementation with whatever information from the server the implementation\nmay need. Default: `{}`\n\nSee [DB Specific Implementations](#db-specific-implementations) below.\n\n#### `columnIdentifierStrategy`\n\nDefaults to determining the column/path to the variable through it's xpath within its parameter definition. The string \"parameter\" can be passed to make it so that the\nraw parameter name is used as the lookup column.\n\n## Usage\n\nThe QueryBuilder class has a method called `buildSearchQuery` which takes two arguments. It takes an Express request object and an object containing argument definitions.\nThe allowed arguments are generated per resource and have the following properties:\n\n#### `type`\n\nData type we expect the parameter to be in. We will try to coerce the value into these types to an extent. See [Valid Types](#valid-types) below.\n\n#### `fhirtype`\n\nData type we expect the parameter to be in of the types listed in the FHIR specification. Currently being used to specify what type of token token parameters are.\n\n#### `xpath`\n\nPath to the parameter within the resource\n\n#### `definition`\n\nLink to the full parameter structure definition on the hl7 website\n\n#### `description`\n\nDescription of the parameter/argument\n\nThe `buildSearchQuery` method returns a search query for the configured db implementation that can be\npassed of to the database service and executed.\n\n### DB Specific Implementations\n\nThe FHIR-QB relies on a database specific implementation to enable it to properly construct queries for the chosen database.\nAn implementation must include the following methods:\n\n```\n\tassembleSearchQuery,\n\tbuildAndQuery,\n\tbuildComparatorQuery,\n\tbuildContainsQuery,\n\tbuildEndsWithQuery,\n\tbuildEqualToQuery,\n\tbuildExistsQuery,\n\tbuildOrQuery,\n\tbuildInRangeQuery,\n\tbuildStartsWithQuery,\n```\n\n### Valid Types\n\nAllowed types are currently `number`, `date`, `uri` `reference`, `string`, `token`, `quantity` and `boolean`.\n","readmeFilename":"README.md"}