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


Java Observation.setCode方法代码示例

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


在下文中一共展示了Observation.setCode方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: testRestHookSubscriptionJson

import ca.uhn.fhir.model.dstu2.resource.Observation; //导入方法依赖的package包/类
@Test
public void testRestHookSubscriptionJson() throws Exception {
	String payload = "application/json";

	String code = "1000000050";
	String criteria1 = "Observation?code=SNOMED-CT|" + code + "&_format=xml";
	String criteria2 = "Observation?code=SNOMED-CT|" + code + "111&_format=xml";

	Subscription subscription1 = createSubscription(criteria1, payload, ourListenerServerBase);
	Subscription subscription2 = createSubscription(criteria2, payload, ourListenerServerBase);

	Observation observation1 = sendObservation(code, "SNOMED-CT");

	// Should see 1 subscription notification
	waitForQueueToDrain();
	waitForSize(0, ourCreatedObservations);
	waitForSize(1, ourUpdatedObservations);
	
	Subscription subscriptionTemp = ourClient.read(Subscription.class, subscription2.getId());
	Assert.assertNotNull(subscriptionTemp);

	subscriptionTemp.setCriteria(criteria1);
	ourClient.update().resource(subscriptionTemp).withId(subscriptionTemp.getIdElement()).execute();


	Observation observation2 = sendObservation(code, "SNOMED-CT");

	// Should see two subscription notifications
	waitForQueueToDrain();
	waitForSize(0, ourCreatedObservations);
	waitForSize(3, ourUpdatedObservations);
	
	ourClient.delete().resourceById(new IdDt("Subscription/"+ subscription2.getId())).execute();

	Observation observationTemp3 = sendObservation(code, "SNOMED-CT");

	// Should see only one subscription notification
	waitForQueueToDrain();
	waitForSize(0, ourCreatedObservations);
	waitForSize(4, ourUpdatedObservations);

	Observation observation3 = ourClient.read(Observation.class, observationTemp3.getId());
	CodeableConceptDt codeableConcept = new CodeableConceptDt();
	observation3.setCode(codeableConcept);
	CodingDt coding = codeableConcept.addCoding();
	coding.setCode(code + "111");
	coding.setSystem("SNOMED-CT");
	ourClient.update().resource(observation3).withId(observation3.getIdElement()).execute();

	// Should see no subscription notification
	waitForQueueToDrain();
	waitForSize(0, ourCreatedObservations);
	waitForSize(4, ourUpdatedObservations);

	Observation observation3a = ourClient.read(Observation.class, observationTemp3.getId());

	CodeableConceptDt codeableConcept1 = new CodeableConceptDt();
	observation3a.setCode(codeableConcept1);
	CodingDt coding1 = codeableConcept1.addCoding();
	coding1.setCode(code);
	coding1.setSystem("SNOMED-CT");
	ourClient.update().resource(observation3a).withId(observation3a.getIdElement()).execute();

	// Should see only one subscription notification
	waitForQueueToDrain();
	waitForSize(0, ourCreatedObservations);
	waitForSize(5, ourUpdatedObservations);

	Assert.assertFalse(subscription1.getId().equals(subscription2.getId()));
	Assert.assertFalse(observation1.getId().isEmpty());
	Assert.assertFalse(observation2.getId().isEmpty());
}
 
开发者ID:jamesagnew,项目名称:hapi-fhir,代码行数:73,代码来源:RestHookTestWithInterceptorRegisteredToDaoConfigDstu2Test.java

示例7: testRestHookSubscriptionXml

import ca.uhn.fhir.model.dstu2.resource.Observation; //导入方法依赖的package包/类
@Test
public void testRestHookSubscriptionXml() throws Exception {
	String payload = "application/xml";

	String code = "1000000050";
	String criteria1 = "Observation?code=SNOMED-CT|" + code + "&_format=xml";
	String criteria2 = "Observation?code=SNOMED-CT|" + code + "111&_format=xml";

	Subscription subscription1 = createSubscription(criteria1, payload, ourListenerServerBase);
	Subscription subscription2 = createSubscription(criteria2, payload, ourListenerServerBase);

	Observation observation1 = sendObservation(code, "SNOMED-CT");

	// Should see 1 subscription notification
	waitForQueueToDrain();
	waitForSize(0, ourCreatedObservations);
	waitForSize(1, ourUpdatedObservations);
	
	Subscription subscriptionTemp = ourClient.read(Subscription.class, subscription2.getId());
	Assert.assertNotNull(subscriptionTemp);

	subscriptionTemp.setCriteria(criteria1);
	ourClient.update().resource(subscriptionTemp).withId(subscriptionTemp.getIdElement()).execute();


	Observation observation2 = sendObservation(code, "SNOMED-CT");

	// Should see two subscription notifications
	waitForQueueToDrain();
	waitForSize(0, ourCreatedObservations);
	waitForSize(3, ourUpdatedObservations);
	
	ourClient.delete().resourceById(new IdDt("Subscription/"+ subscription2.getId())).execute();

	Observation observationTemp3 = sendObservation(code, "SNOMED-CT");

	// Should see only one subscription notification
	waitForQueueToDrain();
	waitForSize(0, ourCreatedObservations);
	waitForSize(4, ourUpdatedObservations);

	Observation observation3 = ourClient.read(Observation.class, observationTemp3.getId());
	CodeableConceptDt codeableConcept = new CodeableConceptDt();
	observation3.setCode(codeableConcept);
	CodingDt coding = codeableConcept.addCoding();
	coding.setCode(code + "111");
	coding.setSystem("SNOMED-CT");
	ourClient.update().resource(observation3).withId(observation3.getIdElement()).execute();

	// Should see no subscription notification
	waitForQueueToDrain();
	waitForSize(0, ourCreatedObservations);
	waitForSize(4, ourUpdatedObservations);

	Observation observation3a = ourClient.read(Observation.class, observationTemp3.getId());

	CodeableConceptDt codeableConcept1 = new CodeableConceptDt();
	observation3a.setCode(codeableConcept1);
	CodingDt coding1 = codeableConcept1.addCoding();
	coding1.setCode(code);
	coding1.setSystem("SNOMED-CT");
	ourClient.update().resource(observation3a).withId(observation3a.getIdElement()).execute();

	// Should see only one subscription notification
	waitForQueueToDrain();
	waitForSize(0, ourCreatedObservations);
	waitForSize(5, ourUpdatedObservations);

	Assert.assertFalse(subscription1.getId().equals(subscription2.getId()));
	Assert.assertFalse(observation1.getId().isEmpty());
	Assert.assertFalse(observation2.getId().isEmpty());
}
 
开发者ID:jamesagnew,项目名称:hapi-fhir,代码行数:73,代码来源:RestHookTestWithInterceptorRegisteredToDaoConfigDstu2Test.java

示例8: testRestHookSubscriptionJson

import ca.uhn.fhir.model.dstu2.resource.Observation; //导入方法依赖的package包/类
@Test
public void testRestHookSubscriptionJson() throws Exception {
	String payload = "application/json";

	String code = "1000000050";
	String criteria1 = "Observation?code=SNOMED-CT|" + code + "&_format=xml";
	String criteria2 = "Observation?code=SNOMED-CT|" + code + "111&_format=xml";

	Subscription subscription1 = createSubscription(criteria1, payload, ourListenerServerBase);
	Subscription subscription2 = createSubscription(criteria2, payload, ourListenerServerBase);

	Observation observation1 = sendObservation(code, "SNOMED-CT");

	// Should see 1 subscription notification
	waitForQueueToDrain();
	waitForSize(0, ourCreatedObservations);
	waitForSize(1, ourUpdatedObservations);

	Subscription subscriptionTemp = ourClient.read(Subscription.class, subscription2.getId());
	Assert.assertNotNull(subscriptionTemp);

	// Update subscription 2 to match as well
	subscriptionTemp.setCriteria(criteria1);
	ourClient.update().resource(subscriptionTemp).withId(subscriptionTemp.getIdElement()).execute();
	waitForQueueToDrain();

	Observation observation2 = sendObservation(code, "SNOMED-CT");
	waitForQueueToDrain();

	// Should see one subscription notification
	waitForSize(0, ourCreatedObservations);
	waitForSize(3, ourUpdatedObservations);

	// Delet one subscription
	ourClient.delete().resourceById(new IdDt("Subscription/" + subscription2.getId())).execute();

	Observation observationTemp3 = sendObservation(code, "SNOMED-CT");

	// Should see only one subscription notification
	waitForQueueToDrain();
	waitForSize(0, ourCreatedObservations);
	waitForSize(4, ourUpdatedObservations);

	Observation observation3 = ourClient.read(Observation.class, observationTemp3.getId());
	CodeableConceptDt codeableConcept = new CodeableConceptDt();
	observation3.setCode(codeableConcept);
	CodingDt coding = codeableConcept.addCoding();
	coding.setCode(code + "111");
	coding.setSystem("SNOMED-CT");
	ourClient.update().resource(observation3).withId(observation3.getIdElement()).execute();

	// Should see no subscription notification
	waitForQueueToDrain();
	waitForSize(0, ourCreatedObservations);
	waitForSize(4, ourUpdatedObservations);

	Observation observation3a = ourClient.read(Observation.class, observationTemp3.getId());

	CodeableConceptDt codeableConcept1 = new CodeableConceptDt();
	observation3a.setCode(codeableConcept1);
	CodingDt coding1 = codeableConcept1.addCoding();
	coding1.setCode(code);
	coding1.setSystem("SNOMED-CT");
	ourClient.update().resource(observation3a).withId(observation3a.getIdElement()).execute();

	// Should see only one subscription notification
	waitForQueueToDrain();
	waitForSize(0, ourCreatedObservations);
	waitForSize(5, ourUpdatedObservations);

	Assert.assertFalse(subscription1.getId().equals(subscription2.getId()));
	Assert.assertFalse(observation1.getId().isEmpty());
	Assert.assertFalse(observation2.getId().isEmpty());
}
 
开发者ID:jamesagnew,项目名称:hapi-fhir,代码行数:75,代码来源:RestHookTestDstu2Test.java

示例9: testRestHookSubscriptionXml

import ca.uhn.fhir.model.dstu2.resource.Observation; //导入方法依赖的package包/类
@Test
public void testRestHookSubscriptionXml() throws Exception {
	String payload = "application/xml";

	String code = "1000000050";
	String criteria1 = "Observation?code=SNOMED-CT|" + code + "&_format=xml";
	String criteria2 = "Observation?code=SNOMED-CT|" + code + "111&_format=xml";

	Subscription subscription1 = createSubscription(criteria1, payload, ourListenerServerBase);
	Subscription subscription2 = createSubscription(criteria2, payload, ourListenerServerBase);

	Observation observation1 = sendObservation(code, "SNOMED-CT");

	// Should see 1 subscription notification
	waitForQueueToDrain();
	waitForSize(0, ourCreatedObservations);
	waitForSize(1, ourUpdatedObservations);

	Subscription subscriptionTemp = ourClient.read(Subscription.class, subscription2.getId());
	Assert.assertNotNull(subscriptionTemp);

	subscriptionTemp.setCriteria(criteria1);
	ourClient.update().resource(subscriptionTemp).withId(subscriptionTemp.getIdElement()).execute();

	Observation observation2 = sendObservation(code, "SNOMED-CT");

	// Should see one subscription notification
	waitForQueueToDrain();
	waitForSize(0, ourCreatedObservations);
	waitForSize(3, ourUpdatedObservations);

	ourClient.delete().resourceById(new IdDt("Subscription/" + subscription2.getId())).execute();

	Observation observationTemp3 = sendObservation(code, "SNOMED-CT");

	// Should see only one subscription notification
	waitForQueueToDrain();
	waitForSize(0, ourCreatedObservations);
	waitForSize(4, ourUpdatedObservations);

	Observation observation3 = ourClient.read(Observation.class, observationTemp3.getId());
	CodeableConceptDt codeableConcept = new CodeableConceptDt();
	observation3.setCode(codeableConcept);
	CodingDt coding = codeableConcept.addCoding();
	coding.setCode(code + "111");
	coding.setSystem("SNOMED-CT");
	ourClient.update().resource(observation3).withId(observation3.getIdElement()).execute();

	// Should see no subscription notification
	waitForQueueToDrain();
	waitForSize(0, ourCreatedObservations);
	waitForSize(4, ourUpdatedObservations);

	Observation observation3a = ourClient.read(Observation.class, observationTemp3.getId());

	CodeableConceptDt codeableConcept1 = new CodeableConceptDt();
	observation3a.setCode(codeableConcept1);
	CodingDt coding1 = codeableConcept1.addCoding();
	coding1.setCode(code);
	coding1.setSystem("SNOMED-CT");
	ourClient.update().resource(observation3a).withId(observation3a.getIdElement()).execute();

	// Should see only one subscription notification
	waitForQueueToDrain();
	waitForSize(0, ourCreatedObservations);
	waitForSize(5, ourUpdatedObservations);

	Assert.assertFalse(subscription1.getId().equals(subscription2.getId()));
	Assert.assertFalse(observation1.getId().isEmpty());
	Assert.assertFalse(observation2.getId().isEmpty());
}
 
开发者ID:jamesagnew,项目名称:hapi-fhir,代码行数:72,代码来源:RestHookTestDstu2Test.java


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