-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
1,904 additions
and
6,787 deletions.
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
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
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
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,24 +1,24 @@ | ||
import Fuse from "fuse.js"; | ||
import { ICodeSystem_Concept } from "@ahryman40k/ts-fhir-types/lib/R4"; | ||
import Filter from "@/services/filter"; | ||
import { QueryOptions, MatchType, LogicalOperator } from "@/types/queryOptions"; | ||
import FuseSearch from "@/services/fuseSearch"; | ||
import { Expression, FuseOptionKeyObject, FuseResult } from "fuse.js"; | ||
|
||
export default class CodeFilter extends Filter { | ||
protected static keys: Fuse.FuseOptionKeyObject[] = [{ name: "code", weight: 1 }]; | ||
protected static keys: FuseOptionKeyObject<ICodeSystem_Concept>[] = [{ name: "code", weight: 1 }]; | ||
|
||
protected static queryOptions: QueryOptions = { | ||
matchType: MatchType.exactMatch, | ||
logicalOperator: LogicalOperator.OR, | ||
}; | ||
|
||
public static initSearch(icdCodes: string[]): Fuse.FuseResult<ICodeSystem_Concept>[] { | ||
public static initSearch(icdCodes: string[]): FuseResult<ICodeSystem_Concept>[] { | ||
const queryStr: string = FuseSearch.getQueryString(icdCodes, CodeFilter.queryOptions); | ||
const query: Fuse.Expression[] = CodeFilter.getQuery(queryStr); | ||
const query: Expression[] = CodeFilter.getQuery(queryStr); | ||
return FuseSearch.doSearch(CodeFilter.keys, query); | ||
} | ||
|
||
protected static getQuery(queryStr: string): Fuse.Expression[] { | ||
protected static getQuery(queryStr: string): Expression[] { | ||
return [{ code: queryStr }]; | ||
} | ||
} |
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
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
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