HL7SenderTransforms { public static MCCIMT000200UV01Sender createMCCIMT000200UV01Sender(String OID) { MCCIMT000200UV01Sender sender = new MCCIMT000200UV01Sender(); if (OID == null) { OID = ""; } sender.setTypeCode(CommunicationFunctionType.SND); MCCIMT000200UV01Device senderDevice = new MCCIMT000200UV01Device(); senderDevice.setDeterminerCode(HL7Constants.SENDER_DETERMINER_CODE); senderDevice.setClassCode(EntityClassDevice.DEV); LOG.debug("Setting sender device id (applicationId) to " + OID); senderDevice.getId().add(HL7DataTransformHelper.IIFactory(OID)); MCCIMT000200UV01Agent agent = new MCCIMT000200UV01Agent(); MCCIMT000200UV01Organization org = new MCCIMT000200UV01Organization(); org.setClassCode(HL7Constants.ORG_CLASS_CODE); org.setDeterminerCode(HL7Constants.SENDER_DETERMINER_CODE); II id = HL7DataTransformHelper.IIFactory(OID); org.getId().add(id); javax.xml.namespace.QName xmlqnameorg = new javax.xml.namespace.QName("urn:hl7-org:v3", "representedOrganization"); JAXBElement<MCCIMT000200UV01Organization> orgElem = new JAXBElement<>(xmlqnameorg, MCCIMT000200UV01Organization.class, org); agent.setRepresentedOrganization(orgElem); agent.getClassCode().add(HL7Constants.AGENT_CLASS_CODE); javax.xml.namespace.QName xmlqnameagent = new javax.xml.namespace.QName("urn:hl7-org:v3", "asAgent"); JAXBElement<MCCIMT000200UV01Agent> agentElem = new JAXBElement<>(xmlqnameagent, MCCIMT000200UV01Agent.class, agent); senderDevice.setAsAgent(agentElem); sender.setDevice(senderDevice); return sender; }  static MCCIMT000200UV01Sender createMCCIMT000200UV01Sender(String OID); static MCCIMT000100UV01Sender createMCCIMT000100UV01Sender(String OID); static MCCIMT000300UV01Sender createMCCIMT000300UV01Sender(String OID);  }
@Test public void createMCCIMT000200UV01Sender() { MCCIMT000200UV01Sender sender; String OID = null; HL7SenderTransforms transforms = new HL7SenderTransforms(); sender = transforms.createMCCIMT000200UV01Sender(OID); assertNull(sender.getDevice().getId().get(0).getRoot()); assertNull(sender.getDevice().getAsAgent().getValue().getRepresentedOrganization().getValue().getId().get(0) .getRoot()); }