use of org.hl7.fhir.dstu2016may.model.DateType in project MobileAccessGateway by i4mi.
the class Iti78RequestConverter method transformDay.
public IVXBTS transformDay(Date date) {
DateType dt = new DateType(date);
IVXBTS result = new IVXBTS();
result.setValue(dt.asStringValue().replace("-", ""));
return result;
}
use of org.hl7.fhir.dstu2016may.model.DateType in project MobileAccessGateway by i4mi.
the class BaseQueryResponseConverter method transformToDate.
/**
* XDS Timestamp -> FHIR Date
* @param timestamp
* @return
*/
public DateType transformToDate(Timestamp timestamp) {
if (timestamp == null)
return null;
Date date = Date.from(timestamp.getDateTime().toInstant());
Precision precision = timestamp.getPrecision();
TemporalPrecisionEnum fhirPrecision;
switch(precision) {
case YEAR:
fhirPrecision = TemporalPrecisionEnum.YEAR;
break;
case DAY:
fhirPrecision = TemporalPrecisionEnum.DAY;
break;
// case SECOND: fhirPrecision = TemporalPrecisionEnum.SECOND;break;
default:
fhirPrecision = TemporalPrecisionEnum.DAY;
break;
}
return new DateType(date, fhirPrecision);
}
Aggregations