use of org.hl7.fhir.r4.model.codesystems.ConsentAction in project Gravity-SDOH-Exchange-RI by FHIR.
the class TaskBundleFactory method createConsent.
protected Consent createConsent() {
Consent consent = new Consent();
consent.getMeta().addProfile(SDOHProfiles.CONSENT);
consent.setId(IdType.newRandomUuid());
consent.setStatus(Consent.ConsentState.ACTIVE);
consent.setDateTimeElement(DateTimeType.now());
ConsentScope consentScope = ConsentScope.PATIENTPRIVACY;
consent.getScope().addCoding(new Coding(consentScope.getSystem(), consentScope.toCode(), consentScope.getDisplay()));
V3ActCode actCode = V3ActCode.IDSCL;
consent.addCategory(new CodeableConcept().addCoding(new Coding(actCode.getSystem(), actCode.toCode(), actCode.getDisplay())));
consent.setPatient(getPatientReference());
ConsentPolicy consentPolicy = ConsentPolicy.HIPAAAUTH;
consent.getPolicyRule().addCoding(new Coding(consentPolicy.getSystem(), consentPolicy.toCode(), consentPolicy.getDisplay()));
V3RoleClass roleClass = V3RoleClass.PAT;
consent.getProvision().addActor().setReference(getPatientReference()).getRole().addCoding(new Coding(roleClass.getSystem(), roleClass.toCode(), roleClass.getDisplay()));
ConsentAction consentAction = ConsentAction.DISCLOSE;
consent.getProvision().addAction().getCoding().add(new Coding(consentAction.getSystem(), consentAction.toCode(), consentAction.getDisplay()));
return consent;
}
use of org.hl7.fhir.r4.model.codesystems.ConsentAction in project Gravity-SDOH-Exchange-RI by FHIR.
the class CreateConsentFactory method createConsent.
public Consent createConsent() {
Consent consent = new Consent();
consent.getSourceAttachment().setTitle(name);
try {
consent.getSourceAttachment().setData(attachment.getBytes());
} catch (IOException e) {
throw new ConsentCreateException("Consent attachment cannot be read.");
}
consent.getSourceAttachment().setContentType(MediaType.APPLICATION_PDF_VALUE);
consent.setId(IdType.newRandomUuid());
consent.setStatus(Consent.ConsentState.ACTIVE);
consent.setDateTimeElement(DateTimeType.now());
consent.getMeta().addProfile(SDOHProfiles.CONSENT);
ConsentScope consentScope = ConsentScope.PATIENTPRIVACY;
consent.getScope().addCoding(new Coding(consentScope.getSystem(), consentScope.toCode(), consentScope.getDisplay()));
V3ActCode actCode = V3ActCode.IDSCL;
consent.addCategory(new CodeableConcept().addCoding(new Coding(actCode.getSystem(), actCode.toCode(), actCode.getDisplay())));
consent.setPatient(patient);
ConsentPolicy consentPolicy = ConsentPolicy.HIPAAAUTH;
consent.getPolicyRule().addCoding(new Coding(consentPolicy.getSystem(), consentPolicy.toCode(), consentPolicy.getDisplay()));
V3RoleClass roleClass = V3RoleClass.PAT;
consent.getProvision().addActor().setReference(patient).getRole().addCoding(new Coding(roleClass.getSystem(), roleClass.toCode(), roleClass.getDisplay()));
ConsentAction consentAction = ConsentAction.DISCLOSE;
consent.getProvision().addAction().getCoding().add(new Coding(consentAction.getSystem(), consentAction.toCode(), consentAction.getDisplay()));
consent.getOrganization().add(organization);
return consent;
}
Aggregations