ISQuestion.GetAnswerFileName

Description

This function returns the name of the file attached to the answer.

Syntax

object.GetAnswerFileName(aIndex)

Part Attribute Type Description
object Required
The object always implements the ISQuestion interface
aIndex In, Required
int
The index of the file attached to the answer

Return Value

string

Returns the name of the file attached to the answer.

Example

Display the number of questions and some information about them, including the names of the files attached to the answers.

Dim aPatient
Dim aQuestions, aQuestion
Dim aMessage
Dim i, j
Dim aAnswerFileName

Set aPatient = Profile.SelectPatient
set aQuestions = Profile.ProfileInternal.LoadQuestionsForPatient(aPatient.ID)
aMessage = "Questions Count = " & aQuestions.Count
for i = 0 to aQuestions.Count - 1
  set aQuestion = aQuestions.Item(i)
  aMessage = aMessage & vbNewLine &_
    "Title: " & aQuestion.Title & vbNewLine &_
    "Amend Date: " & aQuestion.AmendDate & vbNewLine &_
    "Answer: " & aQuestion.Answer & vbNewLine &_
    "Body: " & aQuestion.Body & vbNewLine &_
    "Date: " & aQuestion.Date & vbNewLine &_
    "Patient: " & aPatient.SurnameFirstName & vbNewLine &_
    "Status: " & aQuestion.Status & vbNewLine
  if aQuestion.GetAnswerFileCount <> 0 then 
    for j = 0 to aQuestion.GetAnswerFileCount - 1
      aAnswerFileName = aQuestion.GetAnswerFileName(j) 
      aMessage = aMessage & "Attached answer file name: " & aAnswerFileName & vbNewLine
    next
  end if  
next
Profile.MsgBox(aMessage)                       
Note:

In Profile Client v8 on User Interface Answer File Name can be found in Organisation > Work Centre > Work > Patient Items > Question Properties > Attach.

Version information

Added in v7.8.0