Skip to content
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

Changes of incremental import billing #3354

Merged
merged 4 commits into from
Jun 19, 2023

Conversation

rajithaalurims
Copy link
Contributor

Description

Changes to add billing to incremental import.
ImportJobMetricsNotification needs to be published with ImportMode information so on Health PaaS side, we will know to bill the import requests or not. This PR has changes to add ImportMode in the notification that will be handled in Handler that is on HP side.

Related issues

Addresses [issue 103222].

Testing

Unit tests added

FHIR Team Checklist

  • Update the title of the PR to be succinct and less than 65 characters
  • Add a milestone to the PR for the sprint that it is merged (i.e. add S47)
  • Tag the PR with the type of update: Bug, Build, Dependencies, Enhancement, New-Feature or Documentation
  • Tag the PR with Open source, Azure API for FHIR (CosmosDB or common code) or Azure Healthcare APIs (SQL or common code) to specify where this change is intended to be released.
  • CI is green before merge Build Status
  • Review squash-merge requirements

Semver Change (docs)

Patch|Skip|Feature|Breaking (reason)

@rajithaalurims rajithaalurims added Enhancement Enhancement on existing functionality. Azure Healthcare APIs Label denotes that the issue or PR is relevant to the FHIR service in the Azure Healthcare APIs labels Jun 15, 2023
@rajithaalurims rajithaalurims added this to the S117 milestone Jun 15, 2023
@rajithaalurims rajithaalurims requested a review from a team as a code owner June 15, 2023 18:07
@@ -145,6 +146,103 @@ public async Task GivenIncrementalLoad_MultipleInputVersions_ResourceNotExisting
Assert.Equal(GetLastUpdated("2002"), result.Resource.Meta.LastUpdated);
}

[Fact]
public async Task GivenIncrementalImportInvalidResource_ThenErrorLogsShouldBeOutput_FailedRCountShouldMatch()
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nit: Is the R in the test title a typo or suppose to be the work Resource? Also, the test name should be in Given/When/Then format.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@LTA-Thinking Yes, type. Changed to GivenIncrementalImportInvalidResource__WhenImportData_ThenErrorLogsShouldBeOutputAndFailedCountShouldMatch.

/// <summary>
/// Import mode.
/// </summary>
public ImportMode ImportMode { get; set; }
Copy link
Contributor

@SergeyGaluzo SergeyGaluzo Jun 16, 2023

Choose a reason for hiding this comment

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

Please do not add ImportMode here as it is available in the job Definition

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@SergeyGaluzo removed

@SergeyGaluzo
Copy link
Contributor

SergeyGaluzo commented Jun 16, 2023

    private async Task SendImportMetricsNotification(JobStatus jobStatus, JobInfo jobInfo, ImportOrchestratorJobResult currentResult)

JobInfo contains Status, Result and Definition. Looks some parameters are redundant.


Refers to: src/Microsoft.Health.Fhir.SqlServer/Features/Operations/Import/ImportOrchestratorJob.cs:268 in c55f771. [](commit_id = c55f771, deletion_comment = False)


public int CreatedJobCount { get; set; } // TODO: remove in stage 3

public long? TotalSizeInBytes { get; set; } // TODO: remove in stage 3
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Any reason you did not remove these 2?

SergeyGaluzo
SergeyGaluzo previously approved these changes Jun 16, 2023
Copy link
Contributor

@SergeyGaluzo SergeyGaluzo left a comment

Choose a reason for hiding this comment

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

:shipit:

LTA-Thinking
LTA-Thinking previously approved these changes Jun 16, 2023
@rajithaalurims rajithaalurims merged commit 7d60b61 into main Jun 19, 2023
@rajithaalurims rajithaalurims deleted the personal/rajitha/biling-incremental-import branch June 19, 2023 20:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Azure Healthcare APIs Label denotes that the issue or PR is relevant to the FHIR service in the Azure Healthcare APIs Enhancement Enhancement on existing functionality.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants