use of ch.elexis.core.text.model.Samdas in project elexis-server by elexis.
the class MigratorService method updateEncounter.
private void updateEncounter(IEncounter findingsEncounter, ch.elexis.core.model.IEncounter encounter) {
findingsEncounter.setConsultationId(encounter.getId());
findingsEncounter.setMandatorId(encounter.getMandator().getId());
LocalDate encounterDate = encounter.getDate();
if (encounterDate != null) {
findingsEncounter.setStartTime(encounterDate.atStartOfDay());
findingsEncounter.setEndTime(encounterDate.atTime(23, 59, 59));
}
ICoverage coverage = encounter.getCoverage();
if (coverage != null) {
IPatient patient = coverage.getPatient();
if (patient != null) {
findingsEncounter.setPatientId(patient.getId());
}
}
VersionedResource vr = encounter.getVersionedEntry();
if (vr != null) {
Samdas samdas = new Samdas(vr.getHead());
findingsEncounter.setText(samdas.getRecordText());
}
List<ICoding> coding = findingsEncounter.getType();
if (!ModelUtil.isSystemInList(CodingSystem.ELEXIS_ENCOUNTER_TYPE.getSystem(), coding)) {
coding.add(new TransientCoding(CodingSystem.ELEXIS_ENCOUNTER_TYPE.getSystem(), "text", "Nicht strukturierte Konsultation"));
findingsEncounter.setType(coding);
}
findingsService.saveFinding(findingsEncounter);
}
Aggregations