Bella Project Technical Documentation September 26, 2014, v04 Charts Static variables (parameters) Static variables are the parameters set at the start of the therapy session which do not change throughout the session. How to use static variables (parameters) If you want to access a parameter only once then you can get in by going Binding<T>.GetBinding(stringName).value where T is the type of the variable shown in parantheses in the summary of each parameter and stringName is one of the strings below. If you would like an up to date reference to a value then you should create a property like below Property<T> property = new Property<T>(value); again substituing the T for for type, and value a default value, since the value will change when you bind the property, the value doesn't matter much, so just give it anything. After creating the property, you need to bind it so that it will get the value of the parameter to do this follow the example below property.AddToBinding(stringName,BindingDirection.BindingToProperty,AssignmentOnAdd.TakeBindingValue); Substitute stringName for one of the parameters strings below and leave the rest as is, Note that this will make the propert take the binding it is attaching itself to's value, and the property will only ever take new values from the binding. We want the property to take the parameter's value and never be able to change it. If we used BindingDirection.BiDirectional, everytime our created property value changed then it would change the binding's value as well, and it's best to leave all the parameter values alone. S1 Variable name ExhalePressureMin Value 10 cm H2O S2 ExhalePressureMax 20 cm H2O S3 ExhalePressureThresholdMin 2 cm H2O ExhalePressureThresholdMin2 2 cm H2O Description Lower value of the pressure range within which the patient must hold an exhalation breath for 3-4 seconds. If the pressure drops below this value for longer than the TimeSensitivity then the breath is not good and must be repeated. Upper value of the pressure range within which the patient must hold an exhalation breath for 3-4 seconds. If the pressure rises above this value for longer than the TimeSensitivity then the breath is not good and must be repeated. Pressure threshold above which the first breath is considered to have started. Pressure fluctuations below this level are ignored as noise and only when the pressure passes this level is a breath considered to have started. When displaying a graph of the pressure, this is the minimum display value. Same as ExhalePressureThresholdMin but used for second and subsequent breaths of a set. There is some thinking that if the mask is kept tight on the face and no pressure S4 ExhalePressureThresholdMax 30 cm H2O S5 ExhaleTimeThreshold 1 sec S6 ExhaleTimeMin 1 sec S7 ExhaleTimeMax 4 sec InhalePressureThreshold 2 cm H2O S8 InhaleTimeThreshold 0.5 sec S9 InhaleTimeMin 2 sec S10 InhaleTimeMax 5 sec S11 RestTimeMin 60 sec S12 RestTimeMax 120 sec S13 BreathsMin 12 BreathsTarget 15 is lost subsequent breaths start at a non-zero pressure level. So this parameter allows the exhale pressure threshold to be set higher for later breaths if necessary. Pressure threshold above which the pressure stops being measured. This is a limit level above which the pressure stops being measured and instead the maximum value is shown. When displaying a graph of the pressure, this is the maximum display value. The minimum time over which pressure above ExhalePressureThresholdMin must be held to be considered the exhale part of a breath. If the pressure drops below ExhalePressureThresholdMin in less time it is considered noise and no counters are changed. The minimum time which an exhalation must be held to be a valid breath. If the exhale pressure drops below the ExhalePressureMin pressure or above the ExhalePressureMax pressure before this time then it is not a valid breath and must be repeated. The recommended maximum time which an exhalation breath should be held. However, a breath is still considered good if it is held longer than this recommend time threshold. Pressure below this level for longer than the TimeSensitivity is the definition of the end of an exhale and the start of an inhale. The minimum time over which pressure below ExhalePressureThresholdMin must be held to be considered the inhale part of a breath. If the pressure rises above ExhalePressureThresholdMin in less time it is considered part of the prior exhale. The recommended minimum time of an inhalation. There is no impact on the success of a breath for inhalation periods shorter than this level. The maximum time duration that is considered an inhalation. If the pressure remains below ExhalePressureThresholdMin for longer than this duration then the status changes from Inhale to Rest. There is no impact on the success of a breath for inhalation periods longer than this level. The minimum rest time between completed sets before the next set can be started. A breath made before this time counts as a breath for the prior set. A breath made after this time counts as a breath in the new set. The recommended maximum rest time between completed sets before the next set can be started. There is no consequence for taking longer than this time to start the next set, but the game could prompt the user more emphatically at this time period to start their next set. The minimum number of breaths in a set. A set is not considered complete until this number of breaths is completed. The target number of breaths in a set. There are no consequences for completing more breaths in a set than this value. BreathsMax 20 S14 SetsMin 6 S15 SetsTarget SetsMax TimeSensitivity 6 6 0.1 sec S16 LastSessionDateTime date/time S17 S18 LastSessionSuccessLevel SessionCount % int S19 SessionSuccessLevelAvg % The maximum number of breaths in a set. If the user has completed this number of breaths the set is considered complete no matter how many of the breaths were good. The minimum number of sets in a session. A session is considered complete when this number of valid sets is completed. The game should indicate completion of the therapy session when this number of valid sets is complete. Same as SetsMin. Parameter added for future considerations. Same as SetsMin. Parameter added for future considerations. The time sensitivity below which no attention is paid to swings in the exhalation pressure. That is, pressure spikes up or down shorter than this duration are ignored. The date and time of completion of the last therapy session with a success level of at least 50% The success level in percent of the last session. A counter of sessions completed (since last reset) where the success level was at least 50%. The average success level of all sessions completed (since last reset). Dynamic variables Dynamic variables are the data that is dynamically changing throughout the therapy session. How to use dynamic variables If you want to be notified whenever a parameter value changes, then first create a property as described above, and then add this line property.AddListener(method); Just substitute method with the void method that has a single parameter of the same type as the property, Below is a fully working example, showing all of the ways explained above Property<float> property; float maxPressureValue; void Awake() { maxPressureValue = Binding<float>.GetBinding(ParameterBindingNames.ExhalePressureMax).value; property = new Property<float>(0); property.AddToBinding(BreathStrength,BindingDirection.BindingToProperty,AssignmentOnAdd.TakeBindingValue); property.AddListener(OnNewValue); } void OnNewValue(float value) { //do something with value } D1 Variable name BreathStrength Type float D2 Status enum D3 D4 D5 D6 D7 D8 D9 BreathCount BreathCountGood BreathIsGood SetCount SetCountGood SetIsGood SessionIsGood int int boolean int int boolean boolean Description The current pressure value in cm H2O. The value is between 0 and ExhalePressureThresholdMax. This public variable contains the current status. The enumerated values are: 1-inhale: the inhalation phase of a breath 2-exhale: the exhalation phase of a breath 3-rest: the rest period between sets 4-finished: the session is complete 5-pause: the session is paused (the user can pause at any time) (Note that we still have to figure out if the Pause command can be communicated from the game to the service app so this last status is provisional) Count of breaths in this set. Counter is reset at the beginning of a set. Count of good breaths in this set. Counter is reset at the beginning of a set. Set to True as soon as an exhale is good. Reset to False at the start of an exhale. Count of sets in this session. Counter is reset at the beginning of a session. Count of good sets in this session. Counter is reset at the beginning of a session. Set to True as soon as a set is good. Reset to False at the start of a set. Set to True as soon as a session is good. Reset to False at the start of a session. Events E1 Event name Exhale start E2 E3 E4 Exhale end Good exhale Breath end Trigger D1 from < S3 to > S3 Description The exhale phase of a breath has started. Note that it is possible to have several false starts on the start of an exhale phase since the exhale starts when the ExhalePressureThresholdMin pressure threshold is crossed, but could fail to stay above that threshold for the ExhaleTimeThreshold time period required to complete the exhale phase of a breath. To be completed To be completed To be completed … check the BreathIsGood value to see if breath was good or not. E5 Set end E6 Session end E7 Status change To be completed … check the SetIsGood value to see if breath was good or not. To be completed … check the SessionIsGood value to see if breath was good or not. To be completed Definitions Name Exhale Good Exhale Inhale Breath Good Breath Set Good Set Session Definition To be completed … something like “Exceed pressure of ExhalePressureThresholdMin for a time duration of at least ExhaleTimeThreshold then drop below ExhalePressureThresholdMin. Pressure drops shorter in duration than TimeSensitivity are isgnored.” To be completed To be completed To be completed To be completed To be completed To be completed To be completed aka Therapy Session Data Stored Locally and Transmitted to the Cloud Category Session Set Name SessionID PatientID Description Unique identifier for this session record. Unique identifier of the patient. StartDateTime EndDateTime The date and time of the start of the therapy session. StaticParameters SuccessLevel All of the static parameters used in the session (XML format?) % level of success for the therapy session. This is calculated as the simple average of the % level of success of all of the sets in this session. Field for any general or additional comments about the therapy session. Comments SetID SessionID StartDateTime EndDateTime SuccessLevel Comments Breath BreathID SetID EndDateTime BreathLength SuccessLevel Comments % level of success for the set calculated as follows based on the number of good breaths: 100% >= 15 30% 7 93% 14 27% 6 87% 13 23% 5 80% 12 18% 4 65% 11 14% 3 50% 10 9% 2 43% 9 5% 1 37% 8 0% 0 Field for any general or additional comments about the set. Perhaps note success of the set such as “Good breath count below range”, “Breath count exceeded maximum”, etc. % level of success for this breath as follows: 100% for good breath, 0% otherwise Field for any general or additional comments about the therapy session. Should include reason for failure, such as “Exhale above pressure range”, “Exhale below pressure range”, “Exhale too short”, etc.