Open Visual Studio.Net and create a new class library project, which we shall call "phpclas". Click OK.
In the code window for class1 (class1.vb), type the following:
Public Class patient
Private m_lmp As Date
Public Property lmp()
Return Format(m_lmp, "D")
m_lmp = Value
Public ReadOnly Property edd()
'EDD is 280 days from LMP
Return Format(DateAdd(DateInterval.Day, 280, m_lmp), "D")
This VB.NET code shall calculate the EDD (Estimated Delivery Date) from the specified LMP (Last Menstrual Period) date for any patient, to implement this we have created a namespace HealthRecord and a public class patient with two public property lmp and edd, edd is a readonly property, which is calculated from lmp which could be set and also read.
We have used format function to format the date variable to human readable format; also we have used dateadd function to calculate the edd, which is 280 days from the lmp.