BuildHIPAALetter

Construct HIPAA Letter

Minor Business Rule

Object Name: N0800375

Parent DLL: CHRM

Location: Client

Language: NER

Functional Description

Purpose


The purpose of this business function is to process mail merge functionality so that mail merge 

documents can be processed.


Setup Notes and Prerequisites


Mail Merge document to use must be set up.  In this case, the mail merge template letter should be 

set up in P980014.


Special Logic


Technical Specification


Data Item Data Structure DescriptionI/OReqNotes

AN8mnAddressNumberIRThe address book number of the employee.

DRQJjdDateRequestedJulianInThe date that an item is scheduled to arrive or that 

an action is scheduled for completion.

RQTImnTimeRequestedHHMMSSInThis is the time when an item is to arrive or an 

action is to be completed.

OBNMszNameObjectI/onThe COBRA document name

EV01cProcessFlagI/OnThe flag that is used to Open, Write and close the 

output file (1=Open the file, 2=Gather data and write file, 3=Close the file)

HLNKszNameofDocumentFile



1.0Read the process flag passed in.  

1.1If it is blank or 1, open the data file for output through B0500029.
1.2If it is blank or 2, 

1.2.1Process all benefit plans for employee
1.2.1.1Select/Fetch next all plans for employees through F08330
1.2.1.1.1Get the mailing name for the employee through F0111 Get Mailing 
Name

1.2.1.1.2While you're still fetching records from the F08330

1.2.1.1.2.1Fetch single from F08320 to get the plan information
1.2.1.1.2.2Check to see if it was active enrollment

1.2.1.1.2.3Check to see if it was a COBRA plan.  If it is, write 

that record to the output file

1.2.1.1.2.4Get the name of the provider from the F0101

1.2.1.1.2.5 Find the difference between the previous plan and the next 

plan. If the difference is less than or equal to 63 days, then write 

HIPAA Letter for all the plans. Else write HIPAA Letter only for the most 

recent plan.

1.2.1.1.2.6Write the record to the output file through B0500029 Write 

HIPAA Letter - All qualifying events

1.2.1.2Fetch Next from the F08330
1.3If it is blank or 3, 
1.3.1Close the data file through B0500029
1.3.2Call P980013 to bring up the mail merge document with merged fields 

Data Structure

D0800375 - Construct HIPAA Letter

Data Item Data Structure DescriptionI/OReqNotes
AN8mnAddressNumberIRThe address book number of the employee.

DRQJjdDateRequestedJulianInThe date that an item is scheduled to arrive or that 

an action is scheduled for completion.

RQTImnTimeRequestedHHMMSSInThis is the time when an item is to arrive or an 

action is to be completed.

OBNMszNameObjectI/onThe COBRA document name

EV01cProcessFlagI/OnThe flag that is used to Open, Write and close the 

output file (1=Open the file, 2=Gather data and write file, 3=Close the file)

HLNKszNameofDocumentFile


Parameter NameData ItemData TypeReq/OptI/O/Both
mnAddressNumberAN8MATH_NUMERICOPTNONE

Data Item  ab Data Structure  Descriptionab  I/Oab  Reqab Notes
AN8abab  mnAddressNumberabab  Iab  RabThe address book number of the employee.


jdDateRequestedJulianDRQJJDEDATEOPTNONE

Data Item  ab Data Structure  Descriptionab  I/Oab  Reqab Notes
DRQJabab  jdDateRequestedJulianab  Iab  nabThe date that an item is scheduled to arrive or that an 

action is scheduled for completion.


mnTimeRequestedHHMMSSRQTIMATH_NUMERICOPTNONE

Data Item  ab Data Structure  Descriptionab  I/Oab  Reqab Notes
RQTIabab  mnTimeRequestedHHMMSSab  Iab  nabThis is the time when an item is to arrive or an action is to 

be completed.


cProcessFlagEV01charOPTNONE

Data Item  ab Data Structure  Descriptionab  I/Oab  Reqab Notes
EV01abab  cProcessFlagabab  I/Oab  nabThe flag that is used to Open, Write and close the output file 

(1=Open the file, 2=Gather data and write file, 3=Close the file)


szNameOfDocumentFileHLNKcharOPTNONE

Data Item  ab Data Structure  Descriptionab  I/Oab  Reqab Notes

szNameObjectOBNMcharOPTNONE

Data Item  ab Data Structure  Descriptionab  I/Oab  Reqab Notes
OBNMabab  szNameObjectabab  I/oab  nabThe COBRA document name


mnWebMailMergeUniqueIDMMUIDMATH_NUMERICOPTNONE

A unique value that links a record in the Web Mail Merge Letters table (F05WEBMM) to one or many records in the Mail Merge Runtime 
Web Data table (F980014D). The system generates this value by adding 1 to the MMUID record in the Web Mail Merge Letters table that 
represents the largest value. The resulting value is the primary, unique key for the Web Mail Merge Letters table.

Related Functions

None

Related Tables

None