-
Notifications
You must be signed in to change notification settings - Fork 27
feat: Add ImplementationGuides compile method #38
Conversation
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.
Looks good, one nitpick about type definition for UNSUPPORTED_SEARCH_PARAMS
. Also remember to update the version of the interface package. Looks like GH action Unit Tests and Linting threw an error for it.
); | ||
}; | ||
|
||
const UNSUPPORTED_SEARCH_PARAMS = [ |
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.
Should this be initialized as an array of string?
const UNSUPPORTED_SEARCH_PARAMS: string[]
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.
Doing so won't change the "initialization" of the variable. The difference would be declaring the type explicitly instead of letting TS infer it.
In many cases declaring types explicitly makes code more readable, but declaring types explicitly all the time can be overly verbose and is sort of a waste of the type inference capabilities of TS.
IMO here it's obvious that it is an array of strings since it's a small, fixed, array declared on that same line.
Description of changes:
Mostly just refactoring the old
.js
compiler script into.ts
to use it as the implementation of theImplementationGuides
interfacecompile
method. The functionality of the compiler remains unchanged.We are still bundling the FHIR R4 resources into the search package, so we retain
scripts/searchParamsCompiler/run.ts
as a convenient way to regenerate our schema files if we make changes the grammar/compiler.Testing:
re-compiled the search params for fhir 4.0.1 and 3.0.1. There were no changes to the output, as expected.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.