use of org.hl7.fhir.r4.model.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);
for (int i = 0; i < element.getIdentifier().size(); i++) composeIdentifier(t, "Consent", "identifier", element.getIdentifier().get(i), i);
if (element.hasStatusElement())
composeEnum(t, "Consent", "status", element.getStatusElement(), -1);
if (element.hasScope())
composeCodeableConcept(t, "Consent", "scope", element.getScope(), -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.hasDateTimeElement())
composeDateTime(t, "Consent", "dateTime", element.getDateTimeElement(), -1);
for (int i = 0; i < element.getPerformer().size(); i++) composeReference(t, "Consent", "performer", element.getPerformer().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.hasPolicyRule())
composeCodeableConcept(t, "Consent", "policyRule", element.getPolicyRule(), -1);
for (int i = 0; i < element.getVerification().size(); i++) composeConsentConsentVerificationComponent(t, "Consent", "verification", element.getVerification().get(i), i);
if (element.hasProvision())
composeConsentprovisionComponent(t, "Consent", "provision", element.getProvision(), -1);
}
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);
for (int i = 0; i < element.getIdentifier().size(); i++) composeIdentifier(t, "ResearchSubject", "identifier", element.getIdentifier().get(i), i);
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);
}
use of org.hl7.fhir.r4.model.Consent in project org.hl7.fhir.core by hapifhir.
the class RdfParser method composeConsentprovisionActorComponent.
protected void composeConsentprovisionActorComponent(Complex parent, String parentType, String name, Consent.provisionActorComponent 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);
}
use of org.hl7.fhir.r4.model.Consent in project fhir-bridge by ehrbase.
the class FindConsentTransactionIT method findConsentVRead.
@Test
void findConsentVRead() throws IOException {
MethodOutcome outcome = create("Consent/transactions/provide-consent-create.json");
IIdType id = outcome.getId();
Consent consent = vread(id.getIdPart(), id.getVersionIdPart(), Consent.class);
Assertions.assertNotNull(consent);
Assertions.assertNotNull(consent.getId(), id.getIdPart());
Assertions.assertNotNull(consent.getMeta().getVersionId(), id.getVersionIdPart());
Assertions.assertEquals(PATIENT_ID, consent.getPatient().getIdentifier().getValue());
}
use of org.hl7.fhir.r4.model.Consent in project fhir-bridge by ehrbase.
the class FindConsentTransactionIT method findConsentRead.
@Test
void findConsentRead() throws IOException {
MethodOutcome outcome = create("Consent/transactions/provide-consent-create.json");
IIdType id = outcome.getId();
Consent consent = read(id.getIdPart(), Consent.class);
Assertions.assertNotNull(consent);
Assertions.assertNotNull(consent.getId(), id.getIdPart());
Assertions.assertEquals(PATIENT_ID, consent.getPatient().getIdentifier().getValue());
}
Aggregations