-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
model supports multiple providers and default provider
- Loading branch information
Showing
16 changed files
with
138 additions
and
64 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 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 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 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 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 |
---|---|---|
|
@@ -5626,7 +5626,6 @@ databaseChangeLog: | |
references: role | ||
- sql: | | ||
GRANT SELECT ON ${database.defaultSchemaName}.api_user_role TO ${noPhiUsername}; | ||
- changeSet: | ||
id: add-timer-started-at-to-test_order-table | ||
author: [email protected] | ||
|
@@ -5643,7 +5642,6 @@ databaseChangeLog: | |
- dropColumn: | ||
tableName: test_order | ||
columnName: timer_started_at | ||
|
||
- changeSet: | ||
id: add-hepatitis-c-to-supported_disease-table | ||
author: [email protected] | ||
|
@@ -5661,4 +5659,59 @@ databaseChangeLog: | |
(gen_random_uuid(), 'Hepatitis-C', 'LP14400-3') | ||
rollback: | ||
- sql: | ||
sql: DELETE FROM ${database.defaultSchemaName}.supported_disease WHERE name = 'Hepatitis-C'; | ||
sql: DELETE FROM ${database.defaultSchemaName}.supported_disease WHERE name = 'Hepatitis-C'; | ||
- changeSet: | ||
id: create-facility_providers-table | ||
author: [email protected] | ||
changes: | ||
- tagDatabase: | ||
tag: add-facility-providers-table | ||
- createTable: | ||
tableName: facility_providers | ||
remarks: Join table for mapping multiple providers to a facility. | ||
columns: | ||
- column: | ||
name: facility_id | ||
type: uuid | ||
constraints: | ||
nullable: false | ||
foreignKeyName: fk__facility_providers__facility | ||
references: facility | ||
- column: | ||
name: provider_id | ||
type: uuid | ||
constraints: | ||
nullable: false | ||
foreignKeyName: fk__facility_providers__provider | ||
references: provider | ||
- changeSet: | ||
id: populate-facility-providers-table | ||
author: [email protected] | ||
changes: | ||
- tagDatabase: | ||
tag: populate-facility-providers-table | ||
- sql: | ||
sql: | | ||
INSERT INTO ${database.defaultSchemaName}.facility_providers ( | ||
facility_id, | ||
provider_id | ||
) | ||
SELECT | ||
internal_id, | ||
ordering_provider_id | ||
FROM ${database.defaultSchemaName}.facility; | ||
rollback: | ||
- sql: | ||
sql: | | ||
TRUNCATE TABLE ${database.defaultSchemaName}.facility_providers; | ||
- changeSet: | ||
id: rename-facility-provider-column | ||
author: [email protected] | ||
changes: | ||
- tagDatabase: | ||
tag: rename-facility-provider-column | ||
- renameColumn: | ||
tableName: facility | ||
oldColumnName: ordering_provider_id | ||
newColumnName: default_ordering_provider_id | ||
remarks: The default healthcare provider for tests ordered at this facility. |
This file contains 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 |
---|---|---|
|
@@ -1933,7 +1933,7 @@ void createFhirBundle_TestEvent_matchesJson() throws IOException { | |
.facilityAddress(address) | ||
.phone("7735551234") | ||
.email("[email protected]") | ||
.orderingProvider(provider) | ||
.defaultOrderingProvider(provider) | ||
.defaultDeviceType(deviceType) | ||
.defaultSpecimenType(specimenType) | ||
.configuredDevices(Collections.emptyList()) | ||
|
This file contains 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 |
---|---|---|
|
@@ -110,18 +110,18 @@ void addFacility_withDeviceIds_success() { | |
.email(facility.getEmail()) | ||
.orderingProvider( | ||
ProviderInput.builder() | ||
.firstName(facility.getOrderingProvider().getNameInfo().getFirstName()) | ||
.middleName(facility.getOrderingProvider().getNameInfo().getMiddleName()) | ||
.lastName(facility.getOrderingProvider().getNameInfo().getLastName()) | ||
.suffix(facility.getOrderingProvider().getNameInfo().getSuffix()) | ||
.npi(facility.getOrderingProvider().getProviderId()) | ||
.street(facility.getOrderingProvider().getAddress().getStreetOne()) | ||
.streetTwo(facility.getOrderingProvider().getAddress().getStreetTwo()) | ||
.city(facility.getOrderingProvider().getAddress().getCity()) | ||
.county(facility.getOrderingProvider().getAddress().getCounty()) | ||
.state(facility.getOrderingProvider().getAddress().getState()) | ||
.zipCode(facility.getOrderingProvider().getAddress().getPostalCode()) | ||
.phone(facility.getOrderingProvider().getTelephone()) | ||
.firstName(facility.getDefaultOrderingProvider().getNameInfo().getFirstName()) | ||
.middleName(facility.getDefaultOrderingProvider().getNameInfo().getMiddleName()) | ||
.lastName(facility.getDefaultOrderingProvider().getNameInfo().getLastName()) | ||
.suffix(facility.getDefaultOrderingProvider().getNameInfo().getSuffix()) | ||
.npi(facility.getDefaultOrderingProvider().getProviderId()) | ||
.street(facility.getDefaultOrderingProvider().getAddress().getStreetOne()) | ||
.streetTwo(facility.getDefaultOrderingProvider().getAddress().getStreetTwo()) | ||
.city(facility.getDefaultOrderingProvider().getAddress().getCity()) | ||
.county(facility.getDefaultOrderingProvider().getAddress().getCounty()) | ||
.state(facility.getDefaultOrderingProvider().getAddress().getState()) | ||
.zipCode(facility.getDefaultOrderingProvider().getAddress().getPostalCode()) | ||
.phone(facility.getDefaultOrderingProvider().getTelephone()) | ||
.build()) | ||
.deviceIds(List.of(deviceId)) | ||
.build()); | ||
|
@@ -135,8 +135,8 @@ void addFacility_withDeviceIds_success() { | |
eq("(555) 867-5309"), | ||
eq("[email protected]"), | ||
deviceIdTypeCaptor.capture(), | ||
eq(facility.getOrderingProvider().getNameInfo()), | ||
eq(facility.getOrderingProvider().getAddress()), | ||
eq(facility.getDefaultOrderingProvider().getNameInfo()), | ||
eq(facility.getDefaultOrderingProvider().getAddress()), | ||
eq("(800) 555-1212"), | ||
eq("DOOOOOOM")); | ||
|
||
|
@@ -173,18 +173,18 @@ void updateFacility_success() { | |
.email(facility.getEmail()) | ||
.orderingProvider( | ||
ProviderInput.builder() | ||
.firstName(facility.getOrderingProvider().getNameInfo().getFirstName()) | ||
.middleName(facility.getOrderingProvider().getNameInfo().getMiddleName()) | ||
.lastName(facility.getOrderingProvider().getNameInfo().getLastName()) | ||
.suffix(facility.getOrderingProvider().getNameInfo().getSuffix()) | ||
.npi(facility.getOrderingProvider().getProviderId()) | ||
.street(facility.getOrderingProvider().getAddress().getStreetOne()) | ||
.streetTwo(facility.getOrderingProvider().getAddress().getStreetTwo()) | ||
.city(facility.getOrderingProvider().getAddress().getCity()) | ||
.county(facility.getOrderingProvider().getAddress().getCounty()) | ||
.state(facility.getOrderingProvider().getAddress().getState()) | ||
.zipCode(facility.getOrderingProvider().getAddress().getPostalCode()) | ||
.phone(facility.getOrderingProvider().getTelephone()) | ||
.firstName(facility.getDefaultOrderingProvider().getNameInfo().getFirstName()) | ||
.middleName(facility.getDefaultOrderingProvider().getNameInfo().getMiddleName()) | ||
.lastName(facility.getDefaultOrderingProvider().getNameInfo().getLastName()) | ||
.suffix(facility.getDefaultOrderingProvider().getNameInfo().getSuffix()) | ||
.npi(facility.getDefaultOrderingProvider().getProviderId()) | ||
.street(facility.getDefaultOrderingProvider().getAddress().getStreetOne()) | ||
.streetTwo(facility.getDefaultOrderingProvider().getAddress().getStreetTwo()) | ||
.city(facility.getDefaultOrderingProvider().getAddress().getCity()) | ||
.county(facility.getDefaultOrderingProvider().getAddress().getCounty()) | ||
.state(facility.getDefaultOrderingProvider().getAddress().getState()) | ||
.zipCode(facility.getDefaultOrderingProvider().getAddress().getPostalCode()) | ||
.phone(facility.getDefaultOrderingProvider().getTelephone()) | ||
.build()) | ||
.deviceIds(List.of(deviceId)) | ||
.build()); | ||
|
@@ -198,8 +198,8 @@ void updateFacility_success() { | |
eq(facility.getAddress()), | ||
eq("(555) 867-5309"), | ||
eq("[email protected]"), | ||
eq(facility.getOrderingProvider().getNameInfo()), | ||
eq(facility.getOrderingProvider().getAddress()), | ||
eq(facility.getDefaultOrderingProvider().getNameInfo()), | ||
eq(facility.getDefaultOrderingProvider().getAddress()), | ||
eq("DOOOOOOM"), | ||
eq("(800) 555-1212"), | ||
deviceIdTypeCaptor.capture()); | ||
|
This file contains 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 |
---|---|---|
|
@@ -90,7 +90,7 @@ void serialize_withFacility_noOrgOrFacility() throws IOException { | |
.facilityAddress(addy) | ||
.phone("555-867-5309") | ||
.email("[email protected]") | ||
.orderingProvider(mccoy) | ||
.defaultOrderingProvider(mccoy) | ||
.defaultDeviceType(device) | ||
.defaultSpecimenType(specimenType) | ||
.configuredDevices(List.of(device)) | ||
|
This file contains 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 |
---|---|---|
|
@@ -46,7 +46,7 @@ void smokeTestDeviceOperations() { | |
.facilityAddress(getAddress()) | ||
.phone("555-867-5309") | ||
.email("[email protected]") | ||
.orderingProvider(mccoy) | ||
.defaultOrderingProvider(mccoy) | ||
.defaultDeviceType(bill) | ||
.defaultSpecimenType(spec) | ||
.configuredDevices(configuredDevices) | ||
|
This file contains 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 |
---|---|---|
|
@@ -536,15 +536,16 @@ void updateFacilityTest() { | |
assertThat(updatedFacility.getEmail()).isEqualTo("[email protected]"); | ||
assertThat(updatedFacility.getAddress()).isEqualTo(newFacilityAddress); | ||
|
||
assertThat(updatedFacility.getOrderingProvider().getNameInfo().getFirstName()) | ||
assertThat(updatedFacility.getDefaultOrderingProvider().getNameInfo().getFirstName()) | ||
.isEqualTo("Bill"); | ||
assertThat(updatedFacility.getOrderingProvider().getNameInfo().getMiddleName()) | ||
assertThat(updatedFacility.getDefaultOrderingProvider().getNameInfo().getMiddleName()) | ||
.isEqualTo("Foo"); | ||
assertThat(updatedFacility.getOrderingProvider().getNameInfo().getLastName()) | ||
assertThat(updatedFacility.getDefaultOrderingProvider().getNameInfo().getLastName()) | ||
.isEqualTo("Nye"); | ||
assertThat(updatedFacility.getOrderingProvider().getNameInfo().getSuffix()).isEqualTo("Jr."); | ||
assertThat(updatedFacility.getOrderingProvider().getProviderId()).isEqualTo("npi"); | ||
assertThat(updatedFacility.getOrderingProvider().getAddress()) | ||
assertThat(updatedFacility.getDefaultOrderingProvider().getNameInfo().getSuffix()) | ||
.isEqualTo("Jr."); | ||
assertThat(updatedFacility.getDefaultOrderingProvider().getProviderId()).isEqualTo("npi"); | ||
assertThat(updatedFacility.getDefaultOrderingProvider().getAddress()) | ||
.isEqualTo(newOrderingProviderAddress); | ||
|
||
assertThat(updatedFacility.getDeviceTypes()).hasSize(2); | ||
|
This file contains 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 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 |
---|---|---|
|
@@ -223,7 +223,7 @@ public static Facility createFacility() { | |
.facilityAddress(getAddress()) | ||
.phone("555-867-5309") | ||
.email("[email protected]") | ||
.orderingProvider(doc) | ||
.defaultOrderingProvider(doc) | ||
.defaultDeviceType(deviceType) | ||
.defaultSpecimenType(specimenType) | ||
.configuredDevices(List.of(deviceType)) | ||
|
This file contains 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 |
---|---|---|
|
@@ -228,7 +228,7 @@ public Facility createValidFacility( | |
.facilityAddress(facilityStreetAddress) | ||
.phone("555-867-5309") | ||
.email("[email protected]") | ||
.orderingProvider(doc) | ||
.defaultOrderingProvider(doc) | ||
.defaultDeviceType(defaultDevice) | ||
.defaultSpecimenType(defaultSpecimen) | ||
.configuredDevices(configuredDevices) | ||
|