This function links the usual prescription to the letter of the selected patient.
object.LinkUsualPrescription
aUsualPrescription
Part | Attribute | Type | Description |
---|---|---|---|
object |
Required | The object always implements the
ISLetter interface |
|
aUsualPrescription |
In, Required | The usual prescription linked to the
letter |
Link the usual prescription to the letter of the selected patient and display its ID.
sub main
Dim aPatient
Dim aLetters, aLetter
Dim aUsualPrescriptions, aUsualPrescription
Dim aMessage
Set aPatient = Profile.SelectPatient
set aLetters = aPatient.GetLetters (1) ' slcfWordRTF
aMessage = "INITIAL STATE:" & GetLinkedUsuslaMedicationsInfo(aLetters)
set aUsualPrescriptions = aPatient.Medications.Usual
for each aLetter in aLetters
for each aUsualPrescription in aUsualPrescriptions
aLetter.LinkUsualPrescription aUsualPrescription
next
next
aMessage = aMessage & vbNewLine & vbNewLine &_
"LETTERS AFTER USUAL PRESCRIPTIONS LINKING:" & GetLinkedUsuslaMedicationsInfo(aLetters) & vbNewLine
Profile.MsgBox(aMessage)
end sub
function GetLinkedUsuslaMedicationsInfo(aLetters)
Dim aInfo
Dim aLetter
Dim aUsualPrescriptions, aUsualPrescription
for each aLetter in aLetters
aInfo = aInfo & vbNewLine & "Letter Id: " & aLetter.Id
set aUsualPrescriptions = aLetter.LinkedUsualPrescriptions
if aUsualPrescriptions.Count > 0 then aInfo = aInfo & vbNewLine & " Med IDs: "
for each aUsualPrescription in aUsualPrescriptions
aInfo = aInfo & aUsualPrescription.Oid & ", "
next
next
GetLinkedUsuslaMedicationsInfo = aInfo
end function
In Profile Client v8 on User Interface Usual Prescriptions can be found and linked in
or in .