{"id":35417,"date":"2022-06-01T11:33:07","date_gmt":"2022-06-01T15:33:07","guid":{"rendered":"https:\/\/dormalab.com\/questionnaire-matinal\/"},"modified":"2026-06-27T08:57:01","modified_gmt":"2026-06-27T12:57:01","slug":"questionnaire-matinal","status":"publish","type":"page","link":"https:\/\/dormalab.com\/fr\/questionnaire-matinal\/","title":{"rendered":"Questionnaire du matin"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-page\" data-elementor-id=\"35417\" class=\"elementor elementor-35417 elementor-35413\" data-elementor-post-type=\"page\">\n\t\t\t\t<div class=\"elementor-element elementor-element-21b7001 e-flex e-con-boxed e-con e-parent\" data-id=\"21b7001\" data-element_type=\"container\" data-e-type=\"container\">\n\t\t\t\t\t<div class=\"e-con-inner\">\n\t\t\t\t<div class=\"elementor-element elementor-element-8519ebc elementor-widget elementor-widget-html\" data-id=\"8519ebc\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"html.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<!DOCTYPE html>\n<html lang=\"fr\">\n\n<head>\n    <meta charset=\"UTF-8\">\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n    <title>Document<\/title>\n    <style>\n        body {\n            font-family: Arial, sans-serif;\n            margin: 20px;\n            padding: 0;\n        }\n\n        h1 {\n            text-align: left;\n            margin-top: 50px;\n            font-size: 45px;\n            margin-left: 450px;\n            margin-bottom: 40px;\n        }\n\n        h2 {\n            color: #007BFF;\n            font-size: 25px;\n            margin-top: 30px;\n            margin-bottom: 30px;\n        }\n\n        form {\n            max-width: 600px;\n            margin: 20px auto;\n            display: none;\n        }\n\n        form.active {\n            display: block;\n        }\n\n        label {\n            display: block;\n            margin-top: 15px;\n        }\n\n        input,\n        textarea {\n            width: 100%;\n            padding: 10px;\n            margin-top: 5px;\n            font-size: 16px;\n            box-sizing: border-box;\n        }\n\n        button {\n            background-color: #007BFF;\n            width: 20%;\n            height: 30%;\n            font-size: 16px;\n            padding: 10px;\n            margin-top: 5px;\n            color: white;\n            border: none;\n            cursor: pointer;\n            margin-top: 20px;\n            box-sizing: border-box;\n        }\n\n        button:hover {\n            background-color: #0056b3;\n        }\n    <\/style>\n<script>\n(function (root, factory) {\n  var api = factory(root);\n\n  if (typeof module === \"object\" && module.exports) {\n    module.exports = api;\n  }\n\n  root.SummitQuestionnaireV2 = api;\n\n  \/\/ Expose helper functions as globals so legacy HTML call sites that reference them\n  \/\/ by bare name (e.g. `resolvePublicApiBase(...)`) keep working after the helper is\n  \/\/ inlined into the page. Without this, the IIFE only exposes the api object via\n  \/\/ `window.SummitQuestionnaireV2`, which causes a ReferenceError in code paths that\n  \/\/ do not use the defensive `window.SummitQuestionnaireV2 && ...` pattern.\n  if (api && typeof api === \"object\") {\n    var _helperExports = [\n      \"resolveStage\",\n      \"resolveApiBase\",\n      \"resolvePublicApiBase\",\n      \"rewriteUrl\",\n      \"rewriteLegacyUrl\",\n      \"rewriteManagedTargets\",\n      \"attachManagedForms\",\n    ];\n    for (var _i = 0; _i < _helperExports.length; _i++) {\n      var _name = _helperExports[_i];\n      if (typeof api[_name] === \"function\" && typeof root[_name] !== \"function\") {\n        root[_name] = api[_name];\n      }\n    }\n  }\n})(typeof globalThis !== \"undefined\" ? globalThis : this, function (root) {\n  var PROD_BASE = \"https:\/\/api.ascentemr.com\/v2\";\n  var DEV_BASE = \"https:\/\/dev.ascentemr.com\/v2\";\n  var STAGING_BASE = \"https:\/\/staging.ascentemr.com\/v2\";\n  var LOCAL_BASE = \"http:\/\/localhost:4010\/dev\/v2\";\n  var DOM_READY_EVENTS = [\"DOMContentLoaded\", \"load\"];\n\n  function asSearchParams(input) {\n    if (typeof URLSearchParams === \"undefined\") {\n      return {\n        get: function () {\n          return null;\n        },\n      };\n    }\n\n    if (!input && root.location && typeof root.location.search === \"string\") {\n      return new URLSearchParams(root.location.search);\n    }\n\n    if (input instanceof URLSearchParams) {\n      return input;\n    }\n\n    if (typeof input === \"string\") {\n      return new URLSearchParams(input.charAt(0) === \"?\" ? input.slice(1) : input);\n    }\n\n    if (input && typeof input === \"object\" && typeof input.toString === \"function\") {\n      return new URLSearchParams(String(input));\n    }\n\n    return new URLSearchParams(\"\");\n  }\n\n  function normalize(value) {\n    return String(value || \"\").trim().toLowerCase();\n  }\n\n  function currentOrigin() {\n    if (root.location && typeof root.location.origin === \"string\" && root.location.origin) {\n      return root.location.origin.replace(\/\\\/$\/, \"\");\n    }\n    if (typeof URL !== \"undefined\" && root.location && typeof root.location.href === \"string\") {\n      try {\n        return new URL(root.location.href).origin.replace(\/\\\/$\/, \"\");\n      } catch (_error) {}\n    }\n    return \"\";\n  }\n\n  function isProductionWordpressHost() {\n    var hostname = normalize(root.location && root.location.hostname);\n    if (!hostname) {\n      return false;\n    }\n    if (\n      hostname.indexOf(\"dev.\") === 0 ||\n      hostname.indexOf(\"dev-\") === 0 ||\n      hostname.indexOf(\"staging.\") === 0 ||\n      hostname.indexOf(\"staging-\") === 0 ||\n      hostname.indexOf(\".staging.\") >= 0 ||\n      hostname.indexOf(\".vercel.app\") >= 0\n    ) {\n      return false;\n    }\n\n    return (\n      hostname === \"dormalab.com\" ||\n      hostname === \"www.dormalab.com\" ||\n      hostname === \"summithealth.ca\" ||\n      hostname === \"www.summithealth.ca\" ||\n      hostname === \"cliniquevoyageur.ca\" ||\n      hostname === \"www.cliniquevoyageur.ca\"\n    );\n  }\n\n  function resolveStage(searchLike) {\n    var params = asSearchParams(searchLike);\n    var requestedStage = normalize(params.get(\"stage\"));\n    var testMode = normalize(params.get(\"test\"));\n    var hostname = normalize(root.location && root.location.hostname);\n\n    if (requestedStage === \"local\" || testMode === \"true\") {\n      return \"local\";\n    }\n    if (requestedStage === \"dev\") {\n      return \"dev\";\n    }\n    if (requestedStage === \"staging\") {\n      return \"staging\";\n    }\n    if (requestedStage === \"prod\" || requestedStage === \"production\") {\n      return \"prod\";\n    }\n\n    if (!hostname || hostname === \"localhost\" || hostname === \"127.0.0.1\" || hostname === \"::1\") {\n      return \"local\";\n    }\n    if (\n      hostname === \"staging.ascentemr.com\" ||\n      hostname.indexOf(\"staging.\") === 0 ||\n      hostname.indexOf(\"staging-\") === 0 ||\n      hostname.indexOf(\".staging.\") >= 0\n    ) {\n      return \"staging\";\n    }\n    if (\n      hostname === \"dev.ascentemr.com\" ||\n      hostname === \"dev.ascent.summithealth.ca\" ||\n      hostname.indexOf(\"dev.\") === 0 ||\n      hostname.indexOf(\"dev-\") === 0 ||\n      hostname.indexOf(\".vercel.app\") >= 0\n    ) {\n      return \"dev\";\n    }\n\n    return \"prod\";\n  }\n\n  function resolveApiBase(searchLike) {\n    var stage = resolveStage(searchLike);\n\n    if (isProductionWordpressHost()) {\n      return PROD_BASE;\n    }\n    if (stage === \"local\") {\n      return LOCAL_BASE;\n    }\n    if (stage === \"dev\") {\n      return DEV_BASE;\n    }\n    if (stage === \"staging\") {\n      return STAGING_BASE;\n    }\n\n    return currentOrigin() ? currentOrigin() + \"\/api\/v2\" : DEV_BASE;\n  }\n\n  function resolvePublicApiBase(searchLike) {\n    return resolveApiBase(searchLike).replace(\/\\\/$\/, \"\") + \"\/public\";\n  }\n\n  function startsWith(value, prefix) {\n    return String(value || \"\").slice(0, prefix.length) === prefix;\n  }\n\n  function isAscentApiHost(host) {\n    var normalizedHost = normalize(host);\n    return (\n      normalizedHost === \"api.ascentemr.com\" ||\n      normalizedHost === \"dev.ascentemr.com\" ||\n      normalizedHost === \"staging.ascentemr.com\" ||\n      normalizedHost === \"api.summittravelhealthdev.com\" ||\n      normalizedHost === \"dev.summittravelhealthdev.com\" ||\n      normalizedHost === \"staging.summittravelhealthdev.com\" ||\n      normalizedHost.indexOf(\"localhost:3000\") === 0 ||\n      normalizedHost.indexOf(\"127.0.0.1:3000\") === 0 ||\n      normalizedHost.indexOf(\"localhost:4010\") === 0 ||\n      normalizedHost.indexOf(\"127.0.0.1:4010\") === 0\n    );\n  }\n\n  function normalizePublicPath(pathname) {\n    var normalized = String(pathname || \"\");\n    if (!normalized) {\n      return \"\/public\";\n    }\n\n    if (startsWith(normalized, \"\/public\")) {\n      return normalized;\n    }\n    if (startsWith(normalized, \"\/v2\/public\")) {\n      return normalized.slice(3);\n    }\n    if (startsWith(normalized, \"\/dev\/v2\/public\")) {\n      return normalized.slice(7);\n    }\n    if (startsWith(normalized, \"\/dev\/v2\/\")) {\n      return \"\/public\" + normalized.slice(7);\n    }\n    if (startsWith(normalized, \"\/dev\")) {\n      return \"\/public\" + normalized.slice(4);\n    }\n    if (startsWith(normalized, \"\/v2\/\")) {\n      return \"\/public\" + normalized.slice(3);\n    }\n\n    return normalized;\n  }\n\n  function shouldRewriteUrl(parsed, rawUrl) {\n    var pathname = String(parsed && parsed.pathname || \"\");\n    if (\n      startsWith(pathname, \"\/public\") ||\n      startsWith(pathname, \"\/v2\/public\") ||\n      startsWith(pathname, \"\/dev\/v2\/public\") ||\n      startsWith(pathname, \"\/dev\") ||\n      startsWith(pathname, \"\/v2\/\")\n    ) {\n      var rawValue = String(rawUrl || \"\");\n      var isRelative =\n        startsWith(rawValue, \"\/\") ||\n        startsWith(rawValue, \".\/\") ||\n        startsWith(rawValue, \"..\/\");\n      return isRelative || isAscentApiHost(parsed.host) || normalize(parsed.host) === normalize(root.location && root.location.host);\n    }\n\n    return false;\n  }\n\n  function rewriteUrl(rawUrl, searchLike) {\n    var value = String(rawUrl || \"\");\n    if (!value || typeof URL === \"undefined\") {\n      return value;\n    }\n\n    try {\n      var parsed = new URL(value, root.location && root.location.href ? root.location.href : undefined);\n      if (!shouldRewriteUrl(parsed, value)) {\n        return value;\n      }\n\n      var apiBase = resolveApiBase(searchLike);\n      var normalizedPath = normalizePublicPath(parsed.pathname);\n\n      return apiBase.replace(\/\\\/$\/, \"\") + normalizedPath + parsed.search + parsed.hash;\n    } catch (_error) {\n      return value;\n    }\n  }\n\n  function patchFetch() {\n    if (typeof root.fetch !== \"function\" || root.fetch.__summitQuestionnaireV2Patched) {\n      return;\n    }\n\n    var originalFetch = root.fetch.bind(root);\n\n    var patchedFetch = function (input, init) {\n      if (typeof Request !== \"undefined\" && input instanceof Request) {\n        var rewrittenRequestUrl = rewriteUrl(input.url);\n        if (rewrittenRequestUrl !== input.url) {\n          input = new Request(rewrittenRequestUrl, input);\n        }\n      } else if (typeof input === \"string\" || (typeof URL !== \"undefined\" && input instanceof URL)) {\n        input = rewriteUrl(String(input));\n      }\n\n      return originalFetch(input, init);\n    };\n\n    patchedFetch.__summitQuestionnaireV2Patched = true;\n    root.fetch = patchedFetch;\n  }\n\n  function patchXmlHttpRequest() {\n    if (\n      typeof XMLHttpRequest === \"undefined\" ||\n      !XMLHttpRequest.prototype ||\n      XMLHttpRequest.prototype.open.__summitQuestionnaireV2Patched\n    ) {\n      return;\n    }\n\n    var originalOpen = XMLHttpRequest.prototype.open;\n    XMLHttpRequest.prototype.open = function (method, url) {\n      var rewrittenUrl = rewriteUrl(url);\n      return originalOpen.apply(this, [method, rewrittenUrl].concat([].slice.call(arguments, 2)));\n    };\n    XMLHttpRequest.prototype.open.__summitQuestionnaireV2Patched = true;\n  }\n\n  function rewriteManagedTargets(documentLike) {\n    var doc = documentLike || root.document;\n    if (!doc || typeof doc.querySelectorAll !== \"function\") {\n      return;\n    }\n\n    doc.querySelectorAll(\"form[action], a[href]\").forEach(function (element) {\n      var attributeName = element.tagName === \"FORM\" ? \"action\" : \"href\";\n      var currentValue = element.getAttribute(attributeName);\n      var rewrittenValue = rewriteUrl(currentValue);\n      if (rewrittenValue && rewrittenValue !== currentValue) {\n        element.setAttribute(attributeName, rewrittenValue);\n      }\n    });\n  }\n\n  function getRecaptchaSiteKey(form) {\n    if (!form || !form.querySelector) {\n      return null;\n    }\n\n    var localWidget = form.querySelector(\".g-recaptcha[data-sitekey]\");\n    if (localWidget) {\n      return localWidget.getAttribute(\"data-sitekey\");\n    }\n\n    var globalWidget =\n      root.document && root.document.querySelector(\".g-recaptcha[data-sitekey]\");\n    return globalWidget ? globalWidget.getAttribute(\"data-sitekey\") : null;\n  }\n\n  function collectFormPayload(form) {\n    var payload = {};\n    var formData = new FormData(form);\n\n    formData.forEach(function (value, key) {\n      if (payload[key] !== undefined) {\n        if (!Array.isArray(payload[key])) {\n          payload[key] = [payload[key]];\n        }\n        payload[key].push(value);\n        return;\n      }\n\n      payload[key] = value;\n    });\n\n    payload.formKey = form.getAttribute(\"data-v2-form-key\") || \"\";\n    payload.pageUrl = root.location ? root.location.href : \"\";\n    payload.recaptchaToken =\n      payload.recaptchaToken ||\n      payload[\"g-recaptcha-response\"] ||\n      \"\";\n    payload.recaptchaSiteKey = payload.recaptchaSiteKey || getRecaptchaSiteKey(form);\n\n    return payload;\n  }\n\n  function ensureStatusElement(form, kind) {\n    var attributeName = kind === \"error\" ? \"data-v2-form-error\" : \"data-v2-form-success\";\n    var existing = form.querySelector(\"[\" + attributeName + \"]\");\n    if (existing) {\n      return existing;\n    }\n\n    var element = root.document.createElement(\"div\");\n    element.setAttribute(attributeName, \"true\");\n    element.style.display = \"none\";\n    element.style.marginBottom = \"12px\";\n    element.style.padding = \"12px\";\n    element.style.borderRadius = \"4px\";\n    element.style.fontSize = \"14px\";\n    element.style.background = kind === \"error\" ? \"#fbe9e7\" : \"#e8f5e9\";\n    element.style.color = kind === \"error\" ? \"#b71c1c\" : \"#1b5e20\";\n    form.insertBefore(element, form.firstChild);\n    return element;\n  }\n\n  function setStatusMessage(form, kind, message) {\n    var element = ensureStatusElement(form, kind);\n    element.textContent = message || \"\";\n    element.style.display = message ? \"block\" : \"none\";\n  }\n\n  function disableSubmitButtons(form, disabled) {\n    var buttons = form.querySelectorAll(\"button[type=submit], input[type=submit]\");\n    buttons.forEach(function (button) {\n      button.disabled = Boolean(disabled);\n    });\n  }\n\n  async function submitManagedForm(form) {\n    var payload = collectFormPayload(form);\n    var action = rewriteUrl(form.getAttribute(\"action\"));\n    var response = await root.fetch(action, {\n      method: \"POST\",\n      headers: {\n        \"Content-Type\": \"application\/json\",\n      },\n      body: JSON.stringify(payload),\n    });\n\n    var contentType = String(response.headers && response.headers.get && response.headers.get(\"content-type\") || \"\");\n    var data =\n      contentType.indexOf(\"application\/json\") >= 0\n        ? await response.json()\n        : { success: response.ok, message: await response.text() };\n\n    if (!response.ok || data.success === false) {\n      throw new Error(data.error || data.message || \"Form submission failed.\");\n    }\n\n    return data;\n  }\n\n  function attachFormHandler(form) {\n    if (!form || form.__summitQuestionnaireV2Attached) {\n      return;\n    }\n\n    form.__summitQuestionnaireV2Attached = true;\n    form.addEventListener(\"submit\", async function (event) {\n      event.preventDefault();\n\n      if (form.__summitQuestionnaireV2Submitting) {\n        return;\n      }\n\n      if (typeof form.checkValidity === \"function\" && !form.checkValidity()) {\n        if (typeof form.reportValidity === \"function\") {\n          form.reportValidity();\n        }\n        return;\n      }\n\n      form.__summitQuestionnaireV2Submitting = true;\n      setStatusMessage(form, \"error\", \"\");\n      setStatusMessage(form, \"success\", \"\");\n      disableSubmitButtons(form, true);\n\n      try {\n        var result = await submitManagedForm(form);\n        var redirectUrl = result.redirectUrl || collectFormPayload(form).retURL;\n\n        if (redirectUrl && root.location && typeof root.location.assign === \"function\") {\n          root.location.assign(redirectUrl);\n          return;\n        }\n\n        setStatusMessage(form, \"success\", \"Votre formulaire a ete soumis avec succes.\");\n      } catch (error) {\n        setStatusMessage(form, \"error\", error && error.message ? error.message : \"Le formulaire n'a pas pu etre soumis.\");\n        if (root.console && typeof root.console.error === \"function\") {\n          root.console.error(\"SummitQuestionnaireV2 form submission failed\", error);\n        }\n      } finally {\n        disableSubmitButtons(form, false);\n        form.__summitQuestionnaireV2Submitting = false;\n      }\n    });\n  }\n\n  function attachManagedForms(documentLike) {\n    var doc = documentLike || root.document;\n    if (!doc || typeof doc.querySelectorAll !== \"function\") {\n      return;\n    }\n\n    var managedForms = doc.querySelectorAll(\"form[data-v2-form-key]\");\n    managedForms.forEach(attachFormHandler);\n  }\n\n  function bootstrap() {\n    patchFetch();\n    patchXmlHttpRequest();\n\n    if (!root.document || typeof root.document.addEventListener !== \"function\") {\n      return;\n    }\n\n    rewriteManagedTargets(root.document);\n    attachManagedForms(root.document);\n    DOM_READY_EVENTS.forEach(function (eventName) {\n      root.document.addEventListener(eventName, function () {\n        rewriteManagedTargets(root.document);\n        attachManagedForms(root.document);\n      });\n    });\n\n    root.document.addEventListener(\"submit\", function (event) {\n      var form = event && event.target;\n      if (form && typeof form.getAttribute === \"function\") {\n        var currentAction = form.getAttribute(\"action\");\n        var rewrittenAction = rewriteUrl(currentAction);\n        if (rewrittenAction && rewrittenAction !== currentAction) {\n          form.setAttribute(\"action\", rewrittenAction);\n        }\n      }\n    }, true);\n  }\n\n  bootstrap();\n\n  return {\n    resolveStage: resolveStage,\n    resolveApiBase: resolveApiBase,\n    resolvePublicApiBase: resolvePublicApiBase,\n    rewriteUrl: rewriteUrl,\n    rewriteLegacyUrl: rewriteUrl,\n    rewriteManagedTargets: rewriteManagedTargets,\n    attachManagedForms: attachManagedForms,\n    bootstrap: bootstrap,\n  };\n});\n<\/script>\n<\/head>\n\n<body>\n    <!-- Formulaire en anglais -->\n    <div id=\"errorMessageDiv\"><\/div>\n    <form class=\"active\" id=\"morning-questionnaire\">\n        <h2>Questionnaire du matin<\/h2>\n        <label for=\"wake-up-time\">\u00c0 quelle heure vous \u00eates-vous r\u00e9veill\u00e9(e) ce matin?<\/label>\n        <input type=\"time\" id=\"wake-up-time\" name=\"wake-up-time\" required>\n\n        <label for=\"wake-up-times\">Combien de fois vous \u00eates-vous r\u00e9veill\u00e9(e) la nuit derni\u00e8re?<\/label>\n        <input type=\"number\" id=\"wake-up-times\" name=\"wake-up-times\" min=\"0\" step=\"1\" inputmode=\"numeric\" required>\n\n        <label for=\"lights-out-time\">\u00c0 quelle heure avez-vous \u00e9teint la lumi\u00e8re hier soir? (Heure et minute)<\/label>\n        <input type=\"time\" id=\"lights-out-time\" name=\"lights-out-time\" required>\n\n        <label for=\"fall-asleep-time\">Combien de temps (en minutes) pensez-vous avoir mis pour vous endormir hier\n            soir?<\/label>\n        <input type=\"number\" id=\"fall-asleep-time\" name=\"fall-asleep-time\" min=\"0\" step=\"1\" inputmode=\"numeric\" required>\n\n        <label for=\"awake-times\">\u00c0 quelles heures vous \u00eates-vous r\u00e9veill\u00e9(e)? (approximativement)<\/label>\n        <input type=\"text\" id=\"awake-times\" name=\"awake-times\" required>\n\n        <label for=\"differences\">\u00c0 part l'appareil, y a-t-il eu quelque chose qui a rendu votre nuit diff\u00e9rente des\n            nuits habituelles?<\/label>\n        <textarea id=\"differences\" name=\"differences\" rows=\"4\"><\/textarea>\n\n        <button type=\"submit\">Soumettre<\/button>\n    <\/form>\n\n    <div id=\"successMessage\" style=\"display: none; text-align: center; font-size: 20px; color: green; margin-top: 30px;\">\n        Questionnaire envoy\u00e9 avec succ\u00e8s!\n    <\/div>\n\n    <script>\n\n        function getSleepStudyId() {\n            const urlParams = new URLSearchParams(window.location.search);\n            return urlParams.get('sleepStudyId');\n        }\n\n        document.getElementById(\"morning-questionnaire\").addEventListener(\"submit\", async function (event) {\n            event.preventDefault();\n\n            let sleepStudyId = getSleepStudyId();\n            console.log(\"Retrieved sleepStudyId from url params:\", sleepStudyId);\n\n            if (!sleepStudyId) {\n                console.log(\"No sleepStudyId provided. Failed loading\");\n                if (!sleepStudyId) {\n                    alert(\"Impossible de recuperer le sleepStudyId. Veuillez reessayer.\");\n                    return;\n                }\n            }\n\n            console.log(\"sleepStudyId:\", sleepStudyId);\n\n            const requestData = {\n                sleepStudyId: sleepStudyId,\n                morningWakeupTime: document.getElementById(\"wake-up-time\").value,\n                numberOfTimesAwoke: document.getElementById(\"wake-up-times\").value,\n                lightsTurnedOffTime: document.getElementById(\"lights-out-time\").value,\n                minutesToFallAsleep: document.getElementById(\"fall-asleep-time\").value,\n                awakeTimes: document.getElementById(\"awake-times\").value,\n                nightDifference: document.getElementById(\"differences\").value\n            };\n\n            try {\n                const response = await fetch(resolvePublicApiBase(window.location.search).replace(\/\\\/$\/, \"\") + \"\/sleepStudy\/submitMorningQuestionnaire\", {\n                    method: \"POST\",\n                    headers: {\n                        \"Content-Type\": \"application\/json\"\n                    },\n                    body: JSON.stringify(requestData)\n                });\n\n                const data = await response.json();\n                console.log(\"Server Response:\", data);\n\n                if (data.success) {\n                    if (data.success) {\n                        document.getElementById(\"morning-questionnaire\").style.display = \"none\";\n                        document.getElementById(\"successMessage\").style.display = \"block\";\n                    }\n                } else {\n                    alert(\"Error submitting questionnaire : \" + data.error);\n                }\n            } catch (error) {\n                console.error(\"Error:\", error);\n                alert(\"An error occurred while submitting the questionnaire.\");\n            }\n        });\n\n        document.addEventListener(\"DOMContentLoaded\", function () {\n            const sleepStudyId = getSleepStudyId();\n            const errorMessageDiv = document.getElementById(\"errorMessageDiv\");\n\n            if (!sleepStudyId) {\n                errorMessageDiv.innerHTML = \"<p class='error'>On dirait qu'il y a une erreur et on ne peut pas charger votre formulaire. Veuillez contacter le 1-855-218-5186.<\/p>\";\n                document.getElementById(\"morning-questionnaire\").style.display = \"none\";\n            } \n        })\n    <\/script>\n<\/body>\n\n<\/html>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t","protected":false},"excerpt":{"rendered":"<p>Document Questionnaire du matin \u00c0 quelle heure vous \u00eates-vous r\u00e9veill\u00e9(e) ce matin? Combien de fois vous \u00eates-vous r\u00e9veill\u00e9(e) la nuit derni\u00e8re? \u00c0 quelle heure avez-vous \u00e9teint la lumi\u00e8re hier soir? (Heure et minute) Combien de temps (en minutes) pensez-vous avoir mis pour vous endormir hier soir? \u00c0 quelles heures vous \u00eates-vous r\u00e9veill\u00e9(e)? (approximativement) \u00c0 part &#8230; <a title=\"Questionnaire du matin\" class=\"read-more\" href=\"https:\/\/dormalab.com\/fr\/questionnaire-matinal\/\" aria-label=\"En savoir plus sur Questionnaire du matin\">Lire la suite<\/a><\/p>\n","protected":false},"author":20,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-35417","page","type-page","status-publish"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Questionnaire du matin - \u00c9valuez votre sommeil - Dorma Sleep Clinics<\/title>\n<meta name=\"description\" content=\"Remplissez le questionnaire m\u00e9dical et laissez un sp\u00e9cialiste du sommeil \u00e9valuer votre sommeil. Nous diagnostiquons l&#039;apn\u00e9e du sommeil, l&#039;insomnie et le ronflement.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/dormalab.com\/fr\/questionnaire-matinal\/\" \/>\n<meta property=\"og:locale\" content=\"fr_FR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Questionnaire du matin - \u00c9valuez votre sommeil - Dorma Sleep Clinics\" \/>\n<meta property=\"og:description\" content=\"Remplissez le questionnaire m\u00e9dical et laissez un sp\u00e9cialiste du sommeil \u00e9valuer votre sommeil. Nous diagnostiquons l&#039;apn\u00e9e du sommeil, l&#039;insomnie et le ronflement.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/dormalab.com\/fr\/questionnaire-matinal\/\" \/>\n<meta property=\"og:site_name\" content=\"Dorma Sleep Clinics\" \/>\n<meta property=\"article:modified_time\" content=\"2026-06-27T12:57:01+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Dur\u00e9e de lecture estim\u00e9e\" \/>\n\t<meta name=\"twitter:data1\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/dormalab.com\\\/fr\\\/questionnaire-matinal\\\/\",\"url\":\"https:\\\/\\\/dormalab.com\\\/fr\\\/questionnaire-matinal\\\/\",\"name\":\"Questionnaire du matin - \u00c9valuez votre sommeil - Dorma Sleep Clinics\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/dormalab.com\\\/fr\\\/#website\"},\"datePublished\":\"2022-06-01T15:33:07+00:00\",\"dateModified\":\"2026-06-27T12:57:01+00:00\",\"description\":\"Remplissez le questionnaire m\u00e9dical et laissez un sp\u00e9cialiste du sommeil \u00e9valuer votre sommeil. Nous diagnostiquons l'apn\u00e9e du sommeil, l'insomnie et le ronflement.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/dormalab.com\\\/fr\\\/questionnaire-matinal\\\/#breadcrumb\"},\"inLanguage\":\"fr-FR\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/dormalab.com\\\/fr\\\/questionnaire-matinal\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/dormalab.com\\\/fr\\\/questionnaire-matinal\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/dormalab.com\\\/fr\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Questionnaire du matin\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/dormalab.com\\\/fr\\\/#website\",\"url\":\"https:\\\/\\\/dormalab.com\\\/fr\\\/\",\"name\":\"Dorma Sleep Clinics\",\"description\":\"Sleep Well Live Well\",\"publisher\":{\"@id\":\"https:\\\/\\\/dormalab.com\\\/fr\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/dormalab.com\\\/fr\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"fr-FR\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/dormalab.com\\\/fr\\\/#organization\",\"name\":\"Dorma Clinique Du Sommeil\",\"url\":\"https:\\\/\\\/dormalab.com\\\/fr\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"fr-FR\",\"@id\":\"https:\\\/\\\/dormalab.com\\\/fr\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/dormalab.com\\\/wp-content\\\/uploads\\\/2019\\\/10\\\/Dorma-Logotype-RGB-Black-scaled-e1578787470924.png\",\"contentUrl\":\"https:\\\/\\\/dormalab.com\\\/wp-content\\\/uploads\\\/2019\\\/10\\\/Dorma-Logotype-RGB-Black-scaled-e1578787470924.png\",\"width\":120,\"height\":25,\"caption\":\"Dorma Clinique Du Sommeil\"},\"image\":{\"@id\":\"https:\\\/\\\/dormalab.com\\\/fr\\\/#\\\/schema\\\/logo\\\/image\\\/\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Questionnaire du matin - \u00c9valuez votre sommeil - Dorma Sleep Clinics","description":"Remplissez le questionnaire m\u00e9dical et laissez un sp\u00e9cialiste du sommeil \u00e9valuer votre sommeil. Nous diagnostiquons l'apn\u00e9e du sommeil, l'insomnie et le ronflement.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/dormalab.com\/fr\/questionnaire-matinal\/","og_locale":"fr_FR","og_type":"article","og_title":"Questionnaire du matin - \u00c9valuez votre sommeil - Dorma Sleep Clinics","og_description":"Remplissez le questionnaire m\u00e9dical et laissez un sp\u00e9cialiste du sommeil \u00e9valuer votre sommeil. Nous diagnostiquons l'apn\u00e9e du sommeil, l'insomnie et le ronflement.","og_url":"https:\/\/dormalab.com\/fr\/questionnaire-matinal\/","og_site_name":"Dorma Sleep Clinics","article_modified_time":"2026-06-27T12:57:01+00:00","twitter_card":"summary_large_image","twitter_misc":{"Dur\u00e9e de lecture estim\u00e9e":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/dormalab.com\/fr\/questionnaire-matinal\/","url":"https:\/\/dormalab.com\/fr\/questionnaire-matinal\/","name":"Questionnaire du matin - \u00c9valuez votre sommeil - Dorma Sleep Clinics","isPartOf":{"@id":"https:\/\/dormalab.com\/fr\/#website"},"datePublished":"2022-06-01T15:33:07+00:00","dateModified":"2026-06-27T12:57:01+00:00","description":"Remplissez le questionnaire m\u00e9dical et laissez un sp\u00e9cialiste du sommeil \u00e9valuer votre sommeil. Nous diagnostiquons l'apn\u00e9e du sommeil, l'insomnie et le ronflement.","breadcrumb":{"@id":"https:\/\/dormalab.com\/fr\/questionnaire-matinal\/#breadcrumb"},"inLanguage":"fr-FR","potentialAction":[{"@type":"ReadAction","target":["https:\/\/dormalab.com\/fr\/questionnaire-matinal\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/dormalab.com\/fr\/questionnaire-matinal\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/dormalab.com\/fr\/"},{"@type":"ListItem","position":2,"name":"Questionnaire du matin"}]},{"@type":"WebSite","@id":"https:\/\/dormalab.com\/fr\/#website","url":"https:\/\/dormalab.com\/fr\/","name":"Dorma Sleep Clinics","description":"Sleep Well Live Well","publisher":{"@id":"https:\/\/dormalab.com\/fr\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/dormalab.com\/fr\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"fr-FR"},{"@type":"Organization","@id":"https:\/\/dormalab.com\/fr\/#organization","name":"Dorma Clinique Du Sommeil","url":"https:\/\/dormalab.com\/fr\/","logo":{"@type":"ImageObject","inLanguage":"fr-FR","@id":"https:\/\/dormalab.com\/fr\/#\/schema\/logo\/image\/","url":"https:\/\/dormalab.com\/wp-content\/uploads\/2019\/10\/Dorma-Logotype-RGB-Black-scaled-e1578787470924.png","contentUrl":"https:\/\/dormalab.com\/wp-content\/uploads\/2019\/10\/Dorma-Logotype-RGB-Black-scaled-e1578787470924.png","width":120,"height":25,"caption":"Dorma Clinique Du Sommeil"},"image":{"@id":"https:\/\/dormalab.com\/fr\/#\/schema\/logo\/image\/"}}]}},"_links":{"self":[{"href":"https:\/\/dormalab.com\/fr\/wp-json\/wp\/v2\/pages\/35417","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dormalab.com\/fr\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/dormalab.com\/fr\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/dormalab.com\/fr\/wp-json\/wp\/v2\/users\/20"}],"replies":[{"embeddable":true,"href":"https:\/\/dormalab.com\/fr\/wp-json\/wp\/v2\/comments?post=35417"}],"version-history":[{"count":7,"href":"https:\/\/dormalab.com\/fr\/wp-json\/wp\/v2\/pages\/35417\/revisions"}],"predecessor-version":[{"id":42957,"href":"https:\/\/dormalab.com\/fr\/wp-json\/wp\/v2\/pages\/35417\/revisions\/42957"}],"wp:attachment":[{"href":"https:\/\/dormalab.com\/fr\/wp-json\/wp\/v2\/media?parent=35417"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}