mirror of
https://github.com/pcvolkmer/onkostar-plugin-dnpm.git
synced 2025-07-02 01:02:55 +00:00
fix: Füge beim Speichern kein neues, leeres DNPM UF Therapielinie hinzu
This commit is contained in:
23396
forms/dnpm-formulare.osc
23396
forms/dnpm-formulare.osc
File diff suppressed because it is too large
Load Diff
18
scripts/klinik_anamnese-on_save.js
Normal file
18
scripts/klinik_anamnese-on_save.js
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
let uf = Array.from(getFieldValue('DNPMTherapielinie'))
|
||||||
|
.filter(tl => tl.Beginn[0] || tl.Ende[0] || tl.Wirkstoffe || tl.WirkstoffCodes || tl.Ergebnis.val || tl.Beendigung.val || tl.Abbruchgrund)
|
||||||
|
.sort((tl1, tl2) => { return tl1.Beginn[0] > tl2.Beginn[0] })
|
||||||
|
.map((tl, idx) => {
|
||||||
|
tl.Nummer = idx+1;
|
||||||
|
return tl;
|
||||||
|
});
|
||||||
|
|
||||||
|
setFieldValue('DNPMTherapielinie', uf);
|
||||||
|
|
||||||
|
if (uf.length > 0){
|
||||||
|
setFieldValue('AnzahlTherapielinien', uf.length);
|
||||||
|
setFieldValue('Therapiebeginn', uf[uf.length-1].Beginn[0]);
|
||||||
|
setFieldValue('Therapieende', uf[uf.length-1].Ende[0]);
|
||||||
|
} else {
|
||||||
|
setFieldValue('Therapiebeginn', [null, 'exact']);
|
||||||
|
setFieldValue('Therapieende', [null, 'exact']);
|
||||||
|
}
|
Reference in New Issue
Block a user