PRPAIN201309UVParser { public static JAXBElement<PRPAMT201307UV02QueryByParameter> extractQueryId(PRPAIN201309UV02 message) { JAXBElement<PRPAMT201307UV02QueryByParameter> queryByParameter = null; if (message.getControlActProcess() != null) { queryByParameter = message.getControlActProcess().getQueryByParameter(); } return queryByParameter; }  static PRPAMT201307UV02ParameterList parseHL7ParameterListFrom201309Message(PRPAIN201309UV02 message); static PRPAMT201307UV02PatientIdentifier parseHL7PatientPersonFrom201309Message(PRPAIN201309UV02 message); static List<II> buildAssigningAuthorityInclusionFilterList(PRPAIN201309UV02 message); static JAXBElement<PRPAMT201307UV02QueryByParameter> extractQueryId(PRPAIN201309UV02 message);  }
@Test public void testExtractQueryId() { PRPAIN201309UVParser parser = new PRPAIN201309UVParser(); JAXBElement<PRPAMT201307UV02QueryByParameter> queryByParameter = parser.extractQueryId(createMessage()); assertEquals(queryByParameter.getValue().getQueryId().getAssigningAuthorityName(),"CONNECT"); assertEquals(queryByParameter.getValue().getQueryId().getExtension(),"1.16.17.19"); assertEquals(queryByParameter.getValue().getQueryId().getRoot(), "1.1"); }
@Test public void testExtractQueryIdWhenQueryByParameterNull() { PRPAIN201309UVParser parser = new PRPAIN201309UVParser(); PRPAIN201309UV02 message = new PRPAIN201309UV02(); PRPAIN201309UV02QUQIMT021001UV01ControlActProcess controlActProcess = null; message.setControlActProcess(controlActProcess); assertNull(parser.extractQueryId(message)); }