Search in sources :

Example 36 with Specimen

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

the class RdfParser method composeSpecimenSpecimenCollectionComponent.

protected void composeSpecimenSpecimenCollectionComponent(Complex parent, String parentType, String name, Specimen.SpecimenCollectionComponent element, int index) {
    if (element == null)
        return;
    Complex t;
    if (Utilities.noString(parentType))
        t = parent;
    else {
        t = parent.predicate("fhir:" + parentType + '.' + name);
    }
    composeBackboneElement(t, "collection", name, element, index);
    if (element.hasCollector())
        composeReference(t, "Specimen", "collector", element.getCollector(), -1);
    if (element.hasCommentElement())
        composeString(t, "Specimen", "comment", element.getCommentElement(), -1);
    if (element.hasCollected())
        composeType(t, "Specimen", "collected", element.getCollected(), -1);
    if (element.hasQuantity())
        composeQuantity(t, "Specimen", "quantity", element.getQuantity(), -1);
    if (element.hasMethod())
        composeCodeableConcept(t, "Specimen", "method", element.getMethod(), -1);
    if (element.hasBodySite())
        composeCodeableConcept(t, "Specimen", "bodySite", element.getBodySite(), -1);
}
Also used : Complex(org.hl7.fhir.dstu2016may.formats.RdfGenerator.Complex)

Example 37 with Specimen

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

the class RdfParser method composeSpecimenSpecimenTreatmentComponent.

protected void composeSpecimenSpecimenTreatmentComponent(Complex parent, String parentType, String name, Specimen.SpecimenTreatmentComponent element, int index) {
    if (element == null)
        return;
    Complex t;
    if (Utilities.noString(parentType))
        t = parent;
    else {
        t = parent.predicate("fhir:" + parentType + '.' + name);
    }
    composeBackboneElement(t, "treatment", name, element, index);
    if (element.hasDescriptionElement())
        composeString(t, "Specimen", "description", element.getDescriptionElement(), -1);
    if (element.hasProcedure())
        composeCodeableConcept(t, "Specimen", "procedure", element.getProcedure(), -1);
    for (int i = 0; i < element.getAdditive().size(); i++) composeReference(t, "Specimen", "additive", element.getAdditive().get(i), i);
}
Also used : Complex(org.hl7.fhir.dstu2016may.formats.RdfGenerator.Complex)

Example 38 with Specimen

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

the class RdfParser method composeSpecimenSpecimenCollectionComponent.

protected void composeSpecimenSpecimenCollectionComponent(Complex parent, String parentType, String name, Specimen.SpecimenCollectionComponent element, int index) {
    if (element == null)
        return;
    Complex t;
    if (Utilities.noString(parentType))
        t = parent;
    else {
        t = parent.predicate("fhir:" + parentType + '.' + name);
    }
    composeBackboneElement(t, "collection", name, element, index);
    if (element.hasCollector())
        composeReference(t, "Specimen", "collector", element.getCollector(), -1);
    if (element.hasCollected())
        composeType(t, "Specimen", "collected", element.getCollected(), -1);
    if (element.hasQuantity())
        composeQuantity(t, "Specimen", "quantity", element.getQuantity(), -1);
    if (element.hasMethod())
        composeCodeableConcept(t, "Specimen", "method", element.getMethod(), -1);
    if (element.hasBodySite())
        composeCodeableConcept(t, "Specimen", "bodySite", element.getBodySite(), -1);
}
Also used : Complex(org.hl7.fhir.dstu3.utils.formats.Turtle.Complex)

Example 39 with Specimen

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

the class TurtleTests method test_conceptmap_example_specimen_type.

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

Example 40 with Specimen

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

the class RdfParser method composeProcedureRequest.

protected void composeProcedureRequest(Complex parent, String parentType, String name, ProcedureRequest element, int index) {
    if (element == null)
        return;
    Complex t;
    if (Utilities.noString(parentType))
        t = parent;
    else {
        t = parent.predicate("fhir:" + parentType + '.' + name);
    }
    composeDomainResource(t, "ProcedureRequest", name, element, index);
    for (int i = 0; i < element.getIdentifier().size(); i++) composeIdentifier(t, "ProcedureRequest", "identifier", element.getIdentifier().get(i), i);
    for (int i = 0; i < element.getDefinition().size(); i++) composeReference(t, "ProcedureRequest", "definition", element.getDefinition().get(i), i);
    for (int i = 0; i < element.getBasedOn().size(); i++) composeReference(t, "ProcedureRequest", "basedOn", element.getBasedOn().get(i), i);
    for (int i = 0; i < element.getReplaces().size(); i++) composeReference(t, "ProcedureRequest", "replaces", element.getReplaces().get(i), i);
    if (element.hasRequisition())
        composeIdentifier(t, "ProcedureRequest", "requisition", element.getRequisition(), -1);
    if (element.hasStatusElement())
        composeEnum(t, "ProcedureRequest", "status", element.getStatusElement(), -1);
    if (element.hasIntentElement())
        composeEnum(t, "ProcedureRequest", "intent", element.getIntentElement(), -1);
    if (element.hasPriorityElement())
        composeEnum(t, "ProcedureRequest", "priority", element.getPriorityElement(), -1);
    if (element.hasDoNotPerformElement())
        composeBoolean(t, "ProcedureRequest", "doNotPerform", element.getDoNotPerformElement(), -1);
    for (int i = 0; i < element.getCategory().size(); i++) composeCodeableConcept(t, "ProcedureRequest", "category", element.getCategory().get(i), i);
    if (element.hasCode())
        composeCodeableConcept(t, "ProcedureRequest", "code", element.getCode(), -1);
    if (element.hasSubject())
        composeReference(t, "ProcedureRequest", "subject", element.getSubject(), -1);
    if (element.hasContext())
        composeReference(t, "ProcedureRequest", "context", element.getContext(), -1);
    if (element.hasOccurrence())
        composeType(t, "ProcedureRequest", "occurrence", element.getOccurrence(), -1);
    if (element.hasAsNeeded())
        composeType(t, "ProcedureRequest", "asNeeded", element.getAsNeeded(), -1);
    if (element.hasAuthoredOnElement())
        composeDateTime(t, "ProcedureRequest", "authoredOn", element.getAuthoredOnElement(), -1);
    if (element.hasRequester())
        composeProcedureRequestProcedureRequestRequesterComponent(t, "ProcedureRequest", "requester", element.getRequester(), -1);
    if (element.hasPerformerType())
        composeCodeableConcept(t, "ProcedureRequest", "performerType", element.getPerformerType(), -1);
    if (element.hasPerformer())
        composeReference(t, "ProcedureRequest", "performer", element.getPerformer(), -1);
    for (int i = 0; i < element.getReasonCode().size(); i++) composeCodeableConcept(t, "ProcedureRequest", "reasonCode", element.getReasonCode().get(i), i);
    for (int i = 0; i < element.getReasonReference().size(); i++) composeReference(t, "ProcedureRequest", "reasonReference", element.getReasonReference().get(i), i);
    for (int i = 0; i < element.getSupportingInfo().size(); i++) composeReference(t, "ProcedureRequest", "supportingInfo", element.getSupportingInfo().get(i), i);
    for (int i = 0; i < element.getSpecimen().size(); i++) composeReference(t, "ProcedureRequest", "specimen", element.getSpecimen().get(i), i);
    for (int i = 0; i < element.getBodySite().size(); i++) composeCodeableConcept(t, "ProcedureRequest", "bodySite", element.getBodySite().get(i), i);
    for (int i = 0; i < element.getNote().size(); i++) composeAnnotation(t, "ProcedureRequest", "note", element.getNote().get(i), i);
    for (int i = 0; i < element.getRelevantHistory().size(); i++) composeReference(t, "ProcedureRequest", "relevantHistory", element.getRelevantHistory().get(i), i);
}
Also used : Complex(org.hl7.fhir.dstu3.utils.formats.Turtle.Complex)

Aggregations

Test (org.junit.jupiter.api.Test)19 IBaseResource (org.hl7.fhir.instance.model.api.IBaseResource)11 BundleEntryComponent (org.hl7.fhir.r4.model.Bundle.BundleEntryComponent)11 Resource (org.hl7.fhir.r4.model.Resource)11 Complex (org.hl7.fhir.dstu2016may.formats.RdfGenerator.Complex)9 Complex (org.hl7.fhir.r4.utils.formats.Turtle.Complex)9 Complex (org.hl7.fhir.dstu3.utils.formats.Turtle.Complex)8 Coding (org.hl7.fhir.r4.model.Coding)8 DiagnosticReport (org.hl7.fhir.r4.model.DiagnosticReport)8 Reference (org.hl7.fhir.r4.model.Reference)8 Attachment (org.hl7.fhir.r4.model.Attachment)7 Bundle (org.hl7.fhir.r4.model.Bundle)6 Observation (org.hl7.fhir.r4.model.Observation)6 Specimen (org.hl7.fhir.dstu3.model.Specimen)4 Turtle (org.hl7.fhir.dstu3.utils.formats.Turtle)4 ResourceModel (io.github.linuxforhealth.api.ResourceModel)3 RCMRMT030101UK04EhrExtract (org.hl7.v3.RCMRMT030101UK04EhrExtract)3 FHIRContext (io.github.linuxforhealth.fhir.FHIRContext)2 File (java.io.File)2 FhirPath (au.csiro.pathling.fhirpath.FhirPath)1