Get in touch

Get in touch

Prefer using email? Say hi at hello@moveshelf.com

This section explains how to retrieve session metadata for a specified session for a subject with a specified MRN on Moveshelf using the Moveshelf API.
Prerequisites
Before implementing this example, ensure that your processing script includes all necessary setup steps. In particular, you should have:
Implementation
To retrieve session metadata from a specific session and subject, add the following lines of code to your processing script:
## README: this example shows how we can retrieve session metadata from Moveshelf 
# using the Moveshelf API.
# This code assumes you have implemented the 'Retrieve sessopm' example, and
# that you have found session (my_session) for the subject with a given EHR-id/MRN 
# (my_subject_mrn) or name (my_subject_name) within a given project (my_project), and 
# that you have access to the session ID.

## General configuration. Set values before running the script
my_project = "<organizationName/projectName>"  # e.g. support/demoProject
my_subject_mrn = "<subjectMRN>"  # subject MRN, e.g. "1234567" or None
my_subject_name = "<subjectName>"  # subject name, e.g. Subject1 or None
my_session = "<sessionDate>" # "YYYY-MM-DD" format

## Add here the code to retrieve the project and find an existing subject and session using "getSessionById"

session_id = session["id"]
session_metadata = session.get("metadata", None)
print(
    f"Found session with projectPath: {session['projectPath']},\n"
    f"id: {session_id},\n"
    f"and metadata: {session_metadata}"
)