Hi HAPI Developers,

I am using HAPI hl7 version 2.6

when tring to read MFE|4 field ,it shows java.lang.ClassCastException:
ca.uhn.hl7v2.model.
GenericComposite cannot be cast
 to ca.uhn.hl7v2.model.v26.datatype.CWE

-------------------------------------------
MSH|^~\&|RISHL7|RIS|LCI Billing HL7|LCI
Billing|20110722135421||MFN^M02^MFN_M02|1102|P|2.6|||AL|NE
MFI|PRA||UPD|20110722135308|20110722135308|AL
MFE|MAD||20110722135308|5^Smith, John |CWE|20110722135308|1^Administrator^
----------------------------------------
Here is the code
-----------------------------------------

MFN_M02 adtMsg = (MFN_M02)hapiMsg;

          MSH msh = adtMsg.getMSH();
         String sendingapp=
msh.getSendingApplication().getNamespaceID().getVersion();
         System.out.println("xxx"+sendingapp);

         MFI mfi=adtMsg.getMFI();
         String
masterid=mfi.getMasterFileIdentifier().getIdentifier().getValue();
          System.out.println("masterid"+masterid);
         String
masterid1=mfi.getMasterFileIdentifier().getText().getValue();
          System.out.println("masterid"+masterid1);
         String
masterid2=mfi.getMasterFileIdentifier().getNameOfCodingSystem().getValue();
          System.out.println("masterid"+masterid2);

          String code=mfi.getFileLevelEventCode().getValue();
           System.out.println("code"+code);
        //String entereddate=mfi.getEnteredDateTime().
        String rlevelcode=mfi.getResponseLevelCode().getValue();
        System.out.println("rlevelcode"+rlevelcode);
         MFN_M02_MF_STAFF mfst=adtMsg.getMF_STAFF(0);

         MFE mfe=mfst.getMFE();
         DTM dtm= mfe.getEffectiveDateTime();
          System.out.println("code..."+dtm.getValue());
         System.out.println("event
code..."+mfe.getRecordLevelEventCode().getValue());
         System.out.println("entered
bye..."+mfe.getEnteredBy().getFamilyName().getSurname().getValue());
         System.out.println("control
bye..."+mfe.getMFNControlID().getValue());

System.out.println("ID..."+mfe.getPrimaryKeyValueType(0).getValue());

        //int pp=mfe.getPrimaryKeyValueType();

    *     Varies pm=mfe.getPrimaryKeyValueMFE(0);
         CWE cwe=(CWE)pm.getData();*




how to do typecast,help me

Thanks
Vasu Rao
------------------------------------------------------------------------------
Got Input?   Slashdot Needs You.
Take our quick survey online.  Come on, we don't ask for help often.
Plus, you'll get a chance to win $100 to spend on ThinkGeek.
http://p.sf.net/sfu/slashdot-survey
_______________________________________________
Hl7api-devel mailing list
Hl7api-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/hl7api-devel

Reply via email to