FHIR CodeSystem $lookup Operation for CTSS APIs

The clinical tables (data sets) in the Clinical Table Search Service (CTSS) can be seen as "code systems", for which a rudimentary FHIR CodeSystem $lookup operation has been implemented that conforms to the FHIR specification. For each CTSS data set API, a CodeSystem is implicitly defined, where the CodeSystem id is the api name with underscores (if any) replaced by hyphens. This replacement is necessary because the underscore character isn't allowed to be used in FHIR resource ids. For example, for the CTSS API "icd9cm_dx", the corresponding CodeSystem id will be "icd9cm-dx", and the CodeSystem's url will be "http://clinicaltables.nlm.nih.gov/fhir/CodeSystem/icd9cm-dx".

Per the FHIR specification on CodeSystem Operations, the $lookup operation is for "Concept Look Up & Decomposition". Given a code/system, or a Coding, it gets additional details about the concept, including definition, status, designations, and properties. For CTSS code systems, properties are essentially the fields available in each specific API, which are documented on each API's documentation page.

Please note that CTSS is not a full terminology server and supports only a subset of the $lookup operation parameters - see below for more details.

Request URL format - note that the "FHIR-VERSION" is a placeholder that currently can be "STU3" or "R4": The FHIR $lookup operation parameters supported by this specific implementation:
Parameter Description
code The code to be looked up. Required.
system The CTSS CodeSystem url. Required. The CTSS CodeSystem url should have the following format:
http://clinicaltables.nlm.nih.gov/fhir/CodeSystem/CODE-SYSTEM-ID
Where CODE-SYSTEM-ID is the placeholder for CTSS code system id, which is the CTSS API name with underscore characters (if any) replaced with dashes, e.g., icd9cm-dx.
property A comma-separated list of properties (field names in a CTSS API) to be returned. The list of available properties (fields) for each API is available on each API's documentation page. Optional.
_format The response format, currently can only be xml ("xml", "text/xml", "application/xml", or "application/fhir+xml") or json ("json", "application/json", "application/fhir+json"). Optional, default to "application/fhir+json". You may also use the "Accept" header to specify the response format, but the _format parameter, when specified, has higher priority. Note that if you make a request from the browser (address bar), your browser may send "Accept" headers. Therefore, when _format is not specified, the response format may depend on what "Accept" headers are being sent by your browser.
Example $lookup request & response

For request:

    https://clinicaltables.nlm.nih.gov/fhir/R4/CodeSystem/$lookup?_format=application/fhir%2Bjson&system=http://clinicaltables.nlm.nih.gov/fhir/CodeSystem/conditions&code=cigarette%20smoker&property=icd10cm_codes,synonyms
  
The response is:
{
    "resourceType": "Parameters",
    "parameter": [
        {
            "name": "name",
            "valueString": "conditions/ctss"
        },
        {
            "name": "display",
            "valueString": "Cigarette smoker"
        },
        {
            "name": "property",
            "part": [
                {
                    "name": "code",
                    "valueCode": "icd10cm_codes"
                },
                {
                    "name": "value",
                    "valueCoding": {
                        "code": "F17.210",
                        "display": "F17.210"
                    }
                }
            ]
        },
        {
            "name": "property",
            "part": [
                {
                    "name": "code",
                    "valueCode": "synonyms"
                },
                {
                    "name": "value",
                    "valueCoding": {
                        "code": "smoking cigaret",
                        "display": "smoking cigaret"
                    }
                }
            ]
        },
        {
            "name": "property",
            "part": [
                {
                    "name": "code",
                    "valueCode": "synonyms"
                },
                {
                    "name": "value",
                    "valueCoding": {
                        "code": "tobacco abuse (inhaled)",
                        "display": "tobacco abuse (inhaled)"
                    }
                }
            ]
        }
    ]
}
  

For more in-depth descriptions on the FHIR CodeSystem operations, please refer to the FHIR Spec.