ISHRC.ParentTrans

Description

The parent transaction of the HRC.

Syntax

object.ParentTrans

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

Return Value

ISCDOTransaction

Example

Display some information about the CDO forms contents, including the dates when their observations were created and the user who created them.

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 aTrans
  Dim aSep
  Dim aInfo
  
  set aTrans = aHRI.ParentTrans 
  
  aSep = Space(4 * aLevel)
  aInfo = vbNewLine &_ 
    aSep & " * HRI name: " & aHRI.Name & VbNewLine &_
    aSep & " - Transaction Created On: " & aTrans.CreatedOn & VbNewLine      
  if not aTrans.CreatedBy is nothing then   
    aInfo = aInfo &_
      aSep & " - Transaction Created By: " & aTrans.CreatedBy.FullName & VbNewLine  
  end if     
  GetHRIInfo = aInfo
    
end function

function GetHRCInfo(aHRC, aLevel)
  Dim aTrans
  Dim aSep
  Dim aInfo
  Dim i
  Dim aObs 
 
  set aTrans = aHRC.ParentTrans 
 
  aSep = Space(4 * aLevel)
  aInfo = vbNewLine &_ 
    aSep & " * HRC name: " & aHRC.Name & VbNewLine &_
    aSep & " - Transaction Created On: " & aTrans.CreatedOn & VbNewLine       
  if not aTrans.CreatedBy is nothing then   
    aInfo = aInfo &_
      aSep & " - Transaction Created By: " & aTrans.CreatedBy.FullName & VbNewLine  
  end if 
    
  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      
Note:

Version information

Added in v7.8.0