Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ public DelegatingResourceDescription getRepresentationDescription(Representation
description.addProperty("urlUserName");
description.addProperty("urlPassword");
description.addProperty("syncDataEverSince");
description.addProperty("isCaseBasedProfile");
description.addProperty("dataToSyncStartDate");
description.addProperty("searchable");
description.addProperty("searchURL");
Expand All @@ -125,26 +124,24 @@ public DelegatingResourceDescription getRepresentationDescription(Representation
description.addProperty("isCaseBasedProfile");
description.addProperty("caseBasedPrimaryResourceType");
description.addProperty("caseBasedPrimaryResourceTypeId");
description.addProperty("caseBasedPrimaryResourceType");
description.addProperty("resourceSearchParameter");
description.addProperty("conceptSource", Representation.REF);
description.addProperty("url");
description.addProperty("syncLimit");
description.addProperty("url");
description.addProperty("urlToken");
description.addProperty("urlUserName");
description.addProperty("urlPassword");
description.addProperty("syncDataEverSince");
description.addProperty("dataToSyncStartDate");
description.addProperty("searchable");
description.addProperty("searchURL");
description.addProperty("creator", Representation.REF);
description.addProperty("dateCreated");
description.addProperty("changedBy", Representation.REF);
description.addProperty("dateChanged");
description.addProperty("voidedBy", Representation.REF);
description.addProperty("dateVoided");
description.addProperty("voidReason");
description.addProperty("syncDataEverSince");
description.addProperty("isCaseBasedProfile");
description.addProperty("dataToSyncStartDate");
description.addProperty("searchable");
description.addProperty("searchURL");
description.addSelfLink();
description.addLink("full", ".?v=" + RestConstants.REPRESENTATION_FULL);
return description;
Expand All @@ -169,7 +166,6 @@ public DelegatingResourceDescription getRepresentationDescription(Representation
description.addProperty("urlUserName");
description.addProperty("urlPassword");
description.addProperty("syncDataEverSince");
description.addProperty("isCaseBasedProfile");
description.addProperty("dataToSyncStartDate");
description.addProperty("searchable");
description.addProperty("searchURL");
Expand Down Expand Up @@ -197,7 +193,7 @@ public DelegatingResourceDescription getCreatableProperties() throws ResourceDoe
description.addProperty("profileEnabled");
description.addProperty("patientIdentifierType");
description.addProperty("numberOfResourcesInBundle");
description.addProperty("numberOfResourcesInBundle");
description.addProperty("durationToKeepSyncedResources");
description.addProperty("generateBundle");
description.addProperty("isCaseBasedProfile");
description.addProperty("caseBasedPrimaryResourceType");
Expand All @@ -210,14 +206,47 @@ public DelegatingResourceDescription getCreatableProperties() throws ResourceDoe
description.addProperty("urlUserName");
description.addProperty("urlPassword");
description.addProperty("syncDataEverSince");
description.addProperty("isCaseBasedProfile");
description.addProperty("dataToSyncStartDate");
description.addProperty("searchable");
description.addProperty("searchURL");

return description;
}

@Override
public DelegatingResourceDescription getUpdatableProperties() throws ResourceDoesNotSupportOperationException {
DelegatingResourceDescription description = new DelegatingResourceDescription();
description.addProperty("name");
description.addProperty("resourceTypes");
description.addProperty("profileEnabled");
description.addProperty("patientIdentifierType");
description.addProperty("numberOfResourcesInBundle");
description.addProperty("durationToKeepSyncedResources");
description.addProperty("generateBundle");
description.addProperty("isCaseBasedProfile");
description.addProperty("caseBasedPrimaryResourceType");
description.addProperty("caseBasedPrimaryResourceTypeId");
description.addProperty("resourceSearchParameter");
description.addProperty("conceptSource");
description.addProperty("syncLimit");
description.addProperty("url");
description.addProperty("urlToken");
description.addProperty("urlUserName");
description.addProperty("urlPassword");
description.addProperty("syncDataEverSince");
description.addProperty("dataToSyncStartDate");
description.addProperty("searchable");
description.addProperty("searchURL");
description.addProperty("dateChanged");
description.addProperty("changedBy");
description.addProperty("dateVoided");
description.addProperty("voidReason");
description.addProperty("voidedBy");
return description;
}



@Override
protected PageableResult doSearch(RequestContext context) {
UgandaEMRSyncService ugandaEMRSyncService = Context.getService(UgandaEMRSyncService.class);
Expand All @@ -237,36 +266,40 @@ public Model getGETModel(Representation rep) {
ModelImpl model = (ModelImpl) super.getGETModel(rep);
if (rep instanceof DefaultRepresentation || rep instanceof FullRepresentation) {
model.property("uuid", new StringProperty())
.property("name", new StringProperty())
.property("resourceTypes", new StringProperty())
.property("name", new StringProperty())
.property("resourceTypes", new StringProperty())
.property("profileEnabled", new BooleanProperty())
.property("patientIdentifierType", new StringProperty())
.property("numberOfResourcesInBundle", new IntegerProperty())
.property("durationToKeepSyncedResources", new IntegerProperty())
.property("durationToKeepSyncedResources", new IntegerProperty())
.property("generateBundle", new BooleanProperty())
.property("dataToSyncStartDate", new DateProperty())
.property("isCaseBasedProfile", new BooleanProperty())
.property("syncDataEverSince", new BooleanProperty())
.property("isCaseBasedProfile", new BooleanProperty())
.property("caseBasedPrimaryResourceType", new StringProperty())
.property("caseBasedPrimaryResourceTypeId", new StringProperty())
.property("caseBasedPrimaryResourceTypeId", new StringProperty())
.property("resourceSearchParameter", new StringProperty())
.property("syncLimit", new StringProperty())
.property("url", new StringProperty())
.property("urlToken", new StringProperty())
.property("urlUserName", new StringProperty())
.property("urlPassword", new StringProperty())
.property("syncDataEverSince", new BooleanProperty())
.property("dataToSyncStartDate", new DateProperty())
.property("searchable", new BooleanProperty())
.property("searchURL", new StringProperty());
.property("searchURL", new StringProperty())
.property("patientIdentifierType", new RefProperty("#/definitions/PatientIdentifierTypeGetRef"))
.property("conceptSource", new RefProperty("#/definitions/ConceptGetRef"));
}
if (rep instanceof DefaultRepresentation) {
model.property("patientIdentifierType", new RefProperty("#/definitions/PatientIdentifierTypeGetRef"))
.property("conceptSource", new RefProperty("#/definitions/ConceptGetRef"))
.property("creator", new RefProperty("#/definitions/UserGetRef"))
.property("changedBy", new RefProperty("#/definitions/UserGetRef"))
.property("voidedBy", new RefProperty("#/definitions/UserGetRef"));

model.property("dateChanged", new DateProperty())
.property("dateVoided", new DateProperty())
.property("creator", new RefProperty("#/definitions/UserGetRef"))
.property("changedBy", new RefProperty("#/definitions/UserGetRef"))
.property("voidedBy", new RefProperty("#/definitions/UserGetRef"));
} else if (rep instanceof FullRepresentation) {
model.property("patientIdentifierType", new RefProperty("#/definitions/PatientIdentifierTypeGetRef"))
.property("conceptSource", new RefProperty("#/definitions/ConceptGetRef"))
.property("creator", new RefProperty("#/definitions/UserGetRef"))
.property("changedBy", new RefProperty("#/definitions/UserGetRef"))
.property("voidedBy", new RefProperty("#/definitions/UserGetRef"));
model.property("dateChanged", new DateProperty())
.property("dateVoided", new DateProperty())
.property("creator", new RefProperty("#/definitions/UserGetRef"))
.property("changedBy", new RefProperty("#/definitions/UserGetRef"))
.property("voidedBy", new RefProperty("#/definitions/UserGetRef"));
}
return model;
}
Expand All @@ -275,66 +308,84 @@ public Model getGETModel(Representation rep) {
public Model getCREATEModel(Representation rep) {
ModelImpl model = (ModelImpl) super.getGETModel(rep);
if (rep instanceof DefaultRepresentation || rep instanceof FullRepresentation) {
model.property("uuid", new StringProperty())
.property("name", new StringProperty())
.property("resourceTypes", new StringProperty())
model.property("name", new StringProperty())
.property("resourceTypes", new StringProperty())
.property("profileEnabled", new BooleanProperty())
.property("patientIdentifierType", new StringProperty())
.property("numberOfResourcesInBundle", new IntegerProperty())
.property("durationToKeepSyncedResources", new IntegerProperty())
.property("durationToKeepSyncedResources", new IntegerProperty())
.property("generateBundle", new BooleanProperty())
.property("isCaseBasedProfile", new BooleanProperty())
.property("syncDataEverSince", new BooleanProperty())
.property("dataToSyncStartDate", new DateProperty())
.property("isCaseBasedProfile", new BooleanProperty())
.property("isCaseBasedProfile", new BooleanProperty())
.property("caseBasedPrimaryResourceType", new StringProperty())
.property("caseBasedPrimaryResourceTypeId", new StringProperty())
.property("caseBasedPrimaryResourceTypeId", new StringProperty())
.property("resourceSearchParameter", new StringProperty())
.property("syncLimit", new StringProperty())
.property("url", new StringProperty())
.property("urlToken", new StringProperty())
.property("urlUserName", new StringProperty())
.property("urlPassword", new StringProperty())
.property("syncDataEverSince", new BooleanProperty())
.property("dataToSyncStartDate", new DateProperty())
.property("searchable", new BooleanProperty())
.property("searchURL", new StringProperty());

.property("searchURL", new StringProperty())
.property("patientIdentifierType", new RefProperty("#/definitions/PatientIdentifierTypeGetRef"))
.property("conceptSource", new RefProperty("#/definitions/ConceptGetRef"));
}
if (rep instanceof DefaultRepresentation) {
model.property("patientIdentifierType", new RefProperty("#/definitions/PatientIdentifierTypeGetRef"))
.property("conceptSource", new RefProperty("#/definitions/ConceptGetRef"))
.property("creator", new RefProperty("#/definitions/UserGetRef"))
model.property("dateChanged", new DateProperty())
.property("dateVoided", new DateProperty())
.property("creator", new RefProperty("#/definitions/UserGetRef"))
.property("changedBy", new RefProperty("#/definitions/UserGetRef"))
.property("voidedBy", new RefProperty("#/definitions/UserGetRef"));

} else if (rep instanceof FullRepresentation) {
model.property("patientIdentifierType", new RefProperty("#/definitions/PatientIdentifierTypeGetRef"))
.property("conceptSource", new RefProperty("#/definitions/ConceptGetRef"))
.property("creator", new RefProperty("#/definitions/UserGetRef"))
.property("changedBy", new RefProperty("#/definitions/UserGetRef"))
.property("voidedBy", new RefProperty("#/definitions/UserGetRef"));
model.property("dateChanged", new DateProperty())
.property("dateVoided", new DateProperty())
.property("creator", new RefProperty("#/definitions/UserGetRef"))
.property("changedBy", new RefProperty("#/definitions/UserGetRef"))
.property("voidedBy", new RefProperty("#/definitions/UserGetRef"));
}
return model;
}

@Override
public Model getUPDATEModel(Representation rep) {
return new ModelImpl().property("uuid", new StringProperty())
.property("name", new StringProperty())
.property("resourceTypes", new StringProperty())
.property("profileEnabled", new BooleanProperty())
.property("patientIdentifierType", new StringProperty())
.property("numberOfResourcesInBundle", new IntegerProperty())
.property("durationToKeepSyncedResources", new IntegerProperty())
.property("dataToSyncStartDate", new DateProperty())
.property("generateBundle", new BooleanProperty())
.property("isCaseBasedProfile", new BooleanProperty())
.property("syncDataEverSince", new BooleanProperty())
.property("isCaseBasedProfile", new BooleanProperty())
.property("caseBasedPrimaryResourceType", new StringProperty())
.property("caseBasedPrimaryResourceTypeId", new StringProperty())
.property("resourceSearchParameter", new StringProperty())
.property("searchable", new BooleanProperty())
.property("searchURL", new StringProperty())
.property("patientIdentifierType", new RefProperty("#/definitions/PatientIdentifierTypeGetRef"))
.property("conceptSource", new RefProperty("#/definitions/ConceptGetRef"))
.property("creator", new RefProperty("#/definitions/UserGetRef"))
.property("changedBy", new RefProperty("#/definitions/UserGetRef"))
.property("voidedBy", new RefProperty("#/definitions/UserGetRef"));
ModelImpl model = (ModelImpl) super.getGETModel(rep);
if (rep instanceof DefaultRepresentation || rep instanceof FullRepresentation) {
model.property("name", new StringProperty())
.property("resourceTypes", new StringProperty())
.property("profileEnabled", new BooleanProperty())
.property("numberOfResourcesInBundle", new IntegerProperty())
.property("durationToKeepSyncedResources", new IntegerProperty())
.property("generateBundle", new BooleanProperty())
.property("isCaseBasedProfile", new BooleanProperty())
.property("caseBasedPrimaryResourceType", new StringProperty())
.property("caseBasedPrimaryResourceTypeId", new StringProperty())
.property("resourceSearchParameter", new StringProperty())
.property("syncLimit", new StringProperty())
.property("url", new StringProperty())
.property("urlToken", new StringProperty())
.property("urlUserName", new StringProperty())
.property("urlPassword", new StringProperty())
.property("syncDataEverSince", new BooleanProperty())
.property("dataToSyncStartDate", new DateProperty())
.property("searchable", new BooleanProperty())
.property("searchURL", new StringProperty())
.property("patientIdentifierType", new RefProperty("#/definitions/PatientIdentifierTypeGetRef"))
.property("conceptSource", new RefProperty("#/definitions/ConceptGetRef"));
}
if (rep instanceof DefaultRepresentation) {
model.property("dateChanged", new DateProperty())
.property("dateVoided", new DateProperty())
.property("creator", new RefProperty("#/definitions/UserGetRef"))
.property("changedBy", new RefProperty("#/definitions/UserGetRef"))
.property("voidedBy", new RefProperty("#/definitions/UserGetRef"));
} else if (rep instanceof FullRepresentation) {
model.property("dateChanged", new DateProperty())
.property("dateVoided", new DateProperty())
.property("creator", new RefProperty("#/definitions/UserGetRef"))
.property("changedBy", new RefProperty("#/definitions/UserGetRef"))
.property("voidedBy", new RefProperty("#/definitions/UserGetRef"));
}
return model;
}

private String processResourceSearchParameter(String resourceSearchParameter){
Expand Down