ISProfile.CreateLetter

Description

This function creates a new letter for the patient.

Syntax

object.CreateLetter(aPatientID, aLetterTemplateId)

Part Attribute Type Description
object Required
The object always implements the ISProfile interface
aPatientID In, Required
int
ID of the patient
aLetterTemplateId In, Required
int
ID of the letter template

Return Value

ISLetter

Returns the created letter for the patient.

Example

Create a new letter for the patient.

Dim aPatient
Dim aLetters, aLetter
Dim aTemplate, aTemplateId
Dim aNewLetter
Dim i
Dim aMessage

Set aPatient = Profile.SelectPatient
set aLetters = aPatient.GetLetters (1) ' slcfWordRTF

aMessage =_
  "The number of the letters of the selected format is " & aLetters.Count

aTemplateId = 0

for i = 0 to aLetters.Count - 1
  set aLetter = aLetters.Item(i)
  set aTemplate = aLetter.Template 
  if not aTemplate is nothing then 
    if aTemplate.Subject = "Consultation Slips" then
      aTemplateId = aLetter.Template.ID
    end if  
  end if        
next

if aTemplateId > 0 then
  set aNewLetter = Profile.CreateLetter (aPatient.ID, aTemplateId) 
  aMessage = aMessage & vbNewLine & " The letter was successfully created "
else  
  aMessage = aMessage & vbNewLine & " There is no letter template with the specified subject"
end if  
  
Profile.MsgBox(aMessage)  
Note:

In Profile Client v8 on User Interface Letters can be found in Clinical > Medical Record > Documents or in Organisation > Work Centre > Communication > Letters.

Version information

Added in v7.8.0