コード例 #1
0
ファイル: views.py プロジェクト: Phdmani/crate
def draft_withdrawal_letter(request: HttpRequest, contact_request_id: str,
                            viewtype: str) -> HttpResponse:
    """
    Developer view: draft letter to researcher, withdrawing permission.

    Args:
        request: the :class:`django.http.request.HttpRequest`
        contact_request_id: PK for
            :class:`crate_anon.crateweb.consent.models.ContactRequest`
        viewtype: ``"pdf"`` or ``"html"``
    """
    contact_request = get_contact_request(request, contact_request_id)
    html = contact_request.get_withdrawal_letter_html()
    return serve_html_or_pdf(html, viewtype)
コード例 #2
0
ファイル: views.py プロジェクト: Phdmani/crate
def decision_form_to_pt_re_study(request: HttpRequest, contact_request_id: str,
                                 viewtype: str) -> HttpResponse:
    """
    Developer view: decision form to patient about a study.

    Args:
        request: the :class:`django.http.request.HttpRequest`
        contact_request_id: PK for
            :class:`crate_anon.crateweb.consent.models.ContactRequest`
        viewtype: ``"pdf"`` or ``"html"``
    """
    contact_request = get_contact_request(request, contact_request_id)
    html = contact_request.get_decision_form_to_pt_re_study()
    return serve_html_or_pdf(html, viewtype)
コード例 #3
0
ファイル: views.py プロジェクト: Phdmani/crate
def draft_letter_clinician_to_pt_re_study(request: HttpRequest,
                                          contact_request_id: str,
                                          viewtype: str) -> HttpResponse:
    """
    Developer view: draft letter from clinician to patient, offering a study.

    Args:
        request: the :class:`django.http.request.HttpRequest`
        contact_request_id: PK for
            :class:`crate_anon.crateweb.consent.models.ContactRequest`
        viewtype: ``"pdf"`` or ``"html"``
    """
    contact_request = get_contact_request(request, contact_request_id)
    html = contact_request.get_letter_clinician_to_pt_re_study()
    return serve_html_or_pdf(html, viewtype)
コード例 #4
0
ファイル: views.py プロジェクト: Phdmani/crate
def draft_traffic_light_decision_form(request: HttpRequest,
                                      patient_lookup_id: str,
                                      viewtype: str) -> HttpResponse:
    """
    Developer view: draft traffic-light decision form.

    Args:
        request: the :class:`django.http.request.HttpRequest`
        patient_lookup_id: PK for
            :class:`crate_anon.crateweb.consent.models.PatientLookup`
        viewtype: ``"pdf"`` or ``"html"``
    """
    patient_lookup = get_patient_lookup(request, patient_lookup_id)
    html = patient_lookup.get_traffic_light_decision_form()
    return serve_html_or_pdf(html, viewtype)
コード例 #5
0
ファイル: views.py プロジェクト: Phdmani/crate
def draft_confirm_traffic_light_letter(request: HttpRequest,
                                       consent_mode_id: str,
                                       viewtype: str) -> HttpResponse:
    """
    Developer view: draft letter to patient confirming traffic-light decision.

    Args:
        request: the :class:`django.http.request.HttpRequest`
        consent_mode_id: PK for
            :class:`crate_anon.crateweb.consent.models.ConsentMode`
        viewtype: ``"pdf"`` or ``"html"``
    """
    consent_mode = get_consent_mode(request, consent_mode_id)
    html = consent_mode.get_confirm_traffic_to_patient_letter_html()
    return serve_html_or_pdf(html, viewtype)
コード例 #6
0
def decision_form_to_pt_re_study(request: HttpRequest, contact_request_id: str,
                                 viewtype: str) -> HttpResponse:
    contact_request = get_contact_request(request, contact_request_id)
    html = contact_request.get_decision_form_to_pt_re_study()
    return serve_html_or_pdf(html, viewtype)
コード例 #7
0
def draft_letter_clinician_to_pt_re_study(request: HttpRequest,
                                          contact_request_id: str,
                                          viewtype: str) -> HttpResponse:
    contact_request = get_contact_request(request, contact_request_id)
    html = contact_request.get_letter_clinician_to_pt_re_study()
    return serve_html_or_pdf(html, viewtype)
コード例 #8
0
def draft_traffic_light_decision_form(request: HttpRequest,
                                      patient_lookup_id: str,
                                      viewtype: str) -> HttpResponse:
    patient_lookup = get_patient_lookup(request, patient_lookup_id)
    html = patient_lookup.get_traffic_light_decision_form()
    return serve_html_or_pdf(html, viewtype)
コード例 #9
0
def draft_confirm_traffic_light_letter(request: HttpRequest,
                                       consent_mode_id: str,
                                       viewtype: str) -> HttpResponse:
    consent_mode = get_consent_mode(request, consent_mode_id)
    html = consent_mode.get_confirm_traffic_to_patient_letter_html()
    return serve_html_or_pdf(html, viewtype)
コード例 #10
0
def draft_first_traffic_light_letter(request: HttpRequest,
                                     patient_lookup_id: str,
                                     viewtype: str) -> HttpResponse:
    patient_lookup = get_patient_lookup(request, patient_lookup_id)
    html = patient_lookup.get_first_traffic_light_letter_html()
    return serve_html_or_pdf(html, viewtype)
コード例 #11
0
def draft_withdrawal_letter(request: HttpRequest, contact_request_id: str,
                            viewtype: str) -> HttpResponse:
    contact_request = get_contact_request(request, contact_request_id)
    html = contact_request.get_withdrawal_letter_html()
    return serve_html_or_pdf(html, viewtype)