Health Cloud Diagnostics System API - Implementation Template
Developer guide
Diagnostics Dev Guide
The US-Core Diagnostics application uses the following DataWeave modules to map between Health Cloud and FHIR formats.
| Module | Description |
|---|---|
| DiagnosticReportFHIRTools | DiagnosticReportFHIRTools DataWeave library contains functions used for converting Health Cloud data into FHIR format. |
| DiagnosticReportRequest | This module defines functions needed to convert a FHIR DiagnosticReport resource into its representation within Health Cloud. |
| ObservationFHIRTools | |
| ObservationRequest | This module defines functions needed to convert a FHIR Observation resource into its representation within Health Cloud. |
| Util | A library with needed dataweave utility functions. |
DiagnosticReportFHIRTools
DiagnosticReportFHIRTools DataWeave library contains functions
used for converting Health Cloud data into FHIR format.
Source:
.src/main/resources/dwl/DiagnosticReport/DiagnosticReportFHIRTools.dwl
Functions
fun getDiagnosticReportIdentifiers (identifiers, digReport)
Gets the diagnosticReport identifiers with the provided HC ID array and returns a list of FHIR DiagnosticReport objects.
param
idTypeMapis a map of HC Ids to FHIR identifier codes.
paramidentifiersis an array of HC identifier objects.
return An array of FHIR Identifier objects.
fun getLinkSelf (attr: Object)
Gets the URL to the current web resource.
param
attris an object with the attributes.
return A string with the self link.
fun getEntryUrl (item: Object, attr: Object)
Gets the URL for the entry provided.
param
itemis an object with the item that's being returned.
paramattris an object with the attributes.
return A string with the entry URL.
DiagnosticReportRequest
This module defines functions needed to convert a
FHIR DiagnosticReport resource into its representation within
Health Cloud.
Source:
.src/main/resources/dwl/DiagnosticReport/DiagnosticReportRequest.dwl
Functions
fun getDiagnosticReportUpsert (fhirObj, codeSetBundleList, categoryLookup, carePerformerIds)
Converts the provided DiagnosticReport FHIR object to the Health Cloud DiagnosticSummary object.
param
fhirObjis a FHIR DiagnosticReport object.
paramcodeSetBundleListis list of Codeset Bundle records.
paramcategoryLookupis lookup response of FHIR Codesets object.
paramcarePerformerIdsis Salesforce Ids for practitioner references.
return A Health Cloud DiagnosticSummary object.
fun getDiagnosticReportUpdate (fhirObj, codeSetBundleList, categoryLookup, carePerformerIds)
Converts the provided DiagnosticReport FHIR object to the Health Cloud DiagnosticSummary object for Update of Diagnostic Report.
param
fhirObjis a FHIR DiagnosticReport object.
paramcodeSetBundleListis a list of Codeset Bundle records.
paramcategoryLookupis the lookup response of FHIR Codesets object.
paramcarePerformerIdsis Salesforce Ids for practitioner references.
return A Health Cloud DiagnosticSummary object.
fun getDiagnosticReportIdentifier (identifier, diagnosticReportId, typeId)
Converts the provided DiagnosticReport FHIR object to the Health Cloud Identifier object.
param
identifieris a FHIR DiagnosticReport identifier object.
return A Health Cloud Identifier object.
fun getCodeSetUpsert (codeSetList)
Converts the provided DiagnosticReport FHIR object to the Health Cloud CodeSet object.
param
codeSetListis the list of codeSet object.
return Health Cloud CodeSet upsert fields.
fun getCodeSetBundleUpsert (codeSetList, bundleType, name)
Converts the provided DiagnosticReport FHIR object to the Health Cloud CodeSetBundle object.
param
codeSetListis the list of CodeSetBundle object.
parambundleTypeis for defining the CodeSetBundle type.
paramnameis for defining the name of the CodeSetBundle.
return Health Cloud CodeSetBundle upsert fields.
ObservationFHIRTools
Source:
.src/main/resources/dwl/Observation/ObservationFHIRTools.dwl
Functions
fun getObservationResponse (observation: Object, codeId, identifiers, searchLookupResponse, unitMeasureCodes)
Generates the observation response object in FHIR format with the provided observation object, identifiers, and code set bundles. Queried from Health Cloud.
param
observationis a HC Observation object.
paramcodeIdcode id associated for the observation
paramidentifiersa list of identifiers
return of FHIR formatted Observation object.
fun getCategory (categoryDisplay, searchLookupResponse)
Gets the Category if found or null if not.
param
categoryDisplayis category display value.
paramsearchLookupResponseis response from FHIR Codeset object.
return a Category as FHIR formatted Method object.
fun getCode (obs, codeId)
Gets the code object with the provided observation object and returns null if not found.
param
obsis a HC Code object.
paramcodeIdis codeset record.
return An array of FHIR formatted Code objects.
fun getIdentifier (observation, identifiers)
Gets the observation identifiers with the provided HC ID array and returns a list of FHIR Observation objects.
param
observationis the observation object that has references to codes
paramidentifiersis an array of HC identifier objects.
return An array of FHIR Identifier objects.
fun getBodySite (obs)
Gets the bodySite object with the provided observation object and returns null if not found.
param
obsis a HC bodySite object.
return An array of FHIR formatted BodySite objects.
fun getInterpretation (interpretationDisplay, searchLookupResponse)
Gets the Interpretation if found or null if not.
param
interpretationDisplayis Interpretation display value.
paramsearchLookupResponseis response from FHIR Codeset object.
return a Interpretation as FHIR formatted Method object.
fun getMethod (obs)
Gets the method object with the provided observation object and returns null if not found.
param
obsis a HC method object.
return An array of FHIR formatted Method objects.
fun getValueCodeableConcept (obs)
Gets the valueCodeableConcept object if found or null if not.
param
obsis a HC method object.
return a CodeableConcept as FHIR formatted Method object.
fun getValueRatio (observation, unitMeasureCodes)
Gets the valueRatio object if found or null if not.
param
observationis a HC method object.
paramunitMeasureCodesis lookup response of UnitOf​Measure object.
return a Ratio as FHIR formatted Method object.
fun getComponentData (componentCodeSets, components, searchLookupResponse, unitMeasureCodes)
Gets the Component object if found or null if not.
param
componentCodeSetsa list of component codeset HC objects .
paramcomponentsa list of components
return a Component Data as FHIR formatted Method object.
fun getComponentCode (obs)
Gets the Component Code if found or null if not.
param
obscodeset HC objects .
return a Component Code as FHIR formatted Method object.
fun getComponentInterpretation (componentInterpretation, searchLookupResponse)
Gets the Component Interpretation if found or null if not.
param
componentInterpretationis componentInterpretation display value.
paramsearchLookupResponseis response from FHIR Codeset object.
return a Component Interpretation as FHIR formatted Method object.
fun getLinkSelf (attr: Object)
Gets the URL to the current web resource.
param
attris an object with the attributes.
return A string with the self link.
fun getEntryUrl (item: Object, attr: Object)
Gets the URL for the entry provided.
param
itemis an object with the item that's being returned.
paramattris an object with the attributes.
return A string with the entry URL.
ObservationRequest
This module defines functions needed to convert a
FHIR Observation resource into its representation within
Health Cloud.
Source:
.src/main/resources/dwl/Observation/ObservationRequest.dwl
Functions
fun getObservationDetails (fhirObj, codeSetBundleList, codeId, sourceSystem, lookupResponse, unitMeasureCodes)
Converts the provided Observation FHIR object to the Health Cloud CareObservation object.
param
fhirObjis a FHIR Observation object.
return A Health Cloud Observation object.
fun getObservationDetailsUpdate (fhirObj, codeSetBundleList, codeId, sourceSystem, lookupResponse, unitMeasureCodes)
Converts the provided Observation FHIR object to the Health Cloud CareObservation object.
param
fhirObjis a FHIR Observation object.
return A Health Cloud Observation object.
fun getObservationIdentifier (identifier, observationId, typeId)
Converts the provided Observation FHIR object to the Health Cloud Identifier object.
param
identifieris a FHIR Observation identifier object.
return A Health Cloud Identifier object.
fun getObservationComponents (components, observationId, codeSetBundleList, Index, lookupResponse, unitMeasureCodes)
Converts the provided Observation Component FHIR object to the Health Cloud CareObservationComponent object.
param
componentsis a FHIR Observation Component object.
return A Health Cloud Observation object.
fun getCodeSetUpsert (codeSetList)
Converts the provided Observation FHIR object to the Health Cloud CodeSet object.
param
codeSetListis the list of codeSet object.
return Health Cloud CodeSet upsert fields.
fun getCodeSetBundleUpsert (codeSetList, bundleType, name)
Converts the provided Observation FHIR object to the Health Cloud CodeSetBundle object.
param
codeSetListis the list of CodeSetBundle object.
parambundleTypeis for defining the CodeSetBundle type.
paramnameis for defining the name of the CodeSetBundle.
return Health Cloud CodeSetBundle upsert fields.
fun getResultIds (res)
This function takes the results of a Salesforce query and returns a list of IDs.
param
resis a Salesforce query result.
return An array with a list of Ids found.
Util
A library with needed dataweave utility functions.
Source:
.src/main/resources/dwl/Util.dwl
Functions
fun clean (obj: Object)
Cleans the provided object of blank strings, null values, empty objects, and empty arrays.
param
objis an Object to clean.
return A cleaned object.
fun clean (arr: Array)
Cleans the provided array of blank strings, null values, empty objects, and empty arrays.
param
arris an Array to clean.
return A cleaned Array.
fun removeNull (arr: Array)
Removes all null items from an array.
param
arris an array.
return An array with null items removed.
fun removeNull (obj: Object)
Removes all null values from an object.
param
objis an object.
return An object with null values removed.
fun getPickListValue (req, lookupReq)
Converts the FHIR CodeableConcept fields and result from lookup to get the values for picklist field used in Encounter upsert.
param
reqis a FHIR object field, lookupReq is from FHIRCodeSetc. return_ value for the picklist field.
fun getOrganizationAccount (fhirObj, codeSetLU)
Converts the provided Organization FHIR object to the Health Cloud Account object.
param
fhirObjis a FHIR Organization object.
return A Health Cloud Account object.