/*
* In this example, a CDA r2 document is being embedded as mime content
* in an MDM_T02 message.
*/
MDM_T02 mdmMessage = new MDM_T02();
// A few basic MSH fields are populated. In a real situation, this would not be enough
// to produce a valid message, but for demonstration purposes we'll skip a few
// fields.
mdmMessage.getMSH().getEncodingCharacters().setValue("^~\\&");
mdmMessage.getMSH().getFieldSeparator().setValue("|");
OBX obx = mdmMessage.getOBX();
// This is not a complete CDA document, but it serves as a good example
String sampleClinicalDocument = "<ClinicalDocument xsi:schemaLocation=\"urn:hl7-org:v3 CDA.ReleaseTwo.CommitteeBallot03.Aug.2004.xsd\" templateId=\"2.16.840.1.113883.3.27.1776\">\r\n" +
" <id extension=\"c266\" root=\"2.16.840.1.113883.3.933\"/>\r\n" +
" <code code=\"11488-4\" codeSystem=\"2.16.840.1.113883.6.1\" displayName=\"Consultation note\"/>\r\n" +