Hello,

 

 I am fairly new to HAPI, but am finding my way around.  I am coming
across an error that I can't figure out.

 I set up code to accept order messages.  But when my message comes in
and is processed by HAPI, HAPI is instantiating an RDO_O01 message and
not an ORM_O01 message, then it fails.  See below:

 

Code:

 

            public Message processMessage(Message theIn) throws
ApplicationException, HL7Exception {

                        String patDOBStr = null;

 

                        // Turn off validation

                        Parser p = new GenericParser();

                        NoValidation noVal = new NoValidation();

                        p.setValidationContext(noVal);

                        theIn.setParser(p);

                        

                        System.out.println("in processMessage
**********************");

                        //log.debug("MsgReceived=" + theIn.toString());

                        // System.out.println("In processMessage -
message is:" + theIn);

 

                        // Generate an ACK message to return for the
message received.

                        MSH msh = (MSH) theIn.get("MSH");

 

                        ACK retVal;

 

                        try {

                                    // Take the MSH segment of an
incoming message, and generate an

                                    // appropriate ACK

                                    retVal = (ACK)
DefaultApplication.makeACK(msh);

                                    

                        System.out.println("after Making ACK
**********************");

                                    // Parse the transaction into the
HL7 segments, to access specific

                                    // data

                                    // needed in the STATComm Database

                        

                                    Message msg =
p.parse(theIn.toString());

System.out.println("Got message type=" +
msh.getMsh9_MessageType().getCm_msg1_MessageType().getValue().toString()
+ "" +
msh.getMsh9_MessageType().getCm_msg2_TriggerEvent().getValue().toString(
));

                                    // Retrieve the PID struture, to get
the patient name

                                                

                                    ORM_O01 orm = (ORM_O01) msg;

System.out.println("set up ORM_O01 message");

                                    PID pid = orm.getPATIENT().getPID();

                                    PV1 pv1 =
orm.getPATIENT().getPATIENT_VISIT().getPV1();

                                    OBR obr =
orm.getORDER().getORDER_DETAIL().getOBR();

                                    NTE nte =
orm.getORDER().getORDER_DETAIL().getOBSERVATION().getNTE();

 

 

Errors:

INFO: Responder got message:
MSH|^~\&|HNAM|CL|CL_RADNET|CL|20110628095233||ORM^O01|Q2301030099T190427
0849|P|2.3

PID|1||10011682^^^CL_MRN
Pool^^CD:237968946|60683166^^^DONOTSEND^^CD:237968946|CLABTEST^ONE||1950
0101120000|F||C|34605 W 12 MILE RD^^FARM
MILLS^MN^48331-3263^CD:309221^CD:756^^CD:637908|CD:637908|(248)489-6000^
CD:170||CD:151|M|CD:3391461|606831661088^^^DONOTSEND^FIN
NBR^CD:237968946||||CD:654655774|||0|||CD:654897458

PV1|1|Inpatient|MS^0414^1^CL^^^MMCCN|3|||5332^Rahiman^Abdul|||MED|MS|||1
|||5332^Rahiman^Doctor|A||60|||||||||||||||||||CL||Active|||201103291130
00

ORC|NW|3415770735^HNAM_ORDERID|||RL||||20110628095142|71573^Doctor^Janet
^D^^^^^DONOTSEND^^^^COMMUNITY DR
NBR~70988^Doctor^Janet^D^^^^^DONOTSEND^^^^Personnel Primary
Identifier~FHJDB2293^Doctor^Janet^D^^^^^DONOTSEND^^^^External
Identifier~T^Doctor^Janet^D^^^^^DONOTSEND^^^^CD:296695676|||||2011062809
5231|||CD:2562^Written|71573^Doctor^Janet^D^^^^^DONOTSEND^^^^COMMUNITY
DR NBR~70988^Doctor^Janet^D^^^^^DONOTSEND^^^^Personnel Primary
Identifier~FHJDB2293^Doctor^Janet^D^^^^^DONOTSEND^^^^External
Identifier~T^Doctor^Janet^D^^^^^DONOTSEND^^^^CD:296695676

OBR|1|3415770735^HNAM_ORDERID||CL987^MRA Head w and w/o
Contrast|||||||||||Rad Type&Rad
Type|||||00000MR20110001703^HNA_ACCN~8546871^HNA_ACCNID~7515376^HNA_PACS
ID|CD:232990825|20110628095231||Magnetic Resonance
Imaging|||1^^0^20110628095100^^RT||||^Dizziness

NTE|1|P|Special Instructions-

 

Jul 25, 2011 9:54:59 AM ca.uhn.log.HapiLogImpl info

INFO: Instantiating msg of class ca.uhn.hl7v2.model.v23.message.RDO_O01


in processMessage **********************

 

INFO: hapi.home is set to C:\Application.Projects\StComm_Hl7Recvr\.

after Making ACK **********************

Jul 25, 2011 9:54:59 AM ca.uhn.log.HapiLogImpl info

INFO: Instantiating msg of class ca.uhn.hl7v2.model.v23.message.RDO_O01

Got message type=ORM O01

Jul 25, 2011 9:54:59 AM ca.uhn.log.HapiLogImpl error

SEVERE: Attempting to send error message to remote system.

java.lang.ClassCastException: ca.uhn.hl7v2.model.v23.message.RDO_O01
cannot be cast to ca.uhn.hl7v2.model.v23.message.ORM_O01

      at
src.mchs.StCommApplHandler.processMessage(StCommApplHandler.java:117)

      at
ca.uhn.hl7v2.app.MessageTypeRouter.processMessage(MessageTypeRouter.java
:54)

      at ca.uhn.hl7v2.app.Responder.processMessage(Responder.java:165)

      at ca.uhn.hl7v2.app.Receiver$Grunt.run(Receiver.java:121)

Jul 25, 2011 9:54:59 AM ca.uhn.log.HapiLogImpl info

INFO: Responder sending message:
MSH|^~\&|||||20110725095459.265-0500||ACK|129|P|2.3

MSA|AE|Q2301030099T1904270849|ca.uhn.hl7v2.model.v23.message.RDO_O01
cannot be cast to ca.uhn.hl7v2.model.v23.

ERR|^^^207&Application Internal Error&HL70357

 

Any ideas?

 

Thanks,

 

Barbara Polack

 


------------------------------------------------------------------------------
Find us on Facebook: mountcarmelhealth.com/facebook 

------------------------------------------------------------------------------

"This electronic message transmission contains
confidential or privileged information from Mount
Carmel .  The information is intended for use by the
individual or entity named above.  If you are not the
intended recipient, be aware that any disclosure,
copying, distribution or use of the contents of this 
information is prohibited.  If you have received this
electronic transmission in error, please notify us
immediately by telephone (614-234-8700) or by electronic
mail ([email protected])."
==============================================================================
------------------------------------------------------------------------------
Storage Efficiency Calculator
This modeling tool is based on patent-pending intellectual property that
has been used successfully in hundreds of IBM storage optimization engage-
ments, worldwide.  Store less, Store more with what you own, Move data to 
the right place. Try It Now! http://www.accelacomm.com/jaw/sfnl/114/51427378/
_______________________________________________
Hl7api-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/hl7api-devel

Reply via email to