Skip to main content

HS.SDA3.LabResultItem

serial class HS.SDA3.LabResultItem extends HS.SDA3.SuperClass

LabResultItems are stored in the ResultItems property of an HS.SDA3.Result
containing atomic (as opposed to text) results (ResultType="AT"). Of the
three Order types that can have Results, only LabOrder can have atomic
results. RadOrder and OtherOrder can only have text results.
LabResultItems are parsed from HL7 by the HL7 Inbound Process operation of
the Edge production. Parsing is affected by the following settings:
- KeepDuplicateOBXIdentifiers
- ObservationCompatibilityMode (referred to here as Compatibility Mode
on or off).
- ActionCode="R" in ORC-1 for atomic lab results only
LabResultItems come in two flavors, regular and antibiotic sensitivity.
Sensitivities are part of microbiolgy results and are always "against" a
regular item (i.e. an organism identified in a culture). Structurally,
sensitivities are the same as regular items, and there is no one field that
distinguishes an item as a sensitivity (although if ResultInterpretation is
"S", "R", "I", "MS", or "VS", then the item is probably intended to be a
sensitivity). Rather it is the SubId, ResultInterpretation, and an item's
location in ResultItems relative to other items that distinguishes it as a
sensitivity. Basically, the logic to determine whether an item is a
sensitivity is:
-If ResultInterpretation is S, R, I, MS, or VS,
-And SubId is not null and is the same as the last non-sensitivity item
with a non-null SubId in the result,
-Then the item is a sensitivity against the last non-sensitivity item with
a non-null SubId,
-Else it is a regular item.
Consider this excerpt from an HL7 ORU message:
	OBX|1|ST|AAO^ORGANISM|1|MODERATE GROWTH||||||F
	OBX|2|ST|AAO^ORGANISM|2|STREP, BETA HEM GROUP A||||||F
	OBX|3|ST|AAT^METHOD||KB||||||F
	OBX|4|ST|AM^AMPICILLIN|2|SUSCEPTIBLE|||S|||F
	OBX|5|ST|CLIN^CLINDAMYCIN|2|SUSCEPTIBLE|||S|||F
	OBX|6|ST|E^ERYTHROMYCIN|2|RESISTANT|||R|||F
The 2nd OBX is the organism identified in the culture, and the 4th, 5th,
and 6th segments are the antibiotics tested against it.

In the OnUpdateSDAResult method of the LabOrder Streamlet class (invoked to
update a Result in place of the standard, generated code), for regular (not
sensitivity) items, inbound and existing items are matched on SubId and
TestItemCode.Code and .SDACodingStandard. If a match is found, UpdateSDA is
called on the existing item with the inbound item as its argument.
Otherwise the inbound item is inserted into ResultItems. Sensitivity items
in an update are not matched, but rather processed in "snapshot" mode. If
an update contains sensitivities with a given SubId, then all existing
sensitivities with that SubId are deleted and the inbound sensitivities
inserted into ResultItems after the corresponding "organism" item.

In the Viewer Cache, regular test items are stored as
lab.HS.EPVisitTestSetData, while sensitivities are stored as
lab.HS.EPVisitTestSetDataAntibiotics that are linked to a regular item via
the relationship between these two classes.

Also note that the matching of LabTestItem CodeTableDetails in the SDA to
CTTestCodes in the Viewer Cache can optionally use the ResultValueUnits
of this class as a match property. See the ResultValueUnits property for
more details.

Property Inventory

Method Inventory

Properties

property ActionCode as %String;
Not used.
Property methods: ActionCodeDisplayToLogical(), ActionCodeGet(), ActionCodeIsValid(), ActionCodeLogicalToDisplay(), ActionCodeLogicalToOdbc(), ActionCodeNormalize(), ActionCodeSet()
property ActionScope as %String;
Not used.
Property methods: ActionScopeDisplayToLogical(), ActionScopeGet(), ActionScopeIsValid(), ActionScopeLogicalToDisplay(), ActionScopeLogicalToOdbc(), ActionScopeNormalize(), ActionScopeSet()
property AnalysisTime as HS.SDA3.TimeStamp;
Time of analyis

HL7: OBX-19.1 : DateTimeoftheAnalysis.Time
VIEWERLIB: Not stored
Property methods: AnalysisTimeDisplayToLogical(), AnalysisTimeGet(), AnalysisTimeIsValid(), AnalysisTimeLogicalToDisplay(), AnalysisTimeLogicalToTimeStamp(), AnalysisTimeLogicalToXSD(), AnalysisTimeNormalize(), AnalysisTimeOdbcToLogical(), AnalysisTimeSet(), AnalysisTimeXSDToLogical()
property Comments as %String);
HL7ToSDA3:
Each instance of each NTE-3 following an OBX in an atomic result will be
parsed as one line in Comments. It is also possible for subsequent OBXs to
be parsed as Comments on the current one. If the current OBX-2 is "NM" and
the current OBX-4 is not null, and if the next segment is an OBX that
matches the current one on OBX-3.1 but not on OBX-4, then each instance of
the next OBX-5.1 will be parsed as a line in Comments. Each line will be
HL7-unescaped according to the annotation on
HS.Gateway.HL7.HL7ToSDA3:unescape. Once every instance of OBX-5.1 has been
parsed, then if the next segment is an OBX with the same OBX-3.1 and .2,
then that OBX-5.1 will be parsed in the same way. This will continue until
a non-OBX or an OBX that does not match on fields 3.1 and .2 is
encountered. Then, if any NTEs are following the last OBX, the NTE-3 values
will be parsed to Comments as well.

Streamlet cache:
Comments is not stored for antibiotic sensitivities. In the
OnUpdateSDAResult method, if a LabResultItem is determined to be a
sensitivity, Comments will be set to null.

Viewer cache:
For regular test items only (not sensitivities), the characters "^", "\",
and "|" in Comments will be translated to $C(16), $C(17), and $C(18),
respectively, before being saved to the Viewer Cache. (The reverse
translation is done when Comments is output to the Clinical Viewer.)
VISTDComments is set for regular test items only. Comments on sensitivites
are not stored in the Viewer Cache.

HL7: NTE-3 : Comments
HL7: OBX-5.1 : ObservationValue
VIEWERLIB: lab.HS.EPVisitTestSetData(VISTDComments)
Property methods: CommentsDisplayToLogical(), CommentsGet(), CommentsIsValid(), CommentsLogicalToDisplay(), CommentsLogicalToOdbc(), CommentsNormalize(), CommentsSet()
Provides a reason why the expected value for the Lab Result Item is missing. This field is not populated from HL7 v2 or CCDA. VIEWERLIB: Not stored
Property methods: DataAbsentReasonGet(), DataAbsentReasonGetObject(), DataAbsentReasonGetObjectId(), DataAbsentReasonGetSwizzled(), DataAbsentReasonIsEmpty(), DataAbsentReasonIsValid(), DataAbsentReasonNewObject(), DataAbsentReasonSet(), DataAbsentReasonSetObject(), DataAbsentReasonSetObjectId(), DataAbsentReasonUnSwizzle()
property EncounterNumber as %String (MAXLEN = 220);
Not used.
Property methods: EncounterNumberDisplayToLogical(), EncounterNumberGet(), EncounterNumberIsValid(), EncounterNumberLogicalToDisplay(), EncounterNumberLogicalToOdbc(), EncounterNumberNormalize(), EncounterNumberSet()
property EnteredBy as HS.SDA3.CodeTableDetail.User;
HL7ToSDA3:
Though OBX-16 is a repeating field, only the first non-null instance will
be parsed.

Streamlet cache:
EnteredBy is not stored for antibiotic sensitivities. In the
OnUpdateSDAResult method, if a LabResultItem is determined to be a
sensitivity, EnteredBy will be set to null.

HL7: OBX-16 : ResponsibleObserver
SDATableName=User, ViewerClass=User.HS.SSUser
VIEWERLIB: Not stored

.Code
HL7: OBX-16.1 : ResponsibleObserver.IDNumber
.Description
HL7ToSDA3:
The family and given names are concatenated together as "[Family], [Given]"
to make the Description.
HL7: OBX-16.2.1 : ResponsibleObserver.FamilyName.Surname
HL7: OBX-16.3 : ResponsibleObserver.GivenName
.SDACodingStandard
HL7: OBX-16.9 : ResponsibleObserver.AssigningAuthority
Property methods: EnteredByGet(), EnteredByGetObject(), EnteredByGetObjectId(), EnteredByGetSwizzled(), EnteredByIsEmpty(), EnteredByIsValid(), EnteredByNewObject(), EnteredBySet(), EnteredBySetObject(), EnteredBySetObjectId(), EnteredByUnSwizzle()
property Extension as HS.Local.SDA3.LabResultItemExtension;
Property methods: ExtensionGet(), ExtensionGetObject(), ExtensionGetObjectId(), ExtensionGetSwizzled(), ExtensionIsEmpty(), ExtensionIsValid(), ExtensionNewObject(), ExtensionSet(), ExtensionSetObject(), ExtensionSetObjectId(), ExtensionUnSwizzle()
property ExternalId as %String (MAXLEN = 220);
Not used.
Property methods: ExternalIdDisplayToLogical(), ExternalIdGet(), ExternalIdIsValid(), ExternalIdLogicalToDisplay(), ExternalIdLogicalToOdbc(), ExternalIdNormalize(), ExternalIdSet()
property FromTime as HS.SDA3.TimeStamp;
Not used.
Property methods: FromTimeDisplayToLogical(), FromTimeGet(), FromTimeIsValid(), FromTimeLogicalToDisplay(), FromTimeLogicalToTimeStamp(), FromTimeLogicalToXSD(), FromTimeNormalize(), FromTimeOdbcToLogical(), FromTimeSet(), FromTimeXSDToLogical()
property ObservationMethods as list of HS.SDA3.CodeTableDetail.ObservationMethod;
HL7ToSDA3:
OBX-17 is a repeating field. Each non-null instance will be parsed as one
ObservationMethod in this list.

HL7: OBX-17 : ObservationMethod
VIEWERLIB: Not stored

.Code
HL7: OBX-17.1 : ObservationMethod.Identifier
.Description
HL7: OBX-17.2 : ObservationMethod.Text
.SDACodingStandard
HL7: OBX-17.3 : ObservationMethod.NameofCodingSystem
.CodeSystemVersionId
HL7: OBX-17.7 : ObservationMethod.CodingSystemVersionID
.PriorCodes
HL7ToSDA3:
If OBX-17.4 or .5 are not null, then OBX-17.4, .5, .6, and .8 will be
parsed to a PriorCode as Code, Description, CodeSystem, and
CodeSystemVersionId, respectively.
HL7: OBX-17.4 : ObservationMethod.AlternateIdentifier
HL7: OBX-17.5 : ObservationMethod.AlternateText
HL7: OBX-17.6 : ObservationMethod.AlternateNameofCodingSystem
HL7: OBX-17.8 : ObservationMethod.AlternateCodingSystemVersion
Property methods: ObservationMethodsBuildValueArray(), ObservationMethodsCollectionToDisplay(), ObservationMethodsCollectionToOdbc(), ObservationMethodsDisplayToCollection(), ObservationMethodsGet(), ObservationMethodsGetObject(), ObservationMethodsGetObjectId(), ObservationMethodsGetSwizzled(), ObservationMethodsIsValid(), ObservationMethodsOdbcToCollection(), ObservationMethodsSet(), ObservationMethodsSetObject(), ObservationMethodsSetObjectId()
property ObservationTime as HS.SDA3.TimeStamp;
HL7: OBX-14.1 : DateTimeOfTheObservation.Time
VIEWERLIB: lab.HS.EPVisitTestSetData(VISTDInstrumentDate) + lab.HS.EPVisitTestSetData(VISTDInstrumentTime)
Property methods: ObservationTimeDisplayToLogical(), ObservationTimeGet(), ObservationTimeIsValid(), ObservationTimeLogicalToDisplay(), ObservationTimeLogicalToTimeStamp(), ObservationTimeLogicalToXSD(), ObservationTimeNormalize(), ObservationTimeOdbcToLogical(), ObservationTimeSet(), ObservationTimeXSDToLogical()
property ObservationValueType as %String;
HL7: OBX-2 : ValueType
VIEWERLIB: Not stored
Property methods: ObservationValueTypeDisplayToLogical(), ObservationValueTypeGet(), ObservationValueTypeIsValid(), ObservationValueTypeLogicalToDisplay(), ObservationValueTypeLogicalToOdbc(), ObservationValueTypeNormalize(), ObservationValueTypeSet()
property PerformedAt as HS.SDA3.CodeTableDetail.Organization;
PerformedAt / ProducersID
This can be used to specify the external organization that actually did the
test.

HL7ToSDA3:
If subfield 1 or 10 of OBX-23 is not null, Code, Description, and
SDACodingStandard will be parsed from OBX-23. Else if subfield 1 or 2 of
OBX-15 is not null, Code, Description, and SDACodingStandard will be parsed
from OBX-15.

Streamlet cache:
PerformedAt is not stored for antibiotic sensitivities. In the
OnUpdateSDAResult method, if a LabResultItem is determined to be a
sensitivity, PerformedAt will be set to null.

Viewer cache:
VISTDPerformedAtDR is set for regular test items only, not sensitivities.

HL7: OBX-15 : ProducersReference
HL7: OBX-23 : PerformingOrganizationName
HL7: OBX-24 : PerformingOrganizationAddress
HL7: OBX-25 : PerformingOrganizationMedicalDirector
SDATableName=Organization, ViewerClass=User.HS.CTHospital
VIEWERLIB: lab.HS.EPVisitTestSetData(VISTDPerformedAtDR)

.Code
HL7ToSDA3:
If being parsed from OBX-23, subfield 10 will be used if not null, else
subfield 3 will be used.
HL7: OBX-23.10 : PerformingOrganizationName.OrganizationIdentifier
HL7: OBX-23.3 : PerformingOrganizationName.IDNumber
HL7: OBX-15.1 : ProducersReference.Identifier
VIEWERLIB: User.HS.CTHospital(HOSPCode)
.Description
HL7: OBX-23.10 : PerformingOrganizationName.OrganizationName
HL7: OBX-15.2 : ProducersReference.Text
VIEWERLIB: User.HS.CTHospital(HOSPDesc)
.SDACodingStandard
HL7: OBX-23.6 : PerformingOrganizationName.AssigningAuthority
HL7: OBX-15.3 : ProducersReference.NameofCodingSystem
VIEWERLIB: Not stored

.Address
HL7ToSDA3:
Address will only be parsed from OBX-24 is subfield 1 or 5 is not null. For
the City, State, Zip, Country, and County properties, the HL7 field will be
parsed to the Code. HL7ToSDA3 does not set the Description.
HL7: OBX-24 : PerformingOrganizationAddress
.Address.Street
HL7ToSDA3:
If OBX-24.2 is not null, Street will be parsed as "[.1]; [.2]". Otherwise
Street will simply be parsed from OBX-24.1.
HL7: OBX-24.1 : PerformingOrganizationAddress.Street
HL7: OBX-24.2 : PerformingOrganizationAddress.OtherDesignation
VIEWERLIB: User.HS.CTHospital(HOSPAddress)
.Address.City
HL7: OBX-24.3 : PerformingOrganizationAddress.City
VIEWERLIB: User.HS.CTHospital(HOSPCity)
.Address.State
HL7: OBX-24.4 : PerformingOrganizationAddress.StateorProvince
VIEWERLIB: User.HS.CTHospital(HOSPProvinceDR)
.Address.Zip
HL7: OBX-24.5 : PerformingOrganizationAddress.ZiporPostalCode
VIEWERLIB: User.HS.CTHospital(HOSPZipDR)
.Address.Country
HL7: OBX-24.6 : PerformingOrganizationAddress.Country
VIEWERLIB: User.HS.CTHospital(HOSPCountryDR)
.Address.County
HL7: OBX-24.9 : PerformingOrganizationAddress.CountyParishCode
VIEWERLIB: User.HS.CTHospital(HOSPCountyParishDR)

.MedicalDirector
HL7ToSDA3:
MedicalDirector will only be parsed from OBX-25 if subfield 1, 2, or 9 is
not null.
HL7: OBX-25 : PerformingOrganizationMedicalDirector
VIEWERLIB: Not stored
.MedicalDirector.Code
HL7: OBX-25.1 : IDNumber
.MedicalDirector.Description
HL7ToSDA3:
The family and given names are concatenated together as "[Family], [Given]"
to make the Description.
HL7: OBX-25.2 : FamilyName
HL7: OBX-25.3 : GivenName
.MedicalDirector.SDACodingStandard
HL7: OBX-25.9 : AssigningAuthority
.MedicalDirector.Name.FamilyName
HL7: OBX-25.2 : FamilyName
.MedicalDirector.Name.GivenName
HL7: OBX-25.3 : GivenName
.MedicalDirector.Name.MiddleName
HL7: OBX-25.4 : SecondandFurtherGivenNamesorInitialsThereof
.MedicalDirector.Name.NamePrefix
HL7: OBX-25.6 : Prefix
.MedicalDirector.Name.NameSuffix
HL7: OBX-25.5 : Suffix
.MedicalDirector.Name.ProfessionalSuffix
HL7: OBX-25.21 : ProfessionalSuffix
Property methods: PerformedAtGet(), PerformedAtGetObject(), PerformedAtGetObjectId(), PerformedAtGetSwizzled(), PerformedAtIsEmpty(), PerformedAtIsValid(), PerformedAtNewObject(), PerformedAtSet(), PerformedAtSetObject(), PerformedAtSetObjectId(), PerformedAtUnSwizzle()
property ReferenceComment as %String (MAXLEN = 1000);
Streamlet cache:
ReferenceComment is not stored for antibiotic sensitivities. In the
OnUpdateSDAResult method, if a LabResultItem is determined to be a
sensitivity, ReferenceComment will be set to null.

Viewer cache:
VISTDHL7ReferenceComment is set for regular test items only, not
sensitivities.

VIEWERLIB: lab.HS.EPVisitTestSetData(VISTDHL7ReferenceComment)
Property methods: ReferenceCommentDisplayToLogical(), ReferenceCommentGet(), ReferenceCommentIsValid(), ReferenceCommentLogicalToDisplay(), ReferenceCommentLogicalToOdbc(), ReferenceCommentNormalize(), ReferenceCommentSet()
property ResultCodedValue as HS.SDA3.CodeTableDetail.ObservationValueCode;
Coded value of result

HL7ToSDA3:
If OBX-2 is "CE", "CWE", or "CNE" and OBX-5.3 is not null, then OBX-5 will
be parsed to ResultCodedValue.

HL7: OBX-5 : ObservationValue
VIEWERLIB: Not stored

.Code
HL7: OBX-5.1 : ObservationValue
.Description
HL7: OBX-5.2 : ObservationValue
.SDACodingStandard
HL7: OBX-5.3 : ObservationValue
.PriorCodes
HL7ToSDA3:
If subfield 4 or 5 of OBX-5 is not null, then subfields 4, 5, 6, and 8 will
be parsed to the Code, Description, CodeSystem, and CodeSystemVersionId,
respectively, of a PriorCode in the list of PriorCodes.
HL7: OBX-5.4 : ObservationValue
HL7: OBX-5.5 : ObservationValue
HL7: OBX-5.6 : ObservationValue
HL7: OBX-5.8 : ObservationValue
.CodeSystemVersionId
HL7: OBX-5.7 : ObservationValue
.OriginalText
HL7: OBX-5.9 : ObservationValue
Property methods: ResultCodedValueGet(), ResultCodedValueGetObject(), ResultCodedValueGetObjectId(), ResultCodedValueGetSwizzled(), ResultCodedValueIsEmpty(), ResultCodedValueIsValid(), ResultCodedValueNewObject(), ResultCodedValueSet(), ResultCodedValueSetObject(), ResultCodedValueSetObjectId(), ResultCodedValueUnSwizzle()
property ResultInterpretation as %String (MAXLEN = 100);
HL7ToSDA3:
Each non-null instance of OBX-8 (as it is repeating) will be parsed to
ResultInterpretation, separated by a comma. The value parsed may affect the
way OBX-3 is parsed to TestItemCode. See TestItemCode for more info.

Streamlet cache:
In the OnBeforeMatch method of the LabOrder Streamlet class, if
ResultInterpretation is not N, H, HH, L, LL, A, AA, S, I, R, MS, VS, null,
or two double quotes (the delete instruction), it will be set to null and a
warning logged. Also in the OnBeforeMatch method, LabResultItems with the
same SubId and TestItemCode.Code and .SDACodingStandard are consolidated as
they are considered to be the same item, except for items with
ResultInterpretation= S, R, I, MS, or VS, as this indicates an antibiotic
sensitivity, and the same antibiotic may appear multiple times in a result
if multiple organisms were detected.
In the OnUpdateSDAResult method, ResultInterpretation is used to determine
whether an item is a sensitivity. The full logic is:
-If (ResultInterpretation is S, R, I, MS, or VS,),
-and (SubId is not null),
-and ((this SubId appears in the existing data) OR (this SubId is the same
as for the last non-sensitivity item with a non-null SubId)),
-then this LabResultItem is a sensitivity,
-else is is a regular item.
Sensitivies are processed differently from regular items in this method.
See the annotations on each property for more info.
In the OnValidate method, if a LabResultItem has an abnormal
ResultInterpretation (H, HH, L, LL, A, or AA) or if it has no
ResultInterpretation but ResultValue is numeric, ResultNormalRange is a
numeric form, and ResultValue is outside of ResultNormalRange, then
ResultInterpretation of the containing Result will be set to "A".

Viewer cache:
ResultInterpretation is used in the Viewer Cache to determine whether to
insert a LabResultItem as a regular item (lab.HS.EPVisitTestSetData) or a
sensitivitiy (lab.HS.EPVisitTestSetDataAntibiotics). The full logic is:
-If ResultInterpretation is S, R, I, MS, or VS,
-and SubId is not null,
-and SubId matches the last regular test item inserted with a non-null
SubId, but is not the item itself,
-then insert the item as a sensitivity,
-else insert it as a regular test item.
If this item is inserted as a sensitivity, VISTAResultDR of the
EPVisitTestSetDataAntibiotics will reference the lab.HS.CTSensitivity with
CTSNCode=[ResultInterpretation]. Else ResultInterpretation will populate
VISTDInstrumentFlags of EPVisitTestSetData.

HL7: OBX-8 : AbnormalFlags
VIEWERLIB: lab.HS.EPVisitTestSetDataAntibiotics(VISTAResultDR)->lab.HS.CTSensitivity(CTSNCode)
VIEWERLIB: lab.HS.EPVisitTestSetData(VISTDInstrumentFlags)
Property methods: ResultInterpretationDisplayToLogical(), ResultInterpretationGet(), ResultInterpretationIsValid(), ResultInterpretationLogicalToDisplay(), ResultInterpretationLogicalToOdbc(), ResultInterpretationNormalize(), ResultInterpretationSet()
property ResultNormalRange as %String (MAXLEN = 220);
Streamlet cache:
In the OnBeforeMatch method of the LabOrder Streamlet class, for regular
(not sensitivity) test items, ResultNormalRange is normalized via a call to
NormalizeRange. The logic is:
-Strip out any control characters (via $ZSTRIP, mask code "C").
-If the first non-whitespace character is "<" or ">", the value is
unchanged.
-Else determine the high and low values of the range:
--If the first non-whitespace character is "-" and the value contains "/",
the low value is everything before the "/" and the high value is everything
after. (This assumes only one "/".)
--Else if the first non-whitespace character is "-" and the value contains
at least one more "-", the low value is everything before the second "-",
and the high value is everything after.
--Else the low value is everything before "-", and the high value
everything after. If there is no "-", the entire value is treated as the
low value.
-Once the high and low values have been determined, then if stripping the
leading and trailing whitespace ($ZSTRIP, mask code "W") would make them
valid numbers (determined by $IsValidNum), then this is done.
-If both the low and high values are not null, the value is returned as:
"[lo]-[hi]".
-If the low value is null and the high value is not:
--If the high value is a valid number ($IsValidNum), the value returned is
returned as "<[hi]", else the high value is returned.
-If the high value is null and the low value is not:
--If the low value is a valid number ($IsValidNum), the value returned is
returned as ">[lo]", else the low value is returned.
-Else a null string is returned.
After normalization, ResultNormalRange should have the form "<x", "<=x",
">x", ">=x", "-x-y", "x-y", or some non-numeric value. ResultNormalRange is
not used to calculate ResultInterpretation for this LabResultItem, however
it may be used to flag the containing Result as abnormal. In the OnValidate
method of the LabOrder Streamlet class, if a LabResultItem has an abnormal
ResultInterpretation (H, HH, L, LL, A, or AA) or if it has no
ResultInterpretation but ResultValue is numeric, ResultNormalRange is one
of the numeric forms, and ResultValue is outside of ResultNormalRange, then
ResultInterpretation of the containing Result will be set to "A".
ResultNormalRange is not stored for antibiotic sensitivities. In the
OnUpdateSDAResult method , if a LabResultItem is determined to be a
sensitivity, ResultNormalRange will be set to null.

Viewer cache:
ResultNormalRange is stored as separate high and low values in the Viewer
Cache. The logic to parse them out of the ResultNormalRange (which should
have been normalized) is:
-If the first non-whitespace character is "<", the value is stored as the
high value and the low value is null.
-Else if the first non-whitespace character is ">", the value is stored as
the low value and the high value is null.
-Else if the first non-whitespace character is "-", everything before the
second "-" is the low value and everything after is the high value. If
there isn't another "-", the entire value is stored as the low value.
-Else if the value contains at least one "-", everything before the first
"-" is the low value, and everything after is the high value.
-Else the value is stored as the low value.

HL7: OBX-7 : ReferencesRange
VIEWERLIB: lab.HS.EPVisitTestSetData(VISTDResultRefRangeLow) + lab.HS.EPVisitTestSetData(VISTDResultRefRangeHigh)
Property methods: ResultNormalRangeDisplayToLogical(), ResultNormalRangeGet(), ResultNormalRangeIsValid(), ResultNormalRangeLogicalToDisplay(), ResultNormalRangeLogicalToOdbc(), ResultNormalRangeNormalize(), ResultNormalRangeSet()
property ResultValue as %String);
Result's value

HL7ToSDA3:
The logic to parse ResultValue is:
-If OBX-2 is "TX" or "FT":
--Parse each instance of this OBX-5.1 (OBX-5 is repeating) to its own line
in ResultValue, HL7-unescaped according to the annotation on
HS.Gateway.HL7.HL7ToSDA3:unescape. If the next segment is an OBX with the
same values for OBX-3.1 and .2, parse that OBX-5.1 to this ResultValue in
the same way. Continue doing this until a non-OBX segment or an OBX with
different values in fields 3.1 or 3.2 is encountered.
-Else if Compatibility Mode is off and OBX-2="SN", parse ResultValue from
OBX-5 as: "[5.1][5.2][5.3][5.4]". Ex: if OBX-5 = ">^5", then
ResultValue = ">5"; if OBX-5="^1^-^10", then ResultValue="1-10".
-Else if Compatibility Mode is off and OBX-2 is "CE", "CNE", or "CWE",
parse OBX-5.2 to ResultValue.
-Else if OBX-2="DT", parse the first non-null instance of OBX-5.1
(converted from HL7 timestamp to XML timestamp format) to ResultValue.
-Else parse the first non-null instance of OBX-5.1 (HL7-unescaped according
to the annotation on HS.Gateway.HL7.HL7ToSDA3:unescape) to ResultValue.

Viewer cache:
The logic to insert ResultValue into the Viewer Cache is:
-If the LabResultItem is an antibiotic sensitivity:
--If the ResultValue consists of only punctuation and/or numbers, it is
inserted into the VISTAResultMIC property of
lab.HS.EPVisitTestSetDataAntibiotics.
--Else ResultValue is not inserted into the Viewer Cache.
-If the LabResultItem is not an antibiotic sensitivity, then the characters
"^", "\", and "|" in the ResultValue are translated to $C(16), $C(17), and
$C(18), respectively, before ResultValue is inserted into the VISTDTestData
property of lab.HS.EPVisitTestSetData. (The reverse translation will be
done when the data is displayed in the Clinical Viewer.)

HL7: OBX-5 : ObservationValue
VIEWERLIB: lab.HS.EPVisitTestSetDataAntibiotics(VISTAResultMIC)
VIEWERLIB: lab.HS.EPVisitTestSetData(VISTDTestData)
Property methods: ResultValueDisplayToLogical(), ResultValueGet(), ResultValueIsValid(), ResultValueLogicalToDisplay(), ResultValueLogicalToOdbc(), ResultValueNormalize(), ResultValueSet()
property ResultValueUnits as %String (MAXLEN = 30);
Units of result value

Streamlet cache:
ResultValueUnits is not stored for antibiotic sensitivities. In the
OnUpdateSDAResult method of the LabOrder Streamlet class, if a
LabResultItem is determined to be a sensitivity, ResultValueUnits will be
set to null.

Viewer cache:
For a regular (not sensitivity) test item, a "^" in ResultValueUnits will
be translated to $C(16) before being inserted into CTTCUnits. (The reverse
translation will be done when the value is displayed in the Clinical
Viewer.)
Also, if ResultValueUnits contains any "\" characters, these will be
translated to "_" before being stored in the Viewer Cache. This translation
is done in the Viewer Cache only. The original SDA is not affected.
When LabTestItem CodeTableDetails are compared to CTTestCodes in the Viewer
Cache to determine if there is a match, ResultValueUnits can optionally be
included in the matching. If the value of the Configuration Registry key
"\Viewer\LabTestItem\MatchOnUnits" is 1, then ResultValueUnits is used as
a match property. It must match the CTTCUnits value for the comparison to
be considered a match. Because of this, the CT_TestCode table can contain
multiple instances of the same Code (made unique by uniqueness suffixes) so
long as they have different CTTCUnits values. If this key is not set or if
the value is not 1, ResultValueUnits is not used as a match property.
LabTestItems will be matched on Code and SDACodingStandard only. If a
LabTestItem and a CTTestCode match but the units differ, CTTCUnits will be
updated with the ResultValueUnits value.
ResultValueUnits is not stored in the Viewer Cache for sensitivities.

HL7: OBX-6.1 : Units.Identifier
VIEWERLIB: lab.HS.EPVisitTestSetData(VISTDTestCodeDR)->User.HS.CTTestCode(CTTCUnits)
Property methods: ResultValueUnitsDisplayToLogical(), ResultValueUnitsGet(), ResultValueUnitsIsValid(), ResultValueUnitsLogicalToDisplay(), ResultValueUnitsLogicalToOdbc(), ResultValueUnitsNormalize(), ResultValueUnitsSet()
property SubId as %String (MAXLEN = 30);
An ID that ties together different parts of a result (e.g. multiple
organisms in a culture battery, multiple diagnostic impressions of a chest
x-ray, etc.)

HL7ToSDA3:
In some situations where an OBX-3.1 value appears more than once in a
result, OBX-4 may get appended to it to make the TestItemCode Code unique
within the Result. See TestItemCode for more info.
If OBX-2="NM", OBX-4 is not null, and the following segment is an OBX that
matches the current one on OBX-3.1 but not on OBX-4, then OBX-5.1 of the
next segment will be parsed to the Comments of the current LabResultItem.
See Comments for more info.

Streamlet cache:
Once saved to the Streamlet Cache, SubId cannot be deleted. In the
OnBeforeMatch method of the LabOrder Streamlet class, if the SubId of an
inbound LabResultItem is two double quotes (the delete instruction), it
will be set to null and a warning logged. LabResultItems with the same
SubId and TestItemCode.Code and .SDACodingStandard are considered to be the
same item, so in the OnBeforeMatch method, any matching LabResultItems in
the inbound ResultItems are condensed by calling UpdatedSDA on the first
item with the second as its argument, removing the second from ResultItems,
and repeating as necessary. Note that this excludes LabResultItems that are
susceptibilities (ResultInterpretation= "S", "R", "I", "MS", "VS") and
includes items with null SubIds.
In the OnUpdateSDAResult method, if an inbound LabResultItem is determined
not to be an antibiotic susceptibility, then it is compared to items in the
existing Result on SubId and TestItemCode.Code and .SDACodingStandard. If a
match is found, the existing item is updated by calling UpdateSDA on it with
the inbound item as its argument. Otherwise the inbound item is inserted
into the existing ResultItems.
Sensitivities are processed in snapshot mode, so if an inbound
LabResultItem is determined to be a sensitivity, then any existing
sensitivities with the same SubId are deleted, and the inbound item is
inserted into ResultItems after the organism item with the same SubId. This
deletion only happens once per update though, so sensitivities just
inserted will not be deleted.

Viewer cache:
A LabResultItem will be inserted into the Viewer Cache as a
lab.HS.EPVisitTestSetDataAntibiotics if the ResultInterpretation is "S",
"R", "I", "MS", or "VS", if SubId is not null, and if the last regular (not
sensitivity) item processed had the same SubId. The
EPVisitTestSetDataAntibiotics will be linked to the EPVisitTestSetData
created by that item via the relationship between them.
VISTDMachineDR is only set for regular (not sensitivity) items.

HL7: OBX-4 : SubId
VIEWERLIB: lab.HS.EPVisitTestSetData(VISTDMachineDR)
Property methods: SubIdDisplayToLogical(), SubIdGet(), SubIdIsValid(), SubIdLogicalToDisplay(), SubIdLogicalToOdbc(), SubIdNormalize(), SubIdSet()
property TestItemCode as HS.SDA3.CodeTableDetail.LabTestItem;
Code for test item

HL7ToSDA3:
The logic to parse TestItemCode is:
-SDACodingStandard is always parsed from OBX-3.3 and CodeSystemVersionId
from OBX-3.7.
-If OBX-2="NM", parse Code from OBX-3.1, Description from OBX-3.2, and set
IsNumeric to "true".
-Else if OBX-2="CE" and OBX-8 is not "S", "R", "I", "MS", or "VS":
--If KeepDuplicateOBXIdentifiers is true, or ORC-1="R", or the OBX-3.1 value
is unique in this result, or if it has not yet appeared in this result
with OBX-2="CE" or "ST", parse Code from OBX-3.1.
--Else if OBX-4 is not null, parse fields 3.1 and 4 to Code as "[3.1][4]".
--Else parse field 3.1 and the segment number to the Code as "[3.1][seg#]".
--Parse Description from OBX-3.2.
-Else if OBX-2="ST":
--If KeepDuplicateOBXIdentifiers is true, or ORC-1="R", or the OBX-3.1 value
is unique in this result, or if it has not yet appeared in this result
with OBX-2="CE" or "ST", parse Code from OBX-3.1.
--Else if OBX-4 is not null, parse fields 3.1 and 4 to Code as "[3.1][4]".
--Else parse field 3.1 and the segment number to the Code as "[3.1][seg#]".
--Parse Description from OBX-3.2.
--Set IsNumeric to "true".
-Else if fields 3.1 and .2 are the same as they were for the previous
segment and Compatibility Mode is on, parse Code from OBX-3.1 as
"[3.1] Notes" and Description from OBX-3.2 as "[3.2] Notes".
-Else parse Code from OBX-3.1 and Description from OBX-3.2.
-PriorCodes and OriginalText will only be parsed if the parsed Code was not
changed from OBX-3.1 (by adding either the SubID, segment number, or
"Notes"). Additionally, PriorCodes will only be parsed if OBX-3.4 or .5 is
not null.

Streamlet cache:
In the OnBeforeMatch method of the Streamlet class, if a LabResultItem has
no TestItemCode, it will be removed from ResultItems and a warning logged.
Two LabResultItems in the same set of ResultItems with the same SubId and
TestItemCode.Code and .SDACodingStandard are considered to be the same
item. In the OnBeforeMatch method, if any duplicate LabResultItems are
found, they are consolidated into a single LabResultItem by invoking the
UpdateSDA method on the first LabResultItem with the second LabResultItem
as its argument, then removing the second LabResultItem from ResultItems,
and repeating as necessary. NOTE: This deduplication is skipped if ORC-1="R"
In the OnUpdateSDAResult method, if a LabResultItem is determined not to
be an antibiotic sensitivity, then it is compared to the existing
LabResultItems on SubId and TestItemCode.Code and SDACodingStandard.
If a match is found, the existing LabResultItem is updated by calling
UpdateSDA on it with the inbound LabResultItem as its argument.

Viewer cache:
The Clinical Viewer does not support an atomic lab result containing two or
more regular (not sensitivity) test items with the same code and different
SubIds. (If the SubIds are the same, the test items are considered the same
and will be consolidated.) If ResultItems contains data like this, a suffix
of the form ":[#]" will be appended to the TestItemCode Code to make it
unique within the Result. In this case, the Description is unchanged. If
the LabResultItem is determined to be an antibiotic sensitivity, then this
TestItemCode will be inserted into the Viewer Cache as a
lab.HS.CTAntibiotics, referenced by a lab.HS.EPVisitTestSetDataAntibiotics
that is related to the lab.HS.EPVisitTestSetData representing the organism
identified. Otherwise, this TestItemCode will be stored as a CTTestCode
referenced by EPVisitTestSetData. Note backslash ("\") is a reserved
character for both of these tables (CTAntiobiotics and CTTestCode), so in
the Viewer Cache only, backslashes in a TestItemCode Code or Description
will be replaced with underscores ("_").
Also note that the matching of LabTestItem CodeTableDetails in the SDA to
CTTestCodes in the Viewer Cache can optionally use the ResultValueUnits
of this class as a match property. See the ResultValueUnits property for
more details.

HL7: OBX-3 : ObservationIdentifier
SDATableName=LabTestItem, ViewerClass=User.HS.CTTestCode
VIEWERLIB: lab.HS.EPVisitTestSetData(VISTDTestCodeDR)
VIEWERLIB: lab.HS.EPVisitTestSetDataAntibiotics(VISTAAntibioticDR)

.Code
HL7ToSDA3:
Code is always parsed from OBX-3.1, but may be altered slightly from the
original value depending on the message. See above.
Viewer cache:
As the Clinical Viewer does not support multiple instances of the same
regular (not sensitivity) test item code with different SubIds in the same
Result, Code may have a suffix of the form ":[#]" appended to it to make it
unique within a the Result.
Code will be stored in CTANTCode if this LabResultItem is determined to be
an antibiotic sensitivity, and CTTestCode otherwise.
HL7: OBX-3.1 : ObservationIdentifier.Identifier
VIEWERLIB: User.HS.CTTestCode(CTTCCode)
VIEWERLIB: lab.HS.CTAntibiotics(CTANTCode)
.Description
HL7ToSDA3:
Description is always parsed from OBX-3.2, but may be altered slightly from
the original value depending on the message. See above.
HL7: OBX-3.2 : ObservationIdentifier.Text
VIEWERLIB: User.HS.CTTestCode(CTTCDesc)
VIEWERLIB: lab.HS.CTAntibiotics(CTANTName)
.SDACodingStandard
HL7: OBX-3.3 : ObservationIdentifier.NameofCodingSystem
VIEWERLIB: Not stored
.CodingSystemVersionId
HL7: OBX-3.7 : ObservationIdentifier.CodingSystemVersionID
VIEWERLIB: Not stored
.IsNumeric
HL7ToSDA3:
IsNumeric will be set to "true" in the SDA if OBX-2 is "NM" or "ST",
otherwise it will not be set.
Viewer cache:
The CTTCShowInCummulative property and the ARCIMDisplayCumulative property of the ARCItmMast for the current order will always be set to "Y", regardless of IsNumeric.
HL7: OBX-2 : ValueType
VIEWERLIB: Not stored
Property methods: TestItemCodeGet(), TestItemCodeGetObject(), TestItemCodeGetObjectId(), TestItemCodeGetSwizzled(), TestItemCodeIsEmpty(), TestItemCodeIsValid(), TestItemCodeNewObject(), TestItemCodeSet(), TestItemCodeSetObject(), TestItemCodeSetObjectId(), TestItemCodeUnSwizzle()
property TestItemStatus as %String (MAXLEN = 100);
Note that within HealthShare, the code for an item status of "Corrected" is
"K", not "C".

HL7ToSDA3:
An OBX-11 value of "C" will be parsed to the SDA as "K". Any other value
will be parsed as-is.

Streamlet cache:
In the OnBeforeMatch method of the LabOrder Streamlet class, a
TestItemStatus of "C" will be mapped to "K". Any other value will be
unchanged.
In the OnUpdateSDAResult method, if a match is found between an existing
LabResultItem and an inbound item (for regular items only, sensitivities
are not matched), if the existing TestItemStatus is "F" or "K", then if the
ResultValue or ResultNormalRange of the existing item is updated or deleted
by the inbound item, then TestItemStatus will be set to "K", regardless of
what was passed in. Otherwise, TestItemStatus will be updated normally.
Note that a deletion will only cause the status to be set to "K" if the
existing item has a non-null value to delete.
TestItemStatus is not stored for antibiotic sensitivities. In the
OnUpdateSDAResult method, if a LabResultItem is determined to be a
sensitivity, TestItemStatus will be set to null.
In the OnValidate method, if the TestItemStatus of any
LabResultItem is "K" and the ResultStatus of the containing Result is "F",
the ResultStatus will be changed to "K".

Viewer cache:
VISTDResultStatus is set for regular (not sensitivity) items. The value
that will appear in the Clinical Viewer is the Description for the
Trak "TestItemStatusHealthShare" Standard Type item with
Internal Value = [TestItemStatus]. See the HS documentation for guidance on
configuring Standard Types. For sensitivities, TestItemStatus is not
inserted into the Viewer Cache.

HL7: OBX-11 : ObservationResultStatus
VIEWERLIB: lab.HS.EPVisitTestSetData(VISTDResultStatus)
Property methods: TestItemStatusDisplayToLogical(), TestItemStatusGet(), TestItemStatusIsValid(), TestItemStatusLogicalToDisplay(), TestItemStatusLogicalToOdbc(), TestItemStatusNormalize(), TestItemStatusSet()
property ToTime as HS.SDA3.TimeStamp;
Not used.
Property methods: ToTimeDisplayToLogical(), ToTimeGet(), ToTimeIsValid(), ToTimeLogicalToDisplay(), ToTimeLogicalToTimeStamp(), ToTimeLogicalToXSD(), ToTimeNormalize(), ToTimeOdbcToLogical(), ToTimeSet(), ToTimeXSDToLogical()
property UpdatedOn as HS.SDA3.TimeStamp;
Not used.
Property methods: UpdatedOnDisplayToLogical(), UpdatedOnGet(), UpdatedOnIsValid(), UpdatedOnLogicalToDisplay(), UpdatedOnLogicalToTimeStamp(), UpdatedOnLogicalToXSD(), UpdatedOnNormalize(), UpdatedOnOdbcToLogical(), UpdatedOnSet(), UpdatedOnXSDToLogical()

Methods

classmethod GetRange(range As %Library.String = "") as %Library.String
Convert range to rangeL|rangeH
classmethod RangeResult(pResult As %String = "", pRange As %String = "") as %String
Returns whether a result is (H)igh,(L)ow,(N)ormal, or Not Applicable("") compared to the reference range
method UpdateSDA(pFromObject, pOmitProperties, pIsDeleted As %Boolean = 0)
Copied from the generated code and modified to fit the needs of this class. Changes to the default generated code are commented.

Inherited Members

Inherited Properties

Inherited Methods

FeedbackOpens in a new tab