-
Notifications
You must be signed in to change notification settings - Fork 7
STD_HIV_DATAMART - widen NBS177/NBS167 columns + page-aware codeset #871
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
Open
ericnagel
wants to merge
22
commits into
main
Choose a base branch
from
en/app-619-std-col-width
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+1,432
−27
Open
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
db71f53
Update column widths for HIV case management and datamart tables
ericnagel 52c3b03
Formatting so it's readable
ericnagel c6cc846
Make sure the column isn't already varchar(100) NULL before altering
ericnagel 2d9cd46
Just a SQL comment to help trace data
ericnagel 0035db8
conditional logic for fld_foll_up_expected_in
ericnagel 083e923
MODIFY MISMATCHED COLUMN TYPES
ericnagel b53a239
Needed to increase this column, too
ericnagel 14a0eda
This field needs to be wider, but there isn't enough room to go to 10…
ericnagel 241e0ce
Values and alignment going from nbs_odse.dbo.case_management to [RDB_…
ericnagel 38c032d
86 this commented-out old code
ericnagel eb055bf
Proper values in [STD_HIV_DATAMART]
ericnagel ac37f63
Removing some code that I used for this branch, but was a fix for som…
ericnagel e5780c5
Updates the functional test
ericnagel 7d285dc
More updates to existing functional tests
ericnagel a4c93dc
Updated notification plans
ericnagel 8c443b3
Do not turn on CDC for tmp_DynDM* tables
ericnagel e845c9d
We need this to fix the "Operand type clash: date is incompatible wit…
ericnagel 5a0b3e0
Functional test for HIV Investigation
ericnagel ba3e5b6
Fix the nested queries
ericnagel 828717b
Move this block & formatting
ericnagel 2213ffb
Fighting this formatting
ericnagel 3017a53
Better queries and examine only what we're looking for
ericnagel 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
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
97 changes: 97 additions & 0 deletions
97
.../main/resources/db/005-rdb_modern/tables/261-alter_std_hiv_case_management_widths-001.sql
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,97 @@ | ||
| IF EXISTS ( | ||
| SELECT 1 | ||
| FROM sys.columns | ||
| WHERE object_id = OBJECT_ID(N'[dbo].[nrt_investigation_case_management]') | ||
| AND name = 'fl_fup_actual_ref_type' | ||
| AND system_type_id = 167 | ||
| AND collation_name IS NOT NULL | ||
| AND max_length <> 100 | ||
| ) | ||
| BEGIN | ||
| ALTER TABLE [dbo].[nrt_investigation_case_management] | ||
| ALTER COLUMN [fl_fup_actual_ref_type] varchar(100) NULL; | ||
| END; | ||
|
|
||
| IF EXISTS ( | ||
| SELECT 1 | ||
| FROM sys.columns | ||
| WHERE object_id = OBJECT_ID(N'[dbo].[nrt_investigation_case_management]') | ||
| AND name = 'fl_fup_notification_plan_cd' | ||
| AND system_type_id = 167 | ||
| AND collation_name IS NOT NULL | ||
| AND max_length <> 100 | ||
| ) | ||
| BEGIN | ||
| ALTER TABLE [dbo].[nrt_investigation_case_management] | ||
| ALTER COLUMN [fl_fup_notification_plan_cd] varchar(100) NULL; | ||
| END; | ||
|
|
||
| IF EXISTS ( | ||
| SELECT 1 | ||
| FROM sys.columns | ||
| WHERE object_id = OBJECT_ID(N'[dbo].[D_CASE_MANAGEMENT]') | ||
| AND name = 'FL_FUP_ACTUAL_REF_TYPE' | ||
| AND system_type_id = 167 | ||
| AND collation_name IS NOT NULL | ||
| AND max_length <> 100 | ||
| ) | ||
| BEGIN | ||
| ALTER TABLE [dbo].[D_CASE_MANAGEMENT] | ||
| ALTER COLUMN [FL_FUP_ACTUAL_REF_TYPE] varchar(100) NULL; | ||
| END; | ||
|
|
||
| IF EXISTS ( | ||
| SELECT 1 | ||
| FROM sys.columns | ||
| WHERE object_id = OBJECT_ID(N'[dbo].[D_CASE_MANAGEMENT]') | ||
| AND name = 'FL_FUP_NOTIFICATION_PLAN_CD' | ||
| AND system_type_id = 167 | ||
| AND collation_name IS NOT NULL | ||
| AND max_length <> 100 | ||
| ) | ||
| BEGIN | ||
| ALTER TABLE [dbo].[D_CASE_MANAGEMENT] | ||
| ALTER COLUMN [FL_FUP_NOTIFICATION_PLAN_CD] varchar(100) NULL; | ||
| END; | ||
|
|
||
| IF EXISTS ( | ||
| SELECT 1 | ||
| FROM sys.columns | ||
| WHERE object_id = OBJECT_ID(N'[dbo].[STD_HIV_DATAMART]') | ||
| AND name = 'FL_FUP_ACTUAL_REF_TYPE' | ||
| AND system_type_id = 167 | ||
| AND collation_name IS NOT NULL | ||
| AND max_length <> 100 | ||
| ) | ||
| BEGIN | ||
| ALTER TABLE [dbo].[STD_HIV_DATAMART] | ||
| ALTER COLUMN [FL_FUP_ACTUAL_REF_TYPE] varchar(100) NULL; | ||
| END; | ||
|
|
||
| IF EXISTS ( | ||
| SELECT 1 | ||
| FROM sys.columns | ||
| WHERE object_id = OBJECT_ID(N'[dbo].[STD_HIV_DATAMART]') | ||
| AND name = 'FL_FUP_NOTIFICATION_PLAN' | ||
| AND system_type_id = 167 | ||
| AND collation_name IS NOT NULL | ||
| AND max_length <> 100 | ||
| ) | ||
| BEGIN | ||
| ALTER TABLE [dbo].[STD_HIV_DATAMART] | ||
| ALTER COLUMN [FL_FUP_NOTIFICATION_PLAN] varchar(100) NULL; | ||
| END; | ||
|
|
||
| IF EXISTS ( | ||
| SELECT 1 | ||
| FROM sys.columns | ||
| WHERE object_id = OBJECT_ID(N'[dbo].[DM_INV_HIV]') | ||
| AND name = 'FL_FUP_ACTUAL_REF_TY' | ||
| AND system_type_id = 167 | ||
| AND collation_name IS NOT NULL | ||
| AND max_length <> 25 | ||
| ) | ||
| BEGIN | ||
| ALTER TABLE [dbo].[DM_INV_HIV] | ||
| ALTER COLUMN [FL_FUP_ACTUAL_REF_TY] varchar(25) NULL; | ||
| END; |
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
24 changes: 24 additions & 0 deletions
24
...sources/testData/functional/hivNotificationActualReferral/010-CreatePatient/expected.json
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,24 @@ | ||
| { | ||
| "0": [ | ||
| { | ||
| "PATIENT_ADDED_BY": "Kent, Ariella", | ||
| "PATIENT_ADD_TIME": "2026-06-05T16:09:55.113", | ||
| "PATIENT_CITY": "Atlanta", | ||
| "PATIENT_COUNTRY": "United States", | ||
| "PATIENT_DOB": "1978-08-16T00:00:00.000", | ||
| "PATIENT_ENTRY_METHOD": "N", | ||
| "PATIENT_FIRST_NAME": "Nil", | ||
| "PATIENT_LAST_CHANGE_TIME": "2026-06-05T16:09:55.113", | ||
| "PATIENT_LAST_NAME": "Prevost", | ||
| "PATIENT_LAST_UPDATED_BY": "Kent, Ariella", | ||
| "PATIENT_LOCAL_ID": "PSN1000010000GA01", | ||
| "PATIENT_MPR_UID": 1000010000, | ||
| "PATIENT_RECORD_STATUS": "ACTIVE", | ||
| "PATIENT_STATE": "Georgia", | ||
| "PATIENT_STATE_CODE": "13", | ||
| "PATIENT_STREET_ADDRESS_1": "91181 Steensland", | ||
| "PATIENT_UID": 1000010000, | ||
| "PATIENT_ZIP": "30368" | ||
| } | ||
| ] | ||
| } |
90 changes: 90 additions & 0 deletions
90
...t/resources/testData/functional/hivNotificationActualReferral/010-CreatePatient/query.sql
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,90 @@ | ||
|
|
||
|
|
||
| -- dbo.D_PATIENT | operations: insert | ||
| -- Query: 0 | ||
| -- Step: 1 | ||
| -- WHERE clause narrowed to known lookup key: PATIENT_LOCAL_ID | ||
| SELECT | ||
| [PATIENT_ADDED_BY], | ||
| [PATIENT_ADDL_GENDER_INFO], | ||
| [PATIENT_ADD_TIME], | ||
| [PATIENT_AGE_REPORTED], | ||
| [PATIENT_AGE_REPORTED_UNIT], | ||
| [PATIENT_ALIAS_NICKNAME], | ||
| [PATIENT_BIRTH_COUNTRY], | ||
| [PATIENT_BIRTH_SEX], | ||
| [PATIENT_CENSUS_TRACT], | ||
| [PATIENT_CITY], | ||
| [PATIENT_COUNTRY], | ||
| [PATIENT_COUNTY], | ||
| [PATIENT_COUNTY_CODE], | ||
| [PATIENT_CURRENT_SEX], | ||
| [PATIENT_CURR_SEX_UNK_RSN], | ||
| [PATIENT_DECEASED_DATE], | ||
| [PATIENT_DECEASED_INDICATOR], | ||
| [PATIENT_DOB], | ||
| [PATIENT_EMAIL], | ||
| [PATIENT_ENTRY_METHOD], | ||
| [PATIENT_ETHNICITY], | ||
| [PATIENT_FIRST_NAME], | ||
| [PATIENT_GENERAL_COMMENTS], | ||
| [PATIENT_LAST_CHANGE_TIME], | ||
| [PATIENT_LAST_NAME], | ||
| [PATIENT_LAST_UPDATED_BY], | ||
| [PATIENT_LOCAL_ID], | ||
| [PATIENT_MARITAL_STATUS], | ||
| [PATIENT_MIDDLE_NAME], | ||
| [PATIENT_MPR_UID], | ||
| [PATIENT_NAME_SUFFIX], | ||
| [PATIENT_NUMBER], | ||
| [PATIENT_NUMBER_AUTH], | ||
| [PATIENT_PHONE_CELL], | ||
| [PATIENT_PHONE_EXT_HOME], | ||
| [PATIENT_PHONE_EXT_WORK], | ||
| [PATIENT_PHONE_HOME], | ||
| [PATIENT_PHONE_WORK], | ||
| [PATIENT_PREFERRED_GENDER], | ||
| [PATIENT_PRIMARY_LANGUAGE], | ||
| [PATIENT_PRIMARY_OCCUPATION], | ||
| [PATIENT_RACE_ALL], | ||
| [PATIENT_RACE_AMER_IND_1], | ||
| [PATIENT_RACE_AMER_IND_2], | ||
| [PATIENT_RACE_AMER_IND_3], | ||
| [PATIENT_RACE_AMER_IND_ALL], | ||
| [PATIENT_RACE_AMER_IND_GT3_IND], | ||
| [PATIENT_RACE_ASIAN_1], | ||
| [PATIENT_RACE_ASIAN_2], | ||
| [PATIENT_RACE_ASIAN_3], | ||
| [PATIENT_RACE_ASIAN_ALL], | ||
| [PATIENT_RACE_ASIAN_GT3_IND], | ||
| [PATIENT_RACE_BLACK_1], | ||
| [PATIENT_RACE_BLACK_2], | ||
| [PATIENT_RACE_BLACK_3], | ||
| [PATIENT_RACE_BLACK_ALL], | ||
| [PATIENT_RACE_BLACK_GT3_IND], | ||
| [PATIENT_RACE_CALCULATED], | ||
| [PATIENT_RACE_CALC_DETAILS], | ||
| [PATIENT_RACE_NAT_HI_1], | ||
| [PATIENT_RACE_NAT_HI_2], | ||
| [PATIENT_RACE_NAT_HI_3], | ||
| [PATIENT_RACE_NAT_HI_ALL], | ||
| [PATIENT_RACE_NAT_HI_GT3_IND], | ||
| [PATIENT_RACE_WHITE_1], | ||
| [PATIENT_RACE_WHITE_2], | ||
| [PATIENT_RACE_WHITE_3], | ||
| [PATIENT_RACE_WHITE_ALL], | ||
| [PATIENT_RACE_WHITE_GT3_IND], | ||
| [PATIENT_RECORD_STATUS], | ||
| [PATIENT_SPEAKS_ENGLISH], | ||
| [PATIENT_SSN], | ||
| [PATIENT_STATE], | ||
| [PATIENT_STATE_CODE], | ||
| [PATIENT_STREET_ADDRESS_1], | ||
| [PATIENT_STREET_ADDRESS_2], | ||
| [PATIENT_UID], | ||
| [PATIENT_UNK_ETHNIC_RSN], | ||
| [PATIENT_WITHIN_CITY_LIMITS], | ||
| [PATIENT_ZIP] | ||
| FROM [RDB_MODERN].[dbo].[D_PATIENT] | ||
| WHERE [PATIENT_LOCAL_ID] = N'PSN1000010000GA01' | ||
| ; |
Oops, something went wrong.
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.
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.
what about floats or datetimes, do we need when statements to handle those?
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.
Yes, probably, and I can add them but this modification was a major side-quest to the original issue. I'm not sure how far down that path to go - and I'm not sure how I'd test types that are not part of this process.