Substances SQL Functions

CASCO_Sub_NameList

Display the description name of all substances for the case. The substance verbatim will be returned preceded by ‘(v)-‘ if the description does not exist.

Optionally all or the first x number of substances.

Optionally display additional substance information based on the parameter options passed

 

Return Value:

Returns a text list of all miscellaneous scenarios.

Parameters:

CaseNumber, CenterCode, YearCode: Uniquely Identifies the case for which the information should be returned

Substance Delimiter: Characters to display for each separate value.

Item Delimiter: Characters to display for each sub-item of the substance.

Number of Substances:

0: returns all substances

Higher than 0 specifies the maximum number of substances you want returned.

Substance Data to include:

0: returns the description or the verbatim if the description is not present.

1: also includes the substance quantity

2:  includes 1+ Formulation, Certainty, and concentration

3: includes 2+ Generic and Poisindex codes

Example:                  

(dbo.CASCO_Sub_NameList(ToxPat.CaseNumber, ToxPat.CenterCode, ToxPat.YearCode, Char(10), ', ', 0, 3)) As ‘Substance_List’