Search in sources :

Example 11 with Consent

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

the class RdfParser method composeResearchSubject.

protected void composeResearchSubject(Complex parent, String parentType, String name, ResearchSubject element, int index) {
    if (element == null)
        return;
    Complex t;
    if (Utilities.noString(parentType))
        t = parent;
    else {
        t = parent.predicate("fhir:" + parentType + '.' + name);
    }
    composeDomainResource(t, "ResearchSubject", name, element, index);
    if (element.hasIdentifier())
        composeIdentifier(t, "ResearchSubject", "identifier", element.getIdentifier(), -1);
    if (element.hasStatusElement())
        composeEnum(t, "ResearchSubject", "status", element.getStatusElement(), -1);
    if (element.hasPeriod())
        composePeriod(t, "ResearchSubject", "period", element.getPeriod(), -1);
    if (element.hasStudy())
        composeReference(t, "ResearchSubject", "study", element.getStudy(), -1);
    if (element.hasIndividual())
        composeReference(t, "ResearchSubject", "individual", element.getIndividual(), -1);
    if (element.hasAssignedArmElement())
        composeString(t, "ResearchSubject", "assignedArm", element.getAssignedArmElement(), -1);
    if (element.hasActualArmElement())
        composeString(t, "ResearchSubject", "actualArm", element.getActualArmElement(), -1);
    if (element.hasConsent())
        composeReference(t, "ResearchSubject", "consent", element.getConsent(), -1);
}
Also used : Complex(org.hl7.fhir.dstu3.utils.formats.Turtle.Complex)

Example 12 with Consent

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

the class RdfParser method composeConsentConsentDataComponent.

protected void composeConsentConsentDataComponent(Complex parent, String parentType, String name, Consent.ConsentDataComponent element, int index) {
    if (element == null)
        return;
    Complex t;
    if (Utilities.noString(parentType))
        t = parent;
    else {
        t = parent.predicate("fhir:" + parentType + '.' + name);
    }
    composeBackboneElement(t, "data", name, element, index);
    if (element.hasMeaningElement())
        composeEnum(t, "Consent", "meaning", element.getMeaningElement(), -1);
    if (element.hasReference())
        composeReference(t, "Consent", "reference", element.getReference(), -1);
}
Also used : Complex(org.hl7.fhir.dstu3.utils.formats.Turtle.Complex)

Example 13 with Consent

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

the class RdfParser method composeConsentConsentActorComponent.

protected void composeConsentConsentActorComponent(Complex parent, String parentType, String name, Consent.ConsentActorComponent element, int index) {
    if (element == null)
        return;
    Complex t;
    if (Utilities.noString(parentType))
        t = parent;
    else {
        t = parent.predicate("fhir:" + parentType + '.' + name);
    }
    composeBackboneElement(t, "actor", name, element, index);
    if (element.hasRole())
        composeCodeableConcept(t, "Consent", "role", element.getRole(), -1);
    if (element.hasReference())
        composeReference(t, "Consent", "reference", element.getReference(), -1);
}
Also used : Complex(org.hl7.fhir.dstu3.utils.formats.Turtle.Complex)

Example 14 with Consent

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

the class RdfParser method composeConsentprovisionDataComponent.

protected void composeConsentprovisionDataComponent(Complex parent, String parentType, String name, Consent.provisionDataComponent element, int index) {
    if (element == null)
        return;
    Complex t;
    if (Utilities.noString(parentType))
        t = parent;
    else {
        t = parent.predicate("fhir:" + parentType + '.' + name);
    }
    composeBackboneElement(t, "data", name, element, index);
    if (element.hasMeaningElement())
        composeEnum(t, "Consent", "meaning", element.getMeaningElement(), -1);
    if (element.hasReference())
        composeReference(t, "Consent", "reference", element.getReference(), -1);
}
Also used : Complex(org.hl7.fhir.r4.utils.formats.Turtle.Complex)

Example 15 with Consent

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

the class RdfParser method composeConsentprovisionComponent.

protected void composeConsentprovisionComponent(Complex parent, String parentType, String name, Consent.provisionComponent element, int index) {
    if (element == null)
        return;
    Complex t;
    if (Utilities.noString(parentType))
        t = parent;
    else {
        t = parent.predicate("fhir:" + parentType + '.' + name);
    }
    composeBackboneElement(t, "provision", name, element, index);
    if (element.hasTypeElement())
        composeEnum(t, "Consent", "type", element.getTypeElement(), -1);
    if (element.hasPeriod())
        composePeriod(t, "Consent", "period", element.getPeriod(), -1);
    for (int i = 0; i < element.getActor().size(); i++) composeConsentprovisionActorComponent(t, "Consent", "actor", element.getActor().get(i), i);
    for (int i = 0; i < element.getAction().size(); i++) composeCodeableConcept(t, "Consent", "action", element.getAction().get(i), i);
    for (int i = 0; i < element.getSecurityLabel().size(); i++) composeCoding(t, "Consent", "securityLabel", element.getSecurityLabel().get(i), i);
    for (int i = 0; i < element.getPurpose().size(); i++) composeCoding(t, "Consent", "purpose", element.getPurpose().get(i), i);
    for (int i = 0; i < element.getClass_().size(); i++) composeCoding(t, "Consent", "class", element.getClass_().get(i), i);
    for (int i = 0; i < element.getCode().size(); i++) composeCodeableConcept(t, "Consent", "code", element.getCode().get(i), i);
    if (element.hasDataPeriod())
        composePeriod(t, "Consent", "dataPeriod", element.getDataPeriod(), -1);
    for (int i = 0; i < element.getData().size(); i++) composeConsentprovisionDataComponent(t, "Consent", "data", element.getData().get(i), i);
    for (int i = 0; i < element.getProvision().size(); i++) composeConsentprovisionComponent(t, "Consent", "provision", element.getProvision().get(i), i);
}
Also used : Complex(org.hl7.fhir.r4.utils.formats.Turtle.Complex)

Aggregations

Consent (org.hl7.fhir.r4.model.Consent)15 Consent (org.hl7.fhir.dstu3.model.Consent)8 Complex (org.hl7.fhir.dstu3.utils.formats.Turtle.Complex)8 Complex (org.hl7.fhir.r4.utils.formats.Turtle.Complex)7 Test (org.junit.jupiter.api.Test)7 MethodOutcome (ca.uhn.fhir.rest.api.MethodOutcome)6 List (java.util.List)5 Bundle (org.hl7.fhir.r4.model.Bundle)5 Reference (org.hl7.fhir.r4.model.Reference)5 ResourceNotFoundException (ca.uhn.fhir.rest.server.exceptions.ResourceNotFoundException)4 ConsentEntity (gov.cms.dpc.common.consent.entities.ConsentEntity)4 Optional (java.util.Optional)4 Collectors (java.util.stream.Collectors)4 IIdType (org.hl7.fhir.instance.model.api.IIdType)4 ConsentCreateException (org.hl7.gravity.refimpl.sdohexchange.exception.ConsentCreateException)4 IGenericClient (ca.uhn.fhir.rest.client.api.IGenericClient)3 SmartOnFhirContext (com.healthlx.smartonfhir.core.SmartOnFhirContext)2 DPCIdentifierSystem (gov.cms.dpc.fhir.DPCIdentifierSystem)2 FHIR (gov.cms.dpc.fhir.annotations.FHIR)2 UnitOfWork (io.dropwizard.hibernate.UnitOfWork)2