smaller code by TS as demoEHR