Homepage › Clovertech Forums › Read Only Archives › Cloverleaf › Cloverleaf › Help: char-delimited field to iterate in XLT
- This topic has 11 replies, 3 voices, and was last updated 10 years, 3 months ago by Jim Kosloskey.
-
CreatorTopic
-
May 27, 2014 at 7:13 pm #54230Gabriel MendesParticipant
Hi guys, good morning My experience with Cloverleaf is not very advanced and I need some help with the following matter, and I hope you can help me:
I have a flat file as an input, which needs to be translated to an ORU_R01.
each line of the report in this flat file needs to be inserted into an OBX segment.
is there a way for me to iterate each line of this report into a OBX as a repeating segment?
I know maybe with list iteration, but I don’t have much experience with this kind of iterations in XLT.
Also, do I map the values into a VRL?
Any help will be deeply appreciated
Gabriel Mendes
-
CreatorTopic
-
AuthorReplies
-
-
May 27, 2014 at 9:27 pm #80658Jim KosloskeyParticipant
If there is some way of identifying each line then you could define this as an HRL (possibly with VRL, FRL, or even other HRL as members).
Especially if you can identify the report lines from the other lines.
Then in the HRL you would indicate the VRL would repeat as long as the field which identifies the report lines has the proper ID.
email: jim.kosloskey@jim-kosloskey.com 29+ years Cloverleaf, 59 years IT - old fart.
-
May 28, 2014 at 10:46 am #80659Gabriel MendesParticipant
Jim, thank you very much for your response.
In fact, I must translate not only this repeating segment, but also other literal information (patient name, patient ID…)
How should I organize my input message format, in my XLT? A VRL with the literal information and a separated VRL for the report and a HRL with two fields: patient info and report?
How do i translate my message into a HRL?
Sorry do dig into this. I have never used HRL
Attached, my VRL and my CSV, generated via TCL from my text file. I replaced every line break with a n
Sincerely
-
May 28, 2014 at 11:18 am #80660Jim KosloskeyParticipant
Gabriel,
I will be fairly busy this AM (USA Eastern time) but will respond in more detail later if someone else does not before then.
For know it would be helpful if you shared the design of the messages such as what each column means and what the potential values are.
For instance the ‘Action column is that some kind of line/record ID?
email: jim.kosloskey@jim-kosloskey.com 29+ years Cloverleaf, 59 years IT - old fart.
-
May 28, 2014 at 11:27 am #80661Gabriel MendesParticipant
Jim,
all the columns are textual information. The most important thing is that the “Report” is a repeating column, which does not have a fixed repeat number.
I changed the strategy now. I created two VRL: Patient info and Report. the report vrl has only one field, which is “report text”.
Now I created a HRL with both VRL. Patient is not repeating and report is.
Do you think this will work? How do I test a HRL? with a comma delimited file?
I made the report segment in my HRL as a fixed repeating segment (10), cause i don’t know how to create a condition (example, till it ends)
-
May 28, 2014 at 2:35 pm #80662Jim KosloskeyParticipant
Gabriel,
Is there anything in the report lines that identify them as the report lines?
Sometimes in these kinds of files there is a code in each record identifying the type of record it is.
email: jim.kosloskey@jim-kosloskey.com 29+ years Cloverleaf, 59 years IT - old fart.
-
May 28, 2014 at 4:52 pm #80663Gabriel MendesParticipant
Yes, there is.
In fact, I was able to extract this info from a file and managed to map them into a HRL.
My main issue now is how do I declare the number of repetitions (its fixed with 50, but its variable, depending on the number of lines) and how do I iterate in the XLT
-
May 28, 2014 at 5:21 pm #80664Gabriel MendesParticipant
I managed to make It work.
Solution:
Input: HRL
Output: HL7 ORU
Iterate: Segment
Result from Testing Tool:
[0:TEST] The list of addresses are totally unresolvable
[0:TEST] [mid:0x31ea87c] unknown segment ” — ignored.
0(0).MSH(0) : >|^~&|CRIS|Radiology|PACS|Radiology|20140528122306||ORU|0019061702|P|2.3<
1(0).0(0).0(0).PID(0) : >|||0002192920||TEST VERS#O 14.04.02.01 (F)<
1(0).1(0).0(0).ORC(0) : >|||0019061702<
1(0).1(0).0(0).OBR(0) : >||0019061702|0019061702<
1(0).1(0).1(0).OBX(0) : >||ST|||
|||||||F<1(0).1(0).1(1).OBX(0) : >||ST||||||||||F<
1(0).1(0).1(2).OBX(0) : >||ST||||||||||F<
1(0).1(0).1(3).OBX(0) : >||ST|||asfget 5 554t t435 5 334 4 4345 4 t4 4 4 5 yw45 |||||||F<
1(0).1(0).1(4).OBX(0) : >||ST|||v 3434 3454 54|||||||F<
1(0).1(0).1(5).OBX(0) : >||ST|||5 56 |||||||F<
1(0).1(0).1(6).OBX(0) : >||ST|||56 |||||||F<
1(0).1(0).1(7).OBX(0) : >||ST|||y7j 67j |||||||F<
1(0).1(0).1(8).OBX(0) : >||ST||||||||||F<
1(0).1(0).1(9).OBX(0) : >||ST||||||||||F<
1(0).1(0).1(10).OBX(0) : >||ST||||||||||F<
1(0).1(0).1(11).OBX(0) : >||ST||||||||||F<
1(0).1(0).1(12).OBX(0) : >||ST||||||||||F<
1(0).1(0).1(13).OBX(0) : >||ST|||REPORT|||||||F<
1(0).1(0).1(14).OBX(0) : >||ST||||||||||F<
1(0).1(0).1(15).OBX(0) : >||ST||||||||||F<
[…]
Jim, thank you very much for your help!
The only think I need to do now is to make as many OBX segments as newlines in the file. this way, I’m always generating 50 OBX Segments. Can you help with this, please?
-
May 28, 2014 at 6:50 pm #80665Jim KosloskeyParticipant
Gabriel.
In your HRL at your VRL segment for the OBX lines specify ‘Repeat While’ and indicate the ‘Field:’ as XXX.yyyy where XXX is the name of the VRL and yyyy is the name of the field in that VRL which has the value indicating this is a OBX record.
For the ‘Value:’ as the value which the field above contains which indicates the record is a OBX record.
So the VRL for the lines seems to be ‘Report’ and let’s assume (since you did not state) that MESSAGE_ID is the field that indicates a report record (and let’s also assume the value in that field is ‘detail’ when it is a report line).
Your ‘Field:’ value in the ‘Repeat While’ would be ‘Report.MESSAGE_ID’ and the ‘Value:’ value would be ‘detail’.
So as long as a lline has ‘detail in the MESSAGE_ID position of the Report VRL you can ITERATE.
As for how to ITERATE it would be a segment iteration and the basis would be the element in the inbound tree which is the VRL which repeats.
email: jim.kosloskey@jim-kosloskey.com 29+ years Cloverleaf, 59 years IT - old fart.
-
May 29, 2014 at 12:36 am #80666Charlie BursellParticipant
If it were me, and it is not, I would normalize the input to HL7. It is easy enough to create a simple variant message with a dummy MSH and create repeating segments for your lines
HRL is very unwieldy especially for input. Not too bad on the output. Given this same problem most of the experienced implementers I know would prefer to normalize to HL7
-
May 29, 2014 at 11:45 am #80667Gabriel MendesParticipant
Guys, thanks for the replies
Jim, the main issue is that The patient_info don’t repeat for each line of my report. In one message, I have one patient info and multiple report lines, so I can’t make report lines repeat depending on my patient Info. I imagine that I must repeat using a repeatable field, right?
I inserted a dummy field with a default value, for each report line, and iterated comparing this field to this value.
Now the iterations worked fine
Best Regards
-
May 29, 2014 at 3:30 pm #80668Jim KosloskeyParticipant
Gabriel,
The essential question is whether the lines that repeat have some field in them that is the same so one can identify those lines from thee others.
So is there such a field or not?
Perhaps if you shared an example we can see.
If there is not such a field then using the method I described will not work.
Depending on the construct another method may work – again an example could be enlightening.
You always can follow Charlie’s suggestion and construct a Tcl proc to ‘normalize’ the message to HL/7.
email: jim.kosloskey@jim-kosloskey.com 29+ years Cloverleaf, 59 years IT - old fart.
-
-
AuthorReplies
- The forum ‘Cloverleaf’ is closed to new topics and replies.