FORMATTING INVISION FIELDS WITH $P=CHPPDVAL AND $P=CHPPGE51
By Jeff Ellis
Information in disparate fields is not always formatted in ways best used by foreign
systems. Therefore, many times it is necessary to concatenate separate fields into a
single field an interface, ancillary system, or even for INVISION Patient Accounting to
facilitate the transfer of this information. This process is easily done in INVISION
with the Data Evaluator process - profile PRALC and program $P=CHPPDVAL - and the concatenation
program $P=CHPPGE51.
The following is an example of just such occasion: the billing address needed to be
formatted and sent to Patient Accounting in 28 records. Since the associated address fields,
particularly the street address and city, are of variable lengths it was easier to concatenate
the billing address into one field that was properly formatted, and then to split the field
into 20 character segments for 28 record processing.
To accomplish this, first create a user field that is the length of all combined fields
being used. In this example the fields being used total 111 characters:
Address Line 1 35 characters
Address Line 2 35 characters
City 30 characters
State 2 characters
Zip Code 9 characters
Therefore, one field that is 111 characters long is created; in this example “UADDR”
is used. Next a PRALC member is created to set up the AUDA to concatenate the fields into
UADDR using program CHPPGE51 (Note: non-ENAD patient addresses are used for this
example; this process can be done in TCLs, but it is easier for testing to do with a PRALC
member):
IF "0PTADDAD" IS VALUED THEN "%GEIN"='0PTADDAD' ELSE "%GEIN"='%GESP';
IF "0PTADD02" IS VALUED THEN "%GEIN#02"='0PTADD02' ELSE "%GEIN#02"='%GESP';
IF "0PTADDCI" IS VALUED THEN "%GEIN#03"='0PTADDCI' ELSE "%GEIN#03"='%GESP';
IF "0PTADDST" IS VALUED THEN "%GEIN#04"='0PTADDST' ELSE "%GEIN#04"='%GESP';
IF "0PTADDZI" IS VALUED THEN "%GEIN#05"='0PTADDZI' ELSE "%GEIN#05"='%GESP';
"%GEIN#06"='%GESP';"%GEDESTN"='UADDR',"%GESP"='0',"%GESEPVL"='$',$P=CHPPGE51;
Next, a second PRALC member is created that will run after the first PRALC member in the
pathways. This member takes the target field of the first PRALC member (in this example
UADDR) and splits it into the 20-character segments needed for 28 record processing:
IF "UADDR" IS VALUED THEN
"5C49ADD1"=LEFT("UADDR",20), "5C49ADD2"=MID("UADDR",21,20), "5C49ADD3"=MID("UADDR",41,20), "5C49ADD4"=MID("UADDR",61,20), "5C49ADD5"=MID("UADDR",81,20), "5C49ADD6"=MID("UADDR",101,11);
These members will be executed through TCLs in your target pathway:
"PCALCID"='MEMBER1'
$PE=PCALCID
$P=CHPPDVAL
"PCALCID:='MEMBER2
$PE=PCALCID
$P=CHPPDVAL
Next a delete routine could be created to check to delete any of the 5C49ADD? members which are blank.
Use this process for any situation that needs to have INVISION fields formatted in a
particular way.