Skip to content

Commit 52c0c6e

Browse files
committed
Comestics
1 parent 4efc164 commit 52c0c6e

4 files changed

Lines changed: 15 additions & 10 deletions

File tree

dr-patient-view-controler.js

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { drPatientLib } from "./dr-patient-view-lib.js";
22
import { exportCSVFile } from "./exportToCSV.js";
3+
import { patientLib } from "./patient-lib.js";
34
/**
45
* Based on
56
* - drApiConnecion
@@ -14,18 +15,21 @@ let infos;
1415
window.onload = async (event) => {
1516
const { patientApiEndpoint, questionaryId } = getRequestFrormApiEndPoint();
1617
infos = await drPatientLib.setRefresh(patientApiEndpoint, questionaryId, refresh)
17-
// -- home button
18-
document.getElementById('home-button').href= 'dr.html?questionaryId=' + questionaryId;
19-
20-
// -- set patient Id
21-
const username = infos.user.username;
22-
document.getElementById('patient-label').innerHTML = username;
18+
// -- home button
19+
document.getElementById('home-button').href= 'dr.html?questionaryId=' + questionaryId;
2320

21+
// - form title
22+
const formTitle = document.getElementById('card-questionnary-details-title');
23+
formTitle.innerHTML = patientLib.getFormTitle(questionaryId);
24+
25+
// -- set patient Id
26+
const username = infos.user.username;
27+
document.getElementById('patient-label').innerHTML = username;
2428
}
2529

2630
const tableHeaders = {
2731
time: 'Date',
28-
formLabel: 'Questionnary',
32+
formLabel: 'Set',
2933
formType: 'Type',
3034
label: 'Label',
3135
value: 'Value',

dr-patient-view.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ <h1>Demo Form - Dr's Patient View</h1>
2222
<a href="dr.html" class="btn btn-primary" id="home-button">HOME</a>
2323
<div class="card">
2424
<div class="card-patient">
25-
<h2> Patient: <span id="patient-label">Patient X</span></h2>
25+
<h2 class="card-title"> Questionnary: <span id="card-questionnary-details-title"></span></h2>
26+
<h2 class="card-title"> Patient: <span id="patient-label">Patient X</span></h2>
2627
</div>
2728
</div>
2829
<div class="card" id="data-view">

patient-history.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ <h1>Demo Form - Patient's page</h1>
2626
<div class="card" id="card-content" >
2727
<form id="form-history">
2828
<h2 class="card-title"> Questionnary: <span id="card-questionnary-details-title"></span></h2>
29-
<h3 class="card-title"> Set: <span id="card-questionnary-details-question-set">Historical Data</span></h3>
29+
<h3 class="card-title"> Question set: <span id="card-questionnary-details-question-set">Historical Data</span></h3>
3030
<div class="form-group">
3131
<label for="form-date">Entry date</label>
3232
<input type="date" id="form-date" class="form-control"/>

patient-profile.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ <h1>Demo Form - Patient's page</h1>
2626
<div class="card" id="card-content">
2727
<form id="form-profile">
2828
<h2 class="card-title"> Questionnary: <span id="card-questionnary-details-title"></span></h2>
29-
<h3 class="card-title"> Set: <span id="card-questionnary-details-question-set">Profile</span></h3>
29+
<h3 class="card-title"> Question set: <span id="card-questionnary-details-question-set">Profile</span></h3>
3030
<div class="form-group">
3131
<div class="input-group" id="inputs-list">
3232
<!-- HERE WILL GO THE INPUTS-->

0 commit comments

Comments
 (0)