Amazon HealthLake System API - Implementation Template

(0 reviews)

Developer guide

This document provides information generated from the DataWeave scripts included in the project, such as function definitions, variable definitions, and data mapping tables.

ModuleDescription
FhirToolsThis module defines a number of common FHIR utility functions.

FhirTools

This module defines a number of common
FHIR utility functions.

Source: ./src/main/resources/dwl/FhirTools.dwl

Functions

fun getPatientId (data)

Gets the first Patient ID from the search result set.

return A string with the Patient ID or an empty string.

fun getPractitionerId (data)

Gets the first Practitioner ID from the search result set.

return A string with the Practitioner ID or an empty string.

fun getPatient (data)

Gets the FHIR patient data structure with the provided FHIR bundle.

param data is the FHIR bundle to get the patient from.
return A FHIR Patient resource or null if not found.

fun getPractitioners (data)

Gets a list of FHIR Practitioner objects with the provided FHIR bundle.

param data is the FHIR bundle to get the practitioners from.
return A list of FHIR Practitioner objects or empty list

fun getMrnNumber (data)

Gets the Patient MRN number with the provided FHIR bundle. If no MRN number can be found it returns the value of the first identifier or a blank string.

param data is the FHIR bundle to get the MRN from.
return A String with the MRN number or an empty string if not found.

fun getResourceMrnNumber (resourceData)

Gets the Resource(Ex: Patient, Practitioner etc..) MRN number with the provided FHIR request. If no MRN number can be found it returns the value of the first identifier or a blank string.

param resourceData is the FHIR request to get the MRN from.
return A String with the MRN number or an empty string if not found.

fun getPractitionerIdNumbers (data, practitionerIdSystemList)

Gets the Practitioner ID numbers with the provided FHIR bundle.

param data is the FHIR bundle to get the NPIs from.
param practitionerIdSystemList is a list of strings with the systems to use to match the Practitioner unique identifier.
return A list with the Practitioner ID numbers or an empty list if not found. Each entry in the list is an array with the first item being the identifier found and the second being the resource id value.

fun createBundleRequest (data, patientId)

Creates the bundle request with the provided FHIR bundle and patient ID. This function also updates all Patient and Practitioner references.

param data is the current FHIR bundle request.
param patientId with the new patient ID to use in the request.
return A formatted bundle request ready to send to HealthLake.

fun updatePractitionerId (data, srcPractitionerId, destPractitionerId)

Updates the provided bundle with the provided source and destination Practitioner Ids.

param data is the bundle to upadte.
param srcPractitionerId is the source practitioner ID to look for.
param destPractitionerId is the destination practitioner ID to replace with.
return A bundle with updated Practitioner Ids.

fun updatePractitionerIdRefs (data, srcPractitionerId, destPractitionerId)

Updates all references in the provided bundle with the provided source and destination Practitioner IDs.

param data is the bundle to upadte.
param srcPractitionerId is the source practitioner ID to look for.
param destPractitionerId is the destination practitioner ID to replace with.
return A bundle with updated Practitioner Ids.

fun processBundle (data, patientId)

Creates the bundle request with the provided FHIR bundle and patient ID.

param data is the current FHIR bundle request.
param patientId with the new patient ID to use in the request.
return A formatted bundle request ready to send to HealthLake.

fun updateEntryMethods (data)

Updates all entries in the bundle to method PUT and remove fullUrl because it causes issues updating in HealthLake. If the request section wasn't found it will add it.

param data is the current FHIR bundle request.
return A FHIR bundle request with all of the entry methods set to POST.

fun updatePatientId (entries, patientId)

Updates the patient ID in the provided list of entries with the provided patient ID. This function only updates the IDs in the actual Patient record, not all of the other references.

param entries is a list of entries from the bundle.
param patientId is a string with the new patient ID to update to.
return A list of entries with the updated patient record.

(back to top)


Reviews

TypeTemplate
OrganizationMuleSoft
Published by
MuleSoft Solutions
Published onOct 12, 2023
Asset overview

Asset versions for 1.0.x

Asset versions
VersionActions
1.0.2
1.0.1
1.0.0