Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cs427fa20team22
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
htmoss2
cs427fa20team22
Commits
1e8572f1
Commit
1e8572f1
authored
4 years ago
by
adityab3
Browse files
Options
Downloads
Patches
Plain Diff
[backend] Added action for viewing diagnosis trends
parent
6d72164c
No related branches found
No related tags found
1 merge request
!26
UC14
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
iTrust/src/edu/ncsu/csc/itrust/action/ViewDiagnosisStatisticsAction.java
+37
-0
37 additions, 0 deletions
...ncsu/csc/itrust/action/ViewDiagnosisStatisticsAction.java
with
37 additions
and
0 deletions
iTrust/src/edu/ncsu/csc/itrust/action/ViewDiagnosisStatisticsAction.java
+
37
−
0
View file @
1e8572f1
...
@@ -93,6 +93,43 @@ public class ViewDiagnosisStatisticsAction {
...
@@ -93,6 +93,43 @@ public class ViewDiagnosisStatisticsAction {
return
dsBean
;
return
dsBean
;
}
}
public
List
<
DiagnosisStatisticsBean
>
getDiagnosisTrends
(
String
dateString
,
String
icdCode
,
String
zip
)
throws
FormValidationException
,
ITrustException
{
ArrayList
<
DiagnosisStatisticsBean
>
dsBean
=
null
;
if
(
dateString
==
null
||
icdCode
==
null
)
return
null
;
try
{
if
(!
zip
.
matches
(
"([0-9]{5})|([0-9]{5}-[0-9]{4})"
))
throw
new
FormValidationException
(
"Zip Code must be 5 digits!"
);
Date
next
=
new
SimpleDateFormat
(
"MM/dd/yyyy"
).
parse
(
dateString
);
dsBean
=
new
ArrayList
<>();
boolean
validCode
=
false
;
for
(
DiagnosisBean
diag
:
getDiagnosisCodes
())
{
if
(
diag
.
getICDCode
().
equals
(
icdCode
))
{
validCode
=
true
;
}
}
if
(
validCode
==
false
)
{
throw
new
FormValidationException
(
"ICDCode must be valid diagnosis!"
);
}
Calendar
cal
=
Calendar
.
getInstance
();
cal
.
setTime
(
next
);
for
(
int
i
=
0
;
i
<
8
;
i
++)
{
Date
weekDate
=
cal
.
getTime
();
dsBean
.
add
(
diagnosesDAO
.
getCountForWeekBefore
(
icdCode
,
zip
,
weekDate
));
cal
.
add
(
Calendar
.
HOUR
,
-
24
*
7
);
}
}
catch
(
ParseException
e
)
{
throw
new
FormValidationException
(
"Enter dates in MM/dd/yyyy"
);
}
return
dsBean
;
}
/**
/**
* Gets the local and regional counts for the specified week and calculates the prior average.
* Gets the local and regional counts for the specified week and calculates the prior average.
...
...
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