def run_command()

in healthcare/api-client/v1/fhir/fhir_resources.py [0:0]


def run_command(args):  # noqa
    """Calls the program using the specified command."""
    if args.project_id is None:
        print(
            "You must specify a project ID or set the "
            '"GOOGLE_CLOUD_PROJECT" environment variable.'
        )
        return

    elif args.command == "create-resource-from-file":
        create_resource_from_file(
            args.project_id,
            args.location,
            args.dataset_id,
            args.fhir_store_id,
            args.resource_type,
            args.resource_file,
        )

    elif args.command == "create-patient":
        create_patient(
            args.project_id,
            args.location,
            args.dataset_id,
            args.fhir_store_id,
        )

    elif args.command == "create-encounter":
        create_encounter(
            args.project_id,
            args.location,
            args.dataset_id,
            args.fhir_store_id,
            args.patient_id,
        )

    elif args.command == "create-observation":
        create_observation(
            args.project_id,
            args.location,
            args.dataset_id,
            args.fhir_store_id,
            args.patient_id,
            args.encounter_id,
        )

    elif args.command == "get-resource":
        get_resource(
            args.project_id,
            args.location,
            args.dataset_id,
            args.fhir_store_id,
            args.resource_type,
            args.resource_id,
        )

    elif args.command == "execute-bundle":
        execute_bundle(
            args.project_id,
            args.location,
            args.dataset_id,
            args.fhir_store_id,
            args.bundle,
        )

    elif args.command == "list-resource-history":
        list_resource_history(
            args.project_id,
            args.location,
            args.dataset_id,
            args.fhir_store_id,
            args.resource_type,
            args.resource_id,
        )

    elif args.command == "get-resource-history":
        get_resource_history(
            args.project_id,
            args.location,
            args.dataset_id,
            args.fhir_store_id,
            args.resource_type,
            args.resource_id,
            args.version_id,
        )

    elif args.command == "delete-resource-purge":
        delete_resource_purge(
            args.project_id,
            args.location,
            args.dataset_id,
            args.fhir_store_id,
            args.resource_type,
            args.resource_id,
        )

    elif args.command == "update-resource":
        update_resource(
            args.project_id,
            args.location,
            args.dataset_id,
            args.fhir_store_id,
            args.resource_type,
            args.resource_id,
        )

    elif args.command == "patch-resource":
        patch_resource(
            args.project_id,
            args.location,
            args.dataset_id,
            args.fhir_store_id,
            args.resource_type,
            args.resource_id,
        )

    elif args.command == "delete-resource":
        delete_resource(
            args.project_id,
            args.location,
            args.dataset_id,
            args.fhir_store_id,
            args.resource_type,
            args.resource_id,
        )

    elif args.command == "search-resources-get":
        search_resources_get(
            args.project_id,
            args.location,
            args.dataset_id,
            args.fhir_store_id,
            args.resource_type,
        )

    elif args.command == "search-resources-post":
        search_resources_post(
            args.project_id,
            args.location,
            args.dataset_id,
            args.fhir_store_id,
        )

    elif args.command == "get-patient-everything":
        get_patient_everything(
            args.project_id,
            args.location,
            args.dataset_id,
            args.fhir_store_id,
            args.resource_id,
        )

    elif args.command == "create-implementation-guide":
        create_implementation_guide(
            args.project_id,
            args.location,
            args.dataset_id,
            args.fhir_store_id,
            args.implementation_guide_file,
        )

    elif args.command == "enable-implementation-guide":
        enable_implementation_guide(
            args.project_id,
            args.location,
            args.dataset_id,
            args.fhir_store_id,
            args.implementation_guide_url,
        )

    elif args.command == "create-structure-definition":
        create_structure_definition(
            args.project_id,
            args.location,
            args.dataset_id,
            args.fhir_store_id,
            args.structure_definition_file,
        )

    elif args.command == "validate-resource":
        validate_resource(
            args.project_id,
            args.location,
            args.dataset_id,
            args.fhir_store_id,
            args.resource_type,
        )

    elif args.command == "validate-resource-profile-url":
        validate_resource_profile_url(
            args.project_id,
            args.location,
            args.dataset_id,
            args.fhir_store_id,
            args.resource_type,
            args.profile_url,
        )