diff --git a/src/App.jsx b/src/App.jsx index fb92f96e..bf1aed98 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -273,7 +273,7 @@ export default class App extends Component { }); } }); - console.log(fullBundle); + console.log(allLibrariesResults); this.setState({ bundle: fullBundle, cqlPrepopulationResults: allLibrariesResults, diff --git a/src/components/QuestionnaireForm/QuestionnaireForm.jsx b/src/components/QuestionnaireForm/QuestionnaireForm.jsx index f08db2b6..f992e25c 100644 --- a/src/components/QuestionnaireForm/QuestionnaireForm.jsx +++ b/src/components/QuestionnaireForm/QuestionnaireForm.jsx @@ -668,9 +668,9 @@ export default class QuestionnaireForm extends Component { system = "RxNorm" } - if (system.length > 0) { - displayText = displayText + ' - ' + system + ' - ' + v.code - } + // if (system.length > 0) { + // displayText = displayText + ' - ' + system + ' - ' + v.code + // } } return { diff --git a/src/elmExecutor/buildPopulatedResourceBundle.js b/src/elmExecutor/buildPopulatedResourceBundle.js index eccc28db..ef7b2442 100644 --- a/src/elmExecutor/buildPopulatedResourceBundle.js +++ b/src/elmExecutor/buildPopulatedResourceBundle.js @@ -80,6 +80,21 @@ function doSearch(smart, type, fhirVersion, request, callback) { // unknown version break; } + break; + case "MedicationStatement": + smart.patient.request(type, {resolveReferences: 'medicationReference', flat: true, graph: false}).then((result) =>{ + let finalResult = [] + // TODO: This system should be untangled, reference resolution and resource gathering shouldn't be done separately + if(result && result.data){ + if(result.references) { + Object.keys(result.references).forEach((e)=>{ + finalResult.push(result.references[e]) + }) + } + callback(finalResult); + } + }) + break; } // If this is for Epic, there are some specific modifications needed for the queries to work properly @@ -126,6 +141,7 @@ function doSearch(smart, type, fhirVersion, request, callback) { Object.keys(q).forEach((parameter)=>{ query.set(parameter, q[parameter]); }); + if( usePatient ) { smart.patient.request(`${type}?${query}`) .then(processSuccess(smart, [], callback), processError(smart, callback));