Please help me!

I'm a student and I have to create SIU_12 Messages in HL7. I found HAPI and was 
very happy about it ;)

I have to use Version 2.5 of HL7.




Though I'm running into a problem... I tried to adapt the example message from 
here 
http://hl7api.sourceforge.net/xref/ca/uhn/hl7v2/examples/CreateAMessage.html to 
create a SIU_S12 HL7 Booking Appointment


        import ca.uhn.hl7v2.HL7Exception;
        import ca.uhn.hl7v2.model.v25.group.SIU_S12_PATIENT;
        import ca.uhn.hl7v2.model.v25.message.ADT_A01;
        import ca.uhn.hl7v2.model.v25.message.SIU_S12;
        import ca.uhn.hl7v2.model.v25.segment.MSH;
        import ca.uhn.hl7v2.model.v25.segment.PID;
        import ca.uhn.hl7v2.parser.DefaultXMLParser;
        import ca.uhn.hl7v2.parser.Parser;
        import ca.uhn.hl7v2.parser.PipeParser;


SIU_S12 siu = new SIU_S12();
          
          // Populate the MSH Segment
          MSH mshSegment = siu.getMSH();

          mshSegment.getFieldSeparator().setValue("|");
          mshSegment.getEncodingCharacters().setValue("^~\\&");
     
       
          
          
mshSegment.getSendingApplication().getNamespaceID().setValue("TestingSystem");
          mshSegment.getSequenceNumber().setValue("123");
          mshSegment.getMessageType().getMessageStructure().setValue("SIU");

//I'm not sure what to put in here...
//          mshSegment.getMessageType().getTriggerEvent().setValue("A01");
//          
mshSegment.getMessageType().getMessageStructure().setValue("ADT_A01");
          

//but my main problem is here, how can I set the PersonData in a SIU_S12 message

          // Populate the PID Segment
          //PID pid = siu.getPID(); --- won't work
            
          Parser parser = new PipeParser();
          String encodedMessage = parser.encode(siu);
          System.out.println("Printing ER7 Encoded Message:");
          System.out.println(encodedMessage);


I'm new to this, so please have mercy on my soul... 

best regards
Bernhard

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Hl7api-devel mailing list
Hl7api-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/hl7api-devel

Reply via email to