ISCase.GetRegistryKeysByCode

Description

This function returns the registry keys collection of the case by code.

Syntax

object.GetRegistryKeysByCode(aKeyCode)

Part Attribute Type Description
object Required
The object always implements the ISCase interface
aKeyCode In, Required
string
The code of the registry key. The possible key codes can be found in Maintain/Short Codes/Type 'Registry Key'

Return Value

ISList

Returns the registry keys collection of the case by code.

Example

Add a new registry key with the specified code and value to the created case and display all registry keys of this case.

Dim aTrans
Dim aFilter
Dim aPatient 
Dim aCaseTypes, aCaseType
Dim aNewCase
Dim aNewRegKey
Dim aRegistryKeys, aRegistryKey
Dim i 
Dim aMessage

Set aTrans = Profile.StartMapTransaction  
set aFilter = Profile.CreateCaseTypesFilter
aFilter.Description = "Case Type 1" 
set aCaseTypes = Profile.LoadCaseTypes(aFilter)

if aCaseTypes.Count = 0 then 
  Profile.MsgBox("No case type with the specified description")
  exit sub
end if
  
set aCaseType = aCaseTypes.Item(0)

set aPatient = Profile.SelectPatient
set aNewCase = Profile.CreateCase(aPatient.ID)
aNewCase.CaseTitle = "New Case147"
aNewCase.CaseType = aCaseType
set aNewRegKey = aNewCase.AddRegistryKey("REG1", "NewRegKey_1")

if aNewRegKey is nothing then 
  Profile.MsgBox("No registry key with the specified code")
  exit sub
end if

aTrans.SnapShot 
  
set aRegistryKeys = aNewCase.GetRegistryKeysByCode(aNewRegKey.KeyCode.Code)
aMessage = aNewCase.CaseTitle & " was opened on " & aNewCase.OpenedOn &_ 
  vbNewLine & "Registry Keys Сount = " & aRegistryKeys.Count & vbNewLine 

for i = 0 to aRegistryKeys.Count - 1
  set aRegistryKey = aRegistryKeys.Item(i)
  aMessage = aMessage & "'" & aRegistryKey.KeyCode.Description & "' = '" &_ 
    aRegistryKey.KeyValue & "'" & vbNewLine 
next   

Profile.MsgBox(aMessage)    
Note:

In Profile Client v8 on User Interface Registry Key can be found in Organisation > Work Centre > Work > Cases > Edit Case > Administrative > Registry.

Version information

Added in v8.4.0