Getting started with Flask using client-py.
Getting started
You can run this notebook
- in colab or
- Feel free to ignore the "Start the app", "Convert this notebook" and "Run the app locally" sections
- on your own machine
- Please see index.ipynb and set things up to run on your own machine.
smart = client.FHIRClient(settings=smart_defaults)
for p in _get_patients(smart): assert p.id is not None # TODO: write a better test
if not IN_COLAB:
from nbdev.export import notebook2script
notebook2script('51_flask_client_py_readme.ipynb')
Run the app in colab
The following cell will only run if you're in colab, where you'll see output like
* Serving Flask app "__main__" (lazy loading)
...
INFO:werkzeug: * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): bin.equinox.io:443
...
DEBUG:urllib3.connectionpool:http://localhost:4040 "GET /api/tunnels HTTP/1.1" 200 779
* Running on http://35c09c8e5eb5.ngrok.io
* Traffic stats available on http://127.0.0.1:4040
Hit the ngrok.io
link to see the app - none of the localhost or 127.0.0.1 links will work
if IN_COLAB:
logging.basicConfig(level=logging.DEBUG)
from flask_ngrok import run_with_ngrok
run_with_ngrok(app)
app.run()