This function adds a new Infant object to the patient's problem of 'Pregnancy' type.
object.AddInfant()
| Part | Attribute | Type | Description |
|---|---|---|---|
object |
Required | The object always implements the
ISPatientProblem interface |
Add a new Infant object to the selected patient's problem of 'Pregnancy' type, display the number of all Infant objects for this pregnancy, their names and statuses.
sub main
Dim aPatient
Dim aProblemList
Dim aCategory
Dim aProblems
Dim aNewInfant
Dim aMessage
Set aPatient = Profile.SelectPatient
if aPatient.Sex <> "F" then
Profile.MsgBox("You should select female patient!")
exit sub
end if
set aProblemList = aPatient.ProblemList
set aCategory = aProblemList.Categories.Item(5) 'Pregnancy
set aProblems = aCategory.Problems
aMessage = "The state before the changes: " & vbNewLine & GetPregnanciesInfo(aProblems)
if aProblems.Count > 0 then
set aNewInfant = aProblems.Item(0).AddInfant
aNewInfant.Name = "Bill"
else
Profile.MsgBox("No pregnancies")
exit sub
end if
aMessage = aMessage & vbNewLine &_
"The state after the changes: " & vbNewLine & GetPregnanciesInfo(aProblems)
Profile.MsgBox(aMessage)
end sub
function GetPregnanciesInfo(aProblems)
Dim aProblem
Dim aInfant
Dim aMessage
for i = 0 to aProblems.Count - 1
set aProblem = aProblems.Item(i)
aMessage = aMessage & " " & vbNewLine & "Code: " & aProblem.DxCode &_
"; Description: " & aProblem.DxDescription & vbNewLine
for j = 0 to aProblem.InfantCount - 1
set aInfant = aProblem.Infant(j)
aMessage = aMessage &_
" " & aInfant.Num & ") " & aInfant.Name & "; Status: " &_
aInfant.StatusText & vbNewLine
next 'j
next 'i
GetPregnanciesInfo = aMessage
end function In Profile Client v8 on User Interface Infants can be found in , in or in .