-
Notifications
You must be signed in to change notification settings - Fork 35
148 Add EQ5D as a person attribute #151
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
andrewbaxter439
merged 29 commits into
develop
from
feature/148-add-eq5d-as-a-person-attribute
Mar 20, 2025
Merged
Changes from all commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
21d2181
Person EQ5D column added
andrewbaxter439 e83cd2a
EQ5D enum added
andrewbaxter439 d2ea2f9
Added polynomials and interactions for pcs and mcs
andrewbaxter439 6d89d8a
eq5d coefficient excel sheet
andrewbaxter439 41d319c
add enum and prediction call in person
andrewbaxter439 5001f24
add regression processes
andrewbaxter439 dc9b520
corrected spelling in excel
andrewbaxter439 3456e7e
add update eq5d
andrewbaxter439 c8ff3e4
add lower bound to eq5d score
andrewbaxter439 c359970
add some (failing) person tests
andrewbaxter439 fe728b8
Further testing for person eq5d - correct calcs
andrewbaxter439 720061f
Merge branch 'experiment/person_testing' into feature/148-add-eq5d-as…
andrewbaxter439 0726f14
adding franks coefficients option
andrewbaxter439 35a6dad
updated tests (running in wrong order)
andrewbaxter439 28519b0
correct order for EQ5D tests
andrewbaxter439 90e458b
EQ5D tests trigger events rather than call update methods directly
andrewbaxter439 9af6fe0
refactored `deq5d` to `he_eq5d` and similar
andrewbaxter439 fcfd42a
Make aging private
andrewbaxter439 9b55497
change `healthEQ5D` method to private
andrewbaxter439 e955154
construct person in setup
andrewbaxter439 e88c371
rename setup
andrewbaxter439 92f9364
clearer test naming
andrewbaxter439 833e645
extract load eq5d parameters as public method
andrewbaxter439 681bd5b
only re-load eq5d params (and reset)
andrewbaxter439 9719062
remove test order assertions
andrewbaxter439 a528a4f
remove redundant re-calling of health regression loading
andrewbaxter439 cc3063e
simplify not loading all parameters
andrewbaxter439 cd11f2b
change parameter loading to BeforeEach
andrewbaxter439 70929ab
add annotation to new Person enums
andrewbaxter439 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Binary file not shown.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,110 @@ | ||
| package simpaths.model; | ||
|
|
||
| import org.junit.jupiter.api.*; | ||
| import simpaths.data.Parameters; | ||
| import simpaths.model.enums.Country; | ||
|
|
||
| import static org.junit.jupiter.api.Assertions.*; | ||
|
|
||
| @DisplayName("Person class") | ||
| public class PersonTest { | ||
|
|
||
| static Person testPerson; | ||
|
|
||
| @BeforeAll | ||
| static void setup() { | ||
| testPerson = new Person(true); | ||
| } | ||
|
|
||
| @Nested | ||
| @DisplayName("EQ5D process") | ||
| class Eq5dTests { | ||
|
|
||
| @Nested | ||
| @DisplayName("With eq5dConversionParameters set to 'lawrence'") | ||
| class WithLawrenceParameters { | ||
|
|
||
| @BeforeEach | ||
| public void setupLawrenceCoefficients() { | ||
|
|
||
| Parameters.eq5dConversionParameters = "lawrence"; | ||
| Parameters.loadEQ5DParameters("UK", 8); | ||
|
|
||
| } | ||
|
|
||
| @Test | ||
| @DisplayName("Calculates low score correctly using Lawrence and Fleishman coefficients") | ||
| public void calculatesLowScoreCorrectly() { | ||
|
|
||
|
|
||
| testPerson.setDhe_mcs(1.); | ||
| testPerson.setDhe_pcs(1.); | ||
|
|
||
| testPerson.onEvent(Person.Processes.HealthEQ5D); | ||
|
|
||
| assertEquals(-0.594, testPerson.getHe_eq5d()); | ||
|
|
||
| } | ||
|
|
||
| @Test | ||
| @DisplayName("Calculates high score correctly using Lawrence and Fleishman coefficients") | ||
| public void calculatesHighScoreCorrectly() { | ||
|
|
||
|
|
||
| testPerson.setDhe_mcs(100.); | ||
| testPerson.setDhe_pcs(100.); | ||
|
|
||
| testPerson.onEvent(Person.Processes.HealthEQ5D); | ||
|
|
||
| assertEquals(1, testPerson.getHe_eq5d()); | ||
|
|
||
| } | ||
|
|
||
| } | ||
|
|
||
|
|
||
| @Nested | ||
| @DisplayName("With eq5dConversionParameters set to 'franks'") | ||
| class WithFranksParameters { | ||
|
|
||
| @BeforeEach | ||
| public void setupFranksCoefficients() { | ||
|
|
||
| Parameters.eq5dConversionParameters = "franks"; | ||
| Parameters.loadEQ5DParameters("UK", 8); | ||
|
|
||
| } | ||
|
|
||
|
|
||
| @Test | ||
| @DisplayName("Calculates low score correctly using Franks coefficients") | ||
| public void calculatesLowScoreCorrectly() { | ||
|
|
||
| testPerson.setDhe_mcs(1.); | ||
| testPerson.setDhe_pcs(1.); | ||
|
|
||
| testPerson.onEvent(Person.Processes.HealthEQ5D); | ||
|
|
||
| assertEquals(-0.594, testPerson.getHe_eq5d()); | ||
|
|
||
| } | ||
|
|
||
| @Test | ||
| @DisplayName("Calculates high score correctly using Franks coefficients") | ||
| public void calculatesHighScoreCorrectly(){ | ||
|
|
||
| testPerson.setDhe_mcs(100.); | ||
| testPerson.setDhe_pcs(100.); | ||
|
|
||
| testPerson.onEvent(Person.Processes.HealthEQ5D); | ||
|
|
||
| // The maximum possible value given by the Franks coefficients | ||
| assertEquals(0.9035601, testPerson.getHe_eq5d()); | ||
|
|
||
| } | ||
|
|
||
| } | ||
| } | ||
|
|
||
|
|
||
| } | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.