Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.


Note:

...

 The instructions described here applies to

...

openIMIS version 1.3.0 and laterWe suggest using Visual Studio to the escape procedure

...

The role of the Escape procedures is to allow adaptation of the Web Application to different insurance contexts. There are situated in a single class, EscapeBL, which makes it easier to access and modify without having to worry about messing with the whole Web Application source code. 

There are 2 escape procedures that can be modified: 

  1. isValidInsuranceNumber allows validating the insuree number based on predefined rules. It is used for example when a new family or insuree are enrolled in openIMIS to ensure the valid insuree number and to prevent typing errors.
  2. SendSMS allows sending SMS messages through a specific SMS Gateway. 

Localise the insuree number validation escape procedure

In this guide, we will localise the isValidInsuranceNumber method. 

Parameters Returns

InsuranceNumber String

the insuree number to validate.

Boolean

true if the insuree number is valid; otherwise, false.

This is the generic implementation of the method:

Code Block
languagevb
themeRDark
firstline1
linenumberstrue
Public Function isValidInsuranceNumber(ByVal InsuranceNumber As String) As Boolean
   Return True
End Function

The generic method is returning always true, meaning any insuree number will be a valid one. 

Let's take for example the following insuree number requirements:

  1. The insuree number must follow the modulo 9 rule: the last digit is the modulo 9 of the number without the last digit
  2. The insuree number must have 10 digits ('0' at the beginning must be saved)

These requirements are satisfied by the following escape procedure: 

Code Block
languagevb
themeRDark
firstline1
linenumberstrue
Public Function isValidInsuranceNumber(ByVal InsuranceNumber As String) As Boolean
    If Not InsuranceNumber.ToString.Length = 10 Then Return False
    Dim N As String = Left(InsuranceNumber.ToString, 9)
    Dim Modulo As String = Right(InsuranceNumber.ToString, 1)
    If Modulo = N - (Int(N / 7) * 7) Then Return True
    Return False
End Function

...

To apply the new modification to the escape procedures, the Web Application .Net solution needs to be published and deployed