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
99f29752
Commit
99f29752
authored
4 years ago
by
adityab3
Browse files
Options
Downloads
Patches
Plain Diff
Added JUnit tests for diagnosis DAO zipcode functionality
parent
2832ef84
No related branches found
No related tags found
1 merge request
!8
UC14: Reqeust Biosurveillance
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
iTrust/sql/data/hcp_diagnosis_data.sql
+35
-3
35 additions, 3 deletions
iTrust/sql/data/hcp_diagnosis_data.sql
iTrust/test/edu/ncsu/csc/itrust/unit/dao/officevisit/OVDiagnosesTest.java
+56
-1
56 additions, 1 deletion
...ncsu/csc/itrust/unit/dao/officevisit/OVDiagnosesTest.java
with
91 additions
and
4 deletions
iTrust/sql/data/hcp_diagnosis_data.sql
+
35
−
3
View file @
99f29752
/*-- 27606
-- 27607
-- 27606
-- 27606
-- 27603
-- 10001
-- 10001
-- 10001
-- 28803
-- 59710*/
INSERT
INTO
officevisits
(
ID
,
visitDate
,
HCPID
,
notes
,
PatientID
,
HospitalID
)
VALUES
...
...
@@ -21,7 +30,18 @@ VALUES
(
122
,
'2011-08-25'
,
9000000000
,
'Diagnose Mumps'
,
2
,
'1'
),
(
123
,
'2011-09-09'
,
9000000000
,
'Diagnose Mumps'
,
3
,
'1'
),
(
124
,
'2011-09-12'
,
9000000000
,
'Diagnose Mumps'
,
25
,
'1'
)
(
124
,
'2011-09-12'
,
9000000000
,
'Diagnose Mumps'
,
25
,
'1'
),
(
125
,
'2020-11-18'
,
9000000000
,
'Diagnose Cataracts'
,
1
,
'1'
),
(
126
,
'2020-11-18'
,
9000000000
,
'Diagnose Cataracts'
,
2
,
'1'
),
(
127
,
'2020-11-18'
,
9000000000
,
'Diagnose Cataracts'
,
3
,
'1'
),
(
128
,
'2020-11-18'
,
9000000000
,
'Diagnose Cataracts'
,
4
,
'1'
),
(
129
,
'2020-11-18'
,
9000000000
,
'Diagnose Cataracts'
,
21
,
'1'
),
(
130
,
'2020-11-18'
,
9000000000
,
'Diagnose Cataracts'
,
22
,
'1'
),
(
131
,
'2020-11-18'
,
9000000000
,
'Diagnose Cataracts'
,
23
,
'1'
),
(
132
,
'2020-11-18'
,
9000000000
,
'Diagnose Cataracts'
,
24
,
'1'
),
(
133
,
'2020-11-18'
,
9000000000
,
'Diagnose Cataracts'
,
105
,
'1'
),
(
134
,
'2020-11-18'
,
9000000000
,
'Diagnose Cataracts'
,
107
,
'1'
)
ON
DUPLICATE
KEY
UPDATE
id
=
id
;
...
...
@@ -46,7 +66,19 @@ VALUES
(
122
,
122
,
72
.
00
),
(
123
,
123
,
72
.
00
),
(
124
,
124
,
72
.
00
)
(
124
,
124
,
72
.
00
),
(
125
,
125
,
26
.
8
),
(
126
,
126
,
26
.
8
),
(
127
,
127
,
26
.
8
),
(
128
,
128
,
26
.
8
),
(
129
,
129
,
26
.
8
),
(
130
,
130
,
26
.
8
),
(
131
,
131
,
26
.
8
),
(
132
,
132
,
26
.
8
),
(
133
,
133
,
26
.
8
),
(
134
,
134
,
26
.
8
)
ON
DUPLICATE
KEY
UPDATE
VisitID
=
VALUES
(
VisitID
),
ICDCode
=
VALUES
(
ICDCode
);
INSERT
INTO
labprocedure
(
PatientMID
,
LaboratoryProcedureCode
,
Rights
,
Status
,
Commentary
,
Results
,
OfficeVisitID
,
UpdatedDate
,
...
...
This diff is collapsed.
Click to expand it.
iTrust/test/edu/ncsu/csc/itrust/unit/dao/officevisit/OVDiagnosesTest.java
+
56
−
1
View file @
99f29752
...
...
@@ -4,6 +4,7 @@ import java.text.SimpleDateFormat;
import
java.util.Calendar
;
import
java.util.Date
;
import
java.util.List
;
import
java.lang.IllegalArgumentException
;
import
junit.framework.TestCase
;
import
edu.ncsu.csc.itrust.action.ViewDiagnosisStatisticsAction
;
...
...
@@ -112,7 +113,61 @@ public class OVDiagnosesTest extends TestCase {
//If previous test fails, this test may fail
long
totalRegionNonsplit
=
diagDAO
.
getDiagnosisCounts
(
"487.00"
,
"27607"
,
lower
,
upper
).
getRegionStats
();
assertEquals
(
totalRegionNonsplit
,
totalRegion
);
}
}
public
void
testZipSFs
()
throws
Exception
{
Date
lower
=
new
SimpleDateFormat
(
"MM/dd/yyyy"
).
parse
(
"11/18/2020"
);
Date
upper
=
new
SimpleDateFormat
(
"MM/dd/yyyy"
).
parse
(
"11/18/2020"
);
DiagnosisStatisticsBean
bean
=
diagDAO
.
getDiagnosisCounts
(
"26.8"
,
"27606-1234"
,
lower
,
upper
,
5
);
assertEquals
(
bean
.
getZipStats
(),
bean
.
getRegionStats
());
assertEquals
(
3
,
bean
.
getZipStats
());
lower
=
new
SimpleDateFormat
(
"MM/dd/yyyy"
).
parse
(
"11/18/2020"
);
upper
=
new
SimpleDateFormat
(
"MM/dd/yyyy"
).
parse
(
"11/18/2020"
);
bean
=
diagDAO
.
getDiagnosisCounts
(
"26.8"
,
"27607"
,
lower
,
upper
,
4
);
assertEquals
(
1
,
bean
.
getZipStats
());
assertEquals
(
5
,
bean
.
getRegionStats
());
lower
=
new
SimpleDateFormat
(
"MM/dd/yyyy"
).
parse
(
"11/18/2020"
);
upper
=
new
SimpleDateFormat
(
"MM/dd/yyyy"
).
parse
(
"11/18/2020"
);
bean
=
diagDAO
.
getDiagnosisCounts
(
"26.8"
,
"27603"
,
lower
,
upper
,
3
);
assertEquals
(
1
,
bean
.
getZipStats
());
assertEquals
(
5
,
bean
.
getRegionStats
());
lower
=
new
SimpleDateFormat
(
"MM/dd/yyyy"
).
parse
(
"11/18/2020"
);
upper
=
new
SimpleDateFormat
(
"MM/dd/yyyy"
).
parse
(
"11/18/2020"
);
bean
=
diagDAO
.
getDiagnosisCounts
(
"26.8"
,
"27606"
,
lower
,
upper
,
2
);
assertEquals
(
0
,
bean
.
getZipStats
());
assertEquals
(
5
,
bean
.
getRegionStats
());
lower
=
new
SimpleDateFormat
(
"MM/dd/yyyy"
).
parse
(
"11/18/2020"
);
upper
=
new
SimpleDateFormat
(
"MM/dd/yyyy"
).
parse
(
"11/18/2020"
);
bean
=
diagDAO
.
getDiagnosisCounts
(
"26.8"
,
"20000"
,
lower
,
upper
,
1
);
assertEquals
(
0
,
bean
.
getZipStats
());
assertEquals
(
6
,
bean
.
getRegionStats
());
lower
=
new
SimpleDateFormat
(
"MM/dd/yyyy"
).
parse
(
"11/18/2020"
);
upper
=
new
SimpleDateFormat
(
"MM/dd/yyyy"
).
parse
(
"11/18/2020"
);
bean
=
diagDAO
.
getDiagnosisCounts
(
"26.8"
,
"10001"
,
lower
,
upper
,
0
);
assertEquals
(
3
,
bean
.
getZipStats
());
assertEquals
(
10
,
bean
.
getRegionStats
());
}
public
void
testInvalidZipSigFigs
()
throws
Exception
{
try
{
Date
lower
=
new
SimpleDateFormat
(
"MM/dd/yyyy"
).
parse
(
"11/18/2020"
);
Date
upper
=
new
SimpleDateFormat
(
"MM/dd/yyyy"
).
parse
(
"11/18/2020"
);
DiagnosisStatisticsBean
bean
=
diagDAO
.
getDiagnosisCounts
(
"26.8"
,
"27606-1234"
,
lower
,
upper
,
-
1
);
fail
(
"Expected exception."
);
}
catch
(
IllegalArgumentException
e
)
{
}
try
{
Date
lower
=
new
SimpleDateFormat
(
"MM/dd/yyyy"
).
parse
(
"11/18/2020"
);
Date
upper
=
new
SimpleDateFormat
(
"MM/dd/yyyy"
).
parse
(
"11/18/2020"
);
DiagnosisStatisticsBean
bean
=
diagDAO
.
getDiagnosisCounts
(
"26.8"
,
"27606-1234"
,
lower
,
upper
,
6
);
fail
(
"Expected exception."
);
}
catch
(
IllegalArgumentException
e
)
{
}
}
/**
* testMalaria
...
...
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