<?xml version="1.0" encoding="utf-8"?>

			<rss version="2.0" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:cc="http://web.resource.org/cc/" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd">

			<channel>
			<title>Against All Odds - HL7</title>
			<link>http://www.ppshein.net/index.cfm</link>
			<description>A blog for ColdFusion, Android, jQuery, jQueryMobile, Oracle, HL7 and other Web-based programming languages, Web Server like IIS7 and RDMS like Oracle, Microsoft SQL and MySQL.</description>
			<language>en-us</language>
			<pubDate>Wed, 19 Jun 2013 01:29:24 -0700</pubDate>
			<lastBuildDate>Sat, 18 Jun 2011 02:26:00 -0700</lastBuildDate>
			<generator>BlogCFC</generator>
			<docs>http://blogs.law.harvard.edu/tech/rss</docs>
			<managingEditor>pyaephyoeshein@gmail.com</managingEditor>
			<webMaster>pyaephyoeshein@gmail.com</webMaster>
			<itunes:subtitle></itunes:subtitle>
			<itunes:summary></itunes:summary>
			<itunes:category text="Technology" />
			<itunes:category text="Technology">
				<itunes:category text="Podcasting" />
			</itunes:category>
			<itunes:category text="Technology">
				<itunes:category text="Tech News" />
			</itunes:category>
			<itunes:keywords></itunes:keywords>
			<itunes:author></itunes:author>
			<itunes:owner>
				<itunes:email>pyaephyoeshein@gmail.com</itunes:email>
				<itunes:name></itunes:name>
			</itunes:owner>
			
			<itunes:explicit>no</itunes:explicit>
			
			
			
			
			
			<item>
				<title>Simple HL7 segment viewer with Coldfusion</title>
				<link>http://www.ppshein.net/index.cfm/2011/6/18/Simple-HL7-segment-viewer-with-Coldfusion</link>
				<description>
				
				In these days, I feel like myself to write simple HL7 segment view for myself. Because we need to check manually HL7 message text file with HL7 documentation whether the formation of our HL7 message file is correct or not. Another one is we gotta check the whether correct information is added into the correct segment sequence or not. That&apos;s why I need to write viewer program for saving our time to check like that.

Here is the code for HL7 message viewer

&lt;code&gt;
&lt;cfif StructKeyExists(form, &quot;btnSubmit&quot;)&gt;
	&lt;cfset ArrayMsg = ListToArray(msg, CHR(13), true, false)&gt;
	&lt;table&gt;
		&lt;tr&gt;	
			&lt;cfloop from=&quot;1&quot; to=&quot;#ArrayLen(ArrayMsg)#&quot; index=&quot;i&quot;&gt;
				&lt;cfset HL7MsgName = Mid(ArrayMsg[i], 1, 4)&gt;
				&lt;cfset HL7MsgSeg = ListToArray(Mid(ArrayMsg[i], 6, Len(ArrayMsg[3])), &quot;|&quot;, true, false)&gt;
				&lt;td valign=&quot;top&quot;&gt;
					&lt;cfdump var=&quot;#HL7MsgSeg#&quot; label=&quot;#HL7MsgName# Segment&quot;&gt;
				&lt;/td&gt;
			&lt;/cfloop&gt;
		&lt;/tr&gt;
	&lt;/table&gt;	
&lt;/cfif&gt;

&lt;form action=&quot;index.cfm&quot; method=&quot;post&quot;&gt;
	Paste HL7 message:&lt;br&gt;	
	&lt;textarea name=&quot;msg&quot; style=&quot;width:100%; height:50px;&quot;&gt;&lt;/textarea&gt;&lt;br&gt;
	&lt;input type=&quot;Submit&quot; name=&quot;btnSubmit&quot; value=&quot;View&quot;&gt;
&lt;/form&gt;
&lt;/code&gt;

The outcome will be as follow

&lt;img src=&quot;http://www.ppshein.net/images/HL7_msg_viewer.jpg&quot; /&gt;

&lt;a href=&quot;http://www.ppshein.net/examples/hl7/index.cfm&quot; target=&quot;_blank&quot;&gt;HERE IS DEMO&lt;/a&gt;

If you found any bugs, please leave message as comment.
				
				</description>
				
				
				<category>HL7</category>
				
				<category>Coldfusion</category>
				
				<pubDate>Sat, 18 Jun 2011 02:26:00 -0700</pubDate>
				<guid>http://www.ppshein.net/index.cfm/2011/6/18/Simple-HL7-segment-viewer-with-Coldfusion</guid>
				
				
			</item>
			
		 	
			
			
			<item>
				<title>MAX function is kinda slow in Oracle</title>
				<link>http://www.ppshein.net/index.cfm/2011/6/7/MAX-function-is-kinda-slow-in-Oracle</link>
				<description>
				
				In these days, I&apos;m on HL7 project for my company. In this project, most of processes are created within Oracle Stored Procedure. Most of Oracle stored procedure, we need to retrieve the last record from table. At that time, we sometimes use &quot;&lt;b&gt;MAX&lt;/b&gt;&quot; built-in function of Oracle. Using &quot;&lt;b&gt;MAX&lt;/b&gt;&quot; function in Oracle is very simple and cannot write complicated query to get last record from table like &lt;a href=&quot;http://www.ppshein.net/index.cfm/2011/2/22/Display-the-latest-record-with-descending-in-Oracle&quot; target=&quot;_blank&quot;&gt;query after query method with RomNUM&lt;/a&gt;. But the one I haven&apos;t noticed is the performance of retrieving data.

That&apos;s why I&apos;ve wrote two query statements and test in PLSQL developer.

&lt;b&gt;Using MAX function&lt;/b&gt;
&lt;code&gt;
SELECT MAX(PATIENT_ID) FROM NH_PATIENT

&lt;!--- executing time ---&gt;
0.047 seconds
&lt;/code&gt;

&lt;b&gt;Using query and query&lt;/b&gt;
&lt;b&gt;Using MAX function&lt;/b&gt;
&lt;code&gt;
SELECT PATIENT_ID FROM
    (SELECT PATIENT_ID FROM NH_PATIENT
    ORDER BY PATIENT_ID DESC) CLONE_USER
WHERE ROWNUM = 1

&lt;!--- executing time ---&gt;
0.031 seconds
&lt;/code&gt;

So, we should avoid using &quot;&lt;b&gt;MAX&lt;/b&gt;&quot; function if we really don&apos;t need to use.
				
				</description>
				
				
				<category>Oracle</category>
				
				<category>HL7</category>
				
				<category>Coldfusion</category>
				
				<pubDate>Tue, 07 Jun 2011 21:06:00 -0700</pubDate>
				<guid>http://www.ppshein.net/index.cfm/2011/6/7/MAX-function-is-kinda-slow-in-Oracle</guid>
				
				
			</item>
			
		 	
			
			
			<item>
				<title>Repeat String Function in Oracle</title>
				<link>http://www.ppshein.net/index.cfm/2011/3/22/Repeat-String-Function-in-Oracle</link>
				<description>
				
				Now, I&apos;m fixing the coding of HL7 interface project and clean any unnecessary coding and function from Coldfusion and Oracle Stored Procedure for performance. Among them, I&apos;ve found that I&apos;ve used looping in Oracle Stored Procedure for concatenating string as like follow.

&lt;code&gt;         
V_FIRST_STRING := &apos;PPSHEIN&apos;;
V_LOOP := 10;
FOR LCOUNT IN 1.. V_LOOP
LOOP
	V_ZERO := V_ZERO || &apos;0&apos;;
END LOOP;
V_FINAL_STRING := V_FIRST_STRING  || V_ZERO; 
&lt;/code&gt;

When I developed this coding, I didn&apos;t know there is &lt;a href=&quot;http://www.ppshein.net/index.cfm/2009/11/12/repeatstring&quot; target=&quot;_blank&quot;&gt;RepeatString&lt;/a&gt; built-in function like Coldfusion in Oracle. My senior told me that there is &lt;a href=&quot;http://www.ppshein.net/index.cfm/2009/11/12/repeatstring&quot; target=&quot;_blank&quot;&gt;RepeatString&lt;/a&gt; in Oracle but he forgot it. In this time, I was in rush and I decided to try with &lt;b&gt;Looping&lt;/b&gt;.

Now, it&apos;s time for me to consider the performance of my HL7 interface project. In Coldfusion, Every CF developers know repeat string in Coldfusion is &lt;a href=&quot;http://www.ppshein.net/index.cfm/2009/11/12/repeatstring&quot; target=&quot;_blank&quot;&gt;RepeatString&lt;/a&gt; function. In Oracle, &lt;a href=&quot;http://www.ppshein.net/index.cfm/2009/11/12/repeatstring&quot; target=&quot;_blank&quot;&gt;RepeatString&lt;/a&gt; build-in function is what? So, I&apos;ve kept searching around Oracle forums and documentations. Finally, I found there is &lt;a href=&quot;http://www.techonthenet.com/oracle/functions/rpad.php&quot; target=&quot;_blank&quot;&gt;RPAD&lt;/a&gt; function in Oracle acts like &lt;a href=&quot;http://www.ppshein.net/index.cfm/2009/11/12/repeatstring&quot; target=&quot;_blank&quot;&gt;RepeatString&lt;/a&gt; in Coldfusion. Usage is slightly like Coldfusion.
				 [More]
				</description>
				
				
				<category>Oracle</category>
				
				<category>HL7</category>
				
				<category>CF Function</category>
				
				<pubDate>Tue, 22 Mar 2011 18:51:00 -0700</pubDate>
				<guid>http://www.ppshein.net/index.cfm/2011/3/22/Repeat-String-Function-in-Oracle</guid>
				
				
			</item>
			
		 	
			
			
			<item>
				<title>Display the latest record with descending in Oracle</title>
				<link>http://www.ppshein.net/index.cfm/2011/2/22/Display-the-latest-record-with-descending-in-Oracle</link>
				<description>
				
				This week is very busy time for me. Because I have to implement &lt;a href=&quot;http://www.hl7.org/&quot; target=&quot;_blank&quot;&gt;HL7&lt;/a&gt; segment with Oracle Stored Procedure. As we all know, Oracle SQL command isn&apos;t that same with Microsoft SQL. That&apos;s why some of command are very complicated for me to implement. Today, I need to retrieve the only one latest record from table with Oracle. In Coldfusion, it&apos;s very easy. To put &lt;b&gt;maxrows = &quot;1&quot;&lt;/b&gt; and descending in query as follow:

&lt;code&gt;
&lt;cfquery name=&quot;qryGetLatest&quot; datasource=&quot;myDSN&quot; maxrows=&quot;1&quot;&gt;
	SELECT U_ID FROM TBL_USER
	ORDER BY U_ID DESC
&lt;/cfquery&gt;
&lt;/code&gt;

In Microsoft, it&apos;s very simple. To put &lt;b&gt;TOP&lt;/b&gt; command and descending in query as follow:

&lt;code&gt;
SELECT TOP U_ID FROM TBL_USER
ORDER BY U_ID DESC
&lt;/code&gt;

In Oracle, it&apos;s not that easy. If we put &lt;b&gt;ROWNUM&lt;/b&gt; and descending in query, the first record will be returned. Because &lt;b&gt;ROWNUM&lt;/b&gt; doesn&apos;t work with &lt;b&gt;Order By&lt;/b&gt; descending in query. That&apos;s why we need to do with query with query formula in Oracle as follow:

&lt;code&gt;
SELECT U_ID FROM
	(SELECT U_ID FROM TBL_USER
	ORDER BY U_ID DESC) CLONE_USER
WHERE ROWNUM = 1
&lt;/code&gt;

Phweee...!!! Oracle crack my brain again. :)
				
				</description>
				
				
				<category>Oracle</category>
				
				<category>HL7</category>
				
				<category>Coldfusion</category>
				
				<category>MsSql</category>
				
				<pubDate>Tue, 22 Feb 2011 03:11:00 -0700</pubDate>
				<guid>http://www.ppshein.net/index.cfm/2011/2/22/Display-the-latest-record-with-descending-in-Oracle</guid>
				
				
			</item>
			
		 	
			
			
			<item>
				<title>Cusor loop and for loop in Oracle</title>
				<link>http://www.ppshein.net/index.cfm/2010/11/10/Cusor-loop-and-for-loop-in-Oracle</link>
				<description>
				
				Today I&apos;ve wrote new complex stored procedure in Oracle for HL7 interface. As I mention in above post, I&apos;m very new to Oracle and haven&apos;t known yet all of Oracle&apos;s functions and commands. But I need to create new Oracle stored procedure for existing project. When I creating Stored Procedure, I&apos;ve found two different looping of Cursor. There are Open Cursor and For Loop cursor. Both of them are equal to retrieve data from table but different performance.

As far as I know, Open cursor stands for limited data amount handling and will get slow when large data amount in it. For loop cursor can handle large data amount.
				 [More]
				</description>
				
				
				<category>Oracle</category>
				
				<category>HL7</category>
				
				<pubDate>Wed, 10 Nov 2010 23:57:00 -0700</pubDate>
				<guid>http://www.ppshein.net/index.cfm/2010/11/10/Cusor-loop-and-for-loop-in-Oracle</guid>
				
				
			</item>
			
		 	
			
			
			<item>
				<title>Create Function in Oracle with Cursor Loop</title>
				<link>http://www.ppshein.net/index.cfm/2010/11/4/Create-Function-in-Oracle-with-Cursor-Loop</link>
				<description>
				
				In these days, I&apos;m on HL7 project and need to create functions and store procedures in Oracle for message sending. In our HL7 standard, all of transaction will be manipulated by Oracle and don&apos;t make busy to Coldfusion due to we use less coding inside in CFML file and hope Oracle can manipulate the large data amount than CFML.

Honestly, I&apos;m very new to Oracle and still need self-learning Oracle&apos;s functions and commands for developing Functions and Store Procedures.

First of all, I&apos;ve recently finished reading &lt;a href=&quot;http://www.techonthenet.com/oracle/loops/cursor_for.php&quot; target=&quot;_blank&quot;&gt;Cursor Loop&lt;/a&gt; in Oracle. Because I need to concatenate the data come from table.
				 [More]
				</description>
				
				
				<category>Oracle</category>
				
				<category>HL7</category>
				
				<pubDate>Thu, 04 Nov 2010 00:54:00 -0700</pubDate>
				<guid>http://www.ppshein.net/index.cfm/2010/11/4/Create-Function-in-Oracle-with-Cursor-Loop</guid>
				
				
			</item>
			
		 	
			
			
			<item>
				<title>HL7 interface and me</title>
				<link>http://www.ppshein.net/index.cfm/2010/10/24/HL7-interface-and-me</link>
				<description>
				
				Well, I&apos;m very new to involve at any interfaces in my life. Since August 2010, I have a chance to learn HL7 interface for my company which are going to integrate with another hospital software. When I need to send our information to another system, I always generate XML file and send them. When receive their information from them, receive XML file either and install our system. Once I heard HL7 interface, I thought they will also use integrated file as XML (because XML is standardize file system for integrated two systems). Actually, they use txt file as their integrated file.

HL7 means Health Level Seven which dedicated to share information between two hospitals (maybe, to others as well). In HL7, there are so many standardize events and segments (which has one to many relationships means one event has so many segments). For example, A01 event called Admit Patient which has MSH, EVN, PID, PV1 and so on.
				 [More]
				</description>
				
				
				<category>HL7</category>
				
				<category>Coldfusion</category>
				
				<pubDate>Sun, 24 Oct 2010 19:25:00 -0700</pubDate>
				<guid>http://www.ppshein.net/index.cfm/2010/10/24/HL7-interface-and-me</guid>
				
				
			</item>
			
		 	
			</channel></rss>