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


Java Quantity.setValue方法代码示例

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


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

示例1: newObservation

import org.hl7.fhir.dstu3.model.Quantity; //导入方法依赖的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: makeQuantityFromPQ

import org.hl7.fhir.dstu3.model.Quantity; //导入方法依赖的package包/类
public Quantity makeQuantityFromPQ(Element pq, String units) throws Exception {
if (pq == null)
   return null;
Quantity qty = new Quantity();
String n = pq.getAttribute("value").replace(",", "").trim();
try {
  qty.setValue(new BigDecimal(n));
} catch (Exception e) {
	throw new Exception("Unable to process value '"+n+"'", e);
}			
units = Utilities.noString(pq.getAttribute("unit")) ? units : pq.getAttribute("unit");
if (!Utilities.noString(units)) {
	if (ucumSvc == null || ucumSvc.validate(units) != null)
		qty.setUnit(units);
	else {
		qty.setCode(units);
		qty.setSystem("http://unitsofmeasure.org");
		qty.setUnit(ucumSvc.getCommonDisplay(units));
	}
}
return qty;		
}
 
开发者ID:jamesagnew,项目名称:hapi-fhir,代码行数:23,代码来源:Convert.java

示例3: addComponent

import org.hl7.fhir.dstu3.model.Quantity; //导入方法依赖的package包/类
public void addComponent(DomainResource resource, ObservationComponent iComponent){
	org.hl7.fhir.dstu3.model.Observation fhirObservation =
		(org.hl7.fhir.dstu3.model.Observation) resource;
	ObservationComponentComponent observationComponentComponent =
		new ObservationComponentComponent();
	observationComponentComponent.setId(UUID.randomUUID().toString());
	CodeableConcept codeableConcept = observationComponentComponent.getCode();
	if (codeableConcept == null) {
		codeableConcept = new CodeableConcept();
	}
	ModelUtil.setCodingsToConcept(codeableConcept, iComponent.getCoding());
	observationComponentComponent.setCode(codeableConcept);
	
	setExtensions(iComponent, observationComponentComponent);
	
	if (iComponent.getStringValue().isPresent()) {
		StringType stringType = new StringType();
		stringType.setValue(iComponent.getStringValue().get());
		observationComponentComponent.setValue(stringType);
	} else if (iComponent.getNumericValue().isPresent()
		|| iComponent.getNumericValueUnit().isPresent()) {
		Quantity quantity = new Quantity();
		quantity.setValue(iComponent.getNumericValue().isPresent()
				? iComponent.getNumericValue().get() : null);
		iComponent.getNumericValueUnit()
			.ifPresent(item -> quantity.setUnit(iComponent.getNumericValueUnit().get()));
		observationComponentComponent.setValue(quantity);
	}
	
	fhirObservation.addComponent(observationComponentComponent);
}
 
开发者ID:elexis,项目名称:elexis-3-core,代码行数:32,代码来源:ObservationAccessor.java

示例4: setNumericValue

import org.hl7.fhir.dstu3.model.Quantity; //导入方法依赖的package包/类
public void setNumericValue(DomainResource resource, BigDecimal value, String unit){
	org.hl7.fhir.dstu3.model.Observation fhirObservation =
		(org.hl7.fhir.dstu3.model.Observation) resource;
	Quantity q = new Quantity();
	q.setUnit(unit);
	q.setValue(value);
	fhirObservation.setValue(q);
}
 
开发者ID:elexis,项目名称:elexis-3-core,代码行数:9,代码来源:ObservationAccessor.java


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