ISPatientProblem.GetRegistryKeysByCode

Description

This function returns the registry keys collection of the patient's problem by code.

Syntax

object.GetRegistryKeysByCode(aKeyCode)

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

Return Value

ISList

Returns the registry keys collection of the patient's problem by code.

Example

Add a new registry key with the specified code and value to the patient's problem and display all registry keys of this problem with the specified code.

Dim aTrans
Dim aPatient  
Dim aProblemList, aProblem
Dim aNewRegKey
Dim aProblem2
Dim aRegistryKeys, aRegistryKey
Dim aMessage

'The first mapping transaction
Set aTrans = Profile.StartMapTransaction

Set aPatient = Profile.SelectPatient 
set aProblemList = aPatient.ProblemList

if aProblemList.Count = 0 then
  Profile.MsgBox("The patient has no problems")
  exit sub
end if

set aProblem = aProblemList.Item(0)
set aNewRegKey = aProblem.AddRegistryKey("REGPROBLEM1", "NewRegKey_1")

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

aNewRegKey.SourceRef = "1234567890ABC"
aProblem.Save
aTrans.SnapShot

'The second mapping transaction
set aTrans = Profile.StartMapTransaction
set aProblem2 = Profile.LoadPatientProblemByGUID(aProblem.GUID) 
set aRegistryKeys = aProblem2.GetRegistryKeysByCode(aNewRegKey.KeyCode.Code)
aMessage = "Registry Keys count for the first problem = " &_ 
  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 Keys cannot be found.

Version information

Added in v8.2.0