Search in sources :

Example 36 with Diff

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

the class MapperTestBase 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 37 with Diff

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

the class SexAtBirthIT method testMapping.

@Override
public void testMapping(String resourcePath, String paragonPath) throws IOException {
    Observation observation = (Observation) super.testFileLoader.loadResource(resourcePath);
    SexAtBirthConverter sexAtBirthConverter = new SexAtBirthConverter();
    GECCOPersonendatenComposition mapped = sexAtBirthConverter.convert(observation);
    Diff diff = compareCompositions(getJavers(), paragonPath, mapped);
    assertEquals(0, diff.getChanges().size());
}
Also used : SexAtBirthConverter(org.ehrbase.fhirbridge.ehr.converter.specific.sexatbirth.SexAtBirthConverter) GECCOPersonendatenComposition(org.ehrbase.fhirbridge.ehr.opt.geccopersonendatencomposition.GECCOPersonendatenComposition) Diff(org.javers.core.diff.Diff) Observation(org.hl7.fhir.r4.model.Observation)

Example 38 with Diff

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

the class SofaScoreIT method testMapping.

@Override
public void testMapping(String resourcePath, String paragonPath) throws IOException {
    Observation observation = (Observation) super.testFileLoader.loadResource(resourcePath);
    SofaScoreCompositionConverter converter = new SofaScoreCompositionConverter();
    SOFAComposition composition = converter.convert(observation);
    Diff diff = compareCompositions(getJavers(), paragonPath, composition);
    assertEquals(0, diff.getChanges().size());
}
Also used : Diff(org.javers.core.diff.Diff) SofaScoreObservation(org.ehrbase.fhirbridge.ehr.opt.sofacomposition.definition.SofaScoreObservation) Observation(org.hl7.fhir.r4.model.Observation) SofaScoreCompositionConverter(org.ehrbase.fhirbridge.ehr.converter.specific.sofascore.SofaScoreCompositionConverter) SOFAComposition(org.ehrbase.fhirbridge.ehr.opt.sofacomposition.SOFAComposition)

Example 39 with Diff

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

the class PatientIT method mappingPatient.

@Test
void mappingPatient() throws IOException {
    Patient patient = (Patient) super.testFileLoader.loadResource("create-patient.json");
    PatientCompositionConverter patientCompositionConverterConverter = new PatientCompositionConverter();
    GECCOPersonendatenComposition mappedGeccoPersonendatenComposition = patientCompositionConverterConverter.convert(patient);
    Diff diff = compareCompositions(getJavers(), "paragon-GECCO-patient-mapping-output.json", mappedGeccoPersonendatenComposition);
    assertEquals(0, diff.getChanges().size());
}
Also used : PatientCompositionConverter(org.ehrbase.fhirbridge.ehr.converter.specific.patient.PatientCompositionConverter) GECCOPersonendatenComposition(org.ehrbase.fhirbridge.ehr.opt.geccopersonendatencomposition.GECCOPersonendatenComposition) Diff(org.javers.core.diff.Diff) Patient(org.hl7.fhir.r4.model.Patient) Test(org.junit.jupiter.api.Test)

Example 40 with Diff

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

the class BodyWeightIT method testMapping.

@Override
public void testMapping(String resourcePath, String paragonPath) throws IOException {
    Observation observation = (Observation) super.testFileLoader.loadResource(resourcePath);
    BodyWeightCompositionConverter bodyWeightCompositionConverter = new BodyWeightCompositionConverter();
    KoerpergewichtComposition mapped = bodyWeightCompositionConverter.convert(observation);
    Diff diff = compareCompositions(getJavers(), paragonPath, mapped);
    assertEquals(0, diff.getChanges().size());
}
Also used : BodyWeightCompositionConverter(org.ehrbase.fhirbridge.ehr.converter.specific.bodyweight.BodyWeightCompositionConverter) Diff(org.javers.core.diff.Diff) KoerpergewichtComposition(org.ehrbase.fhirbridge.ehr.opt.koerpergewichtcomposition.KoerpergewichtComposition) KoerpergewichtObservation(org.ehrbase.fhirbridge.ehr.opt.koerpergewichtcomposition.definition.KoerpergewichtObservation) Observation(org.hl7.fhir.r4.model.Observation)

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