ISCase.CreateCaseService

Description

This function adds a new group (service unit or place of service) that should be involved in the case.

Syntax

object.CreateCaseService(aPOSCode)

Part Attribute Type Description
object Required
The object always implements the ISCase interface
aPOSCode In, Required
string
The code of the POS that should be involved in the case

Return Value

ISCaseService

Returns the added case service.

Example

Add a new case sub-referral to the selected case and display the information about all case sub-referrals of this case.

Dim aResult
Dim aPatientID
Dim aCaseID
Dim aCase
Dim aNewCaseService
Dim aFilter
Dim aCaseServises, aCaseService 
Dim aMessage

aResult = Profile.Lookup_PatientCaseSearch(aPatientID, aCaseID, "Case Search", True)

Set aCase = Profile.OpenCase(aCaseID)

set aNewCaseService = aCase.CreateCaseService("POS")
aNewCaseService.Opened = Now
aNewCaseService.Reason = "Automatically created case sub-referral"

set aFilter = Profile.CreateCaseServiceFilter
aFilter.CaseID = aCaseID 
set aCaseServises = Profile.LoadCaseServices(aFilter) 

aMessage = "Case Services Count = " & aCaseServises.Count
 
for i = 0 to aCaseServises.Count -1 
  set aCaseService = aCaseServises.Item(i)
  aMessage = aMessage & vbNewLine & (i + 1) & ") Case service info: " & vbNewLine &_ 
    "ID = " & aCaseService.ID & vbNewLine & "Pos Code = " & aCaseService.PosCode &_
    vbNewLine & "Opened on " & aCaseService.Opened & vbNewLine & "Reason = " &_
    aCaseService.Reason
next  

Profile.MsgBox(aMessage)   
Note:

In Profile Client v8 on User Interface Case Sub-Referral can be added and found in Organisation > Work Centre > Work > Cases > Edit Case > Administrative > Case Sub-Refferals.

Version information

Added in v7.8.0