Search in sources :

Example 1 with Narrative

use of org.hl7.fhir.dstu3.model.Narrative in project bunsen by cerner.

the class TestData method newCondition.

/**
 * Returns a FHIR Condition for testing purposes.
 */
public static Condition newCondition() {
    Condition condition = new Condition();
    // Condition based on example from FHIR:
    // https://www.hl7.org/fhir/condition-example.json.html
    condition.setId("Condition/example");
    condition.setLanguage("en_US");
    // Narrative text
    Narrative narrative = new Narrative();
    narrative.setStatusAsString("generated");
    narrative.setDivAsString("This data was generated for test purposes.");
    XhtmlNode node = new XhtmlNode();
    node.setNodeType(NodeType.Text);
    node.setValue("Severe burn of left ear (Date: 24-May 2012)");
    condition.setText(narrative);
    condition.setSubject(new Reference("Patient/example").setDisplay("Here is a display for you."));
    condition.setVerificationStatus(Condition.ConditionVerificationStatus.CONFIRMED);
    // Condition code
    CodeableConcept code = new CodeableConcept();
    code.addCoding().setSystem("http://snomed.info/sct").setCode("39065001").setDisplay("Severe");
    condition.setSeverity(code);
    // Severity code
    CodeableConcept severity = new CodeableConcept();
    severity.addCoding().setSystem("http://snomed.info/sct").setCode("24484000").setDisplay("Burn of ear").setUserSelected(true);
    condition.setSeverity(severity);
    // Onset date time
    DateTimeType onset = new DateTimeType();
    onset.setValueAsString("2012-05-24");
    condition.setOnset(onset);
    return condition;
}
Also used : Condition(org.hl7.fhir.dstu3.model.Condition) DateTimeType(org.hl7.fhir.dstu3.model.DateTimeType) Narrative(org.hl7.fhir.dstu3.model.Narrative) Reference(org.hl7.fhir.dstu3.model.Reference) XhtmlNode(org.hl7.fhir.utilities.xhtml.XhtmlNode) CodeableConcept(org.hl7.fhir.dstu3.model.CodeableConcept)

Example 2 with Narrative

use of org.hl7.fhir.dstu3.model.Narrative in project gpconnect-demonstrator by nhsconnect.

the class FhirSectionBuilder method buildFhirSection.

public static SectionComponent buildFhirSection(Page page) {
    Coding coding = new Coding().setSystem(SystemURL.VS_GPC_RECORD_SECTION).setCode(page.getCode()).setDisplay(page.getName());
    CodeableConcept codableConcept = new CodeableConcept().addCoding(coding);
    codableConcept.setText(page.getName());
    Narrative narrative = new Narrative();
    narrative.setStatus(NarrativeStatus.GENERATED);
    narrative.setDivAsString(createHtmlContent(page));
    SectionComponent sectionComponent = new SectionComponent();
    sectionComponent.setCode(codableConcept);
    sectionComponent.setTitle(page.getName()).setCode(codableConcept).setText(narrative);
    return sectionComponent;
}
Also used : Coding(org.hl7.fhir.dstu3.model.Coding) Narrative(org.hl7.fhir.dstu3.model.Narrative) SectionComponent(org.hl7.fhir.dstu3.model.Composition.SectionComponent) CodeableConcept(org.hl7.fhir.dstu3.model.CodeableConcept)

Aggregations

CodeableConcept (org.hl7.fhir.dstu3.model.CodeableConcept)2 Narrative (org.hl7.fhir.dstu3.model.Narrative)2 Coding (org.hl7.fhir.dstu3.model.Coding)1 SectionComponent (org.hl7.fhir.dstu3.model.Composition.SectionComponent)1 Condition (org.hl7.fhir.dstu3.model.Condition)1 DateTimeType (org.hl7.fhir.dstu3.model.DateTimeType)1 Reference (org.hl7.fhir.dstu3.model.Reference)1 XhtmlNode (org.hl7.fhir.utilities.xhtml.XhtmlNode)1