Insight - Classify Setting

POST /insight/v1/classify/setting

This operation classifies Encounter, ExplanationOfBenefit, Claim, and ServiceRequest resources by healthcare setting such as inpatient, emergency, ambulatory, and behavioral health (See full list of output classifications below). Output contains the original resources and/or new List resources which contain classifications from the HL7 ActCode value set and SNOMED CT.

See the Programming Guide for general principles that apply to all Insight API operations.

Inputs and Outputs

The input is a FHIR R4 Bundle containing data for a single patient and parameters indicating whether to include List and/or original resources in the output.

The output is a new FHIR R4 Bundle of type searchset containing one or both of the following:

  • The original resources from the input bundle, with classifications added to appropriate fields in resources.
  • 0:N List resources, each containing a single setting classification and a list of references to resources that have that classification.

Query Parameters

include_classification_lists boolean

Flag to include List resources in the output. If true, each List resource contains a single setting classification and a list of references to resources that have that classification. If false, List resources will not be included in the output. Default is true.

include_resources_with_classification boolean

Flag to include the input resources in the output. If true, all source resources will be included in the output, with classifications added to appropriate fields. If false, source resources will not be included in the output. Default is false.

If both parameters are false, the operation will return an error.

Processing Notes

See the Programming Guide for general principles that apply to all Insight API operations.

Input Resources

The Classify Setting operation only examines the following FHIR resources as part of the input bundle:

If include_resources_with_classification is set to true, all other resources from the input will also be returned.

Output Classifications

If include_resources_with_classification is set to true, the Classify Setting operation returns classifications in these fields:

  • Encounter.type
  • ExplanationOfBenefit.subType
  • Claim.subType
  • ServiceRequest.category

If include_classification_lists is set to true, the Classify Setting operation returns classifications in each List.code field.

The classifications may include one or more of the following set of codings:

Code Display System
IMP inpatient encounter https://hl7.org/fhir/R4/v3/ActEncounterCode/vs.html
45618002 Skilled nursing facility (environment) http://snomed.info/sct
ACUTE inpatient acute https://hl7.org/fhir/R4/v3/ActEncounterCode/vs.html
SS short stay https://hl7.org/fhir/R4/v3/ActEncounterCode/vs.html
EMER emergency https://hl7.org/fhir/R4/v3/ActEncounterCode/vs.html
702927004 Urgent care clinic (environment) http://snomed.info/sct
AMB ambulatory https://hl7.org/fhir/R4/v3/ActEncounterCode/vs.html
257585005 Clinic (environment) http://snomed.info/sct
VR virtual https://hl7.org/fhir/R4/v3/ActEncounterCode/vs.html
3711000175101 Behavioral health (qualifier value) http://snomed.info/sct

Resource IDs

The returned resources will retain their input resource IDs. List resources in the output will refer to those resource IDs.

Example

Try It
Try out the operations, with examples, in the Developer Portal Sandbox.

Assuming the original FHIR bundle contained the following resources:

  • Encounter with ID 1 from an outpatient clinic visit
  • Encounter with ID 2 from an inpatient hospital visit
  • Claim with ID 3 associated with Encounter 1’s outpatient clinic visit
  • ExplanationOfBenefit with ID 4 associated with Encounter 2’s hospital visit

If include_resources_with_classification is true, the output bundle will contain all the original resources with the following fields populated:

Resource Field Added Example Classification
Encounter 1 Encounter.type 257585005, Clinic (environment), SNOMED
Encounter 2 Encounter.type IMP, inpatient encounter, HL7ActCode
Claim 3 Claim.subType 257585005, Clinic (environment), SNOMED
ExplanationOfBenefit 4 ExplanationOfBenefit.subType IMP, inpatient encounter, HL7ActCode

If include_classification_lists is true, two List resources would be included - one for the resources classified as clinic visits and one for those classified as inpatient visits. For example, the clinic visit List resource would be:

Sample Output
{
  "resource": {
    "resourceType": "List",
    "status": "current",
    "mode": "snapshot",
    "code": {"coding": [{"extension": [{"url": "https://api.careevolutionapi.com/insight/v1/extensions/code-source",
        "valueCode": "classify-resource-setting"}],
        "system": "http://snomed.info/sct",
        "code": "257585005",
        "display": "Clinic (environment)",
        "userSelected": False}]},
    "note": [{"text": "List generated by CareEvolution Orchestrate API based on available data."}],
    "entry": [
        {"item": {"reference": "Encounter/1"}},
        {"item": {"reference": "Claim/3"}},
        ...]
  }
}