"""
python-bluebutton
FILE: file_def_cms
Created: 3/6/15 10:42 PM

Add Seg List for definition of CMS BlueButton file

"""
__author__ = '<NAME>:@ekivemark'

# Seg is used to control and translate headings and lines
SEG_DEF = [
    {"match": "mymedicare.GovPersonalHealthInformation",
        "pre": {"title": "MyMedicare.gov Personal Health Information",
                "languageCode": "code=\"en-US\"", "versionNumber": {"value": "2"},
                "effectiveTime": {"value": "20150210171504+0500"},
                "confidentialityCode": {"code": "N",
                                        "codeSystem": "2.16.840.1.113883.5.25"},
                "originator": "MyMedicare.gov",
                "comments": ["generated by python-bluebutton utility",
                             "http://github.com/ekivemark/python-bluebutton",
                             "using text file downloaded from",
                             "https://myMedicare.gov"],
                "source": "MyMedicare.gov",
                },
        "level": 0,
        "name": "header",
        "type": "dict", "dict_name": "header", "multi": "False",
        "parent": "",
        "file_source": "CMS",
     },
    {"match": "demographic",
     "level": 0,
     "name": "patient",
     "type": "dict", "dict_name": "patient", "multi": "False",
     "mode": "",
     "parent": "",
     "file_source": "CMS",
     },
    {"match": "patient.partAEffectiveDate",
     "level": 1,
     "name": "medicare",
     "type": "dict", "dict_name": "medicare", "multi": "False",
     "parent": "demographic",
     "file_source": "CMS",
     },
    {"match": "patient.partBEffectiveDate",
     "level": 1,
     "name": "medicare",
     "type": "dict", "dict_name": "medicare", "multi": "False",
     "parent": "demographic",
     "file_source": "CMS",
     },
    {"match": "patient.phoneNumber",
     "level": 2,
     "name": "phoneNumber",
     "type": "list", "sub_type": "string", "multi": "True",
     "mode": "",
     "parent": "demographic",
     "file_source": "CMS",
     },
    {"match": "emergencyContact",
     "level": 0,
     "name": "emergencyContact",
     "type": "list", "sub_type": "dict", "multi": "True",
     "mode": "",
     "parent": "",
     "file_source": "CMS",
     },
    {"match": "emergencyContact.contactName",
     "level": 1,
     "list": True,
     "name": "contactName",
     "type": "dict", "dict_name": "contactName", "multi": "True",
     "mode": "block",
     "parent": "emergencyContact",
     "file_source": "CMS",
     },
    {"match": "emergencyContact.homePhone",
     "level": 2,
     "type": "dict", "dict_name": "phone", "multi": "True",
     "mode": "block",
     "name": "home",
     "field": "home",
     "parent": "emergencyContact",
     "file_source": "CMS",
     },
    {"match": "emergencyContact.workPhone",
     "level": 2,
     "type": "dict", "dict_name": "phone", "multi": "True",
     "mode": "block",
     "name": "work",
     "field": "work",
     "parent": "emergencyContact",
     "file_source": "CMS",
     },
    {"match": "emergencyContact.mobilePhone",
     "level": 2,
     "type": "dict", "dict_name": "phone", "multi": "True",
     "mode": "block",
     "name": "mobile",
     "field": "mobile",
     "parent": "emergencyContact",
     "file_source": "CMS",
     },
    {"match": "selfReportedMedicalConditions",
     "name": "medicalConditions",
     "level": 0,
     "type": "list", "sub_type": "dict", "multi": "True",
     "file_source": "CMS",
     },
    {"match": "selfReportedAllergies",
     "name": "Allergies",
     "level": 0,
     "type": "list", "sub_type": "dict", "multi": "True",
     "file_source": "CMS",
     },
    {"match": "selfReportedImplantableDevice",
     "name": "ImplantableDevices",
     "level": 0,
     "type": "list", "sub_type": "dict", "multi": "True",
     "file_source": "CMS",
     },
    {"match": "selfReportedImmunizations",
     "name": "Immunizations",
     "level": 0,
     "type": "list", "sub_type": "dict", "multi": "True",
     "file_source": "CMS",
     },
    {"match": "selfReportedLabsAndTests",
     "name": "Labs",
     "level": 0,
     "type": "list", "sub_type": "dict", "multi": "True",
     "file_source": "CMS",
     },
    {"match": "selfReportedVitalStatistics",
     "name": "vitals",
     "level": 0,
     "type": "list", "sub_type": "dict", "multi": "True",
     "file_source": "CMS",
     },
    {"match": "familyMedicalHistory",
     "name": "familyHistory",
     "level": 0,
     "type": "list", "sub_type": "dict", "dict_name": "FamilyMember",
     "multi": "True",
     "custom": "family_history",
     "file_source": "CMS",
     },
    {"match": "familyHistory",
     "name": "familyHistory",
     "level": 0,
     "type": "list", "sub_type": "dict", "dict_name": "familyMember",
     "multi": "True",
     "file_source": "CMS",
     },
    {"match": "familyHistory.familyMember",
     "dict_name": "relationship",
     "name": "relationship",
     "level": 1,
     "type": "list", "sub_type": "dict",
     "multi": "True",
     "file_source": "CMS",
     },
    {"match": "familyHistory.familyMember.type",
     "dict_name": "background",
     "name": "background",
     "level": 2,
     "type": "dict", "sub_type": "dict", "multi": "True",
     "file_source": "CMS",
     },

    {"match": "familyHistory.relationship.background",
     "name": "background",
     "level": 2,
     "type": "dict", "sub_type": "dict", "multi": "True",
     "file_source": "CMS",
     },
    {"match": "drugs",
     "name": "medications",
     "level": 0,
     "type": "list", "sub_type": "dict", "multi": "True",
     "file_source": "CMS",
     },
    {"match": "preventiveServices",
     "name": "preventiveServices",
     "level": 0,
     "type": "list", "sub_type": "dict", "multi": "True",
     "file_source": "CMS",
     },
    {"match": "providers",
     "name": "providers",
     "level": 0,
     "type": "list", "sub_type": "dict", "multi": "True",
     "file_source": "CMS",
     },
    {"match": "pharmacies",
     "name": "pharmacies",
     "level": 0,
     "type": "list", "sub_type": "dict", "multi": "True",
     "file_source": "CMS",
     },
    {"match": "pharmacyName",
     "name": "pharmacyName",
     "level": 0,
     "type": "dict", "sub_type": "dict", "multi": "True",
     "file_source": "CMS",
     },
    {"match": "plans",
     "name": "insurance",
     "pre": {"category": "Medicare",
             "mspType": [],
             "startDate": [],
             "endDate": [],
             "insurer": "Medicare",
             },
     "level": 0,
     "type": "list", "sub_type": "dict", "dict_name": "category",
     "multi": "True",
     "file_source": "CMS",
     },
    {"match": "employerSubsidy",
     "name": "category",
     "level": 1,
     "type": "list", "sub_type": "dict", "dict_name": "plan",
     "multi": "True",
     "file_source": "CMS",
     },
    # because we redefine the level we need an entry at both levels (0/1)
    {"match": "insurance.medicareProvider",
     "name": "insurance",
     "pre": {"category": "Medicare",
             "mspType": [],
             "startDate": [],
             "endDate": [],
             "insurer": "Medicare",
             },
     "level": 0,
     "type": "list", "sub_type": "dict", "dict_name": "category",
     "multi": "True",
     "file_source": "CMS",
     },
    {"match": "insurance.employerSubsidy",
     "name": "category",
     "level": 1,
     "type": "list", "sub_type": "dict", "dict_name": "plan",
     "multi": "True",
     "file_source": "CMS",
     },
    {"match": "primaryInsurance",
     "name": "category",
     "level": 1,
     "type": "list", "sub_type": "dict", "dict_name": "plan",
     "multi": "True",
     "file_source": "CMS",
     },
    {"match": "insurance.primaryInsurance",
     "name": "category",
     "level": 1,
     "type": "list", "sub_type": "dict", "dict_name": "plan",
     "multi": "True",
     "file_source": "CMS",
     },
    {"match": "otherInsurance",
     "name": "category",
     "level": 1,
     "type": "list", "sub_type": "dict", "dict_name": "plan",
     "multi": "True",
     "file_source": "CMS",
     },
    {"match": "insurance.otherInsurance",
     "name": "category",
     "level": 1,
     "type": "list", "sub_type": "dict", "dict_name": "plan",
     "multi": "True",
     "file_source": "CMS",
     },
    {"match": "claimSummary",
     "name": "claims",
     "level": 0,
     "type": "list", "sub_type": "dict", "multi": "True",
     "custom": "claim_summary",
     "file_source": "CMS",
     },
    {"match": "claimHeader",
     "name": "claim",
     "level": 1,
     "type": "list", "sub_type": "dict", "multi": "True",
     "file_source": "CMS",
     },
    {"match": "claims.claimHeader",
     "name": "claim",
     "level": 1,
     "type": "list", "sub_type": "dict", "multi": "True",
     "file_source": "CMS",
     },
    {"match": "claims.details.claimNumber",
     "name": "claim",
     "level": 1,
     "type": "list", "sub_type": "dict", "multi": "True",
     "file_source": "CMS",
     },

    {"match": "claims.serviceStartDate",
     "level": 2,
     "name": "startDate",
     "type": "dict", "dict_name": "date", "multi": "False",
     "parent": "claims",
     "file_source": "CMS",
     },
    {"match": "claims.serviceEndDate",
     "level": 2,
     "name": "endDate",
     "type": "dict", "dict_name": "date", "multi": "False",
     "parent": "claims",
     "file_source": "CMS",
     },
    {"match": "claims.claim.serviceStartDate",
     "level": 2,
     "name": "startDate",
     "type": "dict", "dict_name": "date", "multi": "False",
     "parent": "claims",
     "file_source": "CMS",
     },
    {"match": "claims.claim.serviceEndDate",
     "level": 2,
     "name": "endDate",
     "type": "dict", "dict_name": "date", "multi": "False",
     "parent": "claims",
     "file_source": "CMS",
     },

    {"match": "claims.amountCharged",
     "level": 2,
     "name": "startDate",
     "type": "dict", "dict_name": "charges", "multi": "False",
     "parent": "claims",
     "file_source": "CMS",
     },
    {"match": "claims.medicareApproved",
     "level": 2,
     "name": "endDate",
     "type": "dict", "dict_name": "charges", "multi": "False",
     "parent": "claims",
     "file_source": "CMS",
     },
    {"match": "claims.providerPaid",
     "level": 2,
     "name": "endDate",
     "type": "dict", "dict_name": "charges", "multi": "False",
     "parent": "claims",
     "file_source": "CMS",
     },
    {"match": "claims.youMayBeBilled",
     "level": 2,
     "name": "endDate",
     "type": "dict", "dict_name": "charges", "multi": "False",
     "parent": "claims",
     "file_source": "CMS",
     },
    {"match": "claims.claim.amountCharged",
     "level": 2,
     "name": "startDate",
     "type": "dict", "dict_name": "charges", "multi": "False",
     "parent": "claims",
     "file_source": "CMS",
     },
    {"match": "claims.claim.medicareApproved",
     "level": 2,
     "name": "endDate",
     "type": "dict", "dict_name": "charges", "multi": "False",
     "parent": "claims",
     "file_source": "CMS",
     },
    {"match": "claims.claim.providerPaid",
     "level": 2,
     "name": "endDate",
     "type": "dict", "dict_name": "charges", "multi": "False",
     "parent": "claims",
     "file_source": "CMS",
     },
    {"match": "claims.claim.youMayBeBilled",
     "level": 2,
     "name": "endDate",
     "type": "dict", "dict_name": "charges", "multi": "False",
     "parent": "claims",
     "file_source": "CMS",
     },

    {"match": "claims.claimNumber",
     "name": "summary",
     "level": 2,
     "type": "dict", "sub_type": "dict", "dict_name": "summary",
     "multi": "True",
     "file_source": "CMS",
     },
    {"match": "claims.claim.claimNumber",
     "name": "summary",
     "level": 2,
     "type": "dict", "sub_type": "dict", "dict_name": "summary",
     "multi": "True",
     "file_source": "CMS",
     },

    {"match": "claims.details.lineNumber",
     "name": "details",
     "level": 2,
     "type": "list", "sub_type": "dict", "dict_name": "line",
     "multi": "True",
     "file_source": "CMS",
     },


    {"match": "claims.claimLinesForClaimNumber",
     "name": "details",
     "level": 2,
     "type": "list", "sub_type": "dict", "dict_name": "details",
     "multi": "True",
     "file_source": "CMS",
     },

    {"match": "claims.details.modifier1Description",
     "name": "modifiers",
     "level": 3,
     "type": "dict", "sub_type": "dict", "dict_name": "modifiers",
     "multi": "True",
     "file_source": "CMS",
     },
    {"match": "claims.details.modifier2Description",
     "name": "modifiers",
     "level": 3,
     "type": "dict", "sub_type": "dict", "dict_name": "modifiers",
     "multi": "True",
     "file_source": "CMS",
     },
    {"match": "claims.details.modifier3Description",
     "name": "modifiers",
     "level": 3,
     "type": "dict", "sub_type": "dict", "dict_name": "modifiers",
     "multi": "True",
     "file_source": "CMS",
     },
    {"match": "claims.details.modifier4Description",
     "name": "modifiers",
     "level": 3,
     "type": "dict", "sub_type": "dict", "dict_name": "modifiers",
     "multi": "True",
     "file_source": "CMS",
     },
    {"match": "claims.details.modifier5Description",
     "name": "modifiers",
     "level": 3,
     "type": "dict", "sub_type": "dict", "dict_name": "modifiers",
     "multi": "True",
     "file_source": "CMS",
     },
    {"match": "claims.details.modifier6Description",
     "name": "modifiers",
     "level": 3,
     "type": "dict", "sub_type": "dict", "dict_name": "modifiers",
     "multi": "True",
     "file_source": "CMS",
     },
    {"match": "PartDClaims",
     "name": "partDClaim",
     "level": 1,
     "type": "list", "sub_type": "dict", "dict_name": "partD",
     "multi": "True",
     "file_source": "CMS",
     },
    {"match": "claims.partDClaims",
     "name": "partDClaim",
     "level": 1,
     "type": "list", "sub_type": "dict", "dict_name": "partD",
     "multi": "True",
     "file_source": "CMS",
     },


    ]

FLD_TRANSLATE = [{"input": "Emergency Contact",
                 "output": "emergency_contact"},
                {"input": "emergency_contact.Contact Name",
                 "output": "name"},
                {"input": "emergency_contact.Address Line 1",
                 "output": "line_1"},
                {"input": "emergency_contact.Address Line 2",
                 "output": "line_2"},
                ]

"""
python-bluebutton
FILE: file_def_cms
Created: 3/6/15 10:42 PM

Add Seg List for definition of CMS BlueButton file

"""
__author__ = '<NAME>:@ekivemark'

# Seg is used to control and translate headings and lines
SEG_DEF = [
    {"match": "mymedicare.GovPersonalHealthInformation",
        "pre": {"title": "MyMedicare.gov Personal Health Information",
                "languageCode": "code=\"en-US\"", "versionNumber": {"value": "2"},
                "effectiveTime": {"value": "20150210171504+0500"},
                "confidentialityCode": {"code": "N",
                                        "codeSystem": "2.16.840.1.113883.5.25"},
                "originator": "MyMedicare.gov",
                "comments": ["generated by python-bluebutton utility",
                             "http://github.com/ekivemark/python-bluebutton",
                             "using text file downloaded from",
                             "https://myMedicare.gov"],
                "source": "MyMedicare.gov",
                },
        "level": 0,
        "name": "header",
        "type": "dict", "dict_name": "header", "multi": "False",
        "parent": "",
        "file_source": "CMS",
     },
    {"match": "demographic",
     "level": 0,
     "name": "patient",
     "type": "dict", "dict_name": "patient", "multi": "False",
     "mode": "",
     "parent": "",
     "file_source": "CMS",
     },
    {"match": "patient.partAEffectiveDate",
     "level": 1,
     "name": "medicare",
     "type": "dict", "dict_name": "medicare", "multi": "False",
     "parent": "demographic",
     "file_source": "CMS",
     },
    {"match": "patient.partBEffectiveDate",
     "level": 1,
     "name": "medicare",
     "type": "dict", "dict_name": "medicare", "multi": "False",
     "parent": "demographic",
     "file_source": "CMS",
     },
    {"match": "patient.phoneNumber",
     "level": 2,
     "name": "phoneNumber",
     "type": "list", "sub_type": "string", "multi": "True",
     "mode": "",
     "parent": "demographic",
     "file_source": "CMS",
     },
    {"match": "emergencyContact",
     "level": 0,
     "name": "emergencyContact",
     "type": "list", "sub_type": "dict", "multi": "True",
     "mode": "",
     "parent": "",
     "file_source": "CMS",
     },
    {"match": "emergencyContact.contactName",
     "level": 1,
     "list": True,
     "name": "contactName",
     "type": "dict", "dict_name": "contactName", "multi": "True",
     "mode": "block",
     "parent": "emergencyContact",
     "file_source": "CMS",
     },
    {"match": "emergencyContact.homePhone",
     "level": 2,
     "type": "dict", "dict_name": "phone", "multi": "True",
     "mode": "block",
     "name": "home",
     "field": "home",
     "parent": "emergencyContact",
     "file_source": "CMS",
     },
    {"match": "emergencyContact.workPhone",
     "level": 2,
     "type": "dict", "dict_name": "phone", "multi": "True",
     "mode": "block",
     "name": "work",
     "field": "work",
     "parent": "emergencyContact",
     "file_source": "CMS",
     },
    {"match": "emergencyContact.mobilePhone",
     "level": 2,
     "type": "dict", "dict_name": "phone", "multi": "True",
     "mode": "block",
     "name": "mobile",
     "field": "mobile",
     "parent": "emergencyContact",
     "file_source": "CMS",
     },
    {"match": "selfReportedMedicalConditions",
     "name": "medicalConditions",
     "level": 0,
     "type": "list", "sub_type": "dict", "multi": "True",
     "file_source": "CMS",
     },
    {"match": "selfReportedAllergies",
     "name": "Allergies",
     "level": 0,
     "type": "list", "sub_type": "dict", "multi": "True",
     "file_source": "CMS",
     },
    {"match": "selfReportedImplantableDevice",
     "name": "ImplantableDevices",
     "level": 0,
     "type": "list", "sub_type": "dict", "multi": "True",
     "file_source": "CMS",
     },
    {"match": "selfReportedImmunizations",
     "name": "Immunizations",
     "level": 0,
     "type": "list", "sub_type": "dict", "multi": "True",
     "file_source": "CMS",
     },
    {"match": "selfReportedLabsAndTests",
     "name": "Labs",
     "level": 0,
     "type": "list", "sub_type": "dict", "multi": "True",
     "file_source": "CMS",
     },
    {"match": "selfReportedVitalStatistics",
     "name": "vitals",
     "level": 0,
     "type": "list", "sub_type": "dict", "multi": "True",
     "file_source": "CMS",
     },
    {"match": "familyMedicalHistory",
     "name": "familyHistory",
     "level": 0,
     "type": "list", "sub_type": "dict", "dict_name": "FamilyMember",
     "multi": "True",
     "custom": "family_history",
     "file_source": "CMS",
     },
    {"match": "familyHistory",
     "name": "familyHistory",
     "level": 0,
     "type": "list", "sub_type": "dict", "dict_name": "familyMember",
     "multi": "True",
     "file_source": "CMS",
     },
    {"match": "familyHistory.familyMember",
     "dict_name": "relationship",
     "name": "relationship",
     "level": 1,
     "type": "list", "sub_type": "dict",
     "multi": "True",
     "file_source": "CMS",
     },
    {"match": "familyHistory.familyMember.type",
     "dict_name": "background",
     "name": "background",
     "level": 2,
     "type": "dict", "sub_type": "dict", "multi": "True",
     "file_source": "CMS",
     },

    {"match": "familyHistory.relationship.background",
     "name": "background",
     "level": 2,
     "type": "dict", "sub_type": "dict", "multi": "True",
     "file_source": "CMS",
     },
    {"match": "drugs",
     "name": "medications",
     "level": 0,
     "type": "list", "sub_type": "dict", "multi": "True",
     "file_source": "CMS",
     },
    {"match": "preventiveServices",
     "name": "preventiveServices",
     "level": 0,
     "type": "list", "sub_type": "dict", "multi": "True",
     "file_source": "CMS",
     },
    {"match": "providers",
     "name": "providers",
     "level": 0,
     "type": "list", "sub_type": "dict", "multi": "True",
     "file_source": "CMS",
     },
    {"match": "pharmacies",
     "name": "pharmacies",
     "level": 0,
     "type": "list", "sub_type": "dict", "multi": "True",
     "file_source": "CMS",
     },
    {"match": "pharmacyName",
     "name": "pharmacyName",
     "level": 0,
     "type": "dict", "sub_type": "dict", "multi": "True",
     "file_source": "CMS",
     },
    {"match": "plans",
     "name": "insurance",
     "pre": {"category": "Medicare",
             "mspType": [],
             "startDate": [],
             "endDate": [],
             "insurer": "Medicare",
             },
     "level": 0,
     "type": "list", "sub_type": "dict", "dict_name": "category",
     "multi": "True",
     "file_source": "CMS",
     },
    {"match": "employerSubsidy",
     "name": "category",
     "level": 1,
     "type": "list", "sub_type": "dict", "dict_name": "plan",
     "multi": "True",
     "file_source": "CMS",
     },
    # because we redefine the level we need an entry at both levels (0/1)
    {"match": "insurance.medicareProvider",
     "name": "insurance",
     "pre": {"category": "Medicare",
             "mspType": [],
             "startDate": [],
             "endDate": [],
             "insurer": "Medicare",
             },
     "level": 0,
     "type": "list", "sub_type": "dict", "dict_name": "category",
     "multi": "True",
     "file_source": "CMS",
     },
    {"match": "insurance.employerSubsidy",
     "name": "category",
     "level": 1,
     "type": "list", "sub_type": "dict", "dict_name": "plan",
     "multi": "True",
     "file_source": "CMS",
     },
    {"match": "primaryInsurance",
     "name": "category",
     "level": 1,
     "type": "list", "sub_type": "dict", "dict_name": "plan",
     "multi": "True",
     "file_source": "CMS",
     },
    {"match": "insurance.primaryInsurance",
     "name": "category",
     "level": 1,
     "type": "list", "sub_type": "dict", "dict_name": "plan",
     "multi": "True",
     "file_source": "CMS",
     },
    {"match": "otherInsurance",
     "name": "category",
     "level": 1,
     "type": "list", "sub_type": "dict", "dict_name": "plan",
     "multi": "True",
     "file_source": "CMS",
     },
    {"match": "insurance.otherInsurance",
     "name": "category",
     "level": 1,
     "type": "list", "sub_type": "dict", "dict_name": "plan",
     "multi": "True",
     "file_source": "CMS",
     },
    {"match": "claimSummary",
     "name": "claims",
     "level": 0,
     "type": "list", "sub_type": "dict", "multi": "True",
     "custom": "claim_summary",
     "file_source": "CMS",
     },
    {"match": "claimHeader",
     "name": "claim",
     "level": 1,
     "type": "list", "sub_type": "dict", "multi": "True",
     "file_source": "CMS",
     },
    {"match": "claims.claimHeader",
     "name": "claim",
     "level": 1,
     "type": "list", "sub_type": "dict", "multi": "True",
     "file_source": "CMS",
     },
    {"match": "claims.details.claimNumber",
     "name": "claim",
     "level": 1,
     "type": "list", "sub_type": "dict", "multi": "True",
     "file_source": "CMS",
     },

    {"match": "claims.serviceStartDate",
     "level": 2,
     "name": "startDate",
     "type": "dict", "dict_name": "date", "multi": "False",
     "parent": "claims",
     "file_source": "CMS",
     },
    {"match": "claims.serviceEndDate",
     "level": 2,
     "name": "endDate",
     "type": "dict", "dict_name": "date", "multi": "False",
     "parent": "claims",
     "file_source": "CMS",
     },
    {"match": "claims.claim.serviceStartDate",
     "level": 2,
     "name": "startDate",
     "type": "dict", "dict_name": "date", "multi": "False",
     "parent": "claims",
     "file_source": "CMS",
     },
    {"match": "claims.claim.serviceEndDate",
     "level": 2,
     "name": "endDate",
     "type": "dict", "dict_name": "date", "multi": "False",
     "parent": "claims",
     "file_source": "CMS",
     },

    {"match": "claims.amountCharged",
     "level": 2,
     "name": "startDate",
     "type": "dict", "dict_name": "charges", "multi": "False",
     "parent": "claims",
     "file_source": "CMS",
     },
    {"match": "claims.medicareApproved",
     "level": 2,
     "name": "endDate",
     "type": "dict", "dict_name": "charges", "multi": "False",
     "parent": "claims",
     "file_source": "CMS",
     },
    {"match": "claims.providerPaid",
     "level": 2,
     "name": "endDate",
     "type": "dict", "dict_name": "charges", "multi": "False",
     "parent": "claims",
     "file_source": "CMS",
     },
    {"match": "claims.youMayBeBilled",
     "level": 2,
     "name": "endDate",
     "type": "dict", "dict_name": "charges", "multi": "False",
     "parent": "claims",
     "file_source": "CMS",
     },
    {"match": "claims.claim.amountCharged",
     "level": 2,
     "name": "startDate",
     "type": "dict", "dict_name": "charges", "multi": "False",
     "parent": "claims",
     "file_source": "CMS",
     },
    {"match": "claims.claim.medicareApproved",
     "level": 2,
     "name": "endDate",
     "type": "dict", "dict_name": "charges", "multi": "False",
     "parent": "claims",
     "file_source": "CMS",
     },
    {"match": "claims.claim.providerPaid",
     "level": 2,
     "name": "endDate",
     "type": "dict", "dict_name": "charges", "multi": "False",
     "parent": "claims",
     "file_source": "CMS",
     },
    {"match": "claims.claim.youMayBeBilled",
     "level": 2,
     "name": "endDate",
     "type": "dict", "dict_name": "charges", "multi": "False",
     "parent": "claims",
     "file_source": "CMS",
     },

    {"match": "claims.claimNumber",
     "name": "summary",
     "level": 2,
     "type": "dict", "sub_type": "dict", "dict_name": "summary",
     "multi": "True",
     "file_source": "CMS",
     },
    {"match": "claims.claim.claimNumber",
     "name": "summary",
     "level": 2,
     "type": "dict", "sub_type": "dict", "dict_name": "summary",
     "multi": "True",
     "file_source": "CMS",
     },

    {"match": "claims.details.lineNumber",
     "name": "details",
     "level": 2,
     "type": "list", "sub_type": "dict", "dict_name": "line",
     "multi": "True",
     "file_source": "CMS",
     },


    {"match": "claims.claimLinesForClaimNumber",
     "name": "details",
     "level": 2,
     "type": "list", "sub_type": "dict", "dict_name": "details",
     "multi": "True",
     "file_source": "CMS",
     },

    {"match": "claims.details.modifier1Description",
     "name": "modifiers",
     "level": 3,
     "type": "dict", "sub_type": "dict", "dict_name": "modifiers",
     "multi": "True",
     "file_source": "CMS",
     },
    {"match": "claims.details.modifier2Description",
     "name": "modifiers",
     "level": 3,
     "type": "dict", "sub_type": "dict", "dict_name": "modifiers",
     "multi": "True",
     "file_source": "CMS",
     },
    {"match": "claims.details.modifier3Description",
     "name": "modifiers",
     "level": 3,
     "type": "dict", "sub_type": "dict", "dict_name": "modifiers",
     "multi": "True",
     "file_source": "CMS",
     },
    {"match": "claims.details.modifier4Description",
     "name": "modifiers",
     "level": 3,
     "type": "dict", "sub_type": "dict", "dict_name": "modifiers",
     "multi": "True",
     "file_source": "CMS",
     },
    {"match": "claims.details.modifier5Description",
     "name": "modifiers",
     "level": 3,
     "type": "dict", "sub_type": "dict", "dict_name": "modifiers",
     "multi": "True",
     "file_source": "CMS",
     },
    {"match": "claims.details.modifier6Description",
     "name": "modifiers",
     "level": 3,
     "type": "dict", "sub_type": "dict", "dict_name": "modifiers",
     "multi": "True",
     "file_source": "CMS",
     },
    {"match": "PartDClaims",
     "name": "partDClaim",
     "level": 1,
     "type": "list", "sub_type": "dict", "dict_name": "partD",
     "multi": "True",
     "file_source": "CMS",
     },
    {"match": "claims.partDClaims",
     "name": "partDClaim",
     "level": 1,
     "type": "list", "sub_type": "dict", "dict_name": "partD",
     "multi": "True",
     "file_source": "CMS",
     },


    ]

FLD_TRANSLATE = [{"input": "Emergency Contact",
                 "output": "emergency_contact"},
                {"input": "emergency_contact.Contact Name",
                 "output": "name"},
                {"input": "emergency_contact.Address Line 1",
                 "output": "line_1"},
                {"input": "emergency_contact.Address Line 2",
                 "output": "line_2"},
                ]

python-bluebutton FILE: file_def_cms Created: 3/6/15 10:42 PM  Add Seg List for definition of CMS BlueButton file # Seg is used to control and translate headings and lines # because we redefine the level we need an entry at both levels (0/1)