Models
What is a Model?
A Model
is a placeholder for some choice of one among a selection of Facts
. It is implemented as a sum type in Dhall, with a different Fact
for each 'variant', meaning possible value, of the Model
. For example, a ClaimsModel
can denote Demographic
, or Death
or any of the other Fact
s listed among its possibilities. A Model
should not contain other Model
s. In that sense a Model
is at the top level of a collection of Fact
s, defining all possible Fact
s that might be used as metadata for events in some particular application.
Existing Models
This list specifies the currently available Model
s. However, the fact-models
package makes it relatively easy to add new Models.
ClaimsModel
A data model for medical claims data.
- Dhall
-
< Claim : { 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 } } | Death | Demographic : { 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 } | Diagnosis : { claim : Optional { claim_type : Optional Text , id : Text , index : Optional Integer , procedure : Optional Text } , code : { code : Text , codebook : < CDT | CVX | 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 } } | Eligibility : { 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 } | Enrollment : { 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 } | Hospitalization : { cost : Optional { allowed : Optional Double , category : Optional Text , charge : Optional Double , cost : Optional Double , description : Optional Text , transaction : Optional Text } , milestone : < Admission : Optional Text | Discharge : Optional Text | Stay : Optional Text > , provider : Optional { provider_id : Text , provider_type : Optional Text , taxonomy : Optional Text } } | Lab : { code : { code : Text , codebook : < CDT | CVX | 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 } , service : Optional { place : Optional Text , service_location : < Inpatient | Outpatient > , service_type : Optional Text } , value : { units : Optional Text , value : < NumberValue : Double | TextValue : Text > } } | Medication : { claim : Optional { claim_type : Optional Text , id : Text , index : Optional Integer , procedure : Optional Text } , code : { code : Text , codebook : < CDT | CVX | 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 } , manufacturer : Optional Text , milestone : < Administered : Optional { amount : { units : Optional Text , value : < NumberValue : Double | TextValue : Text > } , days_supply : Optional Natural , dose_number : Optional Natural , quantity : Optional Natural , route : Optional Text , strength : Optional Text } | ExpectedStart : Optional { amount : { units : Optional Text , value : < NumberValue : Double | TextValue : Text > } , days_supply : Optional Natural , dose_number : Optional Natural , quantity : Optional Natural , route : Optional Text , strength : Optional Text } | Filled : Optional { amount : { units : Optional Text , value : < NumberValue : Double | TextValue : Text > } , days_supply : Optional Natural , dose_number : Optional Natural , quantity : Optional Natural , route : Optional Text , strength : Optional Text } | MissingMedicationMilestone | Ordered : Optional { amount : { units : Optional Text , value : < NumberValue : Double | TextValue : Text > } , days_supply : Optional Natural , dose_number : Optional Natural , quantity : Optional Natural , route : Optional Text , strength : Optional Text } | OtherMedicationMilestone : Optional { amount : { units : Optional Text , value : < NumberValue : Double | TextValue : Text > } , days_supply : Optional Natural , dose_number : Optional Natural , quantity : Optional Natural , route : Optional Text , strength : Optional Text } | Prescribed : Optional { amount : { units : Optional Text , value : < NumberValue : Double | TextValue : Text > } , days_supply : Optional Natural , dose_number : Optional Natural , quantity : Optional Natural , route : Optional Text , strength : Optional Text } | UnknownMedicationMilestone > , 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 } } | Procedure : { claim : Optional { claim_type : Optional Text , id : Text , index : Optional Integer , procedure : Optional Text } , code : { code : Text , codebook : < CDT | CVX | 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 } } >
- Example JSON
-
{ "contents": { "claim": { "claim_type": null, "id": "foo", "index": 7, "procedure": null }, "cost": { "allowed": 1.2, "category": "expense", "charge": 0.5, "cost": 9, "description": null, "transaction": null }, "provider": { "provider_id": "1104089713", "provider_type": null, "taxonomy": "207RA0001X" }, "service": { "place": "somewhere", "service_location": "Inpatient", "service_type": "something" } }, "tag": "Claim" }
ExampleModel
An example data model.
- Dhall
-
< Bar | BazValue : < NumberValue : Double | TextValue : Text > | FooPlan : { 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 } >
- Example JSON
-
{ "contents": { "benefit": null, "exchange": "Group", "group_id": null, "plan_id": null, "subscriber_id": null, "subscriber_relationship": null }, "tag": "FooPlan" }
P0072Model
A data model for Flatiron data used in the P0072 project.
- Dhall
-
< Biomarker : < ALK : { biomarker_detail : Text , biomarker_status : Text , biomarker_test_type : Text } | BRAF : { biomarker_detail : Text , biomarker_status : Text , biomarker_test_type : Text } | EGFR : { biomarker_detail : Text , biomarker_status : Text , biomarker_test_type : Text } | KRAS : { biomarker_detail : Text , biomarker_status : Text , biomarker_test_type : Text } | MET : { biomarker_detail : Text , biomarker_status : Text , biomarker_test_type : Text } | NTRK : { biomarker_detail : Text , biomarker_status : Text , biomarker_test_type : Text } | OtherBiomarker : { other_biomarker_detail : Text , other_biomarker_name : Text , other_biomarker_status : Text , other_biomarker_test_type : Text } | PDL1 : { pdl1_detail : Text , pdl1_percent_staining : Text , pdl1_status : Text , pdl1_test_type : Text } | RET : { biomarker_detail : Text , biomarker_status : Text , biomarker_test_type : Text } | ROS1 : { biomarker_detail : Text , biomarker_status : Text , biomarker_test_type : Text } > | Death | Demographic : { 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 } | ECOG : { ecog_value : Text } | FlatironDiagnosis : { code : Text , codebook : < CDT | CVX | HCPCS | ICD10 | ICD9 | LOINC | MedicaidCat | NABSP | NDC | NDC9 | UB92 | USSTATE > } | FlatironMedication : { cancellation_status : Optional Bool , medication : { common_drug_name : Text , detailed_drug_category : Text , drug_category : Text , drug_name : Text } , medication_milestone : < Administered : Optional { amount : { units : Optional Text , value : < NumberValue : Double | TextValue : Text > } , days_supply : Optional Natural , dose_number : Optional Natural , quantity : Optional Natural , route : Optional Text , strength : Optional Text } | ExpectedStart : Optional { amount : { units : Optional Text , value : < NumberValue : Double | TextValue : Text > } , days_supply : Optional Natural , dose_number : Optional Natural , quantity : Optional Natural , route : Optional Text , strength : Optional Text } | Filled : Optional { amount : { units : Optional Text , value : < NumberValue : Double | TextValue : Text > } , days_supply : Optional Natural , dose_number : Optional Natural , quantity : Optional Natural , route : Optional Text , strength : Optional Text } | MissingMedicationMilestone | Ordered : Optional { amount : { units : Optional Text , value : < NumberValue : Double | TextValue : Text > } , days_supply : Optional Natural , dose_number : Optional Natural , quantity : Optional Natural , route : Optional Text , strength : Optional Text } | OtherMedicationMilestone : Optional { amount : { units : Optional Text , value : < NumberValue : Double | TextValue : Text > } , days_supply : Optional Natural , dose_number : Optional Natural , quantity : Optional Natural , route : Optional Text , strength : Optional Text } | Prescribed : Optional { amount : { units : Optional Text , value : < NumberValue : Double | TextValue : Text > } , days_supply : Optional Natural , dose_number : Optional Natural , quantity : Optional Natural , route : Optional Text , strength : Optional Text } | UnknownMedicationMilestone > , medication_practice : { practice_type : Text } } | Lab : { code : { code : Text , codebook : < CDT | CVX | 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 } , service : Optional { place : Optional Text , service_location : < Inpatient | Outpatient > , service_type : Optional Text } , value : { units : Optional Text , value : < NumberValue : Double | TextValue : Text > } } | LineOfTherapy : { line_medication : { common_drug_name : Text , detailed_drug_category : Text , drug_category : Text , drug_name : Text } , line_milestone : < EpisodeStart | LineStart | MissingLineOfTherapyMilestone | OtherLineOfTherapyMilestone | UnknownLineOfTherapyMilestone > , line_name : Text , line_number : Natural , maintenance_therapy : Bool } | NSCLCDx : { disease_milestone : < Advanced | Initial | MissingDiseaseMilestone | OtherDiseaseMilestone | UnknownDiseaseMilestone > , group_stage : Optional Text , histology : Optional Text , smoking_status : Optional Text } | Visit : { visit_practice : { practice_type : Text }, visit_type : Text } | Vitals : { code : { code : Text , codebook : < CDT | CVX | 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 } , service : Optional { place : Optional Text , service_location : < Inpatient | Outpatient > , service_type : Optional Text } , value : { units : Optional Text , value : < NumberValue : Double | TextValue : Text > } } >
- Example JSON
-
{ "contents": { "contents": { "biomarker_detail": "", "biomarker_status": "Rearrangement positive", "biomarker_test_type": "NGS and RNA sequencing" }, "tag": "ALK" }, "tag": "Biomarker" }
P0077Model
A data model for medical claims data used in the P0077 project, based on the ClaimsModel.
This model is intended to be compatible with the HealthVerity data source used for this project. |
- Dhall
-
< Claim : { 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 } } | Death | Demographic : { 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 } | Diagnosis : { claim : Optional { claim_type : Optional Text , id : Text , index : Optional Integer , procedure : Optional Text } , code : { code : Text , codebook : < CDT | CVX | 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 } } | Eligibility : { 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 } | Hospitalization : { cost : Optional { allowed : Optional Double , category : Optional Text , charge : Optional Double , cost : Optional Double , description : Optional Text , transaction : Optional Text } , milestone : < Admission : Optional Text | Discharge : Optional Text | Stay : Optional Text > , provider : Optional { provider_id : Text , provider_type : Optional Text , taxonomy : Optional Text } } | Lab : { code : { code : Text , codebook : < CDT | CVX | 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 } , service : Optional { place : Optional Text , service_location : < Inpatient | Outpatient > , service_type : Optional Text } , value : { units : Optional Text , value : < NumberValue : Double | TextValue : Text > } } | Medication : { claim : Optional { claim_type : Optional Text , id : Text , index : Optional Integer , procedure : Optional Text } , code : { code : Text , codebook : < CDT | CVX | 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 } , manufacturer : Optional Text , milestone : < Administered : Optional { amount : { units : Optional Text , value : < NumberValue : Double | TextValue : Text > } , days_supply : Optional Natural , dose_number : Optional Natural , quantity : Optional Natural , route : Optional Text , strength : Optional Text } | ExpectedStart : Optional { amount : { units : Optional Text , value : < NumberValue : Double | TextValue : Text > } , days_supply : Optional Natural , dose_number : Optional Natural , quantity : Optional Natural , route : Optional Text , strength : Optional Text } | Filled : Optional { amount : { units : Optional Text , value : < NumberValue : Double | TextValue : Text > } , days_supply : Optional Natural , dose_number : Optional Natural , quantity : Optional Natural , route : Optional Text , strength : Optional Text } | MissingMedicationMilestone | Ordered : Optional { amount : { units : Optional Text , value : < NumberValue : Double | TextValue : Text > } , days_supply : Optional Natural , dose_number : Optional Natural , quantity : Optional Natural , route : Optional Text , strength : Optional Text } | OtherMedicationMilestone : Optional { amount : { units : Optional Text , value : < NumberValue : Double | TextValue : Text > } , days_supply : Optional Natural , dose_number : Optional Natural , quantity : Optional Natural , route : Optional Text , strength : Optional Text } | Prescribed : Optional { amount : { units : Optional Text , value : < NumberValue : Double | TextValue : Text > } , days_supply : Optional Natural , dose_number : Optional Natural , quantity : Optional Natural , route : Optional Text , strength : Optional Text } | UnknownMedicationMilestone > , 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 } } | Procedure : { claim : Optional { claim_type : Optional Text , id : Text , index : Optional Integer , procedure : Optional Text } , code : { code : Text , codebook : < CDT | CVX | 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 } } >
- Example JSON
-
{ "contents": { "claim": { "claim_type": null, "id": "foo", "index": 7, "procedure": null }, "cost": { "allowed": 1.2, "category": "expense", "charge": 0.5, "cost": 9, "description": null, "transaction": null }, "provider": { "provider_id": "1104089713", "provider_type": null, "taxonomy": "207RA0001X" }, "service": { "place": "somewhere", "service_location": "Inpatient", "service_type": "something" } }, "tag": "Claim" }
SynPUFModel
A data model for medical claims data.
- Dhall
-
< Claim : { 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 } } | Death | Demographic : { 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 } | Diagnosis : { claim : Optional { claim_type : Optional Text , id : Text , index : Optional Integer , procedure : Optional Text } , code : { code : Text , codebook : < CDT | CVX | 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 } } | Medication : { claim : Optional { claim_type : Optional Text , id : Text , index : Optional Integer , procedure : Optional Text } , code : { code : Text , codebook : < CDT | CVX | 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 } , manufacturer : Optional Text , milestone : < Administered : Optional { amount : { units : Optional Text , value : < NumberValue : Double | TextValue : Text > } , days_supply : Optional Natural , dose_number : Optional Natural , quantity : Optional Natural , route : Optional Text , strength : Optional Text } | ExpectedStart : Optional { amount : { units : Optional Text , value : < NumberValue : Double | TextValue : Text > } , days_supply : Optional Natural , dose_number : Optional Natural , quantity : Optional Natural , route : Optional Text , strength : Optional Text } | Filled : Optional { amount : { units : Optional Text , value : < NumberValue : Double | TextValue : Text > } , days_supply : Optional Natural , dose_number : Optional Natural , quantity : Optional Natural , route : Optional Text , strength : Optional Text } | MissingMedicationMilestone | Ordered : Optional { amount : { units : Optional Text , value : < NumberValue : Double | TextValue : Text > } , days_supply : Optional Natural , dose_number : Optional Natural , quantity : Optional Natural , route : Optional Text , strength : Optional Text } | OtherMedicationMilestone : Optional { amount : { units : Optional Text , value : < NumberValue : Double | TextValue : Text > } , days_supply : Optional Natural , dose_number : Optional Natural , quantity : Optional Natural , route : Optional Text , strength : Optional Text } | Prescribed : Optional { amount : { units : Optional Text , value : < NumberValue : Double | TextValue : Text > } , days_supply : Optional Natural , dose_number : Optional Natural , quantity : Optional Natural , route : Optional Text , strength : Optional Text } | UnknownMedicationMilestone > , 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 } } | Procedure : { claim : Optional { claim_type : Optional Text , id : Text , index : Optional Integer , procedure : Optional Text } , code : { code : Text , codebook : < CDT | CVX | 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 } } >
- Example JSON
-
{ "contents": { "claim": { "claim_type": null, "id": "foo", "index": 7, "procedure": null }, "cost": { "allowed": 1.2, "category": "expense", "charge": 0.5, "cost": 9, "description": null, "transaction": null }, "provider": { "provider_id": "1104089713", "provider_type": null, "taxonomy": "207RA0001X" }, "service": { "place": "somewhere", "service_location": "Inpatient", "service_type": "something" } }, "tag": "Claim" }