Health Cloud HL7 v2 ADT Listener - Implementation Template
Developer guide
ADT Application Dev Guide
The Health Cloud ADT application uses the following DataWeave modules to map between HL7 v2 and Health Cloud formats.
Module | Description |
---|---|
address | Maps the FHIR address object. |
addresstype | Maps the address type object. |
allergycriticality | Maps the allergy criticality. |
allergytype | Maps the allergy type. |
codeableconcept | Maps the CodeableConcept object. |
doctors | This module defines some common functions to support doctor lookups and processing. |
driverlicensenumber | Maps the driver license number object. |
extendedpersonname | Maps the extended person name object. |
extendedtelecommunicationnumber | Maps the extended telecommunication number object. |
gender | Maps the gender object. |
identifier | Maps the FHIR identifier object. |
idtypes | Maps the ID type object. |
LibADT | This module defines functions needed to convert an HL7 ADT message into the Health Cloud data model. |
maritalstatus | Maps the marital status object. |
nametype | Maps the name type object. |
telecomequipmenttype | Maps the Telecom Equipment Type object. |
telecomusecode | Maps the telecom use code object. |
util | This module defines a number of common utility functions. |
address
Maps the FHIR address object.
Source:
.src/main/resources/dwl/resources/datatypes/address.dwl
Functions
fun mapAddress (obj)
Maps the provided object to the FHIR address.
param
obj
is an object with XAD fields that can be mapped to an address. (ORC-22, RXA-28 ...)
return A FHIR formatted Address object.
addresstype
Maps the address type object.
Source:
.src/main/resources/dwl/resources/codesystem/addresstype.dwl
Functions
fun mapAddressType (code)
Maps the provided XAD-07 field to the proper address type object.
param
code
is a XAD-07 field to map.
return An address type object.
allergycriticality
Maps the allergy criticality.
Source:
.src/main/resources/dwl/resources/codesystem/allergycriticality.dwl
Functions
fun mapAllergyCriticality (code)
Maps the provided code to the allergy criticality.
param
code
is a string with the criticality code.
return An AllergyCriticality object.
allergytype
Maps the allergy type.
Source:
.src/main/resources/dwl/resources/codesystem/allergytype.dwl
Functions
fun mapAllergyType (code)
Maps the allergy type with the provided code.
param
code
is a string with the allergy type code.
return An AllergyType object.
codeableconcept
Maps the CodeableConcept object.
Source:
.src/main/resources/dwl/resources/datatypes/codeableconcept.dwl
Functions
fun mapCodeableConcept (obj)
Maps the provided object into a CodeableConcept object.
param
obj
is the object to map from.
return A CodeableConcept object.
fun mapCodeableConcept (obj, hasMappingFunct, mappingFunct)
Maps the provided object with the provided mapping function into a CodeableConcept object.
param
obj
is the object to map from.
paramhasMappingFunct
is a boolean with true for has a provided mapping function and false for not. If set to true mappingFunct must be a vaild mapping function reference.
parammappingFunct
is a function reference with the function to call to provide the mapping. This function definition must take a single argument.
return A CodeableConcept object.
fun mapCodeableConceptDoMapping (obj, hasMappingFunct, mappingFunct)
This function produces the codeable concept mappings. It's broken out into it's own function so it can be called multiple times from mapCodeableConcept.
param
obj
is the object to map from.
paramhasMappingFunct
is a boolean with true for has a provided mapping function and false for not. If set to true mappingFunct must be a vaild mapping function reference.
parammappingFunct
is a function reference with the function to call to provide the mapping. This function definition must take a single argument.
return A CodeableConcept object.
fun mapCodeableConceptAdmissionTypes (code)
This function maps the provided code to the appropriate codeableconcept object for Encounter Admission Types. This function is provided as a pointer to mapCodeableConcept.
param
code
is the PV1-04 CWE-01 value.
return A CodeableConcept object.
doctors
This module defines some common functions to
support doctor lookups and processing.
Source:
.src/main/resources/dwl/resources/doctors.dwl
Functions
fun createQuery (doctorIds)
Creates the HC query to get the IdValue and ParentRecordId from the Identifier table with the supplied list of values.
param
doctorIds
is a list of doctor Ids to query.
return A HC query string.
fun processQueryResults (idList, queryResult)
Processes the HC query results along with the provided Id list to create a list of parent record Ids that matches up with the provided idList identifier values. If a query result for a provided idList value isn't present then a null placeholder is put in it's place in the output.
param
idList
is a list of the Id values to create a HC list for.
return A list of HC Ids that match up to the input idList with nulls set where no value was found.
fun createHealthcareProviderQuery (doctorIds)
Creates the HC query to get the AccountId and Id from the HealthcareProvider table with the supplied list of values.
param
doctorIds
is a list of doctor Account Ids to query.
return A HC query string.
fun processHealthcareProviderQueryResults (idList, queryResult)
Processes the HC query results along with the provided Id list to create a list of HealthcareProvider Ids that matches up with the provided Account Id values. If a query result for a provided idList value isn't present then a null placeholder is put in it's place in the output.
param
idList
is a list of the Id values to create a HC list for.
return A list of HealthcareProvider Ids that match up to the input Account Id list with nulls set where no value was found.
fun processHealthcareProvidersByType (identifierValueList, providersList)
Processes the HC Providers along with the provided IdentifierValue list to create a list of HealthcareProvider Ids that matches up with the specified provider type. If a query result for a provided idList value isn't present then an empty list will be is put in it's place in the output.
param
identifierValueList
is a list of the Id values to create a HC list for.
paramprovidersList
is a list of providers with Id and IdentifierValues
return A list of HealthcareProvider Ids that match up to the input Account Id list with nulls set where no value was found.
driverlicensenumber
Maps the driver license number object.
Source:
.src/main/resources/dwl/resources/datatypes/driverlicensenumber.dwl
Functions
fun mapDriverLicenseNumber (obj)
Maps the driver license number object with the provided PID PID-20 object.
param
obj
is a PID-20 object.
return A DriverLicenseNumber object.
extendedpersonname
Maps the extended person name object.
Source:
.src/main/resources/dwl/resources/datatypes/extendedpersonname.dwl
Functions
fun mapExtendedPersonName (xpn)
Maps the extended person name with the provided XPN object.
param
xpn
is an XPN object.
return An ExtendedPersonName object or null if xpn is null.
extendedtelecommunicationnumber
Maps the extended telecommunication number object.
Source:
.src/main/resources/dwl/resources/datatypes/extendedtelecommunicationnumber.dwl
Functions
fun mapExtendedTelecommunicationNumber (xtn)
Maps the extended telecommunication number with the provided xtn object.
param
xtn
is the provided object to map.
return An ExtendedTelecommunicationNumber object.
gender
Maps the gender object.
Source:
.src/main/resources/dwl/resources/codesystem/gender.dwl
Functions
fun mapGender (code)
Maps the gender with the provided code.
param
code
is a string with the code to map.
return A Gender object.
identifier
Maps the FHIR identifier object.
Source:
.src/main/resources/dwl/resources/datatypes/identifier.dwl
Functions
fun mapIdentifier (cx)
Maps the provided object to the FHIR identifier object.
param
cx
is the input object to map.
return An identifier object.
idtypes
Maps the ID type object.
Source:
.src/main/resources/dwl/resources/codesystem/idtypes.dwl
Functions
fun mapIdTypes (code)
Maps the ID type with the provided code.
param
code
is a string with the ID type.
return An IdType object.
LibADT
This module defines functions needed to convert an
HL7 ADT message into the Health Cloud data model.
Source:
.src/main/resources/dwl/hl7/LibADT.dwl
Functions
fun getMRN (msg)
This function takes ADT message and locates the MRN number.
param
msg
is an ADT message.
return The MRN number or null if not found.
fun getResultIds (res)
This function takes the results of a Salesforce query and returns a list of IDs.
param
res
is a Salesforce query result.
return An array with a list of Ids found.
fun getCompositeResponseId (data, refId)
Gets the Id returned in the composite response for the provided reference Id.
param
data
is the composite response.
paramrefId
is a string with the referenceId to match on.
return A string with the Id or null if not found.
fun getCompositeResponseRecords (data, refId)
Gets the records returned in the composite response for the provided reference Id.
param
data
is the composite response.
paramrefId
is a string with the referenceId to match on.
return an array of records that are in composite response for the matching referenceId.
fun stripBlankCompositeRequests (compositeRequests)
Removes any composite requests where the number of items are less then or equal to 1. This is to remove blank requests.
param
compositeRequests
is the list of composite requests to strip.
return A list of composite requests.
fun getPersonAccount (msg, recordType)
Converts the provided ADT request message to the Health Cloud PersonAccount request object.
param
msg
is an ADT message.
paramrecordType
is an ID with the PersonAccount record ID to use.
return A Health Cloud PersonAccount request object.
fun getAccount (msg)
Converts the provided ADT request message to the Health Cloud Account object.
param
msg
is an ADT message.
return A Health Cloud Account object.
fun getPersonName (msg, accountId)
Converts the provided ADT request message to the Health Cloud PersonName object list.
param
msg
is an ADT message.
paramaccountId
is a string with the Account Id.
return A Health Cloud PersonName object list.
HL7 Segment | Salesforce Object and Field | Type |
---|---|---|
PID.2 - Patient External ID | Identifier | Object |
PID.3 - Patient Internal ID | Identifier | Object |
PID.4 - Alternate Patient ID | Identifier | Object |
PID.5 - Patient Name | PersonName | Object |
PID.7 - Datetime of Birth | Contact.BirthDate | Date |
PID.8 - Sex | Contact.Gender | Picklist |
PID.9 - Patient Alias | PersonName | Object |
PID.11 - Patient Address | ContactPointAddress | Object |
PID.13 - Phone Number - Home | ContactPointPhone and ContactPointEmail Objects | |
PID.14 - Phone Number - Business | ContactPointPhone and ContactPointEmail Objects | |
PID.15 - Primary Langauge | PersonLanguage | Object |
PID.16 - Marital Status | Contact.MaritalStatus | Picklist |
PID.25 - Multiple Birth Indicator | Contact.SequenceInMultipleBirth | Double |
PID.29 - Patient Death Date and Time | Contact.DeceasedDate | DateTime |
PID.40 - Patient Telecommunication Information | ContactPointPhone and ContactPointEmail Objects |
fun hcConvertPersonName (fhirObjList, accountId)
Converts the provided list of FHIR formatted patient names to the Health Cloud PersonName object list.
param
msg
is an ADT message.
paramaccountId
is a string with the Account Id.
return A list of Health Cloud PersonName objects.
fun getIdentifiers (msg, idTypeIdMap, accountId)
Converts the provided ADT request message to the Health Cloud Identifier object list.
param
msg
is an ADT message.
paramidTypeIdMap
is an object with the IdType code -> IdType Id from Health Cloud map.
paramaccountId
is a string with the Account Id.
return A Health Cloud Identifier object list.
fun getRelatedPersonContact (nk1)
Converts the provided list of FHIR formatted related person to the Health Cloud Contact object list.
param
msg
is an ADT message.
return A list of Health Cloud Contact objects.
fun hcConvertIdentifier (pid)
Converts the provided PID segment to a list of FHIR formatted identifier objects.
param
pid
is a HL7 PID segment to get the identifiers from.
return A list of FHIR formatted identifier objects.
fun getContact (msg)
Converts the provided ADT request message to the Health Cloud Contact object.
param
msg
is an ADT message.
return A Health Cloud Contact object.
fun getPersonLanguage (msg, accountId)
Converts the provided ADT request message to the Health Cloud Person Language object.
param
msg
is an ADT message.
paramaccountId
is a string with the Account Id.
return A Health Cloud Person Language object.
fun getContactPointAddress (msg, accountId)
Converts the provided ADT request message to the Health Cloud ContactPoint Address objectlist.
param
msg
is an ADT message.
paramaccountId
is a string with the Account Id.
return A Health Cloud ContactPoint Address object list.
fun getContactPointPhone (msg, accountId)
Converts the provided ADT request message to the Health Cloud ContactPointPhone object list.
param
msg
is an ADT message.
paramaccountId
is a string with the Account Id.
return A Health Cloud ContactPointPhone object list.
fun getContactPointEmail (msg, accountId)
Converts the provided ADT request message to the Health Cloud ContactPointEmail object list.
param
msg
is an ADT message.
paramaccountId
is a string with the Account Id.
return A Health Cloud ContactPointEmail object list.
fun getClinicalEncounter (msg, admissionTypeCodeSetBundleId, dischargeDispositionCodeSetBundleId, patientId, status, existingClinicalEncounterStatus, facilityId, priorFacilityId, method)
Converts the provided ADT request message to the Health Cloud ClinicalEncounter object.
param
msg
is an ADT message.
paramadmissionTypeCodeSetBundleId
is a string with the admission type CodeSetBundle Id to set for TypeId.
paramdischargeDispositionCodeSetBundleId
is a string with the discharge disposition CodeSetBundle Id.
paramstatus
is the status of ClinicalEncounter.
return A Health Cloud ClinicalEncounter object.
fun getClinicalEncounter (msg, admissionTypeCodeSetBundleId, dischargeDispositionCodeSetBundleId, patientId, status, existingClinicalEncounterStatus, facilityId, priorFacilityId, method, isDischarged)
Converts the provided ADT request message to the Health Cloud ClinicalEncounter object.
param
msg
is an ADT message.
paramadmissionTypeCodeSetBundleId
is a string with the admission type CodeSetBundle Id to set for TypeId.
paramdischargeDispositionCodeSetBundleId
is a string with the discharge disposition CodeSetBundle Id.
paramstatus
is the status of ClinicalEncounter.
return A Health Cloud ClinicalEncounter object.
HL7 Segment | Salesforce Object and Field | Type |
---|---|---|
PV1.2 - Patient Class | ClinicalEncounter.Category | Picklist |
PV1.3 - Assigned Patient Location | ClinicalEncounterFacility | Object |
PV1.4 - Admission Type | ClinicalEncounter.TypeId | Lookup: CodeSetBundle |
PV1.5 - Preadmit Number | ClinicalEncounter.PreAdmissionIdentifierId | Lookup: Identifier |
PV1.7 - Attending Doctor | ClinicalEncounterProvider | Object |
PV1.8 - Referring Doctor | ClinicalEncounterProvider | Object |
PV1.9 - Consulting Doctor | ClinicalEncounterProvider | Object |
PV1.10 - Hospital Service | ClinicalEncounter.ServiceType | Picklist |
PV1.13 - Readmission Indicator | ClinicalEncounter.ReadmissionCodeId | Lookup: CodeSetBundle |
PV1.14 - Admit Source | ClinicalEncounter.AdmissionSource | Picklist |
PV1.16 - VIP Indicator | ClinicalEncounter.SpecialCourtesy | Picklist |
PV1.17 - Admitting Doctor | ClinicalEncounterProvider | Object |
PV1.18 - Patient Type | ClinicalEncounter.TypeId | Lookup: CodeSetBundle |
PV1.19 - Visit Identifier | ClinicalEncounterIdentifier | Object |
PV1.22 - Courtesy Code | ClinicalEncounter.SpecialCourtesy | Picklist |
PV1.36 - Discharge Disposition | ClinicalEncounter.DischargeDispositionId | Lookup: CodeSetBundle |
PV1.37 - Discharged to Location | ClinicalEncounter.DestinationFacilityId | Lookup: HealthcareFacility |
PV1.37 - Discharged to Location | ClinicalEncounter.DestinationOrganizationId | Lookup: Account |
PV1.38 - Diet Type | ClinicalEncounter.DietPreference | Picklist |
PV1.44 - Admit Datetime | ClinicalEncounter.StartDate | DateTime |
PV1.45 - Discharge Datetime | ClinicalEncounter.EndDate | DateTime |
PV1.50 - Alternate Visit ID | ClinicalEncounterIdentifier | Object |
PV2.3 - Admit Reason | ClinicalEncounterReason.ReasonCodeId | Lookup: CodeSetBundle |
PV2.7 - Visit User Code | ClinicalAlert.CodeId | Lookup: CodeSetBundle |
PV2.11 - Actual Length of Inpatient Stay | ClinicalEncounter.Duration | Double |
PV2.11 - Actual Length of Inpatient Stay | ClinicalEncounter.DurationUnitId | Lookup: UnitOfMeasure |
PV2.25 - Patient Status Code | ClinicalEncounter.PriorityId | Lookup: CodeSetBundle |
fun mapEncounterClass (pv1_02)
This function creates the Encounter Class object.
param
pv1_02
is the PV1-01 object.
return An Encounter Class object.
fun mapClinicalEncounterCategory (val)
Maps the value for PV1-02 to a matching ClinicalEncounter Category or sets as Unknown if a suitable one can't be matched.
param
val
is the PV1-02 value.
return A Health Cloud picklist value for ClinicalEncounter Category.
fun mapServiceType (val)
Maps the value for PV1-10 to a matching ClinicalEncounter ServiceType.
param
val
is the PV1-10 value.
return A Health Cloud picklist value for ClinicalEncounter ServiceType.
fun mapAdmissionSource (val)
Maps the value for PV1-14 to a matching ClinicalEncounter AdmissionSource.
param
val
is the PV1-14 value.
return A Health Cloud picklist value for ClinicalEncounter AdmissionSource.
fun mapCodeableConceptReadmissionIndicator (code)
This function maps the provided code to the appropriate codeableconcept object for Encounter Readmission Indicator. This function is provided as a pointer to mapCodeableConcept.
param
code
is the PV1-13 CWE-01 value.
return A CodeableConcept object.
fun mapCodeableConceptEncounterPriority (code)
This function maps the provided code to the appropriate codeableconcept object for Encounter Priority. This function is provided as a pointer to mapCodeableConcept.
param
code
is the PV2-25 CWE-01 value.
return A CodeableConcept object.
fun getClinicalEncounterFacility (msg, facilityId, clinicalEncounterId, status)
Converts the provided ADT request message to the Health Cloud ClinicalEncounterFacility object.
param
msg
is an ADT message.
paramfacilityId
is the HC facility Id to use.
paramclinicalEncounterId
is the HC ClinicalEncounter Id to use.
paramstatus
is the status of ClinicalEncounterFacility.
return A Health Cloud ClinicalEncounterFacility object.
fun getClinicalEncounterProvider (msg, doctorIds, clinicalEncounterId)
Converts the provided ADT request message to the Health Cloud ClinicalEncounterProvider object list.
param
msg
is an ADT message.
paramattendingDoctorIds
is a list of Practitioner Ids for attending doctors.
paramreferringDoctorIds
is a list of Practitioner Ids for referring doctors.
paramconsultingDoctorIds
is a list of Practitioner Ids for consulting doctors.
paramadmittingDoctorIds
is a list of Practitioner Ids for admitting doctors.
paramclinicalEncounterId
is the HC ClinicalEncounter Id to use.
return A Health Cloud ClinicalEncounterProvider object list.
fun getClinicalEncounterIdentifier (msg, clinicalEncounterId)
Converts the provided ADT request message to the Health Cloud ClinicalEncounterIdentifier object.
param
msg
is an ADT message.
paramclinicalEncounterId
is the HC ClinicalEncounter Id to use.
return A Health Cloud ClinicalEncounterIdentifier object.
fun getClinicalEncounterReason (msg, reasonCodeCodeSetBundleId, clinicalEncounterId)
Converts the provided ADT request message to the Health Cloud ClinicalEncounterReason object.
param
msg
is an ADT message.
paramreasonCodeCodeSetBundleId
is the CodeSetBundle Id of the reason code.
paramclinicalEncounterId
is the HC ClinicalEncounter Id to use.
return A Health Cloud ClinicalEncounterReason object.
fun getClinicalAlert (msg, clinicalAlertCodeSetBundleId, accountId, codeSetUndefined, clinicalEncounterId)
Converts the provided ADT request message to the Health Cloud ClinicalAlert object.
param
msg
is an ADT message.
paramclinicalAlertCodeSetBundleId
is the CodeSetBundle Id of the clinical alert.
paramaccountId
is a string with the Account Id.
paramcodeSetUndefined
is the CodeSetBundle undefined value to be used when no value is available.
paramclinicalEncounterId
is the HC ClinicalEncounter Id to use.
return A Health Cloud ClinicalAlert object.
fun getAllergyIntolerance (al1, allergyCodeCodeSetBundleId, accountId, clinicalEncounterId)
Converts the provided ADT request message to the Health Cloud AllergyIntolerance object.
param
msg
is an ADT message.
paramallergyCodeCodeSetBundleId
is the CodeSetBundle for the Allergy CodeId.
paramaccountId
is a string with the Account Id.
paramclinicalEncounterId
is the HC ClinicalEncounter Id to use.
return A Health Cloud AllergyIntolerance object.
HL7 Segment | Segment Field | Salesforce Object and Field | Salesforce Field Type |
---|---|---|---|
AL1.2 - Allergy Type | AL1.AL1-02.CWE-01 | AllergyIntolerance.Category | Picklist |
AL1.3 - Allergy Code | AL1.AL1-03 | AllergyIntolerance.CodeId | Lookup: CodeSetBundle |
AL1.4 - Allergy Severity | AL1.AL1-04.CWE-01 | AllergyIntolerance.Severity | Picklist |
AL1.5 - Allergy Reaction | AL1[0].AL1-05[0] | PatientHealthReaction.ManifestedSymptomId | Lookup: CodeSetBundle |
AL1.6 - Identification Date | AL1.AL1-06.AL1-06 | onset.onsetDateTime | DateTime |
fun getPatientHealthReaction (al1, manifestedSymptomCodeSetBundleId, allergyIntolerance_Id, index_al1)
Converts the provided ADT request message to the Health Cloud PatientHealthReaction object.
param
msg
is an ADT message.
parammanifestedSymptomCodeSetBundleId
is the Manifested.
paramallergyIntolerance_Id
is the associate AllergyIntolerance Id.
paramindex_al1
is the index of the AL1 List. Symptom CodeSetBundle Id to use.
return A Health Cloud PatientHealthReaction object.
fun getCareObservation (msg, accountId, clinicalEncounterId, idTypeIdMap, unitOfMeasureMap, valueInterpretationCodeSetBundleIds, methodIdCodeSetBundleIds, codeSetUndefined, componentTypeIdCodeSetBundleIds, observerIds)
Converts the provided ADT request message to the Health Cloud CareObservation object list.
param
msg
is an ADT message.
paramaccountId
is a string with the Account Id.
paramclinicalEncounterId
is a string with the ClinicalEncounter Id.
paramidTypeIdMap
is an object with the CodeSet values.
paramunitOfMeasureMap
is an object with the unit of measure name to the Id for lookup.
paramvalueInterpretationCodeSetBundleId
is the CodeSetBundle Id list for ValueInterpretation.
parammethodIdCodeSetBundleIds
is the CodeSetBundle Id list for MethodId.
paramcodeSetUndefined
is the CodeSetBundle undefined value to be used when no value is available.
paramobserverIds
is the list of observerId
paramcomponentTypeIdCodeSetBundleIds
is a list of component type Ids.
return A Health Cloud CareObservation object list.
HL7 Segment | Salesforce Object and Field | Type | |
---|---|---|---|
OBX-02 | CareObservation.ObservedValueType | Picklist | |
OBX-03.CWE-01 | CareObservation.CodeId | Lookup: CodeSetBundle | |
OBX-03.CWE-01 | CareObservationComponent.ComponentTypeCodeId | ||
OBX.5 | CareObservation.ObservedValueNumerator CareObservation.ObservedValueText | ObservedValueNumerator (NM) ObservedValueText(TX) | |
OBX-06.CWE-01 | CareObservation.ObservedValueUnitId CareObservationComponent.ObservedValueUnitId | Lookup: UnitOfMeasure | |
OBX-08[0].CWE-01 | CareObservation.ValueInterpretation CareObservationComponent.ValueInterpretation | Lookup: CodeSetBundle | |
NA | CareObservation.ObservationStatus | Picklist | |
OBX-14 | CareObservation.IssuedDateTime | DateTime | |
OBX.16 - Responsible Observer | CareObservation.ObserverId | Lookup: HealthcareProvider | Account |
OBX.16 - Responsible Observer | CarePerformer | Object | |
OBX-17[0].CWE-01 | CareObservation.MethodId | Lookup: CodeSetBundle |
fun getBaselineValues (obx07)
Get the Upper and Lower baseline values.
param
obx07
is an OBX-7 segment to map.
return An object with the LowerBaselineValue and UpperBaselineValue fields.
fun mapObxTypeAndValue (obx)
Maps the provided OBX segment to it's proper ObservedValueType and value in CareObservation.
param
obx
is an OBX segment to map.
return An object with the CareObservation fields.
fun getCareObservationComponentAttachments (msg, observation_Id)
Converts the provided ADT request message to the Health Cloud Attachment object list.
param
msg
is an ADT message.
return A Health Cloud Attachment object list.
fun mapAttachmentValue (obx)
Maps the provided OBX segment to it's proper ContentType and Body in HC Attachment.
param
obx
is an OBX segment to map.
return An object with the Attachment fields.
fun getCareObservationComponent (msg, unitOfMeasureMap, componentTypeIdCodeSetBundleIds, codeSetBundleUndefined, observation_Id, valueInterpretationCodeSetBundleIds)
Converts the provided ADT request message to the Health Cloud CareObservationComponent object list.
param
msg
is an ADT message.
paramunitOfMeasureMap
is an object with the unit of measure name to the Id for lookup.
paramcomponentTypeIdCodeSetBundleIds
is a list of component type Ids.
paramobservation_Id
is a list of observationIds.
_paramvalueInterpretationCodeSetBundleId
is the CodeSetBundle Id list for ValueInterpretation.
paramcodeSetBundleUndefined
is the undefined value to use for ComponentTypeCodeId if none is available.
return A Health Cloud CareObservationComponent object list.
fun mapObservationStatus (val)
Maps the value for OBX-11 to a matching ObservationStatus.
param
val
is the OBX-11 value.
return A Health Cloud picklist value for ObservationStatus.
fun getObxIdentifer (msg, observation_Id)
Converts the provided ADT request message to the Health Cloud CareObservationIdentifier object list.
param
msg
is an ADT message.
paramobservation_Id
is a list of observationIds.
_return A Health Cloud CareObservationIdentifier object list.
fun getRelatedPersontContactsRelationships (method, msg, relationRoleMap, mainContactId, contactId)
Converts the provided Contact FHIR object to the Health Cloud RelatedPerson contact-to-contact relationship of composite request.
param
method
is a string with POST or PATCH.
parammsg
is an ADT message.
paramrelationRoleMap
the role relationship map.
parammainContactId
is a string with the patient Contact Id.
paramcontactId
is a string with the related person Contact Id.
return A composite Health Cloud contact-to-contact relationship request.
maritalstatus
Maps the marital status object.
Source:
.src/main/resources/dwl/resources/codesystem/maritalstatus.dwl
Functions
fun mapMaritalStatus (code: String)
Maps the marital status with the provided code.
param
code
is a string with the status.
return A MaritalStatus object.
nametype
Maps the name type object.
Source:
.src/main/resources/dwl/resources/codesystem/nametype.dwl
Functions
fun mapNameType (code: String)
Maps the name type with the provided code.
param
code
is a string with the status.
return A NameType object.
telecomequipmenttype
Maps the Telecom Equipment Type object.
Source:
.src/main/resources/dwl/resources/codesystem/telecomequipmenttype.dwl
Functions
fun mapTelecomEquipmentType (code)
Maps the provided XAD-07 field to the proper Telecom Equipment Type object.
param
code
is a XTN-03 field to map.
return An telecom equipment type object or null if not found.
telecomusecode
Maps the telecom use code object.
Source:
.src/main/resources/dwl/resources/codesystem/telecomusecode.dwl
Functions
fun mapTelecomUseCode (code: String)
Maps the telecom use code with the provided code.
param
code
is a string with the code to map.
return A TelecomUseCode object.
util
This module defines a number of common
utility functions.
Source:
.src/main/resources/dwl/resources/util.dwl
Functions
fun mapGuid (InStr: String)
Generates a GUID with the provided string. This is helpful because the GUID generated is predictable.
param
InStr
is the input string to the hash function.
return A string with the predictable hashed value.
fun toString (data)
Converts anything to a JSON string representation. Note that if you are serializing an object datetime fields may have local timezone information so this can cause issues with repeatability for munit tests.
param
data
is the data type to convert to JSON.
return A JSON formatted string of the provided variable.
fun hl7ConvertDateTime (timeStr)
Converts a HL7 datetime string to the expected datetime string.
param
timeStr
is a HL7 datetime string formatted YYYYMMDDHHMMSS.
return A timestamp string formatted YYYY-MM-DDTHH:MM:SS.000Z.
fun addDurationToDateTime (timeStr, duration, durationUnits)
Add duration to datetime string to and return new datetime string.
param
timeStr
is a HL7 datetime string formatted YYYY-MM-DDTHH:MM:SS.000Z.
paramduration
is a number
paramdurationUnits
units is in minutes or hours or seconds
return A timestamp string formatted YYYY-MM-DDTHH:MM:SS.000Z.
fun hl7ConvertDate (dateStr)
Converst a HL7 date to date string.
param
dateStr
is a HL7 date string formatted YYYYMMDD.
return A date string formatted YYYY-MM-DD.
fun removeNull (arr: Array)
Removes all null items from an array.
param
arr
is an array.
return An array with null items removed.
fun removeNull (obj: Object)
Removes all null values from an object.
param
obj
is an object.
return An object with null values removed.
fun clean (obj: Object)
Cleans the provided object of blank strings, null values, empty objects, and empty arrays.
param
obj
is 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
arr
is an Array to clean.
return A cleaned Array.
fun strip (item, key: String)
Recursively strips the provided key name from any objects in the provided item.
param
item
is an value.
paramkey
is a String with the object key name to strip.
return The provided value with any instances of the key removed.
fun toEpochSeconds (str)
Converts the provided HL7 datetime string and converts it to a number with the number of seconds since epoch.
param
str
is a HL7 datetime string.
return A number with number of seconds since epoch.
fun fromEpochSeconds (seconds)
Converts the provided datetime as a number with seconds since epoch into the FHIR formatted datetime string.
param
seconds
is a number with the seconds since epoch.
return A string with the FHIR formatted datetime string.
fun replacePair (obj: Object, key: String, val)
Replaces a key value pair in an object with the provided object and key value set.
param
obj
is an object to replace in.
paramkey
is a string to match on.
paramval
is the value to replace with.
return An object with the replaced pair or null if no object is provided.