Search in sources :

Example 26 with ConceptMap

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

the class NarrativeGenerator method addMapHeaders.

private void addMapHeaders(XhtmlNode tr, Map<ConceptMap, String> mymaps) {
    for (ConceptMap m : mymaps.keySet()) {
        XhtmlNode td = tr.addTag("td");
        XhtmlNode b = td.addTag("b");
        XhtmlNode a = b.addTag("a");
        a.setAttribute("href", prefix + mymaps.get(m));
        a.addText(m.hasDescription() ? m.getDescription() : m.getName());
    }
}
Also used : ConceptMap(org.hl7.fhir.dstu2016may.model.ConceptMap) XhtmlNode(org.hl7.fhir.utilities.xhtml.XhtmlNode)

Example 27 with ConceptMap

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

the class RdfParser method composeConceptMapOtherElementComponent.

protected void composeConceptMapOtherElementComponent(Complex parent, String parentType, String name, ConceptMap.OtherElementComponent element, int index) {
    if (element == null)
        return;
    Complex t;
    if (Utilities.noString(parentType))
        t = parent;
    else {
        t = parent.predicate("fhir:" + parentType + '.' + name);
    }
    composeBackboneElement(t, "dependsOn", name, element, index);
    if (element.hasPropertyElement())
        composeUri(t, "ConceptMap", "property", element.getPropertyElement(), -1);
    if (element.hasSystemElement())
        composeUri(t, "ConceptMap", "system", element.getSystemElement(), -1);
    if (element.hasCodeElement())
        composeString(t, "ConceptMap", "code", element.getCodeElement(), -1);
    if (element.hasDisplayElement())
        composeString(t, "ConceptMap", "display", element.getDisplayElement(), -1);
}
Also used : Complex(org.hl7.fhir.dstu3.utils.formats.Turtle.Complex)

Example 28 with ConceptMap

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

the class ConceptMap14_40 method getGroup.

public static ConceptMapGroupComponent getGroup(ConceptMap map, String srcs, String tgts) {
    for (ConceptMapGroupComponent grp : map.getGroup()) {
        if (grp.getSource().equals(srcs) && grp.getTarget().equals(tgts))
            return grp;
    }
    ConceptMapGroupComponent grp = map.addGroup();
    grp.setSource(srcs);
    grp.setTarget(tgts);
    return grp;
}
Also used : ConceptMapGroupComponent(org.hl7.fhir.r4.model.ConceptMap.ConceptMapGroupComponent)

Example 29 with ConceptMap

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

the class ConceptMap10_40 method getGroup.

public static ConceptMapGroupComponent getGroup(ConceptMap map, String srcs, String tgts) {
    for (ConceptMapGroupComponent grp : map.getGroup()) {
        if (grp.getSource().equals(srcs) && grp.getTarget().equals(tgts))
            return grp;
    }
    ConceptMapGroupComponent grp = map.addGroup();
    grp.setSource(srcs);
    grp.setTarget(tgts);
    return grp;
}
Also used : ConceptMapGroupComponent(org.hl7.fhir.r4.model.ConceptMap.ConceptMapGroupComponent)

Example 30 with ConceptMap

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

the class FHIRToolingClient method updateClosure.

public ConceptMap updateClosure(String name, Coding coding) {
    Parameters params = new Parameters();
    params.addParameter().setName("name").setValue(new StringType(name));
    params.addParameter().setName("concept").setValue(coding);
    List<Header> headers = null;
    ResourceRequest<Resource> result = utils.issuePostRequest(resourceAddress.resolveOperationUri(null, "closure", new HashMap<String, String>()), utils.getResourceAsByteArray(params, false, isJson(getPreferredResourceFormat())), getPreferredResourceFormat(), headers, TIMEOUT_OPERATION);
    // gone
    result.addErrorStatus(410);
    // unknown
    result.addErrorStatus(404);
    result.addErrorStatus(405);
    // Unprocessable Entity
    result.addErrorStatus(422);
    result.addSuccessStatus(200);
    result.addSuccessStatus(201);
    if (result.isUnsuccessfulRequest()) {
        throw new EFhirClientException("Server returned error code " + result.getHttpStatus(), (OperationOutcome) result.getPayload());
    }
    return (ConceptMap) result.getPayload();
}
Also used : Parameters(org.hl7.fhir.dstu2.model.Parameters) Header(org.apache.http.Header) StringType(org.hl7.fhir.dstu2.model.StringType) HashMap(java.util.HashMap) Resource(org.hl7.fhir.dstu2.model.Resource) ConceptMap(org.hl7.fhir.dstu2.model.ConceptMap)

Aggregations

ConceptMap (org.hl7.fhir.dstu3.model.ConceptMap)34 Test (org.junit.Test)31 ArrayList (java.util.ArrayList)29 HashMap (java.util.HashMap)27 FHIRException (org.hl7.fhir.exceptions.FHIRException)26 ConceptMap (org.hl7.fhir.r4.model.ConceptMap)23 XhtmlNode (org.hl7.fhir.utilities.xhtml.XhtmlNode)23 ConceptMap (org.hl7.fhir.r5.model.ConceptMap)22 ConceptMapGroupComponent (org.hl7.fhir.r5.model.ConceptMap.ConceptMapGroupComponent)17 ConceptMapGroupComponent (org.hl7.fhir.dstu3.model.ConceptMap.ConceptMapGroupComponent)15 HashSet (java.util.HashSet)13 ConceptMapGroupComponent (org.hl7.fhir.r4.model.ConceptMap.ConceptMapGroupComponent)13 StructureDefinition (org.hl7.fhir.r5.model.StructureDefinition)12 FileOutputStream (java.io.FileOutputStream)11 ValueSet (org.hl7.fhir.r5.model.ValueSet)11 SourceElementComponent (org.hl7.fhir.dstu3.model.ConceptMap.SourceElementComponent)10 Test (org.junit.jupiter.api.Test)10 ConceptMap (org.hl7.fhir.dstu2016may.model.ConceptMap)9 Coding (org.hl7.fhir.r4.model.Coding)9 SourceElementComponent (org.hl7.fhir.r4.model.ConceptMap.SourceElementComponent)9