@Search() public List<DiagnosticReport> getDiagnosticReport( @RequiredParam(name=DiagnosticReport.SP_IDENTIFIER) TokenParam theIdentifier, @IncludeParam(allow= {"DiagnosticReport:subject"}) String theInclude ) { List<DiagnosticReport> retVal = new ArrayList<DiagnosticReport>(); // Assume this method exists and loads the report from the DB DiagnosticReport report = loadSomeDiagnosticReportFromDatabase(theIdentifier); // If the client has asked for the subject to be included: if ("DiagnosticReport:subject".equals(theInclude)) { // The resource reference should contain the ID of the patient IIdType subjectId = report.getSubject().getReferenceElement(); // So load the patient ID and return it Patient subject = loadSomePatientFromDatabase(subjectId); report.getSubject().setResource(subject); } retVal.add(report); return retVal; } //END SNIPPET: pathSpecSimple
public void dateClientExample() { ITestClient client = provideTc(); //START SNIPPET: dateClient DateParam param = new DateParam(ParamPrefixEnum.GREATERTHAN_OR_EQUALS, "2011-01-02"); List<Patient> response = client.getPatientByDob(param); //END SNIPPET: dateClient }
savePatientToDatabase(thePatient);
savePatientToDatabase(theId, thePatient);
@Search() public List<DiagnosticReport> getDiagnosticReport( @RequiredParam(name=DiagnosticReport.SP_IDENTIFIER) TokenParam theIdentifier, @IncludeParam(allow= {"DiagnosticReport:subject"}) Set<Include> theIncludes ) { List<DiagnosticReport> retVal = new ArrayList<DiagnosticReport>(); // Assume this method exists and loads the report from the DB DiagnosticReport report = loadSomeDiagnosticReportFromDatabase(theIdentifier); // If the client has asked for the subject to be included: if (theIncludes.contains(new Include("DiagnosticReport:subject"))) { // The resource reference should contain the ID of the patient IIdType subjectId = report.getSubject().getReferenceElement(); // So load the patient ID and return it Patient subject = loadSomePatientFromDatabase(subjectId); report.getSubject().setResource(subject); } retVal.add(report); return retVal; } //END SNIPPET: pathSpec