@Override public JSONObject toJSON() { return this.patient.toJSON(); }
@Override public JSONObject toJSON(Collection<String> selectedFields) { return this.patient.toJSON(selectedFields); }
@Override public JSONObject getLocalPatientJSON(String patientID, String exportFieldListJSON) { Patient patient = getPatientByID(patientID, "view"); if (patient == null) { return null; } return patient.toJSON(parseJSONArrayIntoSet(exportFieldListJSON)); }
@Override public JSONObject getLocalPatientJSON(String patientID, String exportFieldListJSON) { Patient patient = getPatientByID(patientID, "view"); if (patient == null) { return null; } return patient.toJSON(parseJSONArrayIntoSet(exportFieldListJSON)); }
JSONArray orderedPatientGenes = patient.toJSON().optJSONArray("genes");
JSONArray similarityFeaturesJson = patient.toJSON().optJSONArray(PATIENTMATCHING_JSON_FEATUREMATCHES); if (similarityFeaturesJson == null) { return features;
String patientJSON = patient.toJSON(exportFields).toString(); this.logger.debug("Sending patient JSON: [{}]", patientJSON);
String patientJSON = patient.toJSON(exportFields).toString(); this.logger.debug("Sending patient JSON: [{}]", patientJSON);
grantedRight = manageRight; JSONObject json = patient.toJSON(); json.put("links", this.autolinker.get().forResource(getClass(), this.uriInfo)
@Override public Response getPatient(String eid) { this.slf4Jlogger.debug("Retrieving patient record with external ID [{}] via REST", eid); Patient patient = this.repository.getByName(eid); if (patient == null) { return checkForMultipleRecords(patient, eid); } User currentUser = this.users.getCurrentUser(); Right grantedRight; if (!this.access.hasAccess(currentUser, Right.VIEW, patient.getDocumentReference())) { this.slf4Jlogger.debug("View access denied to user [{}] on patient record [{}]", currentUser, patient.getId()); return Response.status(Status.FORBIDDEN).build(); } else { grantedRight = Right.VIEW; } if (this.access.hasAccess(currentUser, Right.EDIT, patient.getDocumentReference())) { grantedRight = Right.EDIT; } JSONObject json = patient.toJSON(); json.put("links", this.autolinker.get().forResource(PatientResource.class, this.uriInfo) .withExtraParameters("entity-id", patient.getId()) .withExtraParameters("entity-type", "patients") .withGrantedRight(grantedRight) .build()); return Response.ok(json, MediaType.APPLICATION_JSON_TYPE).build(); }
JSONObject json = patient.toJSON(); json.put("links", this.autolinker.get().forResource(PatientResource.class, this.uriInfo) .withExtraParameters("entity-id", patient.getId())