Socket
Socket
Sign inDemoInstall

@asymmetrik/fhir-qb-mongo

Package Overview
Dependencies
4
Maintainers
8
Versions
10
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.10.5 to 0.11.0

11

CHANGELOG.md

@@ -6,2 +6,13 @@ # Change Log

# [0.11.0](https://github.com/Asymmetrik/phx-tools/compare/@asymmetrik/fhir-qb-mongo@0.10.5...@asymmetrik/fhir-qb-mongo@0.11.0) (2019-11-12)
### Features
* add token searching for psql ([#32](https://github.com/Asymmetrik/phx-tools/issues/32)) ([b9222d4](https://github.com/Asymmetrik/phx-tools/commit/b9222d4))
## [0.10.2](https://github.com/Asymmetrik/phx-tools/compare/@asymmetrik/fhir-qb-mongo@0.10.1...@asymmetrik/fhir-qb-mongo@0.10.2) (2019-05-03)

@@ -8,0 +19,0 @@

43

index.js

@@ -29,2 +29,13 @@ let supportedSearchTransformations = {

let buildTokenQuery = function({ systemPath, codePath, system, code }) {
let queries = [];
if (system) {
queries.push(buildEqualToQuery({ field: systemPath, value: system }));
}
if (code) {
queries.push(buildEqualToQuery({ field: codePath, value: code }));
}
return queries;
};
/**

@@ -156,2 +167,23 @@ * Builds query to get records where the value of the field is [<,<=,>,>=,!=] to the value.

/**
* For mongo, this can just be an Equals query
*/
let buildTokenURIQuery = function({ field, value }) {
return buildEqualToQuery({ field, value });
};
/**
* For mongo, this can just be an Equals query
*/
let buildTokenStringQuery = function({ field, value }) {
return buildEqualToQuery({ field, value });
};
/**
* For mongo, this can just be an Equals query
*/
let buildTokenEqualToQuery = function({ field, value }) {
return buildEqualToQuery({ field, value });
};
/**
* Apply paging

@@ -203,2 +235,3 @@ * @param query

matchesToPerform,
tokenMatches = [],
searchResultTransformations,

@@ -240,2 +273,5 @@ implementationParameters,

// Construct the necessary queries for each match and add them the pipeline.
// Token matches are treated like normal matches for Tokens
matchesToPerform = matchesToPerform.concat(tokenMatches);
if (matchesToPerform.length > 0) {

@@ -246,4 +282,5 @@ let listOfOrs = [];

match.push({});
} else {
listOfOrs.push(buildOrQuery({ queries: match }));
}
listOfOrs.push(buildOrQuery({ queries: match }));
}

@@ -275,2 +312,6 @@ query.push({ $match: buildAndQuery(listOfOrs) });

buildEqualToQuery,
buildTokenQuery,
buildTokenURIQuery,
buildTokenStringQuery,
buildTokenEqualToQuery,
buildExistsQuery,

@@ -277,0 +318,0 @@ buildOrQuery,

3

index.test.js

@@ -266,3 +266,3 @@ const mongoQB = require('./index');

const expectedResult = [
{ $match: { $and: [{ $or: [{}] }] } },
{ $match: { $and: [] } },
{ $match: { 'meta._isArchived': false } },

@@ -287,2 +287,3 @@ {

matchesToPerform: [[]],
tokenMatches: [],
searchResultTransformations: {},

@@ -289,0 +290,0 @@ implementationParameters: { archivedParamPath: 'meta._isArchived' },

{
"name": "@asymmetrik/fhir-qb-mongo",
"version": "0.10.5",
"version": "0.11.0",
"description": "FHIR query builder for Mongo DB",

@@ -35,3 +35,3 @@ "main": "index.js",

},
"gitHead": "bfb404c148ebdd202140b44d0bf4bcdf76c8f08e"
"gitHead": "55dfaff05c51d092b2400b8bad22f71f366621bd"
}
SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc