-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Structured query v2 #3
Open
geloro94
wants to merge
11
commits into
main
Choose a base branch
from
structured-query-v2
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 5 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
0a72d63
WIP structured Query V2
geloro94 b112968
Structured Query V2 with timeRestrictions, multi TermCodes and attrib…
d054730
Structured Query V2 with timeRestriction, multiple TermCodes and attr…
426d2fe
Update 2021_09_12_StructuredQueryV2Example.json
juliangruendner 65efc7d
Strucutured Query v2
geloro94 4c51b6c
Update 2021_10_18_StructuredQueryV2Example.json
geloro94 73ec008
Update 2021_10_18_StructuredQueryV2Example.json
geloro94 0968d8f
Update 2021_10_18StructeredQueryV2Documentation.md
geloro94 22e3514
Update 2021_10_18_StructuredQueryV2Example.json
geloro94 5d69ccc
Update 2021_10_18_StructuredQueryV2Example.json
geloro94 28dbe1f
Update 2021_10_18_StructuredQueryV2Schema.json
geloro94 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
|
||
# Structured Queries | ||
|
||
CODEX front-end allows users to create feasibility queries based on inclusion and exclusion criteria. The different inclusion and exclusion criteria are conjuncted with the "AND" and "OR" operators respectively. Resulting in a conjunctive normal form (CNF) for inclusion and disjunctive normal form (DNF) for the exclusion criteria. | ||
CODEX front-end allows users to create feasibility queries based on inclusion and exclusion criteria. The different inclusion and exclusion criteria are conjuncted with the "AND" and "OR" operators respectively. Resulting in a conjunctive normal form without negation (CNF) for inclusion and disjunctive normal form without negation (DNF) for the exclusion criteria. | ||
|
||
The front-end created queries need to be transmitted to different back-end services which translates the Structured Query format into other query formats such as FHIR Search or CQL. As common data exchange format the so called *Structured Queries* are defined. | ||
|
||
|
@@ -15,24 +16,24 @@ The metadata provides some basic information about the query: | |
| Name | Description | | ||
| :-------- | -------------------------------------- | | ||
| Version | API Version | | ||
| Timestamp | Timestamp when the query was send | | ||
| Timestamp | Timestamp when the query was sent | | ||
| queryId | unique Id to identify a specific query | | ||
|
||
## Query | ||
|
||
As previously introduced the query is based on inclusion and exclusion criteria represented in CNF and DNF. | ||
As previously introduced, the query is based on inclusion and exclusion criteria represented in CNF and DNF. | ||
|
||
With in the query both CNF and DNF are conjuncted with an "AND NOT" operator. | ||
With in the query, both CNF and DNF are conjunct with an "AND NOT" operator. | ||
|
||
For the normal Form different building blocks are provided to represent the conjunctions of criteria. | ||
For the normal form, different building blocks are provided to represent the conjunctions of criteria. | ||
|
||
## inclusionCriteria\[][] | ||
|
||
Given a CNF: A and (B or C) | ||
|
||
The inclusionCriteria is an array of arrays of criteria. Within the outer array all elements are conjuncted with "AND". Based on the example {A} {B or C}. | ||
The inclusionCriteria is an array of arrays of criteria. Within the outer array, all elements are conjunct with "AND". Based on the example {A} {B or C}. | ||
|
||
Within the inner array all elements are disjuncted with "OR". Based on the example {B}{C}. A special case is given if only one element is given e.g. {A}. In this case no logic operation is applied to this element in this hierarchic element. | ||
Within the inner array all elements are disjunct with "OR". Based on the example {B}{C}. A special case is given if only one element is given, e.g. {A}. In this case, no logic operation is applied to this element in this hierarchic element. | ||
|
||
-> inclusionCriteria= {{A}, {B, C}} | ||
|
||
|
@@ -42,29 +43,25 @@ Analog for the exclusion criteria: | |
|
||
Given a DNF: A or (B and C) | ||
|
||
The exclusionCriteria is an array of arrays of criteria. Within the outer array all elements are disjuncted with "OR". Based on the example {A} {B and C} . | ||
The exclusionCriteria is an array of arrays of criteria. Within the outer array, all elements are disjunct with "OR". Based on the example {A} {B and C}. | ||
|
||
Within the inner array all elements are conjuncted with "And". Based on the example {B}{C} . A special case is given if only one element is given e.g. {A}. In this case no logic operation is applied to this element in this hierarchic element. | ||
Within the inner array all elements are conjunct with "And". Based on the example {B}{C} . A special case is given if only one element is given, e.g. {A}. In this case, no logic operation is applied to this element in this hierarchic element. | ||
|
||
-> exclusionCriteria = {{A}, {B, C}} | ||
|
||
## criterion | ||
|
||
The previous introduced elements {A}, {B} and {C} are representative for different criteria. | ||
|
||
Each criterion represents a unique concept or statement which is identified by its termCode. Which can be further specified by applying a value filter. | ||
Each criterion represents a unique concept or statement, which is identified by its termCode. Which can be further specified by applying a value filter. | ||
|
||
## termCode | ||
|
||
The termCode defines a concept based on a coding system (i.e. LOINC). The triplet of code, system and version identify the concept. An additional display element allows for a human readable form (This value SHALL be the same as the value define by the coding system) | ||
The termCode defines a concept based on a coding system (i.e. LOINC). The triplet of code, system and version identify the concept. An additional display element allows for a human-readable form (This value SHALL be the same as the value define by the coding system) | ||
|
||
## valueFilter | ||
|
||
ValueFilter specify the value of a defined concept. Depending on the valueFilter Type different value statements can be made. | ||
|
||
|
||
|
||
|
||
ValueFilter specify the value of a defined concept. Depending on the valueFilter Type, different value statements can be made. The valueFilter restricts the value of the highest interest of the resource. | ||
|
||
### quantity-comperator | ||
|
||
|
@@ -85,26 +82,45 @@ A valueFilter of type quantity-comperator can be applied to all numeric criterio | |
|
||
A valueFilter of type quantity-range can be applied to all numeric criterion concepts to validate if a value is within the boundaries of the defined min and max values. Again a unit can be given. | ||
|
||
## ConceptValueFilter | ||
### DateTime-comperator | ||
|
||
A valueFilter of type datetype can be applied to all datetime criterion concepts. It allows to use the | ||
|
||
| Enumeration | Comparator | | ||
| ----------- | ------------- | | ||
| le | less equal | | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why don't we use ≥ and ≤ signs instead of |
||
| ge | greater equal | | ||
|
||
ISO Datum | ||
|
||
### DateTime-range | ||
|
||
A valueFilter of type datetime-range can be applied to all datetime criterion concepts to validate if a value is an overlap exists between the criterions datetime and the interval explicitly or implicitly defined by the before and/or afterDate. ISO dateformat. | ||
|
||
beforeDate | ||
|
||
afterDate | ||
|
||
### Concept-ValueFilter | ||
|
||
A valueFilter of type concept can be applied to all concepts which have a value which itself is defined by a concept. The Value can be restricted by selectedConcepts which are termCodes. If multiple selectedConceptsare given the criterion is fulfilled if one of the values matches. | ||
|
||
Example: | ||
|
||
The patient gender is a concept and can be represented with a Termcode. The values female, male, diverse, etc. are also concepts representable by termCodes. | ||
|
||
"All male or female patients" (PseudoCriterion): | ||
"All male or female patients " (PseudoCriterion): | ||
|
||
```json | ||
{ | ||
"inclusionCriteria": [ | ||
[ | ||
{ | ||
"termCode": { | ||
"termCode": [ { | ||
"code": "LL2191-6", | ||
"display": "Geschlecht", | ||
"system": "http://loinc.org" | ||
}, | ||
} ], | ||
"valueFilter": { | ||
"type": "concept", | ||
"selectedConcepts": [ | ||
|
@@ -130,3 +146,6 @@ The patient gender is a concept and can be represented with a Termcode. The valu | |
|
||
|
||
|
||
## AttributeFilter[] | ||
|
||
Attribute Filter are valueFilter for specific attributes of the Resource. The AttributeCode defined as termCode specifies which attribute is restricted. |
131 changes: 0 additions & 131 deletions
131
structured-query/example-json/2021_02_01_QueryExampleWithoutTimeRestriction.json
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IHMO the type should be called
date-time-comparator
and notdatetype
to be on par with thequantity-comparator
type name.