Search in sources :

Example 16 with UriType

use of org.hl7.fhir.r4b.model.UriType in project elexis-server by elexis.

the class ServerCapabilityStatementProvider method getSmartOnFhirCapabilityStatementRestSecurityComponent.

private CapabilityStatementRestSecurityComponent getSmartOnFhirCapabilityStatementRestSecurityComponent(HttpServletRequest theRequest) {
    CapabilityStatementRestSecurityComponent csrsc = new CapabilityStatementRestSecurityComponent();
    CodeableConcept smartOnFhirConcept = new CodeableConcept();
    Coding coding = new Coding();
    coding.setSystem("http://hl7.org/fhir/restful-security-service");
    coding.setCode("SMART-on-FHIR");
    smartOnFhirConcept.addCoding(coding);
    smartOnFhirConcept.setText("OAuth2 using SMART-on-FHIR profile (see http://docs.smarthealthit.org)");
    Extension oauthExtension = new Extension();
    oauthExtension.setUrl("http://fhir-registry.smarthealthit.org/StructureDefinition/oauth-uris");
    Extension oauthTokenExtension = new Extension();
    oauthTokenExtension.setUrl("token");
    oauthTokenExtension.setValue(new UriType(keycloakDeployment.getTokenUrl()));
    oauthExtension.getExtension().add(oauthTokenExtension);
    // Extension oauthAuthorizeExtension = new Extension();
    // oauthAuthorizeExtension.setUrl("authorize");
    // oauthAuthorizeExtension.setValue(new UriType(keycloakDeployment.getAuthUrl()));
    // oauthExtension.getExtension().add(oauthAuthorizeExtension);
    // 
    // oauthRegisterExtension.setUrl("register");
    // oauthRegisterExtension.setValue(new UriType(baseUrl + "/openid/register"));
    // oauthExtension.getExtension().add(oauthRegisterExtension);
    // 
    // Extension oauthManageExtension = new Extension();
    // oauthManageExtension.setUrl("manage");
    // oauthManageExtension.setValue(new UriType(baseUrl + "/openid/manage"));
    // oauthExtension.getExtension().add(oauthManageExtension);
    csrsc.getService().add(smartOnFhirConcept);
    csrsc.getExtension().add(oauthExtension);
    return csrsc;
}
Also used : Extension(org.hl7.fhir.r4.model.Extension) Coding(org.hl7.fhir.r4.model.Coding) CapabilityStatementRestSecurityComponent(org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestSecurityComponent) CodeableConcept(org.hl7.fhir.r4.model.CodeableConcept) UriType(org.hl7.fhir.r4.model.UriType)

Example 17 with UriType

use of org.hl7.fhir.r4b.model.UriType in project org.hl7.fhir.core by hapifhir.

the class ClinicalImpression10_30 method convertClinicalImpression.

public static org.hl7.fhir.dstu2.model.ClinicalImpression convertClinicalImpression(org.hl7.fhir.dstu3.model.ClinicalImpression src) throws FHIRException {
    if (src == null || src.isEmpty())
        return null;
    org.hl7.fhir.dstu2.model.ClinicalImpression tgt = new org.hl7.fhir.dstu2.model.ClinicalImpression();
    ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyDomainResource(src, tgt);
    if (src.hasSubject())
        tgt.setPatient(Reference10_30.convertReference(src.getSubject()));
    if (src.hasAssessor())
        tgt.setAssessor(Reference10_30.convertReference(src.getAssessor()));
    if (src.hasStatus())
        tgt.setStatusElement(convertClinicalImpressionStatus(src.getStatusElement()));
    if (src.hasDate())
        tgt.setDateElement(DateTime10_30.convertDateTime(src.getDateElement()));
    if (src.hasDescriptionElement())
        tgt.setDescriptionElement(String10_30.convertString(src.getDescriptionElement()));
    if (src.hasPrevious())
        tgt.setPrevious(Reference10_30.convertReference(src.getPrevious()));
    for (org.hl7.fhir.dstu3.model.Reference t : src.getProblem()) tgt.addProblem(Reference10_30.convertReference(t));
    for (UriType t : src.getProtocol()) tgt.setProtocol(t.asStringValue());
    if (src.hasSummaryElement())
        tgt.setSummaryElement(String10_30.convertString(src.getSummaryElement()));
    for (org.hl7.fhir.dstu3.model.ClinicalImpression.ClinicalImpressionFindingComponent t : src.getFinding()) tgt.addFinding(convertClinicalImpressionFindingComponent(t));
    if (src.hasText())
        tgt.setPrognosis(src.getPrognosisCodeableConceptFirstRep().getText());
    for (org.hl7.fhir.dstu3.model.Reference t : src.getAction()) tgt.addAction(Reference10_30.convertReference(t));
    return tgt;
}
Also used : UriType(org.hl7.fhir.dstu3.model.UriType)

Example 18 with UriType

use of org.hl7.fhir.r4b.model.UriType in project org.hl7.fhir.core by hapifhir.

the class Provenance30_40 method convertProvenanceAgentComponent.

public static org.hl7.fhir.r4.model.Provenance.ProvenanceAgentComponent convertProvenanceAgentComponent(org.hl7.fhir.dstu3.model.Provenance.ProvenanceAgentComponent src) throws FHIRException {
    if (src == null)
        return null;
    org.hl7.fhir.r4.model.Provenance.ProvenanceAgentComponent tgt = new org.hl7.fhir.r4.model.Provenance.ProvenanceAgentComponent();
    ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt);
    for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getRole()) tgt.addRole(CodeableConcept30_40.convertCodeableConcept(t));
    if (src.hasWho()) {
        Type t = ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().convertType(src.getWho());
        if (t instanceof Reference)
            tgt.setWho((Reference) t);
        if (t instanceof UriType)
            tgt.getWho().setReference(t.primitiveValue());
    }
    if (src.hasOnBehalfOf()) {
        Type t = ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().convertType(src.getOnBehalfOf());
        if (t instanceof Reference)
            tgt.setOnBehalfOf((Reference) t);
        if (t instanceof UriType)
            tgt.getOnBehalfOf().setReference(t.primitiveValue());
    }
    return tgt;
}
Also used : Type(org.hl7.fhir.r4.model.Type) UriType(org.hl7.fhir.r4.model.UriType) Reference(org.hl7.fhir.r4.model.Reference) UriType(org.hl7.fhir.r4.model.UriType)

Example 19 with UriType

use of org.hl7.fhir.r4b.model.UriType in project org.hl7.fhir.core by hapifhir.

the class IEEE11073Convertor method generateLoincMdcMap.

private static ConceptMap generateLoincMdcMap(CodeSystem mdc, String dst, String src) throws IOException, FHIRException {
    ConceptMap cm = new ConceptMap();
    cm.setId("loinc-mdc");
    cm.setUrl("http:/???/fhir/ConceptMap/loinc-mdc");
    cm.setVersion("[todo]");
    cm.setName("LoincMdcCrossMap");
    cm.setTitle("Cross Map between LOINC and MDC");
    cm.setStatus(PublicationStatus.DRAFT);
    cm.setExperimental(true);
    cm.setDateElement(new DateTimeType());
    cm.setPublisher("HL7, Inc");
    ContactDetail cd = cm.addContact();
    cd.setName("LOINC + IEEE");
    ContactPoint cp = cd.addTelecom();
    cp.setSystem(ContactPointSystem.URL);
    cp.setValue("http://loinc.org");
    cm.setDescription("A Cross Map between the LOINC and MDC Code systems");
    cm.setPurpose("To implementers map between medical device codes and LOINC codes");
    cm.setCopyright("This content LOINC \u00ae is copyright \u00a9 1995 Regenstrief Institute, Inc. and the LOINC Committee, and available at no cost under the license at http://loinc.org/terms-of-use");
    cm.setSource(new UriType("http://loinc.org/vs"));
    cm.setTarget(new UriType(MDC_ALL_VALUES));
    ConceptMapGroupComponent g = cm.addGroup();
    g.setSource("urn:iso:std:iso:11073:10101");
    g.setTarget("http://loinc.org");
    CSVReader csv = new CSVReader(new FileInputStream(src));
    csv.readHeaders();
    while (csv.line()) {
        SourceElementComponent e = g.addElement();
        e.setCode(csv.cell("IEEE_CF_CODE10"));
        e.setDisplay(csv.cell("IEEE_DESCRIPTION"));
        TargetElementComponent t = e.addTarget();
        t.setEquivalence(ConceptMapEquivalence.EQUIVALENT);
        t.setCode(csv.cell("LOINC_NUM"));
        t.setDisplay(csv.cell("LOINC_LONG_COMMON_NAME"));
    }
    new XmlParser().setOutputStyle(OutputStyle.PRETTY).compose(new FileOutputStream(Utilities.path(dst, "conceptmap-" + cm.getId() + ".xml")), cm);
    System.out.println("Done");
    return cm;
}
Also used : XmlParser(org.hl7.fhir.dstu3.formats.XmlParser) CSVReader(org.hl7.fhir.utilities.CSVReader) FileOutputStream(java.io.FileOutputStream) TargetElementComponent(org.hl7.fhir.dstu3.model.ConceptMap.TargetElementComponent) ConceptMapGroupComponent(org.hl7.fhir.dstu3.model.ConceptMap.ConceptMapGroupComponent) FileInputStream(java.io.FileInputStream) SourceElementComponent(org.hl7.fhir.dstu3.model.ConceptMap.SourceElementComponent)

Example 20 with UriType

use of org.hl7.fhir.r4b.model.UriType in project org.hl7.fhir.core by hapifhir.

the class ISO21090Importer method produceProperties.

private void produceProperties(List<ElementDefinition> elements, String name, List<Property> properties, boolean attrMode, boolean snapshot) throws FHIRFormatError {
    for (Property p : properties) {
        if (p.isIsattr() == attrMode) {
            ElementDefinition ed = new ElementDefinition();
            elements.add(ed);
            ed.setPath(name + "." + p.getName());
            if (p.getType().startsWith("xsd:"))
                ToolingExtensions.addStringExtension(ed.addType(), ToolingExtensions.EXT_XML_TYPE, p.getType());
            else
                ed.addType().setCode(p.getType());
            ed.setMin(p.getMin());
            ed.setMax(p.getMax() == Integer.MAX_VALUE ? "*" : Integer.toString(p.getMax()));
            ed.setDefinition(p.getDoco());
            if (p.isIsattr())
                ed.addRepresentation(PropertyRepresentation.XMLATTR);
            if (p.getBinding() != null)
                ed.getBinding().setStrength(BindingStrength.REQUIRED).setValueSet(new UriType("http://hl7.org/fhir/iso21090/ValueSet/" + p.getBinding()));
            if (snapshot)
                ed.getBase().setPath(ed.getPath()).setMin(ed.getMin()).setMax(ed.getMax());
        }
    }
}
Also used : ElementDefinition(org.hl7.fhir.dstu3.model.ElementDefinition) UriType(org.hl7.fhir.dstu3.model.UriType)

Aggregations

FHIRException (org.hl7.fhir.exceptions.FHIRException)60 UriType (org.hl7.fhir.r5.model.UriType)45 ArrayList (java.util.ArrayList)42 UriType (org.hl7.fhir.r4.model.UriType)41 UriType (org.hl7.fhir.r4b.model.UriType)29 UriType (org.hl7.fhir.dstu3.model.UriType)26 CommaSeparatedStringBuilder (org.hl7.fhir.utilities.CommaSeparatedStringBuilder)24 StructureDefinition (org.hl7.fhir.r5.model.StructureDefinition)22 ElementDefinition (org.hl7.fhir.r5.model.ElementDefinition)19 List (java.util.List)17 XhtmlNode (org.hl7.fhir.utilities.xhtml.XhtmlNode)16 NotImplementedException (org.apache.commons.lang3.NotImplementedException)15 TypeRefComponent (org.hl7.fhir.r5.model.ElementDefinition.TypeRefComponent)14 UriType (org.hl7.fhir.dstu2016may.model.UriType)12 FHIRFormatError (org.hl7.fhir.exceptions.FHIRFormatError)12 Coding (org.hl7.fhir.r4.model.Coding)12 IOException (java.io.IOException)11 StringType (org.hl7.fhir.r4.model.StringType)10 org.hl7.fhir.r5.model (org.hl7.fhir.r5.model)10 StringType (org.hl7.fhir.r5.model.StringType)10