Requirement Constraints

  • Subscribe to our RSS feed.
  • Twitter
  • StumbleUpon
  • Reddit
  • Facebook
  • Digg
Showing posts with label EMR Labs Stuff. Show all posts
Showing posts with label EMR Labs Stuff. Show all posts

Wednesday, 28 August 2013

HL7 Parsing–My Own Parser

Posted on 11:37 by Unknown

In my previous post, i showed how to use HAPI for parsing HL7 File. But for my current assignment , i am not able to go further on HAPI. Here is my requirement

1. I need to parse Patient lab result ORU^R01 Message type
2. Here is the structure of the message

MSH
PID
ORC
IN1
IN2...IN4
DG1....DG4
OBR (N times, under each OBR, there can be N number of OBXs)
----> OBX1....OBXn
----------NTEs(Some time OBX may also contain NTEs
NTE(Some times, OBR may not have OBX, but they have NTEs

3. And here is the challenge, upfront i will not know how many DG, OBR and under each OBR, how many OBXs are present in the result file. So without any looping mechanism, we cannot parse the file and convert into human readable text.
4. I tried with lot with HAPI to achieve the desired result, but no luck. May be because of the following reasons
            a) HAPI Does not have much examples to show the power of the parser of each Message type
            b) I do not have time to read their API and form the example Smile

            c) Finally HAPI does not have ability to parse the multiple OBR and OBX


So i decided to drop HAPI and started my own parser. I have been working in Health care industry for more than 14 years, so understanding the terminology/domain is not a problem for me. Writing our own parser is fun for me, because i have the done the same thing in VB6 successfully.  But this time with java. Here is the detail code.

package hl7.parse;

import java.util.HashMap;
import java.util.Map;

public class MyParser {

String message;
private Long totalLines = (long) 0;
private Long MSHCount = (long) 0;
private Long PIDCount = (long) 0;
private Long ORCCount = (long) 0;
private Long totalDGs = (long) 0;
private Long OBRCounter = (long) 0;
private Long OBXCounter = (long) 0;
private String MSH;
private String PID;
private String ORC;
private Map<String, String> element = new HashMap<String, String>();
private String currentOBR;

public Long getTotalDGs() {
return totalDGs;
}

public Long getTotalOBRs() {
return OBRCounter;
}

public Long getORCCount() {
return ORCCount;
}

public String getORC() {
return ORC;
}

public String getMSH() {
return MSH;
}

public String getPID() {
return PID;
}

public Long getPIDCount() {
return PIDCount;
}

public Long getMSHCount() {
return MSHCount;
}

public Long getTotalLines() {
return totalLines;
}

public String getMessage() {
return message;
}

public void setMessage(String message) {
this.message = message;
}

public MyParser(String message) {
this.message = message;
}

public String getValue(String key) {
return element.get(key);
}

public void parseIt() {
String delimiter = "\\r";
String[] temp;
temp = message.split(delimiter);
for (int i = 0; i < temp.length; i++) {
// Store the lines if developer wants it
element.put("Segment-" + i, temp[i]);
parseSegment(temp[i]);
totalLines++;
}

// Write the final one
// Store the total OBX Count -- OBR[1]OBX-count
if (this.currentOBR != null) {
String key = "OBR[" + OBRCounter + "]" + "OBX-count";
element.put(key, String.valueOf(OBXCounter));

}
}

private void parseSegment(String line) {
String segment;
segment = line.substring(0, 3);
if (segment.equalsIgnoreCase("MSH"))
parseMSH(line);

if (segment.equalsIgnoreCase("PID"))
parsePID(line);

if (segment.equalsIgnoreCase("ORC"))
parseORC(line);

if (segment.equalsIgnoreCase("DG1") || segment.equalsIgnoreCase("DG2")
|| segment.equalsIgnoreCase("DG3")
|| segment.equalsIgnoreCase("DG4"))
parseDGs(line);

if (segment.equalsIgnoreCase("OBR"))
parseOBRs(line);

if (segment.equalsIgnoreCase("OBX"))
parseOBXs(line);

}

private void parseDGs(String line) {

String delimiter = "\\|";
String[] temp;
temp = line.split(delimiter);
totalDGs++;
element.put("DG-" + totalDGs, line);
element.put("DG-" + totalDGs + "-count", String.valueOf(temp.length));
for (int i = 0; i < temp.length; i++) {
element.put("DG[" + totalDGs + "]-" + i, temp[i]);
}

}

private void parseOBRs(String line) {

String delimiter = "\\|";
String[] temp;
temp = line.split(delimiter);

// Store the total OBX Count -- OBR[1]OBX-count
if (this.currentOBR != null) {
String key = "OBR[" + OBRCounter + "]" + "OBX-count";
element.put(key, String.valueOf(OBXCounter));
}
OBRCounter++;
element.put("OBR[" + OBRCounter + "]", line);
element.put("OBR[" + OBRCounter + "]" + "-count",
String.valueOf(temp.length));
this.currentOBR = "OBR[" + OBRCounter + "]";
// Reset the OBX counter
OBXCounter = (long) 0;
for (int i = 0; i < temp.length; i++) {
element.put("OBR[" + OBRCounter + "]-" + i, temp[i]);
if (i == 4 || i == 16) //
{
parseSubComponent(temp[i], "OBR[" + OBRCounter + "]-" + i);
}
}

}

private void parseOBXs(String line) {

// Here we need to carefull, OBX are under OBR, so we need to attach to
// the correct OBR
String delimiter = "\\|";
String[] temp;
String key;
temp = line.split(delimiter);
OBXCounter++;
key = this.currentOBR + "OBX[" + OBXCounter + "]";
// Very first thing is, We need to Print the OBX Line under OBR as
// OBR[1]OBX[1]
element.put(key, line);
// OBR[1]OBX[1]-count
element.put(key + "-count", String.valueOf(temp.length));
// OBR[1]OBX[1]-1, // OBR[1]OBX[1]-2,etc
for (int i = 0; i < temp.length; i++) {
element.put(key + "-" + i, temp[i]);
}
}

private void parseMSH(String line) {

String delimiter = "\\|";
String[] temp;
temp = line.split(delimiter);
this.MSH = line;
for (int i = 0; i < temp.length; i++) {
element.put("MSH-" + i, temp[i]);
MSHCount++;
}

}

private void parseORC(String line) {

String delimiter = "\\|";
String[] temp;
temp = line.split(delimiter);
this.ORC = line;
for (int i = 0; i < temp.length; i++) {
element.put("ORC-" + i, temp[i]);
if (i == 12 || i == 17 || i == 18) //
{
parseSubComponent(temp[i], "ORC-" + i);
}
ORCCount++;
}

}

private void parsePID(String line) {

String delimiter = "\\|";
String[] temp;
temp = line.split(delimiter);
this.PID = line;
for (int i = 0; i < temp.length; i++) {

element.put("PID-" + i, temp[i]);
if (i == 5 || i == 11) // Let us parse patient Name
{
parseSubComponent(temp[i], "PID-" + i);
}
PIDCount++;
}

}

private void parseSubComponent(String line, String mapKey) {

String delimiter = "\\^";
String[] temp;
temp = line.split(delimiter);
int j;
for (int i = 0; i < temp.length; i++) {
j = i + 1;
element.put(mapKey + "-" + j, temp[i]);
}

}

}





public void onParse() {
String element;
String value;
String hl7Message = getStringFromInputStream("c:\\temp\\example1.hl7");
System.out.println("HL7 Content is " + hl7Message);
myParser = new MyParser(hl7Message);
myParser.parseIt();

element = "Receiving Facility";
value = myParser.getValue("MSH-5");
System.out.println(element + " : " + value);

element = "Patient No";
value = myParser.getValue("PID-2");
System.out.println(element + " : " + value);

element = "Lab Accession Number";
value = myParser.getValue("PID-4");
System.out.println(element + " : " + value);

element = "Patient Last Name";
value = myParser.getValue("PID-5-1");
System.out.println(element + " : " + value);

element = "Patient First Name";
value = myParser.getValue("PID-5-2");
System.out.println(element + " : " + value);

element = "Patient Middle Name";
value = myParser.getValue("PID-5-3");
System.out.println(element + " : " + value);

element = "Patient DOB";
value = myParser.getValue("PID-7");
System.out.println(element + " : " + value);

element = "Patient Sex";
value = myParser.getValue("PID-8");
System.out.println(element + " : " + value);

element = "Provider NPI";
value = myParser.getValue("ORC-12-1");
System.out.println(element + " : " + value);

element = "Provider Last Name";
value = myParser.getValue("ORC-12-2");
System.out.println(element + " : " + value);

element = "Provider First Name";
value = myParser.getValue("ORC-12-3");
System.out.println(element + " : " + value);

element = "Provider Initial";
value = myParser.getValue("ORC-12-5");
System.out.println(element + " : " + value);

element = "Account No";
value = myParser.getValue("ORC-17-1");
System.out.println(element + " : " + value);

element = "Account Name";
value = myParser.getValue("ORC-17-2");
System.out.println(element + " : " + value);

element = "Account Address";
value = myParser.getValue("ORC-18-1");
System.out.println(element + " : " + value);

element = "Account City";
value = myParser.getValue("ORC-18-2");
System.out.println(element + " : " + value);

element = "Account State";
value = myParser.getValue("ORC-18-3");
System.out.println(element + " : " + value);

element = "Account Zip";
value = myParser.getValue("ORC-18-4");
System.out.println(element + " : " + value);

element = "Account Phone";
value = myParser.getValue("ORC-18-5");
System.out.println(element + " : " + value);

System.out
.println("*********************************ALL ABOUT MSH ***********************");
// Let us print the MSH Values
for (int i = 0; i < myParser.getMSHCount(); i++) {
System.out.println("MSH-" + i + ": "
+ myParser.getValue("MSH-" + i));
}

// Ofcouse If you want to you get particular value also as follows
System.out.println("Please give me MSH[3] "
+ myParser.getValue("MSH-3"));

// Ofcourse You can also print MSH String
System.out.println("Please give me MSH Line..." + myParser.getMSH());

System.out
.println("*********************************ALL ABOUT PID ***********************");
// Ofcouse If you want to you get particular value also as follows
System.out.println("Please give me PID[3] "
+ myParser.getValue("PID-3"));

// Ofcourse You can also print PID String
System.out.println("Please give me PID Line..." + myParser.getPID());

// Component 1 [ST] family name (last name)
// Component 2 [ST] given name (first name)
// Component 3 [ST] middle initial or name
// Component 4 [ST] suffix (jr, sr, etc)
// Component 5 [ST] prefix (Mr, Mrs, Dr etc)
// Component 6 [ST] degree (MD, PHD etc)
// Component 7 [ID] name type code

// Ofcouse You can print Patient Last Name as follows
System.out.println("Please give me Patient Last Name "
+ myParser.getValue("PID-5-1"));

// Ofcouse You can print Patient First Name as follows
System.out.println("Please give me Patient First Name "
+ myParser.getValue("PID-5-2"));

// Ofcouse You can print Patient Address as follows
System.out.println("Please give me Patient Address "
+ myParser.getValue("PID-11-1"));

// Ofcouse You can print Patient Address as follows
System.out.println("Please give me Patient City "
+ myParser.getValue("PID-11-2"));

// Ofcouse You can print Patient Address as follows
System.out.println("Please give me Patient State "
+ myParser.getValue("PID-11-3"));

// Ofcouse You can print Patient Address as follows
System.out.println("Please give me Patient Zip "
+ myParser.getValue("PID-11-4"));

// Let us print the PID Values
for (int i = 0; i < myParser.getPIDCount(); i++) {
System.out.println("PID-" + i + ": "
+ myParser.getValue("PID-" + i));
}

System.out
.println("*********************************ALL ABOUT ORC***********************");
// Let us print the ORC Values
for (int i = 0; i < myParser.getORCCount(); i++) {
System.out.println("ORC-" + i + ": "
+ myParser.getValue("ORC-" + i));
}
// Ofcouse If you want to you get particular value also as follows
System.out.println("Please give me ORC[2] "
+ myParser.getValue("ORC-2"));

// Ofcourse You can also print ORC String
System.out.println("Please give me ORC Line..." + myParser.getORC());

System.out
.println("*********************************ALL ABOUT DG***********************");
// Total Number of DGs
System.out.println("Please give me Total DGs " + myParser.getTotalDGs());
// Let us print the DGs
for (int i = 1; i <= myParser.getTotalDGs(); i++) {
System.out.println("DG-" + i + ": " + myParser.getValue("DG-" + i));
}

for (int i = 1; i <= myParser.getTotalDGs(); i++) {
int total = Integer.parseInt(myParser
.getValue("DG-" + i + "-count"));
for (int j = 1; j < total; j++) {
System.out.println("DG[" + i + "]-" + j + " : "
+ myParser.getValue("DG[" + i + "]-" + j));
}

}

System.out
.println("*********************************ALL ABOUT OBR***********************");
// Total Number of OBRs
System.out.println("Please give me Total OBR " + myParser.getTotalOBRs());
// Let us print the OBRs
String key;
for (int i = 1; i <= myParser.getTotalOBRs(); i++) {
key = "OBR[" + i + "]";
System.out.println(key + " : " + myParser.getValue(key));
// We can also retieve the total elements in each OBR
System.out.println("Total Elements in " + key + " is "
+ myParser.getValue(key + "-count"));
}

for (int i = 1; i <= myParser.getTotalOBRs(); i++) {
key = "OBR[" + i + "]-count";
int total = Integer.parseInt(myParser.getValue(key));
for (int j = 1; j < total; j++) {
key = "OBR[" + i + "]-" + j;
System.out.println(key + " : " + myParser.getValue(key));
}

}

System.out
.println("*********************************ALL ABOUT OBX***********************");

key = "OBR[1]OBX-count";
// For given OBR, You can find how many OBXs are there as follows
System.out.println("Please give me Total OBXs in OBR[1] "
+ myParser.getValue(key));

key = "OBR[2]OBX-count";
System.out.println("Please give me Total OBXs in OBR[2] "
+ myParser.getValue(key));

key = "OBR[1]OBX[1]";
// You can also Print the OBX Line in each OBR as follows
System.out.println("Please give me OBX[1] in OBR[1] " + myParser.getValue(key));
key = "OBR[1]OBX-count";
int total = Integer.parseInt(myParser.getValue(key));

// You can also Print all OBXs in OBR[1]
for (int i = 1; i <= total; i++) {
key = "OBR[1]OBX[" + i + "]";
System.out.println("OBR[1]OBX[" + i + "] => " + myParser.getValue(key));
}

// Dont know how many OBRs and how many OBXs in each OBRs, no problem,
// we can put them in the loop
for (int i = 1; i <= myParser.getTotalOBRs(); i++) {
key = "OBR[" + i + "]";
System.out.println(key + " : " + myParser.getValue(key));
key = key + "OBX-count";
total = Integer.parseInt(myParser.getValue(key));
for (int j = 1; j <= total; j++) {
key = "OBR[" + i + "]" + "OBX[" + j + "]";
System.out.println("----->" + key + " : " + myParser.getValue(key));
}
}
}

// convert InputStream to String
private static String getStringFromInputStream(String fileName) {

BufferedReader br = null;
StringBuilder sb = new StringBuilder();

String line;
try {
br = new BufferedReader(new FileReader(fileName));
while ((line = br.readLine()) != null) {
sb.append(line + "\r");
}

} catch (IOException e) {
e.printStackTrace();
} finally {
if (br != null) {
try {
br.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}

return sb.toString();

}

Sample HL7 File


MSH|^~\&|mas|MY XXXX LAB|mas|100|201303201430||ORU^R01||P|2.3|
PID|1|K2TE154871|^^^MRN~^^^CID~^^^ACCN|234567892|K2^TEST^||19640512|M|||^^FL^|||||U|||||||0||
ORC|1|000133423|||CM||||201206132103|PHH|201206141230|^^^^     ^^^^^|||||261^XXXX CARE CENTER|31231 IN.STATE ROAD 17 SUITE 102^LAUDERHILL^NY^22313^95455848444|3|PHH|
IN1|1|09102|MCARE|MEDICARE PART B|PO BOX 44117^^JACKSONVILLE^FL^322310018||8664549007||MEDICARE PART B|||||||K2^TEST^|01|00000000|^^NY^||||||||||||||||||||||||||||T|
DG1|1|ICD|319|UNSPECIFIED MENTAL RETARDATION|||||||||||||BUIR154337^000039106|
DG2|1|ICD|30490|UNSPECIFIED DRUG DEPENDENCE, UNSPECIFIED USE|||||||||||||HOJA159610^000039110|
OBR|1|234567892||22014^K2S|||201211151512|201211151514||||||201211151512||^^^^     ^^^^^||A|GENERAL CHEMISTRY||||||X|
OBX|1|TX|22014^K2S|  ^A^A|X||-||||X||9|201211150000||...||
OBR|2|234567892||2521S^K2S|||201211151512|201211181214|||A|||201211151512||^^^^     ^^^^^||D|DRUGS||||||F|
OBX|1|TX|2521S^K2S|  ^A^A|NEGATIVE|CUTOFF 20 ng/ml|-||||F||9|201211181214||MAM||
OBR|3|234567892||4814^GABA|||201211151512|201212061207|||A|||201211151512||^^^^     ^^^^^||D|DRUGS||||||C|
OBX|1|TX|4814^GABA|  ^D^D|X||-||||X||9|201212060949||RBJ|MERCY^^^^^^|
NTE|1|LD|     A THERAPEUTIC RANGE FOR GABAPENTIN HAS NOT BEEN ESTABLISHED. THE RANGE OF|
NTE|2|LD|     THE ASSAY IS 0.75 TO 40.00 ug/mL.REPORTABLE RESULT BELOW THIS RANGE IS|
NTE|3|LD|     <0.75 ug/mL AND ABOVE THIS RANGE IS >40.0 ug/ml.|
OBR|4|234567892||9632^GABA|||201211151512|201211191214|||A|||201211151512||^^^^     ^^^^^||A|GENERAL CHEMISTRY||||||X|
OBX|1|TX|9632^GABA|  ^A^A|X|ng/ml|NEGATIVE-|*|||X||9|201211191214||MAM||



Here is the output

Receiving Facility : 100
Patient No : K2TE154871
Lab Accession Number : 234567892
Patient Last Name : K2
Patient First Name : TEST
Patient Middle Name : null
Patient DOB : 19640512
Patient Sex : M
Provider NPI :
Provider Last Name :
Provider First Name :
Provider Initial :
Account No : 261
Account Name : XXXX CARE CENTER
Account Address : 31231 IN.STATE ROAD 17 SUITE 102
Account City : LAUDERHILL
Account State : NY
Account Zip : 22313
Account Phone : 95455848444
*********************************ALL ABOUT MSH ***********************
MSH-0: MSH
MSH-1: ^~\&
MSH-2: mas
MSH-3: MY XXXX LAB
MSH-4: mas
MSH-5: 100
MSH-6: 201303201430
MSH-7:
MSH-8: ORU^R01
MSH-9:
MSH-10: P
MSH-11: 2.3
Please give me MSH[3] MY XXXX LAB
Please give me MSH Line...MSH|^~\&|mas|MY XXXX LAB|mas|100|201303201430||ORU^R01||P|2.3|
*********************************ALL ABOUT PID ***********************
Please give me PID[3] ^^^MRN~^^^CID~^^^ACCN
Please give me PID Line...PID|1|K2TE154871|^^^MRN~^^^CID~^^^ACCN|234567892|K2^TEST^||19640512|M|||^^FL^|||||U|||||||0||
Please give me Patient Last Name K2
Please give me Patient First Name TEST
Please give me Patient Address
Please give me Patient City
Please give me Patient State FL
Please give me Patient Zip null
PID-0: PID
PID-1: 1
PID-2: K2TE154871
PID-3: ^^^MRN~^^^CID~^^^ACCN
PID-4: 234567892
PID-5: K2^TEST^
PID-6:
PID-7: 19640512
PID-8: M
PID-9:
PID-10:
PID-11: ^^FL^
PID-12:
PID-13:
PID-14:
PID-15:
PID-16: U
PID-17:
PID-18:
PID-19:
PID-20:
PID-21:
PID-22:
PID-23: 0
*********************************ALL ABOUT ORC***********************
ORC-0: ORC
ORC-1: 1
ORC-2: 000133423
ORC-3:
ORC-4:
ORC-5: CM
ORC-6:
ORC-7:
ORC-8:
ORC-9: 201206132103
ORC-10: PHH
ORC-11: 201206141230
ORC-12: ^^^^ ^^^^^
ORC-13:
ORC-14:
ORC-15:
ORC-16:
ORC-17: 261^XXXX CARE CENTER
ORC-18: 31231 IN.STATE ROAD 17 SUITE 102^LAUDERHILL^NY^22313^95455848444
ORC-19: 3
ORC-20: PHH
Please give me ORC[2] 000133423
Please give me ORC Line...ORC|1|000133423|||CM||||201206132103|PHH|201206141230|^^^^ ^^^^^|||||261^XXXX CARE CENTER|31231 IN.STATE ROAD 17 SUITE 102^LAUDERHILL^NY^22313^95455848444|3|PHH|
*********************************ALL ABOUT DG***********************
Please give me Total DGs 2
DG-1: DG1|1|ICD|319|UNSPECIFIED MENTAL RETARDATION|||||||||||||BUIR154337^000039106|
DG-2: DG1|1|ICD|30490|UNSPECIFIED DRUG DEPENDENCE, UNSPECIFIED USE|||||||||||||HOJA159610^000039110|
DG[1]-1 : 1
DG[1]-2 : ICD
DG[1]-3 : 319
DG[1]-4 : UNSPECIFIED MENTAL RETARDATION
DG[1]-5 :
DG[1]-6 :
DG[1]-7 :
DG[1]-8 :
DG[1]-9 :
DG[1]-10 :
DG[1]-11 :
DG[1]-12 :
DG[1]-13 :
DG[1]-14 :
DG[1]-15 :
DG[1]-16 :
DG[1]-17 : BUIR154337^000039106
DG[2]-1 : 1
DG[2]-2 : ICD
DG[2]-3 : 30490
DG[2]-4 : UNSPECIFIED DRUG DEPENDENCE, UNSPECIFIED USE
DG[2]-5 :
DG[2]-6 :
DG[2]-7 :
DG[2]-8 :
DG[2]-9 :
DG[2]-10 :
DG[2]-11 :
DG[2]-12 :
DG[2]-13 :
DG[2]-14 :
DG[2]-15 :
DG[2]-16 :
DG[2]-17 : HOJA159610^000039110
*********************************ALL ABOUT OBR***********************
Please give me Total OBR 4
OBR[1] : OBR|1|234567892||22014^K2S|||201211151512|201211151514||||||201211151512||^^^^ ^^^^^||A|GENERAL CHEMISTRY||||||X|
Total Elements in OBR[1] is 26
OBR[2] : OBR|2|234567892||2521S^K2S|||201211151512|201211181214|||A|||201211151512||^^^^ ^^^^^||D|DRUGS||||||F|
Total Elements in OBR[2] is 26
OBR[3] : OBR|3|234567892||4814^GABA|||201211151512|201212061207|||A|||201211151512||^^^^ ^^^^^||D|DRUGS||||||C|
Total Elements in OBR[3] is 26
OBR[4] : OBR|4|234567892||9632^GABA|||201211151512|201211191214|||A|||201211151512||^^^^ ^^^^^||A|GENERAL CHEMISTRY||||||X|
Total Elements in OBR[4] is 26
OBR[1]-1 : 1
OBR[1]-2 : 234567892
OBR[1]-3 :
OBR[1]-4 : 22014^K2S
OBR[1]-5 :
OBR[1]-6 :
OBR[1]-7 : 201211151512
OBR[1]-8 : 201211151514
OBR[1]-9 :
OBR[1]-10 :
OBR[1]-11 :
OBR[1]-12 :
OBR[1]-13 :
OBR[1]-14 : 201211151512
OBR[1]-15 :
OBR[1]-16 : ^^^^ ^^^^^
OBR[1]-17 :
OBR[1]-18 : A
OBR[1]-19 : GENERAL CHEMISTRY
OBR[1]-20 :
OBR[1]-21 :
OBR[1]-22 :
OBR[1]-23 :
OBR[1]-24 :
OBR[1]-25 : X
OBR[2]-1 : 2
OBR[2]-2 : 234567892
OBR[2]-3 :
OBR[2]-4 : 2521S^K2S
OBR[2]-5 :
OBR[2]-6 :
OBR[2]-7 : 201211151512
OBR[2]-8 : 201211181214
OBR[2]-9 :
OBR[2]-10 :
OBR[2]-11 : A
OBR[2]-12 :
OBR[2]-13 :
OBR[2]-14 : 201211151512
OBR[2]-15 :
OBR[2]-16 : ^^^^ ^^^^^
OBR[2]-17 :
OBR[2]-18 : D
OBR[2]-19 : DRUGS
OBR[2]-20 :
OBR[2]-21 :
OBR[2]-22 :
OBR[2]-23 :
OBR[2]-24 :
OBR[2]-25 : F
OBR[3]-1 : 3
OBR[3]-2 : 234567892
OBR[3]-3 :
OBR[3]-4 : 4814^GABA
OBR[3]-5 :
OBR[3]-6 :
OBR[3]-7 : 201211151512
OBR[3]-8 : 201212061207
OBR[3]-9 :
OBR[3]-10 :
OBR[3]-11 : A
OBR[3]-12 :
OBR[3]-13 :
OBR[3]-14 : 201211151512
OBR[3]-15 :
OBR[3]-16 : ^^^^ ^^^^^
OBR[3]-17 :
OBR[3]-18 : D
OBR[3]-19 : DRUGS
OBR[3]-20 :
OBR[3]-21 :
OBR[3]-22 :
OBR[3]-23 :
OBR[3]-24 :
OBR[3]-25 : C
OBR[4]-1 : 4
OBR[4]-2 : 234567892
OBR[4]-3 :
OBR[4]-4 : 9632^GABA
OBR[4]-5 :
OBR[4]-6 :
OBR[4]-7 : 201211151512
OBR[4]-8 : 201211191214
OBR[4]-9 :
OBR[4]-10 :
OBR[4]-11 : A
OBR[4]-12 :
OBR[4]-13 :
OBR[4]-14 : 201211151512
OBR[4]-15 :
OBR[4]-16 : ^^^^ ^^^^^
OBR[4]-17 :
OBR[4]-18 : A
OBR[4]-19 : GENERAL CHEMISTRY
OBR[4]-20 :
OBR[4]-21 :
OBR[4]-22 :
OBR[4]-23 :
OBR[4]-24 :
OBR[4]-25 : X
*********************************ALL ABOUT OBX***********************
Please give me Total OBXs in OBR[1] 1
Please give me Total OBXs in OBR[2] 1
Please give me OBX[1] in OBR[1] OBX|1|TX|22014^K2S| ^A^A|X||-||||X||9|201211150000||...||
OBR[1]OBX[1] => OBX|1|TX|22014^K2S| ^A^A|X||-||||X||9|201211150000||...||
OBR[1] : OBR|1|234567892||22014^K2S|||201211151512|201211151514||||||201211151512||^^^^ ^^^^^||A|GENERAL CHEMISTRY||||||X|
----->OBR[1]OBX[1] : OBX|1|TX|22014^K2S| ^A^A|X||-||||X||9|201211150000||...||
OBR[2] : OBR|2|234567892||2521S^K2S|||201211151512|201211181214|||A|||201211151512||^^^^ ^^^^^||D|DRUGS||||||F|
----->OBR[2]OBX[1] : OBX|1|TX|2521S^K2S| ^A^A|NEGATIVE|CUTOFF 20 ng/ml|-||||F||9|201211181214||MAM||
OBR[3] : OBR|3|234567892||4814^GABA|||201211151512|201212061207|||A|||201211151512||^^^^ ^^^^^||D|DRUGS||||||C|
----->OBR[3]OBX[1] : OBX|1|TX|4814^GABA| ^D^D|X||-||||X||9|201212060949||RBJ|MERCY^^^^^^|
OBR[4] : OBR|4|234567892||9632^GABA|||201211151512|201211191214|||A|||201211151512||^^^^ ^^^^^||A|GENERAL CHEMISTRY||||||X|
----->OBR[4]OBX[1] : OBX|1|TX|9632^GABA| ^A^A|X|ng/ml|NEGATIVE-|*|||X||9|201211191214||MAM||

Read More
Posted in EMR Labs Stuff | No comments

Friday, 2 August 2013

HL7 Parsing

Posted on 22:59 by Unknown

I was working in parsing the HL7 ORU Message using HAPI. Found an interesting article by here by Ignacio Suay. Thanks mate for simple and quick example

Based on that, here is my example, But still finding a way to extract OBR, OBX and NTE Segments.

package com.product.HL7;

import java.util.ArrayList;
import java.util.List;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import ca.uhn.hl7v2.DefaultHapiContext;
import ca.uhn.hl7v2.HL7Exception;
import ca.uhn.hl7v2.HapiContext;
import ca.uhn.hl7v2.model.Message;
import ca.uhn.hl7v2.parser.PipeParser;
import ca.uhn.hl7v2.util.Terser;
import ca.uhn.hl7v2.validation.impl.NoValidation;

import com.product.domain.LabResults;

public class ParseFile {

static final Logger LOG = LoggerFactory.getLogger(ParseFile.class);
private String HL7Message;
private List<HL7Data> MSH = new ArrayList<HL7Data>();
private List<HL7Data> orderInfo = new ArrayList<HL7Data>();
private ParsingEvent parseingEvent;

public List<HL7Data> getOrderInfo() {
return orderInfo;
}

public void setOrderInfo(List<HL7Data> orderInfo) {
this.orderInfo = orderInfo;
}

public ParseFile(ParsingEvent parseingEvent) {
this.parseingEvent = parseingEvent;
}

public String getHL7Message() {
return HL7Message;
}

public List<HL7Data> getMSH() {
return MSH;
}

public void setMSH(List<HL7Data> mSH) {
MSH = mSH;
}

public void setHL7Message(String hL7Message) {
HL7Message = hL7Message;
}

public void parseMessage() throws HL7Exception {

String element;
String value;
HapiContext context = new DefaultHapiContext();
context.setValidationContext(new NoValidation());
PipeParser pipeParser = context.getPipeParser();
/* pipeParser.setValidationContext(new NoValidation()); */
Message message = pipeParser.parse(HL7Message);
Terser terser = new Terser(message);

LabResults labResults = new LabResults();

element = "Receiving Facility";
value = terser.get("/.MSH-6");
LOG.debug(element + " : " + value);
labResults.setDocAccountNo(value);
MSH.add(new HL7Data(element, value));
value = null;
element = null;

element = "Date";
value = terser.get("/.MSH-7");
LOG.debug(element + " : " + value);
MSH.add(new HL7Data(element, value));
value = null;
element = null;

element = "Patient No";
value = terser.get("/.PID-2");
LOG.debug(element + " : " + value);
MSH.add(new HL7Data(element, value));
value = null;
element = null;

element = "Lab Accession Number";
value = terser.get("/.PID-4");
LOG.debug(element + " : " + value);
MSH.add(new HL7Data(element, value));
value = null;
element = null;

element = "Patient Last Name";
value = terser.get("/.PID-5-1");
LOG.debug(element + " : " + value);
MSH.add(new HL7Data(element, value));
value = null;
element = null;

element = "Patient First Name";
value = terser.get("/.PID-5-2");
LOG.debug(element + " : " + value);
MSH.add(new HL7Data(element, value));
value = null;
element = null;

element = "Patient Middle Name";
value = terser.get("/.PID-5-3");
LOG.debug(element + " : " + value);
MSH.add(new HL7Data(element, value));
value = null;
element = null;

element = "Patient DOB";
value = terser.get("/.PID-7");
LOG.debug(element + " : " + value);
MSH.add(new HL7Data(element, value));
value = null;
element = null;

element = "Patient Sex";
value = terser.get("/.PID-8");
LOG.debug(element + " : " + value);
MSH.add(new HL7Data(element, value));
value = null;
element = null;

element = "Patient Address";
value = terser.get("/.PID-11-1");
LOG.debug(element + " : " + value);
MSH.add(new HL7Data(element, value));
value = null;
element = null;

element = "Patient City";
value = terser.get("/.PID-11-2");
LOG.debug(element + " : " + value);
MSH.add(new HL7Data(element, value));
value = null;
element = null;

element = "Patient State";
value = terser.get("/.PID-11-3");
LOG.debug(element + " : " + value);
MSH.add(new HL7Data(element, value));
value = null;
element = null;

element = "Patient Zip";
value = terser.get("/.PID-11-4");
LOG.debug(element + " : " + value);
MSH.add(new HL7Data(element, value));
value = null;
element = null;

element = "Patient Phone";
value = terser.get("/.PID-13");
LOG.debug(element + " : " + value);
MSH.add(new HL7Data(element, value));
value = null;
element = null;

element = "Patient Maritial Status";
value = terser.get("/.PID-16");
LOG.debug(element + " : " + value);
MSH.add(new HL7Data(element, value));
value = null;
element = null;

element = "Patient EHR Number";
value = terser.get("/.PID-18");
LOG.debug(element + " : " + value);
MSH.add(new HL7Data(element, value));
value = null;
element = null;

element = "Patient SS";
value = terser.get("/.PID-19");
LOG.debug(element + " : " + value);
MSH.add(new HL7Data(element, value));
value = null;
element = null;

element = "Patient Care Number";
value = terser.get("/.PID-20");
LOG.debug(element + " : " + value);
MSH.add(new HL7Data(element, value));
value = null;
element = null;

element = "Patient Caid Number";
value = terser.get("/.PID-21");
LOG.debug(element + " : " + value);
MSH.add(new HL7Data(element, value));
value = null;
element = null;

element = "Patient Age";
value = terser.get("/.PID-23");
LOG.debug(element + " : " + value);
MSH.add(new HL7Data(element, value));
value = null;
element = null;

/*********************** Order Informaton ************************************/

element = "Lab Accession Number";
value = terser.get("/.ORC-2");
LOG.debug(element + " : " + value);
orderInfo.add(new HL7Data(element, value));
value = null;
element = null;

parseingEvent.parsingCompleted();

}
}

Some important note.
1. Hapi always expect \r at the end of the each segment. So if you have manually append the character at the end of the each segment Smile as i did in my example

	// convert InputStream to String
private static String getStringFromInputStream(InputStream is) {

BufferedReader br = null;
StringBuilder sb = new StringBuilder();

String line;
try {

br = new BufferedReader(new InputStreamReader(is));
while ((line = br.readLine()) != null) {
sb.append(line + "\r");
}

} catch (IOException e) {
e.printStackTrace();
} finally {
if (br != null) {
try {
br.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}

return sb.toString();

}


2. HAPI will also validate the Message while parsing. If you want to avoid that, see my example above.

3. But i don’t think so my job is going to easy to fetch OBR and OBX and NTE segments using HAPI. I am trying with that, latest will post if i am able to complete.

Sample File
MSH|^~\&|mas|My LAB|mas|3535|201305280003||ORU^R01||P|2.3|
PID|1|PAT393929|^^^MRN~^^^CID~^^^ACCN|000035100|MOOAFEFERE^SCOOPDSTT^||19690608|M|||^^FL^|||||U|||||||43|y|
ORC|1|000035100|||CM||||201302271648|PAH|201302271700|^^^^     ^^^^^|||||355^MY HOUSE|0011 NW 10 STR^MYCITY^NY^11111^111-371-1111|3|PAH|
OBR|1|000035100||BATH SALTS^BATH SALTS|||20130131----|201302271651||||||201302271648||^^^^     ^^^^^||D|DRUGS||||||F|
OBX|1|TX|BATH SALTS^BATH SALTS|  ^D^[|NEGATIVE||-||||F||7|201302271651||PAH||

Read More
Posted in EMR Labs Stuff, Today Tech Stuff | No comments

Friday, 3 August 2012

Sample HL7 Files

Posted on 06:56 by Unknown

Sample Result file from CCHIT

MSH|^~\&|^CCHITLabs^L-CL|^CCHIT^L-CL|^^|^^|20100407121000||ORU^R01^ORU_R01|20100407121000|P|2.5.1|0001||AL||||MT-ORU-2_R1 
PID|1|12|00000333^^^^AN||Grayson^Jim^^^^^L||19430309|M|||834 Ocean Vista Avenue^Apt. 202^Santa Monica^CA^90401||3105552233
ORC|RE|||3^EHR-System
OBR|1|3^EHR-System|LAB003^^CCHIT^L-CL|087-0714^Lipid Panel, Serum^99Lab^80061^Lipid Panel, Serum^C4|||20100407151000||||L|||||PRO1000#^Butler^Internist^E^^Dr^MD^^^^^^EI||||RO||20100407121000|||F
OBX|1|NM|13457-7^LDL Cholesterol^LN||90|mg/dL|< 99||||F|||||^DOE^JOHN|||||||AccuLabs^^^^^CLIA^^^^10D987432|432 Administration Ave.^^St. Louis^MO^63146|^Smith^John^^^Dr.^MD
NTE|0|L|
OBX|2|NM|14646-4^HDL Cholesterol^LN||60|mg/dL|40-59|H|||F|||||^DOE^JOHN|||||||AccuLabs^^^^^CLIA^^^^10D987432|432 Administration Ave.^^St. Louis^MO^63146|^Smith^John^^^Dr.^MD
NTE|0|L|
OBX|3|NM|14647-2^Total Cholesterol^LN||120|mg/dL|< 199||||F|||||^DOE^JOHN|||||||AccuLabs^^^^^CLIA^^^^10D987432|432 Administration Ave.^^St. Louis^MO^63146|^Smith^John^^^Dr.^MD
NTE|0|L|
OBX|4|NM|14927-8^Triglycerides^LN||100|mg/dL|< 149||||F|||||^DOE^JOHN|||||||AccuLabs^^^^^CLIA^^^^10D987432|432 Administration Ave.^^St. Louis^MO^63146|^Smith^John^^^Dr.^MD
NTE|0|L|


Human readable text for the above result file


image


Sample Result file from NIST  - File 1


MSH|^~\&|^NISTLabs^L-CL^|^NIST^L-CL|^^|^^|20100407121000||ORU^R01^ORU_R01|20100407121000|P|2.5.1|0001||AL||||MT-ORU-2_R1 
PID|1|9999|PT20^^^^AN||Grayson^Jim^^^^^L||19430309|M|||834 Ocean Vista Avenue^Apt. 202^Santa Coloradonica^CA^90401||3105552233
ORC|RE|||ORD003-1^EHR-System
OBR|1|ORD003-1^EHR-System|LAB003^^NIST^L-CL|087-0714^Comprehensive Metabolic Panel^99Lab^80061^Comprehensive Metabolic Panel^C4|||20100407151000||||L||||Arterial catheter|000100^Butler^Internist^E^^Dr^MD^^^^^^EI||||RO||20100407121000||CH|F
OBX|1|NM|13457-7^Fasting Blood Glucose^LN||178|mg/dl|70-100 mg/dl|H|||F|||20100407121000||^DOE^JOHN|||||||Milton Street Laboratory^^^^^CLIA^^^^10D987432|40025 Milton Street^^Aurora^Colorado^80011|^Smith^John^^^Dr.^MD
SPM||||^Arterial catheter||||||||||||||||||||HEM^Hemolyzed|
OBX|2|NM|14682-9^Creatinine^LN||1.0|mg/dL|0.5-1.4||||F|||||^DOE^JOHN|||||||Milton Street Laboratory^^^^^CLIA^^^^10D987432|40025 Milton Street^^Aurora^Colorado^80011|^Smith^John^^^Dr.^MD
SPM||||^Arterial catheter||||||||||||||||||||HEM^Hemolyzed|
OBX|3|NM|14647-2^BUN^LN||18|mg/dL|7-30||||F|||||^DOE^JOHN|||||||Milton Street Laboratory^^^^^CLIA^^^^10D987432|40025 Milton Street^^Aurora^Colorado^80011|^Smith^John^^^Dr.^MD
SPM||||^Arterial catheter||||||||||||||||||||HEM^Hemolyzed|


Sample Result file from NIST - File 2


MSH|^~\&|^NISTLabs^L-CL^|^NIST^L-CL|^^|^^|20100407121000||ORU^R01^ORU_R01|20100407121000|P|2.5.1|0001||AL||||MT-ORU-2_R1 
PID|1|8888|PT21^^^^AN||Mark^Peter^^^^^L||19430309|M|||834 Ocean Vista Avenue^Apt. 202^Santa Coloradonica^CA^90401||3105552233
ORC|RE|||ORD003-1^EHR-System
OBR|1|1^EHR-System|LAB003^^NIST^L-CL|087-0714^Electrolyte panel^99Lab^80061^Electrolyte panel^C4|||20100407151000||||L|||||2^Robinson^William^E^^Dr^MD^^^^^^EI||||RO||20100407121000||CH|F
OBX|1|NM|2951-2^Serum Sodium^LN||141|meq/l|135-146||||F|||20100407121000||^DOE^JOHN|||||||Oakton Crest Laboratories^^^^^CLIA^^^^10D987432|5570 Eden Street^^Oakland^California^94607|^Smith^John^^^Dr.^MD
OBX|2|NM|2823-3^Serum Potassium^LN||4.3|meq/l|3.5-5.3||||F|||20100407121000||^DOE^JOHN|||||||Oakton Crest Laboratories^^^^^CLIA^^^^10D987432|5570 Eden Street^^Oakland^California^94607|^Smith^John^^^Dr.^MD



 


Sample Result file from NIST - File 3


MSH|^~\&|^NISTLabs^L-CL^|^NIST^L-CL|^^|^^|20100407121000||ORU^R01^ORU_R01|20100407121000|P|2.5.1|0001||AL||||MT-ORU-2_R1 
PID|1|7777|PT22^^^^AN||Daniel^Scott^^^^^L||19430309|M|||834 Ocean Vista Avenue^Apt. 202^Santa Coloradonica^CA^90401||3105552233
ORC|RE|||ORD003-1^EHR-System
OBR|1|1^EHR-System|LAB003^^NIST^L-CL|087-0714^Lipid profile^99Lab^80061^Lipid profile^C4|||20100407151000||||L|||||2^Robinson^William^E^^Dr^MD^^^^^^EI||||RO||20100407121000||CH|F
OBX|1|NM|14438-6^Total cholesterol^LN||162|mg/dl|<200||||F|||20100407121000||^DOE^JOHN|||||||Aloha Laboratories^^^^^CLIA^^^^10D987432|575 Luau Street^^Honolulu^Hawaii^96813|^Smith^John^^^Dr.^MD
SPM||||||||||||||||||||||||HEM^Hemolyzed|
OBX|2|NM|48090-5^HDL cholesterol^LN||43|mg/dl|>=40|H|||F|||20100407121000||^DOE^JOHN|||||||Aloha Laboratories^^^^^CLIA^^^^10D987432|575 Luau Street^^Honolulu^Hawaii^96813|^Smith^John^^^Dr.^MD
SPM||||||||||||||||||||||||HEM^Hemolyzed|
OBX|3|NM|55440-2^LDL cholesterol^LN||84|mg/dl|<100||||F|||20100407121000||^DOE^JOHN|||||||Aloha Laboratories^^^^^CLIA^^^^10D987432|575 Luau Street^^Honolulu^Hawaii^96813|^Smith^John^^^Dr.^MD
SPM||||||||||||||||||||||||HEM^Hemolyzed|
OBX|4|NM|14445-1^Triglycerides^LN||127|mg/dl|<150||||F|||20100407121000||^DOE^JOHN|||||||Aloha Laboratories^^^^^CLIA^^^^10D987432|575 Luau Street^^Honolulu^Hawaii^96813|^Smith^John^^^Dr.^MD
SPM||||||||||||||||||||||||HEM^Hemolyzed|

Read More
Posted in EMR Labs Stuff | No comments

LAB Test Panels

Posted on 04:21 by Unknown

Let us see some most commonly used panels.

Lipid Profile

Panel Name : Lipid Profile

Panel Level CPT : 80061

Individual Tests

Test Name

Units

Reference

CPT

LOINC

Specimen Type

Total cholesterol

mg/dL

<200

82465

2093-3

SERUM

High density lipoprotein cholesterol (HDL-C)

mg/dL

>40

83718

2085-9

SERUM

Low density lipoprotein cholesterol (LDL-C)

mg/dL

<100

83721

2089-1

SERUM

Triglycerides

mg/dL

44-148

84478

2571-8

SERUM

Very low density lipoprotein cholesterol (VLDL-C)

mg/dL

20 – 40

83719

25371-6

SERUM

Non-HDL-cholesterol

mg/dL

13458-5

Sample Required:
Blood

Test Instruction:
Fasting for 9-12 hours before having blood drawn; only water is permitted.

****************************************************************************************************************************************

Complete Blood Count

Panel Name : Complete Blood Count

Also known as : CBC; Hemogram; CBC with differential

Panel Level CPT : 85027

Individual Tests

Test Name

Units

Reference

CPT

LOINC

Specimen Type

White blood cell (WBC) count

HPF

0-5

85048

5821-4

Red blood cell (RBC) count

x10E6/uL

4.20-5.80 Mill/mcL

85041

789-8

Whole blood

Hemoglobin

g/dL

13.2-17.1 g/dL

85018

718-7

Whole blood

Hematocrit

%

40.0-54.0

85014

20570-8

Whole blood

PLATELET COUNT

x10E3/uL

140-400 Thous/mcL

85049

777-3

Whole blood

Mean corpuscular volume (MCV)

fL

80.0-100.0 fL

787-2

Mean platelet volume (MPV)

fl

7.5-11.5 fL

Mean corpuscular hemoglobin (MCH)

pg

27.0-33.0 pg

785-6

Mean corpuscular hemoglobin concentration (MCHC)

%

31-36

786-4

Sample Required
Blood

****************************************************************************************************************************************

Comprehensive Metabolic panel

Panel Name : Comprehensive Metabolic Panel

Also known as : CMP; Chem 12; Chemistry panel

Panel Level CPT : 80053

LOINC : 24323-8

Individual Tests

Test Name

Units

Reference

CPT

LOINC

Specimen Type

GLUCOSE

mg/dL

70-140

82947

2345-7

BUN (UREA NITROGEN)

mg/dL

9-23

84520

3094-0

CREATININE-SERUM

mg/dL

0.5-1.3

82565

2161-8

GFR ESTIMATED (CALC)

> OR = 90

48642-3

SODIUM

mEq/L

132-146

84295

2951-2

SERUM

POTASSIUM

mEq/L

3.5-5.5

84132

2823-3

SERUM

CHLORIDE

mEq/L

99-109

82435

2075-0

SERUM

CARBON DIOXIDE (C02)

mEq/L

22-29

82374

1963-8

SERUM

ANION GAP (CALC)

U/L

10-49

84460

1742-6

SERUM

AST (SGOT)

U/L

2-34

84450

1920-8

SERUM

BILIRUBIN, TOTAL

mg/dL

0.3-1.2

82247

1975-2

SERUM

Globulin (CALC)

g/dL

2.0-3.5

10834-0

ALBUMIN

g/dL

3.3-5.0

82040

1751-7

PROTEIN, TOTAL

g/dL

6.4-8.3

84155

2885-2

 

Read More
Posted in EMR Labs Stuff | No comments

EMR In-house Lab workflow

Posted on 04:16 by Unknown

Back to domain Smile

In my last company, we follow the below workflow for the in-house lab order. Please note : Even though I mention as use case, but it may not have all the typical structure of a use case. I will explain in my own way. 

1. Doctor Orders lab and test perform on the same date

Actor : Doctor, Reception

Use Case : Doctor Orders the lab and patient ready to perform the test on the

same date within the same location.

Pre conditions : Soap note is already created by Nurse

Steps

  1. Doctor go to the lab ordering module
  2. Select ECG test
  3. Doctor orally updates to the patient saying “ I have ordered a ECG Test, our location has in house lab to perform this. Please check with reception whether today or next available day, you are able to perform the test
  4. Patient comes out of the doctor room and step into reception area.
  5. Reception identified that doctor orders a lab test called ECG and also she knows that current location (the location where she is physically presents) has the in-house lab to perform this.
  6. From the UI, reception identifies who will perform this test(test technician)
  7. From the UI, she also able to identify whether this test can also conducted in other location for the practice
  8. Double click on the test technician name and system shows the scheduler for the test technician for today.
  9. She came to know that today slots are free very close to the current time.
  10. She immediately turns to patient and checks whether patient is willing to do the test today itself.
  11.  Patient accepts to carry on the same day in the same location
  12. Reception desk immediately forward the lab order information to test technician dashboard.
  13. The use case ends.

Post-conditions

  1. 1. Patient Ordering information for the selected test from the list.
  2. 2. Test appears in the test technician dashboard as pending item for him.

PLEASE NOTE : Even Test technician slots are free, and the above use case assumes that there is no need to book appointment and then forward. If system expects to first book appointment , then we have to follow the work flow such as checked in, roomed, etc which may fail in this case.

 

2. Doctor Orders lab and test perform on the different date on the same location.

Actor : Doctor, Reception

Use Case : Doctor Orders the lab and patient prefer to come for the test on any

of the future date.

Pre conditions : Soap note is already created by Nurse

Steps

  1. Doctor go to the lab ordering module
  2. Select ECG test
  3. Doctor orally updates to the patient saying “ I have ordered a ECG Test, our location has in house lab to perform this. Please check with reception whether today or next available day, you are able to perform the test
  4. Patient comes out of the doctor room and step into reception area.
  5. Reception identified that doctor orders a lab test called ECG and also she knows that current location (the location where she is physically presents) has the in-house lab to perform this.
  6. From the UI, reception identifies who will perform this test(test technician)
  7. From the UI, she also able to identify whether this test can also conducted in other location for the practice
  8. Double click on the test technician name and system shows the scheduler for the test technician for today.
  9. She came to know that today slots are free very close to the current time.
  10. She immediately turns to patient and checks whether patient is willing to do the test today itself.
  11. Patient denies for the current date, and prefer to come after 3 days.
  12. Reception desk ask the patient whether the patient is willing to come for the test after 3 days to this same location or any other location of the practice.
  13.  Patient prefer to come to this same location.
  14. Reception desk book the appointment as a test visit after 3 day for the patient.
  15. Reception desk print the test instruction(if any) and hand over to the patient.
  16. The use case ends.

Alternate workflow

Step after 11 in the above flow

  1. Reception desk ask the patient whether the patient is willing to come for the test after 3 days to this same location or any other location of the practice.
  2.  Patient prefer to come to different location which is near to home. (Practice has one more location where exclusively tests are conducted)
  3. Reception desk book the appointment as a test visit after 3 day for the patient in the different location.
  4. Reception desk print the test instruction(if any) and hand over to the patient.
  5. The use case ends.

3. Patient come to the location for just to perform the test.

Actor : Reception des

Use Case : Doctor Orders the lab and patient come to the location for the test.

Pre conditions : Soap note is already created by Nurse, doctor and lab order is

pending. Patient already have the appointment with test technician

Steps

  1. Patient come to the location for the test
  2. Reception desk change the patient status from schedule to Sign in.
  3. As soon as sign in, test appears in the test technician dashboard.
  4. The use case ends.
Read More
Posted in EMR Labs Stuff | No comments
Older Posts Home
Subscribe to: Posts (Atom)

Popular Posts

  • Understanding EDI Structure
    EDI Structure Primary Levels are 1. Interchange Envelops 2. Functional Group 3. Transaction set Data Element A data element is equival...
  • Types of Reimbursement
    Fee-For-Service Fee-for-service is a method of payment where the provider is paid a fee for each procedure performed and billed.Most payer ...
  • EDI 270–5010 Documentation - ISA – Interchange Control Header
    ISA – Interchange Control Header ISA – Interchange Control Header   The ISA is a fixed record length segment and all positions within ea...
  • EDI Instructions
    HIPAA Compliant Codes All the Health care EDI Transaction set should use only the following HIPAA Compliant Codes Physicians Current Pro...
  • ZK ListBox
    Let us first design a simple  static list box with crud Buttons as last column. Here is the code <?page title="Practice List" c...
  • ZK Example for inline Editing with Add New and Delete
    I am quite impressed on this demo from ZK . But adding new record and delete existing record is missing as part of typical CRUD. So i thoug...
  • Java Static Import
    This is one of feature in Java 5. In order to access static members, it is necessary to qualify references with the class they came from. ...
  • ZK MVVM CRUD With Spring 3 + JPA + Hibernate 4 Entity Manager–Part 3
    Define the persistence.xml file In the Part 2 article , we have seen how to create ZK Maven project and update the default POM.XML with a...
  • ZK MVVM Form Binding CRUD with Spring and Hibernate - Part 4
    Presentation Layer using ZK Framework          In part 3 , We have completed Spring integration with hibernate. In this post, we will des...
  • Hibernate–Java Environment setup
    Environment Eclipse 3.7 Indigo IDE Download Hibernate 4.1.1 Download JavaSE 1.6  Download MySQL 5.1 Download JDBC Driver for MyS...

Categories

  • Billing Process
  • C Workbook
  • C++ Workbook
  • Eclipse Tips
  • EDI 5010
  • EMR Appointment Features
  • EMR Labs Stuff
  • EMR PMS Links
  • EMR Use cases
  • EMR Vital Sign
  • Good Website Design
  • Hibernate Criteria Queries
  • Hibernate Introduction
  • Hibernate Introduction Setup
  • Hibernate Mapping
  • Hibernate POC
  • Hibernate Validator
  • Hibernate–Java Environment setup
  • HPI
  • Java
  • Maven
  • MU Certification
  • NPI
  • PQRS
  • Practice Management System
  • Spring Security
  • Tech Links
  • Today Tech Stuff
  • zk
  • ZK Hibernate
  • ZK 5 Databinding
  • ZK Application
  • ZK Calling Another ZUL
  • ZK CheckBox
  • ZK CreateComponents
  • ZK CSS
  • ZK extended Components
  • ZK Foreach
  • ZK Forum Posts
  • ZK Framework
  • ZK Hibernate Setup
  • ZK ID Space
  • ZK Include
  • ZK Installation
  • ZK iReport
  • ZK Layout
  • ZK Listitem Pagination
  • ZK Message Box
  • ZK MVC
  • ZK MVC Combox Box
  • ZK MVC CRUD Examples
  • ZK MVC Listbox
  • ZK MVVM
  • ZK MVVM Combo
  • ZK MVVM CRUD
  • ZK MVVM ListBox
  • ZK Spring
  • ZK TextBox

Blog Archive

  • ▼  2013 (105)
    • ▼  December (3)
      • EDI Instructions
      • Understanding EDI Structure
      • What is an EDI ?
    • ►  September (7)
    • ►  August (13)
    • ►  July (1)
    • ►  June (11)
    • ►  May (3)
    • ►  April (14)
    • ►  March (19)
    • ►  February (21)
    • ►  January (13)
  • ►  2012 (177)
    • ►  December (1)
    • ►  November (13)
    • ►  October (19)
    • ►  September (24)
    • ►  August (26)
    • ►  July (6)
    • ►  June (37)
    • ►  May (30)
    • ►  April (16)
    • ►  March (1)
    • ►  January (4)
  • ►  2011 (5)
    • ►  December (1)
    • ►  November (1)
    • ►  July (1)
    • ►  June (1)
    • ►  April (1)
  • ►  2010 (1)
    • ►  September (1)
Powered by Blogger.

About Me

Unknown
View my complete profile