def parse_command_line_args()

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


def parse_command_line_args():
    """Parses command line arguments."""

    parser = argparse.ArgumentParser(
        description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter
    )

    parser.add_argument(
        "--project_id",
        default=os.environ.get("GOOGLE_CLOUD_PROJECT"),
        help="GCP project name",
    )

    parser.add_argument("--location", default="us-central1", help="GCP location")

    parser.add_argument("--dataset_id", default=None, help="Name of dataset")

    parser.add_argument("--fhir_store_id", default=None, help="Name of FHIR store")

    parser.add_argument(
        "--resource_file",
        default=None,
        help="A JSON file containing the contents of a FHIR resource to create",
    )

    parser.add_argument(
        "--resource_type",
        default=None,
        help="The type of resource. First letter must be capitalized",
    )

    parser.add_argument(
        "--resource_id", default=None, help="Identifier for a FHIR resource"
    )

    parser.add_argument(
        "--patient_id",
        default=None,
        help="Identifier for a Patient resource. Can be used as a reference "
        "for an Encounter/Observation",
    )

    parser.add_argument(
        "--encounter_id",
        default=None,
        help="Identifier for an Encounter resource. Can be used as a "
        "reference for an Observation",
    )

    parser.add_argument(
        "--bundle",
        default=None,
        help="Name of file containing bundle of operations to execute",
    )

    parser.add_argument(
        "--uri_prefix", default=None, help="Prefix of gs:// URIs for import and export"
    )

    parser.add_argument("--version_id", default=None, help="Version of a FHIR resource")

    parser.add_argument(
        "--structure_definition_file",
        default=None,
        help="A StructureDefinition resource JSON file",
    )

    parser.add_argument(
        "--profile_url",
        default=None,
        help="The canonical URL of the FHIR profile to validate against",
    )

    parser.add_argument(
        "--implementation_guide_file",
        default=None,
        help="An ImplementationGuide resource JSON file",
    )

    parser.add_argument(
        "--implementation_guide_url",
        default=None,
        help="the URL defined in the 'url' property of the ImplementationGuide resource",
    )

    command = parser.add_subparsers(dest="command")

    command.add_parser(
        "create-resource-from-file", help=create_resource_from_file.__doc__
    )
    command.add_parser("create-patient", help=create_patient.__doc__)
    command.add_parser("create-encounter", help=create_encounter.__doc__)
    command.add_parser("create-observation", help=create_observation.__doc__)
    command.add_parser("delete-resource", help=delete_resource.__doc__)
    command.add_parser("get-resource", help=get_resource.__doc__)
    command.add_parser("list-resource-history", help=list_resource_history.__doc__)
    command.add_parser("execute-bundle", help=execute_bundle.__doc__)
    command.add_parser("get-resource-history", help=get_resource_history.__doc__)
    command.add_parser("delete-resource-purge", help=delete_resource_purge.__doc__)
    command.add_parser("update-resource", help=update_resource.__doc__)
    command.add_parser("patch-resource", help=patch_resource.__doc__)
    command.add_parser("search-resources-get", help=search_resources_get.__doc__)
    command.add_parser("search-resources-post", help=search_resources_get.__doc__)
    command.add_parser("get-patient-everything", help=get_patient_everything.__doc__)
    command.add_parser(
        "create-structure-definition", help=create_structure_definition.__doc__
    )
    command.add_parser(
        "create-implementation-guide", help=create_implementation_guide.__doc__
    )
    command.add_parser(
        "enable-implementation-guide", help=enable_implementation_guide.__doc__
    )
    command.add_parser("validate-resource", help=validate_resource.__doc__)
    command.add_parser(
        "validate-resource-profile-url", help=validate_resource_profile_url.__doc__
    )

    return parser.parse_args()