This function returns the registry keys of the HRI by the code.
object.GetRegistryKeysByCode(aKeyCode)
| Part | Attribute | Type | Description |
|---|---|---|---|
object |
Required | The object always implements the
ISHRI interface |
|
aKeyCode |
In, Required | string |
The code of the registry key |
Display some information about the CDO forms contents, including the HRI registry keys loaded by the specified code.
sub main
Dim aPatient
Dim aFilter
Dim aCDOForms, aCDOForm
Dim i
Dim aMessage
Set aPatient = Profile.SelectPatient
set aFilter = Profile.CreateCdoFormFilter
aFilter.PatientId = aPatient.Id
set aCDOForms = Profile.LoadCdoForms(aFilter) ' ISHRObservations
aMessage = "CDO Forms (Count = " & aCDOForms.Count & "):"
for i = 0 to aCDOForms.Count - 1
set aCDOForm = aCDOForms.Item(i) 'ISHRObservation
aMessage = aMessage & vbNewLine & (i + 1) & ") " & aCDOForm.Name &_
GetHRCInfo(aCDOForm.AsHRC, 0)
next
Profile.MsgBox(aMessage)
end sub
function GetHRIInfo(aHRI, aLevel)
Dim aCode
Dim aList
Dim aSep
Dim aInfo
Dim i
Dim aRegistryKey
aCode = "RM1"
set aList = aHRI.GetRegistryKeysByCode(aCode)
aSep = Space(4 * aLevel)
aInfo = vbNewLine &_
aSep & " * HRI name: " & aHRI.Name & VbNewLine &_
aSep & " The number of the Registry Keys with code '" & aCode &_
"' is " & aList.Count & VbNewLine
for i = 0 to aList.Count - 1
set aRegistryKey = aList.Item(i)
aInfo = aInfo & aSep & " " & (i + 1) & ") " &_
aRegistryKey.KeyCode.Code & vbTab & aRegistryKey.KeyCode.Description &_
vbNewLine
next
GetHRIInfo = aInfo
end function
function GetHRCInfo(aHRC, aLevel)
Dim aSep
Dim aInfo
Dim i
Dim aObs
aSep = Space(4 * aLevel)
aInfo = vbNewLine &_
aSep & " * HRC name: " & aHRC.Name & VbNewLine
for i = 0 to aHRC.Count - 1
set aObs = aHRC.Item(i)
if aObs.IsHRI then
aInfo = aInfo & GetHRIInfo(aObs.AsHRI, aLevel + 1)
else
aInfo = aInfo & GetHRCInfo(aObs.AsHRC, aLevel + 1)
end if
next
GetHRCInfo = aInfo
end function