Search in sources :

Example 86 with DiagnosticReport

use of org.hl7.fhir.dstu3.model.DiagnosticReport in project org.hl7.fhir.core by hapifhir.

the class ProfileUtilitiesTests method execute.

public void execute(String[] args) throws FileNotFoundException, IOException, FHIRException {
    System.out.println("loading context");
    context = SimpleWorkerContext.fromPack(Utilities.path(root, "validation.zip"));
    comp = new ProfileComparer(context);
    compare("patient-daf-dafpatient.profile.xml", "patient-qicore-qicore-patient.profile.xml");
    compare("encounter-daf-dafencounter.profile.xml", "encounter-qicore-qicore-encounter.profile.xml");
    compare("substance-daf-dafsubstance.profile.xml", "substance-qicore-qicore-substance.profile.xml");
    compare("medication-daf-dafmedication.profile.xml", "medication-qicore-qicore-medication.profile.xml");
    compare("procedure-daf-dafprocedure.profile.xml", "procedure-qicore-qicore-procedure.profile.xml");
    compare("familymemberhistory-daf-daffamilymemberhistory.profile.xml", "familymemberhistory-qicore-qicore-familymemberhistory.profile.xml");
    compare("immunization-daf-dafimmunization.profile.xml", "immunization-qicore-qicore-immunization.profile.xml");
    compare("condition-daf-dafcondition.profile.xml", "condition-qicore-qicore-condition.profile.xml");
    compare("allergyintolerance-daf-dafallergyintolerance.profile.xml", "allergyintolerance-qicore-qicore-allergyintolerance.profile.xml");
    compare("medicationadministration-daf-dafmedicationadministration.profile.xml", "medicationadministration-qicore-qicore-medicationadministration.profile.xml");
    compare("medicationdispense-daf-dafmedicationdispense.profile.xml", "medicationdispense-qicore-qicore-medicationdispense.profile.xml");
    compare("medicationprescription-daf-dafmedicationprescription.profile.xml", "medicationprescription-qicore-qicore-medicationprescription.profile.xml");
    compare("medicationstatement-daf-dafmedicationstatement.profile.xml", "medicationstatement-qicore-qicore-medicationstatement.profile.xml");
    compare("observation-daf-smokingstatus-dafsmokingstatus.profile.xml", "observation-qicore-qicore-observation.profile.xml");
    compare("observation-daf-vitalsigns-dafvitalsigns.profile.xml", "observation-qicore-qicore-observation.profile.xml");
    // compare("observation-daf-results-dafresultobs.profile.xml", "observation-qicore-qicore-observation.profile.xml");
    // compare("diagnosticorder-daf-dafdiagnosticorder.profile.xml", "diagnosticorder-qicore-qicore-diagnosticorder.profile.xml");
    // compare("diagnosticreport-daf-dafdiagnosticreport.profile.xml", "diagnosticreport-qicore-qicore-diagnosticreport.profile.xml");
    System.out.println("processing output");
    for (ProfileComparison outcome : comp.getComparisons()) {
        if (outcome.getSubset() != null)
            new XmlParser().setOutputStyle(OutputStyle.PRETTY).compose(new FileOutputStream(Utilities.path("[tmp]", "intersection-" + outcome.getId() + ".xml")), outcome.getSubset());
        if (outcome.getSuperset() != null)
            new XmlParser().setOutputStyle(OutputStyle.PRETTY).compose(new FileOutputStream(Utilities.path("[tmp]", "union-" + outcome.getId() + ".xml")), outcome.getSuperset());
        System.out.println("\r\n" + outcome.getId() + ": Comparison of " + outcome.getLeft().getUrl() + " and " + outcome.getRight().getUrl());
        for (ValidationMessage vm : outcome.getMessages()) if (vm.getLevel() == IssueSeverity.INFORMATION)
            System.out.println(vm.summary());
        for (ValidationMessage vm : outcome.getMessages()) if (vm.getLevel() == IssueSeverity.WARNING)
            System.out.println(vm.summary());
        for (ValidationMessage vm : outcome.getMessages()) if (vm.getLevel() == IssueSeverity.ERROR)
            System.out.println(vm.summary());
        for (ValidationMessage vm : outcome.getMessages()) if (vm.getLevel() == IssueSeverity.FATAL)
            System.out.println(vm.summary());
        System.out.println("done. " + Integer.toString(outcome.getMessages().size()) + " messages");
        System.out.println("=================================================================");
    }
}
Also used : ProfileComparison(org.hl7.fhir.dstu3.conformance.ProfileComparer.ProfileComparison) XmlParser(org.hl7.fhir.dstu3.formats.XmlParser) ValidationMessage(org.hl7.fhir.utilities.validation.ValidationMessage) ProfileComparer(org.hl7.fhir.dstu3.conformance.ProfileComparer) FileOutputStream(java.io.FileOutputStream)

Example 87 with DiagnosticReport

use of org.hl7.fhir.dstu3.model.DiagnosticReport in project org.hl7.fhir.core by hapifhir.

the class RdfParser method composeDiagnosticReportDiagnosticReportMediaComponent.

protected void composeDiagnosticReportDiagnosticReportMediaComponent(Complex parent, String parentType, String name, DiagnosticReport.DiagnosticReportMediaComponent element, int index) {
    if (element == null)
        return;
    Complex t;
    if (Utilities.noString(parentType))
        t = parent;
    else {
        t = parent.predicate("fhir:" + parentType + '.' + name);
    }
    composeBackboneElement(t, "media", name, element, index);
    if (element.hasCommentElement())
        composeString(t, "DiagnosticReport", "comment", element.getCommentElement(), -1);
    if (element.hasLink())
        composeReference(t, "DiagnosticReport", "link", element.getLink(), -1);
}
Also used : Complex(org.hl7.fhir.r4.utils.formats.Turtle.Complex)

Example 88 with DiagnosticReport

use of org.hl7.fhir.dstu3.model.DiagnosticReport in project org.hl7.fhir.core by hapifhir.

the class TurtleTests method test_diagnosticreport_example_ghp.

@Test
public void test_diagnosticreport_example_ghp() throws FileNotFoundException, IOException, Exception {
    System.out.println("diagnosticreport-example-ghp.ttl");
    new Turtle().parse(TextFile.fileToString("C:\\work\\org.hl7.fhir\\build\\publish\\diagnosticreport-example-ghp.ttl"));
}
Also used : Turtle(org.hl7.fhir.dstu3.utils.formats.Turtle) Test(org.junit.jupiter.api.Test)

Example 89 with DiagnosticReport

use of org.hl7.fhir.dstu3.model.DiagnosticReport in project org.hl7.fhir.core by hapifhir.

the class TurtleTests method test_diagnosticreport_example_f202_bloodculture.

@Test
public void test_diagnosticreport_example_f202_bloodculture() throws FileNotFoundException, IOException, Exception {
    System.out.println("diagnosticreport-example-f202-bloodculture.ttl");
    new Turtle().parse(TextFile.fileToString("C:\\work\\org.hl7.fhir\\build\\publish\\diagnosticreport-example-f202-bloodculture.ttl"));
}
Also used : Turtle(org.hl7.fhir.dstu3.utils.formats.Turtle) Test(org.junit.jupiter.api.Test)

Example 90 with DiagnosticReport

use of org.hl7.fhir.dstu3.model.DiagnosticReport in project org.hl7.fhir.core by hapifhir.

the class TurtleTests method test_diagnosticreport_genetics_comprehensive_bone_marrow_report.

@Test
public void test_diagnosticreport_genetics_comprehensive_bone_marrow_report() throws FileNotFoundException, IOException, Exception {
    System.out.println("diagnosticreport-genetics-comprehensive-bone-marrow-report.ttl");
    new Turtle().parse(TextFile.fileToString("C:\\work\\org.hl7.fhir\\build\\publish\\diagnosticreport-genetics-comprehensive-bone-marrow-report.ttl"));
}
Also used : Turtle(org.hl7.fhir.dstu3.utils.formats.Turtle) Test(org.junit.jupiter.api.Test)

Aggregations

Test (org.junit.Test)133 DiagnosticReport (org.hl7.fhir.r4.model.DiagnosticReport)115 FhirDiagnosticReport (org.openmrs.module.fhir2.model.FhirDiagnosticReport)65 IBundleProvider (ca.uhn.fhir.rest.api.server.IBundleProvider)52 MockHttpServletResponse (org.springframework.mock.web.MockHttpServletResponse)50 SearchParameterMap (org.openmrs.module.fhir2.api.search.param.SearchParameterMap)42 Test (org.junit.jupiter.api.Test)39 BaseModuleContextSensitiveTest (org.openmrs.test.BaseModuleContextSensitiveTest)39 DiagnosticReport (org.hl7.fhir.dstu3.model.DiagnosticReport)32 IBaseResource (org.hl7.fhir.instance.model.api.IBaseResource)29 ReferenceAndListParam (ca.uhn.fhir.rest.param.ReferenceAndListParam)28 ReferenceOrListParam (ca.uhn.fhir.rest.param.ReferenceOrListParam)28 ReferenceParam (ca.uhn.fhir.rest.param.ReferenceParam)28 BundleEntryComponent (org.hl7.fhir.r4.model.Bundle.BundleEntryComponent)19 Reference (org.hl7.fhir.r4.model.Reference)19 Bundle (org.hl7.fhir.r4.model.Bundle)18 Resource (org.hl7.fhir.r4.model.Resource)18 CodeableConcept (org.hl7.fhir.r4.model.CodeableConcept)16 Include (ca.uhn.fhir.model.api.Include)12 HashSet (java.util.HashSet)12