本文整理汇总了Java中org.hl7.fhir.dstu3.model.Organization.setName方法的典型用法代码示例。如果您正苦于以下问题:Java Organization.setName方法的具体用法?Java Organization.setName怎么用?Java Organization.setName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.hl7.fhir.dstu3.model.Organization
的用法示例。
在下文中一共展示了Organization.setName方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: search
import org.hl7.fhir.dstu3.model.Organization; //导入方法依赖的package包/类
@Search()
public List<Patient> search(@IncludeParam() Set<Include> theIncludes) {
ourLog.info("Includes: {}", theIncludes);
// Grandparent has ID, other orgs don't
Organization gp = new Organization();
gp.setId("Organization/GP");
gp.setName("grandparent");
Organization parent = new Organization();
parent.setName("parent");
parent.getPartOf().setResource(gp);
Organization child = new Organization();
child.setName("child");
child.getPartOf().setResource(parent);
Patient patient = new Patient();
patient.setId("Patient/FOO");
patient.getManagingOrganization().setResource(child);
ArrayList<Patient> retVal = new ArrayList<Patient>();
retVal.add(patient);
return retVal;
}
示例2: testGetResourceReferenceInExtension
import org.hl7.fhir.dstu3.model.Organization; //导入方法依赖的package包/类
@Test
public void testGetResourceReferenceInExtension() {
Patient p = new Patient();
p.addName().setFamily("PATIENT");
Organization o = new Organization();
o.setName("ORG");
Reference ref = new Reference(o);
Extension ext = new Extension("urn:foo", ref);
p.addExtension(ext);
FhirTerser t = ourCtx.newTerser();
List<IBaseReference> refs = t.getAllPopulatedChildElementsOfType(p, IBaseReference.class);
assertEquals(1, refs.size());
assertSame(ref, refs.get(0));
}
示例3: testDeleteFail
import org.hl7.fhir.dstu3.model.Organization; //导入方法依赖的package包/类
@Test
public void testDeleteFail() throws Exception {
Organization o = new Organization();
o.setName("FOO");
IIdType oid = myOrganizationDao.create(o).getId().toUnqualifiedVersionless();
Patient p = new Patient();
p.setManagingOrganization(new Reference(oid));
IIdType pid = myPatientDao.create(p).getId().toUnqualifiedVersionless();
try {
myOrganizationDao.delete(oid);
fail();
} catch (ResourceVersionConflictException e) {
assertEquals("Unable to delete Organization/"+oid.getIdPart()+" because at least one resource has a reference to this resource. First reference found was resource Organization/"+oid.getIdPart()+" in path Patient.managingOrganization", e.getMessage());
}
myPatientDao.delete(pid);
myOrganizationDao.delete(oid);
}
示例4: testDeleteAllow
import org.hl7.fhir.dstu3.model.Organization; //导入方法依赖的package包/类
@Test
public void testDeleteAllow() throws Exception {
myDaoConfig.setEnforceReferentialIntegrityOnDelete(false);
Organization o = new Organization();
o.setName("FOO");
IIdType oid = myOrganizationDao.create(o).getId().toUnqualifiedVersionless();
Patient p = new Patient();
p.setManagingOrganization(new Reference(oid));
IIdType pid = myPatientDao.create(p).getId().toUnqualifiedVersionless();
myOrganizationDao.delete(oid);
myPatientDao.delete(pid);
}
示例5: testExternalReferenceBlockedByDefault
import org.hl7.fhir.dstu3.model.Organization; //导入方法依赖的package包/类
@Test
public void testExternalReferenceBlockedByDefault() {
Organization org = new Organization();
org.setId("FOO");
org.setName("Org Name");
myOrganizationDao.update(org, mySrd);
Patient p = new Patient();
p.getManagingOrganization().setReference("http://example.com/base/Organization/FOO");
try {
myPatientDao.create(p, mySrd);
fail();
} catch (InvalidRequestException e) {
assertEquals("Resource contains external reference to URL \"http://example.com/base/Organization/FOO\" but this server is not configured to allow external references", e.getMessage());
}
}
示例6: testSearchWithGenericReturnType
import org.hl7.fhir.dstu3.model.Organization; //导入方法依赖的package包/类
@Test
public void testSearchWithGenericReturnType() throws Exception {
final Bundle bundle = new Bundle();
final ExtendedPatient patient = new ExtendedPatient();
patient.addIdentifier().setValue("PRP1660");
bundle.addEntry().setResource(patient);
final Organization org = new Organization();
org.setName("FOO");
patient.getManagingOrganization().setResource(org);
final FhirContext ctx = FhirContext.forDstu3();
ctx.setDefaultTypeForProfile(ExtendedPatient.HTTP_FOO_PROFILES_PROFILE, ExtendedPatient.class);
ctx.getRestfulClientFactory().setHttpClient(myHttpClient);
ctx.getRestfulClientFactory().setServerValidationMode(ServerValidationModeEnum.NEVER);
String msg = ctx.newXmlParser().setPrettyPrint(true).encodeResourceToString(bundle);
ArgumentCaptor<HttpUriRequest> capt = ArgumentCaptor.forClass(HttpUriRequest.class);
when(myHttpResponse.getStatusLine()).thenReturn(new BasicStatusLine(new ProtocolVersion("HTTP", 1, 1), 200, "OK"));
when(myHttpResponse.getEntity().getContentType()).thenReturn(new BasicHeader("content-type", Constants.CT_FHIR_XML + "; charset=UTF-8"));
when(myHttpResponse.getEntity().getContent()).thenReturn(new ReaderInputStream(new StringReader(msg), Charset.forName("UTF-8")));
// httpResponse = new BasicHttpResponse(statusline, catalog, locale)
when(myHttpClient.execute(capt.capture())).thenReturn(myHttpResponse);
ITestClient client = ctx.newRestfulClient(ITestClient.class, "http://foo");
List<IBaseResource> response = client.getPatientByDobWithGenericResourceReturnType(new DateParam(ParamPrefixEnum.GREATERTHAN_OR_EQUALS, "2011-01-02"));
assertEquals("http://foo/Patient?birthdate=ge2011-01-02", capt.getValue().getURI().toString());
ExtendedPatient patientResp = (ExtendedPatient) response.get(0);
assertEquals("PRP1660", patientResp.getIdentifier().get(0).getValue());
}
示例7: testSearchWithGenericReturnType2
import org.hl7.fhir.dstu3.model.Organization; //导入方法依赖的package包/类
@Test
public void testSearchWithGenericReturnType2() throws Exception {
final Bundle bundle = new Bundle();
final ExtendedPatient patient = new ExtendedPatient();
patient.addIdentifier().setValue("PRP1660");
bundle.addEntry().setResource(patient);
final Organization org = new Organization();
org.setName("FOO");
patient.getManagingOrganization().setResource(org);
final FhirContext ctx = FhirContext.forDstu3();
ctx.setDefaultTypeForProfile(ExtendedPatient.HTTP_FOO_PROFILES_PROFILE, ExtendedPatient.class);
ctx.getRestfulClientFactory().setHttpClient(myHttpClient);
ctx.getRestfulClientFactory().setServerValidationMode(ServerValidationModeEnum.NEVER);
String msg = ctx.newXmlParser().setPrettyPrint(true).encodeResourceToString(bundle);
ArgumentCaptor<HttpUriRequest> capt = ArgumentCaptor.forClass(HttpUriRequest.class);
when(myHttpResponse.getStatusLine()).thenReturn(new BasicStatusLine(new ProtocolVersion("HTTP", 1, 1), 200, "OK"));
when(myHttpResponse.getEntity().getContentType()).thenReturn(new BasicHeader("content-type", Constants.CT_FHIR_XML + "; charset=UTF-8"));
when(myHttpResponse.getEntity().getContent()).thenReturn(new ReaderInputStream(new StringReader(msg), Charset.forName("UTF-8")));
// httpResponse = new BasicHttpResponse(statusline, catalog, locale)
when(myHttpClient.execute(capt.capture())).thenReturn(myHttpResponse);
ITestClient client = ctx.newRestfulClient(ITestClient.class, "http://foo");
List<IAnyResource> response = client.getPatientByDobWithGenericResourceReturnType2(new DateParam(ParamPrefixEnum.GREATERTHAN_OR_EQUALS, "2011-01-02"));
assertEquals("http://foo/Patient?birthdate=ge2011-01-02", capt.getValue().getURI().toString());
ExtendedPatient patientResp = (ExtendedPatient) response.get(0);
assertEquals("PRP1660", patientResp.getIdentifier().get(0).getValue());
}
示例8: addHospitalToBundle
import org.hl7.fhir.dstu3.model.Organization; //导入方法依赖的package包/类
public static void addHospitalToBundle(Hospital h, Bundle bundle) {
Organization organizationResource = new Organization();
organizationResource.addIdentifier().setSystem("https://github.com/synthetichealth/synthea")
.setValue((String) h.getResourceID());
Map<String, Object> hospitalAttributes = h.getAttributes();
organizationResource.setName(hospitalAttributes.get("name").toString());
Address address = new Address();
address.addLine(hospitalAttributes.get("address").toString());
address.setCity(hospitalAttributes.get("city").toString());
address.setPostalCode(hospitalAttributes.get("city_zip").toString());
address.setState(hospitalAttributes.get("state").toString());
organizationResource.addAddress(address);
Table<Integer, String, AtomicInteger> utilization = h.getUtilization();
// calculate totals for utilization
int totalEncounters = utilization.column(Provider.ENCOUNTERS).values().stream()
.mapToInt(ai -> ai.get()).sum();
Extension encountersExtension = new Extension(SYNTHEA_URI + "utilization-encounters-extension");
IntegerType encountersValue = new IntegerType(totalEncounters);
encountersExtension.setValue(encountersValue);
organizationResource.addExtension(encountersExtension);
int totalProcedures = utilization.column(Provider.PROCEDURES).values().stream()
.mapToInt(ai -> ai.get()).sum();
Extension proceduresExtension = new Extension(SYNTHEA_URI + "utilization-procedures-extension");
IntegerType proceduresValue = new IntegerType(totalProcedures);
proceduresExtension.setValue(proceduresValue);
organizationResource.addExtension(proceduresExtension);
int totalLabs = utilization.column(Provider.LABS).values().stream().mapToInt(ai -> ai.get())
.sum();
Extension labsExtension = new Extension(SYNTHEA_URI + "utilization-labs-extension");
IntegerType labsValue = new IntegerType(totalLabs);
labsExtension.setValue(labsValue);
organizationResource.addExtension(labsExtension);
int totalPrescriptions = utilization.column(Provider.PRESCRIPTIONS).values().stream()
.mapToInt(ai -> ai.get()).sum();
Extension prescriptionsExtension = new Extension(
SYNTHEA_URI + "utilization-prescriptions-extension");
IntegerType prescriptionsValue = new IntegerType(totalPrescriptions);
prescriptionsExtension.setValue(prescriptionsValue);
organizationResource.addExtension(prescriptionsExtension);
Integer bedCount = h.getBedCount();
if (bedCount != null) {
Extension bedCountExtension = new Extension(SYNTHEA_URI + "bed-count-extension");
IntegerType bedCountValue = new IntegerType(bedCount);
bedCountExtension.setValue(bedCountValue);
organizationResource.addExtension(bedCountExtension);
}
newEntry(bundle, organizationResource, h.getResourceID());
}
示例9: transform
import org.hl7.fhir.dstu3.model.Organization; //导入方法依赖的package包/类
@Override
public Organization transform(final OrganisationEntity organisationEntity) {
final Organization organisation = new Organization();
Meta meta = new Meta().addProfile(CareConnectProfile.Organization_1);
if (organisationEntity.getUpdated() != null) {
meta.setLastUpdated(organisationEntity.getUpdated());
}
else {
if (organisationEntity.getCreated() != null) {
meta.setLastUpdated(organisationEntity.getCreated());
}
}
organisation.setMeta(meta);
for(int f=0;f<organisationEntity.getIdentifiers().size();f++)
{
organisation.addIdentifier()
.setSystem(organisationEntity.getIdentifiers().get(f).getSystem().getUri())
.setValue(organisationEntity.getIdentifiers().get(f).getValue());
}
organisation.setId(organisationEntity.getId().toString());
organisation.setName(
organisationEntity.getName());
for(OrganisationTelecom telecom : organisationEntity.getTelecoms())
{
organisation.addTelecom()
.setSystem(telecom.getSystem())
.setValue(telecom.getValue())
.setUse(telecom.getTelecomUse());
}
for(OrganisationAddress organisationAddress : organisationEntity.getAddresses()) {
Address adr = addressTransformer.transform(organisationAddress);
organisation.addAddress(adr);
}
if (organisationEntity.getType()!=null) {
organisation.addType()
.addCoding()
.setCode(organisationEntity.getType().getCode())
.setDisplay(organisationEntity.getType().getDisplay())
.setSystem(organisationEntity.getType().getSystem());
}
if (organisationEntity.getPartOf() != null) {
organisation.setPartOf(new Reference("Organization/"+organisationEntity.getPartOf().getId()));
organisation.getPartOf().setDisplay(organisationEntity.getPartOf().getName());
}
if (organisationEntity.getActive() != null) {
organisation.setActive(organisationEntity.getActive());
}
return organisation;
}
开发者ID:nhsconnect,项目名称:careconnect-reference-implementation,代码行数:61,代码来源:OrganisationEntityToFHIROrganizationTransformer.java