befund.html
⎇
Raw
1{{define "title"}}{{.B.Title}} – {{.P.Name}}{{end}}
2{{define "content"}}
3{{$d := .D}}
4<nav aria-label="breadcrumb"><ul>
5 <li><a href="/patienten">Patienten</a></li>
6 <li><a href="/patient/{{.P.ID}}">{{.P.Name}}</a></li>
7 <li>{{.B.Title}} {{de .B.Date}}</li>
8</ul></nav>
9{{if .Saved}}<p class="ok" role="status">Gespeichert.</p>{{end}}
10
11<form method="post" action="/befund/{{.B.ID}}" id="befund-form" class="befund">
12 <div class="befund-head">
13 <div><strong>{{.P.Name}}</strong>{{with .P.Dob}} · geb. {{.}}{{end}}</div>
14 <label>Titel <input name="title" value="{{.B.Title}}" list="dl-titles"></label>
15 <label>Datum <input type="date" name="date" value="{{.B.Date}}"></label>
16 </div>
17 <datalist id="dl-titles"><option value="Erstbefund"><option value="Wiederbefund"><option value="Zwischenbefund"><option value="Abschlussbefund"></datalist>
18 <datalist id="dl-tests">{{range .Tests}}<option value="{{.Title}}">{{end}}</datalist>
19 <datalist id="dl-measures">{{range .Measures}}<option value="{{.}}">{{end}}</datalist>
20
21 <nav class="toc" aria-label="Abschnitte – springen zu">
22 {{range .Sections}}<a href="#s-{{.ID}}"{{if $d.HasSection .}} class="filled"{{end}}>{{.Title}}</a>{{end}}
23 </nav>
24
25 {{range $s := .Sections}}
26 {{if $s.Specialty}}<details class="sec specialty" id="s-{{$s.ID}}"{{if $d.HasSection $s}} open{{end}}><summary>Fachbereich: {{$s.Title}}</summary>
27 {{else}}<section class="sec" id="s-{{$s.ID}}"><h2>{{$s.Title}}</h2>{{end}}
28
29 {{range $p := $s.Parts}}
30 {{if $p.Collapsible}}<details class="part"{{if $d.HasPart $p}} open{{end}}><summary>{{$p.Title}}</summary>
31 {{else}}<div class="part">{{with $p.Title}}<h4>{{.}}</h4>{{end}}{{end}}
32
33 {{if $p.Body}}
34 <div class="body-tools js-only">
35 {{range $i, $y := $.Symbols}}<button type="button" class="sym{{if eq $i 0}} active{{end}}" data-sym="{{$y.Key}}" title="{{$y.Name}}">{{$y.Char}}</button>{{end}}
36 <input type="color" id="stamp-color" value="#d32f2f" aria-label="Farbe">
37 <select id="stamp-size" aria-label="Größe"><option value="1">klein</option><option value="2" selected>mittel</option><option value="3">groß</option></select>
38 <button type="button" id="stamp-undo" class="secondary outline">↶ Rückgängig</button>
39 </div>
40 <div class="bodies">
41 {{range $vi, $v := $.Views}}
42 <figure class="body">
43 <div class="body-canvas">
44 <img src="{{$v.Image}}" alt="Körperschema {{$v.Name}}">
45 <svg viewBox="0 0 {{$v.W}} {{$v.H}}" data-view="{{$vi}}" data-w="{{$v.W}}" data-h="{{$v.H}}" role="img" aria-label="Markierungen {{$v.Name}}">{{range $d.StampsFor $vi}}<text x="{{fmtNum .X}}" y="{{fmtNum .Y}}" font-size="{{fmtNum .Size}}" fill="{{.Color}}" text-anchor="middle" dominant-baseline="central">{{.Char}}</text>{{end}}</svg>
46 </div>
47 <figcaption>{{$v.Name}}</figcaption>
48 </figure>
49 {{end}}
50 </div>
51 <input type="hidden" name="stamps" id="stamps" value="{{$d.StampsJSON}}">
52 <p class="legend">{{range $.Symbols}}<span>{{.Char}} {{.Name}}</span>{{end}}</p>
53 {{end}}
54
55 {{if $p.Fields}}
56 <div class="fgrid">
57 {{range $f := $p.Fields}}
58 <div class="fld{{if $f.Wide}} wide{{end}}{{if eq $f.Type "check"}} chk{{end}}{{if eq $f.Type "nrs"}} small{{end}}">
59 {{if eq $f.Type "check"}}
60 <label><input type="checkbox" name="f.{{$f.Key}}" value="1"{{if $d.Get $f.Key}} checked{{end}}> {{$f.Label}}</label>
61 {{else}}
62 {{with $f.Label}}<label for="f-{{$f.Key}}">{{.}}</label>{{end}}
63 {{if eq $f.Type "area"}}<textarea id="f-{{$f.Key}}" name="f.{{$f.Key}}" rows="{{if $f.Rows}}{{$f.Rows}}{{else}}2{{end}}" placeholder="{{$f.Placeholder}}" aria-label="{{if $f.Label}}{{$f.Label}}{{else}}{{$s.Title}}{{end}}">{{$d.Get $f.Key}}</textarea>
64 {{else if eq $f.Type "select"}}<select id="f-{{$f.Key}}" name="f.{{$f.Key}}">{{range $f.Options}}<option{{if eq . ($d.Get $f.Key)}} selected{{end}}>{{.}}</option>{{end}}</select>
65 {{else if eq $f.Type "nrs"}}<input id="f-{{$f.Key}}" name="f.{{$f.Key}}" type="number" min="0" max="10" step="1" inputmode="numeric" value="{{$d.Get $f.Key}}">
66 {{else}}<input id="f-{{$f.Key}}" name="f.{{$f.Key}}" value="{{$d.Get $f.Key}}" placeholder="{{$f.Placeholder}}">{{end}}
67 {{end}}
68 </div>
69 {{end}}
70 </div>
71 {{end}}
72
73 {{with $p.Table}}{{$t := .}}{{$rows := $d.TableRows $t 2}}
74 <div class="tablewrap">
75 <table class="etable" data-table="{{$t.Key}}">
76 <thead><tr>{{range $t.Cols}}<th>{{.Label}}</th>{{end}}</tr></thead>
77 <tbody>
78 {{range $i, $row := $rows}}<tr>{{range $c := $t.Cols}}<td>
79 {{if eq $c.Type "select"}}<select name="{{cell $t.Key $c.Key $i}}" aria-label="{{$c.Label}}">{{range $c.Options}}<option{{if eq . (index $row $c.Key)}} selected{{end}}>{{.}}</option>{{end}}</select>
80 {{else if eq $c.Type "number"}}<input name="{{cell $t.Key $c.Key $i}}" value="{{index $row $c.Key}}" type="number" step="any" inputmode="decimal" aria-label="{{$c.Label}}">
81 {{else if eq $c.Type "date"}}<input name="{{cell $t.Key $c.Key $i}}" value="{{index $row $c.Key}}" type="date" aria-label="{{$c.Label}}">
82 {{else}}<input name="{{cell $t.Key $c.Key $i}}" value="{{index $row $c.Key}}" placeholder="{{$c.Placeholder}}" aria-label="{{$c.Label}}"{{if $c.List}} list="{{$c.List}}"{{end}}>{{end}}
83 </td>{{end}}</tr>{{end}}
84 </tbody>
85 </table>
86 </div>
87 <input type="hidden" name="t.{{$t.Key}}.n" value="{{len $rows}}">
88 <button type="button" class="addrow js-only secondary outline small" data-table="{{$t.Key}}">+ Zeile</button>
89 <small class="muted nojs-only">Für weitere Zeilen speichern.</small>
90 {{end}}
91
92 {{if $p.Collapsible}}</details>{{else}}</div>{{end}}
93 {{end}}
94
95 {{if $s.Specialty}}</details>{{else}}</section>{{end}}
96 {{end}}
97
98 <div class="savebar">
99 <button type="submit">Speichern</button>
100 <button type="submit" name="next" value="druck" class="secondary">Speichern &amp; Druck<span class="hide-sm">ansicht</span></button>
101 <a href="/patient/{{.P.ID}}" class="hide-sm">Zurück zum Patienten</a>
102 <small class="muted js-only hide-sm">Strg+S speichert</small>
103 </div>
104</form>
105
106<div class="actions spaced">
107 <a role="button" class="secondary outline" href="/befund/{{.B.ID}}/export">JSON exportieren</a>
108 <details class="danger">
109 <summary>Befund löschen …</summary>
110 <form method="post" action="/befund/{{.B.ID}}/loeschen"><button type="submit" class="danger">Endgültig löschen</button></form>
111 </details>
112</div>
113{{end}}
114