本文整理汇总了Java中org.hl7.fhir.instance.model.TimeType类的典型用法代码示例。如果您正苦于以下问题:Java TimeType类的具体用法?Java TimeType怎么用?Java TimeType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TimeType类属于org.hl7.fhir.instance.model包,在下文中一共展示了TimeType类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: fromJavaPrimitive
import org.hl7.fhir.instance.model.TimeType; //导入依赖的package包/类
@Override
protected Object fromJavaPrimitive(Object value, Object target) {
if (target instanceof DateTimeType) {
return new Date(); // TODO: Why is this so hard?
}
else if (target instanceof DateType) {
return new Date();
}
else if (target instanceof TimeType) {
if (value instanceof Time) {
return ((Time) value).getPartial().toString();
}
return new Date();
}
else {
return value;
}
}
开发者ID:Discovery-Research-Network-SCCM,项目名称:FHIR-CQL-ODM-service,代码行数:19,代码来源:UsciitgFhirDataProviderHL7.java
示例2: processDateConstant
import org.hl7.fhir.instance.model.TimeType; //导入依赖的package包/类
private Base processDateConstant(Object appInfo, String value) throws PathEngineException {
if (value.startsWith("T"))
return new TimeType(value.substring(1));
String v = value;
if (v.length() > 10) {
int i = v.substring(10).indexOf("-");
if (i == -1)
i = v.substring(10).indexOf("+");
if (i == -1)
i = v.substring(10).indexOf("Z");
v = i == -1 ? value : v.substring(0, 10+i);
}
if (v.length() > 10)
return new DateTimeType(value);
else
return new DateType(value);
}
示例3: toJavaPrimitive
import org.hl7.fhir.instance.model.TimeType; //导入依赖的package包/类
@Override
protected Object toJavaPrimitive(Object result, Object source) {
if(source instanceof Iterable){
List<Object> mappedResults = new ArrayList<Object>();
for (Object item : (Iterable<?>)source) {
Object mappedItem = toJavaPrimitive(item, item);
if(mappedItem instanceof IPrimitiveType){
mappedResults.add(((IPrimitiveType<?>) mappedItem).getValue());
}else{
mappedResults.add(mappedItem);
}
}
return mappedResults;
}
else if (source instanceof DateTimeType) {
return DateTime.fromJavaDate(((DateTimeType) source).getValue()); //toDateTime((DateTimeType)source);
}
else if (source instanceof DateType) {
return DateTime.fromJavaDate(((DateType) source).getValue()); //toDateTime((DateType)source);
}
else if (source instanceof TimeType) {
return toTime((TimeType)source);
}
else if (source instanceof InstantType) {
return toDateTime((InstantType)source);
}
else {
return result;
}
}
开发者ID:Discovery-Research-Network-SCCM,项目名称:FHIR-CQL-ODM-service,代码行数:32,代码来源:UsciitgFhirDataProviderHL7.java
示例4: parseTime
import org.hl7.fhir.instance.model.TimeType; //导入依赖的package包/类
private TimeType parseTime(XmlPullParser xpp) throws Exception {
TimeType res = new TimeType();
parseElementAttributes(xpp, res);
res.setValue(parseTimePrimitive(xpp.getAttributeValue(null, "value")));
next(xpp);
int eventType = nextNoWhitespace(xpp);
while (eventType != XmlPullParser.END_TAG) {
if (!parseElementContent(eventType, xpp, res))
unknownContent(xpp);
eventType = nextNoWhitespace(xpp);
}
next(xpp);
return res;
}
示例5: parseTime
import org.hl7.fhir.instance.model.TimeType; //导入依赖的package包/类
private TimeType parseTime(String v) throws Exception {
TimeType res = new TimeType();
if (v != null)
res.setValue(parseTimePrimitive(v));
return res;
}