# Path: onefl/partner_name.py
# class PartnerName(Enum):
#     """
#     3-letter partner names
#     """
#     HCN = 'HCN'     # Health Choice Network
#     BND = 'BND'     # Bond Community Hospital
#     UMI = 'UMI'     # University of Miami
# 
#     FLM = 'FLM'     # Florida Medicaid Claims (aka ICHP)
#     CHP = 'CHP'     # Capital Health Plan Claims
# 
#     UFH = 'UFH'     # University of Florida Health
#     TMC = 'TMC'     # Tallahassee Memorial Hospital - Cerner
#     TMA = 'TMA'     # Tallahassee Memorial Hospital - Allscripts
#     ORH = 'ORH'     # Orlando Health
# 
#     FLH = 'FLH'     # Florida Hospital
#     MCH = 'MCH'     # Miami Children's Hospital
# 
# Path: onefl/partner_name.py
# VALID_PARTNERS = [p.value for p in list(PartnerName)]


from invoke import task
from onefl.partner_name import PartnerName  # noqa
from onefl.partner_name import VALID_PARTNERS
    opt_ask = '--ask' if ask else ''

    ctx.run('PYTHONPATH=. python run/hasher.py -i {} -o {} {}'
            .format(inputfolder, outputfolder, opt_ask))


@task(aliases=['link'],
      help={'partner': 'The partner name: {}'.format(VALID_PARTNERS)})
def linker(ctx, partner, ask=True):
    """ Generate OneFlorida Ids from hashes """
    inputfolder = 'data'
    outputfolder = 'data'
    opt_ask = '--ask' if ask else ''

    if partner:
        ctx.run('PYTHONPATH=. python run/linker.py -i {} -o {} -p {} {}'
                .format(inputfolder, outputfolder, partner, opt_ask))
    else:
        print("""
Usage:
 inv link --inputdir=dir --outputdir=dir -p=partner --ask
              """)
        print("[{}] Please specify a valid partner name"
              " and input directories.\n"
              "Available partners: {}"
              .format(STATUS_FAIL, VALID_PARTNERS))


@task
def link_flm(ctx):

# Path: onefl/partner_name.py
# class PartnerName(Enum):
#     """
#     3-letter partner names
#     """
#     HCN = 'HCN'     # Health Choice Network
#     BND = 'BND'     # Bond Community Hospital
#     UMI = 'UMI'     # University of Miami
# 
#     FLM = 'FLM'     # Florida Medicaid Claims (aka ICHP)
#     CHP = 'CHP'     # Capital Health Plan Claims
# 
#     UFH = 'UFH'     # University of Florida Health
#     TMC = 'TMC'     # Tallahassee Memorial Hospital - Cerner
#     TMA = 'TMA'     # Tallahassee Memorial Hospital - Allscripts
#     ORH = 'ORH'     # Orlando Health
# 
#     FLH = 'FLH'     # Florida Hospital
#     MCH = 'MCH'     # Miami Children's Hospital
# 
# Path: onefl/partner_name.py
# VALID_PARTNERS = [p.value for p in list(PartnerName)]


# Path: tasks.py
from invoke import task
from onefl.partner_name import PartnerName  # noqa
from onefl.partner_name import VALID_PARTNERS

    opt_ask = '--ask' if ask else ''

    ctx.run('PYTHONPATH=. python run/hasher.py -i {} -o {} {}'
            .format(inputfolder, outputfolder, opt_ask))


@task(aliases=['link'],
      help={'partner': 'The partner name: {}'.format(VALID_PARTNERS)})
def linker(ctx, partner, ask=True):
    """ Generate OneFlorida Ids from hashes """
    inputfolder = 'data'
    outputfolder = 'data'
    opt_ask = '--ask' if ask else ''

    if partner:
        ctx.run('PYTHONPATH=. python run/linker.py -i {} -o {} -p {} {}'
                .format(inputfolder, outputfolder, partner, opt_ask))
    else:
        print("""
Usage:
 inv link --inputdir=dir --outputdir=dir -p=partner --ask
              """)
        print("[{}] Please specify a valid partner name"
              " and input directories.\n"
              "Available partners: {}"
              .format(STATUS_FAIL, VALID_PARTNERS))


@task
def link_flm(ctx):

    linker(ctx, partner=PartnerName.FLM.value)