diff --git a/containers/ecr-viewer/src/app/services/ecrMetadataService.ts b/containers/ecr-viewer/src/app/services/ecrMetadataService.ts index 96cc185a1..f27b15691 100644 --- a/containers/ecr-viewer/src/app/services/ecrMetadataService.ts +++ b/containers/ecr-viewer/src/app/services/ecrMetadataService.ts @@ -58,7 +58,7 @@ export const evaluateEcrMetadata = ( fhirBundle: Bundle, mappings: PathMappings, ): EcrMetadata => { - const rrDetails = evaluate(fhirBundle, mappings.rrDetails) as Observation[]; + const rrDetails: Observation[] = evaluate(fhirBundle, mappings.rrDetails); let reportableConditionsList: ReportableConditions = {}; @@ -97,11 +97,11 @@ export const evaluateEcrMetadata = ( } const custodianRef = evaluate(fhirBundle, mappings.eicrCustodianRef)[0] ?? ""; - const custodian = evaluateReference( + const custodian: Organization = evaluateReference( fhirBundle, mappings, custodianRef, - ) as Organization; + ); const eicrReleaseVersion = (fhirBundle: any, mappings: any) => { const releaseVersion = evaluate(fhirBundle, mappings.eicrReleaseVersion)[0]; diff --git a/containers/ecr-viewer/src/app/services/evaluateFhirDataService.ts b/containers/ecr-viewer/src/app/services/evaluateFhirDataService.ts index 876646b4e..dedf6dba1 100644 --- a/containers/ecr-viewer/src/app/services/evaluateFhirDataService.ts +++ b/containers/ecr-viewer/src/app/services/evaluateFhirDataService.ts @@ -594,8 +594,8 @@ export const evaluateEmergencyContact = ( fhirBundle: Bundle, mappings: PathMappings, ) => { - const contacts = (evaluate(fhirBundle, mappings.patientEmergencyContact) ?? - []) as PatientContact[]; + const contacts: PatientContact[] = + evaluate(fhirBundle, mappings.patientEmergencyContact) ?? []; if (contacts.length === 0) return undefined; @@ -655,7 +655,7 @@ export const evaluateValue = (entry: Element, path: string | Path): string => { ) { value = originalValue.toString(); } else if (originalValuePath === "Quantity") { - const data = originalValue as Quantity; + const data: Quantity = originalValue; let unit = data.unit; const firstLetterRegex = /^[a-z]/i; if (unit?.match(firstLetterRegex)) { @@ -663,11 +663,11 @@ export const evaluateValue = (entry: Element, path: string | Path): string => { } value = `${data.value ?? ""}${unit ?? ""}`; } else if (originalValuePath === "CodeableConcept") { - const data = originalValue as CodeableConcept; + const data: CodeableConcept = originalValue; value = data.coding?.[0].display || data.text || data.coding?.[0].code || ""; } else if (originalValuePath === "Coding") { - const data = originalValue as Coding; + const data: Coding = originalValue; value = data?.display || data?.code || ""; } else if (typeof originalValue === "object") { console.log(`Not implemented for ${originalValue.__path__}`); diff --git a/containers/ecr-viewer/src/app/services/formatService.tsx b/containers/ecr-viewer/src/app/services/formatService.tsx index d9d8235fb..f359f36be 100644 --- a/containers/ecr-viewer/src/app/services/formatService.tsx +++ b/containers/ecr-viewer/src/app/services/formatService.tsx @@ -384,9 +384,8 @@ export function formatTablesToJSON(htmlString: string): TableJson[] { } //