Skip to content

Commit 532d857

Browse files
committed
In entry page only display first form
1 parent aadffa1 commit 532d857

3 files changed

Lines changed: 8 additions & 6 deletions

File tree

dr-controler.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ async function setPatientList(questionaryId) {
7373
const table = document.getElementById('patients-table');
7474
// clear table
7575
table.innerHTML = '';
76-
const fields = drLib.getFields(questionaryId);
76+
const fields = drLib.getFirstFormFields(questionaryId);
7777
const headers = {
7878
status: 'Status',
7979
username: 'Username'

dr-lib.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export const drLib = {
77
showLoginButton,
88
getSharingToken,
99
getPatientsList,
10-
getFields,
10+
getFirstFormFields,
1111
getQuestionnaires,
1212
};
1313

@@ -193,10 +193,12 @@ async function getPatientDetails(questionnaryId, patientEvent) {
193193
}
194194

195195
/**
196-
* get the list of rows for the table
196+
* get the list of rows for the initial table
197197
*/
198-
function getFields(questionaryId) {
199-
return dataDefs.questionnaires[questionaryId].forms.profile.content;
198+
function getFirstFormFields(questionaryId) {
199+
const forms = dataDefs.questionnaires[questionaryId].forms;
200+
const firstForm = Object.values(dataDefs.questionnaires[questionaryId].forms)[0];
201+
return firstForm.content;
200202
}
201203

202204
const dataFieldsCaches = {};

dr.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ <h2 class="card-title">Patients</h2>
4747
<button id="button-download" class="btn btn-secondary">Download</button>
4848
<table id='patients-table' class="table">
4949
<thead>
50-
<!-- will be filled by setPatientList-->
50+
<!-- will be filled by setPatientList Headers-->
5151
</thead>
5252
<tbody>
5353
<!-- will be filled by setPatientList-->

0 commit comments

Comments
 (0)