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

Java DateTimeType类代码示例

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

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



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

示例1: getBirthTime

import org.hl7.fhir.dstu3.model.DateTimeType; //导入依赖的package包/类
public DateTimeType getBirthTime()
{
   List<org.hl7.fhir.dstu3.model.Extension> extensions = adaptedClass
           .getExtensionsByUrl("http://hl7.org/fhir/StructureDefinition/patient-birthTime");
   if (extensions == null || extensions.size() <= 0)
   {
      return null;
   }
   else if (extensions.size() == 1)
   {
      return (org.hl7.fhir.dstu3.model.DateTimeType) extensions.get(0)
              .getValue();
   }
   else
   {
      throw new RuntimeException(
              "More than one extension exists for birthTime");
   }
}
 
开发者ID:cqframework,项目名称:qicore_model,代码行数:20,代码来源:qicorepatientAdapter.java


示例2: testGenerateMedicationPrescription

import org.hl7.fhir.dstu3.model.DateTimeType; //导入依赖的package包/类
@Test
@Ignore
public void testGenerateMedicationPrescription() {
	MedicationRequest mp = new MedicationRequest();
	mp.setId("12345");
	Medication med = new Medication();
	med.getCode().setText("ciproflaxin");
	Reference medRef = new Reference(med);
	mp.setMedication(medRef);
	mp.setStatus(MedicationRequestStatus.ACTIVE);
	mp.setAuthoredOnElement(new DateTimeType("2014-09-01"));

	Narrative narrative = new Narrative();
	myGen.generateNarrative(ourCtx, mp, narrative);

	assertTrue("Expected medication name of ciprofloaxin within narrative: " + narrative.getDiv().toString(), narrative.getDiv().toString().indexOf("ciprofloaxin") > -1);
	assertTrue("Expected string status of ACTIVE within narrative: " + narrative.getDiv().toString(), narrative.getDiv().toString().indexOf("ACTIVE") > -1);

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


示例3: getStart

import org.hl7.fhir.dstu3.model.DateTimeType; //导入依赖的package包/类
public Optional<String> getStart(DomainResource resource){
	org.hl7.fhir.dstu3.model.Condition fhirCondition =
		(org.hl7.fhir.dstu3.model.Condition) resource;
	try {
		if (fhirCondition.hasOnsetDateTimeType()) {
			DateTimeType dateTime = fhirCondition.getOnsetDateTimeType();
			if (dateTime != null) {
				Date date = dateTime.getValue();
				SimpleDateFormat format = new SimpleDateFormat("dd.MM.yyyy");
				return Optional.of(format.format(date));
			}
		} else if (fhirCondition.hasOnsetStringType()) {
			return Optional.of(fhirCondition.getOnsetStringType().getValue());
		}
	} catch (FHIRException e) {
		LoggerFactory.getLogger(ConditionAccessor.class).error("Could not access start time.",
			e);
	}
	return Optional.empty();
}
 
开发者ID:elexis,项目名称:elexis-3-core,代码行数:21,代码来源:ConditionAccessor.java


示例4: getEnd

import org.hl7.fhir.dstu3.model.DateTimeType; //导入依赖的package包/类
public Optional<String> getEnd(DomainResource resource){
	org.hl7.fhir.dstu3.model.Condition fhirCondition =
		(org.hl7.fhir.dstu3.model.Condition) resource;
	try {
		if (fhirCondition.hasAbatementDateTimeType()) {
			DateTimeType dateTime = fhirCondition.getAbatementDateTimeType();
			if (dateTime != null) {
				Date date = dateTime.getValue();
				SimpleDateFormat format = new SimpleDateFormat("dd.MM.yyyy");
				return Optional.of(format.format(date));
			}
		} else if (fhirCondition.hasAbatementStringType()) {
			return Optional.of(fhirCondition.getAbatementStringType().getValue());
		}
	} catch (FHIRException e) {
		LoggerFactory.getLogger(ConditionAccessor.class).error("Could not access end.", e);
	}
	return Optional.empty();
}
 
开发者ID:elexis,项目名称:elexis-3-core,代码行数:20,代码来源:ConditionAccessor.java


示例5: getEffectiveTime

import org.hl7.fhir.dstu3.model.DateTimeType; //导入依赖的package包/类
public Optional<LocalDateTime> getEffectiveTime(DomainResource resource){
	org.hl7.fhir.dstu3.model.Observation fhirObservation =
		(org.hl7.fhir.dstu3.model.Observation) resource;
	Type effective = fhirObservation.getEffective();
	if (effective instanceof DateTimeType) {
		return Optional.of(getLocalDateTime(((DateTimeType) effective).getValue()));
	} else if (effective instanceof Period) {
		Date start = ((Period) effective).getStart();
		if (start != null) {
			return Optional.of(getLocalDateTime(start));
		}
		Date end = ((Period) effective).getEnd();
		if (end != null) {
			return Optional.of(getLocalDateTime(end));
		}
	}
	return Optional.empty();
}
 
开发者ID:elexis,项目名称:elexis-3-core,代码行数:19,代码来源:ObservationAccessor.java


示例6: convertFhirDateTime

import org.hl7.fhir.dstu3.model.DateTimeType; //导入依赖的package包/类
/**
 * Convert the timestamp into a FHIR DateType or DateTimeType.
 * 
 * @param datetime
 *          Timestamp
 * @param time
 *          If true, return a DateTime; if false, return a Date.
 * @return a DateType or DateTimeType representing the given timestamp
 */
private static Type convertFhirDateTime(long datetime, boolean time) {
  Date date = new Date(datetime);

  if (time) {
    return new DateTimeType(date);
  } else {
    return new DateType(date);
  }
}
 
开发者ID:synthetichealth,项目名称:synthea_java,代码行数:19,代码来源:FhirStu3.java


示例7: choiceValue

import org.hl7.fhir.dstu3.model.DateTimeType; //导入依赖的package包/类
@Test
public void choiceValue() {

  // Our test condition uses the DateTime choice, so use that type and column.
  Assert.assertEquals(((DateTimeType) condition.getOnset()).getValueAsString(),
      conditionsDataset.select("onsetDateTime").head().get(0));

  Assert.assertEquals(condition.getOnset().toString(),
      decodedCondition.getOnset().toString());
}
 
开发者ID:cerner,项目名称:bunsen,代码行数:11,代码来源:FhirEncodersTest.java


示例8: newCondition

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

  Condition condition = new Condition();

  // Condition based on example from FHIR:
  // https://www.hl7.org/fhir/condition-example.json.html
  condition.setId("Condition/example");

  condition.setLanguage("en_US");

  // Narrative text
  Narrative narrative = new Narrative();
  narrative.setStatusAsString("generated");
  narrative.setDivAsString("This data was generated for test purposes.");
  XhtmlNode node = new XhtmlNode();
  node.setNodeType(NodeType.Text);
  node.setValue("Severe burn of left ear (Date: 24-May 2012)");
  condition.setText(narrative);

  condition.setSubject(new Reference("Patient/example").setDisplay("Here is a display for you."));

  condition.setVerificationStatus(Condition.ConditionVerificationStatus.CONFIRMED);

  // Condition code
  CodeableConcept code = new CodeableConcept();
  code.addCoding()
      .setSystem("http://snomed.info/sct")
      .setCode("39065001")
      .setDisplay("Severe");
  condition.setSeverity(code);

  // Severity code
  CodeableConcept severity = new CodeableConcept();
  severity.addCoding()
      .setSystem("http://snomed.info/sct")
      .setCode("24484000")
      .setDisplay("Burn of ear")
      .setUserSelected(true);
  condition.setSeverity(severity);

  // Onset date time
  DateTimeType onset = new DateTimeType();
  onset.setValueAsString("2012-05-24");
  condition.setOnset(onset);

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


示例9: getEffectiveDateTimeType

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


示例10: getEffectiveDateTimeType

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


示例11: getAbatementDateTimeType

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


示例12: getOnsetDateTimeType

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


示例13: getOccurrenceDateTimeType

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


示例14: getScheduledDateTimeType

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


示例15: getDeceasedDateTimeType

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


示例16: setBirthTime

import org.hl7.fhir.dstu3.model.DateTimeType; //导入依赖的package包/类
public Iqicorepatient setBirthTime(DateTimeType param)
{
   adaptedClass
           .addExtension()
           .setUrl("http://hl7.org/fhir/StructureDefinition/patient-birthTime")
           .setValue(param);
   return this;
}
 
开发者ID:cqframework,项目名称:qicore_model,代码行数:9,代码来源:qicorepatientAdapter.java


示例17: getValueDateTimeType

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


示例18: getPerformedDateTimeType

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


示例19: toDateTime

import org.hl7.fhir.dstu3.model.DateTimeType; //导入依赖的package包/类
public DateTime toDateTime(DateTimeType hapiDt) {
    // TODO: do we want 0 to be the default value if null?
    int year = hapiDt.getYear() == null ? 0 : hapiDt.getYear();
    // months in HAPI are zero-indexed -- don't want that, hence the plus one
    int month = hapiDt.getMonth() == null ? 0 : hapiDt.getMonth() + 1;
    int day = hapiDt.getDay() == null ? 0 : hapiDt.getDay();
    int hour = hapiDt.getHour() == null ? 0 : hapiDt.getHour();
    int minute = hapiDt.getMinute() == null ? 0 : hapiDt.getMinute();
    int sec = hapiDt.getSecond() == null ? 0 : hapiDt.getSecond();
    int millis = hapiDt.getMillis() == null ? 0 : hapiDt.getMillis();
    if (hapiDt.getTimeZone() == null) {
        return new DateTime(new Partial(DateTime.getFields(7), new int[] {year, month, day, hour, minute, sec, millis}));
    }
    return new DateTime(new Partial(DateTime.getFields(7), new int[] {year, month, day, hour, minute, sec, millis}), DateTimeZone.forTimeZone(hapiDt.getTimeZone()));
}
 
开发者ID:DBCG,项目名称:cql_engine,代码行数:16,代码来源:FileBasedFhirProvider.java


示例20: convertForDateFormat

import org.hl7.fhir.dstu3.model.DateTimeType; //导入依赖的package包/类
private String convertForDateFormat(String fmt, String av) throws FHIRException {
 	if ("v3".equals(fmt)) {
 		DateTimeType d = DateTimeType.parseV3(av);
 		return d.asStringValue();
 	} else
 		throw new FHIRException("Unknown Data format '"+fmt+"'");
}
 
开发者ID:jamesagnew,项目名称:hapi-fhir,代码行数:8,代码来源:XmlParser.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Java XMLParser类代码示例发布时间:2022-05-23
下一篇:
Java MediaCodecRenderer类代码示例发布时间: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