Page 1 of 1

Description from Restriction list

Posted: Wed Jan 03, 2007 4:43 pm
by dstx_1
Hello,
I am new to Datastage and need some help with map designer. I need to know if there a way to do a lookup in the map on the element restriction list ?.


For Example :
In a X12 210 invoice, there is a element BilledRatedAsQualifier and it has a include restriction list as follows:

Include Description
BA Barrels
BX Box.

In my map, when I encounter value BX , I need to display "Box" in my output file instead of the value "BX"

Thanks in advance for your help

Posted: Thu Jan 04, 2007 8:33 am
by boblopez1
Welcome Aboard, you'll notice that with TX there are many ways to skin a cat the simplest in this case is:

=IF(BilledRatedAsQualifier="BX","Box")

Regards,
Bob Lopez

Description from Restriction list

Posted: Thu Jan 04, 2007 9:48 am
by dstx_1
Bob, Thanks! for the response. But there are lot of values possible for BilledRatedAsQualifier and each one of them has a different description. The only place these values and it's description is available is in the Restriction list that is setup for this element.

I was hoping to read the value from the Inbound 210 X12 file and do a lookup against the restriction list to get the description.

Therefore what I was looking for was a way to access the restriction list from the map.

Thanks

Posted: Fri Jan 05, 2007 12:14 am
by jvmerc
As far as I know you can't refer to the description. You can refer to the 'include' value that the description defines.

Use the member function......

something like

if(member(element:with:include_value, {"XX", "ZZ", "30"}),
do process,
else do whatever)

If you bring up the function window in the map it will provide an example of how to define/format the rule.

Posted: Fri Jan 05, 2007 12:22 am
by jvmerc
Found this old example from an old 834 map. It converted the larger variety of HIPAA codes to our smaller group of internal relationship codes....

IF (MEMBER (Indiv'lRelationshipCd Element:INS Segment:Input, { "01", "25", "53"}), "2",
IF (MEMBER (Indiv'lRelationshipCd Element:INS Segment:Input, {"05", "07", "09", "10", "11", "12", "15", "17", "19", "23", "24", "38"}),
IF (Gender Field:Dependent:Output = "F", "3", "4"), "5"))

Re: Description from Restriction list

Posted: Fri Jan 05, 2007 10:24 am
by boblopez1
dstx_1 wrote:Bob, Thanks! for the response. But there are lot of values possible for BilledRatedAsQualifier and each one of them has a different description. The only place these values and it's description is available is in the Restriction list that is setup for this element.

I was hoping to read the value from the Inbound 210 X12 file and do a lookup against the restriction list to get the description.

Therefore what I was looking for was a way to access the restriction list from the map.

Thanks
Ok, that makes it a little clearer, what you may want to try is to open the Type Designer for the output field of field let's say UOM. In the properties box for UOM change the restriction to Character and Rule to Exclude. When you bring up the restriction list for UOM you'll notice an Exclude Column and a Reference String column. In the Exlude column you would add as an exmaple BX and in the reference string you would enter Box and do this for all qualifiers. Now when you map you simply map the UOM from the inbound, when the map executes it will produe the output based on the reference string automatically. This is used extensively in XML for Markup delimiters.

Hope this helps.
Bob

Posted: Fri Jan 05, 2007 1:58 pm
by jvmerc
If you only need to map the qualifier the tree solution is a good one and it will minimize code changes. Just update the exclude and recompile.

If you need to do more, though, you still need a good rule. Depending on your needs perhaps a combination of tree and rule is a good option.

Posted: Sun Jan 07, 2007 11:36 pm
by PS_IND
jvmerc wrote:If you only need to map the qualifier the tree solution is a good one and it will minimize code changes. Just update the exclude and recompile.

If you need to do more, though, you still need a good rule. Depending on your needs perhaps a combination of tree and rule is a good option.
There might be another way. I have never tried it but. Export the tree and create the XML. Use that XML as an input. I think you should see all the qualifier in it. If you do try please respond back, just curious to know.