WA3.1 Escape procedures
openIMIS components: Web Application v1.3.0 and later.
Implementation roles required: Developer
We suggest using Visual Studio to update the escape procedures.
Video Tutorial
openIMIS Legacy Web Application - Escape Procedures
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. To modify the escape procedure, first download the source code from Github Web Application repository. Within the solution, go to IMIS_BL folder and open the EscapeBL.vb file.
There are 2 escape procedures that can be modified:
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 insuree number validity and to prevent typing errors.
SendSMS allows sending SMS messages through a specific SMS Gateway. It is used, for example, in Web Application Policy Renewal form to send the renewal SMS message to the family.
Localise the insuree number validation escape procedure
In this guide, we will localise the isValidInsuranceNumber method.
Parameters | Returns |
---|---|
InsuranceNumber String | Boolean |
This is the generic implementation of the method:
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:
The insuree number must follow the modulo 9 rule: the last digit is the modulo 9 of the number without the last digit
The insuree number must have 10 digits ('0' at the beginning must be saved)
These requirements are satisfied by the following escape procedure:
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 / 9) * 9) Then Return True
Return False
End Function
The isValidInsuranceNumber is executing the following steps:
validates the length of the insuree number (line 2)
splits the insuree number into number and modulo parts (lines 3 and 4)
validates the insuree number if the modulo part is equal to the modulo result (line 5)
all other cases are invalidated (line 6)
Other validations rules can be applied.
To apply the new modification to the escape procedures, the Web Application .Net solution needs to be published and deployed.
Did you encounter a problem or do you have a suggestion?
Please contact our Service Desk
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License. https://creativecommons.org/licenses/by-sa/4.0/