-
Notifications
You must be signed in to change notification settings - Fork 518
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
new import tool #3182
new import tool #3182
Conversation
tools/ImporterV2/ImporterV2.cs
Outdated
|
||
namespace Microsoft.Health.Fhir.ImporterV2 | ||
{ | ||
internal static class ImporterV2 |
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.
tools/ImporterV2/App.config
Outdated
<add key="grant_type" value="Client_Credentials" /> | ||
<add key="client_id" value="{add your client id}" /> | ||
<add key="client_secret" value="{add your client secret}" /> | ||
<add key="resource" value="{add your FHIR endpoint}" /> |
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.
Why it is not jus a connection string?
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.
It uses the connection string for getting the blob container and lines 25-28 in the app.config for getting the auth token needed for $import status. Please let me know if I'm misunderstanding your question.
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.
Will it work the same way for OSS FHIR?
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.
🕐
tools/ImporterV2/readme.md
Outdated
1. It can monitor a long running $import job by polling the status. Simply provide the MonitorImportStatusEndpoint and the token fields in the config file. | ||
Note that when this field is supplied then no other operation can be performed. Meaning you can't concurrently POST an $import. | ||
Consequently when this setting is empty then the tool looks to POST an $import job. | ||
2. Run an $import job by consuming ndjson blob files from the configured container and posting them to an OSS endpoint. |
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.
tools/ImporterV2/readme.md
Outdated
Note that when this field is supplied then no other operation can be performed. Meaning you can't concurrently POST an $import. | ||
Consequently when this setting is empty then the tool looks to POST an $import job. | ||
2. Run an $import job by consuming ndjson blob files from the configured container and posting them to an OSS endpoint. | ||
3. Run an $import job by consuming ndjson blob files from the configured container and posting them to a Paas endpoint. |
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.
tools/ImporterV2/readme.md
Outdated
When running FHIR OSS be sure to have these configuration settings in the portal: | ||
FhirServer__Operations__Import__Enabled = True | ||
FhirServer__Operations__Import__InitialImportMode = True | ||
FhirServer__Operations__Import__StorageAccountConnection = your_storageaccount_access_key_connection_string |
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.
tools/ImporterV2/readme.md
Outdated
FhirServer__Operations__IntegrationDataStore__StorageAccountConnection = your_storageaccount_access_key_connection_string | ||
|
||
**You may need to remove this setting to get import to work** | ||
FhirServer__Operations__IntegrationDataStore__StorageAccountUri |
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.
Can you test with leaving this setting and see if this still work?
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.
This needs to be removed, so I'll update the comment stating so.
tools/ImporterV2/App.config
Outdated
the type of files it'll search for in the container | ||
do not add a file extension as ndjson is assumed and added to the ResourceType automatically | ||
--> | ||
<add key="ResourceType" value="Observation" /> |
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.
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.
I updated the comment stating that leaving this empty will search all.
tools/ImporterV2/App.config
Outdated
of course this can be a much larger value than 20 so adjust as needed | ||
--> | ||
<add key="NumberOfBlobsForImport" value="20" /> | ||
<add key="FhirEndpoint" value="{add your FHIR endpoint}" /> |
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.
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.
I have removed this one
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.
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.
private static readonly string TokenEndpoint = ConfigurationManager.AppSettings["TokenEndpoint"] ?? string.Empty; | ||
private static readonly string TokenGrantType = ConfigurationManager.AppSettings["grant_type"] ?? string.Empty; | ||
private static readonly string TokenClientId = ConfigurationManager.AppSettings["client_id"] ?? string.Empty; | ||
private static readonly string TokenClientSecret = ConfigurationManager.AppSettings["client_secret"] ?? string.Empty; | ||
private static readonly string TokenResource = ConfigurationManager.AppSettings["FhirEndpoint"] ?? string.Empty; | ||
private static readonly string ResourceType = ConfigurationManager.AppSettings["ResourceType"] ?? string.Empty; | ||
private static readonly string ContainerName = ConfigurationManager.AppSettings["ContainerName"] ?? string.Empty; | ||
private static readonly string ConnectionString = ConfigurationManager.AppSettings["ConnectionString"] ?? string.Empty; | ||
private static readonly string FhirEndpoint = TokenResource; | ||
private static readonly int NumberOfBlobsForImport = int.Parse(ConfigurationManager.AppSettings["NumberOfBlobsForImport"] ?? "1"); | ||
private static readonly TimeSpan ImportStatusDelay = TimeSpan.Parse(ConfigurationManager.AppSettings["ImportStatusDelay"]); |
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.
When there are this many properties, could we just bind to a configuration object? I think it would simplify all this a lot
private static readonly int NumberOfBlobsForImport = int.Parse(ConfigurationManager.AppSettings["NumberOfBlobsForImport"] ?? "1"); | ||
private static readonly TimeSpan ImportStatusDelay = TimeSpan.Parse(ConfigurationManager.AppSettings["ImportStatusDelay"]); | ||
private static readonly HttpClient HttpClient = new(); | ||
private static BlobContainerClient s_blobContainerClientSource; |
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.
Why are we getting s_
in here? Can we check the right code style is getting applied
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.
The code style is referencing the same file as all other projects.
The IDE will flag warnings or errors as you can see in the screenshot. This is not unique to this project as far as warnings go. There are actually countless examples already that violate this IDE1006 rule if a field is private static and not readonly.
<PropertyGroup> | ||
<OutputType>Exe</OutputType> | ||
<AssemblyName>Fhir.RegisterAndMonitorImport</AssemblyName> | ||
<RootNamespace>Microsoft.Health.Fhir.RegisterAndMonitorImport</RootNamespace> |
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.
Microsoft.Health.Internal...
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.
* new import tool * revised app.config * Revised based on code review * revisions to handle oss; code cleanup * updated readme to assist oss usage; added config setting for delay when getting import status * revisions from code review * final code review revisions * changes from code review * Adding one additional comment for clarify
Description
This adds an import tool for use with either fhir oss or paas. It can also monitor the status of an ongoing import.
Read the readme.md file for a complete description of what this can do.
Related issues
Addresses [issue #].
Testing
It was tested while importing more than 1 TB of data to a fhir endpoint.
FHIR Team Checklist
Semver Change (docs)
Patch|Skip|Feature|Breaking (reason)