Trailer to have the count no.of records - biztalk

I have the output schema which should look in the following format
Header
Memeber 01
Benefit 01
Benefit 02
Memeber 02
Benefit 01
Benefit 02
Benefit 03
Trailer-Count 09
The Trailer should have the field element called count which should hold the count of the no.of records. How should we approach this should I create a custom pipeline component or can we do this through mapping. Any help is greatly appreciated.

Not sure what's your message type, If your send port is designed to receive individual member messages then assembly them together, yes, a custom pipeline component shall be used.
If your message already have the Header and Trailer defined, you can simply use a map to count the member nodes count without using a custom pipeline component

Related

Debatching Biztalk flat file message into individual grouped flat files based on value

Have an issue where I am trying to debatch a flat file in BizTalk Server (comma delimited to tab-delimited) into individual flat files based on a value (in this example it would be PONumber) in the original file.
Sample input:
PartNumber,Weight,PONumber,Other
21519,234,46788,1
81919,456,47115,1
91910,789,47115,1
This would outcome into 2 messages such as:
PartNumber Weight PONumber Other
21519 234 46788 1
and
PartNumber Weight PONumber Other
81919 456 47115 1
91910 789 47115 1
I have seen similar things but no definite answers, or samples are dead links. Does anyone have a sample where they have done something like this or have a good solution?
Option 1: Convoy pattern
Change your schema so that it has a max occurs of 1 for the PO line, this will debatch each line into it's own messages when it is received.
Promote the PONumber so that it is a promoted property in the message context.
Have an Orchestration that has a correlation set based on the PO number, and initialises this on the first receive shape.
Have a receive shape with a following correlation that is in a wait shape inside a loop to receive all the other lines with the same PO number and combine them into a single message.
Option 2: Staging database
The other option is to just insert all of the rows into a SQL database, and then have a stored procedure that you poll that gets all the lines for a single PO.
This can sometimes be simpler, and avoids the issue of Zombies as you can implement this as a messaging only pattern or using a simpler Orcherstration without a loop.

Presenting relational data as columns in table

Trying to figure out how to present/edit related data in a table, could really use a push in the right direction!
Broadly, this is looking at subscription data - I want to see how much each client is paying per month. If a client gets upsold halfway through the year - I need the data to reflect that.
So, I have a database of clients, and a database of months, with a Many-One relationship. I also have a "monthlyallocation" database related to both, so I can say Client A has $40 for Jun 2017, for eg. I'm looking to present the data like so in a table, and make the numbers editable:
Jun Jul Aug Sep
Client A 20 20 22 20
Client B 15 20 15 15
Client C null 11 11 12
So I can filter out months (columns), and I can filter out Clients (rows). Any help appreciated!
************EDIT - So I've managed to get partway there.
First, the datasource for the table needs to Client - since I want my table rows to be grouped by client.
Next, the page has a custom property "datenum" which I can change to help filter out columns.
Each column header now becomes #datasources.Months.items..MonthName[#properties.datenum + Insert Column Number Here]. As the datenum changes, the columns display different names. Great.
The last piece of the puzzle though - the values shown IN the table need to filter by the column header name. I can't do the "[#properties.datenum + Insert Column Number Here]" trick here, in case I'm missing a value.. If I did that, I could accidentally get the Sep value under Aug, for eg.
Really hope that makes sense - my first instinct is to make a script that takes the rows datasource, and the "MonthName[#properties.datenum + Insert Column Number Here]", and return the correct value, but maybe I'm just misunderstanding how binding works and there's a simpler way to do this.
For filtering out clients, check out this tutorial: https://developers.google.com/appmaker/tutorials/establish-relations/
It shows how to create a data query with a filter, which is basically what you need for that.
Filtering out columns is a bit tougher, at least I haven't figured an easy way to do it yet.
DISCLAIMER: Out there, there are probably solutions that are much better than this one. This is just to give you a thought.
I've solved this problem by using a custom property List named 'isVisible' for the page the table is in. Then I've added a multi select named 'ColumnPicker' into the page.
After each change in the ColumnPicker, I sync the changes with isVisible. Each column's visibility (for both header and data parts) are connected to:
#widget.root.properties.isVisible[#widget.childIndex]
So using the widget's index, I relate it to the isVisible list.
Here's the sync function I'm using:
function syncColumnPickerValuesWithIsVisible(columnPickerWidget, newValues) {
setIsVisibleAllSameValue(columnPickerWidget, false);
newValues.forEach(function(element) {
columnPickerWidget.root.properties.isVisible[element] = true;
});
}
So in the sync, I first set all isVisible values to false. Then I use the newValues array that the multi select provides to set the correct isVisible elements as true.
=> Items selected from the multi select are shown as columns in the table.

BizTalk routing messages in message box based on field value

I have an exercise I'm working to complete; previously it was de-batching multiple XML messages from one file into individual files. Then I had to route individual files based on a field value which had been promoted using filters on a port. Now the exercise has evolved into taking a multi record XML file, breaking it down to individual XML records, and routing their output to different folders based on a value in one of the fields. The hurdles are as follow:
I can't promote a repeating field such as the one I have to use to sort the outbound messages
The value of the field is a system.int32; I am sorting on a "equal to or more than 900" and "less than 900" so I need the int type.
Beyond simple "idNUm >= 900" I am in over my head with the necessary expression(s).
I have the basic orchestration design down, I am just lacking the expressions. The node I am looking to validate against is IDNum, and occurs in each record.
UPDATE: Still not working
I put in the following in my expression: IDNumDefined.Customer.IDNum >= 900
and I get "identifier Customer does not exist in "IDNumDefined"; are you missing an assembly reference?" and "unexpected token '>=' "
Ideas? (sorry about not updating question here)
The debatching has to occur using an Envelope and Body schema.
Once you have this figured out, the debatching can occur using a simple XML disassembler. In the body schema you can quick promote your idNum field by associating a PropertySchema with it.
Once this is taken care of, it is easy to use 2 send ports in order to set your filter subscription(s).

Suggest Box not working for SQL

I'm seeing an error when typing into a suggest box:
Thu Dec 08 10:45:58 GMT-700 2016
Speckle models do not support distinct sorted field values. Error: Speckle models do not support distinct sorted field values.
E
Thu Dec 08 10:45:58 GMT-700 2016
Query for field suggest oracle.: (Error) : Speckle models do not support distinct sorted field values.
E
Thu Dec 08 10:45:58 GMT-700 2016
Query for field suggest oracle. failed.
Value of the suggest is set to:
#datasource.query.filters.project._equals
and the suggestions are set to the datasource and field project.
I have also un-checked "Value is a record" as that is an error already in the editor.
I can use a normal text box and the same value to filter the data which works fine but would prefer the ability to select from suggest.
Support for using suggest text field with SQL is coming in the next few weeks. I will respond to this question again when it is added.
CloudSQL support for Suggest text field is released. Please give it a try.

How to generate 837 DAT file with ICD10 code in Biztalk?

My 'BizTalk' application 'convert' txt file to 'DAT(EDI 837 005010X222A1)' file format.
'Now change is Need to generate DAT file with ICD10 code'
Question are
How I generate DAT with like 'HI*ABK'? right now in Combined837Doc.map, 'BK' is hardcoded
Should I change 'X12_00501_837_P.xsd'?
How BizTalk decide ABK | ABF | ABN | ABJ HI qualifier based on passed ICD code?
BK ---> Primary Diagnosis code -->ABK
BF ---> Secondary Diagnosis code -->ABF
BN ---> External Cause of injury -->ABN
BJ ---> Admitting Diagnosis -->ABJ
PR ---> Patient Reason for Visit -->APR
BR ---> Primary Procedure code -->BBR
BQ ---> Secondary Procedure code -->BBQ
BizTalk will not handle this in any sort of automatic way. The 837 XSDs will give you clues about what qualifiers are valid for a particular field, but they do not get set on those fields unless you set them in the map - either in the Value property of the destination node or via the output of a link (from a source node or functoid). You should not modify the XSD unless you need to support a non-standard qualifier that you and your trading partner have agreed to use - but you should stick to the standard qualifiers and encourage/require your partners to do so as well to avoid the need of such customization, and if you do make such modifications it should be to a trading partner version of the schema that gets properly mapped to a canonical format that does use the standard codes.
To further clarify, if you need to set the primary diagnosis code to BK and set other diagnostic codes to ABK, you have to provide that output from the map. You also have to ensure that you link to the proper HI node - only the first HI node for the Primary Diagnosis will accept BK as the qualifier (per WPC standards); subsequent ones can have ABK. I've written a couple blogs on this topic here and here.
What you really need here is to review the WPC specification for the Professional Claim v. 5010 and your trading partner's companion guide for the claim. These will provide all of this information so you can do your mapping correctly. You will also very likely need to work with an EDI claims specialist to get this right - HIPAA transactions are particularly challenging, and the claim forms are probably the most complicated of them.

Resources