ISEncounter.ServiceCode

Description

The service code of the first contact of the encounter.

Syntax

object.ServiceCode

Part Attribute Type Description
object Required
The object always implements the ISEncounter interface
Restriction: This property is readonly.

Return Value

string

Example

Display the number of the encounters and some information about them, including the service codes.

Dim aPatient
Dim aService, aServiceDescription
Dim aFilter
Dim aEncounters, aEncounter
Dim i
Dim aMessage

set aPatient = Profile.SelectPatient
set aService = Profile.LoadService("CON") 
set aFilter = Profile.CreateEncounterFilter 
aFilter.PatientId = aPatient.Id
aFilter.ActivityId = aService.Id 
set aEncounters = Profile.LoadEncounters(aFilter)

aMessage = "The number of Encounters is " & aEncounters.Count & vbNewLine

for i = 0 to aEncounters.Count - 1
  set aEncounter = aEncounters.Item(i)
 
  if aEncounter.ServiceID > 0 then
    set aService = Profile.LoadServiceById(aEncounter.ServiceID)
    aServiceDescription = aService.Description & " (" & aService.Code & ")"
  else
    aServiceDescription = " - "
  end if     
 
  aMessage = aMessage & vbNewLine &_
    (i + 1) & ") The Patient Name: " & aPatient.SurnameFirstName & vbNewLine &_
    "     The Encounter Date: " & aEncounter.Date & vbNewLine &_
    "     Service Description: " & aServiceDescription & vbNewLine &_
    "     Service ID: " & aEncounter.ServiceID & vbNewLine &_
    "     Service Code: " & aEncounter.ServiceCode & vbNewLine     
next      

Profile.MsgBox(aMessage)
Note:

In Profile Client v8 on User Interface Service Code cannot be found.

Version information

Added in v7.8.0