Search in sources :

Example 1 with RiskAssessment

use of org.hl7.fhir.r4.model.RiskAssessment in project org.hl7.fhir.core by hapifhir.

the class RdfParser method composeRiskAssessmentRiskAssessmentPredictionComponent.

protected void composeRiskAssessmentRiskAssessmentPredictionComponent(Complex parent, String parentType, String name, RiskAssessment.RiskAssessmentPredictionComponent element, int index) {
    if (element == null)
        return;
    Complex t;
    if (Utilities.noString(parentType))
        t = parent;
    else {
        t = parent.predicate("fhir:" + parentType + '.' + name);
    }
    composeBackboneElement(t, "prediction", name, element, index);
    if (element.hasOutcome())
        composeCodeableConcept(t, "RiskAssessment", "outcome", element.getOutcome(), -1);
    if (element.hasProbability())
        composeType(t, "RiskAssessment", "probability", element.getProbability(), -1);
    if (element.hasQualitativeRisk())
        composeCodeableConcept(t, "RiskAssessment", "qualitativeRisk", element.getQualitativeRisk(), -1);
    if (element.hasRelativeRiskElement())
        composeDecimal(t, "RiskAssessment", "relativeRisk", element.getRelativeRiskElement(), -1);
    if (element.hasWhen())
        composeType(t, "RiskAssessment", "when", element.getWhen(), -1);
    if (element.hasRationaleElement())
        composeString(t, "RiskAssessment", "rationale", element.getRationaleElement(), -1);
}
Also used : Complex(org.hl7.fhir.dstu3.utils.formats.Turtle.Complex)

Example 2 with RiskAssessment

use of org.hl7.fhir.r4.model.RiskAssessment in project org.hl7.fhir.core by hapifhir.

the class RdfParser method composeRiskAssessment.

protected void composeRiskAssessment(Complex parent, String parentType, String name, RiskAssessment element, int index) {
    if (element == null)
        return;
    Complex t;
    if (Utilities.noString(parentType))
        t = parent;
    else {
        t = parent.predicate("fhir:" + parentType + '.' + name);
    }
    composeDomainResource(t, "RiskAssessment", name, element, index);
    for (int i = 0; i < element.getIdentifier().size(); i++) composeIdentifier(t, "RiskAssessment", "identifier", element.getIdentifier().get(i), i);
    if (element.hasBasedOn())
        composeReference(t, "RiskAssessment", "basedOn", element.getBasedOn(), -1);
    if (element.hasParent())
        composeReference(t, "RiskAssessment", "parent", element.getParent(), -1);
    if (element.hasStatusElement())
        composeEnum(t, "RiskAssessment", "status", element.getStatusElement(), -1);
    if (element.hasMethod())
        composeCodeableConcept(t, "RiskAssessment", "method", element.getMethod(), -1);
    if (element.hasCode())
        composeCodeableConcept(t, "RiskAssessment", "code", element.getCode(), -1);
    if (element.hasSubject())
        composeReference(t, "RiskAssessment", "subject", element.getSubject(), -1);
    if (element.hasEncounter())
        composeReference(t, "RiskAssessment", "encounter", element.getEncounter(), -1);
    if (element.hasOccurrence())
        composeType(t, "RiskAssessment", "occurrence", element.getOccurrence(), -1);
    if (element.hasCondition())
        composeReference(t, "RiskAssessment", "condition", element.getCondition(), -1);
    if (element.hasPerformer())
        composeReference(t, "RiskAssessment", "performer", element.getPerformer(), -1);
    for (int i = 0; i < element.getReasonCode().size(); i++) composeCodeableConcept(t, "RiskAssessment", "reasonCode", element.getReasonCode().get(i), i);
    for (int i = 0; i < element.getReasonReference().size(); i++) composeReference(t, "RiskAssessment", "reasonReference", element.getReasonReference().get(i), i);
    for (int i = 0; i < element.getBasis().size(); i++) composeReference(t, "RiskAssessment", "basis", element.getBasis().get(i), i);
    for (int i = 0; i < element.getPrediction().size(); i++) composeRiskAssessmentRiskAssessmentPredictionComponent(t, "RiskAssessment", "prediction", element.getPrediction().get(i), i);
    if (element.hasMitigationElement())
        composeString(t, "RiskAssessment", "mitigation", element.getMitigationElement(), -1);
    for (int i = 0; i < element.getNote().size(); i++) composeAnnotation(t, "RiskAssessment", "note", element.getNote().get(i), i);
}
Also used : Complex(org.hl7.fhir.r4.utils.formats.Turtle.Complex)

Example 3 with RiskAssessment

use of org.hl7.fhir.r4.model.RiskAssessment in project org.hl7.fhir.core by hapifhir.

the class TurtleTests method test_riskassessment_example_population.

@Test
public void test_riskassessment_example_population() throws FileNotFoundException, IOException, Exception {
    System.out.println("riskassessment-example-population.ttl");
    new Turtle().parse(TextFile.fileToString("C:\\work\\org.hl7.fhir\\build\\publish\\riskassessment-example-population.ttl"));
}
Also used : Turtle(org.hl7.fhir.dstu3.utils.formats.Turtle) Test(org.junit.jupiter.api.Test)

Example 4 with RiskAssessment

use of org.hl7.fhir.r4.model.RiskAssessment in project himss_2021_sepsis_detection by redhat-na-ssa.

the class RiskAssessmentService method createRiskAssessment.

private RiskAssessment createRiskAssessment(Patient patient, String sepsisResponse, String observationId, String correlationKey) {
    RiskAssessment assessment = new RiskAssessment();
    Reference ref = new Reference();
    ref.setReference(patient.getId());
    assessment.setSubject(ref);
    assessment.addIdentifier().setValue(correlationKey);
    assessment.setBasedOn(new Reference("Observation/" + observationId));
    assessment.setStatus(RiskAssessmentStatus.PRELIMINARY);
    Coding coding = new Coding("http://browser.ihtsdotools.org/", "AIMODEL", "Inference of Sepsis");
    CodeableConcept concept = new CodeableConcept(coding);
    assessment.setCode(concept);
    RiskAssessmentPredictionComponent component = new RiskAssessmentPredictionComponent();
    String display = "Not Detected";
    if (sepsisResponse.equals("1"))
        display = "Detected";
    component.setOutcome(new CodeableConcept(new Coding("http://browser.ihtsdotools.org/", "1", display)));
    List<RiskAssessmentPredictionComponent> predictionsList = new ArrayList<RiskAssessmentPredictionComponent>();
    predictionsList.add(component);
    assessment.setPrediction(predictionsList);
    return assessment;
}
Also used : RiskAssessment(org.hl7.fhir.r4.model.RiskAssessment) RiskAssessmentPredictionComponent(org.hl7.fhir.r4.model.RiskAssessment.RiskAssessmentPredictionComponent) Coding(org.hl7.fhir.r4.model.Coding) Reference(org.hl7.fhir.r4.model.Reference) ArrayList(java.util.ArrayList) CodeableConcept(org.hl7.fhir.r4.model.CodeableConcept)

Example 5 with RiskAssessment

use of org.hl7.fhir.r4.model.RiskAssessment in project himss_2021_sepsis_detection by redhat-na-ssa.

the class RiskAssessmentUtil method getCode.

public static String getCode(RiskAssessment rAssessment) {
    RiskAssessmentPredictionComponent raPredictionComponent = rAssessment.getPredictionFirstRep();
    Property cProp = raPredictionComponent.getOutcome().getChildByName("coding");
    Coding coding = (Coding) cProp.getValues().get(0);
    String code = coding.getCode();
    log.info("getCode() code = " + code);
    return code;
}
Also used : RiskAssessmentPredictionComponent(org.hl7.fhir.r4.model.RiskAssessment.RiskAssessmentPredictionComponent) Coding(org.hl7.fhir.r4.model.Coding) Property(org.hl7.fhir.r4.model.Property)

Aggregations

Test (org.junit.jupiter.api.Test)7 Turtle (org.hl7.fhir.dstu3.utils.formats.Turtle)4 RiskAssessment (org.hl7.fhir.r4.model.RiskAssessment)4 Coding (org.hl7.fhir.r4.model.Coding)3 Patient (org.hl7.fhir.r4.model.Patient)3 RiskAssessmentPredictionComponent (org.hl7.fhir.r4.model.RiskAssessment.RiskAssessmentPredictionComponent)3 QuarkusTest (io.quarkus.test.junit.QuarkusTest)2 Complex (org.hl7.fhir.dstu2016may.formats.RdfGenerator.Complex)2 Complex (org.hl7.fhir.dstu3.utils.formats.Turtle.Complex)2 Property (org.hl7.fhir.r4.model.Property)2 Complex (org.hl7.fhir.r4.utils.formats.Turtle.Complex)2 JsonNode (com.fasterxml.jackson.databind.JsonNode)1 ObjectNode (com.fasterxml.jackson.databind.node.ObjectNode)1 PatientVitals (com.redhat.naps.process.model.PatientVitals)1 CloudEvent (io.cloudevents.CloudEvent)1 DefaultIncomingCloudEventMetadata (io.smallrye.reactive.messaging.ce.impl.DefaultIncomingCloudEventMetadata)1 InMemorySink (io.smallrye.reactive.messaging.connectors.InMemorySink)1 DefaultIncomingKafkaCloudEventMetadata (io.smallrye.reactive.messaging.kafka.impl.ce.DefaultIncomingKafkaCloudEventMetadata)1 ByteArrayInputStream (java.io.ByteArrayInputStream)1 IOException (java.io.IOException)1