ISPatientMessage.AddAttachment

Description

This function adds an attachment to the patient's message.

Syntax

object.AddAttachment aFileName, aMimeType, aContent

Part Attribute Type Description
object Required
The object always implements the ISPatientMessage interface
aFileName In, Required
string
The name of the added file
aMimeType In, Required
string
MIME type is an Internet standard that describes the contents of Internet files based on their natures and formats, contains two parts: a type and a sub-type. For example, image/jpeg (JPEG Image).
aContent In, Required
The data stream that contains the body of the file being added

Example

Add the attachment to the message created by the macro.

Dim aPatient
Dim aProvider
Dim aCustomMsg
Dim aStream
Dim aMessage 

Set aPatient = Profile.SelectPatient
set aProvider = Profile.LoadProvider("MM")

if aProvider.ID = 0 then
  Profile.MsgBox("There is no provider with the specified code")
  exit sub
end if

set aCustomMsg = Profile.CreateCustomPatientMessage(1, aPatient.ID, aProvider.ID,_
  "Hello!")   
  
set aStream = Profile.makeStream
aStream.LoadFromFile("D:\Usiaka\Images\1.jpg")
aCustomMsg.AddAttachment "D:\Usiaka\Images\1.jpg", "image/jpeg", aStream

aMessage = "A new message with the added attachment was created successfully!"
   
Profile.MsgBox(aMessage)  
Note:

In Profile Client v8 on User Interface Attachment can be added only by the patient through Accession, the added Attachment can be found in Clinical > Medical Record > Messages or in Organisation > Work Centre > Communication > Conversations.

See also

Version information

Added in v8.2.0