• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java Observation类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



Observation类属于ca.uhn.fhir.model.dstu2.resource包,在下文中一共展示了Observation类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: testTranslateMatchUrl

import ca.uhn.fhir.model.dstu2.resource.Observation; //导入依赖的package包/类
@Test
public void testTranslateMatchUrl() {
	RuntimeResourceDefinition resourceDef = ourCtx.getResourceDefinition(Condition.class);
	
	IDao dao = mock(IDao.class);
	when(dao.getSearchParamByName(any(RuntimeResourceDefinition.class), eq("patient"))).thenReturn(resourceDef.getSearchParam("patient"));
			
	SearchParameterMap match = BaseHapiFhirDao.translateMatchUrl(dao, ourCtx, "Condition?patient=304&_lastUpdated=>2011-01-01T11:12:21.0000Z", resourceDef);
	assertEquals("2011-01-01T11:12:21.0000Z", match.getLastUpdated().getLowerBound().getValueAsString());
	assertEquals(ReferenceParam.class, match.get("patient").get(0).get(0).getClass());
	assertEquals("304", ((ReferenceParam)match.get("patient").get(0).get(0)).getIdPart());
	
	Observation observation = new Observation();
	
	PeriodDt period = new PeriodDt();
	period.setStart(new DateTimeDt("2011-01-02T11:22:33Z"));
	period.setEnd(new DateTimeDt("2011-01-02T11:33:33Z"));
	observation.setEffective(period);
	
}
 
开发者ID:jamesagnew,项目名称:hapi-fhir,代码行数:21,代码来源:BaseHapiFhirDaoTest.java


示例2: deleteObservationBySpecimen

import ca.uhn.fhir.model.dstu2.resource.Observation; //导入依赖的package包/类
public static void deleteObservationBySpecimen(FhirContext oContext,List<String> listIdSpecimenToDelete, String serverUrl, String logFileName)
{
    try
    {
        IGenericClient client=oContext.newRestfulGenericClient(serverUrl);
        IBaseOperationOutcome resp=client.delete()
                .resourceConditionalByType("Observation")
                //.where(DiagnosticReport.SPECIMEN.hasId(idSpecimenToDelete))
                .where(Observation.SPECIMEN.hasAnyOfIds(listIdSpecimenToDelete))
                .execute();
        if(resp!=null)
        {
            OperationOutcome outcome = (OperationOutcome) resp;
            System.out.println(outcome.getIssueFirstRep().getDetailsElement().getValue());
        }

    }
    catch (Exception exc)
    {
        FhirMediatorUtilities.writeInLogFile(logFileName,
                exc.getMessage(),"Error");
    }
}
 
开发者ID:gerard-bisama,项目名称:DHIS2-fhir-lab-app,代码行数:24,代码来源:FhirResourceValidator.java


示例3: tResultObservation2Observation

import ca.uhn.fhir.model.dstu2.resource.Observation; //导入依赖的package包/类
public Bundle tResultObservation2Observation(ResultObservation cdaResultObservation) {
	Bundle fhirObservationBundle = tObservation2Observation(cdaResultObservation);
	if(fhirObservationBundle == null)
		return null;

	// finding the observation resource and setting its meta.profile to result observation's profile url
	if(Config.isGenerateDafProfileMetadata()) {
		for (Bundle.Entry entry : fhirObservationBundle.getEntry()) {
			if (entry.getResource() instanceof Observation) {
				(entry.getResource()).getMeta().addProfile(Constants.PROFILE_DAF_RESULT_OBS);
			}
		}
	}

	return fhirObservationBundle;
}
 
开发者ID:srdc,项目名称:cda2fhir,代码行数:17,代码来源:ResourceTransformerImpl.java


示例4: tVitalSignObservation2Observation

import ca.uhn.fhir.model.dstu2.resource.Observation; //导入依赖的package包/类
public Bundle tVitalSignObservation2Observation(VitalSignObservation cdaVitalSignObservation) {
	Bundle fhirObservationBundle = tObservation2Observation(cdaVitalSignObservation);
	if(fhirObservationBundle == null)
		return null;

	// finding the observation resource and setting its meta.profile to result observation's profile url
	if(Config.isGenerateDafProfileMetadata()) {
		for (Bundle.Entry entry : fhirObservationBundle.getEntry()) {
			if (entry.getResource() instanceof Observation) {
				(entry.getResource()).getMeta().addProfile(Constants.PROFILE_DAF_VITAL_SIGNS);
			}
		}
	}

	return fhirObservationBundle;
}
 
开发者ID:srdc,项目名称:cda2fhir,代码行数:17,代码来源:ResourceTransformerImpl.java


示例5: testSlowServiceInAGlobal

import ca.uhn.fhir.model.dstu2.resource.Observation; //导入依赖的package包/类
@Test
public void testSlowServiceInAGlobal() {
    Assert.assertNotNull(kBase);
    KieSession kSession = kBase.newKieSession();

    kSession.setGlobal("myService", new SlowMyServiceImpl());
    System.out.println(" ---- Starting testSlowServiceInAGlobal() Test ---");

    List<Observation> observations = generateObservations(20);
    for (Observation o : observations) {
        kSession.insert(o);
    }

    Assert.assertEquals(20, kSession.fireAllRules());
    System.out.println(" ---- Finished testSlowServiceInAGlobal() Test ---");
    kSession.dispose();
}
 
开发者ID:Salaboy,项目名称:drools-workshop,代码行数:18,代码来源:WrongServiceRulesJUnitTest.java


示例6: testPatientWith3Observations

import ca.uhn.fhir.model.dstu2.resource.Observation; //导入依赖的package包/类
@Test
public void testPatientWith3Observations() {
    Assert.assertNotNull(kBaseCrossProduct);
    KieSession kSession = kBaseCrossProduct.newKieSession();
    System.out.println(" ---- Starting testPatientWith3Observations() Test ---");

    Patient patient = (Patient) new Patient().setId("Patient/1");
    
    Observation observation1 = (Observation) new Observation().setId("Observation/1");
    observation1.setSubject(new ResourceReferenceDt(patient));
    
    Observation observation2 = (Observation) new Observation().setId("Observation/2");
    observation2.setSubject(new ResourceReferenceDt(patient));
    
    Observation observation3 = (Observation) new Observation().setId("Observation/3");
    observation3.setSubject(new ResourceReferenceDt(patient));

    kSession.insert(patient);
    kSession.insert(observation1);
    kSession.insert(observation2);
    kSession.insert(observation3);

    Assert.assertEquals(3, kSession.fireAllRules());
    System.out.println(" ---- Finished testPatientWith3Observations() Test ---");
    kSession.dispose();
}
 
开发者ID:Salaboy,项目名称:drools-workshop,代码行数:27,代码来源:CrossProductRulesJUnitTest.java


示例7: testObservationAndPatient

import ca.uhn.fhir.model.dstu2.resource.Observation; //导入依赖的package包/类
@Test
public void testObservationAndPatient() {
    Assert.assertNotNull(kBase);
    KieSession kSession = kBase.newKieSession();
    System.out.println(" ---- Starting testObservationAndPatient() Test ---");

    Patient patient = (Patient) new Patient().setId("Patient/1");
    kSession.insert(patient);
    
    Observation observation = (Observation) new Observation().setId("Observation/1");
    kSession.insert(observation);

    Assert.assertEquals(1, kSession.fireAllRules());
    System.out.println(" ---- Finished testObservationAndPatient() Test ---");
    kSession.dispose();
}
 
开发者ID:Salaboy,项目名称:drools-workshop,代码行数:17,代码来源:NonFactsRulesJUnitTest.java


示例8: testObservationAndPatientRelated

import ca.uhn.fhir.model.dstu2.resource.Observation; //导入依赖的package包/类
@Test
public void testObservationAndPatientRelated() {
    
    Assert.assertNotNull(kBase);
    KieSession kSession = kBase.newKieSession();
    System.out.println(" ---- Starting testObservationAndPatientRelated() Test ---");
    
    Patient patient = (Patient) new Patient().setId("Patient/1");
    Observation observation = (Observation) new Observation().setId("Observation/1");
    observation.setSubject(new ResourceReferenceDt(patient));
    kSession.insert(observation);

    Assert.assertEquals(0, kSession.fireAllRules());
    System.out.println(" ---- Finished testObservationAndPatientRelated() Test ---");
    kSession.dispose();
    
}
 
开发者ID:Salaboy,项目名称:drools-workshop,代码行数:18,代码来源:NonFactsRulesJUnitTest.java


示例9: testPatientAndAnObservation

import ca.uhn.fhir.model.dstu2.resource.Observation; //导入依赖的package包/类
@Test
public void testPatientAndAnObservation() {
    Assert.assertNotNull(kBase);
    KieSession kSession = kBase.newKieSession();
    System.out.println(" ---- Starting testPatientAndAnObservation() Test ---");
    
    kSession.insert(new Patient()
        .setId("Patient/1")
    );
    kSession.insert(new Observation()
        .setId("Observation/1")
    );
    
    Assert.assertEquals(1, kSession.fireAllRules());
    System.out.println(" ---- Finished testPatientAndAnObservation() Test ---");
    kSession.dispose();
}
 
开发者ID:Salaboy,项目名称:drools-workshop,代码行数:18,代码来源:MultiConditionRulesJUnitTest.java


示例10: testPatientAndAnRelatedObservation

import ca.uhn.fhir.model.dstu2.resource.Observation; //导入依赖的package包/类
@Test
public void testPatientAndAnRelatedObservation() {
    Assert.assertNotNull(kBase);
    KieSession kSession = kBase.newKieSession();
    System.out.println(" ---- Starting testRoomAndHouseRelated() Test ---");
    
    Patient patient = (Patient) new Patient().setId("Patient/1");
    kSession.insert(patient);
    kSession.insert(new Observation()
        .setSubject(new ResourceReferenceDt(patient))
        .setId("Observation/1")
    );

    Assert.assertEquals(2, kSession.fireAllRules());
    System.out.println(" ---- Finished testRoomAndHouseRelated() Test ---");
    kSession.dispose();
}
 
开发者ID:Salaboy,项目名称:drools-workshop,代码行数:18,代码来源:MultiConditionRulesJUnitTest.java


示例11: testPatientWithBloodPressureObservations

import ca.uhn.fhir.model.dstu2.resource.Observation; //导入依赖的package包/类
@Test
public void testPatientWithBloodPressureObservations() {
    Assert.assertNotNull(kBase);
    KieSession kSession = kBase.newKieSession();
    System.out.println(" ---- Starting testPatientWithBloodPressureObservations() Test ---");
    
    
    kSession.insert(generatePatients(1).get(0));
    
    List<Observation> observations = generateBloodPressureObservations(60);
    for (Observation observation : observations) {
        kSession.insert(observation);
    }

    Assert.assertEquals(1, kSession.fireAllRules());
    
    System.out.println(" ---- Finished testPatientWithBloodPressureObservations() Test ---");
    kSession.dispose();
}
 
开发者ID:Salaboy,项目名称:drools-workshop,代码行数:20,代码来源:AccumulationRulesJUnitTest.java


示例12: datatypes

import ca.uhn.fhir.model.dstu2.resource.Observation; //导入依赖的package包/类
public static void datatypes() {
   // START SNIPPET: datatypes
   Observation obs = new Observation();

   // These are all equivalent
   obs.setIssued(new InstantDt(new Date()));
   obs.setIssued(new Date(), TemporalPrecisionEnum.MILLI);
   obs.setIssuedWithMillisPrecision(new Date());

   // The InstantDt also lets you work with the instant as a Java Date
   // object or as a FHIR String.
   Date date = obs.getIssuedElement().getValue(); // A date object
   String dateString = obs.getIssuedElement().getValueAsString(); // "2014-03-08T12:59:58.068-05:00"
   // END SNIPPET: datatypes

   System.out.println(date);
   System.out.println(dateString);

}
 
开发者ID:gajen0981,项目名称:FHIR-Server,代码行数:20,代码来源:FhirDataModel.java


示例13: nonNull

import ca.uhn.fhir.model.dstu2.resource.Observation; //导入依赖的package包/类
@SuppressWarnings("unused")
public void nonNull() {
   // START SNIPPET: nonNull
   Observation observation = new Observation();

   // None of these calls will not return null, but instead create their
   // respective
   // child elements.
   List<IdentifierDt> identifierList = observation.getIdentifier();
   CodeableConceptDt code = observation.getCode();
   StringDt textElement = observation.getCode().getTextElement();

   // DateTimeDt is a FHIR primitive however, so the following will return
   // null
   // unless a value has been placed there.
   Date active = observation.addIdentifier().getPeriod().getStartElement().getValue();
   // END SNIPPET: nonNull

}
 
开发者ID:gajen0981,项目名称:FHIR-Server,代码行数:20,代码来源:FhirDataModel.java


示例14: main

import ca.uhn.fhir.model.dstu2.resource.Observation; //导入依赖的package包/类
public static void main(String[] args) {
   datatypes();

   // START SNIPPET: observation
   Observation observation = new Observation();
   
   // Create a quantity datatype
   QuantityDt q = new QuantityDt();
   q.setValue(185);
   q.setSystem("http://unitsofmeasure.org");
   q.setCode("lbs");
   
   // Put the datatype in the observation
   observation.setValue(q);
   
   // Set the reference range
   observation.getReferenceRangeFirstRep().setLow(new QuantityDt(100));
   observation.getReferenceRangeFirstRep().setHigh(new QuantityDt(200));
   
   // END SNIPPET: observation
   
   
}
 
开发者ID:gajen0981,项目名称:FHIR-Server,代码行数:24,代码来源:FhirDataModel.java


示例15: testPersistSearchParamQuantity

import ca.uhn.fhir.model.dstu2.resource.Observation; //导入依赖的package包/类
@Test
public void testPersistSearchParamQuantity() {
	Observation obs = new Observation();
	obs.getCode().addCoding().setSystem("foo").setCode("testPersistSearchParamQuantity");
	obs.setValue(new QuantityDt(111));

	ourObservationDao.create(obs);

	List<Observation> found = toList(ourObservationDao.search("value-quantity", new QuantityDt(111)));
	assertEquals(1, found.size());

	found = toList(ourObservationDao.search("value-quantity", new QuantityDt(112)));
	assertEquals(1, found.size());

	found = toList(ourObservationDao.search("value-quantity", new QuantityDt(212)));
	assertEquals(0, found.size());

}
 
开发者ID:gajen0981,项目名称:FHIR-Server,代码行数:19,代码来源:FhirResourceDaoDstu2Test.java


示例16: 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


示例17: 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


示例18: 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


示例19: 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


示例20: 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



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java SnapshotArtifactRepositoryMetadata类代码示例发布时间:2022-05-22
下一篇:
Java Fade类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap