@Update public MethodOutcome updatePatientWithRawValue ( @ResourceParam Patient thePatient, @IdParam IdType theId, @ResourceParam String theRawBody, @ResourceParam EncodingEnum theEncodingEnum) { // Here, thePatient will have the parsed patient body, but // theRawBody will also have the raw text of the resource // being created, and theEncodingEnum will tell you which // encoding was used return new MethodOutcome(); // populate this } //END SNIPPET: updateRaw
/** A FHIR create */ @Create public MethodOutcome createPatient(@ResourceParam Patient thePatient);
@Validate public MethodOutcome validate(@ResourceParam T theResource, @ResourceParam String theRawResource, @ResourceParam EncodingEnum theEncoding, @Validate.Mode ValidationModeEnum theMode, @Validate.Profile String theProfile, RequestDetails theRequestDetails) { return validate(theResource, null, theRawResource, theEncoding, theMode, theProfile, theRequestDetails); }
@Validate public MethodOutcome validate(@ResourceParam T theResource, @ResourceParam String theRawResource, @ResourceParam EncodingEnum theEncoding, @Validate.Mode ValidationModeEnum theMode, @Validate.Profile String theProfile, RequestDetails theRequestDetails) { return validate(theResource, null, theRawResource, theEncoding, theMode, theProfile, theRequestDetails); }
@Validate public MethodOutcome validate(@ResourceParam T theResource, @ResourceParam String theRawResource, @ResourceParam EncodingEnum theEncoding, @Validate.Mode ValidationModeEnum theMode, @Validate.Profile String theProfile, RequestDetails theRequestDetails) { return validate(theResource, null, theRawResource, theEncoding, theMode, theProfile, theRequestDetails); }
@Validate public MethodOutcome validate(@ResourceParam T theResource, @IdParam IdType theId, @ResourceParam String theRawResource, @ResourceParam EncodingEnum theEncoding, @Validate.Mode ValidationModeEnum theMode, @Validate.Profile String theProfile, RequestDetails theRequestDetails) { return getDao().validate(theResource, theId, theRawResource, theEncoding, theMode, theProfile, theRequestDetails); }
@Validate public MethodOutcome validate(@ResourceParam T theResource, @IdParam IdDt theId, @ResourceParam String theRawResource, @ResourceParam EncodingEnum theEncoding, @Validate.Mode ValidationModeEnum theMode, @Validate.Profile String theProfile, RequestDetails theRequestDetails) { return getDao().validate(theResource, theId, theRawResource, theEncoding, theMode, theProfile, theRequestDetails); }
@Validate public MethodOutcome validate(@ResourceParam T theResource, @IdParam IdType theId, @ResourceParam String theRawResource, @ResourceParam EncodingEnum theEncoding, @Validate.Mode ValidationModeEnum theMode, @Validate.Profile String theProfile, RequestDetails theRequestDetails) { return getDao().validate(theResource, theId, theRawResource, theEncoding, theMode, theProfile, theRequestDetails); }
@Create public MethodOutcome createPatient(@ResourceParam Patient patient) { patient.setId(createId(counter, 1L)); patients.put(String.valueOf(counter), patient); return new MethodOutcome(patient.getIdElement()); }
@Create public MethodOutcome create(@ResourceParam T theResource) { long idPart = myNextId++; String idPartAsString = Long.toString(idPart); Long versionIdPart = 1L; IIdType id = store(theResource, idPartAsString, versionIdPart); myCreateCount.incrementAndGet(); return new MethodOutcome() .setCreated(true) .setId(id); }
@Update public MethodOutcome update(@IdParam IdType theId, @ResourceParam Patient thePatient) { String resourceId = theId.getIdPart(); String versionId = theId.getVersionIdPart(); // this will contain the ETag String currentVersion = "1"; // populate this with the current version if (!versionId.equals(currentVersion)) { throw new ResourceVersionConflictException("Expected version " + currentVersion); } // ... perform the update ... return new MethodOutcome(); } //END SNIPPET: updateEtag
@Create public MethodOutcome createPatientResource(@ResourceParam Patient thePatient) { // ..save the resouce.. IdType id = new IdType("123"); // the new databse primary key for this resource // Get the tag list List<Coding> tags = thePatient.getMeta().getTag(); for (Coding tag : tags) { // process/save each tag somehow } return new MethodOutcome(id); } //END SNIPPET: createTags
@Patch public DaoMethodOutcome patch(HttpServletRequest theRequest, @IdParam IIdType theId, RequestDetails theRequestDetails, @ResourceParam String theBody, PatchTypeEnum thePatchType) { startRequest(theRequest); try { return myDao.patch(theId, thePatchType, theBody, theRequestDetails); } finally { endRequest(theRequest); } }
@Patch public OperationOutcome patientPatch(@IdParam IdType theId, PatchTypeEnum thePatchType, @ResourceParam String theBody) { if (thePatchType == PatchTypeEnum.JSON_PATCH) { // do something } if (thePatchType == PatchTypeEnum.XML_PATCH) { // do something } OperationOutcome retVal = new OperationOutcome(); retVal.getText().setDivAsString("<div>OK</div>"); return retVal; } //END SNIPPET: patch
@Create public MethodOutcome create(@ResourceParam final Patient patient, @ConditionalUrlParam String theConditional) { // create the patient ... return new MethodOutcome(new IdDt(1L)).setCreated(true); }
@Create public MethodOutcome create(HttpServletRequest theRequest, @ResourceParam T theResource, @ConditionalUrlParam String theConditional, RequestDetails theRequestDetails) { startRequest(theRequest); try { if (theConditional != null) { return getDao().create(theResource, theConditional, theRequestDetails); } else { return getDao().create(theResource, theRequestDetails); } } finally { endRequest(theRequest); } }
@Create public MethodOutcome create(HttpServletRequest theRequest, @ResourceParam T theResource, @ConditionalUrlParam String theConditional, RequestDetails theRequestDetails) { startRequest(theRequest); try { if (theConditional != null) { return getDao().create(theResource, theConditional, theRequestDetails); } else { return getDao().create(theResource, theRequestDetails); } } finally { endRequest(theRequest); } }
@Create public MethodOutcome create(HttpServletRequest theRequest, @ResourceParam T theResource, @ConditionalUrlParam String theConditional, RequestDetails theRequestDetails) { startRequest(theRequest); try { if (theConditional != null) { return getDao().create(theResource, theConditional, theRequestDetails); } else { return getDao().create(theResource, theRequestDetails); } } finally { endRequest(theRequest); } }
@Update public MethodOutcome update(HttpServletRequest theRequest, @ResourceParam T theResource, @IdParam IdType theId, @ConditionalUrlParam String theConditional, RequestDetails theRequestDetails) { startRequest(theRequest); try { if (theConditional != null) { return getDao().update(theResource, theConditional, theRequestDetails); } else { return getDao().update(theResource, theRequestDetails); } } finally { endRequest(theRequest); } }
@Update public MethodOutcome update(HttpServletRequest theRequest, @ResourceParam T theResource, @IdParam IdType theId, @ConditionalUrlParam String theConditional, RequestDetails theRequestDetails) { startRequest(theRequest); try { if (theConditional != null) { return getDao().update(theResource, theConditional, theRequestDetails); } else { return getDao().update(theResource, theRequestDetails); } } finally { endRequest(theRequest); } }