Search in sources :

Example 1 with ConditionStageComponent

use of org.hl7.fhir.r4.model.Condition.ConditionStageComponent in project odm2fhir by num-codex.

the class StageAtDiagnosis method createCondition.

private Condition createCondition(ItemData generalCoding, ItemData answerCoding) {
    var condition = (Condition) new Condition().addIdentifier(createIdentifier(CONDITION, generalCoding)).setRecordedDateElement(// TODO Set actual DateTime value
    UNKNOWN_DATE_TIME).addCategory(createCodeableConcept(createCoding(SNOMED_CT, "394807007", "Infectious diseases (specialty) (qualifier value)"))).setClinicalStatus(ACTIVE).setCode(createCodeableConcept(createCoding(SNOMED_CT, "840539006", "Disease caused by Severe acute respiratory syndrome coronavirus 2 (disorder)"))).setVerificationStatus(CONFIRMED).setMeta(createMeta(DIAGNOSIS_COVID_19));
    var summaryCodeableConcept = createCodeableConcept(answerCoding);
    var typeCodeableConcept = createCodeableConcept(generalCoding);
    if (!summaryCodeableConcept.getCoding().isEmpty() && !typeCodeableConcept.getCoding().isEmpty()) {
        condition.addStage(new ConditionStageComponent().setSummary(summaryCodeableConcept).setType(typeCodeableConcept));
    }
    return condition;
}
Also used : Condition(org.hl7.fhir.r4.model.Condition) ConditionStageComponent(org.hl7.fhir.r4.model.Condition.ConditionStageComponent)

Example 2 with ConditionStageComponent

use of org.hl7.fhir.r4.model.Condition.ConditionStageComponent in project pathling by aehrc.

the class TestData method newConditionWithExtensions.

public static Condition newConditionWithExtensions() {
    // Condition
    // - extension:
    // - url: uuid:ext1
    // - value: ext1
    // - extension:
    // - url: uuid:ext2
    // - value: 2
    // - extension:
    // - url: uuid:ext4
    // - extension
    // - url: uuid:nested
    // - value: nested
    // - identifier
    // - id: uuid:identifier1
    // - extension:
    // - url: uuid:ext10
    // - value: ext10
    // - extension:
    // - url: uuid:ext11
    // - value: 11
    // - stage
    // - type
    // - extension
    // - url: uuid:ext12
    // - value: ext12
    final Condition conditionWithExtension = new Condition();
    conditionWithExtension.setId("someId");
    final Extension nestedExtension = new Extension("uuid:ext4");
    nestedExtension.addExtension(new Extension("uuid:nested", new StringType("nested")));
    conditionWithExtension.setExtension(Arrays.asList(new Extension("uuid:ext1", new StringType("ext1")), new Extension("uuid:ext2", new IntegerType(2)), nestedExtension));
    conditionWithExtension.setMeta(new Meta().setVersionId("MetVersion"));
    conditionWithExtension.setOnset(new Range());
    conditionWithExtension.setSeverity(new CodeableConcept().addCoding(new Coding("sys", "code", "name")));
    final Identifier identifier = conditionWithExtension.getIdentifierFirstRep();
    identifier.setId("uuid:identifier1");
    identifier.setExtension(Arrays.asList(new Extension("uuid:ext10", new StringType("ext10")), new Extension("uuid:ext11", new IntegerType(11))));
    final ConditionStageComponent stage = conditionWithExtension.getStageFirstRep();
    stage.getType().setExtension(Collections.singletonList(new Extension("uuid:ext12", new StringType("ext12"))));
    return conditionWithExtension;
}
Also used : ConditionStageComponent(org.hl7.fhir.r4.model.Condition.ConditionStageComponent)

Aggregations

ConditionStageComponent (org.hl7.fhir.r4.model.Condition.ConditionStageComponent)2 Condition (org.hl7.fhir.r4.model.Condition)1