Skip to content

Commit

Permalink
Merge branch 'master' into experience/14238/integrate-pagination-api-…
Browse files Browse the repository at this point in the history
…daily-data
  • Loading branch information
etanb committed Jul 31, 2024
2 parents b49e256 + dfa6cf6 commit 2dc22c9
Show file tree
Hide file tree
Showing 9 changed files with 71 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/sonarcloud.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:

- name: "Get changed files with yaml"
id: changed-files-yaml
uses: tj-actions/changed-files@6b2903bdce6310cfbddd87c418f253cf29b2dec9
uses: tj-actions/changed-files@c65cd883420fd2eb864698a825fc4162dd94482c
with:
files_yaml: |
frontend:
Expand Down
31 changes: 31 additions & 0 deletions prime-router/docs/observability/azure-events.md
Original file line number Diff line number Diff line change
Expand Up @@ -254,3 +254,34 @@ customEvents
| summarize count() by conditionDisplay
| order by count_
```

### List of items that were not routed where patient lived in state X
```kql
customEvents
| where name == "ITEM_NOT_ROUTED"
| extend params = parse_json(tostring(customDimensions.params))
| where params.bundleDigest.patientState contains "X"
```

### List of items that failed a filter where patient lived in state X
```kql
customEvents
| where name == "ITEM_FILTER_FAILED"
| extend params = parse_json(tostring(customDimensions.params))
| where params.bundleDigest.patientState contains "X"
```

### Find the original report ID for a report that failed a filter where patient lived in state X
```kql
customEvents
| where name == "REPORT_RECEIVED"
| extend reportId = tostring(customDimensions.childReportId)
| join (
customEvents
| where name == "ITEM_FILTER_FAILED"
| extend params = parse_json(tostring(customDimensions.params))
| where params.bundleDigest.patientState contains "X"
| extend submittedReportIds = parse_json(tostring(customDimensions.submittedReportIds))
| mv-expand submittedReportIds
| project childReportId=tostring(submittedReportIds)) on $left.reportId == $right.childReportId
```
12 changes: 11 additions & 1 deletion prime-router/src/main/kotlin/fhirengine/engine/FHIRConverter.kt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import ca.uhn.hl7v2.util.Hl7InputStreamMessageStringIterator
import ca.uhn.hl7v2.util.Hl7InputStreamMessageStringIterator.ParseFailureError
import com.fasterxml.jackson.annotation.JsonProperty
import com.google.common.collect.Streams
import fhirengine.engine.CustomFhirPathFunctions
import fhirengine.engine.IProcessedItem
import fhirengine.engine.ProcessedFHIRItem
import fhirengine.engine.ProcessedHL7Item
Expand Down Expand Up @@ -38,6 +39,7 @@ import gov.cdc.prime.router.azure.observability.event.ReportStreamEventName
import gov.cdc.prime.router.azure.observability.event.ReportStreamEventProperties
import gov.cdc.prime.router.fhirengine.translation.HL7toFhirTranslator
import gov.cdc.prime.router.fhirengine.translation.hl7.FhirTransformer
import gov.cdc.prime.router.fhirengine.translation.hl7.utils.CustomContext
import gov.cdc.prime.router.fhirengine.translation.hl7.utils.FhirPathUtils
import gov.cdc.prime.router.fhirengine.utils.FhirTranscoder
import gov.cdc.prime.router.fhirengine.utils.HL7Reader
Expand Down Expand Up @@ -232,7 +234,14 @@ class FHIRConverter(
actionHistory.trackCreatedReport(routeEvent, report, blobInfo = blobInfo)

val bundleDigestExtractor = BundleDigestExtractor(
FhirPathBundleDigestLabResultExtractorStrategy()
FhirPathBundleDigestLabResultExtractorStrategy(
CustomContext(
bundle,
bundle,
mutableMapOf(),
CustomFhirPathFunctions()
)
)
)
reportEventService.sendItemEvent(
ReportStreamEventName.ITEM_ACCEPTED,
Expand All @@ -241,6 +250,7 @@ class FHIRConverter(
) {
parentReportId(queueMessage.reportId)
parentItemIndex(itemIndex.toInt() + 1)
trackingId(bundle)
params(
mapOf(
ReportStreamEventProperties.BUNDLE_DIGEST
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -234,14 +234,22 @@ class FHIRDestinationFilter(
actionHistory.trackCreatedReport(nextEvent, report)

val bundleDigestExtractor = BundleDigestExtractor(
FhirPathBundleDigestLabResultExtractorStrategy()
FhirPathBundleDigestLabResultExtractorStrategy(
CustomContext(
bundle,
bundle,
mutableMapOf(),
CustomFhirPathFunctions()
)
)
)
reportEventService.sendItemEvent(
eventName = ReportStreamEventName.ITEM_NOT_ROUTED,
childReport = report,
pipelineStepName = TaskAction.destination_filter
) {
parentReportId(queueMessage.reportId)
trackingId(bundle)
params(
mapOf(
ReportStreamEventProperties.BUNDLE_DIGEST
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,14 @@ class FHIRReceiverFilter(
actionHistory.trackCreatedReport(nextEvent, emptyReport)

val bundleDigestExtractor = BundleDigestExtractor(
FhirPathBundleDigestLabResultExtractorStrategy()
FhirPathBundleDigestLabResultExtractorStrategy(
CustomContext(
bundle,
bundle,
mutableMapOf(),
CustomFhirPathFunctions()
)
)
)
reportEventService.sendItemEvent(
eventName = ReportStreamEventName.ITEM_FILTER_FAILED,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ class FHIRConverterIntegrationTests {
1,
2,
2,
null,
"371784",
"phd.hl7-elr-no-transform"
)
)
Expand All @@ -352,7 +352,7 @@ class FHIRConverterIntegrationTests {
)
),
patientState = listOf("TX"),
orderingFacilityState = emptyList(),
orderingFacilityState = listOf("FL"),
performerState = emptyList(),
eventType = "ORU^R01^ORU_R01"
)
Expand Down Expand Up @@ -491,7 +491,7 @@ class FHIRConverterIntegrationTests {
1,
3,
3,
null,
"1234d1d1-95fe-462c-8ac6-46728dbau8cd",
"phd.fhir-elr-no-transform"
)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ class FHIRDestinationFilterIntegrationTests : Logging {
1,
1,
1,
null,
"MT_COCNB_ORU_NBPHELR.1.5348467",
"phd.Test Sender"
)
)
Expand All @@ -422,7 +422,7 @@ class FHIRDestinationFilterIntegrationTests : Logging {
eventType = "ORU/ACK - Unsolicited transmission of an observation message",
patientState = listOf("CO"),
performerState = emptyList(),
orderingFacilityState = emptyList()
orderingFacilityState = listOf("CO")
)
)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ class FHIRReceiverFilterIntegrationTests : Logging {
eventType = "ORU/ACK - Unsolicited transmission of an observation message",
patientState = listOf("CA"),
performerState = emptyList(),
orderingFacilityState = emptyList()
orderingFacilityState = listOf("CA")
),
ReportStreamEventProperties.RECEIVER_NAME to receiver.fullName
)
Expand Down Expand Up @@ -566,7 +566,7 @@ class FHIRReceiverFilterIntegrationTests : Logging {
eventType = "ORU/ACK - Unsolicited transmission of an observation message",
patientState = listOf("CA"),
performerState = emptyList(),
orderingFacilityState = emptyList()
orderingFacilityState = listOf("CA")
),
ReportStreamEventProperties.RECEIVER_NAME to receiver.fullName
)
Expand Down Expand Up @@ -747,7 +747,7 @@ class FHIRReceiverFilterIntegrationTests : Logging {
eventType = "ORU/ACK - Unsolicited transmission of an observation message",
patientState = listOf("CA"),
performerState = emptyList(),
orderingFacilityState = emptyList()
orderingFacilityState = listOf("CA")
),
ReportStreamEventProperties.RECEIVER_NAME to receiver.fullName
)
Expand Down Expand Up @@ -1121,7 +1121,7 @@ class FHIRReceiverFilterIntegrationTests : Logging {
eventType = "ORU/ACK - Unsolicited transmission of an observation message",
patientState = listOf("CO"),
performerState = emptyList(),
orderingFacilityState = emptyList()
orderingFacilityState = listOf("CO")
),
ReportStreamEventProperties.RECEIVER_NAME to receiver.fullName
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,7 @@ class FhirDestinationFilterTests {
1,
1,
1,
null,
"1234d1d1-95fe-462c-8ac6-46728dba581c",
"sendingOrg.sendingOrgClient"
)
)
Expand Down Expand Up @@ -509,7 +509,7 @@ class FhirDestinationFilterTests {
),
patientState = listOf("CA"),
performerState = emptyList(),
orderingFacilityState = emptyList(),
orderingFacilityState = listOf("CA"),
eventType = "ORU/ACK - Unsolicited transmission of an observation message"
)
)
Expand Down

0 comments on commit 2dc22c9

Please sign in to comment.