ISRxPackage.CmiDetail

Description

Consumer medicine information for the Rx package.

Syntax

object.CmiDetail(aInd)

Part Attribute Type Description
object Required
The object always implements the ISRxPackage interface
aInd In, Required
int
The index of Cmi detail
Restriction: This property is readonly.

Return Value

ISCmiDetail

Example

Display Cmi details for the Rx packages, loaded on the basis of the selected filter, in the HTML browser.

sub main
  Dim aFilter
  Dim aRxCollection, aRxPackage
  Dim aHTML, aHTMLPart
  Dim aContents 
  Dim i, j
  Dim aCmiDetail
  Dim aHTMStream
  Dim aLink
  Dim aBodyTagStart, aBodyTagEnd
  Dim aEndBodyTagStart
  Dim aResult   
  Dim aMessage

  Set aFilter = Profile.CreateRxFilter
  aFilter.RxName = "Pentasa"
  aFilter.IncludePreparations = False
  aFilter.IncludePackages = True
  aFilter.IncludeGroups = False
  aFilter.IncludeChemicals = False
  aFilter.RxNameSearchMode = 1 'rnsmStartsWith
  set aRxCollection = Profile.LoadRxCollection(aFilter)

  aHTML = ""
  aContents = ""

  for i = 0 to aRxCollection.Count - 1 
    set aRxPackage = aRxCollection.Item(i)
    for j = 0 to aRxPackage.CmiDetailCount - 1
      set aCmiDetail = aRxPackage.CmiDetail(j)   
      set aHTMStream = aCmiDetail.HTMLStream
  
      aContents = aContents & "<li><a href='#" & GetDetailLink(i, j) & "'>" &_
        aRxPackage.AsString & " - CMI Detail #" & (j + 1) & "</a></li>" 
    
      aHTMLPart = FixHTML(aHTMStream.AsString)
      aHTML = aHTML & "<hr>" &_
      "<a name='" & GetDetailLink(i, j) & "'>" &_
       "<p>" & aRxPackage.RxSystem.Name & "</p>" & aHTMLPart
    next 'j
  next 'i

  aHTML = "<H1>Search Results</H1>" &_
    "<p>for the Rx package name with substring '" & aFilter.RxName & "':</p>" & _   
    aContents & aHTML

  Profile.ShowHTML aHTML, "Loaded Formulary"
end sub

function GetDetailLink(aRxIndex, aDetailIndex)
  aLink = "Rx" & aRxIndex & "_" & aDetailIndex
  GetDetailLink = aLink
end function

function FixHTML(aHTML)
  aBodyTagStart = InStr(1, aHTML, "<BODY", vbTextCompare)
  aBodyTagEnd = InStr(aBodyTagStart, aHTML, ">")  
  aEndBodyTagStart = InStr(aBodyTagEnd, aHTML, "</BODY")  
  aResult = Mid(aHTML, aBodyTagEnd + 1, aEndBodyTagStart - aBodyTagEnd - 1)

  FixHTML = aResult
end function  
Note:

In Profile Client v8 on User Interface Cmi can be found in Maintain > Formulary > Rx > Show Consumer medicine information, in Clinical > Medical Record > New Encounter > Scripts > Usual Scrips tab > Show Consumer medicine informationor in Clinical > New Encounter > Scripts > Usual Scrips tab > Show Consumer medicine information.

Version information

Added in v8.4.0