<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="AmbulatorySummary.aspx.cs" Inherits="Axium.Web.Users.AmbulatorySummaryPage" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head id="Head1" runat="server">
    <title></title>
    
    <meta http-equiv="Content-Style-Type" content="text/css" />
    <meta http-equiv="Content-Script-Type" content="text/javascript" />
    <link rel="stylesheet" type="text/css" href="../Includes/Css/jquery.timepicker.min.css" />
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-GLhlTQ8iRABdZLl6O3oVMWSktQOp6b7In1Zl3/Jr59b6EGGoI1aFkw7cmDA6j6gD" crossorigin="anonymous" />
    
    <!-- AX-21790 -->
    <script src="../Includes/JQueryUI/js/jquery-3.5.1.min.js" type="text/javascript"></script>
    <script src="../Includes/JQueryUI/js/jquery-migrate-3.3.2.min.js" type="text/javascript"></script>
    <script src="../Includes/Scripts/ui.datepicker.js" type="text/javascript"></script>
    <script src="../Includes/Scripts/dateControl.js" type="text/javascript"></script>
    <script src="../Includes/Scripts/jquery.timer.js" type="text/javascript"></script>    
    <script src="../Includes/Scripts/jquery.validate-1.19.2.min.js" type="text/javascript"></script>
    <script src="../Includes/Scripts/jquery.timepicker.min.js" type="text/javascript"></script>
    <script src="../Includes/Scripts/utilities.js" type="text/javascript"></script>

    <%--<script src="../Includes/Scripts/jquery-1.3.2.min.js" type="text/javascript"></script>--%>
    <script src="../Includes/Scripts/jquery.validate-1.19.2.min.js" type="text/javascript"></script>
    <script src="../Includes/Scripts/ambulatorySummary.240600.js" type="text/javascript"></script>
    <script src="../Includes/Scripts/iframe.231520.js" type="text/javascript"></script>
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/js/bootstrap.bundle.min.js" integrity="sha384-w76AqPfDkMBDXo30jS1Sgez6pr3x5MlQ1ZAGC+nuZB+EYdgRZgiwxhTBTkF7CXvN" crossorigin="anonymous"></script>
    
</head>
<body id="ambulatorySummaryPage">
    <form name="AmbSum" id="AmbSum" runat="server">
    <asp:HiddenField runat="server" ID="FromDateField"/>
    <asp:HiddenField runat="server" ID="ToDateField"/>
        
    <div id="AmbulatorySummary">
	    <h1>Ambulatory Summary</h1>
		<div class="instructionMessage">
		    <p class="instructionText"><span class="instructionBold">Q.</span> What is an Ambulatory Summary?</p>
            <p class="instructionText"><span class="instructionBold">A.</span> The Ambulatory Summary is a summary of your health information, which includes information such as your current medications, medication allergies, medical problems, and a history of your treatments.</p>
		</div>
		<div class="instructionMessage">
		    <p class="instructionText"><span class="instructionBold">Q.</span> How can I use my Ambulatory Summary?</p>
            <p class="instructionText"><span class="instructionBold">A.</span> You can use the Ambulatory Summary to get a better understanding of your own health, as well as use it to share your medical history with your other healthcare providers.</p>
		</div>
		<div class="instructionMessage">
		    <p class="instructionText"><span class="instructionBold">Q.</span> How can I access my Ambulatory Summary?</p>
            <p class="instructionText"><span class="instructionBold">A.</span> You can access your Ambulatory Summary by viewing or downloading it. You can also send it to a healthcare provider's DIRECT Address. Please obtain the DIRECT Address from your healthcare provider. It is used to deliver your Ambulatory Summary safely and securely.</p>
		</div>
        
        
        <div class="AmbDiv">
            <table aria-label="ambsumm">
                <%--                
                <tr>
                    <td class="colText">
                        <p>View</p>
                    </td>
                    <td class="colAction">
                        <asp:LinkButton ID="ViewBrowserLink" runat="server" OnClientClick="window.open('ViewAmbulatorySummary.aspx', '_blank'); return false;" >View in a browser</asp:LinkButton>
                    </td>
                </tr>
                --%>
                <thead></thead>
                <tr >
                    <td class="colText" scope="row">
                        <input id="limitRange" type="checkbox" onclick="limitRangeCheckBox(this);" runat="server"  />
                        <label for="limitRange">Limit the Data to the following Date and Time range</label>
                    </td>
                    <td class="colAction" scope="row">
                        <div id="rangeDateArea" class="rangeDateArea" runat="server">
                            <span id="FromDate">
                                <span id="timeFromLabel" class="LabelDate">Date From:</span>
                                <!-- <span class="LabelTime">Time From:</span>-->
                                <asp:Image ID="FromDateImgError" runat="server" ImageUrl="../Includes/Images/unchecked.png" CssClass="imgErrorHide" AlternateText="From Date" />                                
                                <asp:Image ID="FromTimeImgError" runat="server" ImageUrl="../Includes/Images/unchecked.png" CssClass="imgErrorHide" AlternateText="From Time" />
                                <br />
                                <asp:Panel runat="server" ID="FromDateControlDiv"></asp:Panel>
                                <label style="display:block;float:left;position:relative;top:-20px" for="timeFrom">
                                    Time From
                                <input id="timeFrom" runat="server" aria-labelledby="timeFromLabel" style="display:block;float:left"/>
                                </label>
                            </span>
                            <span id="ToDate">
                                <span id="timeToLabel" class="LabelDate">Date To:</span>
                                <!-- <span class="LabelTime">Time To:</span>-->
                                <asp:Image ID="ToDateImgError" runat="server" ImageUrl="../Includes/Images/unchecked.png" CssClass="imgErrorHide" AlternateText="To Date" />
                                <asp:Image ID="ToTimeImgError" runat="server" ImageUrl="../Includes/Images/unchecked.png" CssClass="imgErrorHide" AlternateText="To Time" />
                                <br />
                                <asp:Panel runat="server" ID="ToDateControlDiv"></asp:Panel>
                                <label style="display:block; float:left;position:relative;top:-20px" for="timeTo" >
                                    Time To:
                                    <input id="timeTo" runat="server" aria-labelledby="timeToLabel" style="display:block;float:left"/>
                                </label>
                                

                            </span>
                        </div>
                    </td>
                </tr>
                <tr class="border_top">
                    <td class="colText" scope="row">
                        <p>Download</p>
                    </td>
                    <td class="colAction" scope="row">
                        <div>
                            <asp:LinkButton ID="DownHtmlLink" runat="server" OnClientClick="checkDates()"  OnClick="DownloadHtml_Click">Download HTML version</asp:LinkButton>
                        </div>
                        <div class="lineSeparateDownload"></div>
                        <div>
                            <asp:LinkButton ID="DownCcdaLink" runat="server" OnClientClick="checkDates()"  OnClick="DownloadCcda_Click">Download Consolidated Clinical Document Architecture (CCDA) version</asp:LinkButton>
                        </div>
                    </td>
                </tr>
                <tr id="SendRowArea" runat="server" class="border_top">
                    <td class="colText" scope="row">
                        <div class="leftArea">
                            <span id="labelSendCCDATextBox" >Send to a healthcare provider's DIRECT Address</span>
                        </div>
                        <div class="leftArea">
                            <input id="emailDirect" type="checkbox" runat="server" checked="True" />
                            <label id="emailLabel" for="emailDirect">Use Direct</label>                                                        
                        </div>
                    </td>
                    <td class="colAction" scope="row">
                        <div>
                            <asp:TextBox id="SendCCDATextBox" runat="server" class="sendCcdaTextBox required email" title="Send CCDA" onfocus="removeError()" onblur="validateEmail()" ></asp:TextBox>
                            <asp:Image ID="SendCCDATextBoxImgError" runat="server" ImageUrl="../Includes/Images/unchecked.png"  CssClass="imgErrorHide" AlternateText="Send CCDA" />
                        </div>
                        <div>
		                    <span id="ErrorAddressCCDALabel" class="errorMessage" runat="server" >&nbsp;</span>
                        </div>
                        <div>
			                <asp:Button ID="SendCCDAButton" runat="server" CssClass="sendCcdaButton" Text="Send" OnClientClick="checkDates(); return (validateEmail());" OnClick="SendCcda_Click"/>
                        </div>
                        <div>
    		                <span id="NotificationSentLabel" class="notificationMessage" runat="server"></span>
                            <span id="ErrorSendingCCDALabel" class="errorMessage" runat="server" >&nbsp;</span>
                        </div>
                    </td>
                </tr>
                <tr class="border_top">
                    <td class="colText" scope="row">
                        <p>Update the Ambulatory Summary of Care below</p>
                    </td>
                    <td class="colAction" scope="row">
                        <div>
                            <asp:Button ID="UpdateBtn" runat="server" Text="Update" OnClientClick="checkDates()" OnClick="UpdateData_Click"  />
                        </div>
                    </td>
                </tr>
                

            </table>

        </div>
    </div>
    <div id="AmbulatorySummaryArea"  runat="server"></div>
    </form>
	
	<script type="text/javascript">
		jQuery(document).ready(function () {
			var childHeight = $(document).height();
			jQuery('#ambulatoryIframeId', window.parent.document).css('height', childHeight);

			jQuery('#timeFrom').timepicker({ 'disableTextInput': true });               // AX-21790
			jQuery('#timeTo').timepicker({ 'disableTextInput': true });                 // AX-21790
		    //$('.rangeDateArea').prop("disabled", true);                         // AX-21790
		    if (jQuery('#timeFrom').val() === '') {
		        jQuery('#timeFrom').timepicker('setTime', '12:00am');               // AX-21790
		    }
		    if (jQuery('#timeTo').val() === '') {
		        jQuery('#timeTo').timepicker('setTime', '12:00am');                 // AX-21790
		    }
		    limitRangeCheckBox(jQuery('#limitRange'));

            $('#DVALIDEMPTY123Year').on('keydown', function (e) {		// AX-24898.24919.2 .keydown(function (e) {
		        // Allow: backspace, delete, tab, escape, enter and .
		        if ($.inArray(e.keyCode, [46, 8, 9, 27, 13, 110]) !== -1 ||
		            // Allow: Ctrl+A, Command+A
                    (e.keyCode === 65 && (e.ctrlKey === true || e.metaKey === true)) ||
		            // Allow: home, end, left, right, down, up
                    (e.keyCode >= 35 && e.keyCode <= 40)) {
		            // let it happen, don't do anything
		            return;
		        }
		        // Ensure that it is a number and stop the keypress
		        if ((e.shiftKey || (e.keyCode < 48 || e.keyCode > 57)) && (e.keyCode < 96 || e.keyCode > 105)) {
		            e.preventDefault();
		        }

		        //$('.success').hide();
		        //$('.errorMsg').hide();
		    });

            $('#DVALIDEMPTY321Year').on('keydown', function (e) {		// AX-24898.24919.2 .keydown(function (e) {
		        // Allow: backspace, delete, tab, escape, enter and .
		        if ($.inArray(e.keyCode, [46, 8, 9, 27, 13, 110]) !== -1 ||
		            // Allow: Ctrl+A, Command+A
                    (e.keyCode === 65 && (e.ctrlKey === true || e.metaKey === true)) ||
		            // Allow: home, end, left, right, down, up
                    (e.keyCode >= 35 && e.keyCode <= 40)) {
		            // let it happen, don't do anything
		            return;
		        }
		        // Ensure that it is a number and stop the keypress
		        if ((e.shiftKey || (e.keyCode < 48 || e.keyCode > 57)) && (e.keyCode < 96 || e.keyCode > 105)) {
		            e.preventDefault();
		        }

		        //$('.success').hide();
		        //$('.errorMsg').hide();
		    });

		});          
    </script>
</body>
</html>
