Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
K
KatApp
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Thi Huyen Trang Nguyen
KatApp
Commits
7e44f822
Commit
7e44f822
authored
4 years ago
by
Thi Huyen Trang Nguyen
Browse files
Options
Downloads
Patches
Plain Diff
newBranchTEST: Added startTriage.dart and invalid_triage_state_exception.dart
parent
a7614f57
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
rescueapp/lib/start_triage_system/invalid_triage_state_exception.dart
+1
-0
1 addition, 0 deletions
...b/start_triage_system/invalid_triage_state_exception.dart
rescueapp/lib/start_triage_system/startTriage.dart
+209
-0
209 additions, 0 deletions
rescueapp/lib/start_triage_system/startTriage.dart
with
210 additions
and
0 deletions
rescueapp/lib/start_triage_system/invalid_triage_state_exception.dart
0 → 100644
+
1
−
0
View file @
7e44f822
class
InvalidTriageStateException
implements
Exception
{
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
rescueapp/lib/start_triage_system/startTriage.dart
0 → 100644
+
209
−
0
View file @
7e44f822
import
'package:flutter/material.dart'
;
import
'package:rescueapp/start_triage_system/after_opening_airways.dart'
;
import
'package:rescueapp/start_triage_system/ambulatory.dart'
;
import
'package:rescueapp/start_triage_system/camera_access.dart'
;
import
'package:rescueapp/start_triage_system/lock_screen.dart'
;
import
'package:rescueapp/start_triage_system/spontaneous_breathing_present.dart'
;
import
'breathing_frequency_per_minute.dart'
;
import
'circulation.dart'
;
import
'invalid_triage_state_exception.dart'
;
import
'neurology.dart'
;
class
StartTriage
{
bool
_isAmbulatory
;
bool
_isSpontaneousBreathingPresent
;
bool
_isAfterOpeningAirways
;
bool
_isBreathingFrequencyPerMinute
;
bool
_isCirculation
;
bool
_isNeurology
;
Object
_state
;
TriageCategory
_triageCategory
=
new
TriageCategory
();
bool
getIsAmbulatory
()
{
return
_isAmbulatory
;
}
bool
getIsSpontaneousBreathingPresent
()
{
return
_isSpontaneousBreathingPresent
;
}
bool
getIsAfterOpeningAirways
()
{
return
_isAfterOpeningAirways
;
}
bool
getIsBreathingFrequencyPerMinute
()
{
return
_isBreathingFrequencyPerMinute
;
}
bool
getIsCirculation
()
{
return
_isCirculation
;
}
bool
getIsNeurology
()
{
return
_isNeurology
;
}
void
setIsAmbulatory
(
bool
isAmbulatory
)
{
if
(
_state
is
Ambulatory
||
_state
is
SpontaneousBreathingPresent
||
_state
is
AfterOpeningAirways
||
_state
is
BreathingFrequencyPerMinute
||
_state
is
CapillaryFillingTime
||
_state
is
Neurology
)
{
if
(
_state
is
Ambulatory
)
{
this
.
_isAmbulatory
=
isAmbulatory
;
}
else
{
throw
new
InvalidTriageStateException
();
}
}
}
void
setIsSpontaneousBreathingPresent
(
bool
isSpontaneousBreathingPresent
)
{
if
(
_state
is
Ambulatory
||
_state
is
SpontaneousBreathingPresent
||
_state
is
AfterOpeningAirways
||
_state
is
BreathingFrequencyPerMinute
||
_state
is
CapillaryFillingTime
||
_state
is
Neurology
)
{
this
.
_isSpontaneousBreathingPresent
=
isSpontaneousBreathingPresent
;
}
else
{
throw
new
InvalidTriageStateException
();
}
}
void
setIsAfterOpeningAirways
(
bool
isAfterOpeningAirways
)
{
if
(
_state
is
Ambulatory
||
_state
is
AfterOpeningAirways
||
_state
is
SpontaneousBreathingPresent
)
{
this
.
_isAfterOpeningAirways
=
isAfterOpeningAirways
;
}
else
{
throw
new
InvalidTriageStateException
();
}
}
void
setBreathingFrequencyPerMinute
(
bool
isBreathingFrequencyPerMinute
)
{
if
(
_state
is
Ambulatory
||
_state
is
BreathingFrequencyPerMinute
||
_state
is
SpontaneousBreathingPresent
||
_state
is
CapillaryFillingTime
||
_state
is
Neurology
)
{
this
.
_isBreathingFrequencyPerMinute
=
isBreathingFrequencyPerMinute
;
}
else
{
throw
new
InvalidTriageStateException
();
}
}
void
setIsNeurology
(
bool
isNeurology
)
{
if
(
_state
is
Ambulatory
||
_state
is
BreathingFrequencyPerMinute
||
_state
is
SpontaneousBreathingPresent
||
_state
is
CapillaryFillingTime
||
_state
is
Neurology
)
{
this
.
_isNeurology
=
isNeurology
;
}
else
{
throw
new
InvalidTriageStateException
();
}
}
void
setIsCirculation
(
bool
isCirculation
)
{
if
(
_state
is
Ambulatory
||
_state
is
BreathingFrequencyPerMinute
||
_state
is
SpontaneousBreathingPresent
||
_state
is
CapillaryFillingTime
||
_state
is
Neurology
)
{
this
.
_isCirculation
=
isCirculation
;
}
else
{
throw
new
InvalidTriageStateException
();
}
}
void
setState
(
Object
state
)
{
_state
=
state
;
String
categoryName
;
print
(
_isAmbulatory
);
Color
color
;
if
(
_state
is
Ambulatory
||
_state
is
AfterOpeningAirways
||
_state
is
BreathingFrequencyPerMinute
||
_state
is
SpontaneousBreathingPresent
||
_state
is
CapillaryFillingTime
||
_state
is
Neurology
)
{
categoryName
=
""
;
}
else
if
(
_state
is
LockScreen
||
_state
is
CameraAccess
)
{
if
((
this
.
_isAmbulatory
==
true
))
{
categoryName
=
'Kategorie T3'
;
color
=
Colors
.
green
;
}
else
if
(
this
.
_isAmbulatory
==
false
&&
this
.
_isSpontaneousBreathingPresent
==
false
&&
this
.
_isAfterOpeningAirways
==
false
)
{
categoryName
=
"Kategorie T4"
;
color
=
Colors
.
black
;
}
else
if
(
this
.
_isAmbulatory
==
false
&&
this
.
_isSpontaneousBreathingPresent
==
false
&&
this
.
_isAfterOpeningAirways
==
true
)
{
categoryName
=
"Kategorie T1A"
;
color
=
Colors
.
red
;
}
else
if
(
this
.
_isAmbulatory
==
false
&&
this
.
_isSpontaneousBreathingPresent
==
true
&&
this
.
_isBreathingFrequencyPerMinute
==
true
)
{
categoryName
=
"Kategorie T1B"
;
color
=
Colors
.
red
;
}
else
if
(
this
.
_isAmbulatory
==
false
&&
this
.
_isSpontaneousBreathingPresent
==
true
&&
this
.
_isBreathingFrequencyPerMinute
==
false
&&
this
.
_isCirculation
==
true
)
{
categoryName
=
"Kategorie T1C"
;
color
=
Colors
.
red
;
}
else
if
(
this
.
_isAmbulatory
==
false
&&
this
.
_isSpontaneousBreathingPresent
==
true
&&
this
.
_isBreathingFrequencyPerMinute
==
false
&&
this
.
_isCirculation
==
false
&&
this
.
_isNeurology
==
false
)
{
categoryName
=
"Kategorie T1D"
;
color
=
Colors
.
red
;
}
else
if
(
this
.
_isAmbulatory
==
false
&&
this
.
_isSpontaneousBreathingPresent
==
true
&&
this
.
_isBreathingFrequencyPerMinute
==
false
&&
this
.
_isCirculation
==
false
&&
this
.
_isNeurology
==
true
)
{
categoryName
=
"Kategorie T2"
;
color
=
Colors
.
yellow
;
}
}
if
(
categoryName
!=
null
)
{
_triageCategory
.
setCategory
(
categoryName
);
_triageCategory
.
setColor
(
color
);
}
else
{
throw
new
InvalidTriageStateException
();
}
}
TriageCategory
getTriageCategory
()
{
return
_triageCategory
;
}
}
class
TriageCategory
{
String
_category
;
Color
_color
;
String
getCategory
()
{
return
_category
;
}
void
setCategory
(
String
category
)
{
this
.
_category
=
category
;
}
Color
getColor
()
{
return
_color
;
}
void
setColor
(
Color
color
)
{
this
.
_color
=
color
;
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment