@Test public void testAddFormatCode_Given_AdhocQueryType_XdsbDocumentType_PrivacyConsent() { String actualValue = null; String expectedValue = XdsbRegistryAdapter.FORMAT_CODE_PRIVACY_CONSENT; AdhocQueryType adhocQueryType = new AdhocQueryType(); xdsbRegistryAdapterSpy.addFormatCode(adhocQueryType, XDSB_DOCUMENT_TYPE_PRIVACY_CONSENT, ""); List<SlotType1> slotList = adhocQueryType.getSlot(); for (SlotType1 slot : slotList) { List<String> values = slot.getValueList().getValue(); for (String value : values) { actualValue = value; } } assertNotNull(actualValue); assertEquals(expectedValue, actualValue); }
void addFormatCode(AdhocQueryType adhocQueryType, XdsbDocumentType xdsbDocumentType, String messageId) { SlotType1 formatCodeSlotType = new SlotType1(); formatCodeSlotType.setName(SLOT_NAME_XDS_DOCUMENT_ENTRY_FORMAT_CODE); ValueListType formatCodeValueListType = new ValueListType(); if (xdsbDocumentType.equals(XdsbDocumentType.CLINICAL_DOCUMENT)) { formatCodeValueListType.getValue().add( FORMAT_CODE_CLINICAL_DOCUMENT); } else if (xdsbDocumentType.equals(XdsbDocumentType.PRIVACY_CONSENT)) { formatCodeValueListType.getValue().add(FORMAT_CODE_PRIVACY_CONSENT); } else { logger.error(messageId, "Unsupported XDS.b document format code"); throw new DS4PException("Unsupported XDS.b document format code"); } formatCodeSlotType.setValueList(formatCodeValueListType); adhocQueryType.getSlot().add(formatCodeSlotType); }
XdsbRegistryAdapter { void addFormatCode(AdhocQueryType adhocQueryType, XdsbDocumentType xdsbDocumentType, String messageId) { SlotType1 formatCodeSlotType = new SlotType1(); formatCodeSlotType.setName(SLOT_NAME_XDS_DOCUMENT_ENTRY_FORMAT_CODE); ValueListType formatCodeValueListType = new ValueListType(); if (xdsbDocumentType.equals(XdsbDocumentType.CLINICAL_DOCUMENT)) { formatCodeValueListType.getValue().add( FORMAT_CODE_CLINICAL_DOCUMENT); } else if (xdsbDocumentType.equals(XdsbDocumentType.PRIVACY_CONSENT)) { formatCodeValueListType.getValue().add(FORMAT_CODE_PRIVACY_CONSENT); } else { logger.error(messageId, "Unsupported XDS.b document format code"); throw new DS4PException("Unsupported XDS.b document format code"); } formatCodeSlotType.setValueList(formatCodeValueListType); adhocQueryType.getSlot().add(formatCodeSlotType); } }
XdsbRegistryAdapter { void addFormatCode(AdhocQueryType adhocQueryType, XdsbDocumentType xdsbDocumentType, String messageId) { SlotType1 formatCodeSlotType = new SlotType1(); formatCodeSlotType.setName(SLOT_NAME_XDS_DOCUMENT_ENTRY_FORMAT_CODE); ValueListType formatCodeValueListType = new ValueListType(); if (xdsbDocumentType.equals(XdsbDocumentType.CLINICAL_DOCUMENT)) { formatCodeValueListType.getValue().add( FORMAT_CODE_CLINICAL_DOCUMENT); } else if (xdsbDocumentType.equals(XdsbDocumentType.PRIVACY_CONSENT)) { formatCodeValueListType.getValue().add(FORMAT_CODE_PRIVACY_CONSENT); } else { logger.error(messageId, "Unsupported XDS.b document format code"); throw new DS4PException("Unsupported XDS.b document format code"); } formatCodeSlotType.setValueList(formatCodeValueListType); adhocQueryType.getSlot().add(formatCodeSlotType); } XdsbRegistryAdapter(XdsbRegistryWebServiceClient xdsbRegistry,
			AdhocQueryResponseFilter responseFilter,
			SimpleMarshaller marshaller,
			DocumentXmlConverter documentXmlConverter,
			DocumentAccessor documentAccessor); }
XdsbRegistryAdapter { void addFormatCode(AdhocQueryType adhocQueryType, XdsbDocumentType xdsbDocumentType, String messageId) { SlotType1 formatCodeSlotType = new SlotType1(); formatCodeSlotType.setName(SLOT_NAME_XDS_DOCUMENT_ENTRY_FORMAT_CODE); ValueListType formatCodeValueListType = new ValueListType(); if (xdsbDocumentType.equals(XdsbDocumentType.CLINICAL_DOCUMENT)) { formatCodeValueListType.getValue().add( FORMAT_CODE_CLINICAL_DOCUMENT); } else if (xdsbDocumentType.equals(XdsbDocumentType.PRIVACY_CONSENT)) { formatCodeValueListType.getValue().add(FORMAT_CODE_PRIVACY_CONSENT); } else { logger.error(messageId, "Unsupported XDS.b document format code"); throw new DS4PException("Unsupported XDS.b document format code"); } formatCodeSlotType.setValueList(formatCodeValueListType); adhocQueryType.getSlot().add(formatCodeSlotType); } XdsbRegistryAdapter(XdsbRegistryWebServiceClient xdsbRegistry,
			AdhocQueryResponseFilter responseFilter,
			SimpleMarshaller marshaller,
			DocumentXmlConverter documentXmlConverter,
			DocumentAccessor documentAccessor); AdhocQueryResponse registryStoredQuery(
			AdhocQueryRequest adhocQueryRequest); AdhocQueryResponse registryStoredQuery(String patientId,
			String domainId, String authorId,
			XdsbDocumentType xdsbDocumentType, boolean serviceTimeAware,
			String messageId); AdhocQueryResponse registryStoredQuery(String patientUniqueId,
			String authorNPI, XdsbDocumentType xdsbDocumentType,
			boolean serviceTimeAware, String messageId); AdhocQueryResponse registryStoredQuery(AdhocQueryRequest req,
			String authorNPI, String messageId); List<String> findDeprecatedDocumentUniqueIds(
			String submissionSetPatientId, String submissionSetAuthorPerson,
			String messageId); AdhocQueryResponse findSubmissionSets(String submissionSetPatientId,
			String submissionSetAuthorPerson); AdhocQueryResponse getSubmissionSetAndContents(
			String submissionSetUniqueId, String messageId); List<String> extractSubmissionSetUniqueIds(
			AdhocQueryResponse response); String extractDeprecatedDocumentUniqueId(
			AdhocQueryResponse response, String messageId); List<XdsbDocumentReference> extractXdsbDocumentReferenceList(
			AdhocQueryResponse adhocQueryResponse); RetrieveDocumentSetRequest extractXdsbDocumentReferenceListAsRetrieveDocumentSetRequest(
			AdhocQueryResponse adhocQueryResponse); String extractPatientId(AdhocQueryRequest req); String extractFormatCode(AdhocQueryRequest req); String extractResponseOptionReturnType(AdhocQueryRequest req); String extractDocumentEntryStatus(AdhocQueryRequest req); String getPatientUniqueId(String patientId, String domainId); }
XdsbRegistryAdapter { void addFormatCode(AdhocQueryType adhocQueryType, XdsbDocumentType xdsbDocumentType, String messageId) { SlotType1 formatCodeSlotType = new SlotType1(); formatCodeSlotType.setName(SLOT_NAME_XDS_DOCUMENT_ENTRY_FORMAT_CODE); ValueListType formatCodeValueListType = new ValueListType(); if (xdsbDocumentType.equals(XdsbDocumentType.CLINICAL_DOCUMENT)) { formatCodeValueListType.getValue().add( FORMAT_CODE_CLINICAL_DOCUMENT); } else if (xdsbDocumentType.equals(XdsbDocumentType.PRIVACY_CONSENT)) { formatCodeValueListType.getValue().add(FORMAT_CODE_PRIVACY_CONSENT); } else { logger.error(messageId, "Unsupported XDS.b document format code"); throw new DS4PException("Unsupported XDS.b document format code"); } formatCodeSlotType.setValueList(formatCodeValueListType); adhocQueryType.getSlot().add(formatCodeSlotType); } XdsbRegistryAdapter(XdsbRegistryWebServiceClient xdsbRegistry,
			AdhocQueryResponseFilter responseFilter,
			SimpleMarshaller marshaller,
			DocumentXmlConverter documentXmlConverter,
			DocumentAccessor documentAccessor); AdhocQueryResponse registryStoredQuery(
			AdhocQueryRequest adhocQueryRequest); AdhocQueryResponse registryStoredQuery(String patientId,
			String domainId, String authorId,
			XdsbDocumentType xdsbDocumentType, boolean serviceTimeAware,
			String messageId); AdhocQueryResponse registryStoredQuery(String patientUniqueId,
			String authorNPI, XdsbDocumentType xdsbDocumentType,
			boolean serviceTimeAware, String messageId); AdhocQueryResponse registryStoredQuery(AdhocQueryRequest req,
			String authorNPI, String messageId); List<String> findDeprecatedDocumentUniqueIds(
			String submissionSetPatientId, String submissionSetAuthorPerson,
			String messageId); AdhocQueryResponse findSubmissionSets(String submissionSetPatientId,
			String submissionSetAuthorPerson); AdhocQueryResponse getSubmissionSetAndContents(
			String submissionSetUniqueId, String messageId); List<String> extractSubmissionSetUniqueIds(
			AdhocQueryResponse response); String extractDeprecatedDocumentUniqueId(
			AdhocQueryResponse response, String messageId); List<XdsbDocumentReference> extractXdsbDocumentReferenceList(
			AdhocQueryResponse adhocQueryResponse); RetrieveDocumentSetRequest extractXdsbDocumentReferenceListAsRetrieveDocumentSetRequest(
			AdhocQueryResponse adhocQueryResponse); String extractPatientId(AdhocQueryRequest req); String extractFormatCode(AdhocQueryRequest req); String extractResponseOptionReturnType(AdhocQueryRequest req); String extractDocumentEntryStatus(AdhocQueryRequest req); String getPatientUniqueId(String patientId, String domainId); static final String FORMAT_CODE_CLINICAL_DOCUMENT; static final String FORMAT_CODE_PRIVACY_CONSENT; static final String SLOT_NAME_XDS_DOCUMENT_ENTRY_FORMAT_CODE; static final String SLOT_NAME_XDS_DOCUMENT_ENTRY_PATIENT_ID; static final String SLOT_NAME_XDS_DOCUMENT_ENTRY_STATUS; static final String UUID_XDS_DOCUMENTENTRY; static final String UUID_XDS_DOCUMENTENTRY_UNIQUEID; static final String UUID_XDS_DOCUMENTENTRY_AUTHOR; static final String UUID_XDS_SUBMISSION_SET_UNIQUEID; }