ISProfileForm.SetCurrentContact

Description

This function links the form to the encounter contact.

Syntax

object.SetCurrentContact aContact

Part Attribute Type Description
object Required
The object always implements the ISProfileForm interface
aContact In, Required
The encounter contact

Example

Check if the form is linked to the encounter. If not, open the encounter editor and link the form to the first encounter contact.

Dim aEncounter 
Dim aEncounterEditor
Dim aFormContact

Set aEncounter = Form.FindLinkedEncounterViaActionLinks
if not aEncounter is nothing then exit sub

if Profile.MsgBox("Do you want to create new encounter and link the form to it?",_
  vbYesNo + vbQuestion) = vbNo then exit sub

Profile.OpenEncounterEditor Form.PatientId, 0

set aEncounterEditor = Profile.EncounterEditor(Form.PatientId)

set aFormContact = aEncounterEditor.CurrentContact

aEncounterEditor.ActivateContact aFormContact.Id
Form.SetCurrentContact(aFormContact)
Form.Save  
Note: This macro should be executed in any event handler of the form control.

See also

Version information

Added in v7.10.60
parameter aContact modified in v7.11.0