use of ch.elexis.core.findings.util.model.TransientCoding 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);
}
use of ch.elexis.core.findings.util.model.TransientCoding in project elexis-server by elexis.
the class ObservationTest method setupClass.
@BeforeClass
public static void setupClass() throws IOException, SQLException, ElexisException {
AllTests.getTestDatabaseInitializer().initializeLabResult();
AllTests.getTestDatabaseInitializer().initializeBehandlung();
AllTests.getTestDatabaseInitializer().initializeMandant();
client = FhirUtil.getGenericClient("http://localhost:8380/fhir");
assertNotNull(client);
IObservation persAnam = AllTests.getFindingsService().create(IObservation.class);
persAnam.setCategory(ObservationCategory.SOCIALHISTORY);
persAnam.setCoding(Collections.singletonList(new TransientCoding(ObservationCode.ANAM_PERSONAL)));
persAnam.setText("Pers Anamnese 1");
persAnam.setPatientId(AllTests.getTestDatabaseInitializer().getPatient().getId());
IObservation risk = AllTests.getFindingsService().create(IObservation.class);
risk.setCategory(ObservationCategory.SOCIALHISTORY);
risk.setCoding(Collections.singletonList(new TransientCoding(ObservationCode.ANAM_RISK)));
risk.setText("Risiken 1");
risk.setPatientId(AllTests.getTestDatabaseInitializer().getPatient().getId());
IEncounter encounter = AllTests.getFindingsService().create(IEncounter.class);
encounter.setConsultationId(TestDatabaseInitializer.getBehandlung().getId());
encounter.setPatientId(AllTests.getTestDatabaseInitializer().getPatient().getId());
IObservation iObservation = AllTests.getFindingsService().create(IObservation.class);
iObservation.setCategory(ObservationCategory.SOAP_SUBJECTIVE);
iObservation.setText("Encounter test 1");
iObservation.setPatientId(AllTests.getTestDatabaseInitializer().getPatient().getId());
iObservation.setEncounter(encounter);
IObservation vitalSign = AllTests.getFindingsService().create(IObservation.class);
vitalSign.setObservationType(ObservationType.COMP);
vitalSign.setCategory(ObservationCategory.VITALSIGNS);
vitalSign.setCoding(Collections.singletonList(new TransientCoding(CodingSystem.ELEXIS_LOCAL_CODESYSTEM.getSystem(), "test", "display test")));
ObservationComponent componentA = new ObservationComponent("componentA");
componentA.setNumericValue(new BigDecimal("122"));
componentA.setNumericValueUnit("mmHg");
vitalSign.addComponent(componentA);
ObservationComponent componentB = new ObservationComponent("componentB");
componentB.setNumericValue(new BigDecimal("78"));
componentB.setNumericValueUnit("mmHg");
vitalSign.addComponent(componentB);
vitalSign.setPatientId(AllTests.getTestDatabaseInitializer().getPatient().getId());
vitalSign.setEncounter(encounter);
new UpdateFindingTextCommand(vitalSign).execute();
AllTests.getFindingsService().saveFinding(persAnam);
AllTests.getFindingsService().saveFinding(risk);
AllTests.getFindingsService().saveFinding(encounter);
AllTests.getFindingsService().saveFinding(iObservation);
AllTests.getFindingsService().saveFinding(vitalSign);
findingsCreated.add(persAnam);
findingsCreated.add(risk);
findingsCreated.add(encounter);
findingsCreated.add(iObservation);
findingsCreated.add(vitalSign);
}
use of ch.elexis.core.findings.util.model.TransientCoding in project elexis-server by elexis.
the class CoverageTypeCodingContribution method loadTypes.
private List<ICoding> loadTypes() {
List<ICoding> ret = new ArrayList<>();
IQuery<IBillingSystemFactor> query = CoreModelServiceHolder.get().getQuery(IBillingSystemFactor.class);
List<IBillingSystemFactor> factors = query.execute();
HashSet<String> uniqueTypes = new HashSet<>();
for (IBillingSystemFactor factor : factors) {
uniqueTypes.add(factor.getSystem());
}
if (!uniqueTypes.isEmpty()) {
for (String string : uniqueTypes) {
ret.add(new TransientCoding(getCodeSystem(), string, string));
}
}
return ret;
}
Aggregations