visit.html 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. <style>
  2. table {margin-bottom:20px;table-layout:fixed; border-collapse:collapse; border-spacing:10px}
  3. table.t1 {width:400px; border:1px solid black}
  4. table.t1 th {border:1px solid black;padding:4px;background-color:#e0e0e0}
  5. table.t1 td {text-align:center}
  6. table.t2 {width:800px; border:1px solid black;}
  7. table.t2 th {border:1px solid black;padding:4px;background-color:#e0e0e0}
  8. table.t2 td {border:1px solid black; text-align:center}
  9. div.d1 {text-align:center; width=400px; background-color:#e0e0e0;
  10. font-size: 20px; margin-bottom:20px}
  11. </style>
  12. <div id="staticDataDiv"/>
  13. <!--set static values -->
  14. <table cellspacing="2" cellpadding="5" border="0" id="staticTable">
  15. <tr><td width="200">CRF ID: </td><td><strong id="crfRefId">1583163135258</strong></td></tr>
  16. </table>
  17. <form name="visitForm" id="visitForm">
  18. </form>
  19. <div id="submitDiv"/>
  20. <div id="errorDiv" style="display:none">
  21. <textarea id="errorTxt" cols="95" rows="10"></textarea>
  22. </div>
  23. <div id="debugDiv"/>
  24. <!--<div id="debug" style="display:block">
  25. <textarea cols="95" rows="10" name="formStatus" id="formStatus">
  26. Loading
  27. </textarea>
  28. </div>
  29. -->
  30. <script type="text/javascript">
  31. window.onload = loadScripts;
  32. function loadScripts(){
  33. LABKEY.requiresScript(["crfTecant/crfVisit.js","crfTecant/debug.js"],init);
  34. }
  35. function init(){
  36. let searchParams = new URLSearchParams(window.location.search);
  37. //update this to pick crfRef from url
  38. let crfRef=searchParams.get('entryId');
  39. //let formSetupQuery=searchParams.get('formSetupQuery');
  40. document.getElementById("crfRefId").innerHTML=crfRef;
  41. //config is part of crfVisit.js
  42. //will this change if we are in views?
  43. //config.review=true;
  44. //where to get ParticipantId
  45. //pick this from study properties
  46. let config=crfVisit.config;
  47. config.masterForm="visitForm";
  48. config.document=document;
  49. config.window=window;
  50. config.debugDiv="debugDiv";
  51. config.debugId="formStatus";
  52. config.crfRefId="crfRefId";
  53. config.registrationParticipantIdField="participantCode";
  54. config.containerPath= LABKEY.ActionURL.getContainer();
  55. //config.setupQueryName=formSetupQuery;
  56. config.formId=searchParams.get("formId");
  57. config.role=searchParams.get('role');
  58. crfVisit.generateMasterForm();
  59. }
  60. </script>