Skip to content

Commit

Permalink
Merge pull request #67 from mcode/fix-null-alert
Browse files Browse the repository at this point in the history
fixes null alert due to https/http variance in vsac
  • Loading branch information
avirgulto authored Jan 11, 2024
2 parents ccd5785 + 8454ff0 commit b9e3618
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions src/views/Questionnaire/SmartApp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -525,10 +525,17 @@ export function SmartApp(props: SmartAppProps) {
// iterate over valueSet definitions
elm.library.valueSets.def.forEach(valueSetDef => {
// find FHIR value set artifact
const valueSetDefId = valueSetDef.id.replace(/https:\/\//, 'http://'); // vsac only returns urls with http in the resource
const valueSet = artifacts.valueSets.find(
valueSet => valueSet.id == valueSetDefId || valueSet.url == valueSetDefId
);
const valueSetDefId = valueSetDef.id;
const valueSet = artifacts.valueSets.find(valueSet => {
if (valueSet.id && valueSetDefId.includes(valueSet.id)) {
return true;
} else {
if (valueSet.url && valueSetDefId.includes(valueSet.url)) {
return true;
}
}
return false;
});
if (valueSet != null) {
// make sure it has an expansion
if (valueSet.expansion != null) {
Expand Down

0 comments on commit b9e3618

Please sign in to comment.