This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const VentilationModes = ['VCV', 'PCV', 'AC-VCV', 'AC-PCV', 'CPAP']; | |
const ventilationMode = getVentilationMode(Data[29]); | |
function getVentilationMode(valueToParse: number): string { | |
// 0x1C is 00011100 so we find the values contain in bits 2-4 | |
// we also want the index to retrieve the correct mode from our array | |
// so we shift the bits to the end to get the actual value | |
const ventilationModeIndex = (valueToParse & 0x1C) >> 2; | |
return VentilationModes[ventilationModeIndex]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Alarms = [ | |
'Battery in Use', | |
'Circuit Integrity Failed', | |
'High Respiratory Rate', | |
'High FiO2', | |
'High PEEP', | |
'High Plateau Pressure', | |
'High Peak Pressure', | |
'Low Inspiratory Pressure', | |
'Low FiO2', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export default function dummyDataGenerator(updateReadingStateFunction) { | |
let intervalFunction; | |
function getRandomValue(range, valueToSubtract = 0) { | |
return Math.round(Math.random() * range - valueToSubtract); | |
} | |
function generateDummyReadings() { | |
return { | |
peep: getRandomValue(10), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function generateDummyReadings(){ | |
return { | |
peep: getRandomValue(10), | |
peakPressure: getRandomValue(100, 100), | |
patientRate: getRandomValue(220), | |
vte: getRandomValue(700), | |
inspiratoryTime: getRandomValue(3), | |
expiratoryTime: getRandomValue(5), | |
oxygen: getRandomValue(100), | |
flow: getRandomValue(30, 10) |