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

Java Observation类代码示例

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

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



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

示例1: newObservation

import org.hl7.fhir.dstu3.model.Observation; //导入依赖的package包/类
/**
 * Returns a FHIR Observation for testing purposes.
 */
public static Observation newObservation() {

  // Observation based on https://www.hl7.org/FHIR/observation-example-bloodpressure.json.html
  Observation observation = new Observation();

  observation.setId("blood-pressure");

  Identifier identifier = observation.addIdentifier();
  identifier.setSystem("urn:ietf:rfc:3986");
  identifier.setValue("urn:uuid:187e0c12-8dd2-67e2-99b2-bf273c878281");

  observation.setStatus(Observation.ObservationStatus.FINAL);

  Quantity quantity = new Quantity();
  quantity.setValue(new java.math.BigDecimal("123.45"));
  quantity.setUnit("mm[Hg]");
  observation.setValue(quantity);

  return observation;
}
 
开发者ID:cerner,项目名称:bunsen,代码行数:24,代码来源:TestData.java


示例2: setUp

import org.hl7.fhir.dstu3.model.Observation; //导入依赖的package包/类
/**
 * Set up Spark.
 */
@BeforeClass
public static void setUp() {
  spark = SparkSession.builder()
      .master("local[*]")
      .appName("testing")
      .getOrCreate();

  patientDataset = spark.createDataset(ImmutableList.of(patient),
      encoders.of(Patient.class));
  decodedPatient = patientDataset.head();

  conditionsDataset = spark.createDataset(ImmutableList.of(condition),
      encoders.of(Condition.class));
  decodedCondition = conditionsDataset.head();

  observationsDataset = spark.createDataset(ImmutableList.of(observation),
      encoders.of(Observation.class));
  decodedObservation = observationsDataset.head();

  medDataset = spark.createDataset(ImmutableList.of(medRequest),
      encoders.of(MedicationRequest.class));

  decodedMedRequest = medDataset.head();
}
 
开发者ID:cerner,项目名称:bunsen,代码行数:28,代码来源:FhirEncodersTest.java


示例3: loadObservationData

import org.hl7.fhir.dstu3.model.Observation; //导入依赖的package包/类
public void loadObservationData() throws Exception {
	IParser parser = ctx.newJsonParser();

	FileReader fileReader = new FileReader(
			new File(this.getClass().getClassLoader().getResource("fhir/observation_example001.json").getPath()));
	IBaseResource resource = parser.parseResource(fileReader);

	for (int i = 0; i < 1; i++) {

		resource.getIdElement().setValue("obs_" + i);
		((Observation) resource).getIdentifier().get(0).setValue("urn:uuid:187e0c12-8dd2-67e2-99b2-bf273c1111" + i);

		String json = parser.encodeResourceToString(resource);

		long timestamp = Calendar.getInstance().getTimeInMillis();
		session.execute(
				"INSERT INTO test.FHIR_RESOURCES (resource_id, version, resource_type, state, lastupdated, format, author, content)"
						+ " VALUES ('" + resource.getIdElement().getValue() + "', 1, '"
						+ resource.getClass().getSimpleName() + "', 'active', " + timestamp + ", 'json', 'dr who',"
						+ "'" + json + "')");

		System.out.println(resource.getClass().getSimpleName() + ": " + resource.getIdElement().getValue());
	}
}
 
开发者ID:jmiddleton,项目名称:cassandra-fhir-index,代码行数:25,代码来源:FhirTestDataTest.java


示例4: processProceduresSection

import org.hl7.fhir.dstu3.model.Observation; //导入依赖的package包/类
protected SectionComponent processProceduresSection(Element section) throws Exception {
	ListResource list = new ListResource();
	for (Element entry : cda.getChildren(section, "entry")) {
		Element procedure = cda.getlastChild(entry);

		if (cda.hasTemplateId(procedure, "2.16.840.1.113883.10.20.22.4.14")) {
			processProcedure(list, procedure, ProcedureType.Procedure);
		} else if (cda.hasTemplateId(procedure, "2.16.840.1.113883.10.20.22.4.13")) {
			processProcedure(list, procedure, ProcedureType.Observation);
		} else if (cda.hasTemplateId(procedure, "2.16.840.1.113883.10.20.22.4.12")) {
			processProcedure(list, procedure, ProcedureType.Act);
		} else
			throw new Exception("Unhandled Section template ids: "+cda.showTemplateIds(procedure));
	}

	// todo: text
	SectionComponent s = new Composition.SectionComponent();
	s.setCode(convert.makeCodeableConceptFromCD(cda.getChild(section,  "code")));
	// todo: check subject
	s.addEntry(Factory.makeReference(addReference(list, "Procedures", makeUUIDReference())));
	return s;

}
 
开发者ID:jamesagnew,项目名称:hapi-fhir,代码行数:24,代码来源:CCDAConverter.java


示例5: search

import org.hl7.fhir.dstu3.model.Observation; //导入依赖的package包/类
List<Observation> search (FhirContext ctx,
@OptionalParam(name= Observation.SP_CATEGORY) TokenParam category,
@OptionalParam(name= Observation.SP_CODE) TokenParam code,
@OptionalParam(name= Observation.SP_DATE) DateRangeParam effectiveDate,
@OptionalParam(name = Observation.SP_PATIENT) ReferenceParam patient
,@OptionalParam(name = Observation.SP_IDENTIFIER) TokenParam identifier
,@OptionalParam(name= Observation.SP_RES_ID) TokenParam id
);
 
开发者ID:nhsconnect,项目名称:careconnect-reference-implementation,代码行数:9,代码来源:ObservationRepository.java


示例6: searchEntity

import org.hl7.fhir.dstu3.model.Observation; //导入依赖的package包/类
List<ObservationEntity> searchEntity (FhirContext ctx,
                          @OptionalParam(name= Observation.SP_CATEGORY) TokenParam category,
                          @OptionalParam(name= Observation.SP_CODE) TokenParam code,
                          @OptionalParam(name= Observation.SP_DATE) DateRangeParam effectiveDate,
                          @OptionalParam(name = Observation.SP_PATIENT) ReferenceParam patient
        ,@OptionalParam(name = Observation.SP_IDENTIFIER) TokenParam identifier
        ,@OptionalParam(name= Observation.SP_RES_ID) TokenParam id
);
 
开发者ID:nhsconnect,项目名称:careconnect-reference-implementation,代码行数:9,代码来源:ObservationRepository.java


示例7: getObservationById

import org.hl7.fhir.dstu3.model.Observation; //导入依赖的package包/类
@Read
public Observation getObservationById(@IdParam IdType internalId) {
    Observation observation = observationDao.read(ctx,internalId);

    if (observation == null) {
        throw OperationOutcomeFactory.buildOperationOutcomeException(
                new ResourceNotFoundException("No observation found for ID: " + internalId.getIdPart()),
                OperationOutcome.IssueSeverity.ERROR, OperationOutcome.IssueType.NOTFOUND);
    }
    return observation;
}
 
开发者ID:nhsconnect,项目名称:careconnect-reference-implementation,代码行数:12,代码来源:ObservationProvider.java


示例8: search

import org.hl7.fhir.dstu3.model.Observation; //导入依赖的package包/类
@Search
public List<Observation> search(HttpServletRequest theRequest,

                                @OptionalParam(name= Observation.SP_CATEGORY) TokenParam category,
                                @OptionalParam(name= Observation.SP_CODE) TokenParam code,
                                @OptionalParam(name= Observation.SP_DATE) DateRangeParam effectiveDate,
                                @OptionalParam(name = Observation.SP_PATIENT) ReferenceParam patient,
                                @OptionalParam(name = Observation.SP_IDENTIFIER) TokenParam identifier
        , @OptionalParam(name = Observation.SP_RES_ID) TokenParam resid
                                   ) {
    return observationDao.search(ctx,category, code, effectiveDate,patient, identifier,resid);
}
 
开发者ID:nhsconnect,项目名称:careconnect-reference-implementation,代码行数:13,代码来源:ObservationProvider.java


示例9: testTransformObservationEntity

import org.hl7.fhir.dstu3.model.Observation; //导入依赖的package包/类
@Test
public void testTransformObservationEntity(){
    ObservationEntity observationEntity = new ObservationEntityBuilder()
            .build();
    Observation observation = transformer.transform(observationEntity);
    assertThat(observation, not(nullValue()));
    assertThat(observation.getId(), not(nullValue()));
    assertThat(observation.getId(), equalTo((new Long(ObservationEntityBuilder.DEFAULT_ID)).toString()));
    assertThat(observation.getSubject(), not(nullValue()));
    assertThat(observation.getSubject().getReference(), equalTo("Patient/100002"));
    assertThat(observation.getEffective(), not(nullValue()));
}
 
开发者ID:nhsconnect,项目名称:careconnect-reference-implementation,代码行数:13,代码来源:ObservationEntityToFHIRObservationTransformerTest.java


示例10: getRelated

import org.hl7.fhir.dstu3.model.Observation; //导入依赖的package包/类
public List<Observation.ObservationRelatedComponent> getRelated()
{
   try
   {
      return adaptedClass.getRelated();
   }
   catch (Exception e)
   {
      throw new RuntimeException("Error getting Related", e);
   }
}
 
开发者ID:cqframework,项目名称:qicore_model,代码行数:12,代码来源:qicoreobservationAdapter.java


示例11: getComponent

import org.hl7.fhir.dstu3.model.Observation; //导入依赖的package包/类
public List<Observation.ObservationComponentComponent> getComponent()
{
   try
   {
      return adaptedClass.getComponent();
   }
   catch (Exception e)
   {
      throw new RuntimeException("Error getting Component", e);
   }
}
 
开发者ID:cqframework,项目名称:qicore_model,代码行数:12,代码来源:qicoreobservationAdapter.java


示例12: getStatus

import org.hl7.fhir.dstu3.model.Observation; //导入依赖的package包/类
public Observation.ObservationStatus getStatus()
{
   try
   {
      return adaptedClass.getStatus();
   }
   catch (Exception e)
   {
      throw new RuntimeException("Error getting Status", e);
   }
}
 
开发者ID:cqframework,项目名称:qicore_model,代码行数:12,代码来源:qicoreobservationAdapter.java


示例13: getStatusElement

import org.hl7.fhir.dstu3.model.Observation; //导入依赖的package包/类
public Enumeration<Observation.ObservationStatus> getStatusElement()
{
   try
   {
      return adaptedClass.getStatusElement();
   }
   catch (Exception e)
   {
      throw new RuntimeException("Error getting StatusElement", e);
   }
}
 
开发者ID:cqframework,项目名称:qicore_model,代码行数:12,代码来源:qicoreobservationAdapter.java


示例14: getReferenceRange

import org.hl7.fhir.dstu3.model.Observation; //导入依赖的package包/类
public List<Observation.ObservationReferenceRangeComponent> getReferenceRange()
{
   try
   {
      return adaptedClass.getReferenceRange();
   }
   catch (Exception e)
   {
      throw new RuntimeException("Error getting ReferenceRange", e);
   }
}
 
开发者ID:cqframework,项目名称:qicore_model,代码行数:12,代码来源:qicoreobservationAdapter.java


示例15: buildRuleList

import org.hl7.fhir.dstu3.model.Observation; //导入依赖的package包/类
@Override
public List<IAuthRule> buildRuleList(RequestDetails theRequestDetails) {

   // Process this header
   String authHeader = theRequestDetails.getHeader("Authorization");

   RuleBuilder builder = new RuleBuilder();
   builder
      .allow().metadata().andThen()
      .allow().read().allResources().withAnyId().andThen()
      .allow().write().resourcesOfType(Observation.class).inCompartment("Patient", new IdType("Patient/123"));

   return builder.build();
}
 
开发者ID:furore-fhir,项目名称:fhirstarters,代码行数:15,代码来源:Example03_AuthorizationInterceptor.java


示例16: testCloneIntoValues

import org.hl7.fhir.dstu3.model.Observation; //导入依赖的package包/类
/**
* See #369
*/
 @Test
 public void testCloneIntoValues() {
     Observation obs = new Observation();
     obs.setValue(new StringType("AAA"));
     obs.setComment("COMMENTS");

     Observation target = new Observation();
ourCtx.newTerser().cloneInto(obs, target, false);

assertEquals("AAA", ((StringType)obs.getValue()).getValue());
assertEquals("COMMENTS", obs.getComment());
 }
 
开发者ID:jamesagnew,项目名称:hapi-fhir,代码行数:16,代码来源:FhirTerserDstu3Test.java


示例17: testIndexContained

import org.hl7.fhir.dstu3.model.Observation; //导入依赖的package包/类
@Test
	public void testIndexContained() {
		Patient p = new Patient();
		p.setId("#some_patient");
		p.addName().setFamily("MYFAMILY").addGiven("MYGIVEN");
		
		Observation o1 = new Observation();
		o1.getCode().setText("Some Observation");
		o1.setSubject(new Reference(p));
		IIdType oid1 = myObservationDao.create(o1, mySrd).getId().toUnqualifiedVersionless();
		
		Observation o2 = new Observation();
		o2.getCode().setText("Some Observation");
		o2.setSubject(new Reference(p));
		IIdType oid2 = myObservationDao.create(o2, mySrd).getId().toUnqualifiedVersionless();

		Patient p2 = new Patient();
		p2.addName().setFamily("MYFAMILY").addGiven("MYGIVEN");
		IIdType pid2 = myPatientDao.create(p2, mySrd).getId().toUnqualifiedVersionless();
		
		ourLog.info(myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(o2));
		
		
		SearchParameterMap map;
		
//		map = new SearchParameterMap();
//		map.add(Observation.SP_CODE, new TokenParam(null, "some observation").setModifier(TokenParamModifier.TEXT));
//		assertThat(toUnqualifiedVersionlessIdValues(myObservationDao.search(map)), containsInAnyOrder(toValues(id1, id2)));

	}
 
开发者ID:jamesagnew,项目名称:hapi-fhir,代码行数:31,代码来源:FhirResourceDaoDstu3ContainedTest.java


示例18: testFHIRExport

import org.hl7.fhir.dstu3.model.Observation; //导入依赖的package包/类
@Test
public void testFHIRExport() throws Exception {
  Config.set("exporter.baseDirectory", tempFolder.newFolder().toString());
  
  FhirContext ctx = FhirContext.forDstu3();
  IParser parser = ctx.newJsonParser().setPrettyPrint(true);

  FhirValidator validator = ctx.newValidator();
  validator.setValidateAgainstStandardSchema(true);
  validator.setValidateAgainstStandardSchematron(true);

  List<String> validationErrors = new ArrayList<String>();

  int numberOfPeople = 10;
  Generator generator = new Generator(numberOfPeople);
  for (int i = 0; i < numberOfPeople; i++) {
    int x = validationErrors.size();
    TestHelper.exportOff();
    Person person = generator.generatePerson(i);
    Config.set("exporter.fhir.export", "true");
    String fhirJson = FhirStu3.convertToFHIR(person, System.currentTimeMillis());
    IBaseResource resource = ctx.newJsonParser().parseResource(fhirJson);
    ValidationResult result = validator.validateWithResult(resource);
    if (result.isSuccessful() == false) {
      // If the validation failed, let's crack open the Bundle and validate
      // each individual entry.resource to get context-sensitive error
      // messages...
      Bundle bundle = parser.parseResource(Bundle.class, fhirJson);
      for (BundleEntryComponent entry : bundle.getEntry()) {
        ValidationResult eresult = validator.validateWithResult(entry.getResource());
        if (eresult.isSuccessful() == false) {
          for (SingleValidationMessage emessage : eresult.getMessages()) {
            if (emessage.getSeverity() == ResultSeverityEnum.ERROR
                || emessage.getSeverity() == ResultSeverityEnum.FATAL) {
              boolean valid = false;
              /*
               * There are a few bugs in the FHIR schematron files that are distributed with HAPI
               * 3.0.0 (these are fixed in the latest `master` branch), specifically with XPath
               * expressions.
               *
               * Two of these bugs are related to the FHIR Invariant rules obs-7 and con-4, which
               * have XPath expressions that incorrectly raise errors on validation.
               */
              if (emessage.getMessage().contains("Message=obs-7")) {
                /*
                 * The obs-7 invariant basically says that Observations should have values, unless
                 * they are made of components. This test replaces an invalid XPath expression
                 * that was causing correct instances to fail validation.
                 */
                valid = validateObs7((Observation) entry.getResource());
              } else if (emessage.getMessage().contains("Message=con-4")) {
                /*
                 * The con-4 invariant says "If condition is abated, then clinicalStatus must be
                 * either inactive, resolved, or remission" which is very clear and sensical.
                 * However, the XPath expression does not evaluate correctly for valid instances,
                 * so we must manually validate.
                 */
                valid = validateCon4((Condition) entry.getResource());
              }
              if (!valid) {
                System.out.println(parser.encodeResourceToString(entry.getResource()));
                System.out.println("ERROR: " + emessage.getMessage());
                validationErrors.add(emessage.getMessage());
              }
            }
          }
        }
      }
    }
    int y = validationErrors.size();
    if (x != y) {
      Exporter.export(person, System.currentTimeMillis());
    }
  }

  assertEquals(0, validationErrors.size());
}
 
开发者ID:synthetichealth,项目名称:synthea_java,代码行数:78,代码来源:FHIRExporterTest.java


示例19: getStatus

import org.hl7.fhir.dstu3.model.Observation; //导入依赖的package包/类
public Observation.ObservationStatus getStatus() {
    return status;
}
 
开发者ID:nhsconnect,项目名称:careconnect-reference-implementation,代码行数:4,代码来源:ObservationEntity.java


示例20: setStatus

import org.hl7.fhir.dstu3.model.Observation; //导入依赖的package包/类
public ObservationEntity setStatus(Observation.ObservationStatus status) {
    this.status = status;
    return this;
}
 
开发者ID:nhsconnect,项目名称:careconnect-reference-implementation,代码行数:5,代码来源:ObservationEntity.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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