Search in sources :

Example 86 with Location

use of com.google.api.services.actions_fulfillment.v2.model.Location in project synthea by synthetichealth.

the class FhirR4PatientHome method getPatientHome.

/**
 * Provides the one and only patient home Location.
 * @return a Location resource
 */
public static Location getPatientHome() {
    if (patientHome == null) {
        patientHome = new Location();
        patientHome.setMode(org.hl7.fhir.r4.model.Location.LocationMode.KIND);
        patientHome.setStatus(Location.LocationStatus.ACTIVE);
        patientHome.setPhysicalType(new CodeableConcept().addCoding(new Coding().setCode(LocationPhysicalType.HO.toCode()).setSystem(LocationPhysicalType.HO.getSystem()).setDisplay(LocationPhysicalType.HO.getDisplay())));
        patientHome.setDescription("Patient's Home");
        // Not really generating a random UUID. Given that this is not tied to a particular provider
        // or person, this just makes up a person with a hardcoded random seed.
        patientHome.setId(new Person(1).randUUID().toString());
    }
    return patientHome;
}
Also used : Coding(org.hl7.fhir.r4.model.Coding) Person(org.mitre.synthea.world.agents.Person) Location(org.hl7.fhir.r4.model.Location) CodeableConcept(org.hl7.fhir.r4.model.CodeableConcept)

Example 87 with Location

use of com.google.api.services.actions_fulfillment.v2.model.Location in project metacat by Netflix.

the class S3ConnectorInfoConverter method fromStorageInfo.

/**
 * Converts from storage info to s3 location.
 * @param storageInfo storage info
 * @return location
 */
Location fromStorageInfo(final StorageInfo storageInfo) {
    final Location result = new Location();
    if (storageInfo != null) {
        result.setUri(storageInfo.getUri());
        final Info info = new Info();
        info.setLocation(result);
        info.setOwner(storageInfo.getOwner());
        info.setInputFormat(storageInfo.getInputFormat());
        info.setOutputFormat(storageInfo.getOutputFormat());
        info.setSerializationLib(storageInfo.getSerializationLib());
        final Map<String, String> parameters = Maps.newHashMap();
        if (storageInfo.getParameters() != null) {
            parameters.putAll(storageInfo.getParameters());
        }
        if (storageInfo.getSerdeInfoParameters() != null) {
            parameters.putAll(storageInfo.getSerdeInfoParameters());
        }
        info.setParameters(parameters);
        result.setInfo(info);
    }
    return result;
}
Also used : AuditInfo(com.netflix.metacat.common.server.connectors.model.AuditInfo) DatabaseInfo(com.netflix.metacat.common.server.connectors.model.DatabaseInfo) FieldInfo(com.netflix.metacat.common.server.connectors.model.FieldInfo) PartitionInfo(com.netflix.metacat.common.server.connectors.model.PartitionInfo) StorageInfo(com.netflix.metacat.common.server.connectors.model.StorageInfo) Info(com.netflix.metacat.connector.s3.model.Info) TableInfo(com.netflix.metacat.common.server.connectors.model.TableInfo) Location(com.netflix.metacat.connector.s3.model.Location)

Example 88 with Location

use of com.google.api.services.actions_fulfillment.v2.model.Location in project metacat by Netflix.

the class S3ConnectorInfoConverter method fromTableInfo.

@Override
public Table fromTableInfo(final TableInfo tableInfo) {
    final Table result = new Table();
    result.setName(tableInfo.getName().getTableName());
    final Location location = toLocation(tableInfo);
    if (location != null) {
        result.setLocation(location);
        location.setTable(result);
    }
    return result;
}
Also used : Table(com.netflix.metacat.connector.s3.model.Table) Location(com.netflix.metacat.connector.s3.model.Location)

Example 89 with Location

use of com.google.api.services.actions_fulfillment.v2.model.Location in project metacat by Netflix.

the class S3ConnectorInfoConverter method toStorageInfo.

/**
 * Converts from s3 table info to storage info.
 * @param table table info
 * @return table info
 */
StorageInfo toStorageInfo(final Table table) {
    StorageInfo result = null;
    final Location location = table.getLocation();
    if (location != null) {
        final Map<String, String> infoParameters = Maps.newHashMap();
        result = new StorageInfo();
        result.setUri(location.getUri());
        final Info info = location.getInfo();
        if (info != null) {
            result.setOwner(info.getOwner());
            result.setInputFormat(info.getInputFormat());
            result.setOutputFormat(info.getOutputFormat());
            result.setSerializationLib(info.getSerializationLib());
            if (info.getParameters() != null) {
                infoParameters.putAll(info.getParameters());
            }
        }
        result.setSerdeInfoParameters(infoParameters);
        result.setParameters(Maps.newHashMap());
    }
    return result;
}
Also used : StorageInfo(com.netflix.metacat.common.server.connectors.model.StorageInfo) AuditInfo(com.netflix.metacat.common.server.connectors.model.AuditInfo) DatabaseInfo(com.netflix.metacat.common.server.connectors.model.DatabaseInfo) FieldInfo(com.netflix.metacat.common.server.connectors.model.FieldInfo) PartitionInfo(com.netflix.metacat.common.server.connectors.model.PartitionInfo) StorageInfo(com.netflix.metacat.common.server.connectors.model.StorageInfo) Info(com.netflix.metacat.connector.s3.model.Info) TableInfo(com.netflix.metacat.common.server.connectors.model.TableInfo) Location(com.netflix.metacat.connector.s3.model.Location)

Example 90 with Location

use of com.google.api.services.actions_fulfillment.v2.model.Location in project metacat by Netflix.

the class S3ConnectorInfoConverter method getOwner.

/**
 * Gets the owner for the given table.
 * @param table table info
 * @return owner name
 */
public String getOwner(final Table table) {
    String result = null;
    final Location location = table.getLocation();
    if (location != null) {
        final Info info = location.getInfo();
        if (info != null) {
            result = info.getOwner();
        }
    }
    return result;
}
Also used : AuditInfo(com.netflix.metacat.common.server.connectors.model.AuditInfo) DatabaseInfo(com.netflix.metacat.common.server.connectors.model.DatabaseInfo) FieldInfo(com.netflix.metacat.common.server.connectors.model.FieldInfo) PartitionInfo(com.netflix.metacat.common.server.connectors.model.PartitionInfo) StorageInfo(com.netflix.metacat.common.server.connectors.model.StorageInfo) Info(com.netflix.metacat.connector.s3.model.Info) TableInfo(com.netflix.metacat.common.server.connectors.model.TableInfo) Location(com.netflix.metacat.connector.s3.model.Location)

Aggregations

Test (org.junit.Test)120 Location (org.hl7.fhir.r4.model.Location)93 Location (org.hl7.fhir.dstu3.model.Location)66 IBundleProvider (ca.uhn.fhir.rest.api.server.IBundleProvider)59 MockHttpServletResponse (org.springframework.mock.web.MockHttpServletResponse)42 BaseModuleContextSensitiveTest (org.openmrs.test.BaseModuleContextSensitiveTest)30 SearchParameterMap (org.openmrs.module.fhir2.api.search.param.SearchParameterMap)27 BaseFhirProvenanceResourceTest (org.openmrs.module.fhir2.providers.BaseFhirProvenanceResourceTest)21 StringAndListParam (ca.uhn.fhir.rest.param.StringAndListParam)20 StringOrListParam (ca.uhn.fhir.rest.param.StringOrListParam)20 StringParam (ca.uhn.fhir.rest.param.StringParam)20 ReferenceAndListParam (ca.uhn.fhir.rest.param.ReferenceAndListParam)16 ReferenceOrListParam (ca.uhn.fhir.rest.param.ReferenceOrListParam)16 ReferenceParam (ca.uhn.fhir.rest.param.ReferenceParam)16 MockIBundleProvider (org.openmrs.module.fhir2.providers.r4.MockIBundleProvider)16 TokenAndListParam (ca.uhn.fhir.rest.param.TokenAndListParam)13 Test (org.junit.jupiter.api.Test)13 ArrayList (java.util.ArrayList)11 HashSet (java.util.HashSet)11 TokenParam (ca.uhn.fhir.rest.param.TokenParam)10