Beispiel #1
0
def explain(api: infermedica_api.API):
    # Prepare diagnosis request it need to have sufficient amount of evidences
    # The most appropriate way to get a request way for explain method is to
    # use the one which has been created while interacting with diagnosis.
    # For the example purpose a new one is created.
    request = infermedica_api.Diagnosis(sex='female', age=35)

    request.add_symptom('s_10', 'present')
    request.add_symptom('s_608', 'present')
    request.add_symptom('s_1394', 'absent')
    request.add_symptom('s_216', 'present')
    request.add_symptom('s_9', 'present')
    request.add_symptom('s_188', 'present')

    # call the explain method
    request = api.explain(request, target_id='c_62')

    # and see the results

    Log.pretty(request)
Beispiel #2
0
def diagnosis(api: infermedica_api.API):
    request = infermedica_api.Diagnosis(sex='female', age=35)
    request.add_symptom('s_21', 'present', initial=True)
    request.add_symptom('s_98', 'present', initial=True)
    request.add_symptom('s_107', 'absent')

    # call diagnosis
    request = api.diagnosis(request)

    Log.pretty(request)

    # ask patient the questions returned by diagnosis and update request with patient answers
    request.add_symptom('s_99', 'present')
    request.add_symptom('s_8', 'absent')
    request.add_symptom('s_25', 'present')
    # ... and so on until you decided that enough question have been asked
    # or you have sufficient results in request.conditions

    # call diagnosis again with updated request
    request = api.diagnosis(request)

    # repeat the process
    Log.pretty(request)
Beispiel #3
0
def conditions(api: infermedica_api.API):
    Log.info('Conditions list:')
    Log.pretty(api.conditions_list())

    Log.info('Conditions details:')
    Log.pretty(api.condition_details('c_221'))

    Log.warn('Conditions details (Fail Test)')
    Log.pretty(api.condition_details('fail'))