Java Code Examples for ca.uhn.fhir.rest.api.MethodOutcome#setId()
The following examples show how to use
ca.uhn.fhir.rest.api.MethodOutcome#setId() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ScheduleProvider.java From careconnect-reference-implementation with Apache License 2.0 | 6 votes |
@Update public MethodOutcome updateSchedule(HttpServletRequest theRequest, @ResourceParam Schedule schedule, @IdParam IdType theId, @ConditionalUrlParam String theConditional, RequestDetails theRequestDetails) { resourcePermissionProvider.checkPermission("update"); MethodOutcome method = new MethodOutcome(); method.setCreated(true); OperationOutcome opOutcome = new OperationOutcome(); method.setOperationOutcome(opOutcome); try { Schedule existingSchedule = scheduleDao.create(ctx, schedule, theId, theConditional); method.setId(existingSchedule.getIdElement()); method.setResource(existingSchedule); } catch (Exception ex) { ProviderResponseLibrary.handleException(method,ex); } return method; }
Example 2
Source File: MedicationStatementProvider.java From careconnect-reference-implementation with Apache License 2.0 | 6 votes |
@Create public MethodOutcome create(HttpServletRequest theRequest, @ResourceParam MedicationStatement statement) { resourcePermissionProvider.checkPermission("create"); MethodOutcome method = new MethodOutcome(); method.setCreated(true); OperationOutcome opOutcome = new OperationOutcome(); method.setOperationOutcome(opOutcome); try { MedicationStatement newMedicationStatement = statementDao.create(ctx,statement, null,null); method.setId(newMedicationStatement.getIdElement()); method.setResource(newMedicationStatement); } catch (Exception ex) { ProviderResponseLibrary.handleException(method,ex); } return method; }
Example 3
Source File: ValueSetProvider.java From careconnect-reference-implementation with Apache License 2.0 | 6 votes |
@Update() public MethodOutcome update(HttpServletRequest theRequest,@ResourceParam ValueSet valueSet) { resourcePermissionProvider.checkPermission("update"); MethodOutcome method = new MethodOutcome(); method.setCreated(true); OperationOutcome opOutcome = new OperationOutcome(); method.setOperationOutcome(opOutcome); try { ValueSet newValueSet = valueSetDao.create(ctx, valueSet); method.setId(newValueSet.getIdElement()); method.setResource(newValueSet); } catch (BaseServerResponseException srv) { // HAPI Exceptions pass through throw srv; } catch(Exception ex) { ProviderResponseLibrary.handleException(method,ex); } return method; }
Example 4
Source File: ClinicalImpressionProvider.java From careconnect-reference-implementation with Apache License 2.0 | 6 votes |
@Create public MethodOutcome create(HttpServletRequest theRequest, @ResourceParam ClinicalImpression impression) { resourcePermissionProvider.checkPermission("read"); MethodOutcome method = new MethodOutcome(); method.setCreated(true); OperationOutcome opOutcome = new OperationOutcome(); method.setOperationOutcome(opOutcome); try { ClinicalImpression newClinicalImpression = impressionDao.create(ctx,impression, null,null); method.setId(newClinicalImpression.getIdElement()); method.setResource(newClinicalImpression); } catch (Exception ex) { ProviderResponseLibrary.handleException(method,ex); } return method; }
Example 5
Source File: ReferralRequestProvider.java From careconnect-reference-implementation with Apache License 2.0 | 6 votes |
@Create public MethodOutcome createReferralRequest(HttpServletRequest theRequest, @ResourceParam ReferralRequest referral) { resourcePermissionProvider.checkPermission("create"); MethodOutcome method = new MethodOutcome(); method.setCreated(true); OperationOutcome opOutcome = new OperationOutcome(); method.setOperationOutcome(opOutcome); try { ReferralRequest newReferralRequest = referralDao.create(ctx, referral,null,null); method.setId(newReferralRequest.getIdElement()); method.setResource(newReferralRequest); } catch (Exception ex) { ProviderResponseLibrary.handleException(method,ex); } return method; }
Example 6
Source File: ImmunizationProvider.java From careconnect-reference-implementation with Apache License 2.0 | 6 votes |
@Create public MethodOutcome create(HttpServletRequest theRequest, @ResourceParam Immunization immunisation) { resourcePermissionProvider.checkPermission("create"); MethodOutcome method = new MethodOutcome(); method.setCreated(true); OperationOutcome opOutcome = new OperationOutcome(); method.setOperationOutcome(opOutcome); try { Immunization newImmunisation = immunisationDao.create(ctx,immunisation, null, null); method.setId(newImmunisation.getIdElement()); method.setResource(newImmunisation); } catch (Exception ex) { ProviderResponseLibrary.handleException(method,ex); } return method; }
Example 7
Source File: DiagnosticReportProvider.java From careconnect-reference-implementation with Apache License 2.0 | 6 votes |
@Create public MethodOutcome create(HttpServletRequest theRequest, @ResourceParam DiagnosticReport diagnosticReport) { resourcePermissionProvider.checkPermission("create"); MethodOutcome method = new MethodOutcome(); method.setCreated(true); OperationOutcome opOutcome = new OperationOutcome(); method.setOperationOutcome(opOutcome); try { DiagnosticReport newDiagnosticReport = diagnosticReportDao.create(ctx,diagnosticReport, null,null); method.setId(newDiagnosticReport.getIdElement()); method.setResource(newDiagnosticReport); } catch (Exception ex) { ProviderResponseLibrary.handleException(method,ex); } return method; }
Example 8
Source File: EndpointProvider.java From careconnect-reference-implementation with Apache License 2.0 | 6 votes |
@Update public MethodOutcome updateEndpoint(HttpServletRequest theRequest, @ResourceParam Endpoint endpoint, @IdParam IdType theId, @ConditionalUrlParam String theConditional, RequestDetails theRequestDetails) { resourcePermissionProvider.checkPermission("update"); MethodOutcome method = new MethodOutcome(); method.setCreated(true); OperationOutcome opOutcome = new OperationOutcome(); method.setOperationOutcome(opOutcome); try { Endpoint newEndpoint = endpointDao.create(ctx, endpoint, theId, theConditional); method.setId(newEndpoint.getIdElement()); method.setResource(newEndpoint); } catch (Exception ex) { ProviderResponseLibrary.handleException(method,ex); } return method; }
Example 9
Source File: TaskProvider.java From careconnect-reference-implementation with Apache License 2.0 | 6 votes |
@Create public MethodOutcome create(HttpServletRequest theRequest, @ResourceParam Task task) { resourcePermissionProvider.checkPermission("create"); MethodOutcome method = new MethodOutcome(); method.setCreated(true); OperationOutcome opOutcome = new OperationOutcome(); method.setOperationOutcome(opOutcome); try { Task newTask = taskDao.create(ctx,task, null,null); method.setId(newTask.getIdElement()); method.setResource(newTask); } catch (BaseServerResponseException srv) { // HAPI Exceptions pass through throw srv; } catch(Exception ex) { ProviderResponseLibrary.handleException(method,ex); } return method; }
Example 10
Source File: ReferralRequestProvider.java From careconnect-reference-implementation with Apache License 2.0 | 6 votes |
@Update public MethodOutcome updateReferralRequest(HttpServletRequest theRequest, @ResourceParam ReferralRequest referral, @IdParam IdType theId, @ConditionalUrlParam String theConditional, RequestDetails theRequestDetails) { resourcePermissionProvider.checkPermission("update"); MethodOutcome method = new MethodOutcome(); method.setCreated(true); OperationOutcome opOutcome = new OperationOutcome(); method.setOperationOutcome(opOutcome); try { ReferralRequest newReferralRequest = referralDao.create(ctx, referral, theId, theConditional); method.setId(newReferralRequest.getIdElement()); method.setResource(newReferralRequest); } catch (Exception ex) { ProviderResponseLibrary.handleException(method,ex); } return method; }
Example 11
Source File: ConsentProvider.java From careconnect-reference-implementation with Apache License 2.0 | 6 votes |
@Create public MethodOutcome create(HttpServletRequest theRequest, @ResourceParam Consent consent) { resourcePermissionProvider.checkPermission("create"); MethodOutcome method = new MethodOutcome(); method.setCreated(true); OperationOutcome opOutcome = new OperationOutcome(); method.setOperationOutcome(opOutcome); try { Consent newConsent = consentDao.create(ctx,consent, null,null); method.setId(newConsent.getIdElement()); method.setResource(newConsent); } catch (Exception ex) { ProviderResponseLibrary.handleException(method,ex); } return method; }
Example 12
Source File: NamingSystemProvider.java From careconnect-reference-implementation with Apache License 2.0 | 6 votes |
@Create public MethodOutcome create(HttpServletRequest theRequest, @ResourceParam NamingSystem namingSystem) { resourcePermissionProvider.checkPermission("create"); MethodOutcome method = new MethodOutcome(); method.setCreated(true); OperationOutcome opOutcome = new OperationOutcome(); method.setOperationOutcome(opOutcome); try { NamingSystem newNamingSystem = namingSystemDao.create(ctx, namingSystem); method.setId(newNamingSystem.getIdElement()); method.setResource(newNamingSystem); } catch (BaseServerResponseException srv) { // HAPI Exceptions pass through throw srv; } catch (Exception ex) { ProviderResponseLibrary.handleException(method, ex); } return method; }
Example 13
Source File: MedicationRequestProvider.java From careconnect-reference-implementation with Apache License 2.0 | 6 votes |
@Update public MethodOutcome update(HttpServletRequest theRequest, @ResourceParam MedicationRequest prescription, @IdParam IdType theId, @ConditionalUrlParam String theConditional, RequestDetails theRequestDetails) { resourcePermissionProvider.checkPermission("update"); MethodOutcome method = new MethodOutcome(); method.setCreated(true); OperationOutcome opOutcome = new OperationOutcome(); method.setOperationOutcome(opOutcome); try { MedicationRequest newMedicationRequest = prescriptionDao.create(ctx,prescription, theId, theConditional); method.setId(newMedicationRequest.getIdElement()); method.setResource(newMedicationRequest); } catch (Exception ex) { ProviderResponseLibrary.handleException(method,ex); } return method; }
Example 14
Source File: TaskProvider.java From careconnect-reference-implementation with Apache License 2.0 | 6 votes |
@Update public MethodOutcome update(HttpServletRequest theRequest, @ResourceParam Task task, @IdParam IdType theId, @ConditionalUrlParam String theConditional, RequestDetails theRequestDetails) { resourcePermissionProvider.checkPermission("update"); MethodOutcome method = new MethodOutcome(); method.setCreated(true); OperationOutcome opOutcome = new OperationOutcome(); method.setOperationOutcome(opOutcome); try { Task newTask = taskDao.create(ctx,task, theId, theConditional); method.setId(newTask.getIdElement()); method.setResource(newTask); } catch (BaseServerResponseException srv) { // HAPI Exceptions pass through throw srv; } catch(Exception ex) { ProviderResponseLibrary.handleException(method,ex); } return method; }
Example 15
Source File: NamingSystemProvider.java From careconnect-reference-implementation with Apache License 2.0 | 6 votes |
@Update() public MethodOutcome update(HttpServletRequest theRequest, @ResourceParam NamingSystem namingSystem) { resourcePermissionProvider.checkPermission("update"); MethodOutcome method = new MethodOutcome(); method.setCreated(true); OperationOutcome opOutcome = new OperationOutcome(); method.setOperationOutcome(opOutcome); try { NamingSystem newNamingSystem = namingSystemDao.create(ctx, namingSystem); method.setId(newNamingSystem.getIdElement()); method.setResource(newNamingSystem); } catch (BaseServerResponseException srv) { // HAPI Exceptions pass through throw srv; } catch (Exception ex) { ProviderResponseLibrary.handleException(method, ex); } return method; }
Example 16
Source File: AllergyIntoleranceProvider.java From careconnect-reference-implementation with Apache License 2.0 | 4 votes |
@Create public MethodOutcome create(HttpServletRequest theRequest, @ResourceParam AllergyIntolerance allergy) { resourcePermissionProvider.checkPermission("create"); MethodOutcome method = new MethodOutcome(); method.setCreated(true); OperationOutcome opOutcome = new OperationOutcome(); method.setOperationOutcome(opOutcome); try { AllergyIntolerance newAllergyIntolerance = allergyDao.create(ctx,allergy, null,null); method.setId(newAllergyIntolerance.getIdElement()); method.setResource(newAllergyIntolerance); } catch (Exception ex) { ProviderResponseLibrary.handleException(method,ex); } return method; }
Example 17
Source File: CareTeamProvider.java From careconnect-reference-implementation with Apache License 2.0 | 4 votes |
@Update public MethodOutcome update(HttpServletRequest theRequest, @ResourceParam CareTeam careTeam, @IdParam IdType theId, @ConditionalUrlParam String theConditional, RequestDetails theRequestDetails) { resourcePermissionProvider.checkPermission("update"); MethodOutcome method = new MethodOutcome(); method.setCreated(true); OperationOutcome opOutcome = new OperationOutcome(); method.setOperationOutcome(opOutcome); try { CareTeam newCareTeam = careTeamDao.create(ctx,careTeam, theId, theConditional); method.setId(newCareTeam.getIdElement()); method.setResource(newCareTeam); } catch (Exception ex) { ProviderResponseLibrary.handleException(method,ex); } return method; }
Example 18
Source File: PersonProvider.java From careconnect-reference-implementation with Apache License 2.0 | 4 votes |
@Create public MethodOutcome create(HttpServletRequest theRequest, @ResourceParam Person person) throws OperationOutcomeException { log.info("Update Person Provider called"); MethodOutcome method = new MethodOutcome(); method.setCreated(true); OperationOutcome opOutcome = new OperationOutcome(); method.setOperationOutcome(opOutcome); Person newPerson = null; newPerson = personDao.update(ctx, person, null); method.setId(newPerson.getIdElement()); method.setResource(newPerson); log.debug("called create Person method"); return method; }
Example 19
Source File: PersonProvider.java From careconnect-reference-implementation with Apache License 2.0 | 4 votes |
@Update public MethodOutcome update(HttpServletRequest theRequest, @ResourceParam Person person, @IdParam IdType theId, RequestDetails theRequestDetails) throws OperationOutcomeException { log.debug("Update Person Provider called"); MethodOutcome method = new MethodOutcome(); method.setCreated(true); OperationOutcome opOutcome = new OperationOutcome(); method.setOperationOutcome(opOutcome); Person newPerson = null; newPerson = personDao.update(ctx, person, theId); method.setId(newPerson.getIdElement()); method.setResource(newPerson); log.debug("called update Person method"); return method; }
Example 20
Source File: CarePlanProvider.java From careconnect-reference-implementation with Apache License 2.0 | 4 votes |
@Update public MethodOutcome update(HttpServletRequest theRequest, @ResourceParam CarePlan carePlan, @IdParam IdType theId, @ConditionalUrlParam String theConditional, RequestDetails theRequestDetails) { resourcePermissionProvider.checkPermission("update"); MethodOutcome method = new MethodOutcome(); method.setCreated(true); OperationOutcome opOutcome = new OperationOutcome(); method.setOperationOutcome(opOutcome); try { CarePlan newCarePlan = carePlanDao.create(ctx,carePlan, theId, theConditional); method.setId(newCarePlan.getIdElement()); method.setResource(newCarePlan); } catch (Exception ex) { ProviderResponseLibrary.handleException(method,ex); } return method; }