Пример #1
0
def doctor_photo_path(instance, filename):
    doctor = instance
    new_filename = generate_filename(filename,
                                     prefix='{0}_profile_pic'.format(
                                         doctor.pk))

    return '/'.join(['users', str(doctor.pk), 'profile_picture', new_filename])
Пример #2
0
def patient_consent_signature_path(instance, filename):
    consent = instance
    patient = instance.patient
    new_filename = generate_filename(filename,
                                     prefix='{0}_signature'.format(consent.pk))

    return '/'.join(['patients', str(patient.pk), 'consent', new_filename])
Пример #3
0
def patient_photo_path(instance, filename):
    new_filename = generate_filename(filename,
                                     prefix='{0}_profile_pic'.format(
                                         instance.pk))

    return '/'.join(
        ['patients',
         str(instance.pk), 'profile_picture', new_filename])
Пример #4
0
def mole_image_photo_path(instance, filename):
    mole_image = instance
    mole = mole_image.mole
    patient = mole.patient

    new_filename = generate_filename(filename,
                                     prefix='{0}_photo'.format(mole.pk))

    return '/'.join([
        'patients',
        str(patient.pk),
        'skin_images',
        str(mole.pk),
        new_filename,
    ])
Пример #5
0
def distant_photo_path(instance, filename):
    anatomical_site = instance.anatomical_site
    patient = instance.patient

    new_filename = generate_filename(filename,
                                     prefix='{0}_{1}_regional_photo'.format(
                                         instance.pk, anatomical_site.pk))

    return '/'.join([
        'patients',
        str(patient.pk),
        'anatomical_sites',
        str(instance.pk),
        'regional_photo',
        new_filename,
    ])
Пример #6
0
def study_consent_docs_path(instance, filename):
    instance.original_filename = filename

    new_filename = generate_filename(filename, prefix='doc')

    return '/'.join(['study_consent_docs', new_filename])