use of net.geoprism.registry.model.ServerGeoObjectType in project geoprism-registry by terraframe.
the class DHIS2AttributeMapping method writeStandardAttributes.
public void writeStandardAttributes(VertexServerGeoObject serverGo, JsonObject jo, DHIS2SyncConfig dhis2Config, DHIS2SyncLevel level) {
if (this.isStandardAttribute()) {
ServerGeoObjectType got = level.getGeoObjectType();
AttributeType attr = got.getAttribute(this.getCgrAttrName()).get();
Object value = serverGo.getValue(attr.getName());
if (value == null || (value instanceof String && ((String) value).length() == 0)) {
return;
}
this.writeAttributeValue(attr, this.dhis2AttrName, value, jo);
}
}
use of net.geoprism.registry.model.ServerGeoObjectType in project geoprism-registry by terraframe.
the class DHIS2AttributeMapping method writeCustomAttributes.
public void writeCustomAttributes(JsonArray attributeValues, VertexServerGeoObject serverGo, DHIS2SyncConfig dhis2Config, DHIS2SyncLevel syncLevel, String lastUpdateDate, String createDate) {
if (this.isCustomAttribute()) {
ServerGeoObjectType got = syncLevel.getGeoObjectType();
AttributeType attr = got.getAttribute(this.getCgrAttrName()).get();
Object value = serverGo.getValue(attr.getName());
if (value == null || (value instanceof String && ((String) value).length() == 0)) {
return;
}
JsonObject av = new JsonObject();
av.addProperty("lastUpdated", lastUpdateDate);
av.addProperty("created", createDate);
this.writeAttributeValue(attr, "value", value, av);
JsonObject joAttr = new JsonObject();
joAttr.addProperty("id", this.getExternalId());
av.add("attribute", joAttr);
attributeValues.add(av);
}
}
use of net.geoprism.registry.model.ServerGeoObjectType in project geoprism-registry by terraframe.
the class MCSDFhirDataPopulator method populate.
@Override
public void populate(Business row, Facility facility) {
super.populate(row, facility);
ServerGeoObjectType type = this.getList().getGeoObjectType();
String label = type.getLabel().getValue();
String system = this.getContext().getSystem();
CodeableConcept concept = new CodeableConcept().setText(label).addCoding(new Coding(system, type.getCode(), label));
Location location = facility.getLocation();
location.addType(concept);
location.getMeta().addProfile("http://ihe.net/fhir/StructureDefinition/IHE.mCSD.Location");
Organization organization = facility.getOrganization();
organization.addType(concept);
organization.getMeta().addProfile("http://ihe.net/fhir/StructureDefinition/IHE.mCSD.Organization");
if (type.getGeometryType().equals(GeometryType.MULTIPOINT)) {
location.getMeta().addProfile("http://ihe.net/fhir/StructureDefinition/IHE.mCSD.FacilityLocation");
location.addType(new CodeableConcept().addCoding(new Coding("urn:ietf:rfc:3986", "urn:ihe:iti:mcsd:2019:facility", "Facility")));
location.setPhysicalType(new CodeableConcept().setText("Building").addCoding(new Coding("http://terminology.hl7.org/CodeSystem/location-physical-type", "bu", "Building")));
organization.getMeta().addProfile("http://ihe.net/fhir/StructureDefinition/IHE.mCSD.FacilityOrganization");
organization.addType(new CodeableConcept().addCoding(new Coding("urn:ietf:rfc:3986", "urn:ihe:iti:mcsd:2019:facility", "Facility")));
} else {
location.getMeta().addProfile("http://ihe.net/fhir/StructureDefinition/IHE.mCSD.JurisdictionLocation");
location.addType(new CodeableConcept().addCoding(new Coding("urn:ietf:rfc:3986", "urn:ihe:iti:mcsd:2019:jurisdiction", "Jurisdiction")));
location.setPhysicalType(new CodeableConcept().setText("Jurisdiction").addCoding(new Coding("http://terminology.hl7.org/CodeSystem/location-physical-type", "jdn", "Jurisdiction")));
organization.getMeta().addProfile("http://ihe.net/fhir/StructureDefinition/IHE.mCSD.JurisdictionsOrganization");
organization.addType(new CodeableConcept().addCoding(new Coding("urn:ietf:rfc:3986", "urn:ihe:iti:mcsd:2019:jurisdiction", "Jurisdiction")));
}
if (this.hierarchies.size() > 1) {
for (ServerHierarchyType hierarchy : this.hierarchies) {
this.addHierarchyExtension(row, facility, hierarchy);
}
} else if (this.hierarchies.size() == 1) {
this.setPartOf(row, facility, this.hierarchies.get(0));
}
}
use of net.geoprism.registry.model.ServerGeoObjectType in project geoprism-registry by terraframe.
the class TolkienFhirDataPopulator method populate.
@Override
public void populate(Business row, Facility facility) {
super.populate(row, facility);
ServerGeoObjectType type = this.getList().getGeoObjectType();
String label = type.getLabel().getValue();
String system = this.getContext().getSystem();
CodeableConcept concept = new CodeableConcept().setText(label).addCoding(new Coding(system, type.getCode(), label));
Location location = facility.getLocation();
location.addType(concept);
location.getMeta().addProfile("http://ihe.net/fhir/StructureDefinition/IHE.mCSD.Location");
Organization organization = facility.getOrganization();
organization.addType(concept);
organization.getMeta().addProfile("http://ihe.net/fhir/StructureDefinition/IHE.mCSD.Organization");
if (type.getGeometryType().equals(GeometryType.MULTIPOINT)) {
location.getMeta().addProfile("http://ihe.net/fhir/StructureDefinition/IHE.mCSD.FacilityLocation");
location.addType(new CodeableConcept().addCoding(new Coding("urn:ietf:rfc:3986", "urn:ihe:iti:mcsd:2019:facility", "Facility")));
location.setPhysicalType(new CodeableConcept().setText("Building").addCoding(new Coding("http://terminology.hl7.org/CodeSystem/location-physical-type", "bu", "Building")));
organization.getMeta().addProfile("http://ihe.net/fhir/StructureDefinition/IHE.mCSD.FacilityOrganization");
organization.addType(new CodeableConcept().addCoding(new Coding("urn:ietf:rfc:3986", "urn:ihe:iti:mcsd:2019:facility", "Facility")));
} else {
location.getMeta().addProfile("http://ihe.net/fhir/StructureDefinition/IHE.mCSD.JurisdictionLocation");
location.addType(new CodeableConcept().addCoding(new Coding("urn:ietf:rfc:3986", "urn:ihe:iti:mcsd:2019:jurisdiction", "Jurisdiction")));
location.setPhysicalType(new CodeableConcept().setText("Jurisdiction").addCoding(new Coding("http://terminology.hl7.org/CodeSystem/location-physical-type", "jdn", "Jurisdiction")));
organization.getMeta().addProfile("http://ihe.net/fhir/StructureDefinition/IHE.mCSD.JurisdictionsOrganization");
organization.addType(new CodeableConcept().addCoding(new Coding("urn:ietf:rfc:3986", "urn:ihe:iti:mcsd:2019:jurisdiction", "Jurisdiction")));
}
// if (this.hierarchies.size() > 1)
{
for (ServerHierarchyType hierarchy : this.hierarchies) {
this.addHierarchyExtension(row, facility, hierarchy);
}
}
// else if (this.hierarchies.size() == 1)
// {
// this.setPartOf(row, facility, this.hierarchies.get(0));
// }
}
use of net.geoprism.registry.model.ServerGeoObjectType in project geoprism-registry by terraframe.
the class GeoObjectImporter method setTermValue.
protected void setTermValue(ServerGeoObjectIF entity, AttributeType attributeType, String attributeName, Object value, Date startDate, Date endDate) {
if (!this.configuration.isExclusion(attributeName, value.toString())) {
try {
ServerGeoObjectType type = this.configuration.getType();
MdBusinessDAOIF mdBusiness = type.getMdBusinessDAO();
MdAttributeTermDAOIF mdAttribute = (MdAttributeTermDAOIF) mdBusiness.definesAttribute(attributeName);
if (mdAttribute == null && type.getSuperType() != null) {
mdAttribute = (MdAttributeTermDAOIF) type.getSuperType().getMdBusinessDAO().definesAttribute(attributeName);
}
Classifier classifier = Classifier.findMatchingTerm(value.toString().trim(), mdAttribute);
if (classifier == null) {
Term rootTerm = ((AttributeTermType) attributeType).getRootTerm();
TermReferenceProblem trp = new TermReferenceProblem(value.toString(), rootTerm.getCode(), mdAttribute.getOid(), attributeName, attributeType.getLabel().getValue());
trp.addAffectedRowNumber(this.progressListener.getWorkProgress() + 1);
trp.setHistoryId(this.configuration.getHistoryId());
this.progressListener.addReferenceProblem(trp);
} else {
entity.setValue(attributeName, classifier.getOid(), startDate, endDate);
}
} catch (UnknownTermException e) {
TermValueException ex = new TermValueException();
ex.setAttributeLabel(e.getAttribute().getLabel().getValue());
ex.setCode(e.getCode());
throw e;
}
}
}
Aggregations