Search in sources :

Example 46 with CapabilityStatement

use of org.hl7.fhir.r4.model.CapabilityStatement in project org.hl7.fhir.core by hapifhir.

the class RdfParser method composeCapabilityStatementCapabilityStatementRestResourceSearchParamComponent.

protected void composeCapabilityStatementCapabilityStatementRestResourceSearchParamComponent(Complex parent, String parentType, String name, CapabilityStatement.CapabilityStatementRestResourceSearchParamComponent element, int index) {
    if (element == null)
        return;
    Complex t;
    if (Utilities.noString(parentType))
        t = parent;
    else {
        t = parent.predicate("fhir:" + parentType + '.' + name);
    }
    composeBackboneElement(t, "searchParam", name, element, index);
    if (element.hasNameElement())
        composeString(t, "CapabilityStatement", "name", element.getNameElement(), -1);
    if (element.hasDefinitionElement())
        composeCanonical(t, "CapabilityStatement", "definition", element.getDefinitionElement(), -1);
    if (element.hasTypeElement())
        composeEnum(t, "CapabilityStatement", "type", element.getTypeElement(), -1);
    if (element.hasDocumentationElement())
        composeMarkdown(t, "CapabilityStatement", "documentation", element.getDocumentationElement(), -1);
}
Also used : Complex(org.hl7.fhir.r4.utils.formats.Turtle.Complex)

Example 47 with CapabilityStatement

use of org.hl7.fhir.r4.model.CapabilityStatement in project org.hl7.fhir.core by hapifhir.

the class RdfParser method composeCapabilityStatement.

protected void composeCapabilityStatement(Complex parent, String parentType, String name, CapabilityStatement element, int index) {
    if (element == null)
        return;
    Complex t;
    if (Utilities.noString(parentType))
        t = parent;
    else {
        t = parent.predicate("fhir:" + parentType + '.' + name);
    }
    composeDomainResource(t, "CapabilityStatement", name, element, index);
    if (element.hasUrlElement())
        composeUri(t, "CapabilityStatement", "url", element.getUrlElement(), -1);
    if (element.hasVersionElement())
        composeString(t, "CapabilityStatement", "version", element.getVersionElement(), -1);
    if (element.hasNameElement())
        composeString(t, "CapabilityStatement", "name", element.getNameElement(), -1);
    if (element.hasTitleElement())
        composeString(t, "CapabilityStatement", "title", element.getTitleElement(), -1);
    if (element.hasStatusElement())
        composeEnum(t, "CapabilityStatement", "status", element.getStatusElement(), -1);
    if (element.hasExperimentalElement())
        composeBoolean(t, "CapabilityStatement", "experimental", element.getExperimentalElement(), -1);
    if (element.hasDateElement())
        composeDateTime(t, "CapabilityStatement", "date", element.getDateElement(), -1);
    if (element.hasPublisherElement())
        composeString(t, "CapabilityStatement", "publisher", element.getPublisherElement(), -1);
    for (int i = 0; i < element.getContact().size(); i++) composeContactDetail(t, "CapabilityStatement", "contact", element.getContact().get(i), i);
    if (element.hasDescriptionElement())
        composeMarkdown(t, "CapabilityStatement", "description", element.getDescriptionElement(), -1);
    for (int i = 0; i < element.getUseContext().size(); i++) composeUsageContext(t, "CapabilityStatement", "useContext", element.getUseContext().get(i), i);
    for (int i = 0; i < element.getJurisdiction().size(); i++) composeCodeableConcept(t, "CapabilityStatement", "jurisdiction", element.getJurisdiction().get(i), i);
    if (element.hasPurposeElement())
        composeMarkdown(t, "CapabilityStatement", "purpose", element.getPurposeElement(), -1);
    if (element.hasCopyrightElement())
        composeMarkdown(t, "CapabilityStatement", "copyright", element.getCopyrightElement(), -1);
    if (element.hasKindElement())
        composeEnum(t, "CapabilityStatement", "kind", element.getKindElement(), -1);
    for (int i = 0; i < element.getInstantiates().size(); i++) composeCanonical(t, "CapabilityStatement", "instantiates", element.getInstantiates().get(i), i);
    for (int i = 0; i < element.getImports().size(); i++) composeCanonical(t, "CapabilityStatement", "imports", element.getImports().get(i), i);
    if (element.hasSoftware())
        composeCapabilityStatementCapabilityStatementSoftwareComponent(t, "CapabilityStatement", "software", element.getSoftware(), -1);
    if (element.hasImplementation())
        composeCapabilityStatementCapabilityStatementImplementationComponent(t, "CapabilityStatement", "implementation", element.getImplementation(), -1);
    if (element.hasFhirVersionElement())
        composeEnum(t, "CapabilityStatement", "fhirVersion", element.getFhirVersionElement(), -1);
    for (int i = 0; i < element.getFormat().size(); i++) composeCode(t, "CapabilityStatement", "format", element.getFormat().get(i), i);
    for (int i = 0; i < element.getPatchFormat().size(); i++) composeCode(t, "CapabilityStatement", "patchFormat", element.getPatchFormat().get(i), i);
    for (int i = 0; i < element.getImplementationGuide().size(); i++) composeCanonical(t, "CapabilityStatement", "implementationGuide", element.getImplementationGuide().get(i), i);
    for (int i = 0; i < element.getRest().size(); i++) composeCapabilityStatementCapabilityStatementRestComponent(t, "CapabilityStatement", "rest", element.getRest().get(i), i);
    for (int i = 0; i < element.getMessaging().size(); i++) composeCapabilityStatementCapabilityStatementMessagingComponent(t, "CapabilityStatement", "messaging", element.getMessaging().get(i), i);
    for (int i = 0; i < element.getDocument().size(); i++) composeCapabilityStatementCapabilityStatementDocumentComponent(t, "CapabilityStatement", "document", element.getDocument().get(i), i);
}
Also used : Complex(org.hl7.fhir.r4.utils.formats.Turtle.Complex)

Example 48 with CapabilityStatement

use of org.hl7.fhir.r4.model.CapabilityStatement in project org.hl7.fhir.core by hapifhir.

the class RdfParser method composeCapabilityStatementCapabilityStatementMessagingSupportedMessageComponent.

protected void composeCapabilityStatementCapabilityStatementMessagingSupportedMessageComponent(Complex parent, String parentType, String name, CapabilityStatement.CapabilityStatementMessagingSupportedMessageComponent element, int index) {
    if (element == null)
        return;
    Complex t;
    if (Utilities.noString(parentType))
        t = parent;
    else {
        t = parent.predicate("fhir:" + parentType + '.' + name);
    }
    composeBackboneElement(t, "supportedMessage", name, element, index);
    if (element.hasModeElement())
        composeEnum(t, "CapabilityStatement", "mode", element.getModeElement(), -1);
    if (element.hasDefinitionElement())
        composeCanonical(t, "CapabilityStatement", "definition", element.getDefinitionElement(), -1);
}
Also used : Complex(org.hl7.fhir.r4.utils.formats.Turtle.Complex)

Example 49 with CapabilityStatement

use of org.hl7.fhir.r4.model.CapabilityStatement in project org.hl7.fhir.core by hapifhir.

the class CapabilityStatementComparer method compare.

public CapabilityStatementComparison compare(CapabilityStatement left, CapabilityStatement right) {
    if (left == null)
        throw new DefinitionException("No CapabilityStatement provided (left)");
    if (right == null)
        throw new DefinitionException("No CapabilityStatement provided (right)");
    CapabilityStatementComparison res = new CapabilityStatementComparison(left, right);
    session.identify(res);
    CapabilityStatement cs = new CapabilityStatement();
    res.setUnion(cs);
    session.identify(cs);
    cs.setName("Union" + left.getName() + "And" + right.getName());
    cs.setTitle("Union of " + left.getTitle() + " And " + right.getTitle());
    cs.setStatus(left.getStatus());
    cs.setDate(new Date());
    CapabilityStatement cs1 = new CapabilityStatement();
    res.setIntersection(cs1);
    session.identify(cs1);
    cs1.setName("Intersection" + left.getName() + "And" + right.getName());
    cs1.setTitle("Intersection of " + left.getTitle() + " And " + right.getTitle());
    cs1.setStatus(left.getStatus());
    cs1.setDate(new Date());
    compareMetadata(left, right, res.getMetadata(), res);
    comparePrimitives("kind", left.getKindElement(), right.getKindElement(), res.getMetadata(), IssueSeverity.ERROR, res);
    compareCanonicalList("instantiates", left.getInstantiates(), right.getInstantiates(), res.getMetadata(), IssueSeverity.ERROR, res, cs.getInstantiates(), cs1.getInstantiates());
    compareCanonicalList("imports", left.getImports(), right.getImports(), res.getMetadata(), IssueSeverity.ERROR, res, cs.getImports(), cs1.getImports());
    comparePrimitives("software.name", left.getSoftware().getNameElement(), right.getSoftware().getNameElement(), res.getMetadata(), IssueSeverity.ERROR, res);
    comparePrimitives("software.version", left.getSoftware().getVersionElement(), right.getSoftware().getVersionElement(), res.getMetadata(), IssueSeverity.ERROR, res);
    comparePrimitives("software.releaseDate", left.getSoftware().getReleaseDateElement(), right.getSoftware().getReleaseDateElement(), res.getMetadata(), IssueSeverity.ERROR, res);
    comparePrimitives("implementation.description", left.getImplementation().getDescriptionElement(), right.getImplementation().getDescriptionElement(), res.getMetadata(), IssueSeverity.ERROR, res);
    comparePrimitives("implementation.url", left.getImplementation().getUrlElement(), right.getImplementation().getUrlElement(), res.getMetadata(), IssueSeverity.ERROR, res);
    comparePrimitives("fhirVersion", left.getFhirVersionElement(), right.getFhirVersionElement(), res.getMetadata(), IssueSeverity.ERROR, res);
    compareCodeList("format", left.getFormat(), right.getFormat(), res.getMetadata(), IssueSeverity.ERROR, res, cs.getFormat(), cs1.getFormat());
    compareCodeList("patchFormat", left.getPatchFormat(), right.getPatchFormat(), res.getMetadata(), IssueSeverity.ERROR, res, cs.getPatchFormat(), cs1.getPatchFormat());
    compareCanonicalList("implementationGuide", left.getImplementationGuide(), right.getImplementationGuide(), res.getMetadata(), IssueSeverity.ERROR, res, cs.getImplementationGuide(), cs1.getImplementationGuide());
    compareRests(left.getRest(), right.getRest(), res.getCombined(), res.getUnion().getRest(), res.getIntersection().getRest(), res.getUnion(), res.getIntersection(), res, "CapabilityStatement.rest");
    return res;
}
Also used : CapabilityStatement(org.hl7.fhir.r4b.model.CapabilityStatement) DefinitionException(org.hl7.fhir.exceptions.DefinitionException) Date(java.util.Date)

Example 50 with CapabilityStatement

use of org.hl7.fhir.r4.model.CapabilityStatement in project org.hl7.fhir.core by hapifhir.

the class CapabilityStatementComparer method compareRestSecurityService.

private void compareRestSecurityService(CapabilityStatementRestSecurityComponent left, CapabilityStatementRestSecurityComponent right, StructuralMatch<Element> combined, CapabilityStatementRestSecurityComponent union, CapabilityStatementRestSecurityComponent intersection, CapabilityStatement csU, CapabilityStatement csI, CapabilityStatementComparison res, String path) {
    List<CodeableConcept> matchR = new ArrayList<>();
    for (CodeableConcept l : left.getService()) {
        CodeableConcept r = findInList(right.getService(), l);
        if (r == null) {
            union.getService().add(l);
            combined.getChildren().add(new StructuralMatch<Element>(l, vmI(IssueSeverity.INFORMATION, "Removed this item", path)));
        } else {
            matchR.add(r);
            CodeableConcept cdM = CodeableConcept.merge(l, r);
            CodeableConcept cdI = CodeableConcept.intersect(l, r);
            union.getService().add(cdM);
            intersection.getService().add(cdI);
            StructuralMatch<Element> sm = new StructuralMatch<Element>(l, r);
            compare(sm, l, r, path, res);
            combined.getChildren().add(sm);
        }
    }
    for (CodeableConcept r : right.getService()) {
        if (!matchR.contains(r)) {
            union.getService().add(r);
            combined.getChildren().add(new StructuralMatch<Element>(vmI(IssueSeverity.INFORMATION, "Added this concept", path), r));
        }
    }
}
Also used : BackboneElement(org.hl7.fhir.r4b.model.BackboneElement) Element(org.hl7.fhir.r4b.model.Element) ArrayList(java.util.ArrayList) CodeableConcept(org.hl7.fhir.r4b.model.CodeableConcept)

Aggregations

CapabilityStatement (org.hl7.fhir.r4.model.CapabilityStatement)39 Test (org.junit.Test)24 Patient (org.hl7.fhir.r4.model.Patient)22 Library (org.hl7.fhir.r4.model.Library)20 Measure (org.hl7.fhir.r4.model.Measure)20 MeasureReport (org.hl7.fhir.r4.model.MeasureReport)18 ArrayList (java.util.ArrayList)17 Complex (org.hl7.fhir.dstu3.utils.formats.Turtle.Complex)16 MeasureEvidenceOptions (com.ibm.cohort.engine.measure.evidence.MeasureEvidenceOptions)15 Complex (org.hl7.fhir.r4.utils.formats.Turtle.Complex)14 CapabilityStatement (org.hl7.fhir.dstu3.model.CapabilityStatement)13 HashMap (java.util.HashMap)12 Test (org.junit.jupiter.api.Test)11 Date (java.util.Date)10 DefinitionException (org.hl7.fhir.exceptions.DefinitionException)10 StringType (org.hl7.fhir.r4.model.StringType)10 CodeableConcept (org.hl7.fhir.r4.model.CodeableConcept)9 Coding (org.hl7.fhir.r4.model.Coding)9 CapabilityStatement (org.hl7.fhir.r5.model.CapabilityStatement)9 Extension (org.hl7.fhir.r4.model.Extension)8