Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to request file batch MTI requests? #5

Open
C-molloy opened this issue Oct 5, 2022 · 2 comments
Open

How to request file batch MTI requests? #5

C-molloy opened this issue Oct 5, 2022 · 2 comments

Comments

@C-molloy
Copy link

C-molloy commented Oct 5, 2022

For the generic_batch_file.py, I wanted to ask what are the arguments to pass the file through the MTI batch request i.e.
https://ii.nlm.nih.gov/Batch/UTS_Required/MTI.html

If there is documentation on this where can I find this?

@MasonRoberts
Copy link

Hi - I think the mti_interactive.py shows how to make a request to the MTI module. You can edit it to meet your needs. I put an example below. You will need to edit the "inputtext" variable to be what you want to send. I imagine you can make this a loop. This might not be perfect as I am experimenting with this myself.

""" MTI interactive """
import argparse
import os
from skr_web_api import Submission, SEMREP_INTERACTIVE_URL

if name == 'main':

parser = argparse.ArgumentParser(description="test cas auth")
parser.add_argument('-s', '--serviceurl',
default=SEMREP_INTERACTIVE_URL,
help='url of service')

parser.add_argument('-e', '--email', help='Email address')

parser.add_argument('-a', '--apikey', help='UTS api key')

args = parser.parse_args()
if args.email is None and 'EMAIL' in os.environ:
args.email = os.environ['EMAIL']
if args.apikey is None and 'UTS_API_KEY' in os.environ:
args.apikey = os.environ['UTS_API_KEY']

inputtext = "A spinal tap was performed and oligoclonal bands
were detected in the cerebrospinal fluid.\n"

inst = Submission(, ,)
if args.serviceurl:
inst.set_serviceurl(args.serviceurl)
inst.init_mti_interactive(inputtext, args='-opt1L_DCMS')
response = inst.submit()
print('response status: {}'.format(response.status_code))
print('content: {}'.format(response.content.decode()))

@MasonRoberts
Copy link

Woops - those commented out sections are being read as headers in markup. I commented them out so it would be easy to see how I was editing the .py example the author provided.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants