You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The module/terminology/code-system directory structure needs a way to be populated.
One idea would be to update the fhir-jq shell function to inspect the jq exit code. It could look for code 32 (code-system unknown) or code 42 (concept_code unknown in a known code-system), and emit a hint for the user suggesting how the missing data should be added.
If a terminology database is available, the missing systems and concept fields could be automatically added. If users were instructed to download terminology from Athena to populate tables in a sqlite database, it would be easy to have the shell function parse the error message for the missing code-system / concept_code, create missing directories, and inject the codes that are failing.
A configuration option could suggest whether the whole set of codes is loaded when a new code-system is added, or whether new codes are added as they are needed.
Example
The current instructions have users define the following in their shell .rc file:
# The fhir-jq installation directory.export FHIR_JQ="${HOME}/.jq/fhir"
mkdir -p "${FHIR_JQ}"### fhir-jq is used just like jq, but it injects the path to the fhir-jq# module when invoked. All other `jq` args are passed along to jq.#functionfhir-jq() {
jq -L "${FHIR_JQ}""${@}"
}
The shell function could be updated to look more like this:
### fhir-jq is used just like jq, but it injects the path to the fhir-jq# module when invoked. All other `jq` args are passed along to jq.#functionfhir-jq() {
jq -L "${FHIR_JQ}""${@}"local jq_exit_code=${?}# Hint when a code is missing from a known code-system.if(( jq_exit_code ==42));thenlocal fixer="${FHIR_JQ}/terminology/bin/add-concept-code.sh"
cat <<EOMTo add the missing concept_code in the error above, run: ${fixer}EOM# Hint when a code-system is missing.elif(( jq_exit_code ==32));thenlocal fixer="${FHIR_JQ}/terminology/bin/add-code-system.sh"
cat <<EOMTo add the missing code-system in the error above, run: ${fixer}EOM# Hint when a generic error is detected.elif(( jq_exit_code !=0));then# etc...else# Default.fi# Return the original exit code.return${jq_exit_code}
}
The text was updated successfully, but these errors were encountered:
The
module/terminology/code-system
directory structure needs a way to be populated.One idea would be to update the
fhir-jq
shell function to inspect thejq
exit code. It could look for code32
(code-system unknown) or code42
(concept_code unknown in a known code-system), and emit a hint for the user suggesting how the missing data should be added.If a terminology database is available, the missing systems and concept fields could be automatically added. If users were instructed to download terminology from Athena to populate tables in a
sqlite
database, it would be easy to have the shell function parse the error message for the missing code-system / concept_code, create missing directories, and inject the codes that are failing.A configuration option could suggest whether the whole set of codes is loaded when a new code-system is added, or whether new codes are added as they are needed.
Example
The current instructions have users define the following in their shell .rc file:
The shell function could be updated to look more like this:
The text was updated successfully, but these errors were encountered: