ISProfile.CreateEncounter

Description

This function creates a new encounter.

Syntax

object.CreateEncounter(aPatientID, aCaseID = 0)

Part Attribute Type Description
object Required
The object always implements the ISProfile interface
aPatientID In, Required
int
ID of the patient
aCaseID In, Required
Default value is 0
int
ID of the case

Return Value

ISEncounter

Returns the created encounter.

Example

Add a new encounter and display some information about it.

sub main
  Dim aPatient, aPatientID
  Dim aCadeID
  Dim aEncounter
  Dim aMessage

  set aPatient = Profile.SelectPatient
  aPatientID = aPatient.ID 
  aCaseID = 0
  set aEncounter = Profile.CreateEncounter(aPatientID, aCaseID)

  aMessage = "Encounter after creating: " & vbNewLine &_
    GetEncounterInfo(aEncounter)

  aEncounter.SetAutoCreatedValues

  aMessage = aMessage & vbNewLine &_
    "Encounter after updating fields: " & vbNewLine &_
    GetEncounterInfo(aEncounter)

  Profile.MsgBox(aMessage)
end sub

function GetEncounterInfo(aEncounter)
  Dim aInfo
  Dim aSection
  
  aInfo = "ID: " & aEncounter.ID & vbNewLine &_
    "Is New: " & aEncounter.IsNew & vbNewLine &_  
    "Duration (seconds): " & CDbl(Round(aEncounter.Duration * 24 * 60 * 60)) & vbNewLine &_
    "Type Description: " & aEncounter.TypeDescription & vbNewLine
  
  if aEncounter.Section > 0 then  
    set aSection = Profile.LoadShortCode(aEncounter.Section)
    aInfo = aInfo &_ 
      "Section: " & aSection.Description & vbNewLine
  end if     
  
  GetEncounterInfo = aInfo             
end function                   
Note:

In Profile Client v8 on User Interface Encounter can be created in Clinical > Medical Record > Encounters > New Encounter.

Version information

Added in v7.8.0