Search in sources :

Example 16 with DataElement

use of org.hl7.fhir.dstu2.model.DataElement in project org.hl7.fhir.core by hapifhir.

the class RdfParser method composeDataElementDataElementMappingComponent.

protected void composeDataElementDataElementMappingComponent(Complex parent, String parentType, String name, DataElement.DataElementMappingComponent element, int index) {
    if (element == null)
        return;
    Complex t;
    if (Utilities.noString(parentType))
        t = parent;
    else {
        t = parent.predicate("fhir:" + parentType + '.' + name);
    }
    composeBackboneElement(t, "mapping", name, element, index);
    if (element.hasIdentityElement())
        composeId(t, "DataElement", "identity", element.getIdentityElement(), -1);
    if (element.hasUriElement())
        composeUri(t, "DataElement", "uri", element.getUriElement(), -1);
    if (element.hasNameElement())
        composeString(t, "DataElement", "name", element.getNameElement(), -1);
    if (element.hasCommentElement())
        composeString(t, "DataElement", "comment", element.getCommentElement(), -1);
}
Also used : Complex(org.hl7.fhir.dstu2016may.formats.RdfGenerator.Complex)

Example 17 with DataElement

use of org.hl7.fhir.dstu2.model.DataElement in project org.hl7.fhir.core by hapifhir.

the class LoincToDEConvertor method processLoincCodes.

private void processLoincCodes() {
    Element row = XMLUtil.getFirstChild(xml.getDocumentElement());
    int i = 0;
    while (row != null) {
        i++;
        if (i % 1000 == 0)
            System.out.print(".");
        String code = col(row, "LOINC_NUM");
        String comp = col(row, "COMPONENT");
        DataElement de = new DataElement();
        de.setId("loinc-" + code);
        de.setMeta(new Meta().setLastUpdatedElement(InstantType.now()));
        bundle.getEntry().add(new BundleEntryComponent().setResource(de));
        Identifier id = new Identifier();
        id.setSystem("http://hl7.org/fhir/commondataelement/loinc");
        id.setValue(code);
        de.addIdentifier(id);
        de.setPublisher("Regenstrief + FHIR Project Team");
        if (!col(row, "STATUS").equals("ACTIVE"))
            // till we get good at this
            de.setStatus(ConformanceResourceStatus.DRAFT);
        else
            de.setStatus(ConformanceResourceStatus.RETIRED);
        de.setDateElement(DateTimeType.now());
        de.setName(comp);
        ElementDefinition dee = de.addElement();
        // PROPERTY	ignore
        // TIME_ASPCT
        // SYSTEM
        // SCALE_TYP
        // METHOD_TYP
        // dee.getCategory().add(new CodeableConcept().setText(col(row, "CLASS")));
        // SOURCE
        // DATE_LAST_CHANGED - should be in ?
        // CHNG_TYPE
        dee.setComments(col(row, "COMMENTS"));
        if (hasCol(row, "CONSUMER_NAME"))
            dee.addAlias(col(row, "CONSUMER_NAME"));
        // SURVEY_QUEST_SRC
        if (hasCol(row, "RELATEDNAMES2")) {
            String n = col(row, "RELATEDNAMES2");
            for (String s : n.split("\\;")) {
                if (!Utilities.noString(s))
                    dee.addAlias(s);
            }
        }
        dee.addAlias(col(row, "SHORTNAME"));
        // ORDER_OBS
        // CDISC Code
        // HL7_FIELD_SUBFIELD_ID
        // ------------------ EXTERNAL_COPYRIGHT_NOTICE todo
        dee.setDefinition(col(row, "LONG_COMMON_NAME"));
        // HL7_V2_DATATYPE
        String cc = makeType(col(row, "HL7_V3_DATATYPE"), code);
        if (cc != null)
            dee.addType().setCode(cc);
        // todo... CURATED_RANGE_AND_UNITS
        // todo: DOCUMENT_SECTION
        // STATUS_REASON
        // STATUS_TEXT
        // CHANGE_REASON_PUBLIC
        // COMMON_TEST_RANK
        // COMMON_ORDER_RANK
        // COMMON_SI_TEST_RANK
        // HL7_ATTACHMENT_STRUCTURE
        // units:
        // UNITSREQUIRED
        // SUBMITTED_UNITS
        ToolingExtensions.setAllowableUnits(dee, makeUnits(col(row, "EXAMPLE_UNITS"), col(row, "EXAMPLE_UCUM_UNITS")));
        // EXAMPLE_SI_UCUM_UNITS
        row = XMLUtil.getNextSibling(row);
    }
    System.out.println("done");
}
Also used : DataElement(org.hl7.fhir.dstu2016may.model.DataElement) Meta(org.hl7.fhir.dstu2016may.model.Meta) BundleEntryComponent(org.hl7.fhir.dstu2016may.model.Bundle.BundleEntryComponent) Identifier(org.hl7.fhir.dstu2016may.model.Identifier) DataElement(org.hl7.fhir.dstu2016may.model.DataElement) Element(org.w3c.dom.Element) ElementDefinition(org.hl7.fhir.dstu2016may.model.ElementDefinition)

Example 18 with DataElement

use of org.hl7.fhir.dstu2.model.DataElement in project org.hl7.fhir.core by hapifhir.

the class TurtleTests method test_dataelement_example.

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

Example 19 with DataElement

use of org.hl7.fhir.dstu2.model.DataElement in project org.hl7.fhir.core by hapifhir.

the class RdfParser method composeDataElementDataElementContactComponent.

protected void composeDataElementDataElementContactComponent(Complex parent, String parentType, String name, DataElement.DataElementContactComponent element, int index) {
    if (element == null)
        return;
    Complex t;
    if (Utilities.noString(parentType))
        t = parent;
    else {
        t = parent.predicate("fhir:" + parentType + '.' + name);
    }
    composeBackboneElement(t, "contact", name, element, index);
    if (element.hasNameElement())
        composeString(t, "DataElement", "name", element.getNameElement(), -1);
    for (int i = 0; i < element.getTelecom().size(); i++) composeContactPoint(t, "DataElement", "telecom", element.getTelecom().get(i), i);
}
Also used : Complex(org.hl7.fhir.dstu2016may.formats.RdfGenerator.Complex)

Example 20 with DataElement

use of org.hl7.fhir.dstu2.model.DataElement in project org.hl7.fhir.core by hapifhir.

the class ResourceUtilities method renderDE.

private static void renderDE(DataElement de, List<String> cols, StringBuilder b, boolean profileLink, String linkBase) {
    b.append("<tr>");
    for (String col : cols) {
        String v;
        ElementDefinition dee = de.getElement().get(0);
        if (col.equals("DataElement.name")) {
            v = de.hasName() ? Utilities.escapeXml(de.getName()) : "";
        } else if (col.equals("DataElement.status")) {
            v = de.hasStatusElement() ? de.getStatusElement().asStringValue() : "";
        } else if (col.equals("DataElement.code")) {
            v = renderCoding(dee.getCode());
        } else if (col.equals("DataElement.type")) {
            v = dee.hasType() ? Utilities.escapeXml(dee.getType().get(0).getCode()) : "";
        } else if (col.equals("DataElement.units")) {
            v = renderDEUnits(ToolingExtensions.getAllowedUnits(dee));
        } else if (col.equals("DataElement.binding")) {
            v = renderBinding(dee.getBinding());
        } else if (col.equals("DataElement.minValue")) {
            v = ToolingExtensions.hasExtension(de, "http://hl7.org/fhir/StructureDefinition/minValue") ? Utilities.escapeXml(ToolingExtensions.readPrimitiveExtension(de, "http://hl7.org/fhir/StructureDefinition/minValue").asStringValue()) : "";
        } else if (col.equals("DataElement.maxValue")) {
            v = ToolingExtensions.hasExtension(de, "http://hl7.org/fhir/StructureDefinition/maxValue") ? Utilities.escapeXml(ToolingExtensions.readPrimitiveExtension(de, "http://hl7.org/fhir/StructureDefinition/maxValue").asStringValue()) : "";
        } else if (col.equals("DataElement.maxLength")) {
            v = ToolingExtensions.hasExtension(de, "http://hl7.org/fhir/StructureDefinition/maxLength") ? Utilities.escapeXml(ToolingExtensions.readPrimitiveExtension(de, "http://hl7.org/fhir/StructureDefinition/maxLength").asStringValue()) : "";
        } else if (col.equals("DataElement.mask")) {
            v = ToolingExtensions.hasExtension(de, "http://hl7.org/fhir/StructureDefinition/mask") ? Utilities.escapeXml(ToolingExtensions.readPrimitiveExtension(de, "http://hl7.org/fhir/StructureDefinition/mask").asStringValue()) : "";
        } else
            throw new Error("Unknown column name: " + col);
        b.append("<td>" + v + "</td>");
    }
    if (profileLink) {
        b.append("<td><a href=\"" + linkBase + "-" + de.getId() + ".html\">Profile</a>, <a href=\"http://www.opencem.org/#/20140917/Intermountain/" + de.getId() + "\">CEM</a>");
        if (ToolingExtensions.hasExtension(de, ToolingExtensions.EXT_CIMI_REFERENCE))
            b.append(", <a href=\"" + ToolingExtensions.readStringExtension(de, ToolingExtensions.EXT_CIMI_REFERENCE) + "\">CIMI</a>");
        b.append("</td>");
    }
    b.append("</tr>\r\n");
}
Also used : ElementDefinition(org.hl7.fhir.dstu3.model.ElementDefinition)

Aggregations

BundleEntryComponent (org.hl7.fhir.dstu2.model.Bundle.BundleEntryComponent)3 DataElement (org.hl7.fhir.dstu2.model.DataElement)3 Complex (org.hl7.fhir.dstu2016may.formats.RdfGenerator.Complex)3 BundleEntryComponent (org.hl7.fhir.dstu2016may.model.Bundle.BundleEntryComponent)3 DataElement (org.hl7.fhir.dstu2016may.model.DataElement)3 BundleEntryComponent (org.hl7.fhir.dstu3.model.Bundle.BundleEntryComponent)3 DataElement (org.hl7.fhir.dstu3.model.DataElement)3 CommaSeparatedStringBuilder (org.hl7.fhir.utilities.CommaSeparatedStringBuilder)3 ServiceException (com.prosysopc.ua.ServiceException)2 StatusException (com.prosysopc.ua.StatusException)2 AddressSpaceException (com.prosysopc.ua.client.AddressSpaceException)2 UaNodeFactoryException (com.prosysopc.ua.nodes.UaNodeFactoryException)2 ServiceResultException (com.prosysopc.ua.stack.common.ServiceResultException)2 MessageBusException (de.fraunhofer.iosb.ilt.faaast.service.exception.MessageBusException)2 DataElement (io.adminshell.aas.v3.model.DataElement)2 FileOutputStream (java.io.FileOutputStream)2 AASAnnotatedRelationshipElementType (opc.i4aas.AASAnnotatedRelationshipElementType)2 AASRelationshipElementType (opc.i4aas.AASRelationshipElementType)2 ElementDefinition (org.hl7.fhir.dstu2.model.ElementDefinition)2 ElementDefinition (org.hl7.fhir.dstu2016may.model.ElementDefinition)2