Search in sources :

Example 71 with Address

use of org.hl7.fhir.dstu2016may.model.Address in project org.hl7.fhir.core by hapifhir.

the class ToolsHelper method generateSnapshots.

private void generateSnapshots(String[] args) throws IOException, FHIRException {
    if (args.length == 1) {
        System.out.println("tools.jar snapshot-maker [source] -defn [definitions]");
        System.out.println("");
        System.out.println("Generates a snapshot from a differential. The nominated profile must have a single struture that has a differential");
        System.out.println("");
        System.out.println("source - the profile to generate the snapshot for. Maybe a file name, or a URL reference to a server running FHIR RESTful API");
        System.out.println("definitions - filename for local copy of the validation.zip file");
    }
    String address = args[1];
    String definitions = args[3];
    SimpleWorkerContext context = SimpleWorkerContext.fromDefinitions(getDefinitions(definitions));
    // } else {
    throw new NotImplementedException("generating snapshots not done yet (address = " + address + ")");
// }
}
Also used : NotImplementedException(org.apache.commons.lang3.NotImplementedException) SimpleWorkerContext(org.hl7.fhir.dstu2016may.utils.SimpleWorkerContext)

Example 72 with Address

use of org.hl7.fhir.dstu2016may.model.Address in project org.hl7.fhir.core by hapifhir.

the class RdfParser method composeAuditEventAuditEventAgentNetworkComponent.

protected void composeAuditEventAuditEventAgentNetworkComponent(Complex parent, String parentType, String name, AuditEvent.AuditEventAgentNetworkComponent element, int index) {
    if (element == null)
        return;
    Complex t;
    if (Utilities.noString(parentType))
        t = parent;
    else {
        t = parent.predicate("fhir:" + parentType + '.' + name);
    }
    composeBackboneElement(t, "network", name, element, index);
    if (element.hasAddressElement())
        composeString(t, "AuditEvent", "address", element.getAddressElement(), -1);
    if (element.hasTypeElement())
        composeEnum(t, "AuditEvent", "type", element.getTypeElement(), -1);
}
Also used : Complex(org.hl7.fhir.dstu3.utils.formats.Turtle.Complex)

Example 73 with Address

use of org.hl7.fhir.dstu2016may.model.Address in project org.hl7.fhir.core by hapifhir.

the class RdfParser method composePerson.

protected void composePerson(Complex parent, String parentType, String name, Person element, int index) {
    if (element == null)
        return;
    Complex t;
    if (Utilities.noString(parentType))
        t = parent;
    else {
        t = parent.predicate("fhir:" + parentType + '.' + name);
    }
    composeDomainResource(t, "Person", name, element, index);
    for (int i = 0; i < element.getIdentifier().size(); i++) composeIdentifier(t, "Person", "identifier", element.getIdentifier().get(i), i);
    for (int i = 0; i < element.getName().size(); i++) composeHumanName(t, "Person", "name", element.getName().get(i), i);
    for (int i = 0; i < element.getTelecom().size(); i++) composeContactPoint(t, "Person", "telecom", element.getTelecom().get(i), i);
    if (element.hasGenderElement())
        composeEnum(t, "Person", "gender", element.getGenderElement(), -1);
    if (element.hasBirthDateElement())
        composeDate(t, "Person", "birthDate", element.getBirthDateElement(), -1);
    for (int i = 0; i < element.getAddress().size(); i++) composeAddress(t, "Person", "address", element.getAddress().get(i), i);
    if (element.hasPhoto())
        composeAttachment(t, "Person", "photo", element.getPhoto(), -1);
    if (element.hasManagingOrganization())
        composeReference(t, "Person", "managingOrganization", element.getManagingOrganization(), -1);
    if (element.hasActiveElement())
        composeBoolean(t, "Person", "active", element.getActiveElement(), -1);
    for (int i = 0; i < element.getLink().size(); i++) composePersonPersonLinkComponent(t, "Person", "link", element.getLink().get(i), i);
}
Also used : Complex(org.hl7.fhir.dstu2016may.formats.RdfGenerator.Complex)

Example 74 with Address

use of org.hl7.fhir.dstu2016may.model.Address in project org.hl7.fhir.core by hapifhir.

the class RdfParser method composePatient.

protected void composePatient(Complex parent, String parentType, String name, Patient element, int index) {
    if (element == null)
        return;
    Complex t;
    if (Utilities.noString(parentType))
        t = parent;
    else {
        t = parent.predicate("fhir:" + parentType + '.' + name);
    }
    composeDomainResource(t, "Patient", name, element, index);
    for (int i = 0; i < element.getIdentifier().size(); i++) composeIdentifier(t, "Patient", "identifier", element.getIdentifier().get(i), i);
    if (element.hasActiveElement())
        composeBoolean(t, "Patient", "active", element.getActiveElement(), -1);
    for (int i = 0; i < element.getName().size(); i++) composeHumanName(t, "Patient", "name", element.getName().get(i), i);
    for (int i = 0; i < element.getTelecom().size(); i++) composeContactPoint(t, "Patient", "telecom", element.getTelecom().get(i), i);
    if (element.hasGenderElement())
        composeEnum(t, "Patient", "gender", element.getGenderElement(), -1);
    if (element.hasBirthDateElement())
        composeDate(t, "Patient", "birthDate", element.getBirthDateElement(), -1);
    if (element.hasDeceased())
        composeType(t, "Patient", "deceased", element.getDeceased(), -1);
    for (int i = 0; i < element.getAddress().size(); i++) composeAddress(t, "Patient", "address", element.getAddress().get(i), i);
    if (element.hasMaritalStatus())
        composeCodeableConcept(t, "Patient", "maritalStatus", element.getMaritalStatus(), -1);
    if (element.hasMultipleBirth())
        composeType(t, "Patient", "multipleBirth", element.getMultipleBirth(), -1);
    for (int i = 0; i < element.getPhoto().size(); i++) composeAttachment(t, "Patient", "photo", element.getPhoto().get(i), i);
    for (int i = 0; i < element.getContact().size(); i++) composePatientContactComponent(t, "Patient", "contact", element.getContact().get(i), i);
    if (element.hasAnimal())
        composePatientAnimalComponent(t, "Patient", "animal", element.getAnimal(), -1);
    for (int i = 0; i < element.getCommunication().size(); i++) composePatientPatientCommunicationComponent(t, "Patient", "communication", element.getCommunication().get(i), i);
    for (int i = 0; i < element.getGeneralPractitioner().size(); i++) composeReference(t, "Patient", "generalPractitioner", element.getGeneralPractitioner().get(i), i);
    if (element.hasManagingOrganization())
        composeReference(t, "Patient", "managingOrganization", element.getManagingOrganization(), -1);
    for (int i = 0; i < element.getLink().size(); i++) composePatientPatientLinkComponent(t, "Patient", "link", element.getLink().get(i), i);
}
Also used : Complex(org.hl7.fhir.dstu3.utils.formats.Turtle.Complex)

Example 75 with Address

use of org.hl7.fhir.dstu2016may.model.Address in project org.hl7.fhir.core by hapifhir.

the class RdfParser method composeLocation.

protected void composeLocation(Complex parent, String parentType, String name, Location element, int index) {
    if (element == null)
        return;
    Complex t;
    if (Utilities.noString(parentType))
        t = parent;
    else {
        t = parent.predicate("fhir:" + parentType + '.' + name);
    }
    composeDomainResource(t, "Location", name, element, index);
    for (int i = 0; i < element.getIdentifier().size(); i++) composeIdentifier(t, "Location", "identifier", element.getIdentifier().get(i), i);
    if (element.hasStatusElement())
        composeEnum(t, "Location", "status", element.getStatusElement(), -1);
    if (element.hasOperationalStatus())
        composeCoding(t, "Location", "operationalStatus", element.getOperationalStatus(), -1);
    if (element.hasNameElement())
        composeString(t, "Location", "name", element.getNameElement(), -1);
    for (int i = 0; i < element.getAlias().size(); i++) composeString(t, "Location", "alias", element.getAlias().get(i), i);
    if (element.hasDescriptionElement())
        composeString(t, "Location", "description", element.getDescriptionElement(), -1);
    if (element.hasModeElement())
        composeEnum(t, "Location", "mode", element.getModeElement(), -1);
    if (element.hasType())
        composeCodeableConcept(t, "Location", "type", element.getType(), -1);
    for (int i = 0; i < element.getTelecom().size(); i++) composeContactPoint(t, "Location", "telecom", element.getTelecom().get(i), i);
    if (element.hasAddress())
        composeAddress(t, "Location", "address", element.getAddress(), -1);
    if (element.hasPhysicalType())
        composeCodeableConcept(t, "Location", "physicalType", element.getPhysicalType(), -1);
    if (element.hasPosition())
        composeLocationLocationPositionComponent(t, "Location", "position", element.getPosition(), -1);
    if (element.hasManagingOrganization())
        composeReference(t, "Location", "managingOrganization", element.getManagingOrganization(), -1);
    if (element.hasPartOf())
        composeReference(t, "Location", "partOf", element.getPartOf(), -1);
    for (int i = 0; i < element.getEndpoint().size(); i++) composeReference(t, "Location", "endpoint", element.getEndpoint().get(i), i);
}
Also used : Complex(org.hl7.fhir.dstu3.utils.formats.Turtle.Complex)

Aggregations

Address (org.hl7.fhir.r4.model.Address)75 Test (org.junit.Test)47 Patient (org.hl7.fhir.r4.model.Patient)30 Test (org.junit.jupiter.api.Test)30 PersonAddress (org.openmrs.PersonAddress)27 HumanName (org.hl7.fhir.r4.model.HumanName)24 Identifier (org.hl7.fhir.r4.model.Identifier)23 ArrayList (java.util.ArrayList)22 Address (org.hl7.fhir.dstu3.model.Address)22 Path (javax.ws.rs.Path)20 Produces (javax.ws.rs.Produces)20 NotImplementedException (org.apache.commons.lang3.NotImplementedException)19 ContactPoint (org.hl7.fhir.r4.model.ContactPoint)19 Location (org.hl7.fhir.r4.model.Location)13 Organization (org.hl7.fhir.r4.model.Organization)13 InputStream (java.io.InputStream)12 IdType (org.hl7.fhir.dstu3.model.IdType)12 Patient (org.hl7.fhir.dstu3.model.Patient)12 Complex (org.hl7.fhir.dstu3.utils.formats.Turtle.Complex)12 BaseModuleContextSensitiveTest (org.openmrs.test.BaseModuleContextSensitiveTest)12