Skip to content

Commit

Permalink
fix: payment details not found
Browse files Browse the repository at this point in the history
  • Loading branch information
jamil314 committed Jan 31, 2025
1 parent 7d83bbf commit 51441cd
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions packages/metrics/src/features/registration/fhirUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ import {
export const CAUSE_OF_DEATH_CODE = 'ICD10'
export const MANNER_OF_DEATH_CODE = 'uncertified-manner-of-death'
import { NOTIFICATION_TYPES } from '@metrics/features/metrics/constants'
import {
URLReference,
urlReferenceToResourceIdentifier
} from '@opencrvs/commons/types'

export function getSectionBySectionCode(
bundle: fhir.Bundle,
Expand Down Expand Up @@ -148,8 +152,12 @@ export function getPaymentReconciliation(
const paymentDetailsReference = task.extension?.find((x) =>
x.url.includes('paymentDetails')
)?.valueReference?.reference
return bundle.entry?.find((x) => x.fullUrl === paymentDetailsReference)
?.resource as fhir.PaymentReconciliation
return bundle.entry?.find(
(x) =>
x.fullUrl &&
urlReferenceToResourceIdentifier(x.fullUrl as URLReference) ===
paymentDetailsReference
)?.resource as fhir.PaymentReconciliation
}

return getResourceByType<fhir.PaymentReconciliation>(
Expand Down

0 comments on commit 51441cd

Please sign in to comment.