form.html 2.4 KB
Newer Older
Ryan Herbert's avatar
Ryan Herbert committed
1 2 3
<fieldset name="patient{{=i}}">
    <legend>Patient {{=i+1}}</legend>
    <input type="hidden" id="patient_id_{{=i}}" name="patient[{{=i}}][id]" value="{{if set is not None:}}{{=set['id']}}{{pass}}">
4
    <input type="hidden" sample_set_id="patient_sample_set_id_{{=i}}" name="patient[{{=i}}][sample_set_id]" value="{{if set is not None:}}{{=set['sample_set_id']}}{{pass}}">
5
    {{ if set is not None and 'error' in set and len(set['error']) > 0: }}
Ryan Herbert's avatar
Ryan Herbert committed
6 7
        <div class="error">error: {{=", ".join(set['error'])}}</div>
    {{ pass }}
Ryan Herbert's avatar
Ryan Herbert committed
8 9 10
    {{ if set is not None and 'message' in set and len(set['message']) > 0: }}
        <div>{{=", ".join(set['message'])}}</div>
    {{ pass }}
Ryan Herbert's avatar
Ryan Herbert committed
11
    <div class="field_div">
Ryan Herbert's avatar
Ryan Herbert committed
12
        <input class="date form-control" id="patient_id_label_{{=i}}" name="patient[{{=i}}][id_label]" type="text"
13
            value="{{if set is not None and set['id_label'] is not None:}}{{=set['id_label']}}{{pass}}" placeholder="Patient ID">
Ryan Herbert's avatar
Ryan Herbert committed
14
    </div>
Ryan Herbert's avatar
Ryan Herbert committed
15
    <div class="field_div">
Ryan Herbert's avatar
Ryan Herbert committed
16
        <input class="string form-control" id="patient_first_name_{{=i}}" name="patient[{{=i}}][first_name]" type="text"
17
            value="{{if set is not None:}}{{=set['first_name']}}{{pass}}" required placeholder="First Name">
Ryan Herbert's avatar
Ryan Herbert committed
18
    </div>
Ryan Herbert's avatar
Ryan Herbert committed
19
    <div class="field_div">
Ryan Herbert's avatar
Ryan Herbert committed
20
        <input class="string form-control" id="patient_last_name_{{=i}}" name="patient[{{=i}}][last_name]" type="text"
21
            value="{{if set is not None:}}{{=set['last_name']}}{{pass}}" required placeholder="Last Name">
Ryan Herbert's avatar
Ryan Herbert committed
22
    </div>
Ryan Herbert's avatar
Ryan Herbert committed
23
    <div class="field_div">
Ryan Herbert's avatar
Ryan Herbert committed
24
        <input class="date form-control" id="patient_birth_{{=i}}" name="patient[{{=i}}][birth]" type="text"
Ryan Herbert's avatar
Ryan Herbert committed
25
            value="{{if set is not None and set['birth'] is not None:}}{{=set['birth']}}{{pass}}"
26
            title="yyyy-mm-dd" pattern="(?:19|20)[0-9]{2}-(?:(?:0[1-9]|1[0-2])-(?:0[1-9]|1[0-9]|2[0-9])|(?:(?!02)(?:0[1-9]|1[0-2])-(?:30))|(?:(?:0[13578]|1[02])-31))" placeholder="Birth (yyyy-mm-dd)">
Ryan Herbert's avatar
Ryan Herbert committed
27
    </div>
Ryan Herbert's avatar
Ryan Herbert committed
28
    <div class="field_div">
Ryan Herbert's avatar
Ryan Herbert committed
29 30 31 32
        <textarea
            onfocus="$(this).data('keys', [$('#group_select option:selected').val()]);
                     new VidjilAutoComplete().setupTags(this);"
            data-needs-atwho="true"
Ryan Herbert's avatar
Ryan Herbert committed
33
            class="text form-control"
Ryan Herbert's avatar
Ryan Herbert committed
34 35
            id="patient_info_{{=i}}"
            name="patient[{{=i}}][info]"
36 37
            rows="1"
            placeholder="Info">{{if set is not None and set['info'] is not None:}}{{=set['info']}}{{pass}}</textarea>
Ryan Herbert's avatar
Ryan Herbert committed
38 39
    </div>
</fieldset>