Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/common.js.ts
Original file line number Diff line number Diff line change
Expand Up @@ -250,19 +250,22 @@ function getErrorOrWarningFull(issue: OperationOutcomeIssue) {
}
return error;
}
// raiseWarning function allows the custom raising (true) or ignoring (false) of warnings when testing files
function raiseWarning(issue: OperationOutcomeIssue, failOnWarning:boolean): boolean {
if (issue != undefined && issue.diagnostics != undefined) {

//THESE WARNINGS SHOULD ALWAYS ERROR
if (issue.diagnostics.includes('incorrect type for element')) {
return true;
}
// unauthorised requests
if (issue.diagnostics.includes('Error HTTP 401')) {
return true;
}

// THESE WARNINGS SHOULD ALWAYS BE SILENTLY IGNORED
//if (issue.diagnostics.includes('Code system https://dmd.nhs.uk/ could not be resolved.')) return false
// Issue with hapi giving incorrect error when one code is from the valueset, but another is not. See https://github.com/hapifhir/hapi-fhir/issues/4152
if (issue.diagnostics.includes('Inappropriate CodeSystem URL') && issue.diagnostics.includes('for ValueSet: http://hl7.org/fhir/ValueSet/all-languages')) {
return false
}
Expand All @@ -281,12 +284,13 @@ function raiseWarning(issue: OperationOutcomeIssue, failOnWarning:boolean): bool
// if error not handled above, return error if FailOnWarning is true
return failOnWarning;
}
// raiseError function allows the custom raising (true) or ignoring (false) of errors when testing files
function raiseError(issue: OperationOutcomeIssue) : boolean {
if (issue != undefined) {
if (issue.diagnostics != undefined) {
// List of errors to ALWAYS ignore

// languages, known issue!
// Issue with hapi giving incorrect error when one code is from the valueset, but another is not. See https://github.com/hapifhir/hapi-fhir/issues/4152
if (issue.diagnostics.includes('Inappropriate CodeSystem URL') && issue.diagnostics.includes('for ValueSet: http://hl7.org/fhir/ValueSet/all-languages')) {
return false
}
Expand Down