use of org.ehrbase.client.openehrclient.OpenEhrClientConfig in project fhir-bridge by ehrbase.
the class AbstractSetupIT method setup.
@BeforeAll
static void setup() throws URISyntaxException {
CredentialsProvider credentialsProvider = new BasicCredentialsProvider();
credentialsProvider.setCredentials(AuthScope.ANY, new UsernamePasswordCredentials("myuser", "myPassword432"));
CloseableHttpClient httpClient = HttpClientBuilder.create().setDefaultCredentialsProvider(credentialsProvider).build();
DefaultRestClient client = new DefaultRestClient(new OpenEhrClientConfig(new URI("http://localhost:8080/ehrbase/")), new ResourceTemplateProvider("classpath:/opt/*.opt"), httpClient);
PATIENT_ID = UUID.randomUUID().toString();
EhrStatus ehrStatus = new EhrStatus();
ehrStatus.setSubject(new PartySelf(new PartyRef(new HierObjectId(PATIENT_ID), "demographic", "PERSON")));
ehrStatus.setArchetypeNodeId("openEHR-EHR-EHR_STATUS.generic.v1");
ehrStatus.setName(new DvText("Integration tests status"));
client.ehrEndpoint().createEhr(ehrStatus);
}
use of org.ehrbase.client.openehrclient.OpenEhrClientConfig in project openEHR_SDK by ehrbase.
the class DefaultRestClientTestHelper method setupDefaultRestClientWithDefaultProvider.
public static DefaultRestClient setupDefaultRestClientWithDefaultProvider(DefaultValuesProvider defaultValuesProvider) throws URISyntaxException {
TestDataTemplateProvider templateProvider = new TestDataTemplateProvider();
OpenEhrClientConfig config = new OpenEhrClientConfig(new URI(OPEN_EHR_URL));
config.setDefaultValuesProvider(defaultValuesProvider);
DefaultRestClient client = new DefaultRestClient(config, templateProvider);
templateProvider.listTemplateIds().stream().forEach(t -> client.templateEndpoint().ensureExistence(t));
return client;
}
use of org.ehrbase.client.openehrclient.OpenEhrClientConfig in project openEHR_SDK by ehrbase.
the class DefaultRestClientTestHelper method setupDefaultRestClient.
public static DefaultRestClient setupDefaultRestClient() throws URISyntaxException {
TestDataTemplateProvider templateProvider = new TestDataTemplateProvider();
DefaultRestClient client = new DefaultRestClient(new OpenEhrClientConfig(new URI(OPEN_EHR_URL)), templateProvider);
templateProvider.listTemplateIds().stream().forEach(t -> client.templateEndpoint().ensureExistence(t));
return client;
}
Aggregations