This function removes the specified rule day.
object.RemoveRuleDay
aDayIndex
Part | Attribute | Type | Description |
---|---|---|---|
object |
Required | The object always implements the
ISPatientRule interface |
|
aDayIndex |
In, Required | int |
The index of the day to be removed |
Remove the specified rule day from the patient rule and display the patient rules loaded by the specified patient ID, their descriptions, dates when they were created and the provider they were created by.
sub main
Dim aTrans
Dim aPatient
Dim aPatientId
Dim aRules
Dim aRule
Dim aMessage
set aTrans = Profile.StartMapTransaction
Set aPatient = Profile.SelectPatient
aPatientId = aPatient.Id
set aRules = Profile.LoadPatientRules(aPatientId)
aMessage = "Before removing the day: " & vbNewLine & GetpatientRulesAsText(aRules)
if aRules.Count > 0 then
set aRule = aRules.Item(0)
aMessage = aMessage & vbNewLine & "Try to remove a rule day" & aRule.Description &_
vbNewLine
aRule.RemoveRuleDay 2
end if
aTrans.Commit
set aTrans = Profile.StartMapTransaction
set aRules = Profile.LoadPatientRules(aPatientId)
aMessage = aMessage & vbNewLine & "After removing the day: " & vbNewLine &_
GetpatientRulesAsText(aRules)
Profile.MsgBox(aMessage)
end sub
function GetpatientRulesAsText(aRules)
Dim aText
Dim aProvider
Dim aRule
Dim i
aText = "The number of the patint rules is " & aRules.Count & vbNewLine
for i = 0 to aRules.Count - 1
set aRule = aRules.Item(i)
set aProvider = Profile.LoadProviderById(aRule.CreatedBy)
aText = aText & "The patient rule '" & aRule.Description &_
"' was created on " & aRule.CreatedOn & " by " & aProvider.FullName & vbNewLine
next
GetpatientRulesAsText = aText
end function
In Profile Client v8 on User Interface Removed Rule Day cannot be found, but the days of the patient rules can be found in
.