-
Notifications
You must be signed in to change notification settings - Fork 3
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
Modified the logic on computing validity vls #559
base: dev
Are you sure you want to change the base?
Conversation
Reviewer's Guide by SourceryThis pull request modifies the logic for computing the validity of viral loads. The date range for data extraction has been adjusted, and the age calculation logic has been updated to prioritize the Updated class diagram for VLValidityCheckBasedOnEligibilityAndAgeclassDiagram
class VLValidityCheckBasedOnEligibilityAndAge {
+SiteCode int
+PatientPK int
+VisitID varchar
+MFLCode int
+FacilityName varchar
+Partner varchar
+Agency varchar
+PatientID varchar
+PrepNumber varchar
+StartARTDate date
+CohortYearMonth int
+CohortYear int
+DOB date
+AgeLastVisit int
+AgeAsOfDate int
+OrderedbyDate date
+ReportedbyDate date
+AsOfDate date
+TestName varchar
+TestResult varchar
+Emr varchar
+Project varchar
+EligibleVL int
+IsValidVL int
}
note for VLValidityCheckBasedOnEligibilityAndAge "The IsValidVL attribute is now calculated based on AgeLastVisit if available, otherwise using DOB."
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @DennisGibz - I've reviewed your changes - here's some feedback:
Overall Comments:
- Consider adding comments to the queries to explain the logic behind key calculations, especially around age and date differences.
- It might be helpful to add some logging or auditing to track the number of records processed and any potential errors encountered during the loop.
Here's what I looked at during the review
- 🟢 General issues: all looks good
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
@@ -2,11 +2,11 @@ TRUNCATE TABLE ndwh.Fact.FactViralLoad_Historical; | |||
|
|||
DECLARE @start_date DATE; | |||
|
|||
SELECT @start_date = dateadd(month, -24, eomonth(dateadd(month, -1, getdate()))); | |||
SELECT @start_date = dateadd(month, -24, eomonth(dateadd(month, -2, getdate()))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@DennisGibz this was for testing purposes perhaps ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@thanks for noticing above. I have modified it from -2 to -1
@DennisGibz just general question, how does the ValidVL in the historical fact compare with FactViralLoad with the new changes? |
@nobert-mumo the exaggerated numbers have drastically reduced but not tallied. Hist still has some higher numbers. 30K diff. |
Summary by Sourcery
Modified the logic for computing the validity of viral load (VL) results. This includes adjusting the date range used for determining VL eligibility and incorporating the
AgeLastVisit
field to improve the accuracy of age calculations.Bug Fixes:
AgeLastVisit
field to improve age calculation accuracy.Enhancements:
AgeLastVisit
field, providing a more accurate assessment of a patient's age at the time of the viral load test.