use of org.hl7.fhir.r4b.model.DateTimeType in project fhir-bridge by ehrbase.
the class ProblemDiagnoseEvaluationConverter method convertInternal.
@Override
protected ProblemDiagnoseEvaluation convertInternal(Condition resource) {
ProblemDiagnoseEvaluation evaluation = new ProblemDiagnoseEvaluation();
evaluation.setLetztesDokumentationsdatumValue(OffsetDateTime.now());
if (resource.hasSeverity() && resource.getSeverity().hasCoding()) {
evaluation.setSchweregrad(getSchweregrad(resource.getSeverity().getCoding().get(0)));
}
if (resource.hasCode() && resource.getCode().hasCoding()) {
evaluation.setNameDesProblemsDerDiagnoseDefiningCode(getNameDesProblemsDerDiagnose(resource.getCode().getCoding().get(0)));
}
if (resource.hasOnset()) {
DateTimeType fhirOnsetDateTime = resource.getOnsetDateTimeType();
evaluation.setDatumDesAuftretensDerErstdiagnoseValue(fhirOnsetDateTime.getValueAsCalendar().toZonedDateTime());
}
if (resource.getBodySite().size() == 1) {
String bodySiteName = resource.getBodySite().get(0).getCoding().get(0).getDisplay();
evaluation.setLokalisationValue("body site");
AnatomischeLokalisationCluster anatomischeLokalisationCluster = new AnatomischeLokalisationCluster();
anatomischeLokalisationCluster.setNameDerKoerperstelleValue(bodySiteName);
evaluation.setAnatomischeLokalisation(List.of(anatomischeLokalisationCluster));
}
return evaluation;
}
use of org.hl7.fhir.r4b.model.DateTimeType in project fhir-bridge by ehrbase.
the class TimeConverter method convertAgeExtensionTime.
public static TemporalAccessor convertAgeExtensionTime(Extension extension) {
if (extension == null) {
return OffsetDateTime.now();
}
Extension dataTimeOfDocumentationExtension = extension.getExtensionByUrl("dateTimeOfDocumentation");
if (dataTimeOfDocumentationExtension == null) {
return OffsetDateTime.now();
}
DateTimeType dateTimeOfDocumentationDt = (DateTimeType) dataTimeOfDocumentationExtension.getValue();
return dateTimeOfDocumentationDt.getValueAsCalendar().toZonedDateTime();
}
use of org.hl7.fhir.r4b.model.DateTimeType in project odm2fhir by num-codex.
the class ECMO method createProcedure.
private Procedure createProcedure(ItemData generalCoding, ItemData answerCoding) {
var procedure = (Procedure) new Procedure().addIdentifier(createIdentifier(PROCEDURE, generalCoding)).setPerformed(// TODO Set actual DateTime value
UNKNOWN_DATE_TIME).setCategory(createCodeableConcept(createCoding(SNOMED_CT, "277132007", "Therapeutic procedure (procedure)"))).setCode(createCodeableConcept(generalCoding).setText("ECMO")).setMeta(createMeta(EXTRACORPOREAL_MEMBRANE_OXYGENATION));
createCodings(answerCoding).forEach(coding -> {
if (ProcedureStatus.UNKNOWN.getSystem().equals(coding.getSystem())) {
procedure.setStatus(ProcedureStatus.fromCode(coding.getCode()));
} else {
procedure.setPerformed((DateTimeType) new DateTimeType().addExtension(createExtension(coding)));
}
});
return procedure;
}
use of org.hl7.fhir.r4b.model.DateTimeType in project pathling by aehrc.
the class DateTimeLiteralPath method fromString.
/**
* Returns a new instance, parsed from a FHIRPath literal.
*
* @param fhirPath The FHIRPath representation of the literal
* @param context An input context that can be used to build a {@link Dataset} to represent the
* literal
* @return A new instance of {@link LiteralPath}
* @throws ParseException if the literal is malformed
*/
public static DateTimeLiteralPath fromString(@Nonnull final String fhirPath, @Nonnull final FhirPath context) throws ParseException {
final String dateTimeString = fhirPath.replaceFirst("^@", "");
final java.util.Date date = DateTimePath.getDateFormat().parse(dateTimeString);
final DateTimeType literalValue = new DateTimeType(date);
literalValue.setTimeZone(DateTimePath.getTimeZone());
return new DateTimeLiteralPath(context.getDataset(), context.getIdColumn(), literalValue);
}
use of org.hl7.fhir.r4b.model.DateTimeType in project pathling by aehrc.
the class TestData method newCondition.
/**
* Returns a FHIR Condition for testing purposes.
*/
public static Condition newCondition() {
final Condition condition = new Condition();
// Condition based on example from FHIR:
// https://www.hl7.org/fhir/condition-example.json.html
condition.setId("example");
condition.setLanguage("en_US");
// Narrative text
final Narrative narrative = new Narrative();
narrative.setStatusAsString("generated");
narrative.setDivAsString("This data was generated for test purposes.");
final 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."));
final CodeableConcept verificationStatus = new CodeableConcept();
verificationStatus.addCoding(new Coding(ConditionVerStatus.CONFIRMED.getSystem(), ConditionVerStatus.CONFIRMED.toCode(), ConditionVerStatus.CONFIRMED.getDisplay()));
condition.setVerificationStatus(verificationStatus);
// Condition code
final CodeableConcept code = new CodeableConcept();
code.addCoding().setSystem("http://snomed.info/sct").setCode("39065001").setDisplay("Severe");
condition.setSeverity(code);
// Severity code
final 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
final DateTimeType onset = new DateTimeType();
onset.setValueAsString("2012-05-24");
condition.setOnset(onset);
return condition;
}
Aggregations