Initial Box Code

From FeMR Wiki
Jump to navigation Jump to search

ASP

Use an existing signature or initial. You will want to make sure that you copy the two divs below for the signature or initial. Make sure the button, Signature Div and MouseSignature names are copied from MW

Example 1

An example for an Initial Box only

                <div class="formRow">
                   <div class="col-InitButton">
                      <asp:Button type="submit" ID="btnInitial1" Text="Initial" runat="server" Width="125px"/>
                      <asp:Button ID="btnInitialEnable1" runat="server" Text="Enable Initial" Width="125px" />
                   </div>
                   <div class="col-Initial" id="DivInitial1" runat="server">
                      <cc1:MouseSignature BorderStyle="Solid"  SignPenColor="Black" BackColor="White" SignTransparent="false"  BorderWidth="2" SignShowImageBorder="true"  BorderColor="Black"  ID="ctlSuperSignatureName" runat="server"  Height="200px" SignHeight="200" SignStartMessage="Initial" SignWidth="200" IncludeJquery="False" SignPenSize="2" Width="200px"  />
                   </div>
                   <div id="DivInit1" class="col-Initial" style="width: 500px; " >
                      Text next to Initial Box. 
                   </div>
                </div>
 

Example 2

An initial with a nested Radio Button in the text

                <div class="formRow">
                   <div class="col-InitButton">
                      <asp:Button type="submit" ID="btnInitial1" Text="Initial" runat="server" Width="125px"/>
                      <asp:Button ID="btnInitialEnable1" runat="server" Text="Enable Initial" Width="125px" />
                   </div>
                   <div class="col-Initial" id="DivInitial1" runat="server">
                      <cc1:MouseSignature BorderStyle="Solid"  SignPenColor="Black" BackColor="White" SignTransparent="false"  BorderWidth="2" SignShowImageBorder="true"  BorderColor="Black"  ID="ctlSuperSignatureName" runat="server"  Height="200px" SignHeight="200" SignStartMessage="Initial" SignWidth="200" IncludeJquery="False" SignPenSize="2" Width="200px"  />
                   </div>
                   <div id="DivInit1" class="col-Initial" style="width: 500px; " >
                      Text next to Initial Box. 
                      <div class="col-Radio175">
                        <asp:RadioButtonList ID="rdoContactPermissionBy" runat="server" CssClass="chkboxList" RepeatDirection="Horizontal">
                           <asp:ListItem Text="Description1" Value="1" />
                           <asp:ListItem Text="Description2" Value="2" />
                        </asp:RadioButtonList>
                      </div>
                   </div>
                </div>
 

Example 3

An initial with a nested Check Box in the text

                <div class="formRow">
                   <div class="col-InitButton">
                      <asp:Button type="submit" ID="btnInitial1" Text="Initial" runat="server" Width="125px"/>
                      <asp:Button ID="btnInitialEnable1" runat="server" Text="Enable Initial" Width="125px" />
                   </div>
                   <div class="col-Initial" id="DivInitial1" runat="server">
                      <cc1:MouseSignature BorderStyle="Solid"  SignPenColor="Black" BackColor="White" SignTransparent="false"  BorderWidth="2" SignShowImageBorder="true"  BorderColor="Black"  ID="ctlSuperSignatureName" runat="server"  Height="200px" SignHeight="200" SignStartMessage="Initial" SignWidth="200" IncludeJquery="False" SignPenSize="2" Width="200px"  />
                   </div>
                   <div id="DivInit1" class="col-Initial" style="width: 500px; " >
                      Text next to [[Initial Box]].
                        <asp:CheckBox ID="chkOption1" Text="Option1" runat="server" />
                        <asp:CheckBox ID="chkOption2" Text="Option2" runat="server" />
                   </div>
                </div>
 

Example 4

***sample example box that isn't valid for use yet***


  <div class="col-InitButton">
  <asp:Button type="submit" ID="btnInitial1" Text="Initial" runat="server" Width="125px"/>
  <asp:Button ID="btnInitialEnable1" runat="server" Text="Enable Initial" Width="125px" />
  </div>
                        
  <div class="col-Initial" id="DivInitial1" runat="server">
  <cc1:MouseSignature BorderStyle="Solid"  SignPenColor="Black" BackColor="White" SignTransparent="false"  BorderWidth="2" SignShowImageBorder="true"  BorderColor="Black"  ID="ctlPatientInitalLEReport" runat="server"  Height="200px" SignHeight="200" SignStartMessage="Initial" SignWidth="200" IncludeJquery="False" SignPenSize="2" Width="200px"  />
  </div>
 

MW Signatures

These are the naming standards for the buttons, signature div and signature control name. Make sure to increment buy number for each signature or initial.

VB - LoadSignatures

You will want to make sure the initial or signature button and the signature div are disabled and not visible

       'Hide Div / Disable Buttons
        btnInitial1.Enabled = False
        DivInitial1.Visible = False
         

Next you will copy the template to check if the signature was completed and change the column name to match the MW

    
        'Set button text

        If dsSignatureData.Tables("Signature").Rows(0).Item("chrPatientInitalLEReport") = "Y" Then
            btnInitial1.Text = "Initialed"
            btnInitial1.BackColor = strBackColor
            btnInitial1.ForeColor = strForeColor
            btnInitialEnable1.Visible = True
        End If  
       

Next you will copy the template to check if the signature was NOT completed and change the column name to match the MW

    'If sesLoadReason is New or Update, enable buttons and divs for required signatures
        If Session("sesLoadReason") = "New" Or Session("sesLoadReason") = "Edit" Then
        'Copy the statement below. Leave the first if statement above alone
        
            If dsSignatureData.Tables("Signature").Rows(0).Item("chrPatientInitalLEReport") = "N" Then
                btnInitial1.Enabled = True
                DivInitial1.Visible = True
                btnInitialEnable1.Visible = False
            End If
 

VB - Initial/Signature Button

You can copy some existing code from the button type. For the initial or signature button, the code behind will need 3 things changed : The Bitmap CTL name The strSaveFile png name The strColumn name

Make sure that if you copy it, the button and div names under the Copy Master button comment match your MW names. Same with the btnInitialEnable* name at the bottom of the code

   '*** Copy Master Button VB Column B & C below ***
        Dim bm As Bitmap = ctlSuperSignatureName.SaveSignature("")


        Dim strSaveLoc As String
        Dim strSaveFile As String
        Dim strSaveFull As String
        Dim strBackColor As System.Drawing.Color = System.Drawing.Color.Green
        Dim strForeColor As System.Drawing.Color = System.Drawing.Color.Yellow

        strSaveLoc = "~/Drawings/" & Session("sesCurrentMedicalRecordNumber") & "/Signatures/"

        '*** Copy Master Button VB Column D & E below ***
        strSaveFile = "ctlSuperSignatureName.png"

        strSaveFull = Server.MapPath(strSaveLoc) & strSaveFile

        bm.Save(strSaveFull, ImageFormat.Png)

        'Hide Div / Disable - Paint Button
        '*** Copy Master Button VB Column H below ***

        btnInitial1.Enabled = False
        DivInitial1.Visible = False
        btnInitial1.Text = "Initialed"
        btnInitial1.BackColor = strBackColor
        btnInitial1.ForeColor = strForeColor




        'Update tblSignature
        Dim strColumn As String
        Dim strRecordStatus As String
        strRecordStatus = "Y"

        '*** Copy Master Button VB Column F & G below ***
        strColumn = "chrSuperSignatureName"



        SetTableSignature(strColumn, strRecordStatus)

        btnInitialEnable1.Visible = True

 

VB - Enable Button

You can copy some existing code from the button type. For the enable button, the code behind will need 1 thing changed : The strColumn name

Make sure that if you copy it, the button and div names under the 'Hide Div / Disable comment match your MW names. Same with the btnInitialEnable* name at the bottom of the code

'Hide Div / Disable - Paint Button
        '*** Copy Master Button VB Column H below ***
        btnInitial1.Enabled = True
        DivInitial1.Visible = True
        btnInitial1.Text = "Initial"
        btnInitial1.ForeColor = Color.Black
        btnInitial1.BackColor = Color.LightGray


        'Update tblSignature
        Dim strColumn As String
        Dim strRecordStatus As String
        strRecordStatus = "N"

        '*** Copy Master Button VB Column F & G below ***
        strColumn = "chrSuperSignatureName"


        SetTableSignature(strColumn, strRecordStatus)

        'Hide enable button
        btnInitialEnable1.Visible = False
 

VB - DisableFields

Add the btn*****Enable here. Make sure they are not Visible

  'Signatures
        btnInitialEnable1.Visible = False