ISRxMedication.AddRegistryKey

Description

This function adds a new registry key to the Rx medication.

Syntax

object.AddRegistryKey(aKeyCode, aKeyValue)

Part Attribute Type Description
object Required
The object always implements the ISRxMedication interface
aKeyCode In, Required
string
The code of the registry key
aKeyValue In, Required
string
The value of the registry key

Return Value

ISRegistryKey

Returns the added registry key.

Example

Add a new registry key with the specified code and value to the Rx medication.

Dim aRxMedication
Dim aList
Dim aKeyCode, aKeyValue
Dim aRegistryKey  
Dim aRxMedicationInfo  
 
Set aRxMedication = Profile.LoadRxMedication(1507)

if aRxMedication is nothing then 
  Profile.MsgBox("There is no Rx Medication with the specified ID")
  exit sub
else 
  set aList = aRxMedication.GetRegistryKeys 
  aKeyCode = "CODE1"
  aKeyValue = "Code1" 
  set aRegistryKey = aRxMedication.AddRegistryKey(aKeyCode, aKeyValue)
  if not aRegistryKey is nothing then
    aRxMedicationInfo = aMessage & vbNewLine & "New Registry Key with code '" &_
      aKeyCode & "' was added successfully " &_
      "(Id= " & aRegistryKey.Id & ", Key Value = " & aRegistryKey.KeyValue & ")"
  else 
    aRxMedicationInfo = "There is no Registry Key with the specified code" 
  end if  
end if

Profile.MsgBox(aRxMedicationInfo)  
Note:

In Profile Client v8 on User Interface Registry Key cannot be found, but the possible codes of Registry Keys can be found in Maintain > Short Codes > Type 'Registry (Rx)'.

Version information

Added in v8.2.0