Skip to content

Commit

Permalink
Merge pull request #2948 from IBM/issue-713
Browse files Browse the repository at this point in the history
Avoid creating unnecessary tables for Resource and DomainResource resource types #713
  • Loading branch information
prb112 authored Nov 9, 2021
2 parents 230c754 + a2521f2 commit db6813d
Show file tree
Hide file tree
Showing 21 changed files with 622 additions and 126 deletions.
6 changes: 3 additions & 3 deletions build/audit/kafka/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,15 @@ services:
command: bash -c "
java -jar /opt/ibm-fhir-server/tools/fhir-persistence-schema-*-cli.jar
--db-type derby --prop db.database=/output/derby/profile --prop db.create=Y
--prop resourceTypes=Patient,Group,Practitioner,PractitionerRole,Person,RelatedPerson,Organization,Location,Observation,MedicationAdministration,StructureDefinition,ElementDefinition,CodeSystem,ValueSet,Resource
--prop resourceTypes=Patient,Group,Practitioner,PractitionerRole,Person,RelatedPerson,Organization,Location,Observation,MedicationAdministration,StructureDefinition,ElementDefinition,CodeSystem,ValueSet
--update-schema &&
java -jar /opt/ibm-fhir-server/tools/fhir-persistence-schema-*-cli.jar
--db-type derby --prop db.database=/output/derby/reference --prop db.create=Y
--prop resourceTypes=Patient,Group,Practitioner,PractitionerRole,Device,Organization,Location,Medication,Observation,MedicationAdministration,StructureDefinition,ElementDefinition,CodeSystem,ValueSet,Resource
--prop resourceTypes=Patient,Group,Practitioner,PractitionerRole,Device,Organization,Location,Medication,Observation,MedicationAdministration,StructureDefinition,ElementDefinition,CodeSystem,ValueSet
--update-schema &&
java -jar /opt/ibm-fhir-server/tools/fhir-persistence-schema-*-cli.jar
--db-type derby --prop db.database=/output/derby/study1 --prop db.create=Y
--prop resourceTypes=Patient,Group,Practitioner,PractitionerRole,Device,Organization,Location,Encounter,AllergyIntolerance,Observation,Condition,CarePlan,Provenance,Medication,MedicationAdministration,StructureDefinition,ElementDefinition,CodeSystem,ValueSet,Resource
--prop resourceTypes=Patient,Group,Practitioner,PractitionerRole,Device,Organization,Location,Encounter,AllergyIntolerance,Observation,Condition,CarePlan,Provenance,Medication,MedicationAdministration,StructureDefinition,ElementDefinition,CodeSystem,ValueSet
--update-schema &&
/opt/ol/wlp/bin/server run"
healthcheck:
Expand Down
6 changes: 3 additions & 3 deletions build/derby-bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ java -jar ${WORKSPACE}/fhir-persistence-schema/target/fhir-persistence-schema-*-
--update-schema
java -jar ${WORKSPACE}/fhir-persistence-schema/target/fhir-persistence-schema-*-cli.jar \
--db-type derby --prop db.database=${DB_LOC}/profile --prop db.create=Y \
--prop resourceTypes=Patient,Group,Practitioner,PractitionerRole,Person,RelatedPerson,Organization,Location,Observation,MedicationAdministration,StructureDefinition,ElementDefinition,CodeSystem,ValueSet,Resource \
--prop resourceTypes=Patient,Group,Practitioner,PractitionerRole,Person,RelatedPerson,Organization,Location,Observation,MedicationAdministration,StructureDefinition,ElementDefinition,CodeSystem,ValueSet \
--update-schema
java -jar ${WORKSPACE}/fhir-persistence-schema/target/fhir-persistence-schema-*-cli.jar \
--db-type derby --prop db.database=${DB_LOC}/reference --prop db.create=Y \
--prop resourceTypes=Patient,Group,Practitioner,PractitionerRole,Device,Organization,Location,Medication,Observation,MedicationAdministration,StructureDefinition,ElementDefinition,CodeSystem,ValueSet,Resource \
--prop resourceTypes=Patient,Group,Practitioner,PractitionerRole,Device,Organization,Location,Medication,Observation,MedicationAdministration,StructureDefinition,ElementDefinition,CodeSystem,ValueSet \
--update-schema
java -jar ${WORKSPACE}/fhir-persistence-schema/target/fhir-persistence-schema-*-cli.jar \
--db-type derby --prop db.database=${DB_LOC}/study1 --prop db.create=Y \
--prop resourceTypes=Patient,Group,Practitioner,PractitionerRole,Device,Organization,Location,Encounter,AllergyIntolerance,Observation,Condition,CarePlan,Provenance,Medication,MedicationAdministration,StructureDefinition,ElementDefinition,CodeSystem,ValueSet,Resource \
--prop resourceTypes=Patient,Group,Practitioner,PractitionerRole,Device,Organization,Location,Encounter,AllergyIntolerance,Observation,Condition,CarePlan,Provenance,Medication,MedicationAdministration,StructureDefinition,ElementDefinition,CodeSystem,ValueSet \
--update-schema
6 changes: 3 additions & 3 deletions build/docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,15 @@ services:
command: bash -c "
java -jar /opt/ibm-fhir-server/tools/fhir-persistence-schema-*-cli.jar
--db-type derby --prop db.database=/output/derby/profile --prop db.create=Y
--prop resourceTypes=Patient,Group,Practitioner,PractitionerRole,Person,RelatedPerson,Organization,Location,Observation,MedicationAdministration,StructureDefinition,ElementDefinition,CodeSystem,ValueSet,Resource
--prop resourceTypes=Patient,Group,Practitioner,PractitionerRole,Person,RelatedPerson,Organization,Location,Observation,MedicationAdministration,StructureDefinition,ElementDefinition,CodeSystem,ValueSet
--update-schema &&
java -jar /opt/ibm-fhir-server/tools/fhir-persistence-schema-*-cli.jar
--db-type derby --prop db.database=/output/derby/reference --prop db.create=Y
--prop resourceTypes=Patient,Group,Practitioner,PractitionerRole,Device,Organization,Location,Medication,Observation,MedicationAdministration,StructureDefinition,ElementDefinition,CodeSystem,ValueSet,Resource
--prop resourceTypes=Patient,Group,Practitioner,PractitionerRole,Device,Organization,Location,Medication,Observation,MedicationAdministration,StructureDefinition,ElementDefinition,CodeSystem,ValueSet
--update-schema &&
java -jar /opt/ibm-fhir-server/tools/fhir-persistence-schema-*-cli.jar
--db-type derby --prop db.database=/output/derby/study1 --prop db.create=Y
--prop resourceTypes=Patient,Group,Practitioner,PractitionerRole,Device,Organization,Location,Encounter,AllergyIntolerance,Observation,Condition,CarePlan,Provenance,Medication,MedicationAdministration,StructureDefinition,ElementDefinition,CodeSystem,ValueSet,Resource
--prop resourceTypes=Patient,Group,Practitioner,PractitionerRole,Device,Organization,Location,Encounter,AllergyIntolerance,Observation,Condition,CarePlan,Provenance,Medication,MedicationAdministration,StructureDefinition,ElementDefinition,CodeSystem,ValueSet
--update-schema &&
/opt/ol/wlp/bin/server run"
healthcheck:
Expand Down
8 changes: 4 additions & 4 deletions build/migration/db2/4_current-migrate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,19 +56,19 @@ java -jar ${WORKSPACE}/fhir/fhir-persistence-schema/target/fhir-persistence-sche
--update-schema
java -jar ${WORKSPACE}/fhir/fhir-persistence-schema/target/fhir-persistence-schema-*-cli.jar \
--db-type derby --prop db.database=${DB_LOC}/profile --prop db.create=Y \
--prop resourceTypes=Patient,Group,Practitioner,PractitionerRole,Person,RelatedPerson,Organization,Location,Observation,MedicationAdministration,StructureDefinition,ElementDefinition,CodeSystem,ValueSet,Resource \
--prop resourceTypes=Patient,Group,Practitioner,PractitionerRole,Person,RelatedPerson,Organization,Location,Observation,MedicationAdministration,StructureDefinition,ElementDefinition,CodeSystem,ValueSet \
--update-schema
java -jar ${WORKSPACE}/fhir/fhir-persistence-schema/target/fhir-persistence-schema-*-cli.jar \
--db-type derby --prop db.database=${DB_LOC}/reference --prop db.create=Y \
--prop resourceTypes=Patient,Group,Practitioner,PractitionerRole,Device,Organization,Location,Medication,Observation,MedicationAdministration,StructureDefinition,ElementDefinition,CodeSystem,ValueSet,Resource \
--prop resourceTypes=Patient,Group,Practitioner,PractitionerRole,Device,Organization,Location,Medication,Observation,MedicationAdministration,StructureDefinition,ElementDefinition,CodeSystem,ValueSet \
--update-schema
java -jar ${WORKSPACE}/fhir/fhir-persistence-schema/target/fhir-persistence-schema-*-cli.jar \
--db-type derby --prop db.database=${DB_LOC}/study1 --prop db.create=Y \
--prop resourceTypes=Patient,Group,Practitioner,PractitionerRole,Device,Organization,Location,Encounter,AllergyIntolerance,Observation,Condition,CarePlan,Provenance,Medication,MedicationAdministration,StructureDefinition,ElementDefinition,CodeSystem,ValueSet,Resource \
--prop resourceTypes=Patient,Group,Practitioner,PractitionerRole,Device,Organization,Location,Encounter,AllergyIntolerance,Observation,Condition,CarePlan,Provenance,Medication,MedicationAdministration,StructureDefinition,ElementDefinition,CodeSystem,ValueSet \
--update-schema

# Reset to Original Directory
popd > /dev/null

# EOF
###############################################################################
###############################################################################
8 changes: 4 additions & 4 deletions build/migration/postgres/4_current-migrate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -70,19 +70,19 @@ java -jar ${WORKSPACE}/fhir/fhir-persistence-schema/target/fhir-persistence-sche
--update-schema
java -jar ${WORKSPACE}/fhir/fhir-persistence-schema/target/fhir-persistence-schema-*-cli.jar \
--db-type derby --prop db.database=${DB_LOC}/profile --prop db.create=Y \
--prop resourceTypes=Patient,Group,Practitioner,PractitionerRole,Person,RelatedPerson,Organization,Location,Observation,MedicationAdministration,StructureDefinition,ElementDefinition,CodeSystem,ValueSet,Resource \
--prop resourceTypes=Patient,Group,Practitioner,PractitionerRole,Person,RelatedPerson,Organization,Location,Observation,MedicationAdministration,StructureDefinition,ElementDefinition,CodeSystem,ValueSet \
--update-schema
java -jar ${WORKSPACE}/fhir/fhir-persistence-schema/target/fhir-persistence-schema-*-cli.jar \
--db-type derby --prop db.database=${DB_LOC}/reference --prop db.create=Y \
--prop resourceTypes=Patient,Group,Practitioner,PractitionerRole,Device,Organization,Location,Medication,Observation,MedicationAdministration,StructureDefinition,ElementDefinition,CodeSystem,ValueSet,Resource \
--prop resourceTypes=Patient,Group,Practitioner,PractitionerRole,Device,Organization,Location,Medication,Observation,MedicationAdministration,StructureDefinition,ElementDefinition,CodeSystem,ValueSet \
--update-schema
java -jar ${WORKSPACE}/fhir/fhir-persistence-schema/target/fhir-persistence-schema-*-cli.jar \
--db-type derby --prop db.database=${DB_LOC}/study1 --prop db.create=Y \
--prop resourceTypes=Patient,Group,Practitioner,PractitionerRole,Device,Organization,Location,Encounter,AllergyIntolerance,Observation,Condition,CarePlan,Provenance,Medication,MedicationAdministration,StructureDefinition,ElementDefinition,CodeSystem,ValueSet,Resource \
--prop resourceTypes=Patient,Group,Practitioner,PractitionerRole,Device,Organization,Location,Encounter,AllergyIntolerance,Observation,Condition,CarePlan,Provenance,Medication,MedicationAdministration,StructureDefinition,ElementDefinition,CodeSystem,ValueSet \
--update-schema

# Reset to Original Directory
popd > /dev/null

# EOF
###############################################################################
###############################################################################
6 changes: 3 additions & 3 deletions build/notifications/kafka/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,15 @@ services:
command: bash -c "
java -jar /opt/ibm-fhir-server/tools/fhir-persistence-schema-*-cli.jar
--db-type derby --prop db.database=/output/derby/profile --prop db.create=Y
--prop resourceTypes=Patient,Group,Practitioner,PractitionerRole,Person,RelatedPerson,Organization,Location,Observation,MedicationAdministration,StructureDefinition,ElementDefinition,CodeSystem,ValueSet,Resource
--prop resourceTypes=Patient,Group,Practitioner,PractitionerRole,Person,RelatedPerson,Organization,Location,Observation,MedicationAdministration,StructureDefinition,ElementDefinition,CodeSystem,ValueSet
--update-schema &&
java -jar /opt/ibm-fhir-server/tools/fhir-persistence-schema-*-cli.jar
--db-type derby --prop db.database=/output/derby/reference --prop db.create=Y
--prop resourceTypes=Patient,Group,Practitioner,PractitionerRole,Device,Organization,Location,Medication,Observation,MedicationAdministration,StructureDefinition,ElementDefinition,CodeSystem,ValueSet,Resource
--prop resourceTypes=Patient,Group,Practitioner,PractitionerRole,Device,Organization,Location,Medication,Observation,MedicationAdministration,StructureDefinition,ElementDefinition,CodeSystem,ValueSet
--update-schema &&
java -jar /opt/ibm-fhir-server/tools/fhir-persistence-schema-*-cli.jar
--db-type derby --prop db.database=/output/derby/study1 --prop db.create=Y
--prop resourceTypes=Patient,Group,Practitioner,PractitionerRole,Device,Organization,Location,Encounter,AllergyIntolerance,Observation,Condition,CarePlan,Provenance,Medication,MedicationAdministration,StructureDefinition,ElementDefinition,CodeSystem,ValueSet,Resource
--prop resourceTypes=Patient,Group,Practitioner,PractitionerRole,Device,Organization,Location,Encounter,AllergyIntolerance,Observation,Condition,CarePlan,Provenance,Medication,MedicationAdministration,StructureDefinition,ElementDefinition,CodeSystem,ValueSet
--update-schema &&
/opt/ol/wlp/bin/server run"
healthcheck:
Expand Down
6 changes: 3 additions & 3 deletions build/persistence/postgres/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,15 @@ services:
command: bash -c "
java -jar /opt/ibm-fhir-server/tools/fhir-persistence-schema-*-cli.jar
--db-type derby --prop db.database=/output/derby/profile --prop db.create=Y
--prop resourceTypes=Patient,Group,Practitioner,PractitionerRole,Person,RelatedPerson,Organization,Location,Observation,MedicationAdministration,StructureDefinition,ElementDefinition,CodeSystem,ValueSet,Resource
--prop resourceTypes=Patient,Group,Practitioner,PractitionerRole,Person,RelatedPerson,Organization,Location,Observation,MedicationAdministration,StructureDefinition,ElementDefinition,CodeSystem,ValueSet
--update-schema &&
java -jar /opt/ibm-fhir-server/tools/fhir-persistence-schema-*-cli.jar
--db-type derby --prop db.database=/output/derby/reference --prop db.create=Y
--prop resourceTypes=Patient,Group,Practitioner,PractitionerRole,Device,Organization,Location,Medication,Observation,MedicationAdministration,StructureDefinition,ElementDefinition,CodeSystem,ValueSet,Resource
--prop resourceTypes=Patient,Group,Practitioner,PractitionerRole,Device,Organization,Location,Medication,Observation,MedicationAdministration,StructureDefinition,ElementDefinition,CodeSystem,ValueSet
--update-schema &&
java -jar /opt/ibm-fhir-server/tools/fhir-persistence-schema-*-cli.jar
--db-type derby --prop db.database=/output/derby/study1 --prop db.create=Y
--prop resourceTypes=Patient,Group,Practitioner,PractitionerRole,Device,Organization,Location,Encounter,AllergyIntolerance,Observation,Condition,CarePlan,Provenance,Medication,MedicationAdministration,StructureDefinition,ElementDefinition,CodeSystem,ValueSet,Resource
--prop resourceTypes=Patient,Group,Practitioner,PractitionerRole,Device,Organization,Location,Encounter,AllergyIntolerance,Observation,Condition,CarePlan,Provenance,Medication,MedicationAdministration,StructureDefinition,ElementDefinition,CodeSystem,ValueSet
--update-schema &&
/opt/ol/wlp/bin/server run"
healthcheck:
Expand Down
6 changes: 3 additions & 3 deletions build/pre-integration-test.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,15 @@ java -jar $SCHEMATOOL `
--update-schema
java -jar $SCHEMATOOL `
--db-type derby --prop db.database=${DB_LOC}\profile --prop db.create=Y `
--prop resourceTypes=Patient,Group,Practitioner,PractitionerRole,Person,RelatedPerson,Organization,Location,Observation,MedicationAdministration,StructureDefinition,ElementDefinition,CodeSystem,ValueSet,Resource `
--prop resourceTypes=Patient,Group,Practitioner,PractitionerRole,Person,RelatedPerson,Organization,Location,Observation,MedicationAdministration,StructureDefinition,ElementDefinition,CodeSystem,ValueSet `
--update-schema
java -jar $SCHEMATOOL `
--db-type derby --prop db.database=${DB_LOC}\reference --prop db.create=Y `
--prop resourceTypes=Patient,Group,Practitioner,PractitionerRole,Device,Organization,Location,Medication,Observation,MedicationAdministration,StructureDefinition,ElementDefinition,CodeSystem,ValueSet,Resource `
--prop resourceTypes=Patient,Group,Practitioner,PractitionerRole,Device,Organization,Location,Medication,Observation,MedicationAdministration,StructureDefinition,ElementDefinition,CodeSystem,ValueSet `
--update-schema
java -jar $SCHEMATOOL `
--db-type derby --prop db.database=${DB_LOC}\study1 --prop db.create=Y `
--prop resourceTypes=Patient,Group,Practitioner,PractitionerRole,Device,Organization,Location,Encounter,AllergyIntolerance,Observation,Condition,CarePlan,Provenance,Medication,MedicationAdministration,StructureDefinition,ElementDefinition,CodeSystem,ValueSet,Resource `
--prop resourceTypes=Patient,Group,Practitioner,PractitionerRole,Device,Organization,Location,Encounter,AllergyIntolerance,Observation,Condition,CarePlan,Provenance,Medication,MedicationAdministration,StructureDefinition,ElementDefinition,CodeSystem,ValueSet `
--update-schema

# If the Config Exists, let's wipe it outfind
Expand Down
6 changes: 3 additions & 3 deletions build/pre-integration-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,15 @@ java -jar ${SIT}/fhir-server-dist/tools/fhir-persistence-schema-*-cli.jar \
--update-schema
java -jar ${SIT}/fhir-server-dist/tools/fhir-persistence-schema-*-cli.jar \
--db-type derby --prop db.database=${DB_LOC}/profile --prop db.create=Y \
--prop resourceTypes=Patient,Group,Practitioner,PractitionerRole,Person,RelatedPerson,Organization,Location,Observation,MedicationAdministration,StructureDefinition,ElementDefinition,CodeSystem,ValueSet,Resource \
--prop resourceTypes=Patient,Group,Practitioner,PractitionerRole,Person,RelatedPerson,Organization,Location,Observation,MedicationAdministration,StructureDefinition,ElementDefinition,CodeSystem,ValueSet \
--update-schema
java -jar ${SIT}/fhir-server-dist/tools/fhir-persistence-schema-*-cli.jar \
--db-type derby --prop db.database=${DB_LOC}/reference --prop db.create=Y \
--prop resourceTypes=Patient,Group,Practitioner,PractitionerRole,Device,Organization,Location,Medication,Observation,MedicationAdministration,StructureDefinition,ElementDefinition,CodeSystem,ValueSet,Resource \
--prop resourceTypes=Patient,Group,Practitioner,PractitionerRole,Device,Organization,Location,Medication,Observation,MedicationAdministration,StructureDefinition,ElementDefinition,CodeSystem,ValueSet \
--update-schema
java -jar ${SIT}/fhir-server-dist/tools/fhir-persistence-schema-*-cli.jar \
--db-type derby --prop db.database=${DB_LOC}/study1 --prop db.create=Y \
--prop resourceTypes=Patient,Group,Practitioner,PractitionerRole,Device,Organization,Location,Encounter,AllergyIntolerance,Observation,Condition,CarePlan,Provenance,Medication,MedicationAdministration,StructureDefinition,ElementDefinition,CodeSystem,ValueSet,Resource \
--prop resourceTypes=Patient,Group,Practitioner,PractitionerRole,Device,Organization,Location,Encounter,AllergyIntolerance,Observation,Condition,CarePlan,Provenance,Medication,MedicationAdministration,StructureDefinition,ElementDefinition,CodeSystem,ValueSet \
--update-schema

echo "Copying configuration to install location..."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@
*/
public class Db2CatalogAccess implements ICatalogAccess {
private static final Logger logger = Logger.getLogger(Db2CatalogAccess.class.getName());

private Connection connection;
private Db2CatalogDAO dao = new Db2CatalogDAO(new Db2Translator());

public Db2CatalogAccess(Connection c) {
this.connection = c;
}

@Override
public List<PartitionInfo> getPartitionList(String schema, String table) {
try {
Expand Down
Loading

0 comments on commit db6813d

Please sign in to comment.