ISMentalEvent.StateID

Description

ID of the short code of type 'Mental Health Patient State'.

Syntax

object.StateID

Part Attribute Type Description
object Required
The object always implements the ISMentalEvent interface

Return Value

int

Example

Display the number of the legal status changes, some information about them and the linked mental events, including their states.

Dim aFilter
Dim aLegalStatusChanges, aLegalStatusChange
Dim aMessage
Dim i 
Dim aEvent

set aFilter = Profile.CreateLegalStatusChangeFilter
aFilter.FromDate = #01/01/2020#
set aLegalStatusChanges = Profile.LoadLegalStatusChanges(aFilter)

aMessage = "Legal Status Changes Count = " & aLegalStatusChanges.Count
for i = 0 to aLegalStatusChanges.Count - 1
  set aLegalStatusChange = aLegalStatusChanges.Item(i)
  set aEvent = Profile.LoadMentalHealthEvent(aLegalStatusChange.EventID)
  
  aMessage = aMessage & vbNewLine & (i + 1) & ") " &_
    "Created Date/Time: " & aLegalStatusChange.CreatedDT & vbNewLine &_
    "    ID: " & aLegalStatusChange.ID & vbNewLine &_
    "    Modified Date/Time: " & aLegalStatusChange.ModifiedDT & vbNewLine 
    
  if not aEvent is nothing then
    aMessage = aMessage &_
      "Event Name: " & aEvent.Name & vbNewLine &_
      "Comment: " & aEvent.Comment & vbNewLine &_
      "Actions Comma Text: " & aEvent.ActionsCommaText & vbNewLine &_
      "Created On: " & aEvent.CreatedOn & vbNewLine &_
      "ID: " & aEvent.ID & vbNewLine &_
      "Legal Status: " & aEvent.LegalStatus & vbNewLine &_
      "Modified On: " & aEvent.ModifiedOn & vbNewLine &_
      "Reference Date: " & aEvent.ReferenceDate & vbNewLine 

    if aEvent.StateID > 0 then
      aMessage = aMessage &  "State: " & Profile.LoadShortCode(aEvent.StateID).Description & vbNewLine
    end if
    if aEvent.PatientId > 0 then 
      aMessage = aMessage & Profile.LoadPatient(aEvent.PatientId).SurnameFirstName & vbNewLine
    end if
  end if                                 
next                                          

Profile.MsgBox(aMessage)  
Note:

In Profile Client v8 on User Interface State ID cannot be found.

Version information

Added in v7.8.0