ISPatientProblem.VersionOnDate

Description

This function returns the version of the patient's problem record on the specified date.

Syntax

object.VersionOnDate(aDate)

Part Attribute Type Description
object Required
The object always implements the ISPatientProblem interface
aDate In, Required
DateTime
The date of the returned version

Return Value

ISPatientProblemVers

Returns the version of the patient's problem record on the specified date.

Example

Display the codes, descriptions and statuses of the patient's problems in the current and the selected versions.

sub main
  Dim aPatient
  Dim aProblemList
  Dim aCategories
  Dim aCategory
  Dim aProblems
  Dim aProblem
  Dim aProblemVers
  Dim aMessage
  
  Set aPatient = Profile.SelectPatient

  set aProblemList = aPatient.ProblemList
  set aCategories = aProblemList.Categories

  for each aCategory in aCategories
    aMessage = aMessage & vbNewLine & "---------" & aCategory.Description &_ 
      "---------"  & vbNewLine & vbNewLine 
    set aProblems = aCategory.Problems
    for each aProblem in aProblems
      if aProblem.ProblemType = 6 then  'ptPregnancy  
        aMessage = aMessage & "    " & GetProblemInfo(aProblem) & vbNewLine
      else 
        set aProblemVers = aProblem.VersionOnDate(#06/06/2019#)
        aMessage = aMessage & "    " & GetProblemInfo(aProblem) & vbNewLine
        if aProblemVers is nothing then
          aMessage = aMessage & "      - no version on this date" & vbNewLine
        else  
          aMessage = aMessage & "      -" & GetProblemInfo(aProblemVers) & vbNewLine 
        end if  
      end if           
    next ' aProblem
  next ' aCategory 

  Profile.MsgBox(aMessage)
end sub


function GetProblemInfo(aProblem)
  Dim aInfo
  
  aInfo = "Code: " & aProblem.DxCode & "; Description: " & aProblem.DxDescription
  if aProblem.ProblemType <> 6 then  'ptPregnancy
    aInfo = aInfo & " (Status = " & aProblem.Status & ")"    
  end if
  GetProblemInfo = aInfo
end function   
Note:

In Profile Client v8 on User Interface Versions can be found in Clinical > Medical Record > Problems > Open Problem > History, in Clinical > Clinical Details > Problems > Open Problem > Historyor in Patient > Cases > Clinical > Problems > Open Problem > History.

Version information

Added in v7.8.0