Search in sources :

Example 1 with DetectedIssue

use of org.hl7.fhir.r4.model.DetectedIssue in project cqf-ruler by DBCG.

the class DetectedIssueBuilder method initializeR4.

@Override
protected void initializeR4(T theResource) {
    super.initializeR4(theResource);
    org.hl7.fhir.r4.model.DetectedIssue detectedIssue = (org.hl7.fhir.r4.model.DetectedIssue) theResource;
    List<org.hl7.fhir.r4.model.Identifier> identifier = new ArrayList<>();
    identifier.add(new org.hl7.fhir.r4.model.Identifier().setSystem(getIdentifier().getKey()).setValue(getIdentifier().getValue()));
    detectedIssue.setIdentifier(identifier).setPatient(new org.hl7.fhir.r4.model.Reference(myPatient)).setStatus(org.hl7.fhir.r4.model.DetectedIssue.DetectedIssueStatus.valueOf(myStatus)).setCode(new CodeableConcept().addCoding(new Coding().setSystem(getCodeSetting().getSystem()).setCode(getCodeSetting().getCode()).setDisplay(getCodeSetting().getDisplay())));
    getEvidenceDetails().forEach(evidence -> detectedIssue.addEvidence(new DetectedIssueEvidenceComponent().addDetail(new org.hl7.fhir.r4.model.Reference(evidence))));
}
Also used : ArrayList(java.util.ArrayList) Identifier(org.hl7.fhir.dstu2016may.model.Identifier) Coding(org.hl7.fhir.r4.model.Coding) DetectedIssueEvidenceComponent(org.hl7.fhir.r4.model.DetectedIssue.DetectedIssueEvidenceComponent) CodeableConcept(org.hl7.fhir.r4.model.CodeableConcept)

Example 2 with DetectedIssue

use of org.hl7.fhir.r4.model.DetectedIssue in project cqf-ruler by DBCG.

the class DetectedIssueBuilder method initializeDstu2_1.

@Override
protected void initializeDstu2_1(T theResource) {
    super.initializeDstu2_1(theResource);
    org.hl7.fhir.dstu2016may.model.DetectedIssue detectedIssue = (org.hl7.fhir.dstu2016may.model.DetectedIssue) theResource;
    detectedIssue.setIdentifier(new Identifier().setSystem(getIdentifier().getKey()).setValue(getIdentifier().getValue())).setPatient(new Reference(myPatient));
    getEvidenceDetails().forEach(detectedIssue::setReference);
}
Also used : Identifier(org.hl7.fhir.dstu2016may.model.Identifier) Reference(org.hl7.fhir.dstu2016may.model.Reference)

Example 3 with DetectedIssue

use of org.hl7.fhir.r4.model.DetectedIssue in project cqf-ruler by DBCG.

the class CareGapsProvider method patientReports.

// warning for greater than 7 parameters
@SuppressWarnings("squid:S00107")
private Parameters.ParametersParameterComponent patientReports(RequestDetails requestDetails, String periodStart, String periodEnd, Patient patient, List<String> status, List<Measure> measures, String organization) {
    // TODO: add organization to report, if it exists.
    Composition composition = getComposition(patient);
    List<DetectedIssue> detectedIssues = new ArrayList<>();
    Map<String, Resource> evaluatedResources = new HashMap<>();
    List<MeasureReport> reports = getReports(requestDetails, periodStart, periodEnd, patient, status, measures, composition, detectedIssues, evaluatedResources);
    if (reports.isEmpty()) {
        return null;
    }
    return initializePatientParameter(patient).setResource(addBundleEntries(requestDetails.getFhirServerBase(), composition, detectedIssues, reports, evaluatedResources));
}
Also used : Composition(org.hl7.fhir.r4.model.Composition) DetectedIssue(org.hl7.fhir.r4.model.DetectedIssue) HashMap(java.util.HashMap) ArrayList(java.util.ArrayList) Resource(org.hl7.fhir.r4.model.Resource) MeasureReport(org.hl7.fhir.r4.model.MeasureReport)

Example 4 with DetectedIssue

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

the class RdfParser method composeDetectedIssue.

protected void composeDetectedIssue(Complex parent, String parentType, String name, DetectedIssue element, int index) {
    if (element == null)
        return;
    Complex t;
    if (Utilities.noString(parentType))
        t = parent;
    else {
        t = parent.predicate("fhir:" + parentType + '.' + name);
    }
    composeDomainResource(t, "DetectedIssue", name, element, index);
    if (element.hasPatient())
        composeReference(t, "DetectedIssue", "patient", element.getPatient(), -1);
    if (element.hasCategory())
        composeCodeableConcept(t, "DetectedIssue", "category", element.getCategory(), -1);
    if (element.hasSeverityElement())
        composeEnum(t, "DetectedIssue", "severity", element.getSeverityElement(), -1);
    for (int i = 0; i < element.getImplicated().size(); i++) composeReference(t, "DetectedIssue", "implicated", element.getImplicated().get(i), i);
    if (element.hasDetailElement())
        composeString(t, "DetectedIssue", "detail", element.getDetailElement(), -1);
    if (element.hasDateElement())
        composeDateTime(t, "DetectedIssue", "date", element.getDateElement(), -1);
    if (element.hasAuthor())
        composeReference(t, "DetectedIssue", "author", element.getAuthor(), -1);
    if (element.hasIdentifier())
        composeIdentifier(t, "DetectedIssue", "identifier", element.getIdentifier(), -1);
    if (element.hasReferenceElement())
        composeUri(t, "DetectedIssue", "reference", element.getReferenceElement(), -1);
    for (int i = 0; i < element.getMitigation().size(); i++) composeDetectedIssueDetectedIssueMitigationComponent(t, "DetectedIssue", "mitigation", element.getMitigation().get(i), i);
}
Also used : Complex(org.hl7.fhir.dstu2016may.formats.RdfGenerator.Complex)

Example 5 with DetectedIssue

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

the class RdfParser method composeMedicationRequest.

protected void composeMedicationRequest(Complex parent, String parentType, String name, MedicationRequest element, int index) {
    if (element == null)
        return;
    Complex t;
    if (Utilities.noString(parentType))
        t = parent;
    else {
        t = parent.predicate("fhir:" + parentType + '.' + name);
    }
    composeDomainResource(t, "MedicationRequest", name, element, index);
    for (int i = 0; i < element.getIdentifier().size(); i++) composeIdentifier(t, "MedicationRequest", "identifier", element.getIdentifier().get(i), i);
    for (int i = 0; i < element.getDefinition().size(); i++) composeReference(t, "MedicationRequest", "definition", element.getDefinition().get(i), i);
    for (int i = 0; i < element.getBasedOn().size(); i++) composeReference(t, "MedicationRequest", "basedOn", element.getBasedOn().get(i), i);
    if (element.hasGroupIdentifier())
        composeIdentifier(t, "MedicationRequest", "groupIdentifier", element.getGroupIdentifier(), -1);
    if (element.hasStatusElement())
        composeEnum(t, "MedicationRequest", "status", element.getStatusElement(), -1);
    if (element.hasIntentElement())
        composeEnum(t, "MedicationRequest", "intent", element.getIntentElement(), -1);
    if (element.hasCategory())
        composeCodeableConcept(t, "MedicationRequest", "category", element.getCategory(), -1);
    if (element.hasPriorityElement())
        composeEnum(t, "MedicationRequest", "priority", element.getPriorityElement(), -1);
    if (element.hasMedication())
        composeType(t, "MedicationRequest", "medication", element.getMedication(), -1);
    if (element.hasSubject())
        composeReference(t, "MedicationRequest", "subject", element.getSubject(), -1);
    if (element.hasContext())
        composeReference(t, "MedicationRequest", "context", element.getContext(), -1);
    for (int i = 0; i < element.getSupportingInformation().size(); i++) composeReference(t, "MedicationRequest", "supportingInformation", element.getSupportingInformation().get(i), i);
    if (element.hasAuthoredOnElement())
        composeDateTime(t, "MedicationRequest", "authoredOn", element.getAuthoredOnElement(), -1);
    if (element.hasRequester())
        composeMedicationRequestMedicationRequestRequesterComponent(t, "MedicationRequest", "requester", element.getRequester(), -1);
    if (element.hasRecorder())
        composeReference(t, "MedicationRequest", "recorder", element.getRecorder(), -1);
    for (int i = 0; i < element.getReasonCode().size(); i++) composeCodeableConcept(t, "MedicationRequest", "reasonCode", element.getReasonCode().get(i), i);
    for (int i = 0; i < element.getReasonReference().size(); i++) composeReference(t, "MedicationRequest", "reasonReference", element.getReasonReference().get(i), i);
    for (int i = 0; i < element.getNote().size(); i++) composeAnnotation(t, "MedicationRequest", "note", element.getNote().get(i), i);
    for (int i = 0; i < element.getDosageInstruction().size(); i++) composeDosage(t, "MedicationRequest", "dosageInstruction", element.getDosageInstruction().get(i), i);
    if (element.hasDispenseRequest())
        composeMedicationRequestMedicationRequestDispenseRequestComponent(t, "MedicationRequest", "dispenseRequest", element.getDispenseRequest(), -1);
    if (element.hasSubstitution())
        composeMedicationRequestMedicationRequestSubstitutionComponent(t, "MedicationRequest", "substitution", element.getSubstitution(), -1);
    if (element.hasPriorPrescription())
        composeReference(t, "MedicationRequest", "priorPrescription", element.getPriorPrescription(), -1);
    for (int i = 0; i < element.getDetectedIssue().size(); i++) composeReference(t, "MedicationRequest", "detectedIssue", element.getDetectedIssue().get(i), i);
    for (int i = 0; i < element.getEventHistory().size(); i++) composeReference(t, "MedicationRequest", "eventHistory", element.getEventHistory().get(i), i);
}
Also used : Complex(org.hl7.fhir.dstu3.utils.formats.Turtle.Complex)

Aggregations

Complex (org.hl7.fhir.r4.utils.formats.Turtle.Complex)5 Turtle (org.hl7.fhir.dstu3.utils.formats.Turtle)4 Complex (org.hl7.fhir.dstu3.utils.formats.Turtle.Complex)4 Test (org.junit.jupiter.api.Test)4 ArrayList (java.util.ArrayList)3 Complex (org.hl7.fhir.dstu2016may.formats.RdfGenerator.Complex)2 Identifier (org.hl7.fhir.dstu2016may.model.Identifier)2 DetectedIssue (org.hl7.fhir.r4.model.DetectedIssue)2 MeasureReport (org.hl7.fhir.r4.model.MeasureReport)2 HashMap (java.util.HashMap)1 Reference (org.hl7.fhir.dstu2016may.model.Reference)1 Bundle (org.hl7.fhir.r4.model.Bundle)1 CodeableConcept (org.hl7.fhir.r4.model.CodeableConcept)1 Coding (org.hl7.fhir.r4.model.Coding)1 Composition (org.hl7.fhir.r4.model.Composition)1 DetectedIssueEvidenceComponent (org.hl7.fhir.r4.model.DetectedIssue.DetectedIssueEvidenceComponent)1 Measure (org.hl7.fhir.r4.model.Measure)1 Resource (org.hl7.fhir.r4.model.Resource)1