当前位置: 首页>>代码示例>>Java>>正文


Java Observation.setId方法代码示例

本文整理汇总了Java中ca.uhn.fhir.model.dstu2.resource.Observation.setId方法的典型用法代码示例。如果您正苦于以下问题:Java Observation.setId方法的具体用法?Java Observation.setId怎么用?Java Observation.setId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ca.uhn.fhir.model.dstu2.resource.Observation的用法示例。


在下文中一共展示了Observation.setId方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: sendObservation

import ca.uhn.fhir.model.dstu2.resource.Observation; //导入方法依赖的package包/类
private Observation sendObservation(String code, String system) throws InterruptedException {
	Observation observation = new Observation();
	CodeableConceptDt codeableConcept = new CodeableConceptDt();
	observation.setCode(codeableConcept);
	CodingDt coding = codeableConcept.addCoding();
	coding.setCode(code);
	coding.setSystem(system);

	observation.setStatus(ObservationStatusEnum.FINAL);

	MethodOutcome methodOutcome = ourClient.create().resource(observation).execute();

	String observationId = methodOutcome.getId().getIdPart();
	observation.setId(observationId);

	waitForQueueToDrain();
	return observation;
}
 
开发者ID:jamesagnew,项目名称:hapi-fhir,代码行数:19,代码来源:RestHookTestWithInterceptorRegisteredToDaoConfigDstu2Test.java

示例2: createObservation

import ca.uhn.fhir.model.dstu2.resource.Observation; //导入方法依赖的package包/类
@Test
public void createObservation() throws Exception {
	Observation observation = new Observation();
	CodeableConceptDt cc = new CodeableConceptDt();
	observation.setCode(cc);
	CodingDt coding = cc.addCoding();
	coding.setCode("82313006");
	coding.setSystem("SNOMED-CT");
	ResourceReferenceDt reference = new ResourceReferenceDt();
	reference.setReference("Patient/" + myPatientId);
	observation.setSubject(reference);
	observation.setStatus(ObservationStatusEnum.FINAL);

	MethodOutcome methodOutcome2 = ourClient.create().resource(observation).execute();
	String observationId = methodOutcome2.getId().getIdPart();
	observation.setId(observationId);

	ourLog.info("Observation id generated by server is: " + observationId);

	ourLog.info("WS Messages: {}", mySocketImplementation.getMessages());
	waitForSize(2, mySocketImplementation.getMessages());
	assertThat(mySocketImplementation.getMessages(), contains("bound " + mySubscriptionId, "ping " + mySubscriptionId));
}
 
开发者ID:jamesagnew,项目名称:hapi-fhir,代码行数:24,代码来源:WebsocketWithCriteriaDstu2Test.java

示例3: createObservationThatDoesNotMatch

import ca.uhn.fhir.model.dstu2.resource.Observation; //导入方法依赖的package包/类
@Test
public void createObservationThatDoesNotMatch() throws Exception {
	Observation observation = new Observation();
	CodeableConceptDt cc = new CodeableConceptDt();
	observation.setCode(cc);
	CodingDt coding = cc.addCoding();
	coding.setCode("8231");
	coding.setSystem("SNOMED-CT");
	ResourceReferenceDt reference = new ResourceReferenceDt();
	reference.setReference("Patient/" + myPatientId);
	observation.setSubject(reference);
	observation.setStatus(ObservationStatusEnum.FINAL);

	MethodOutcome methodOutcome2 = ourClient.create().resource(observation).execute();
	String observationId = methodOutcome2.getId().getIdPart();
	observation.setId(observationId);

	ourLog.info("Observation id generated by server is: " + observationId);

	waitForSize(2, mySocketImplementation.getMessages());
	ourLog.info("WS Messages: {}", mySocketImplementation.getMessages());
	assertThat(mySocketImplementation.getMessages(), contains("bound " + mySubscriptionId));
}
 
开发者ID:jamesagnew,项目名称:hapi-fhir,代码行数:24,代码来源:WebsocketWithCriteriaDstu2Test.java

示例4: sendObservation

import ca.uhn.fhir.model.dstu2.resource.Observation; //导入方法依赖的package包/类
private Observation sendObservation(String code, String system) {
	Observation observation = new Observation();
	CodeableConceptDt codeableConcept = new CodeableConceptDt();
	observation.setCode(codeableConcept);
	CodingDt coding = codeableConcept.addCoding();
	coding.setCode(code);
	coding.setSystem(system);

	observation.setStatus(ObservationStatusEnum.FINAL);

	MethodOutcome methodOutcome = ourClient.create().resource(observation).execute();

	String observationId = methodOutcome.getId().getIdPart();
	observation.setId(observationId);

	return observation;
}
 
开发者ID:jamesagnew,项目名称:hapi-fhir,代码行数:18,代码来源:EmailSubscriptionDstu2Test.java

示例5: createObservationThatDoesNotMatch

import ca.uhn.fhir.model.dstu2.resource.Observation; //导入方法依赖的package包/类
@Test
public void createObservationThatDoesNotMatch() throws Exception {
	Observation observation = new Observation();
	CodeableConceptDt cc = new CodeableConceptDt();
	observation.setCode(cc);
	CodingDt coding = cc.addCoding();
	coding.setCode("8231");
	coding.setSystem("SNOMED-CT");
	ResourceReferenceDt reference = new ResourceReferenceDt();
	reference.setReference("Patient/" + myPatientId);
	observation.setSubject(reference);
	observation.setStatus(ObservationStatusEnum.FINAL);

	MethodOutcome methodOutcome2 = ourClient.create().resource(observation).execute();
	String observationId = methodOutcome2.getId().getIdPart();
	observation.setId(observationId);

	ourLog.info("Observation id generated by server is: " + observationId);

	ourLog.info("WS Messages: {}", mySocketImplementation.getMessages());
	waitForSize(1, mySocketImplementation.getMessages());
	assertThat(mySocketImplementation.getMessages(), contains("bound " + mySubscriptionId));
}
 
开发者ID:jamesagnew,项目名称:hapi-fhir,代码行数:24,代码来源:WebsocketWithSubscriptionIdDstu2Test.java

示例6: testHapiFHIRInitializationDSTU2

import ca.uhn.fhir.model.dstu2.resource.Observation; //导入方法依赖的package包/类
@Test
public void testHapiFHIRInitializationDSTU2() {
    PatientFhirHelper gcm = new PatientFhirHelper();

    Patient p = new Patient();
    p.setId("Patient/"+UUID.randomUUID().toString());
    p.setActive(true);
    p.addName().addFamily("HapiFhirAndroidTest").addGiven("Patient");
    Observation o = new Observation();
    o.setId("Observation/"+UUID.randomUUID().toString());
    o.addIdentifier().setValue(o.getId().getIdPart());
    o.setComments("HapiFhirAndroidTestObservation");
    o.setSubject(new ResourceReferenceDt(p));
    //Test transaction create
    gcm.getClient().update().resource(p).execute();
    gcm.getClient().update().resource(o).execute();
    //Test search
    Observation obs = getObservation(o.getId(), gcm.getClient());
    Assert.assertNotNull(obs);
    Assert.assertNotNull(obs.getSubject().getResource());
    Patient patient = ((Patient)obs.getSubject().getResource());
    Assert.assertEquals(p.getId().getIdPart(), patient.getId().getIdPart());
    Assert.assertEquals(o.getComments(), obs.getComments());
    Assert.assertEquals(o.getId().getIdPart(), obs.getId().getIdPart());
    //Test and use delete
    gcm.getClient().delete().resourceById(o.getId()).execute();
    gcm.getClient().delete().resourceById(p.getId()).execute();
    //Test the they are deleted.
    try {
        gcm.getClient().read().resource(Observation.class).withId(o.getId()).execute();
        fail();
    } catch (ResourceGoneException e) {
        // good
    }
}
 
开发者ID:hapifhir,项目名称:hapi-fhir-android-integration-test,代码行数:36,代码来源:TestFHIRRobolectric.java

示例7: method2SearchCompartment2

import ca.uhn.fhir.model.dstu2.resource.Observation; //导入方法依赖的package包/类
@Search(compartmentName = "Observation")
public List<Observation> method2SearchCompartment2(final @IdParam IdDt theId) {
	ourLastId = theId;
	ourLastMethod = "searchObservationCompartment";
	System.out.println("Encounter compartment search");
	List<Observation> encounters = new ArrayList<Observation>();
	Observation obs = new Observation();
	obs.setId("1");
	obs.setSubject(new ResourceReferenceDt(theId));
	encounters.add(obs);
	return encounters;
}
 
开发者ID:jamesagnew,项目名称:hapi-fhir,代码行数:13,代码来源:CompartmentDstu2Test.java

示例8: create

import ca.uhn.fhir.model.dstu2.resource.Observation; //导入方法依赖的package包/类
@Create()
public MethodOutcome create(@ResourceParam String theBody) {
	Observation retVal = new Observation();
	retVal.setId("Observation/123/_history/2");
	return new MethodOutcome(retVal.getId());
}
 
开发者ID:jamesagnew,项目名称:hapi-fhir,代码行数:7,代码来源:ServerActionInterceptorTest.java


注:本文中的ca.uhn.fhir.model.dstu2.resource.Observation.setId方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。