use of org.hl7.fhir.r4b.model.DateTimeType in project openmrs-module-fhir2 by openmrs.
the class ConditionTranslatorImpl_2_2Test method shouldTranslateFhirConditionOnsetToOpenMrsOnsetDate.
@Test
public void shouldTranslateFhirConditionOnsetToOpenMrsOnsetDate() {
DateTimeType theDateTime = new DateTimeType();
theDateTime.setValue(new Date());
fhirCondition.setOnset(theDateTime);
org.openmrs.Condition condition = conditionTranslator.toOpenmrsType(fhirCondition);
assertThat(condition, notNullValue());
assertThat(condition.getOnsetDate(), notNullValue());
assertThat(condition.getOnsetDate(), DateMatchers.sameDay(new Date()));
}
use of org.hl7.fhir.r4b.model.DateTimeType in project summary-care-record-api by NHSDigital.
the class DiagnosisMapper method mapInformant.
private void mapInformant(List<Resource> resources, Encounter encounter, Node informant) {
DateTimeType time = parseDate(xmlUtils.getValueByXPath(informant, DIAGNOSIS_PARTICIPANT_TIME_XPATH), DateTimeType.class);
participantMapper.map(informant).stream().peek(it -> resources.add(it)).filter(it -> it instanceof PractitionerRole || it instanceof RelatedPerson).forEach(it -> encounter.addParticipant(new EncounterParticipantComponent().setPeriod(new Period().setStartElement(time)).addType(getParticipationType("INF", "informant")).setIndividual(new Reference(it))));
}
use of org.hl7.fhir.r4b.model.DateTimeType in project summary-care-record-api by NHSDigital.
the class FindingMapper method mapInformant.
private void mapInformant(List<Resource> resources, Encounter encounter, Node informant) {
DateTimeType time = parseDate(xmlUtils.getValueByXPath(informant, FINDING_PARTICIPANT_TIME_XPATH), DateTimeType.class);
participantMapper.map(informant).stream().peek(it -> resources.add(it)).filter(it -> it instanceof PractitionerRole || it instanceof RelatedPerson).map(Reference::new).forEach(it -> encounter.addParticipant(new EncounterParticipantComponent().setPeriod(new Period().setStartElement(time)).addType(getParticipationType("INF", "informant")).setIndividual(it)));
}
use of org.hl7.fhir.r4b.model.DateTimeType in project integration-adaptor-111 by nhsconnect.
the class PeriodMapper method mapPeriod.
public Period mapPeriod(IVLTS ivlts) {
DateTimeType high = DateUtil.parse(ivlts.getHigh().getValue());
DateTimeType low = DateUtil.parse(ivlts.getLow().getValue());
return new Period().setStartElement(low).setEndElement(high);
}
use of org.hl7.fhir.r4b.model.DateTimeType in project odm2fhir by num-codex.
the class Apheresis 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("Apheresis")).setMeta(createMeta(APHERESIS));
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;
}
Aggregations