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
07e4adf8
Commit
07e4adf8
authored
4 years ago
by
sbobo3
Committed by
adityab3
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
[backend] Overloaded getDiagnosisStatistics to get statistics for 8 weeks prior to given date
parent
75b800c7
No related branches found
Branches containing commit
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
+47
-0
47 additions, 0 deletions
...ncsu/csc/itrust/action/ViewDiagnosisStatisticsAction.java
with
47 additions
and
0 deletions
iTrust/src/edu/ncsu/csc/itrust/action/ViewDiagnosisStatisticsAction.java
+
47
−
0
View file @
07e4adf8
...
...
@@ -97,6 +97,53 @@ public class ViewDiagnosisStatisticsAction {
return
dsBean
;
}
/**
* Gets the counts of local and regional diagnoses for the specified input (lower date 8 weeks prior to upper date)
*
* @param upperDate The ending date for the time range
* @param icdCode The diagnosis code to examine
* @param zip The zip code to examine
* @return A bean containing the local and regional counts
* @throws FormValidationException
* @throws ITrustException
*/
public
DiagnosisStatisticsBean
getDiagnosisStatistics
(
String
upperDate
,
String
icdCode
,
String
zip
)
throws
FormValidationException
,
ITrustException
{
DiagnosisStatisticsBean
dsBean
;
try
{
if
(
upperDate
==
null
||
icdCode
==
null
)
return
null
;
Date
upper
=
new
SimpleDateFormat
(
"MM/dd/yyyy"
).
parse
(
upperDate
);
//calculate lower date by finding the date that is 8 weeks prior to upperDate
Calendar
cal
=
Calendar
.
getInstance
();
cal
.
setTime
(
upper
);
cal
.
add
(
Calendar
.
HOUR
,
-
56
*
24
);
Date
lower
=
cal
.
getTime
();
if
(!
zip
.
matches
(
"([0-9]{5})|([0-9]{5}-[0-9]{4})"
))
throw
new
FormValidationException
(
"Zip Code must be 5 digits!"
);
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!"
);
}
dsBean
=
diagnosesDAO
.
getDiagnosisCounts
(
icdCode
,
zip
,
lower
,
upper
);
}
catch
(
ParseException
e
)
{
throw
new
FormValidationException
(
"Enter date in MM/dd/yyyy"
);
}
return
dsBean
;
}
public
List
<
DiagnosisStatisticsBean
>
getDiagnosisTrends
(
String
dateString
,
String
icdCode
,
String
zip
)
throws
FormValidationException
,
ITrustException
{
ArrayList
<
DiagnosisStatisticsBean
>
dsBean
=
null
;
if
(
dateString
==
null
||
icdCode
==
null
)
{
...
...
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