ISMovement.Delete

Description

This function deletes the patient's movements.

Syntax

object.Delete

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

Example

Display the number of the movements before and after deleting, some information about them.

sub main

  Dim aTrans
  Dim aPatient
  Dim aFilter
  Dim aMovements
  Dim aMovement
  Dim aMessage
  Dim i

  Set aTrans = Profile.StartMapTransaction

  set aPatient = Profile.SelectPatient
  set aFilter = Profile.CreateMovementFilter
  aFilter.PatientID = aPatient.ID
  set aMovements = Profile.LoadMovements(aFilter)

  aMessage = "The number of movements before deleting is " & vbNewLine & GetMovementsInfo(aMovements)
  
  if aMovements.Count > 0 then
    set aMovement = aMovements.Item(0) 
    aMovement.Delete
  end if
  
  aTrans.Commit
  
  set aTrans = Profile.StartMapTransaction 
  set aMovements = Profile.LoadMovements(aFilter)

  aMessage = aMessage & vbNewLine & "The number of movements after deleting is " & vbNewLine &_
  GetMovementsInfo(aMovements)
  
  Profile.MsgBox(aMessage)  
  
end sub

function GetMovementsInfo(aMovements)
  Dim aText

  aText = "The number of the movements is " & aMovements.Count & vbNewLine
  for i = 0 to aMovements.Count - 1
    set aMovement = aMovements.Item(i)
    aText = aText & "The movement from '" & aMovement.PhysicalLocationFrom &_
      "' to " & aMovement.PhysicalLocationTo  
  next  
    
  GetMovementsInfo = aText
end function   
Note:

In Profile Client v8 on User Interface Movements can be found and deleted in Clinical > Medical Record > Movements or in Patient > Cases > Administrative > Movements.

Version information

Added in v7.8.0