Skip to content

Update Db2Adapter.createFhirSchemas to succeed when schemas exist#520

Merged
lmsurpre merged 4 commits intomasterfrom
lee-master
Dec 19, 2019
Merged

Update Db2Adapter.createFhirSchemas to succeed when schemas exist#520
lmsurpre merged 4 commits intomasterfrom
lee-master

Conversation

@lmsurpre
Copy link
Copy Markdown
Member

Without this, the step always fails if you've already created a schema
on this db because FHIR_ADMIN already exists. Now it will succeed but
print a WARNING to indicate it already existed.

  1. introduced DuplicateNameException and a corresponding helper to
    identify when schema creation fails due to the schema already existing

  2. renamed DuplicateValueException to UniquenessViolationException to
    avoid confusion with DuplicateNameException

  3. updated Db2Adapter to catch the DuplicateNameException and WARN
    instead of failing

Also added log statement at the end of tenant creation so that you don't
need to scroll to the very top of the output to find the generated key

Signed-off-by: Lee Surprenant lmsurpre@us.ibm.com

Its simply not used any more, so its silly to keep creating it.

I also removed the `resourceName` concept from both the Audit Context
object and also the FHIRConfiguration config props.

In the future, I'd also like to remove the undocumented
`fhirServer/audit/patientIdExtensionUrl` config property, but that one
wasn't quite as clean to remove right now...we need to think through
whether/how to include the data subject (e.g. Patient) identifier in the
audit log in a more FHIR-native way.

Finally, I included some unrelated minor updates to the
`fhir-persistence-schema` README.md; now the examples all use the
`default` tenant...this is the simplest option because otherwise
everyone needs to understand our tenancy model just to get something
working on Db2.

Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com>
Without this, the step always fails if you've already created a schema
on this db because FHIR_ADMIN already exists. Now it will succeed but
print a WARNING to indicate it already existed.

1. introduced DuplicateNameException and a corresponding helper to
identify when schema creation fails due to the schema already existing

2. renamed DuplicateValueException to UniquenessViolationException to
avoid confusion with DuplicateNameException

3. updated Db2Adapter to catch the DuplicateNameException and WARN
instead of failing

Also added log statement at the end of tenant creation so that you don't
need to scroll to the very top of the output to find the generated key

Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com>
@lmsurpre lmsurpre requested review from JohnTimm and prb112 December 19, 2019 04:39
issue #518 - remove audit db from default config
@prb112
Copy link
Copy Markdown
Contributor

prb112 commented Dec 19, 2019

interesting, the fhir-audit changes are in the PR.

@lmsurpre
Copy link
Copy Markdown
Member Author

lmsurpre commented Dec 19, 2019

interesting, the fhir-audit changes are in the PR.

Sorry, that was just a bit lazy on my part. I created this PR first, then branched and did those changes on top of these. Then, instead of cherry-picking it to a new branch from master, I just opened that PR against this one. Just disregard those changes since you already reviewed them (and keep in mind they aren't in master until we merge this one).

Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com>
Copy link
Copy Markdown
Contributor

@prb112 prb112 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@lmsurpre lmsurpre merged commit 50a93fa into master Dec 19, 2019
@lmsurpre lmsurpre deleted the lee-master branch December 19, 2019 13:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants