本文整理汇总了Java中ca.uhn.fhir.model.dstu2.resource.Organization类的典型用法代码示例。如果您正苦于以下问题:Java Organization类的具体用法?Java Organization怎么用?Java Organization使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Organization类属于ca.uhn.fhir.model.dstu2.resource包,在下文中一共展示了Organization类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: manualContained
import ca.uhn.fhir.model.dstu2.resource.Organization; //导入依赖的package包/类
public static void manualContained() {
// START SNIPPET: manualContained
// Create an organization, and give it a local ID
Organization org = new Organization();
org.setId("#localOrganization");
org.getNameElement().setValue("Contained Test Organization");
// Create a patient
Patient patient = new Patient();
patient.setId("Patient/1333");
patient.addIdentifier().setSystem("urn:mrns").setValue("253345");
// Set the reference, and manually add the contained resource
patient.getManagingOrganization().setReference("#localOrganization");
patient.getContained().getContainedResources().add(org);
String encoded = ourCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(patient);
System.out.println(encoded);
// END SNIPPET: manualContained
}
开发者ID:gajen0981,项目名称:FHIR-Server,代码行数:21,代码来源:ResourceRefs.java
示例2: searchForPatients
import ca.uhn.fhir.model.dstu2.resource.Organization; //导入依赖的package包/类
@Search
private List<IResource> searchForPatients() {
// Create an organization
Organization org = new Organization();
org.setId("Organization/65546");
org.setName("Test Organization");
// Create a patient
Patient patient = new Patient();
patient.setId("Patient/1333");
patient.addIdentifier().setSystem("urn:mrns").setValue("253345");
patient.getManagingOrganization().setResource(org);
// Here we return only the patient object, which has links to other resources
List<IResource> retVal = new ArrayList<IResource>();
retVal.add(patient);
return retVal;
}
开发者ID:gajen0981,项目名称:FHIR-Server,代码行数:19,代码来源:IncludesExamples.java
示例3: normalInclude
import ca.uhn.fhir.model.dstu2.resource.Organization; //导入依赖的package包/类
@Search(queryName = "normalInclude")
public List<Patient> normalInclude() {
Organization o1 = new Organization();
o1.getNameElement().setValue("o1");
o1.setId("o1");
Patient p1 = new Patient();
p1.setId("p1");
p1.addIdentifier().setValue("p1");
p1.getManagingOrganization().setResource(o1);
Patient p2 = new Patient();
p2.setId("p2");
p2.addIdentifier().setValue("p2");
p2.getManagingOrganization().setResource(o1);
return Arrays.asList(p1, p2);
}
开发者ID:gajen0981,项目名称:FHIR-Server,代码行数:19,代码来源:IncludeDstu2Test.java
示例4: extInclude
import ca.uhn.fhir.model.dstu2.resource.Organization; //导入依赖的package包/类
@Search(queryName = "extInclude")
public List<Patient> extInclude() {
Organization o1 = new Organization();
o1.getNameElement().setValue("o1");
o1.setId("o1");
Patient p1 = new Patient();
p1.setId("p1");
p1.addIdentifier().setValue("p1");
p1.addUndeclaredExtension(false, "http://foo", new ResourceReferenceDt(o1));
Patient p2 = new Patient();
p2.setId("p2");
p2.addIdentifier().setValue("p2");
p2.addUndeclaredExtension(false, "http://foo", new ResourceReferenceDt(o1));
return Arrays.asList(p1, p2);
}
开发者ID:gajen0981,项目名称:FHIR-Server,代码行数:19,代码来源:IncludeDstu2Test.java
示例5: declaredExtInclude
import ca.uhn.fhir.model.dstu2.resource.Organization; //导入依赖的package包/类
@Search(queryName = "declaredExtInclude")
public List<ExtPatient> declaredExtInclude() {
Organization o1 = new Organization();
o1.getNameElement().setValue("o1");
o1.setId("o1");
Organization o2 = new Organization();
o2.getNameElement().setValue("o2");
o2.setId("o2");
o1.getPartOf().setResource(o2);
ExtPatient p1 = new ExtPatient();
p1.setId("p1");
p1.addIdentifier().setValue("p1");
p1.getSecondOrg().setResource(o1);
ExtPatient p2 = new ExtPatient();
p2.setId("p2");
p2.addIdentifier().setValue("p2");
p2.getSecondOrg().setResource(o1);
return Arrays.asList(p1, p2);
}
开发者ID:gajen0981,项目名称:FHIR-Server,代码行数:24,代码来源:IncludeDstu2Test.java
示例6: containedInclude
import ca.uhn.fhir.model.dstu2.resource.Organization; //导入依赖的package包/类
@Search(queryName = "containedInclude")
public List<Patient> containedInclude() {
Organization o1 = new Organization();
o1.getNameElement().setValue("o1");
Patient p1 = new Patient();
p1.setId("p1");
p1.addIdentifier().setValue("p1");
p1.getManagingOrganization().setResource(o1);
Patient p2 = new Patient();
p2.setId("p2");
p2.addIdentifier().setValue("p2");
p2.getManagingOrganization().setResource(o1);
return Arrays.asList(p1, p2);
}
开发者ID:gajen0981,项目名称:FHIR-Server,代码行数:18,代码来源:IncludeDstu2Test.java
示例7: testGetAllPopulatedChildElementsOfTypeDescendsIntoContained
import ca.uhn.fhir.model.dstu2.resource.Organization; //导入依赖的package包/类
@Test
public void testGetAllPopulatedChildElementsOfTypeDescendsIntoContained() {
Patient p = new Patient();
p.addName().addFamily("PATIENT");
Organization o = new Organization();
o.getNameElement().setValue("ORGANIZATION");
p.getContained().getContainedResources().add(o);
FhirTerser t = ourCtx.newTerser();
List<StringDt> strings = t.getAllPopulatedChildElementsOfType(p, StringDt.class);
assertEquals(2, strings.size());
assertThat(strings, containsInAnyOrder(new StringDt("PATIENT"), new StringDt("ORGANIZATION")));
}
开发者ID:gajen0981,项目名称:FHIR-Server,代码行数:17,代码来源:FhirTerserTest.java
示例8: testReverseIncludes
import ca.uhn.fhir.model.dstu2.resource.Organization; //导入依赖的package包/类
@Test
public void testReverseIncludes() {
String methodName = "testReverseIncludes";
Organization org = new Organization();
org.setName("X"+methodName+"X");
IdDt orgId = ourOrganizationDao.create(org).getId();
Patient pat = new Patient();
pat.addName().addFamily("X"+methodName+"X");
pat.getManagingOrganization().setReference(orgId.toUnqualifiedVersionless());
ourPatientDao.create(pat);
SearchParameterMap map = new SearchParameterMap();
map.add(Organization.SP_NAME, new StringParam("X"+methodName+"X"));
map.setRevIncludes(Collections.singleton(Patient.INCLUDE_ORGANIZATION));
IBundleProvider resultsP = ourOrganizationDao.search(map);
assertEquals(2, resultsP.size());
List<IResource> results = resultsP.getResources(0, resultsP.size());
assertEquals(2, results.size());
assertEquals(Organization.class, results.get(0).getClass());
assertEquals(Patient.class, results.get(1).getClass());
}
开发者ID:gajen0981,项目名称:FHIR-Server,代码行数:23,代码来源:FhirResourceDaoDstu2Test.java
示例9: testStoreUnversionedResources
import ca.uhn.fhir.model.dstu2.resource.Organization; //导入依赖的package包/类
@Test
public void testStoreUnversionedResources() {
Organization o1 = new Organization();
o1.getNameElement().setValue("AAA");
IdDt o1id = ourOrganizationDao.create(o1).getId();
assertTrue(o1id.hasVersionIdPart());
Patient p1 = new Patient();
p1.addName().addFamily("AAAA");
p1.getManagingOrganization().setReference(o1id);
IdDt p1id = ourPatientDao.create(p1).getId();
p1 = ourPatientDao.read(p1id);
assertFalse(p1.getManagingOrganization().getReference().hasVersionIdPart());
assertEquals(o1id.toUnqualifiedVersionless(), p1.getManagingOrganization().getReference().toUnqualifiedVersionless());
}
开发者ID:gajen0981,项目名称:FHIR-Server,代码行数:18,代码来源:FhirResourceDaoDstu2Test.java
示例10: testCountParam
import ca.uhn.fhir.model.dstu2.resource.Organization; //导入依赖的package包/类
@Test
public void testCountParam() throws Exception {
// NB this does not get used- The paging provider has its own limits built in
ourDaoConfig.setHardSearchLimit(100);
List<IResource> resources = new ArrayList<IResource>();
for (int i = 0; i < 100; i++) {
Organization org = new Organization();
org.setName("rpdstu2_testCountParam_01");
resources.add(org);
}
ourClient.transaction().withResources(resources).prettyPrint().encodedXml().execute();
Bundle found = ourClient.search().forResource(Organization.class).where(Organization.NAME.matches().value("rpdstu2_testCountParam_01")).limitTo(10).execute();
assertEquals(100, found.getTotalResults().getValue().intValue());
assertEquals(10, found.getEntries().size());
found = ourClient.search().forResource(Organization.class).where(Organization.NAME.matches().value("rpdstu2_testCountParam_01")).limitTo(999).execute();
assertEquals(100, found.getTotalResults().getValue().intValue());
assertEquals(50, found.getEntries().size());
}
开发者ID:gajen0981,项目名称:FHIR-Server,代码行数:23,代码来源:ResourceProviderDstu2Test.java
示例11: testSaveAndRetrieveWithContained
import ca.uhn.fhir.model.dstu2.resource.Organization; //导入依赖的package包/类
@Test
public void testSaveAndRetrieveWithContained() {
Patient p1 = new Patient();
p1.addIdentifier().setSystem("urn:system:rpdstu2").setValue("testSaveAndRetrieveWithContained01");
Organization o1 = new Organization();
o1.addIdentifier().setSystem("urn:system:rpdstu2").setValue("testSaveAndRetrieveWithContained02");
p1.getManagingOrganization().setResource(o1);
IdDt newId = ourClient.create().resource(p1).execute().getId();
Patient actual = ourClient.read(Patient.class, newId);
assertEquals(1, actual.getContained().getContainedResources().size());
assertThat(actual.getText().getDiv().getValueAsString(), containsString("<td>Identifier</td><td>testSaveAndRetrieveWithContained01</td>"));
Bundle b = ourClient.search().forResource("Patient").where(Patient.IDENTIFIER.exactly().systemAndCode("urn:system:rpdstu2", "testSaveAndRetrieveWithContained01")).prettyPrint().execute();
assertEquals(1, b.size());
}
开发者ID:gajen0981,项目名称:FHIR-Server,代码行数:21,代码来源:ResourceProviderDstu2Test.java
示例12: searchForPatients
import ca.uhn.fhir.model.dstu2.resource.Organization; //导入依赖的package包/类
@Search
private List<IBaseResource> searchForPatients() {
// Create an organization
Organization org = new Organization();
org.setId("Organization/65546");
org.setName("Test Organization");
// Create a patient
Patient patient = new Patient();
patient.setId("Patient/1333");
patient.addIdentifier().setSystem("urn:mrns").setValue("253345");
patient.getManagingOrganization().setResource(org);
// Here we return only the patient object, which has links to other resources
List<IBaseResource> retVal = new ArrayList<IBaseResource>();
retVal.add(patient);
return retVal;
}
开发者ID:jamesagnew,项目名称:hapi-fhir,代码行数:19,代码来源:IncludesExamples.java
示例13: createOrganization
import ca.uhn.fhir.model.dstu2.resource.Organization; //导入依赖的package包/类
public static String createOrganization(FhirContext oContext,List<Organization> listOfOrganization,String serverUrl) throws Exception
{
MethodOutcome respOutcome=null;
String stringTransactionResult="{TransactionResultStatus:no}";
try
{
IGenericClient client=oContext.newRestfulGenericClient(serverUrl);
int compter=0;
int nbreResourceCreated=0;
int total=listOfOrganization.size();
for(Organization oOrganization: listOfOrganization)
{
respOutcome=client.update()
.resource(oOrganization)
.prettyPrint()
.encodedJson()
.execute();
if(respOutcome.getCreated())
{
nbreResourceCreated++;
}
}
int success=nbreResourceCreated;
int failed=total-success;
stringTransactionResult="total:"+total+"," +
"succes:"+success+"," +
"failed:"+failed+"}";
}
catch (Exception exc)
{
throw new Exception(exc.getMessage());
}
return stringTransactionResult;
}
开发者ID:gerard-bisama,项目名称:DHIS2-fhir-lab-app,代码行数:37,代码来源:FhirResourceValidator.java
示例14: main
import ca.uhn.fhir.model.dstu2.resource.Organization; //导入依赖的package包/类
/**
* The main method here will directly call an open FHIR server and retrieve a
* list of resources matching a given criteria, then load a linked resource.
*/
public static void main(String[] args) throws IOException {
// Create a client factory
FhirContext ctx = new FhirContext();
// Create the client
String serverBase = "http://fhir.healthintersections.com.au/open";
ClientInterface client = ctx.newRestfulClient(ClientInterface.class, serverBase);
// Invoke the client to search for patient
List<Patient> patients = client.findPatientsForMrn(new IdentifierDt("urn:oid:1.2.36.146.595.217.0.1", "12345"));
System.out.println("Found " + patients.size() + " patients");
// Print a value from the loaded resource
Patient patient = patients.get(0);
System.out.println("Patient Last Name: " + patient.getName().get(0).getFamily().get(0).getValue());
// Load a referenced resource
ResourceReferenceDt managingRef = patient.getManagingOrganization();
Organization org = (Organization) managingRef.loadResource(client);
// Print organization name
System.out.println(org.getName());
}
开发者ID:gajen0981,项目名称:FHIR-Server,代码行数:31,代码来源:CompleteExampleClient.java
示例15: testEncodeAndParseBundleWithoutResourceIds
import ca.uhn.fhir.model.dstu2.resource.Organization; //导入依赖的package包/类
@Test
public void testEncodeAndParseBundleWithoutResourceIds() {
Organization org = new Organization();
org.addIdentifier().setSystem("urn:system").setValue("someval");
Bundle bundle = Bundle.withSingleResource(org);
String str = ourCtx.newXmlParser().encodeBundleToString(bundle);
ourLog.info(str);
Bundle parsed = ourCtx.newXmlParser().parseBundle(str);
assertThat(parsed.getEntries().get(0).getResource().getId().getValue(), emptyOrNullString());
assertTrue(parsed.getEntries().get(0).getResource().getId().isEmpty());
}
开发者ID:gajen0981,项目名称:FHIR-Server,代码行数:14,代码来源:XmlParserDstu2Test.java
示例16: testOrganizationName
import ca.uhn.fhir.model.dstu2.resource.Organization; //导入依赖的package包/类
@Test
public void testOrganizationName() {
//@formatter:off
String inputStr = "{\"resourceType\":\"Organization\",\n" +
" \"extension\":[\n" +
" {\n" +
" \"url\":\"http://fhir.connectinggta.ca/Profile/organization#providerIdPool\",\n" +
" \"valueUri\":\"urn:oid:2.16.840.1.113883.3.239.23.21.1\"\n" +
" }\n" +
" ],\n" +
" \"text\":{\n" +
" \"status\":\"empty\",\n" +
" \"div\":\"<div xmlns=\\\"http://www.w3.org/1999/xhtml\\\">No narrative template available for resource profile: http://fhir.connectinggta.ca/Profile/organization</div>\"\n" +
" },\n" +
" \"identifier\":[\n" +
" {\n" +
" \"use\":\"official\",\n" +
" \"label\":\"HSP 2.16.840.1.113883.3.239.23.21\",\n" +
" \"system\":\"urn:cgta:hsp_ids\",\n" +
" \"value\":\"urn:oid:2.16.840.1.113883.3.239.23.21\"\n" +
" }\n" +
" ],\n" +
" \"name\":\"Peterborough Regional Health Centre\"\n" +
" }\n" +
" }";
//@formatter:on
Set<Long> val = ourOrganizationDao.searchForIds("name", new StringParam("P"));
int initial = val.size();
Organization org = ourFhirCtx.newJsonParser().parseResource(Organization.class, inputStr);
ourOrganizationDao.create(org);
val = ourOrganizationDao.searchForIds("name", new StringParam("P"));
assertEquals(initial + 1, val.size());
}
开发者ID:gajen0981,项目名称:FHIR-Server,代码行数:39,代码来源:FhirResourceDaoDstu2Test.java
示例17: testStoreUtf8Characters
import ca.uhn.fhir.model.dstu2.resource.Organization; //导入依赖的package包/类
/**
* Test for issue #60
*/
@Test
public void testStoreUtf8Characters() throws Exception {
Organization org = new Organization();
org.setName("測試醫院");
org.addIdentifier().setSystem("urn:system").setValue("testStoreUtf8Characters_01");
IdDt orgId = ourOrganizationDao.create(org).getId();
Organization returned = ourOrganizationDao.read(orgId);
String val = ourFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(returned);
ourLog.info(val);
assertThat(val, containsString("<name value=\"測試醫院\"/>"));
}
开发者ID:gajen0981,项目名称:FHIR-Server,代码行数:17,代码来源:FhirResourceDaoDstu2Test.java
示例18: testStringParamWhichIsTooLong
import ca.uhn.fhir.model.dstu2.resource.Organization; //导入依赖的package包/类
@Test
public void testStringParamWhichIsTooLong() {
Organization org = new Organization();
String str = "testStringParamLong__lvdaoy843s89tll8gvs89l4s3gelrukveilufyebrew8r87bv4b77feli7fsl4lv3vb7rexloxe7olb48vov4o78ls7bvo7vb48o48l4bb7vbvx";
str = str + str;
org.getNameElement().setValue(str);
assertThat(str.length(), greaterThan(ResourceIndexedSearchParamString.MAX_LENGTH));
Set<Long> val = ourOrganizationDao.searchForIds("name", new StringParam("P"));
int initial = val.size();
ourOrganizationDao.create(org);
val = ourOrganizationDao.searchForIds("name", new StringParam("P"));
assertEquals(initial + 0, val.size());
val = ourOrganizationDao.searchForIds("name", new StringParam(str.substring(0, ResourceIndexedSearchParamString.MAX_LENGTH)));
assertEquals(initial + 1, val.size());
try {
ourOrganizationDao.searchForIds("name", new StringParam(str.substring(0, ResourceIndexedSearchParamString.MAX_LENGTH + 1)));
fail();
} catch (InvalidRequestException e) {
// ok
}
}
开发者ID:gajen0981,项目名称:FHIR-Server,代码行数:29,代码来源:FhirResourceDaoDstu2Test.java
示例19: testSearchWithInclude
import ca.uhn.fhir.model.dstu2.resource.Organization; //导入依赖的package包/类
@Test
public void testSearchWithInclude() throws Exception {
Organization org = new Organization();
org.addIdentifier().setSystem("urn:system:rpdstu2").setValue("testSearchWithInclude01");
IdDt orgId = ourClient.create().resource(org).prettyPrint().encodedXml().execute().getId();
Patient pat = new Patient();
pat.addIdentifier().setSystem("urn:system:rpdstu2").setValue("testSearchWithInclude02");
pat.getManagingOrganization().setReference(orgId);
ourClient.create().resource(pat).prettyPrint().encodedXml().execute().getId();
//@formatter:off
Bundle found = ourClient
.search()
.forResource(Patient.class)
.where(Patient.IDENTIFIER.exactly().systemAndIdentifier("urn:system:rpdstu2","testSearchWithInclude02"))
.include(Patient.INCLUDE_ORGANIZATION)
.prettyPrint()
.execute();
//@formatter:on
assertEquals(2, found.size());
assertEquals(Patient.class, found.getEntries().get(0).getResource().getClass());
assertEquals(BundleEntrySearchModeEnum.MATCH, found.getEntries().get(0).getSearchMode().getValueAsEnum());
assertEquals(BundleEntrySearchModeEnum.MATCH, found.getEntries().get(0).getResource().getResourceMetadata().get(ResourceMetadataKeyEnum.ENTRY_SEARCH_MODE));
assertEquals(Organization.class, found.getEntries().get(1).getResource().getClass());
assertEquals(BundleEntrySearchModeEnum.INCLUDE, found.getEntries().get(1).getSearchMode().getValueAsEnum());
assertEquals(BundleEntrySearchModeEnum.INCLUDE, found.getEntries().get(1).getResource().getResourceMetadata().get(ResourceMetadataKeyEnum.ENTRY_SEARCH_MODE));
}
开发者ID:gajen0981,项目名称:FHIR-Server,代码行数:30,代码来源:ResourceProviderDstu2Test.java
示例20: testSearchByResourceChain
import ca.uhn.fhir.model.dstu2.resource.Organization; //导入依赖的package包/类
@Test
public void testSearchByResourceChain() {
delete("Organization", Organization.SP_NAME, "testSearchByResourceChainName01");
deleteToken("Patient", Patient.SP_IDENTIFIER, "urn:system", "testSearchByResourceChain01");
Organization o1 = new Organization();
o1.setName("testSearchByResourceChainName01");
IdDt o1id = ourClient.create().resource(o1).execute().getId();
Patient p1 = new Patient();
p1.addIdentifier().setSystem("urn:system").setValue("testSearchByResourceChain01");
p1.addName().addFamily("testSearchByResourceChainFamily01").addGiven("testSearchByResourceChainGiven01");
p1.setManagingOrganization(new ResourceReferenceDt(o1id));
IdDt p1Id = ourClient.create().resource(p1).execute().getId();
//@formatter:off
Bundle actual = ourClient.search()
.forResource(Patient.class)
.where(Patient.ORGANIZATION.hasId(o1id.getIdPart()))
.encodedJson().prettyPrint().execute();
//@formatter:on
assertEquals(1, actual.size());
assertEquals(p1Id.getIdPart(), actual.getEntries().get(0).getResource().getId().getIdPart());
//@formatter:off
actual = ourClient.search()
.forResource(Patient.class)
.where(Patient.ORGANIZATION.hasId(o1id.getValue()))
.encodedJson().prettyPrint().execute();
//@formatter:on
assertEquals(1, actual.size());
assertEquals(p1Id.getIdPart(), actual.getEntries().get(0).getResource().getId().getIdPart());
}
开发者ID:gajen0981,项目名称:FHIR-Server,代码行数:35,代码来源:ResourceProviderDstu2Test.java
注:本文中的ca.uhn.fhir.model.dstu2.resource.Organization类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论