Skip to content

Commit

Permalink
mh
Browse files Browse the repository at this point in the history
  • Loading branch information
rob-reynolds committed May 18, 2024
1 parent 74492b8 commit b21c879
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions example-smart-app/src/js/example-smart-app.js
Original file line number Diff line number Diff line change
Expand Up @@ -241,10 +241,18 @@ function onReady(smart) {
}
if (questionnaireError) {
console.error("Failed to read questionnaire data:", questionnaireError);
createQuestionnaireForm(defaultQuestionnaire);
}

var patient = patientError ? null : patientData[0];
var questionnaire = questionnaireError ? defaultQuestionnaire : questionnaireData[0];

if (patient) {
createQuestionnaireForm(questionnaire);
document.getElementById("submit-button").onclick = function() {
submitQuestionnaire(patient.id, defaultQuestionnaire);
submitQuestionnaire(patient.id, questionnaire);
};
} else {
console.error("Cannot proceed without patient data.");
}
});
} else {
Expand Down

0 comments on commit b21c879

Please sign in to comment.