Advanced Search Syntax

CoreComponentSpecial characters

Advanced users can use the following special characters in the search string.

+ Plus

The "+" or required operator requires that the term after the "+" symbol exists somewhere in each search result. As described in the Basic Search Syntax section, the "+" and the AND operators are interchangable, and when no operator is specified, "+" is implied. To search for records that must contain anthracis and may contain bacillus use the query:

bacillus +anthracis

- Minus

The "-" or prohibit operator excludes records that contain the term after the "-" symbol. To search for records that contain bacillus but not anthracis use the query:

bacillus -anthracis

( ) Parentheses

Parentheses can be used to group clauses to form sub queries. This can be very useful if you want to control the boolean logic for a query. To search for records that contain either influenza or rhinovirus and not haemophilus use the query:

(influenza OR rhinovirus) -haemophilus

Parentheses can also be used to search for multiple search terms in a single field. To search for terms that contain the words opiates and confirm in the Component use the query:

Component:(opiates confirm)

To search for terms that contain the word opiates or the word confirm in the Component use the query:

Component:(opiates OR confirm)

~ Tilde

To do a fuzzy search use the tilde symbol ("~") at the end of a single search term. Fuzzy searches can be used when you are not sure about the spelling of a word. For example, to search for a term similar in spelling to "haemofhilus" use the fuzzy search:

haemofhilus~

An additional (optional) parameter between 0 and 1 can specify the degree of similarity required. With a value closer to 1, only terms with a higher similarity will be matched. For example:

haemofhilus~0.8

returns a large number of terms, but

haemofhilus~0.95

does not return any.

The default that is used if the optional parameter is not given is 0.5.

The proximity search allows you to find records containing words within a specific distance of each other. To do a proximity search use the tilde symbol ("~") at the end of a phrase in quotes. For example to search for function and panel within 1 word of each other use the search:

"function panel"~1

[ ] { } Range searches

Range searches allow you to find records whose field values are between the specified lower bound and upper bound.

To perform an inclusive range search use square brackets. This type of query will return records where the specified field contains the lower bound, the upper bound, or any value between the lower bound and upper bound. For example, to search for Parts created between 20170101 and 20170601, inclusive, use the following query in the Part Search tab:

createdon:[20170101 TO 20170601]

To perform an exclusive range search use curly brackets. This type of query will only return records where the specified field contains a value between the lower bound and the upper bound without containing either the upper or lower bound values themselves. For example, to search for records created between 20170101 and 20170601, exclusive (i.e., not created on either January 1, 2017 or June 1, 2017), use the query:

createdon:{20170101 TO 20170601}

Escaping special characters

Special characters that are part of the query syntax can be escaped and treated as data. The current list of special characters is

+ - && || ! ( ) { } [ ] ^ " ~ * ? : \

To escape these characters use the \ (backslash) before the character. For example to search for O157:H7 use the query

O157\:H7

Advanced LOINC Field Names

Users can use the following field names in the search string.

AllowMethodSpecific

Allowed values:

True

False

This field is used to find LOINC codes with a Method, where either equivalent methodless LOINC codes exist (AllowMethodSpecific:False) or do not exist (AllowMethodSpecific:True). For example, to find codes containing cytomegalovirus that have a Method and for which there are no equivalent methodless LOINC codes use the query:

cytomegalovirus AllowMethodSpecific:True

And to find codes containing cytomegalovirus that have a Method and for which there are equivalent methodless LOINC codes use the query:

cytomegalovirus AllowMethodSpecific:False

AnswerList

Allowed values:

True

False

Whether or not a LOINC code has an associated answer list. To search for all the LOINC codes containing glucose that also have an answer list use the query:

glucose AnswerList:true

AnswerListId

This field allows you to find all LOINC codes with a specific answer list. For example, to find all LOINC codes with which Answer list LL956-4 is associated, use:

AnswerListId:LL956-4

AnswerListName

This field allows you to find LOINC codes whose answer list name contains specific keywords. The following example will return all of the LOINC codes whose assigned answer list has the word "medication" in its name.

AnswerListName:medication

AnswerListType

Allowed values:

Example

Preferred

Normative

This field allows you to find LOINC codes by the type of associated answer list. The following example will return all of the LOINC glucose codes that have an associated NORMATIVE answer list.

glucose answerlisttype:normative

See the LOINC Users' guide for the complete list of answer types and their definitions.

AskAtOrderEntry

Allowed values:

True

{LOINC #}

Ask at order entry terms are additional observation terms that may be included with an instance of an order. A LOINC order term may be associated with one or more ask at order entry sets.

The example query shown here will return all of the LOINC terms with which the ask at order entry panel 80399-9 are associated:

AskAtOrderEntry:80399-9

To see the complete list of LOINC codes that are linked to an Ask at Order Entry set of any type, use this query:

AskAtOrderEntry:True

AssociatedObservations

Allowed values:

True

{LOINC #}

Associated observations are additional results that may be reported with a primary result. For example, the laboratory may report the volume of a urine specimen along with the primary urine analyte results. We also use the associated observations mechanism in LOINC to specify the sections and entries from HL7 Clinical Document Architecture (CDA) implementation guides that can be reported with certain LOINC document codes. This field can be used to find all of the LOINC terms have associated observation term(s) assigned to them, or to find terms that are linked to a specific associated observation term.

The example query shown here will return all of the LOINC terms that are associated with the term 72225-6, which contains all of the recommended C-CDA R1.1 sections for a Progress Note:

AssociatedObservations:72225-6

To see the complete list of LOINC codes to which associated observations are linked, use this query:

AssociatedObservations:True

AttachmentUnitsRequired

Allowed values:

Y

N

Y/N field indicating whether or not a LOINC code is an attachment that requires units. To find all the LOINC codes containing chicken that are attachments that require units use the query:

chicken AttachmentUnitsRequired:y

Categorization

LOINC codes can be categorized in many different ways. Many of these categories span LOINC classes, component, and other attributes. By creating indexed fields of these categories, we provide yet another mechanism to assist in finding the optimal LOINC term. These categories are also available in the LoincPartLink file

Unlike most of our search fields, these category field are either true or false. Do not use other keywords with these fields. In most cases you will want to use the value of true. Searching for a false value will only make sense if you include enough other keywords to limit search results to a reasonable number of terms.

Examples:

AOEObservation:True

Exercise:True

PublicHealth:True

Categories currently available include:

  • Admin
  • Allergy
  • AOEObservation
  • Audiology
  • Cardiology
  • CorePlaybook
  • Dental
  • Dermatology
  • Dietetics
  • Endocrinology
  • ENT
  • Esoteric
  • Exercise
  • Gastroenterology
  • Genetics
  • Hematology
  • Hepatology
  • Honorary
  • InfectiousDisease
  • InternalLabUse
  • LimitedUseLabOrders
  • MentalHealth
  • Nephrology
  • Neurology
  • ObGyn
  • Oncology
  • Ophthalmology
  • Orthopedics
  • OT
  • PotentialForAbuse
  • PT
  • PublicHealth
  • Pulmonology
  • Radiology
  • Rheumatology
  • SDH.Community
  • SDH.Economics
  • SDH.Education
  • SDH.Environment
  • SDH.Food
  • SDH.Healthcare
  • Ultrasound
  • UniversalLabOrders
  • Urology
  • Veterinary

ChangeReasonPublic

This field provides detailed explanation about changes made to the term over time, including those made to the primary Parts, Answer list, etc. To search for all LOINC codes containing the word Mucus and the phrase "specimen changed" in this field, use the query:

mucus ChangeReasonPublic:"specimen changed"

ChngType

This field is used to limit a search using the value of the LOINC CHNG_TYPE field. The values in this field are fully documented in the LOINC Users' Guide and are reproduced here for you convenience.

  • DEL = delete (deprecate)
  • ADD = add
  • NAM = change to Component
  • MAJ = change to one of the six major parts other than the Component (i.e., Property, Time, System, Scale, or Method)
  • MIN = change to field other than name
  • UND = undelete

To search for all the LOINC codes containing the word Glucose that have not been modified since they were first released, and therefore will still have a CHNG_TYPE of ADD, use the query:

glucose chngtype:ADD

ClassHierarchy, ComponentHierarchy, MethodHierarchy, MultiAxialHierarchy, SystemHierarchy

This field contains the path enumeration to a category or name in the hierarchy. Restricting on the hierarchy by manually typing in a value requires extensive knowledge of the database and is therefore not recommended. See the LOINC Hierarchies section of the "Mapping" chapter in the RELMA Users' Manual for information on how to enforce a hierarchy restriction from the user-friendly hierarchy restriction screen.

CommonOrder

Allowed values:

True

False

Indicates whether or not a LOINC code is from our common order set. To search for all the LOINC codes containing acetone that are a common test use the query:

acetone CommonOrder:true

Ranked or CommonLabResult

Allowed values:

True

False

Indicates whether or not a LOINC code is ranked as one of the most common 20,000 codes. To search for all the LOINC codes for "acetone" with a ranking in the top 20,000 use this query:

acetone Ranked:true

acetone CommonLabResult:true

ComponentWordCount

Number of words in the Component field. To search for all the LOINC codes containing cancer with 3 words in the Component field use the query:

cancer ComponentWordCount:3

CoreComponent

This field is used to search for the "core component" of the LOINC term. The Core Component is the portion of the Component that remains after all other parts, including the suffix, challenge, and divisor, are parsed. For example, the core component for Chlamydia trachomatis Ab.IgA is Chlamydia trachomatis. To search for all LOINC codes with core compnent of acyclovir, use the query:

CoreComponent:acyclovir

Description

Use this field to search the LOINC description and other reference information fields. Example query:

Description:"isoleucine catabolism"

DisplayName

Use this field to search the LOINC DisplayName field. Example query:

DisplayName:MTHFR

ExUCUMunits

Example UCUM units. To search for all the LOINC codes containing glucose that have ug/dl in the example UCUM units field use the query:

glucose ExUCUMunits:ug/dl

ExUnits

Example units. To search for all the LOINC codes containing streptococcus that also contain titer anywhere in the example units field use the query:

streptococcus ExUnits:titer

Formula

Contains the formula in human readable form, for calculating the value of any measure that is based on an algebraic or other formula, except those for which the component expresses the formula. So Sodium/Creatinine does not need a formula, but Free T3 index does. To find all LOINC codes that contain the word "hours" in their formula field, use the query:

Formula:hours

HL7AttachmentStructure

Allowed values:

IGexists

NoIGexists

This field can be used to restrict search results to find LOINC codes that have clinically-relevant HL7 implementation guides that use the U.S. Realm Header (using IGexists) or those that are approved by the HL7 Attachments WG for transmission using the C-CDA Unstructured Document template. Example query:

cancer HL7AttachmentStructure:IGexists

HL7FieldSubId

The field is valued with the pre-defined HL7 v2.x field that should be used to represent the result associated with this LOINC term if the data is being transmitted using HL7 v2.x messages. For most terms, this field will be null, meaning that the result should be sent in an OBX segment with the LOINC code in OBX-3 and result in OBX-5. To find LOINC codes whose values would be transmitted in the PID-8 field use the query:

HL7FieldSubId:PID-8

LabTest

Allowed values:

True

False

Indicates whether or not a LOINC code is a lab test (i.e., Class type 1). To search for all the LOINC codes containing aortic that are a lab test use the query:

aortic LabTest:true

The above query will return the same result as:

aortic Type:1

LForms

Allowed values:

True

False

This field indicates whether or not the LOINC term is available for viewing in the LForms data widget tool. To search for these terms use the query:

LForms:True

LongName

To search for all the LOINC codes containing glucose that also contain [presence] anywhere in the long common name field use the following query. Note that [ and ] are special characters that are part of the query syntax and must be escaped with the \ character so they are treated as data in the search.

glucose LongName:`[presence]`

MapToLOINC

The LOINC code to be used as a replacement for deprecated or discouraged LOINC codes. To search for all the LOINC codes containing "protein" that are mapped to LOINC code "2885-2" use the query:

protein MapToLOINC:2885-2

MassProperty

Allowed values:

True

False

This field will contain true if the property of the LOINC code is a mass concentration or if it is unknown whether the property of the LOINC code is a mass concentration or a substance concentration. To search for all the LOINC codes containing calcium whose LOINC property is not defined as a substance concentration use the query:

calcium MassProperty:true

Methodless

Allowed values:

True

False

Indicates whether or not a LOINC code contains a value in the Method field. To search for all the LOINC codes containing amikacin that do not contain a Method use the query:

amikacin Methodless:true

NonroutineChallenge

Allowed values:

True

False

Indicates whether or not a LOINC code is considered a non-routine challenge test. To search for all glucose terms with non-routine challenges use the query:

glucose nonroutinechallenge:true

More practically, you probably want to hide the non-routine terms. This query will return the glucose terms that are not tagged as being non-routine:

glucose nonroutinechallenge:false

OrderObs

Allowed values:

Both

Observation

Order

Subset

To search for all the LOINC codes containing glucose that can be used an an order or an observation use the query:

glucose OrderObs:both

OrderRank

This field has been deprecated. Please see the UniversalLabOrders field.

OtherCopyright

External copyright. To search for all the LOINC codes containing feeling with material that is copyrighted by Pfizer use the query:

feeling OtherCopyright:Pfizer

PanelType

Allowed values:

Panel

Convenience

Organizer

LOINC panel classification as a Panel, a Convenience Group, or an Organizer. To search for all the LOINC panel codes classified as a "Convenience Group" use the query:

paneltype:Convenience

See the LOINC Users' Guide for the complete list of panel types and their definitions.

Pharma

Allowed values:

True

False

Indicates whether or not the codes were created for a special Pharma use case and have a property that covers both mass and substance. To search for all the LOINC codes containing calcium whose property covers both mass and substance use the query:

calcium Pharma:True

Punctuation

This field contains a text version of the non-alphanumeric characters that exist in the 6 core fields of the LOINC name. For example, if you want to only see LOINC terms that contain a "+" character, you would use the following query:

Punctuation:plus

Supported values:

ampersand

asterisk

brace

caret

colon

equal

greaterthan

hyphen

lessthan

parenthesis

period

percent

plus

semicolon

slash

Rank

The position of the LOINC code in the list of the "LOINC Top 2,000+" result codes. This field originally contained values of 1 through approximately 2,000 where 1 represents the most common test. In 2016 we added some LOINC terms to the top 2,000 and assigned them a rank of 3,000 in order to distinguish them from the original set. To search for the LOINC code that is ranked as the 5th most common test use the query:

Rank:5

To search for the LOINC codes that were added to the list in 2016 use the query:

Rank:3000

RelatedCodes

This field can be used to search for LOINC terms that correspond to concepts in external sources, including RadLex, PhenX, IEEE, and CMS. If you know the specific code, you can search for it individually, e.g., RelatedCodes:RPID1278. You can also search for all of the LOINC terms that correspond to a specific source, e.g.:

RelatedCodes:RPID* (for RadLex)

RelatedCodes:PX* (for PhenX)

RelatedCodes:urn* (for IEEE)

RelatedCodes:CMS* (for CMS)

ShortName

To search for all the LOINC codes containing chemotherapy that also contain Rx anywhere in the short name field use the query:

chemotherapy ShortName:Rx

Status

Allowed values:

Active

Trial

Discouraged

Deprecated

To search for all the LOINC codes containing bacteria that are deprecated use the query:

bacteria Status:deprecated

StatusReason

Allowed values:

Duplicate

Erroneous

Ambiguous

Gives the reason a term was deprecated, if known. Otherwise, it contains NULL. To search for all the LOINC codes containing bacteria that are deprecated because a duplicate term exists, use the query:

bacteria Status:deprecated StatusReason:duplicate

StatusText

This field contains the free text reason for the current STATUS. This field is optional, therefore it may or may not contain text, and because it is free text, it may not contain the exact text you are searching for. To search for all the LOINC codes that are deprecated because they were created in error and use the phrase "created in error" in the Status text field, use the query:

statustext:"created in error"

SubstanceProperty

Allowed values:

True

False

This field will contain true if the property of the LOINC code is a substance concentration or if it is unknown whether the property of the LOINC code is a mass concentration or a substance concentration. To search for all the LOINC codes containing calcium whose LOINC property is not defined as a mass concentration use the query:

calcium SubstanceProperty:true

SuperSystem

The super system is the text to the right of the "^" in the system field. To search for all the LOINC codes with a supersystem of fetus use the query:

supersystem:fetus

This query will return all terms that have a super system

supersystem:true

SurveyQuestionSource

To search for all the LOINC codes containing bowel that also contain Omaha anywhere in the survey question source use the query:

bowel SurveyQuestionSource:omaha

SurveyQuestionText

To search for all the LOINC codes containing pain that also contain HIV anywhere in the survey question text use the query:

pain SurveyQuestionText:HIV

TimeModifier

The time modifier is the text to the right of the "^" in the TIME_ASPCT field. The following query will return all terms with time modifier of mean:

TimeModifier:mean

This query will return all terms that have a time modifier

TimeModifier:true

Type

Allowes values:

1

2

3

4

Numeric representation of the class type. To search for all the LOINC codes containing glucose with a class type of 2 use the query:

glucose Type:2

See the LOINC Users' Guide for definitions of each class type.

TypeName

Allowed values:

Lab

Clinical

Attachment

Survey

String representation of the class type. To search for all the LOINC codes containing glucose with a class type of clinical use the query:

glucose TypeName:clinical

UniversalLabOrders

The Universal Lab Order Codes Value Set from LOINC is a collection of the most frequent lab orders.

universallaborders:true

ValidHL7AttachmentRequest

Allowed values:

Y

N

A value of Y in this field indicates that this LOINC code can be sent by a payer as part of an HL7 attachment request for additional information. To find all LOINC codes that can be sent by a payer as part of an HL7 attachment request, type:

ValidHL7AttachmentRequest:Y

VersionLastChanged

The LOINC version number in which this LOINC code was modified. To search for all the LOINC codes containing adenovirus that were last updated in version 2.56 use the query:

adenovirus VersionLastChanged:2.56

Knowledge Base

Users’ Guide

Search Syntax

RELMA

FAQ