コード例 #1
0
ファイル: offline.py プロジェクト: rajeevs1992/pyhealthvault
def main():
    conn = Connection(HV_APPID, HV_SERVICE_SERVER)
    conn.thumbprint = APP_THUMBPRINT
    conn.publickey = APP_PUBLIC_KEY
    conn.privatekey = APP_PRIVATE_KEY
    conn.connect()
    conn.set_person_and_record('214ade00-dbc1-448a-b409-0762ec814a34', '53ac76dd-c7e7-4d48-ac48-3c22c529704f')
    method = GetVocabulary()
    thing = VocabularyKey()
    thing.name = 'thing-types'
    thing.family = 'wc'
    thing.version = '1'

    param = VocabularyParameters([thing])
    #method.request.vocabulary_parameters = param
    method.execute(conn)

    for i in method.response.vocabulary_code_set:
        print i.name
        print i.family
        print i.version

        for j in i.code_item:
            print j.code_value
            print j.display_text

    for i in method.response.vocabulary_key:
        print i.name
        print i.family
        print i.version
        print i.description
コード例 #2
0
ファイル: testbase.py プロジェクト: rajeevs1992/pyhealthvault
 def get_connection(self):
     conn = Connection(settings.HV_APPID, settings.HV_SERVICE_SERVER)
     conn.thumbprint = settings.APP_THUMBPRINT
     conn.publickey = settings.APP_PUBLIC_KEY
     conn.privatekey = settings.APP_PRIVATE_KEY
     conn.connect()
     conn.set_person_and_record(settings.OFFLINE_PERSON_ID, settings.OFFLINE_RECORD_ID)
     return conn
コード例 #3
0
ファイル: views.py プロジェクト: rajeevs1992/pyhealthvault
def set_authenticated_connection(request, wctoken):
    if 'connection' in request.session:
        del request.session['connection']
    conn = Connection(HV_APPID, HV_SERVICE_SERVER)
    conn.thumbprint = APP_THUMBPRINT
    conn.publickey = APP_PUBLIC_KEY
    conn.privatekey = APP_PRIVATE_KEY
    conn.user_auth_token = wctoken
    conn.connect()
    conn.set_person_and_record_from_personinfo()
    request.session['connection'] = conn