npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@asymmetrik/fhir-qb

v0.12.5

Published

FHIR query builder

Downloads

16

Readme

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. The QueryBuilder constructor takes 4 arguments:

packageName

Query builder implementation package to be required. Default: @asymmetrik/fhir-qb-mongo

globalParameterDefinitions

Parameter definitions for global parameters that apply to all resources. Defined by the fhir 'resource' resource parameters. Default: {}

pageParam

Query parameter used to indicate which page of results is being requested. Default: page

resultsPerPage

How many results should be returned per page. Default: 10

implementationParameters

Object to be passed through to the DB-specific implementation with whatever information from the server the implementation may need. Default: {}

See DB Specific Implementations below.

columnIdentifierStrategy

Defaults 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 raw parameter name is used as the lookup column.

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