simonkelly1973 / mdpnp

MD PnP OpenICE
https://www.openice.info
1 stars 0 forks source link

Introduce Pulse Oximetry App #5

Open simonkelly1973 opened 6 years ago

simonkelly1973 commented 6 years ago

Per the upcoming conference demo, the pulse oximetry app needs to be integrated into the normal code base.

simonkelly1973 commented 6 years ago

The initial version of the oximetry app and associated changes to devices etc. changes quite a lot. The details are here

ice.idl - new parameters to indicate oximetry device capabilities - can the software or the operator get and set the averaging rate. Also, an OximetryAveragingObjective for devices that can support setting the averaging rate through software.

AbstractWaveAndParamsPanel - in order to allow child classes to customise the label behaviour, the "params" Label array is made protected, not private. The purpose of this is that the oximetry panel needs to have customised labels that say things like "Yes" or "No", rather than numeric values that are displayed by binding the labels to numeric properties. Or more specifically, we want to treat numeric values like 1=Yes and 0=No, which is not possible without unbinding them. To allow that, we introduce the customiseLabels method.

PulseOximeterPanel - introduce new parameters for operator and software getting and setting the rate. Then, the customiseLabels implementation overrides the parent and unbinds the labels for those new parameters (if they are set), and "translates" the 1 and 0 values to display Yes or No instead 1 and 0.

AbstractFxList - slightly improved error handling situation for the specific case of RETCODE_ERROR.

DeviceFactory - This introduces a number of new simulated Oximeter devices to demonstrate the different capabilities. There are devices with four and eight second average rates, that do and do not publish the average rate in OpenICE, and devices that can and cannot support the average rate being set by OpenICE and by the operator.

IceAppContainerContext.xml - introduces a new bean type that handles publishing a DDS objective to set the averaging time.

/META-INF/services/org.mdpnp.apps.testapp.IceApplicationProvider - Introduces a new factory, org.mdpnp.apps.testapp.oximetry.OximetryTestApplicationFactory, that in turn produces the oximetry test application.

SimPulseOximeter - change the name to "Legacy Pulse Ox (Simulated)" to indicate that this is a device without any get/set capabilities for averaging rate.

/META-INF/services/org.mdpnp.devices.DeviceDriverProvider - add in five new simulated devices from the DeviceFactory class for the different oximeters.

EightSecFixedAvgSimPulseOximeter.java FourSecFixedAvgSimPulseOximeter.java FourSecNoSoftAvgSimPulseOximeter.java InitialEightSecIceSettableAvgSimPulseOximeter.java InitialEightSecOperSettableAvgSimPulseOximeter.java - These are all new simulated oximeters.

OximetryAveragingObjectiveDataWriterFactory.java - creates instances of the objective writer for setting the average rate in software.

simonkelly1973 commented 6 years ago

More changes that should have been in that last commit!

OximetryTestApplicationFactory - produces instances of OximetryTestApplication OximetryTestApplication - This consists of a GUI laid out in FXML. There is a large graph area, and inputs on the right hand side to select the data to be used on the graph (and the speed of playback), as well as a simple alarm parameter that sets the threshold below which the background is turned red.

OximetryTestApplication.fxml - the layout file for the oximetry test app. oximetry.png - the icon for the app, displayed on the ICE Applications" panel on the left hand side of the main window.

simonkelly1973 commented 6 years ago

Allow devices to add custom contents to the display panel.

AbstractWaveAndParamsPanel had a new method addToHeader. That's should be overriden by any panel that wants to actually do customisation. It wasn't made abstract as that would have required a retrofit to all extending classes. The only panel that implements that now is PulseOximiter.

CompositeDevicePanel has a new header, implemented with a FlowPane. The panel that was previously there is added to that instead, and via the getTopFlowPane method, other classes can access that flow pane to add their own contents.

PulseOximiterPanel does customise the headers, by setting up a list of numerics that should be added, checking if published numeric values are of one of those types, and if so adding them to a label panel with the panel being added to the flow pane.

DeviceView exposes the top flow pane via getTopFlowPane

OximetryTestApplication validates all input before starting to run. It also listens for changes to the current patient, and clears the graphs etc. if that is changed. Much larger value for tickUnitProperty on the graph, that greatly improves performance.

OximetryTestApplicationFactory passes in MDSHandler to allow listening for patient changes

OximetryTestApplication.fxml - Add a few fields used in the app such as run speed

all done in 507dd65