Search in sources :

Example 1 with Diff

use of org.javers.core.diff.Diff in project backend by CatalogueOfLife.

the class ResourceTestBase method printDiff.

protected void printDiff(Object o1, Object o2) {
    Javers javers = JaversBuilder.javers().build();
    Diff diff = javers.compare(o1, o2);
    System.out.println(diff);
}
Also used : Javers(org.javers.core.Javers) Diff(org.javers.core.diff.Diff)

Example 2 with Diff

use of org.javers.core.diff.Diff in project fhir-bridge by ehrbase.

the class BloodGasIT method testMapping.

@Override
public void testMapping(String resourcePath, String paragonPath) throws IOException {
    Bundle bundle = (Bundle) super.testFileLoader.loadResource(resourcePath);
    BloodGasPanelConverter bloodGasPanelConverter = new BloodGasPanelConverter();
    Observation observation = bloodGasPanelConverter.convert(bundle);
    BloodGasPanelCompositionConverter bloodGasPanelCompositionConverter = new BloodGasPanelCompositionConverter();
    BefundDerBlutgasanalyseComposition mappedBefundDerBlutgasanalyseComposition = bloodGasPanelCompositionConverter.convert(observation);
    Diff diff = compareCompositions(getJavers(), paragonPath, mappedBefundDerBlutgasanalyseComposition);
    assertEquals(diff.getChanges().size(), 0);
}
Also used : BefundDerBlutgasanalyseComposition(org.ehrbase.fhirbridge.ehr.opt.befundderblutgasanalysecomposition.BefundDerBlutgasanalyseComposition) Diff(org.javers.core.diff.Diff) Bundle(org.hl7.fhir.r4.model.Bundle) Observation(org.hl7.fhir.r4.model.Observation) BloodGasPanelConverter(org.ehrbase.fhirbridge.fhir.bundle.converter.BloodGasPanelConverter) BloodGasPanelCompositionConverter(org.ehrbase.fhirbridge.ehr.converter.specific.bloodgas.BloodGasPanelCompositionConverter)

Example 3 with Diff

use of org.javers.core.diff.Diff in project fhir-bridge by ehrbase.

the class SerologischerBefundIT method testMapping.

@Override
public void testMapping(String resourcePath, String paragonPath) throws IOException {
    Bundle bundle = (Bundle) super.testFileLoader.loadResource(resourcePath);
    AntiBodyPanelConverter antiBodyPanelConverter = new AntiBodyPanelConverter();
    Observation observation = antiBodyPanelConverter.convert(bundle);
    GECCOSerologischerBefundCompositionConverter geccoSerologischerBefundCompositionConverter = new GECCOSerologischerBefundCompositionConverter();
    GECCOSerologischerBefundComposition mappedGECCOSerologischerBefundComposition = geccoSerologischerBefundCompositionConverter.convert(observation);
    Diff diff = compareCompositions(getJavers(), paragonPath, mappedGECCOSerologischerBefundComposition);
    assertEquals(diff.getChanges().size(), 0);
}
Also used : GECCOSerologischerBefundComposition(org.ehrbase.fhirbridge.ehr.opt.geccoserologischerbefundcomposition.GECCOSerologischerBefundComposition) AntiBodyPanelConverter(org.ehrbase.fhirbridge.fhir.bundle.converter.AntiBodyPanelConverter) Diff(org.javers.core.diff.Diff) Bundle(org.hl7.fhir.r4.model.Bundle) GECCOSerologischerBefundCompositionConverter(org.ehrbase.fhirbridge.ehr.converter.specific.antibodypanel.GECCOSerologischerBefundCompositionConverter) Observation(org.hl7.fhir.r4.model.Observation)

Example 4 with Diff

use of org.javers.core.diff.Diff in project fhir-bridge by ehrbase.

the class GECCODiagnoseIT method testMapping.

@Override
public void testMapping(String resourcePath, String paragonPath) throws IOException {
    Condition resource = (Condition) super.testFileLoader.loadResource(resourcePath);
    GECCODiagnoseCompositionConverter compositionConverter = new GECCODiagnoseCompositionConverter();
    GECCODiagnoseComposition composition = compositionConverter.convert(resource);
    Diff diff = compareCompositions(getJavers(), paragonPath, composition);
    assertEquals(diff.getChanges().size(), 0);
}
Also used : Condition(org.hl7.fhir.r4.model.Condition) GECCODiagnoseComposition(org.ehrbase.fhirbridge.ehr.opt.geccodiagnosecomposition.GECCODiagnoseComposition) GECCODiagnoseCompositionConverter(org.ehrbase.fhirbridge.ehr.converter.specific.geccodiagnose.GECCODiagnoseCompositionConverter) Diff(org.javers.core.diff.Diff)

Example 5 with Diff

use of org.javers.core.diff.Diff in project fhir-bridge by ehrbase.

the class SymptomIT method testMapping.

@Override
public void testMapping(String resourcePath, String paragonPath) throws IOException {
    Condition condition = (Condition) testFileLoader.loadResource(resourcePath);
    SymptomCompositionConverter compositionConverter = new SymptomCompositionConverter();
    SymptomComposition mapped = compositionConverter.convert(condition);
    Diff diff = compareCompositions(getJavers(), paragonPath, mapped);
    assertEquals(0, diff.getChanges().size());
}
Also used : Condition(org.hl7.fhir.r4.model.Condition) Diff(org.javers.core.diff.Diff) SymptomComposition(org.ehrbase.fhirbridge.ehr.opt.symptomcomposition.SymptomComposition) SymptomCompositionConverter(org.ehrbase.fhirbridge.ehr.converter.specific.symptom.SymptomCompositionConverter)

Aggregations

Diff (org.javers.core.diff.Diff)57 Observation (org.hl7.fhir.r4.model.Observation)23 Javers (org.javers.core.Javers)10 Test (org.junit.Test)5 Bundle (org.hl7.fhir.r4.model.Bundle)4 DualProtocolSaajSoapMessageFactory (ca.bc.gov.open.pcss.civil.comparison.config.DualProtocolSaajSoapMessageFactory)2 List (java.util.List)2 UsernamePasswordCredentials (org.apache.http.auth.UsernamePasswordCredentials)2 VirologischerBefundCompositionConverter (org.ehrbase.fhirbridge.ehr.converter.specific.virologischerbefund.VirologischerBefundCompositionConverter)2 GECCOPersonendatenComposition (org.ehrbase.fhirbridge.ehr.opt.geccopersonendatencomposition.GECCOPersonendatenComposition)2 VirologischerBefundComposition (org.ehrbase.fhirbridge.ehr.opt.virologischerbefundcomposition.VirologischerBefundComposition)2 BefundObservation (org.ehrbase.fhirbridge.ehr.opt.virologischerbefundcomposition.definition.BefundObservation)2 VirologischerBefundConverter (org.ehrbase.fhirbridge.fhir.bundle.converter.VirologischerBefundConverter)2 Condition (org.hl7.fhir.r4.model.Condition)2 DiagnosticReport (org.hl7.fhir.r4.model.DiagnosticReport)2 ValueChange (org.javers.core.diff.changetype.ValueChange)2 WebServiceSenderWithAuth (ca.bc.gov.open.pcss.civil.comparison.config.WebServiceSenderWithAuth)1 ca.bc.gov.open.pcss.three (ca.bc.gov.open.pcss.three)1 YesNoType (ca.bc.gov.open.pcss.two.YesNoType)1 VisibleForTesting (com.google.common.annotations.VisibleForTesting)1