File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import { drPatientLib } from "./dr-patient-view-lib.js" ;
22import { exportCSVFile } from "./exportToCSV.js" ;
3+ import { patientLib } from "./patient-lib.js" ;
34/**
45 * Based on
56 * - drApiConnecion
@@ -14,18 +15,21 @@ let infos;
1415window . 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
2630const tableHeaders = {
2731 time : 'Date' ,
28- formLabel : 'Questionnary ' ,
32+ formLabel : 'Set ' ,
2933 formType : 'Type' ,
3034 label : 'Label' ,
3135 value : 'Value' ,
Original file line number Diff line number Diff 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 ">
Original file line number Diff line number Diff 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 "/>
Original file line number Diff line number Diff 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-->
You can’t perform that action at this time.
0 commit comments