Private Sub HL_Click(sender As Object, e As EventArgs) Handles HL.Click If vld(TxtProcode) = False Then Exit Sub End If Dim file As System.IO.StreamWriter Dim fileDateTime As String = DateTime.Now.ToString("yyyyMMdd") & DateTime.Now.ToString("HHmmss") & ".HL7" Dim ts As String = DateTime.Now.ToString("yyyyMMdd") & DateTime.Now.ToString("HHmmss") file = My.Computer.FileSystem.OpenTextFileWriter("C:\psave\New folder\" & fileDateTime, True) TxtDob.Format = DateTimePickerFormat.Custom TxtDob.CustomFormat = "yyyyMMdd" TxtExamtime.Format = DateTimePickerFormat.Custom TxtExamtime.CustomFormat = "hhMMss" TxtExamdate.Format = DateTimePickerFormat.Custom TxtExamdate.CustomFormat = "yyyyMMdd" file.WriteLine("MSH|^~\&|||||" & TxtExamdate.Text & "" & TxtExamtime.Text & "||ORM^O01||P|2.3.1") file.WriteLine("PID|||" & TxtId.Text & "||" & TxtFamilyname.Text & "^" & TxtGivenname.Text & "||" & TxtDob.Text & "||" & TxtGender.Text & "|||" & TxtStreet.Text & " " & TxtHouse.Text & "^^" & TxtCity.Text & "^^" & TxtPostcode.Text) file.WriteLine("PV1||O|||||||||||||||||" & TxtId.Text & "|||||||||||||||||||||||||" & ts) file.WriteLine("ORC|NW|" & ts & "|||||^^^S||" & TxtExamdate.Text) file.WriteLine("OBR||" & ts & "^" & ts & "||" & TxtProcode.Text & "|||" & TxtExamdate.Text & "" & TxtExamtime.Text & "|" & TxtExamdate.Text & "" & TxtExamtime.Text) file.WriteLine() file.Close() MessageBox.Show("HL7 Message Saved to " & fileDateTime, "HL7") TxtDob.Format = DateTimePickerFormat.Short TxtExamtime.CustomFormat = "hh:MM tt" TxtExamdate.CustomFormat = "dd-MMM-yy" End Sub
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)