<commit_before>/**
 * This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
 * If a copy of the MPL was not distributed with this file, You can obtain one at
 * http://mozilla.org/MPL/2.0/.
 *
 * This Source Code Form is also subject to the terms of the Health-Related Additional
 * Disclaimer of Warranty and Limitation of Liability available at
 * http://www.carewebframework.org/licensing/disclaimer.
 */
package org.carewebframework.vista.api.domain;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.fail;

import java.net.URISyntaxException;
import java.util.List;

import ca.uhn.fhir.model.api.BaseResource;
import ca.uhn.fhir.model.api.ExtensionDt;
import ca.uhn.fhir.model.dstu.resource.Binary;
import ca.uhn.fhir.model.dstu.resource.Condition;
import ca.uhn.fhir.model.dstu.resource.DocumentReference;
import ca.uhn.fhir.model.dstu.resource.Patient;
import ca.uhn.fhir.model.primitive.UriDt;
import ca.uhn.fhir.rest.client.GenericClient;

import org.carewebframework.api.domain.IDomainFactory;
import org.carewebframework.api.test.CommonTest;
import org.carewebframework.fhir.client.ClientUtil;
import org.carewebframework.fhir.common.FhirDomainFactory;
import org.carewebframework.vista.api.mbroker.BrokerClient;

import org.junit.Test;

public class FhirTest extends CommonTest {
    
    private static final String ROOT = "http://broker/FHIR/";
    
    private static final String[] PAT_IDS = { "1", "2" };
    
    @Test
    public void test() throws URISyntaxException {
        ClientUtil.registerHttpClient("broker://*", new BrokerClient());
        IDomainFactory<BaseResource> factory = FhirDomainFactory.getInstance();
        Patient pat1 = factory.fetchObject(Patient.class, "1");
        assertNotNull(pat1);
        for (ExtensionDt extension : pat1.getAllUndeclaredExtensions()) {
            System.out.println(extension.getUrlAsString() + "=" + extension.getValue());<commit_msg>Remove unnecessary code from unit test.<commit_after>/**
 * This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
 * If a copy of the MPL was not distributed with this file, You can obtain one at
 * http://mozilla.org/MPL/2.0/.
 *
 * This Source Code Form is also subject to the terms of the Health-Related Additional
 * Disclaimer of Warranty and Limitation of Liability available at
 * http://www.carewebframework.org/licensing/disclaimer.
 */
package org.carewebframework.vista.api.domain;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.fail;

import java.net.URISyntaxException;
import java.util.List;

import ca.uhn.fhir.model.api.BaseResource;
import ca.uhn.fhir.model.api.ExtensionDt;
import ca.uhn.fhir.model.dstu.resource.Binary;
import ca.uhn.fhir.model.dstu.resource.Condition;
import ca.uhn.fhir.model.dstu.resource.DocumentReference;
import ca.uhn.fhir.model.dstu.resource.Patient;
import ca.uhn.fhir.model.primitive.UriDt;
import ca.uhn.fhir.rest.client.GenericClient;

import org.carewebframework.api.domain.IDomainFactory;
import org.carewebframework.api.test.CommonTest;
import org.carewebframework.fhir.client.ClientUtil;
import org.carewebframework.fhir.common.FhirDomainFactory;

import org.junit.Test;

public class FhirTest extends CommonTest {
    
    private static final String ROOT = "http://broker/FHIR/";
    
    private static final String[] PAT_IDS = { "1", "2" };
    
    @Test
    public void test() throws URISyntaxException {
        IDomainFactory<BaseResource> factory = FhirDomainFactory.getInstance();
        Patient pat1 = factory.fetchObject(Patient.class, "1");
        assertNotNull(pat1);
        for (ExtensionDt extension : pat1.getAllUndeclaredExtensions()) {
            System.out.println(extension.getUrlAsString() + "=" + extension.getValue());
{'fraction_non_alphanumeric': 0.10875670155731428, 'fraction_numerical': 0.0051059484299208575, 'mean_word_length': 4.2520107238605895, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1897604', 'n_tokens_mistral': 1230, 'n_tokens_neox': 1203, 'n_words': 285}