Package ca.cdr.test.app.harness.impl
Class DockerSmileHarness
java.lang.Object
ca.cdr.test.app.harness.impl.DockerSmileHarness
- All Implemented Interfaces:
SmileHarness
The
DockerSmileHarness
class is responsible for managing interaction
with a Smile CDR environment using Docker. It provides utility methods to
identify and interact with Smile modules, such as FHIR endpoints and HL7v2 endpoints,
through exposed ports and administrative interfaces.
This class implements the SmileHarness
interface to provide concrete
implementations of the methods required to handle FHIR and administrative operations.
This class was generated partly with the help of Claude Sonnet 3.7
-
Constructor Summary
ConstructorsConstructorDescriptionDockerSmileHarness
(HarnessContext theContext, Map<String, Map<String, Integer>> theModuleTypeToModuleToPort, Map<Integer, Integer> theExposedPortMappings) -
Method Summary
Modifier and TypeMethodDescriptionGets an administrative JSON client for interacting with the CDR's admin API.getAdminJsonClient
(int theAdminPort) Gets an administrative JSON client for interacting with the CDR's admin API on a specific port.Gets a standard FHIR client.getFhirClient
(int thePort) Gets a standard FHIR client on a specific port.getFhirClient
(String theModuleId) Gets a standard FHIR client for a specific module.Gets the only persistence module's FhirContext.getFhirContext
(String moduleId) Get the FHIR context for a specific persistence module.Gets an HL7V2 REST client for interacting with the CDR's HL7V2 endpoint.getHL7V2RestClient
(int thePort) Gets an HL7V2 REST client for interacting with the CDR's HL7V2 endpoint on a specific port.getHL7V2RestClient
(String theModuleId) Gets an HL7V2 REST client for a specific module.Gets a FHIR client with superuser privileges.getSuperuserFhirClient
(int thePort) Gets a FHIR client with superuser privileges on a specific port.getSuperuserFhirClient
(String theModuleId) Gets a FHIR client with superuser privileges for a specific module.
-
Constructor Details
-
DockerSmileHarness
public DockerSmileHarness(HarnessContext theContext, Map<String, Map<String, Integer>> theModuleTypeToModuleToPort, Map<Integer, Integer> theExposedPortMappings)
-
-
Method Details
-
getSuperuserFhirClient
Description copied from interface:SmileHarness
Gets a FHIR client with superuser privileges. This will create an @{link IGenericClient} with the first available FHIR_ENDPOINT module- Specified by:
getSuperuserFhirClient
in interfaceSmileHarness
- Returns:
- The FHIR client with superuser authentication
-
getSuperuserFhirClient
Description copied from interface:SmileHarness
Gets a FHIR client with superuser privileges on a specific port.- Specified by:
getSuperuserFhirClient
in interfaceSmileHarness
- Parameters:
thePort
- The port to connect to- Returns:
- The FHIR client with superuser authentication on the specified port
-
getAdminJsonClient
Description copied from interface:SmileHarness
Gets an administrative JSON client for interacting with the CDR's admin API. This will create an @{link JsonRestClient} with the first available ADMIN_JSON moduledmin- Specified by:
getAdminJsonClient
in interfaceSmileHarness
- Returns:
- An autodiscovered AdminJsonRestClient.
-
getAdminJsonClient
Description copied from interface:SmileHarness
Gets an administrative JSON client for interacting with the CDR's admin API on a specific port.- Specified by:
getAdminJsonClient
in interfaceSmileHarness
- Parameters:
theAdminPort
- The port to connect to- Returns:
- The admin JSON client configured with the specified port
-
getSuperuserFhirClient
Description copied from interface:SmileHarness
Gets a FHIR client with superuser privileges for a specific module.- Specified by:
getSuperuserFhirClient
in interfaceSmileHarness
- Parameters:
theModuleId
- The ID of the module to connect to- Returns:
- The FHIR client with superuser authentication for the specified module
-
getFhirClient
Description copied from interface:SmileHarness
Gets a standard FHIR client.- Specified by:
getFhirClient
in interfaceSmileHarness
- Returns:
- The FHIR client with default authentication
-
getFhirClient
Description copied from interface:SmileHarness
Gets a standard FHIR client on a specific port.- Specified by:
getFhirClient
in interfaceSmileHarness
- Parameters:
thePort
- The port to connect to- Returns:
- The FHIR client with default authentication on the specified port
-
getFhirClient
Description copied from interface:SmileHarness
Gets a standard FHIR client for a specific module.- Specified by:
getFhirClient
in interfaceSmileHarness
- Parameters:
theModuleId
- The ID of the module to connect to- Returns:
- The FHIR client with default authentication for the specified module
-
getFhirContext
Gets the only persistence module's FhirContext. If More or less than 1 persistence modules are present, throwsIllegalStateException
.}See
getFhirContext(String)
if you have multiple persistence modules.- Specified by:
getFhirContext
in interfaceSmileHarness
- Returns:
- the
FhirContext
of the only persistence module.}
-
getFhirContext
Get the FHIR context for a specific persistence module.- Specified by:
getFhirContext
in interfaceSmileHarness
- Parameters:
moduleId
- The ID of the persistence module to get the FHIR context for- Returns:
- The FHIR context for the specified module
- Throws:
IllegalStateException
- if the module is not found or has an unsupported type
-
getHL7V2RestClient
Description copied from interface:SmileHarness
Gets an HL7V2 REST client for interacting with the CDR's HL7V2 endpoint.- Specified by:
getHL7V2RestClient
in interfaceSmileHarness
- Returns:
- The HL7V2 REST client configured with default port
-
getHL7V2RestClient
Description copied from interface:SmileHarness
Gets an HL7V2 REST client for interacting with the CDR's HL7V2 endpoint on a specific port.- Specified by:
getHL7V2RestClient
in interfaceSmileHarness
- Parameters:
thePort
- The port to connect to- Returns:
- The HL7V2 REST client configured with the specified port
-
getHL7V2RestClient
Description copied from interface:SmileHarness
Gets an HL7V2 REST client for a specific module.- Specified by:
getHL7V2RestClient
in interfaceSmileHarness
- Parameters:
theModuleId
- The ID of the module to connect to- Returns:
- The HL7V2 REST client for the specified module
-