PriorAuthorization Support System API - Implementation Template

(0 reviews)

Developer guide

Prior Authorization Developer Guide

Prior Authorization provides helper functions for mapping FHIR objects to X12 ones and reverse.

ModuleDescription
fhirtoAdditionalInfo275Module that provides support for submit 275 request mapping.
fhirToSubmitRequest278Module that provides support for submit 278 request mapping.
submitResponse278toFHIRModule that provides support for submit 278 response mapping.
claimInquiryResponse278toFHIRModule that provides support for inquiry 278 response mapping.
fhirTo278InquiryModule that provides support for inquiry 278 request mapping.
x12SegmentToolsThis module implements X12 segment tools needed for 270 and 271 segments.
fhirConstantsThis module implements FHIR constants that are used in CoverageEligibilityRequest and Response mapping.
x12SegmentQualifiersThis module implements X12 segment qualifier functions.

fhirtoAdditionalInfo275

Module that provides support for submit 275 request mapping.

fhirToSubmitRequest278

Module that provides support for submit 278 request mapping.

submitResponse278toFHIR

Module that provides support for submit 278 response mapping.

claimInquiryResponse278toFHIR

Module that provides support for inquiry 278 response mapping.

fhirTo278Inquiry

Module that provides support for inquiry 278 request mapping.

x12SegmentTools

This module implements X12 segment tools needed for
270 and 271 segments.

Functions

fun getResource ( resourceBundle, resourceId, resourceType)

param resourceBundle is the payload bundle to be filtered.
param resourceId is the ID of the resource to be used for filtering resources.
param resourceType is the type of resource to be used for filtering resources. Use either resourceId or resourceType for filtering.

Function to get resource from bundle using either resourceId or resourceType.

fun createN3 ( n3Type, n301, n302)

param n3Type is a string with the N3 type.
param n301 is the first address line.
param n302 is the second address line.
return A formatted N3 address object.

Creates a N3 address object with the provided arguments.

fun createN4 ( n4Type, n401, n402, n403, n404, n407)

param n4Type is a string with the N$ type.
param n401 is a string with the address city.
param n402 is a string with the address state.
param n403 is a string with the address postal code.
param n404 is a string with the address country.
param n407 is a string with the address district.
return A formatted N4 address object.

Creates an N4 address (city, state, zip) object with the provided arguments. Limitation - Doesn't support N407. Assuming address is within United States of America, including its territories, or Canada

fun createDTP ( dtpType, dtp01, dtp02, dtp03)

param dtpType is a string with DTP type.
param dtp01 is a string with DTP qualifier.
param dtp02 is a string with DTP format qualifier.
param dtp03 is a string with DTP value.
return A formatted DTP object.

Creates a DTP (date time period) object with the provided arguments.

fun createREF ( refType, ref01, ref02)

param refType is a string with the provider code.
param ref01 is a string with the reference identification qualifier.
param ref02 is a reference with the ref02 element name being constructed with refType and REF02.
return X12 formatted REF segment.

Creates a REF segment with provided arguments.

fun getFHIRResource ( inRequest, resourceId)

param inRequest - Input request to the API.
param resourceId - ID of resource to be looked up.
return Resource Object for the matching resource.

Function to look up a resource from the bundle based on resource's ID. Example: Pass in an Organization's ID and the response would be the Organization object from the bundle.

fun createPER ( perType, per01, per02, per03, per04, per05, per06, per07, per08)

param perType is a string with the PER type.
param per01 is a string with the function code.
param per02 is a string with the Contact name.
param per03 is a string with the number qualifier.
param per04 is a string with the number value.
param per05 is a string with the second number qualifier.
param per06 is a string with the second number value.
param per07 is a string with the third number qualifier.
param per08 is a string with the third number value.
return A formatted PER contact information object.

Creates a PER contact information object with the provided arguments.

fun createSV303 ( inputData)

param inputData is a claim resource object.
return A SV303 oral cavity object.

Creates a SV303 oral cavity designation object with the provided arguments.

fun createSV3 ( inputData)

param inputData is a claim resource object.
return A formatted SV3 dental service object.

Creates a SV3 dental service object with the provided arguments.

fun createSV1 ( sv101_01, sv101_02, sv101_03, sv101_04, sv101_05, sv101_06, sv101_07, sv101_08, sv102, sv103, sv104)

param sv1_1 is a string with the EPSDT indicator.
param sv1_2 is a string with product or service ID qualifier.
param sv1_3 is a claim resource object.
return A formatted SV1 professional service object.

Creates a SV1 professional service object with the provided arguments.

fun createSBR ( perType, per01, per02, per03, per04, per05, per09)

param perType is a string with the PER type.
param per01 is a string with the Contact Function Code.
param per02 is a string with the Contact name.
param per03 is a string with the Communication Number Qualifier.
param per04 is a string with the Communication Number.
param per05 is a string with the Communication Number Qualifier.
param per09 is a string with the Contact Inquiry Reference.
return A formatted PER contact information object.

Creates a SBR contact information object with the provided arguments.

fun genderLookup ( gndr)

param gndr is the string with gender type.
return A required gender value.

Formats the provided gender string into a valid gender string that can be cast to the gender value.

fun createDMG ( dmgType, dmg01, dmg02, dmg03)

param dmgType is a string with the DMG type.
param dmg01 is a string with the format qualifier.
param dmg02 is a patient object.
return A formatted DMG demographic information object.

Creates a DMG demographic information object with the provided arguments.

fun payerSequenceNumberPayerLookup ( code)

param gndr is the string with gender type.
return A required gender value.

Formats the provided gender string into a valid gender string that can be cast to the gender value.

fun relationCodeX12FHIR ( inCode)

param inCode X12 relationship code.
return FHIR format relationship code.

Function to convert X12 relationship code to FHIR format.

fun genderLookupX12FHIR ( inCode)

param inCode X12 Gender code.
return FHIR format Gender code.

Function to convert X12 Gender Codes to FHIR format.

fun telecomTypeX12FHIR ( inCode)

param inCode X12 relationship code.
return FHIR format relationship code.

Function to convert X12 telecom codes to FHIR format.

fun createTelecom ( perSegment)

param perSegment PER segment from X12 message.
return telecom object formatted per FHIR specification.

Function create telecom object for FHIR resource using X12 PER segment.

fun pluckValuefromSeg ( segment, selector)

param segment from which the element value is to be extracted.

Function to fetch an element from the segment with the key name prefix.

fun createPWK ( pwkType, pwk01, pwk02, pwk05, pwk06)

param pwkType Describes the PWK segment being mapped.
param pwk01 Report Type code.
param pwk02 Report Transmission code.
param pwk05 Attachment control number.
param pwk06 Attachment description.
return X12 formatted BIN segment.

Function that creates a PWK segment using the provided parameters.

fun createMSG ( msgType, msg01)

param msgType Describes the MSG segment being mapped.
param msg01 Message to be written to MSG segment.
return X12 formatted MSG segment.

Function create MSG segment using the provided parameters.

fun benefitTypeLookup ( x12BenefitType)

param x12BenefitType - X12 benefit type.
return FHIR benefit format benefit type.

Function to translate X12 benefit type to FHIR format.

fun createPRV ( prvType, prv01, prv02, prv03)

param prvType describes the provider type being mapped. Not currently in use now, but it could be used if multiple PRV segments with varying fields names are required.
param prv01 is a string with the provider code.
param prv02 is a string with the reference identification qualifier.
param prv03 is a string with the provider taxonomy code.
return X12 formatted PRV segment.

Creates a PRV provider information object with the provided arguments.

fun termTypeLookup ( x12TermCode)

param x12TermCode - X12 term type.
return FHIR format term type.

Function to convert term type from X12 to FHIR.

fun createResponseItem ( item, fhirConstants)

param item - item is the input x12's EB segment.
param itemCategorySystem - system identifier for item's category.
return - An array of item with benefit and other details.

Function to create an item array within CoverageEligibilityResponse.

fun fetchBenefitLoop ( dependentPatientExists, benefitsLoop)

param dependentPatientExists - Boolean indicating if the patient is the subscriber or dependent.
param benefitsLoop - X12 271's 2100C or 2100D based on the patient being a dependent or subscriber.

Function to fetch the benefits loop based on the patient being a subscriber or a dependent.

fun createCoverageEligibilityResponse ( fhirConstants, covRespId, bhtSegment, patientId, requesterType, requestorId, outcome, payorId, coverageId, benefitPeriod, benefitsLoop, dependentPatientExists)

param fhirConstants - List of constants used to for identifiers and system.
param covRespId - Unique ID for CoverageEligibilityResponse.
param bhtSegment - BHT segment from X12 271 input.
param patientId - the patient's ID (either subscriber or dependent) from X12 271 2100C Loop.
param requesterType - Type of the party sending the CoverageEligibilityRequest can be either Practitioner or Organization.
param requestorId - ID of the sender of the CoverageEligibilityRequest.
param outcome - Outcome of the 271 X12 based on AAA segment.
param payorId - ID of the Information Source i.e. the payer in this case.
param coverageId - ID of the Coverage created as part of the bundle.
param benefitPeriod - Benefit begin and end date.
param benefitsLoop - 2110D or 2110C loop of the X12 271 based on the patient.
param dependentPatientExists - Boolean indicating if patient is the subscriber or dependent.

Function to create CoverageEligibilityResponse.

fun RelationshipLookup ( relateship)

param relateship is the string with gender type.
return A required gender value.

Formats the provided coverage relationship string into a valid relationship string that can be cast to the relationship value. Limitation: Only supports FHIR relations: Spouse, Child and Other Relationship.

fun createINS ( insType, ins01, ins02)

param insType - INS segment for patient(subscriber or dependent).
param ins01 - insured indicator.
param ins02 - relationship to insured.
return An X12 formatted INS segment.

Function to create INS segment with provided input parameters.

fun createINS ( insType, ins01, ins02, ins08)

param ins01 is an Insured Indicator value.
param inso2 is value for Individual Relationship Code.
param ins08 is a string with Employment Status Code.
return X12 formatted INS segment.

Creates an INS object with the provided arguments.

fun insuredRelationLookup ( relCode)

param relCode is the code with relationship type.
return A required relationship code.

Formats the provided relationship code into a valid code that can be cast to relationship code.

fun createBIN ( bin01)

param bin01 is a Binary Data value.
return X12 formatted BIN segment.

Creates a BIN object with the provided arguments.

fun createEFI ( efi01)

param efi01 is a Security Level Code.
return X12 formatted EFI segment.

Creates a EFI (Electronic Format Identification) object with the provided arguments.

fun createCAT ( cat01, cat02)

param cat01 is a Attachment Report Type Code.
param cat02 is a Attachment Information Format Code.
return X12 formatted CAT segment.

Creates a CAT (Category Of Patient Information Service) object with the provided arguments.

fun createLX ( lx01)

param lx01 is a Assigned Number.
return X12 formatted LX segment.

Creates a LX object with the provided arguments.

fun createNX1 ( nx1_01)

param nx1_01 is a Entity Identifier Code.
return X12 formatted NX1 segment.

Creates a NX1 object with the provided arguments.

fun providerTypeLookup ( inCode)

param inCode FHIR format lookup value.
return X12 format qualifier for provider.

Function to convert provider type from FHIR to X12 format.

fun lookupPERCommType ( inCode)

param inCode - Telecom system in FHIR.
return X12 format communication type qualifier.

Function to convert PER segments from FHIR format to X12 format.

fun extensionLookUp ( extension, valueType, url)

param extension - Array of extensions to be filtered.
param valueType - Defines whether extension is of valueCodeableConcept or string.
param url - URL of the extension being filtered identifying MilitaryStatus, leveOfService etc.

Function to lookup extension using URL comparison and return the appropriate code based on type of extension.

fun fetchSupportingInfo ( supportingInfoArray, eventCode, eventSystem)

param supportingInfoArray - List of supportinginfos from FHIR PAS Claim Resource.
param eventCode - Codeable concept's code to filter the list.
param eventSystem - Codeable concept's system to filter the list.
return - supportingInfo from FHIR Claim that matches the code and system.

Function to fetch claim resource's supporting Info for Patient Event, Admission, Discharge, AdditionalInfo, Message etc.

fun formatPeriod ( periodObject)

param periodObject is an FHIR-formatted period object.
return An X12 period range string.

X12 formats the period range string with the provided FHIR period object.

fun formatDateTime ( str)

param str is the current datetime string.
return A datetime formatted string.

Formats the provided date string into a valid datetime string that can be cast to a date or a time.

fun createTRN ( trnType, trn01, trn02, trn03, trn04)

param trnType is a string with TRN type.
param trn01 is value for Trace Type code.
param trn02 is a string with TRN type Trace Number.
param trn03 is a string with Trace Assigning Entity Identifier.
param trn04 is a string with Trace Assigning Entity Additional Identifier.
return X12 formatted TRN segment

Creates a TRN object with the provided arguments.

fun createHI ( hi101, hi102, hi201, hi202)

param hi101 - Diagnosis code classification library identifier.
param hi102 - Diagnosis code.
param hi201 - Diagnosis code classification library identifier.
param hi202 - Diagnosis code.
return An X12 formatted HI segment.

Function to create HI segment with provided input parameters.

fun createHI ( hi01, hi02)

param hi01 is a segment qualifier for diagnosys code admitting.
param hi02 is a segment qualifier for diagnosys code principal.
param hi03 is a segment qualifier for diagnosys code patientreasonforvisit.
param hi04 is a string with diagnosys code.

Creates a HI healthcare information object with the provided arguments.

fun createUM ( um01, um02, um03, um0401, um0402, um0501, um0504, um06)

param um01 is request category code.
param um02 is certification type code.
param um03 is service type code.
param um0401 is a sub element of UM04 for facility code.
param um0402 is a sub element of UM04 for facility code qualifier.
param um0501 is a sub element of UM05 for related causes code.
param um0504 is a sub element of UM05 for state or province code.
param um0506 is the level of service code.
return X12 formatted UM segment.

Creates an UM object with the provided arguments.

fun createSubmit2000ELoop ( inRequest, claimResource, segmentQualifiers, fhirConstantsObj, patientDates, claimSupportingInfo)

Function creates 2000E_Loop and its child loops like 2010EA and 2000F. 2000E_Loop includes TRN, UM, DTP,HI,PWK,MSG, 2010EA_Loop and 2000F_Loop. 2010EA_Loop includes NM1, N3, N4, PER, PRV. 2000F_Loop includes TRN, REF, UM, DTP, SV1 or SV2. This loop can occur in either 2000C at the subscriber level, when the subscriber is the patient, or it can occur at 2000D at the beneficiary level, when a dependent of the subscriber is the patient.

fun getEventLoop ( loop2000E, loop2000FExists)

param loop2000E is the 2000ELoop from X12 278 Response
_param
loop2000FExists is a boolean that identifies presence of 2000FLoop
_return
Loop structure of either 2000E or 2000F

Function to get EventLoop from 2000E or 2000F. There are situations where, 2000F loops are not populated in the X12 message. This function looks at both and returns the one that is present

fun getExtensionValue ( LoopESegName, LoopFSegName, LoopE_Element, LoopF_Element, loop2000FExists, loop2000E)

param LoopESegName is the segment name from 2000ELoop of X12 278 Response
_param
LoopFSegName is the segment name from 2000ELoop of X12 278 Response
_param
LoopE_Element is the element name from 2000ELoop of X12 278 Response
_param
LoopF_Element is the element name from 2000ELoop of X12 278 Response
_param
loop2000FExists is a boolean that identifies presence of 2000FLoop
_param
loop2000E is the 2000ELoop from X12 278 Response
_return
Loop structure of either 2000E or 2000F

Function to get extension values segment in either 2000E or 2000F loops. There are situations where, 2000F loops are not populated in the X12 message. with parameters LoopESegName,LoopFSegName,LoopE_Element,LoopF_Element,loop2000FExists,loop2000E This function looks at both and returns the element from 2000F_Loop if it exists else from 2000E_Loop

fun createInquiry2000ELoop ( inRequest, claimResource, segmentQualifiers, fhirConstantsObj, patientDates, claimSupportingInfo)

Function creates 2000E_Loop and its child loops like 2010EA and 2000F. 2000E_Loop includes TRN, DTP, 2010EA_Loop and 2000F_Loop. 2010EA_Loop includes NM1, N3, N4, PER, PRV. 2000F_Loop includes TRN, UM, HCR, REF, DTP, SV1 or SV2. This loop can occur in either 2000C at the subscriber level, when the subscriber is the patient, or it can occur at 2000D at the beneficiary level, when a dependent of the subscriber is the patient.

fun createHCR ( hcr01)

param hcr01 is a string with the action code for HCR.
return X12 formatted HCR segment.

Creates a HCR segment with provided arguments.

fhirConstants

This module implements FHIR constants that are used in CoverageEligibilityRequest and Response mapping.

Functions

fun fhirConstants ( )

return A map of constants used.

Gets the constants used in lookup functions.

x12SegmentQualifiers

This module implements X12 segment qualifier functions.

Functions

fun getSegmentQualifiers ( )

return A map of segment qualifiers.

Gets the segment qualifiers for the 270 and 837 transactions.


Reviews

TypeTemplate
OrganizationMulesoft
Published by
MuleSoft Organization
Published onDec 14, 2022
Asset overview

Asset versions for 1.0.x

Asset versions
VersionActions
1.0.4