Search in sources :

Example 41 with CONSENT

use of org.hl7.fhir.r4.model.codesystems.ResourceTypes.CONSENT in project org.hl7.fhir.core by hapifhir.

the class RdfParser method composeConsentExceptActorComponent.

protected void composeConsentExceptActorComponent(Complex parent, String parentType, String name, Consent.ExceptActorComponent 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 42 with CONSENT

use of org.hl7.fhir.r4.model.codesystems.ResourceTypes.CONSENT in project org.hl7.fhir.core by hapifhir.

the class RdfParser method composeConsent.

protected void composeConsent(Complex parent, String parentType, String name, Consent element, int index) {
    if (element == null)
        return;
    Complex t;
    if (Utilities.noString(parentType))
        t = parent;
    else {
        t = parent.predicate("fhir:" + parentType + '.' + name);
    }
    composeDomainResource(t, "Consent", name, element, index);
    if (element.hasIdentifier())
        composeIdentifier(t, "Consent", "identifier", element.getIdentifier(), -1);
    if (element.hasStatusElement())
        composeEnum(t, "Consent", "status", element.getStatusElement(), -1);
    for (int i = 0; i < element.getCategory().size(); i++) composeCodeableConcept(t, "Consent", "category", element.getCategory().get(i), i);
    if (element.hasPatient())
        composeReference(t, "Consent", "patient", element.getPatient(), -1);
    if (element.hasPeriod())
        composePeriod(t, "Consent", "period", element.getPeriod(), -1);
    if (element.hasDateTimeElement())
        composeDateTime(t, "Consent", "dateTime", element.getDateTimeElement(), -1);
    for (int i = 0; i < element.getConsentingParty().size(); i++) composeReference(t, "Consent", "consentingParty", element.getConsentingParty().get(i), i);
    for (int i = 0; i < element.getActor().size(); i++) composeConsentConsentActorComponent(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.getOrganization().size(); i++) composeReference(t, "Consent", "organization", element.getOrganization().get(i), i);
    if (element.hasSource())
        composeType(t, "Consent", "source", element.getSource(), -1);
    for (int i = 0; i < element.getPolicy().size(); i++) composeConsentConsentPolicyComponent(t, "Consent", "policy", element.getPolicy().get(i), i);
    if (element.hasPolicyRuleElement())
        composeUri(t, "Consent", "policyRule", element.getPolicyRuleElement(), -1);
    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);
    if (element.hasDataPeriod())
        composePeriod(t, "Consent", "dataPeriod", element.getDataPeriod(), -1);
    for (int i = 0; i < element.getData().size(); i++) composeConsentConsentDataComponent(t, "Consent", "data", element.getData().get(i), i);
    for (int i = 0; i < element.getExcept().size(); i++) composeConsentExceptComponent(t, "Consent", "except", element.getExcept().get(i), i);
}
Also used : Complex(org.hl7.fhir.dstu3.utils.formats.Turtle.Complex)

Example 43 with CONSENT

use of org.hl7.fhir.r4.model.codesystems.ResourceTypes.CONSENT in project org.hl7.fhir.core by hapifhir.

the class RdfParser method composeConsentConsentPolicyComponent.

protected void composeConsentConsentPolicyComponent(Complex parent, String parentType, String name, Consent.ConsentPolicyComponent element, int index) {
    if (element == null)
        return;
    Complex t;
    if (Utilities.noString(parentType))
        t = parent;
    else {
        t = parent.predicate("fhir:" + parentType + '.' + name);
    }
    composeBackboneElement(t, "policy", name, element, index);
    if (element.hasAuthorityElement())
        composeUri(t, "Consent", "authority", element.getAuthorityElement(), -1);
    if (element.hasUriElement())
        composeUri(t, "Consent", "uri", element.getUriElement(), -1);
}
Also used : Complex(org.hl7.fhir.dstu3.utils.formats.Turtle.Complex)

Example 44 with CONSENT

use of org.hl7.fhir.r4.model.codesystems.ResourceTypes.CONSENT in project org.hl7.fhir.core by hapifhir.

the class RdfParser method composeConsentExceptDataComponent.

protected void composeConsentExceptDataComponent(Complex parent, String parentType, String name, Consent.ExceptDataComponent 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 45 with CONSENT

use of org.hl7.fhir.r4.model.codesystems.ResourceTypes.CONSENT in project org.hl7.fhir.core by hapifhir.

the class RdfParser method composeConsentConsentVerificationComponent.

protected void composeConsentConsentVerificationComponent(Complex parent, String parentType, String name, Consent.ConsentVerificationComponent element, int index) {
    if (element == null)
        return;
    Complex t;
    if (Utilities.noString(parentType))
        t = parent;
    else {
        t = parent.predicate("fhir:" + parentType + '.' + name);
    }
    composeBackboneElement(t, "verification", name, element, index);
    if (element.hasVerifiedElement())
        composeBoolean(t, "Consent", "verified", element.getVerifiedElement(), -1);
    if (element.hasVerifiedWith())
        composeReference(t, "Consent", "verifiedWith", element.getVerifiedWith(), -1);
    if (element.hasVerificationDateElement())
        composeDateTime(t, "Consent", "verificationDate", element.getVerificationDateElement(), -1);
}
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