Search in sources :

Example 1 with ConditionVerificationStatusCodes

use of org.hl7.gravity.refimpl.sdohexchange.fhir.ConditionVerificationStatusCodes in project Gravity-SDOH-Exchange-RI by FHIR.

the class ConditionBundleFactory method createCondition.

protected Condition createCondition() {
    Condition healthConcern = new Condition();
    healthConcern.getMeta().addProfile(SDOHProfiles.CONDITION);
    ConditionClinicalStatusCodes clinicalStatus = ConditionClinicalStatusCodes.ACTIVE;
    healthConcern.setClinicalStatus(new CodeableConcept().addCoding(new Coding().setCode(clinicalStatus.toCode()).setSystem(clinicalStatus.getSystem()).setDisplay(clinicalStatus.getDisplay())));
    ConditionVerificationStatusCodes verificationStatus = ConditionVerificationStatusCodes.UNCONFIRMED;
    healthConcern.setVerificationStatus(new CodeableConcept().addCoding(new Coding().setCode(verificationStatus.toCode()).setSystem(verificationStatus.getSystem()).setDisplay(verificationStatus.getDisplay())));
    healthConcern.addCategory().addCoding(category);
    healthConcern.addCategory().addCoding(new Coding().setSystem(conditionType.getSystem()).setCode(conditionType.toCode()).setDisplay(conditionType.getDisplay()));
    healthConcern.getCode().setText(name);
    healthConcern.getCode().addCoding(icdCode);
    healthConcern.getCode().addCoding(snomedCode);
    healthConcern.setSubject(getPatientReference());
    healthConcern.setAsserter(getPatientReference());
    healthConcern.setRecorder(FhirUtil.toReference(Patient.class, practitioner.getIdElement().getIdPart(), practitioner.getNameFirstRep().getNameAsSingleString()));
    healthConcern.getEvidenceFirstRep().getCodeFirstRep().setText(basedOnText);
    return healthConcern;
}
Also used : Condition(org.hl7.fhir.r4.model.Condition) ConditionVerificationStatusCodes(org.hl7.gravity.refimpl.sdohexchange.fhir.ConditionVerificationStatusCodes) ConditionClinicalStatusCodes(org.hl7.gravity.refimpl.sdohexchange.fhir.ConditionClinicalStatusCodes) Coding(org.hl7.fhir.r4.model.Coding) Patient(org.hl7.fhir.r4.model.Patient) CodeableConcept(org.hl7.fhir.r4.model.CodeableConcept)

Aggregations

CodeableConcept (org.hl7.fhir.r4.model.CodeableConcept)1 Coding (org.hl7.fhir.r4.model.Coding)1 Condition (org.hl7.fhir.r4.model.Condition)1 Patient (org.hl7.fhir.r4.model.Patient)1 ConditionClinicalStatusCodes (org.hl7.gravity.refimpl.sdohexchange.fhir.ConditionClinicalStatusCodes)1 ConditionVerificationStatusCodes (org.hl7.gravity.refimpl.sdohexchange.fhir.ConditionVerificationStatusCodes)1