Facts

Claim

The claim fact is used to capture claim information about an event. This would most commonly be used in insurance claim data.

Dhall
{ claim_type : Optional Text
, id : Text
, index : Optional Integer
, procedure : Optional Text
}
Rust
pub struct Claim {
    pub id: String,

    #[serde(skip_serializing_if = "Option::is_none")]
    pub claim_type: Option<String>,

    #[serde(skip_serializing_if = "Option::is_none")]
    pub index: Option<i32>,

    #[serde(skip_serializing_if = "Option::is_none")]
    pub procedure: Option<String>,
}
Example JSON
{
  "claim_type": "notbar",
  "id": "foo",
  "index": 7
}

ClaimFacts

A collection of facts relevant to an insurance claim.

Dhall
{ claim :
    { claim_type : Optional Text
    , id : Text
    , index : Optional Integer
    , procedure : Optional Text
    }
, cost :
    Optional
      { allowed : Optional Double
      , category : Optional Text
      , charge : Optional Double
      , cost : Optional Double
      , description : Optional Text
      , transaction : Optional Text
      }
, provider :
    Optional
      { provider_id : Text
      , provider_type : Optional Text
      , taxonomy : Optional Text
      }
, service :
    Optional
      { place : Optional Text
      , service_location : < Inpatient | Outpatient >
      , service_type : Optional Text
      }
}
Rust
pub struct ClaimFacts {
    pub claim: Claim,

    #[serde(skip_serializing_if = "Option::is_none")]
    pub cost: Option<Cost>,

    #[serde(skip_serializing_if = "Option::is_none")]
    pub provider: Option<Provider>,

    #[serde(skip_serializing_if = "Option::is_none")]
    pub service: Option<Service>,
}
Example JSON
{
  "claim": {
    "claim_type": "notbar",
    "id": "foo",
    "index": 7
  },
  "cost": {
    "allowed": 1.2,
    "category": "expense",
    "charge": 0.5,
    "cost": 9
  },
  "provider": {
    "provider_id": "blah",
    "taxonomy": "207RA0001X"
  },
  "service": {
    "place": "somewhere",
    "service_location": "Inpatient"
  }
}

Code

The code fact captures information about an event’s code, such as an ICD9/10 diagnosis code or NDC medication code.

A code’s predicate shape is special and unlike other predicate shapes. It is a codelist, which is defined in the Codelist dhall package.
Dhall
{ code : Text
, codebook :
    < CDT
    | HCPCS
    | ICD10
    | ICD9
    | LOINC
    | MedicaidCat
    | NABSP
    | NDC
    | NDC9
    | UB92
    | USSTATE
    >
}
Rust
pub struct Code {
    pub code: String,

    pub codebook: Codebook,
}
Example JSON
{
  "code": "71949",
  "codebook": "ICD9"
}

Codebook

Enumerates the possible codebooks used in the EDM.

Dhall
< CDT
| HCPCS
| ICD10
| ICD9
| LOINC
| MedicaidCat
| NABSP
| NDC
| NDC9
| UB92
| USSTATE
>
Rust
pub enum Codebook {
    CDT,
    HCPCS,
    ICD9,
    ICD10,
    LOINC,
    MedicaidCat,
    NABSP,
    NDC,
    NDC9,
    UB92,
    USSTATE,
}
Example JSON
"CDT"

Cost

The cost fact is used to capture cost information about a claim.

Dhall
{ allowed : Optional Double
, category : Optional Text
, charge : Optional Double
, cost : Optional Double
, description : Optional Text
, transaction : Optional Text
}
Rust
pub struct Cost {
    #[serde(skip_serializing_if = "Option::is_none")]
    pub charge: Option<f64>,

    #[serde(skip_serializing_if = "Option::is_none")]
    pub cost: Option<f64>,

    #[serde(skip_serializing_if = "Option::is_none")]
    pub allowed: Option<f64>,

    #[serde(skip_serializing_if = "Option::is_none")]
    pub transaction: Option<String>,

    #[serde(skip_serializing_if = "Option::is_none")]
    pub category: Option<String>,

    #[serde(skip_serializing_if = "Option::is_none")]
    pub description: Option<String>,
}
Example JSON
{
  "allowed": 1.2,
  "category": "expense",
  "charge": 0.5,
  "cost": 9
}

Demographic

The demo fact captures demographic information.

Dhall
{ field :
    < BirthDate
    | BirthYear
    | County
    | CountyFIPS
    | Ethnicity
    | Gender
    | GeoAdiNatRank
    | GeoAdiStateRank
    | GeoPctAmIndian
    | GeoPctAsian
    | GeoPctBlack
    | GeoPctHispanic
    | GeoPctMutli
    | GeoPctOther
    | GeoPctWhite
    | GeoType
    | Race
    | RaceCodes
    | Region
    | State
    | UrbanRural
    | Zipcode
    >
, info : Text
}
Rust
pub struct Demographic {
    pub field: DemographicField,
    pub info: String,
}
Example JSON
{
  "field": "BirthYear",
  "info": "1970"
}

Demographic Field

Enumerates the possible demographic fields

Dhall
< BirthDate
| BirthYear
| County
| CountyFIPS
| Ethnicity
| Gender
| GeoAdiNatRank
| GeoAdiStateRank
| GeoPctAmIndian
| GeoPctAsian
| GeoPctBlack
| GeoPctHispanic
| GeoPctMutli
| GeoPctOther
| GeoPctWhite
| GeoType
| Race
| RaceCodes
| Region
| State
| UrbanRural
| Zipcode
>
Rust
pub enum DemographicField {
    BirthYear,
    BirthDate,
    Race,
    RaceCodes,
    Gender,
    Zipcode,
    County,
    CountyFIPS,
    State,
    Ethnicity,
    Region,
    UrbanRural,
    GeoPctAmIndian,
    GeoPctAsian,
    GeoPctBlack,
    GeoPctHispanic,
    GeoPctMutli,
    GeoPctOther,
    GeoPctWhite,
    GeoType,
    GeoAdiStateRank,
    GeoAdiNatRank,
}
Example JSON
"BirthDate"

Fill

The fill fact may be used to provide prescription fill information for medications.

The code identifying the kind of medication would be put in a code fact.
Dhall
{ days_supply : Optional Integer
, quantity : Optional Double
, strength : Optional Text
}
Rust
pub struct Fill {
    #[serde(skip_serializing_if = "Option::is_none")]
    pub days_supply: Option<i32>,

    #[serde(skip_serializing_if = "Option::is_none")]
    pub quantity: Option<f64>,

    #[serde(skip_serializing_if = "Option::is_none")]
    pub strength: Option<String>,
}
Example JSON
{
  "days_supply": 4,
  "strength": "strong"
}

HospitalDischarge

Information about a hospital discharge.

Dhall
{ discharge_status : Optional Text, length_of_stay : Optional Double }
Rust
pub struct HospitalDischarge {
    #[serde(skip_serializing_if = "Option::is_none")]
    pub discharge_status: Option<String>,

    #[serde(skip_serializing_if = "Option::is_none")]
    pub length_of_stay: Option<f64>,
}
Example JSON
{
  "discharge_status": "42",
  "length_of_stay": 5
}

Hospitalization

Facts about hospitalization

Dhall
{ cost :
    Optional
      { allowed : Optional Double
      , category : Optional Text
      , charge : Optional Double
      , cost : Optional Double
      , description : Optional Text
      , transaction : Optional Text
      }
, discharge :
    { discharge_status : Optional Text, length_of_stay : Optional Double }
, provider :
    Optional
      { provider_id : Text
      , provider_type : Optional Text
      , taxonomy : Optional Text
      }
}
Rust
pub struct Hospitalization {
    pub discharge: HospitalDischarge,

    #[serde(skip_serializing_if = "Option::is_none")]
    pub cost: Option<Cost>,

    #[serde(skip_serializing_if = "Option::is_none")]
    pub provider: Option<Provider>,
}
Example JSON
{
  "cost": {
    "allowed": 1.2,
    "category": "expense",
    "charge": 0.5,
    "cost": 9
  },
  "discharge": {
    "discharge_status": "42",
    "length_of_stay": 5
  }
}

LabValue

The labValue fact is either a text or numeric value possibly along with units.

The code identifying the kind of lab would be put in an domain’s code fact.
Dhall
{ units : Optional Text, value : < NumberValue : Double | TextValue : Text > }
Rust
pub struct LabValue {
    pub value: TNValue,

    #[serde(skip_serializing_if = "Option::is_none")]
    pub units: Option<String>,
}
Example JSON
{
  "units": "mg",
  "value": 2.3
}

MedicalServiceFacts

The facts related to a medical encounter, such as diagnosis or procedure.

Dhall
{ claim :
    Optional
      { claim_type : Optional Text
      , id : Text
      , index : Optional Integer
      , procedure : Optional Text
      }
, code :
    { code : Text
    , codebook :
        < CDT
        | HCPCS
        | ICD10
        | ICD9
        | LOINC
        | MedicaidCat
        | NABSP
        | NDC
        | NDC9
        | UB92
        | USSTATE
        >
    }
, cost :
    Optional
      { allowed : Optional Double
      , category : Optional Text
      , charge : Optional Double
      , cost : Optional Double
      , description : Optional Text
      , transaction : Optional Text
      }
, provider :
    Optional
      { provider_id : Text
      , provider_type : Optional Text
      , taxonomy : Optional Text
      }
, service :
    Optional
      { place : Optional Text
      , service_location : < Inpatient | Outpatient >
      , service_type : Optional Text
      }
}
Rust
pub struct MedicalServiceFacts {
    pub code: Code,

    #[serde(skip_serializing_if = "Option::is_none")]
    pub service: Option<Service>,

    #[serde(skip_serializing_if = "Option::is_none")]
    pub claim: Option<Claim>,

    #[serde(skip_serializing_if = "Option::is_none")]
    pub cost: Option<Cost>,

    #[serde(skip_serializing_if = "Option::is_none")]
    pub provider: Option<Provider>,
}
Example JSON
{
  "code": {
    "code": "a",
    "codebook": "ICD10"
  }
}

Medication

Facts for a medication.

Dhall
{ claim :
    Optional
      { claim_type : Optional Text
      , id : Text
      , index : Optional Integer
      , procedure : Optional Text
      }
, code :
    { code : Text
    , codebook :
        < CDT
        | HCPCS
        | ICD10
        | ICD9
        | LOINC
        | MedicaidCat
        | NABSP
        | NDC
        | NDC9
        | UB92
        | USSTATE
        >
    }
, cost :
    Optional
      { allowed : Optional Double
      , category : Optional Text
      , charge : Optional Double
      , cost : Optional Double
      , description : Optional Text
      , transaction : Optional Text
      }
, fill :
    { days_supply : Optional Integer
    , quantity : Optional Double
    , strength : Optional Text
    }
, provider :
    Optional
      { provider_id : Text
      , provider_type : Optional Text
      , taxonomy : Optional Text
      }
, service :
    Optional
      { place : Optional Text
      , service_location : < Inpatient | Outpatient >
      , service_type : Optional Text
      }
}
Rust
pub struct Medication {
    pub code: Code,

    #[serde(skip_serializing_if = "Option::is_none")]
    pub service: Option<Service>,

    #[serde(skip_serializing_if = "Option::is_none")]
    pub claim: Option<Claim>,

    #[serde(skip_serializing_if = "Option::is_none")]
    pub cost: Option<Cost>,

    #[serde(skip_serializing_if = "Option::is_none")]
    pub provider: Option<Provider>,

    pub fill: Fill,
}
Example JSON
{
  "code": {
    "code": "a",
    "codebook": "ICD10"
  },
  "fill": {
    "days_supply": 4,
    "strength": "strong"
  }
}

Plan

The plan fact determines the health care plan under which an event occurred. The fields are based on fields commonly found in insurance claim data.

Dhall
{ benefit : Optional Text
, exchange :
    < Group
    | IndFederal
    | IndState
    | Medicaid
    | Medicare
    | None
    | ThirdParty
    | Unknown
    >
, group_id : Optional Text
, plan_id : Optional Text
, subscriber_id : Optional Text
, subscriber_relationship : Optional Text
}
Rust
pub struct Plan {
    pub exchange: PlanExchange,

    #[serde(skip_serializing_if = "Option::is_none")]
    pub plan_id: Option<String>,

    #[serde(skip_serializing_if = "Option::is_none")]
    pub group_id: Option<String>,

    #[serde(skip_serializing_if = "Option::is_none")]
    pub subscriber_id: Option<String>,

    #[serde(skip_serializing_if = "Option::is_none")]
    pub subscriber_relationship: Option<String>,

    #[serde(skip_serializing_if = "Option::is_none")]
    pub benefit: Option<String>,
}
Example JSON
{
  "benefit": "a",
  "exchange": "Group"
}

Plan exchanges

Enumerates the possible insurance exchanges used in the EDM.

See ../fact/plan.dhall for a fact that uses this type.

Dhall
< Group
| IndFederal
| IndState
| Medicaid
| Medicare
| None
| ThirdParty
| Unknown
>
Rust
pub enum PlanExchange {
    Unknown,
    None,
    Group,
    IndFederal,
    IndState,
    Medicaid,
    Medicare,
    ThirdParty,
}
Example JSON
"Group"

Provider

The provider fact determines an event’s health care provider. The fields are based on the National Provider Identifier (NPI) schema.

  • provider_id: NPI number (Required)

  • provider_type: individual or organization

  • taxonomy: a CMS taxonomy code

Dhall
{ provider_id : Text, provider_type : Optional Text, taxonomy : Optional Text }
Rust
pub struct Provider {
    pub provider_id: String,

    #[serde(skip_serializing_if = "Option::is_none")]
    pub provider_type: Option<String>,

    #[serde(skip_serializing_if = "Option::is_none")]
    pub taxonomy: Option<String>,
}
Example JSON
{
  "provider_id": "blah",
  "taxonomy": "207RA0001X"
}

Service

The service fact holds information about an inpatient or outpatient service provided to a patient.

Dhall
{ place : Optional Text
, service_location : < Inpatient | Outpatient >
, service_type : Optional Text
}
Rust
pub struct Service {
    pub service_location: ServiceLocation,

    #[serde(skip_serializing_if = "Option::is_none")]
    pub place: Option<String>,

    #[serde(skip_serializing_if = "Option::is_none")]
    pub service_type: Option<String>,
}
Example JSON
{
  "place": "somewhere",
  "service_location": "Inpatient"
}

ServiceLocation

Enumerates the possible location that a service is performed.

Dhall
< Inpatient | Outpatient >
Rust
pub enum ServiceLocation {
    Inpatient,
    Outpatient,
}
Example JSON
"Inpatient"

Text or Number Value

Data that could be either a text value or a number value.

Dhall
< NumberValue : Double | TextValue : Text >
Rust
pub enum TNValue {
    NumberValue(f64),
    TextValue(String),
}
Example JSON
2.1