function clientLogicInit() { $(".questionTrigger").change(function() { subQuestionTrigger(this.id); }); $(".symptomTrigger").change(function() { symptomTrigger(this.id); }); } function clientLogicGetFormSettings(attr) { if (typeof(attr.pageParam) == "undefined") { pageParam = new Array(); } else { pageParam = attr.pageParam; } if (typeof(attr.data) == "undefined") { data = new Array(); } else { data = attr.data; } pageParam["includeHomeButton"] = data.includeHomeButton; if (pageParam["includeHomeButton"] == true) { pageParam["homeButtonURL"] = data.homeButtonURL; pageParam["homeButtonText"] = data.homeButtonText; } if (data.enableOutbreak == "Y") { pageParam["enableOutbreak"] = true; $("#reportingSymptoms-general-outbreak-container").show(); $("#returnToWork-questions-outbreakContainer").show(); } else { pageParam["enableOutbreak"] = false; } if (data.enableOtherCovidDetails == "Y") { pageParam["enableOtherCovidDetails"] = true; } else { pageParam["enableOtherCovidDetails"] = false; } $("#label-reportType-reportingSymptoms").html(escapeHTML(data.reportingSymptomsLabel)); $("#label-reportType-returnToWork").html(escapeHTML(data.returnToWorkLabel)); return pageParam; } function pageControl(pageAction) { if (pageParam["currentPage"] == "introduction") { if (pageAction == "next") { //Verify they have located their employee record if (pageParam["employeeFound"] !== true) { if ((pageParam["employeeLookupType"] == "H") || (pageParam["employeeLookupType"] == "N")) { //Hybrid or None pageStatusError("Please submit your employee record"); } else { //Parklane Lookup pageStatusError("Please locate your employee record"); } return; } if ((typeof(pageParam["departmentPostionFieldsRequired"]) != "undefined") && (pageParam["departmentPostionFieldsRequired"] == true)) { if ($("#loginPanel-statedDepartment").val() == "") { pageStatusError("You must indicate your department"); return; } if ($("#loginPanel-statedPosition").val() == "") { pageStatusError("You must indicate your position"); return; } } //Verify whether they have agreed or not if ($("#reportAcknowledgement").prop("checked") == false) { pageStatusError("You must agree to continue with this form"); return; } disableButtonControl(true); pageParam["currentPage"] = "reportType"; $("#seriiPanel-intro").slideUp("fast"); $("#seriiPanel-acknowledgement").slideUp("fast"); if ((typeof(pageParam["departmentPostionFieldsRequired"]) != "undefined") && (pageParam["departmentPostionFieldsRequired"] == true)) { $("#seriiPanel-employeeAdditionalFields").slideUp("fast"); } $("#seriiPanel-reportType").slideDown("fast"); disableButtonControl(false); } if (pageAction == "previous") { //You can't return from the first page. return; } } else if (pageParam["currentPage"] == "reportType") { if (pageAction == "next") { //Make sure they select a report type if (typeof($("[name='reportType']:checked").val()) == "undefined") { pageStatusError("Please select one of the above"); return; } if ($("[name='reportType']:checked").val() == "reportingSymptoms") { disableButtonControl(true); pageParam["currentPage"] = "reportingSymptoms-covid19"; $("#seriiPanel-reportType").fadeOut("fast", function() { $("#seriiPanel-reportingSymptoms-covid19").fadeIn("fast"); disableButtonControl(false); }); } if ($("[name='reportType']:checked").val() == "returnToWork") { disableButtonControl(true); pageParam["currentPage"] = "returnToWork-symptom"; $("#seriiPanel-reportType").fadeOut("fast", function() { $("#seriiPanel-returnToWork-symptom").fadeIn("fast"); disableButtonControl(false); }); } } if (pageAction == "previous") { disableButtonControl(true); pageParam["currentPage"] = "introduction" $("#seriiPanel-reportType").slideUp("fast"); $("#seriiPanel-intro").slideDown("fast"); $("#seriiPanel-acknowledgement").slideDown("fast"); if ((typeof(pageParam["departmentPostionFieldsRequired"]) != "undefined") && (pageParam["departmentPostionFieldsRequired"] == true)) { $("#seriiPanel-employeeAdditionalFields").slideDown("fast"); } disableButtonControl(false); } } //REPORTING SYMTPOMS PAGES else if (pageParam["currentPage"] == "reportingSymptoms-covid19") { if (pageAction == "next") { //If they have not selected wither they have visited a country if (typeof($("[name='reportingSymptoms-covid19-foreignTravel-yn']:checked").val()) == "undefined") { pageStatusError("Please indicate if you have travelled outside of Canada within the last 14 days"); return; } if (typeof($("[name='reportingSymptoms-covid19-contact-yn']:checked").val()) == "undefined") { pageStatusError("Please indicate if you have been in contact with known individuals that have tested positive for COVID-19"); return; } if (typeof($("[name='reportingSymptoms-covid19-test-yn']:checked").val()) == "undefined") { pageStatusError("Please indicate if you have been tested for COVID-19"); return; } if ($("[name='reportingSymptoms-covid19-test-yn']:checked").val() == "y") { if ($("#reportingSymptoms-covid19-testReason").val() == "") { pageStatusError("Please indicate the reason for getting a COVID-19 test"); return; } if ($("#reportingSymptoms-covid19-testResult").val() == "") { pageStatusError("Please indicate the result of COVID-19 test. If you have not yet obtained a result, select 'Pending'"); return; } } disableButtonControl(true); pageParam["currentPage"] = "reportingSymptoms-respiratory"; $("#seriiPanel-reportingSymptoms-covid19").fadeOut("fast", function() { $("#seriiPanel-reportingSymptoms-respiratory").fadeIn("fast"); disableButtonControl(false); }); } if (pageAction == "previous") { disableButtonControl(true); pageParam["currentPage"] = "reportType" $("#seriiPanel-reportingSymptoms-covid19").fadeOut("fast", function() { $("#seriiPanel-reportType").fadeIn("fast") disableButtonControl(false); }); } } else if (pageParam["currentPage"] == "reportingSymptoms-respiratory") { if (pageAction == "next") { if ($("#seriiPanel-reportingSymptoms-respiratory [type='checkbox']:checked").length) { if ($("#reportingSymptoms-respiratory-earliestSymptoms").val() == "") { pageStatusError("Please indicate the earliest date of respiratory symptom onset"); return; } //Make sure it's a valid date if (checkLocalDate($("#reportingSymptoms-respiratory-earliestSymptoms").val()) == false) { pageStatusError("The earliest date of respiratory symptom onset is not valid. It must be in " + pageParam["supportCode"]["dateFormat"] + " format"); return; } //Make sure it's not a future date if (checkFutureDate($("#reportingSymptoms-respiratory-earliestSymptoms").val()) == true) { pageStatusError("The earliest date of respiratory symptom onset cannot be a future date"); return; } } disableButtonControl(true); pageParam["currentPage"] = "reportingSymptoms-gastrointestinal"; $("#seriiPanel-reportingSymptoms-respiratory").fadeOut("fast", function() { $("#seriiPanel-reportingSymptoms-gastrointestinal").fadeIn("fast") disableButtonControl(false); }); } if (pageAction == "previous") { disableButtonControl(true); pageParam["currentPage"] = "reportingSymptoms-covid19" $("#seriiPanel-reportingSymptoms-respiratory").fadeOut("fast", function() { $("#seriiPanel-reportingSymptoms-covid19").fadeIn("fast") disableButtonControl(false); }); } } else if (pageParam["currentPage"] == "reportingSymptoms-gastrointestinal") { if (pageAction == "next") { if ($("#seriiPanel-reportingSymptoms-gastrointestinal [type='checkbox']:checked").length) { if ($("#reportingSymptoms-gastrointestinal-earliestSymptoms").val() == "") { pageStatusError("Please indicate the earliest date of gastrointestinal symptom onset"); return; } //Make sure it's a valid date if (checkLocalDate($("#reportingSymptoms-gastrointestinal-earliestSymptoms").val()) == false) { pageStatusError("The earliest date of gastrointestinal symptom onset is not valid. It must be in " + pageParam["supportCode"]["dateFormat"] + " format"); return; } //Make sure it's not a future date if (checkFutureDate($("#reportingSymptoms-gastrointestinal-earliestSymptoms").val()) == true) { pageStatusError("The earliest date of gastrointestinal symptom onset cannot be a future date"); return; } } disableButtonControl(true); pageParam["currentPage"] = "reportingSymptoms-general"; $("#seriiPanel-reportingSymptoms-gastrointestinal").fadeOut("fast", function() { $("#seriiPanel-reportingSymptoms-general").fadeIn("fast") disableButtonControl(false); }); } if (pageAction == "previous") { disableButtonControl(true); pageParam["currentPage"] = "reportingSymptoms-respiratory" $("#seriiPanel-reportingSymptoms-gastrointestinal").fadeOut("fast", function() { $("#seriiPanel-reportingSymptoms-respiratory").fadeIn("fast") disableButtonControl(false); }); } } else if (pageParam["currentPage"] == "reportingSymptoms-general") { if (pageAction == "next") { if ($("#reportingSymptoms-general-otherCovidSymptoms").prop("checked")) { if ((pageParam["enableOtherCovidDetails"] == true) && ($("#reportingSymptoms-general-otherCovidSymptomsList").val() == "")) { pageStatusError("Please list your other COVID-19 symptoms"); return; } } disableButtonControl(true); pageParam["currentPage"] = "reportingSymptoms-other"; $("#seriiPanel-reportingSymptoms-general").fadeOut("fast", function() { $("#seriiPanel-reportingSymptoms-other").fadeIn("fast") disableButtonControl(false); }); } if (pageAction == "previous") { disableButtonControl(true); pageParam["currentPage"] = "reportingSymptoms-gastrointestinal" $("#seriiPanel-reportingSymptoms-general").fadeOut("fast", function() { $("#seriiPanel-reportingSymptoms-gastrointestinal").fadeIn("fast") disableButtonControl(false); }); } } else if (pageParam["currentPage"] == "reportingSymptoms-other") { if (pageAction == "next") { if ($("#seriiPanel-reportingSymptoms-otherSymptomContainer [type='checkbox']:checked").length) { if ($("#reportingSymptoms-other-earliestSymptoms").val() == "") { pageStatusError("Please indicate the earliest date of the symptom onset"); return; } //Make sure it's a valid date if (checkLocalDate($("#reportingSymptoms-other-earliestSymptoms").val()) == false) { pageStatusError("The earliest date of the symptom onset is not valid. It must be in " + pageParam["supportCode"]["dateFormat"] + " format"); return; } //Make sure it's not a future date if (checkFutureDate($("#reportingSymptoms-other-earliestSymptoms").val()) == true) { pageStatusError("The earliest date of the symptom onset cannot be a future date"); return; } } //Submit and go to summary page disableButtonControl(true); $("#seriiPanel-reportingSymptoms-other").fadeOut("fast") submitData(); //submitData function will handle page change return; } if (pageAction == "previous") { disableButtonControl(true); pageParam["currentPage"] = "reportingSymptoms-general" $("#seriiPanel-reportingSymptoms-other").fadeOut("fast", function() { $("#seriiPanel-reportingSymptoms-general").fadeIn("fast") disableButtonControl(false); }); } } //RETURN TO WORK PAGES else if (pageParam["currentPage"] == "returnToWork-symptom") { if (pageAction == "next") { if ($("#returnToWork-symptom-otherCovidSymptoms").prop("checked")) { if ((pageParam["enableOtherCovidDetails"] == true) && ($("#returnToWork-symptom-otherCovidSymptomsList").val() == "")) { pageStatusError("Please list your other COVID-19 symptoms"); return; } } disableButtonControl(true); prepareReturnToWorkQuestions(); pageParam["currentPage"] = "returnToWork-questions"; $("#seriiPanel-returnToWork-symptom").fadeOut("fast", function() { $("#seriiPanel-returnToWork-questions").fadeIn("fast"); disableButtonControl(false); }); } if (pageAction == "previous") { disableButtonControl(true); pageParam["currentPage"] = "reportType" $("#seriiPanel-returnToWork-symptom").fadeOut("fast", function() { $("#seriiPanel-reportType").fadeIn("fast") disableButtonControl(false); }); } } else if (pageParam["currentPage"] == "returnToWork-questions") { if (pageAction == "next") { if (pageParam["returnToWork-hasSymptoms"] == true) { if (typeof($("[name='returnToWork-questions-symptomFree24Hours']:checked").val()) == "undefined") { pageStatusError("Please indicate if you have been symptom free for 24 hours"); return; } } if (typeof($("[name='returnToWork-questions-quarantine']:checked").val()) == "undefined") { pageStatusError("Please indicate if you were required to Self-Isolate or Quarantine"); return; } else if ($("[name='returnToWork-questions-quarantine']:checked").val() == "y") { if ($("#returnToWork-questions-quarantineStart").val() == "") { pageStatusError("Please indicate when you entered Self-Isolation / Quarantine"); return; } //Make sure it's a valid date if (checkLocalDate($("#returnToWork-questions-quarantineStart").val()) == false) { pageStatusError("The date you entered Self-Isolation / Quarantine is not valid. It must be in " + pageParam["supportCode"]["dateFormat"] + " format"); return; } //Make sure it's not a future date if (checkFutureDate($("#returnToWork-questions-quarantineStart").val()) == true) { pageStatusError("The date you entered Self-Isolation / Quarantine cannot be a future date"); return; } if ($("#returnToWork-questions-quarantineReasonList [type='checkbox']:checked").length == 0) { pageStatusError("Please indicate the reason for Self-Isolation / Quarantine"); return; } if (typeof($("[name='returnToWork-questions-quarantineComplete']:checked").val()) == "undefined") { pageStatusError("Please indicate if you have completed Self-Isolation / Quarantine"); return; } } if (typeof($("[name='returnToWork-questions-covid19Test']:checked").val()) == "undefined") { pageStatusError("Please indicate if you have been tested for COVID-19"); return; } else if ($("[name='returnToWork-questions-covid19Test']:checked").val() == "y") { if ($("#returnToWork-questions-covid19-testResult").val() == "") { pageStatusError("Please indicate the result of COVID-19 test. If you have not yet obtained a result, select 'Pending'"); return; } if ($("#returnToWork-questions-covid19-testResult").val() == "Negative") { if (typeof($("[name='returnToWork-questions-covid19TestResultDocumentation']:checked").val()) == "undefined") { pageStatusError("Please indicate if you can provide documentation of the COVID-19 test result"); return; } } } if (pageParam["enableOutbreak"] == true) { if (typeof($("[name='returnToWork-questions-outbreak']:checked").val()) == "undefined") { pageStatusError("Please indicate if you work in a unit that has been declared to be in an outbreak"); return; } } //ready for Submission disableButtonControl(true); $("#seriiPanel-returnToWork-questions").fadeOut("fast") submitData(); //SubmitData handles the page control and action buttons. return; } if (pageAction == "previous") { disableButtonControl(true); pageParam["currentPage"] = "returnToWork-symptom" $("#seriiPanel-returnToWork-questions").fadeOut("fast", function() { $("#seriiPanel-returnToWork-symptom").fadeIn("fast") disableButtonControl(false); }); } } //SUMMARY PAGES else if (pageParam["currentPage"] == "summary-acknowledged-employee") { if (pageAction == "next") { return; //nowhere to go after a submission is complete } if (pageAction == "previous") { return; //can't return after a submission is complete } } //If there was a previous error message, clear it out $("#pageStatus").fadeOut("fast",function() { $("#pageStatus").html(""); }); actionButtonController() } function actionButtonController() { displayForward = true; forwardText = "Next >>" displayBack = true; backText = "<< Previous" if (pageParam["currentPage"] == "introduction") { displayBack = false; } else if (pageParam["currentPage"] == "reportType") {} else if (pageParam["currentPage"] == "reportingSymptoms-respiratory") {} else if (pageParam["currentPage"] == "reportingSymptoms-gastrointestinal") {} else if (pageParam["currentPage"] == "reportingSymptoms-general") {} else if (pageParam["currentPage"] == "reportingSymptoms-other") { forwardText = "View Recommendations" } else if (pageParam["currentPage"] == "returnToWork-symptoms") {} else if (pageParam["currentPage"] == "returnToWork-questions") { forwardText = "View Recommendations" } else if (pageParam["currentPage"] == "summary-acknowledged-employee") { displayForward = false; displayBack = false; } if (displayForward == true) { $("#actionButton-next").val(forwardText); $("#actionButton-next").removeClass("hidden"); } else { $("#actionButton-next").addClass("hidden"); } if (displayBack == true) { $("#actionButton-previous").val(backText); $("#actionButton-previous").removeClass("hidden"); } else { $("#actionButton-previous").addClass("hidden"); } if ((pageParam["currentPage"] == "summary-acknowledged-employee") && (pageParam["includeHomeButton"] == true)) { //In fact, clear out the action button panel at this point and put an exit button $("#seriiPanel-actionButtons").html("
"+pageParam["homeButtonText"]+"
"); } } function subQuestionTrigger(selectedElement) { //Subquestion Trigger //Certain Questions will have subquestions assigned to them (such as asking for a date if a symptom is Yes) //Reporting Symptoms if (selectedElement == "reportingSymptoms-covid19-test-yn-y") { $("#reportingSymptoms-covid19-detailsContainer").slideDown("fast"); $("#reportingSymptoms-covid19-detailsContainer").focus(); } if (selectedElement == "reportingSymptoms-covid19-test-yn-n") { $("#reportingSymptoms-covid19-detailsContainer").slideUp("fast"); } if ($("#" + selectedElement).hasClass("respiratoryTrigger")) { if ($("#seriiPanel-reportingSymptoms-respiratory [type='checkbox']:checked").length) { $("#reportingSymptoms-respiratory-earliestSymptomsContainer").slideDown("fast"); } else { $("#reportingSymptoms-respiratory-earliestSymptomsContainer").slideUp("fast"); } } if ($("#" + selectedElement).hasClass("gastrointestinalTrigger")) { if ($("#seriiPanel-reportingSymptoms-gastrointestinal [type='checkbox']:checked").length) { $("#reportingSymptoms-gastrointestinal-earliestSymptomsContainer").slideDown("fast"); } else { $("#reportingSymptoms-gastrointestinal-earliestSymptomsContainer").slideUp("fast"); } } if (selectedElement == "reportingSymptoms-general-otherCovidSymptoms") { if (pageParam["enableOtherCovidDetails"] == true) { if ($("#reportingSymptoms-general-otherCovidSymptoms").prop("checked")) { $("#reportingSymptoms-general-otherCovidSymptomsContainer").slideDown("fast"); } else { $("#reportingSymptoms-general-otherCovidSymptomsContainer").slideUp("fast"); } } } if ($("#" + selectedElement).hasClass("otherTrigger")) { if ($("#seriiPanel-reportingSymptoms-otherSymptomContainer [type='checkbox']:checked").length) { $("#reportingSymptoms-other-earliestSymptomsContainer").slideDown("fast"); } else { $("#reportingSymptoms-other-earliestSymptomsContainer").slideUp("fast"); } } //Return To Work if (selectedElement == "returnToWork-symptom-otherCovidSymptoms") { if (pageParam["enableOtherCovidDetails"] == true) { if ($("#returnToWork-symptom-otherCovidSymptoms").prop("checked")) { $("#returnToWork-symptom-otherCovidSymptomsContainer").slideDown("fast"); } else { $("#returnToWork-symptom-otherCovidSymptomsContainer").slideUp("fast"); } } } if (selectedElement == "returnToWork-questions-quarantine-y") { $("#returnToWork-questions-quarantineContainer").slideDown("fast"); } if (selectedElement == "returnToWork-questions-quarantine-n") { $("#returnToWork-questions-quarantineContainer").slideUp("fast"); } if (selectedElement == "returnToWork-questions-covid19Test-y") { $("#returnToWork-questions-covid19TestContainer").slideDown("fast"); } if (selectedElement == "returnToWork-questions-covid19Test-n") { $("#returnToWork-questions-covid19TestContainer").slideUp("fast"); } if (selectedElement == "returnToWork-questions-covid19-testResult") { if ($("#returnToWork-questions-covid19-testResult").val() == "Negative") { $("#returnToWork-questions-covid19TestResultDocumentationContainer").slideDown("fast"); } else { $("#returnToWork-questions-covid19TestResultDocumentationContainer").slideUp("fast"); } } } function prepareReturnToWorkQuestions() { symptomText = ""; if ($("#returnToWork-symptom-fever").prop("checked")) { symptomText += "Fever, " } if ($("#returnToWork-symptom-cough").prop("checked")) { symptomText += "New or worsening cough, " } if ($("#returnToWork-symptom-soreThroat").prop("checked")) { symptomText += "Sore throat or difficulty swallowing, " } if ($("#returnToWork-symptom-shortnessOfBreath").prop("checked")) { symptomText += "Shortness of breath, " } if ($("#returnToWork-symptom-vomiting").prop("checked")) { symptomText += "Vomiting, " } if ($("#returnToWork-symptom-diarrhea").prop("checked")) { symptomText += "Diarrhea, " } if ($("#returnToWork-symptom-aches").prop("checked")) { symptomText += "Myalgias or body aches, " } if ($("#returnToWork-symptom-runnyNose").prop("checked")) { symptomText += "Runny nose, " } if ($("#returnToWork-symptom-severeHeadache").prop("checked")) { symptomText += "Severe Headache, " } if ($("#returnToWork-symptom-fatigue").prop("checked")) { symptomText += "Unexplained fatigue or malaise, " } if ($("#returnToWork-symptom-lossTasteOrSmell").prop("checked")) { symptomText += "Decrease or loss of sense of taste or smell, " } if ($("#returnToWork-symptom-rashColdSores").prop("checked")) { symptomText += "Rash or Open Cold Sores, " } if ($("#returnToWork-symptom-conjunctivitis").prop("checked")) { symptomText += "Conjunctivitis / Pink Eye, " } if ($("#returnToWork-symptom-otherCovidSymptoms").prop("checked")) { if (pageParam["enableOtherCovidDetails"] == true) { symptomText += "Other COVID-19 symptoms not listed: " otherCovidText = $("#returnToWork-symptom-otherCovidSymptomsList").val(); otherCovidText = otherCovidText.trim(); otherCovidText = otherCovidText.replace(/(?:\r\n|\r|\n)/g, ', '); symptomText += otherCovidText + ", " } else { symptomText += "Other COVID-19 symptoms not listed, " } } if (symptomText != "") { //Each symptom has a separator attached to it. Strip off the last ", " at the end of the symptom list. symptomText = symptomText.substr(0, symptomText.lastIndexOf(",")); $("#returnToWork-questions-symptomFree24HourText").html(symptomText); $("#returnToWork-questions-symptomFree24HourContainer").removeClass("hidden") pageParam["returnToWork-hasSymptoms"] = true; } else { $("#returnToWork-questions-symptomFree24HourText").html(""); $("#returnToWork-questions-symptomFree24HourContainer").addClass("hidden") pageParam["returnToWork-hasSymptoms"] = false; } } function generateSubmissionDetails() { var submissionDetails = new Array(); submissionDetails["acknowledgement"] = ($("#reportAcknowledgement").prop("checked")) ? "y" : "n"; //If they did not acknowledge, this will be the only value as part of the submission. if (submissionDetails["acknowledgement"] == "y") { if ((typeof(pageParam["departmentPostionFieldsRequired"]) != "undefined") && (pageParam["departmentPostionFieldsRequired"] == true)) { //Since their employee record was not found, Include the stated department and position values. submissionDetails["employeeDetails-reportedDepartment"] = $("#loginPanel-statedDepartment").val(); submissionDetails["employeeDetails-reportedPosition"] = $("#loginPanel-statedPosition").val(); } //Next, get the report type submissionDetails["reportType"] = $("[name='reportType']:checked").val(); //Reporting Symptoms if (submissionDetails["reportType"] == "reportingSymptoms") { submissionDetails["reportingSymptoms-covid19-foreignTravel"] = $("[name='reportingSymptoms-covid19-foreignTravel-yn']:checked").val(); submissionDetails["reportingSymptoms-covid19-contact"] = $("[name='reportingSymptoms-covid19-contact-yn']:checked").val(); submissionDetails["reportingSymptoms-covid19-test"] = $("[name='reportingSymptoms-covid19-test-yn']:checked").val(); if ($("[name='reportingSymptoms-covid19-test-yn']:checked").val() == "y") { submissionDetails["reportingSymptoms-covid19-testReason"] = $("#reportingSymptoms-covid19-testReason").val(); submissionDetails["reportingSymptoms-covid19-testResult"] = $("#reportingSymptoms-covid19-testResult").val(); } //Symptoms submissionDetails["reportingSymptoms-respiratory-fever"] = ($("#reportingSymptoms-respiratory-fever").prop("checked")) ? "y" : "n"; submissionDetails["reportingSymptoms-respiratory-cough"] = ($("#reportingSymptoms-respiratory-cough").prop("checked")) ? "y" : "n"; submissionDetails["reportingSymptoms-respiratory-soreThroat"] = ($("#reportingSymptoms-respiratory-soreThroat").prop("checked")) ? "y" : "n"; submissionDetails["reportingSymptoms-respiratory-shortnessOfBreath"] = ($("#reportingSymptoms-respiratory-shortnessOfBreath").prop("checked")) ? "y" : "n"; if ($("#seriiPanel-reportingSymptoms-respiratory [type='checkbox']:checked").length) { submissionDetails["reportingSymptoms-respiratory-earliestSymptoms"] = localDateToServer($("#reportingSymptoms-respiratory-earliestSymptoms").val()); } submissionDetails["reportingSymptoms-gastrointestinal-vomiting"] = ($("#reportingSymptoms-gastrointestinal-vomiting").prop("checked")) ? "y" : "n"; submissionDetails["reportingSymptoms-gastrointestinal-diarrhea"] = ($("#reportingSymptoms-gastrointestinal-diarrhea").prop("checked")) ? "y" : "n"; if ($("#seriiPanel-reportingSymptoms-gastrointestinal [type='checkbox']:checked").length) { submissionDetails["reportingSymptoms-gastrointestinal-earliestSymptoms"] = localDateToServer($("#reportingSymptoms-gastrointestinal-earliestSymptoms").val()); } submissionDetails["reportingSymptoms-general-aches"] = ($("#reportingSymptoms-general-aches").prop("checked")) ? "y" : "n"; submissionDetails["reportingSymptoms-general-runnyNose"] = ($("#reportingSymptoms-general-runnyNose").prop("checked")) ? "y" : "n"; submissionDetails["reportingSymptoms-general-chills"] = ($("#reportingSymptoms-general-chills").prop("checked")) ? "y" : "n"; submissionDetails["reportingSymptoms-general-changeTasteOrSmell"] = ($("#reportingSymptoms-general-changeTasteOrSmell").prop("checked")) ? "y" : "n"; submissionDetails["reportingSymptoms-general-fatigue"] = ($("#reportingSymptoms-general-fatigue").prop("checked")) ? "y" : "n"; submissionDetails["reportingSymptoms-general-severeHeadache"] = ($("#reportingSymptoms-general-severeHeadache").prop("checked")) ? "y" : "n"; submissionDetails["reportingSymptoms-general-otherCovidSymptoms"] = ($("#reportingSymptoms-general-otherCovidSymptoms").prop("checked")) ? "y" : "n"; if ((pageParam["enableOtherCovidDetails"] == true) && ($("#reportingSymptoms-general-otherCovidSymptoms").prop("checked"))) { submissionDetails["reportingSymptoms-general-otherCovidSymptomsList"] = $("#reportingSymptoms-general-otherCovidSymptomsList").val(); } submissionDetails["reportingSymptoms-other-rashColdSore"] = ($("#reportingSymptoms-other-rashColdSore").prop("checked")) ? "y" : "n"; submissionDetails["reportingSymptoms-other-conjunctivitis"] = ($("#reportingSymptoms-other-conjunctivitis").prop("checked")) ? "y" : "n"; if ($("#seriiPanel-reportingSymptoms-otherSymptomContainer [type='checkbox']:checked").length) { submissionDetails["reportingSymptoms-other-earliestSymptoms"] = localDateToServer($("#reportingSymptoms-other-earliestSymptoms").val()); } if (pageParam["enableOutbreak"] == true) { submissionDetails["reportingSymptoms-general-outbreak"] = ($("#reportingSymptoms-general-outbreak").prop("checked")) ? "y" : "n"; } } //Return to Work if (submissionDetails["reportType"] == "returnToWork") { submissionDetails["returnToWork-symptom-fever"] = ($("#returnToWork-symptom-fever").prop("checked")) ? "y" : "n"; submissionDetails["returnToWork-symptom-cough"] = ($("#returnToWork-symptom-cough").prop("checked")) ? "y" : "n"; submissionDetails["returnToWork-symptom-soreThroat"] = ($("#returnToWork-symptom-soreThroat").prop("checked")) ? "y" : "n"; submissionDetails["returnToWork-symptom-shortnessOfBreath"] = ($("#returnToWork-symptom-shortnessOfBreath").prop("checked")) ? "y" : "n"; submissionDetails["returnToWork-symptom-vomiting"] = ($("#returnToWork-symptom-vomiting").prop("checked")) ? "y" : "n"; submissionDetails["returnToWork-symptom-diarrhea"] = ($("#returnToWork-symptom-diarrhea").prop("checked")) ? "y" : "n"; submissionDetails["returnToWork-symptom-aches"] = ($("#returnToWork-symptom-aches").prop("checked")) ? "y" : "n"; submissionDetails["returnToWork-symptom-runnyNose"] = ($("#returnToWork-symptom-runnyNose").prop("checked")) ? "y" : "n"; submissionDetails["returnToWork-symptom-severeHeadache"] = ($("#returnToWork-symptom-severeHeadache").prop("checked")) ? "y" : "n"; submissionDetails["returnToWork-symptom-fatigue"] = ($("#returnToWork-symptom-fatigue").prop("checked")) ? "y" : "n"; submissionDetails["returnToWork-symptom-lossTasteOrSmell"] = ($("#returnToWork-symptom-lossTasteOrSmell").prop("checked")) ? "y" : "n"; submissionDetails["returnToWork-symptom-rashColdSores"] = ($("#returnToWork-symptom-rashColdSores").prop("checked")) ? "y" : "n"; submissionDetails["returnToWork-symptom-conjunctivitis"] = ($("#returnToWork-symptom-conjunctivitis").prop("checked")) ? "y" : "n"; submissionDetails["returnToWork-symptom-otherCovidSymptoms"] = ($("#returnToWork-symptom-otherCovidSymptoms").prop("checked")) ? "y" : "n"; if ((pageParam["enableOtherCovidDetails"] == true) && ($("#returnToWork-symptom-otherCovidSymptoms").prop("checked"))) { submissionDetails["returnToWork-symptom-otherCovidSymptomsList"] = $("#returnToWork-symptom-otherCovidSymptomsList").val(); } if (pageParam["returnToWork-hasSymptoms"] == true) { submissionDetails["returnToWork-questions-symptomFree24Hours"] = $("[name='returnToWork-questions-symptomFree24Hours']:checked").val(); } submissionDetails["returnToWork-questions-quarantine"] = $("[name='returnToWork-questions-quarantine']:checked").val(); if ($("[name='returnToWork-questions-quarantine']:checked").val() == "y") { submissionDetails["returnToWork-questions-quarantineStart"] = localDateToServer($("#returnToWork-questions-quarantineStart").val()); submissionDetails["returnToWork-questions-quarantineReason-travel"] = ($("#returnToWork-questions-quarantineReason-travel").prop("checked")) ? "y" : "n"; submissionDetails["returnToWork-questions-quarantineReason-contact"] = ($("#returnToWork-questions-quarantineReason-contact").prop("checked")) ? "y" : "n"; submissionDetails["returnToWork-questions-quarantineReason-covidPositive"] = ($("#returnToWork-questions-quarantineReason-covidPositive").prop("checked")) ? "y" : "n"; submissionDetails["returnToWork-questions-quarantineComplete"] = $("[name='returnToWork-questions-quarantineComplete']:checked").val(); } submissionDetails["returnToWork-questions-covid19Test"] = $("[name='returnToWork-questions-covid19Test']:checked").val(); if ($("[name='returnToWork-questions-covid19Test']:checked").val() == "y") { submissionDetails["returnToWork-questions-covid19-testResult"] = $("#returnToWork-questions-covid19-testResult").val(); if ($("#returnToWork-questions-covid19-testResult").val() == "Negative") { submissionDetails["returnToWork-questions-covid19TestResultDocumentation"] = $("[name='returnToWork-questions-covid19TestResultDocumentation']:checked").val(); } } if (pageParam["enableOutbreak"] == true) { submissionDetails["returnToWork-questions-outbreak"] = $("[name='returnToWork-questions-outbreak']:checked").val(); } } } return submissionDetails; }