-
Notifications
You must be signed in to change notification settings - Fork 67
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
Add correlation id as option for grouping measurements #47
Conversation
… query property of ARM templates * Add ability to extract correlation id to JsonPathContentTemplate * Add tests for extraction logic
…ationIdNotDefinedException with id not set * Add CorrelationIdNotDefinedException to telemetry processor as a known non-recoverable error. * Add unit tests for new observation groups and observation group factories.
...soft.Health.Fhir.Ingest.UnitTests/Data/CorrelationMeasurementObservationGroupFactoryTests.cs
Outdated
Show resolved
Hide resolved
…rval hasn't changed. This is to ensure no backwards breaking changes.
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.
Please update the Configuration document with information on correlationId.
…at includes data to be created and information about the existing observation.
* Add ability to update the period of observation if the merged values our outside the current period. * Add unit tests for observation period update scenario.
…d period when merging data. Old period will now be used and tests updated. * Updated SampledDataFhirValueProcessor to use values from existing observation when merging sample data. Tests updated.
|
||
public TimePeriodMeasurementObservationGroup((DateTime Start, DateTime End) boundary) | ||
{ | ||
_bondary = boundary; |
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.
Do we need a null check here?
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.
No, it is a value type, can never be null. The implicit tuple syntax i.e. ( , ) is compiled as a struct.
correlationId = GetCorrelationId(token); | ||
EnsureArg.IsNotNull(correlationId, nameof(correlationId)); | ||
} | ||
|
||
var measurement = new Measurement | ||
{ | ||
DeviceId = deviceId, | ||
OccurrenceTimeUtc = timestamp.Value, | ||
Type = TypeName, | ||
PatientId = GetPatientId(token), |
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.
Should we treat PatientId and EncounterId the same as CorrelationId? Where if there is an expression defined we require the value in the message?
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 was something I considered but it would change existing behavior. Right now the values will be normalized and then generate specific errors in the FHIR conversion side that will be logged in App Insights.
…ead of data period during create to future proof. Right now they would always be the same. * Fix issue in SampledDataProcessor were the last value was omitted from the stream if it was on the end boundary. Never hit before because the hourly and daily time periods would end on the time boundary - 1 ms.
Added documentation. |
Add an optional correlation id for grouping measurements to create observations in FHIR.
When a template is set to the new ObservationPeriodInterval = CorrelationId all measurements for a given device, type, and correlation id will share the same observation in FHIR. This overrides the traditional time based grouping like hourly or daily.
In order to use the feature the device messages need to supply a correlation id that is then extracted with the via the CorrelationIdExpression property added to the Json & Iot templates.