Giter Club home page Giter Club logo

Comments (2)

alexwangtech avatar alexwangtech commented on June 3, 2024

The clinical/medications vs ehr/medications on line 291 isn't the only hardcoded stuff right? I saw a low_rate being used on line 300, in the line ce = self.f['low_rate'][:]. I might be still a bit confused/unfamiliar with the application, but why does a medication have to be specified? Is there a structural thing with the HDF5 file type that makes it difficult to recoqnize all renderable series?

from auviewer.

guswelter avatar guswelter commented on June 3, 2024

That's true, 'low_rate' is hard-coded as well.

Is there a structural thing with the HDF5 file type that makes it difficult to recoqnize all renderable series?

Well, all series are "renderable," but the question is how to render them. Let's take the simplest single-column numeric time series:

Time Value
0    21
1    14
2    23
3    17

That could be displayed as a numeric time series (the default dot-plot with time on x-axis and numeric value on y-axis on the viewer currently). But it could also be displayed as an event series, where the value is the label. So, the first event occurs at time 0 and its event label is "21".

That's why I suggest to start by making it so that users can specify which series to render as an event series in the template file. Speaking of which, here is sample template file. Put this in the global_templates folder in the viewer data folder, and it will change how the sample file displays -- and you can start from there to add the ability to specify event series in the template: project_template.zip

However, I think we can and should, by default, display factor and string column types as event series. As a starting point, you can see here where we're currently skipping column types we don't recognize (and when you open the sample file in the viewer you should see lots of "Skipping unsupported factor series" in the console). So instead of skipping those, you can add in the logic to handle them as event series.

Other than that, as I mentioned in the original post, I suspect the js code is already fully "generalized". It's just in the backend that we need to add/generalize the logic of when to send transmit series as event series to the frontend. And this is the only reason it's hard-coded in the backend to pull the medications and low_rate series and send them as event data as a temporary measure.

Oh, one other thing... The simple example I gave above of the single-column dataset is one case. But if you look at the raw data for the medications series, it's a multi-column dataset, something like:

Time   Medication   Dosage   Units
0      Insulin      30 mL    mL
300    Saline       1 L      L

So, what I have actually hard-coded with the medications (even though the code is simple, this is what it's actually doing) is to throw all of these columns as a single event series. In other words, in the sample set, there are two events -- e.g. the first is Insulin at 30 mL with units L at time 0... that's all one event.

By default, the viewer treats each column as an individual time series. You might ask why... well for numeric series, the columns will be individual time series and they're put in a common table like that because the series are sampled uniformly and it's most efficient on disk to encode like that (not repeat time values).

With events, however (including factors, numerics, etc.), the user needs to be able to specify in the template that a single column, multiple columns, or perhaps all columns are a single series.

We're down the rabbit hole now. Have fun with all that :)

from auviewer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.