Search in sources :

Example 1 with TransientCoding

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);
}
Also used : ICoding(ch.elexis.core.findings.ICoding) ICoverage(ch.elexis.core.model.ICoverage) TransientCoding(ch.elexis.core.findings.util.model.TransientCoding) Samdas(ch.elexis.core.text.model.Samdas) LocalDate(java.time.LocalDate) VersionedResource(ch.rgw.tools.VersionedResource) IPatient(ch.elexis.core.model.IPatient)

Example 2 with TransientCoding

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);
}
Also used : IEncounter(ch.elexis.core.findings.IEncounter) TransientCoding(ch.elexis.core.findings.util.model.TransientCoding) UpdateFindingTextCommand(ch.elexis.core.findings.util.commands.UpdateFindingTextCommand) BigDecimal(java.math.BigDecimal) IObservation(ch.elexis.core.findings.IObservation) ObservationComponent(ch.elexis.core.findings.ObservationComponent) BeforeClass(org.junit.BeforeClass)

Example 3 with TransientCoding

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;
}
Also used : ICoding(ch.elexis.core.findings.ICoding) IBillingSystemFactor(ch.elexis.core.model.IBillingSystemFactor) ArrayList(java.util.ArrayList) TransientCoding(ch.elexis.core.findings.util.model.TransientCoding) HashSet(java.util.HashSet)

Aggregations

TransientCoding (ch.elexis.core.findings.util.model.TransientCoding)3 ICoding (ch.elexis.core.findings.ICoding)2 IEncounter (ch.elexis.core.findings.IEncounter)1 IObservation (ch.elexis.core.findings.IObservation)1 ObservationComponent (ch.elexis.core.findings.ObservationComponent)1 UpdateFindingTextCommand (ch.elexis.core.findings.util.commands.UpdateFindingTextCommand)1 IBillingSystemFactor (ch.elexis.core.model.IBillingSystemFactor)1 ICoverage (ch.elexis.core.model.ICoverage)1 IPatient (ch.elexis.core.model.IPatient)1 Samdas (ch.elexis.core.text.model.Samdas)1 VersionedResource (ch.rgw.tools.VersionedResource)1 BigDecimal (java.math.BigDecimal)1 LocalDate (java.time.LocalDate)1 ArrayList (java.util.ArrayList)1 HashSet (java.util.HashSet)1 BeforeClass (org.junit.BeforeClass)1