Skip to content

Commit

Permalink
Make attribute required for ValueFilter
Browse files Browse the repository at this point in the history
  • Loading branch information
lmd59 committed Jan 31, 2025
1 parent 9e7aea5 commit 7ef6c67
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
6 changes: 2 additions & 4 deletions src/helpers/elm/QueryFilterParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1184,7 +1184,8 @@ export function interpretComparator(

const valueFilter: ValueFilter = {
type: 'value',
comparator: comparatorString
comparator: comparatorString,
attribute: propRef.path
};
const op = comparatorELM.operand[1];

Expand Down Expand Up @@ -1218,9 +1219,6 @@ export function interpretComparator(
if (propRef.scope) {
valueFilter.alias = propRef.scope;
}
if (propRef.path) {
valueFilter.attribute = propRef.path;
}
return valueFilter;
}

Expand Down
4 changes: 2 additions & 2 deletions src/types/QueryFilterTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ export interface codeFilterQuery {

export interface ValueFilter extends Filter {
type: 'value';
attribute?: string;
attribute: string;
alias?: string;
comparator: ValueFilterComparator;
valueBoolean?: boolean;
Expand All @@ -169,5 +169,5 @@ export interface ValueFilter extends Filter {
valueRange?: fhir4.Range;
}

// Information on these comparators found here: http://build.fhir.org/ig/HL7/cqf-measures/ValueSet-value-filter-comparator.html
// Information on these comparators found here: https://build.fhir.org/ig/HL7/fhir-extensions/StructureDefinition-cqf-valueFilter.html
export type ValueFilterComparator = 'eq' | 'gt' | 'lt' | 'ge' | 'le' | 'sa' | 'eb';

0 comments on commit 7ef6c67

Please sign in to comment.