Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@asymmetrik/fhir-qb

Package Overview
Dependencies
Maintainers
8
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@asymmetrik/fhir-qb

FHIR query builder

  • 0.10.3
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
12
decreased by-47.83%
Maintainers
8
Weekly downloads
 
Created
Source

FHIR-QB

Utility for standard rest API's to build search queries from incoming requests.

Install

yarn add @asymmetrik/fhir-qb

Arguments

@asymmetrik/fhir-qb exports a single class called QueryBuilder. When creating a new QueryBuilder, you must supply the db-specific implementation in phx-tools that you wish the query builder to use. For example:

let qb = new QueryBuilder('fhir-qb-mongo')

See DB Specific Implementations below.

Usage

The QueryBuilder class has a method called buildSearchQuery which takes two arguments. It takes an Express request object and an object containing argument definitions. The allowed arguments are generated per resource and have the following properties:

type

Data type we expect the parameter to be in. We will try to coerce the value into these types to an extent. See Valid Types below.

fhirtype

Data 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.

xpath

Path to the parameter within the resource

definition

Link to the full parameter structure definition on the hl7 website

description
description

Description of the parameter/argument

The buildSearchQuery method returns a search query for the configured db implementation that can be passed of to the database service and executed.

DB Specific Implementations

The FHIR-QB relies on a database specific implementation to enable it to properly construct queries for the chosen database. An implementation must include the following methods:

	assembleSearchQuery,
	buildAndQuery,
	buildComparatorQuery,
	buildContainsQuery,
	buildEndsWithQuery,
	buildEqualToQuery,
	buildExistsQuery,
	buildOrQuery,
	buildInRangeQuery,
	buildStartsWithQuery,

Valid Types

Allowed types are currently number, date, uri reference, string, token, quantity and boolean.

FAQs

Package last updated on 16 May 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc