当前位置: 首页>>代码示例>>Java>>正文


Java MethodOutcome.setId方法代码示例

本文整理汇总了Java中ca.uhn.fhir.rest.api.MethodOutcome.setId方法的典型用法代码示例。如果您正苦于以下问题:Java MethodOutcome.setId方法的具体用法?Java MethodOutcome.setId怎么用?Java MethodOutcome.setId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ca.uhn.fhir.rest.api.MethodOutcome的用法示例。


在下文中一共展示了MethodOutcome.setId方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createPatient

import ca.uhn.fhir.rest.api.MethodOutcome; //导入方法依赖的package包/类
@Create
public MethodOutcome createPatient(HttpServletRequest theRequest, @ResourceParam Patient patient) {

    log.debug("Update Patient Provider called");

    MethodOutcome method = new MethodOutcome();
    method.setCreated(true);
    OperationOutcome opOutcome = new OperationOutcome();

    method.setOperationOutcome(opOutcome);
    Patient newPatient = null;
    try {
        newPatient = patientDao.update(ctx, patient, null,null);
        method.setId(newPatient.getIdElement());
        method.setResource(newPatient);
    } catch (Exception ex) {
        log.error(ex.getMessage());
    }

    log.debug("called create Patient method");

    return method;
}
 
开发者ID:nhsconnect,项目名称:careconnect-reference-implementation,代码行数:24,代码来源:PatientProvider.java

示例2: updatePatient

import ca.uhn.fhir.rest.api.MethodOutcome; //导入方法依赖的package包/类
@Update
public MethodOutcome updatePatient(HttpServletRequest theRequest, @ResourceParam Patient patient, @IdParam IdType theId,@ConditionalUrlParam String theConditional, RequestDetails theRequestDetails) {

    log.debug("Update Patient Provider called");

    MethodOutcome method = new MethodOutcome();
    method.setCreated(true);
    OperationOutcome opOutcome = new OperationOutcome();

    method.setOperationOutcome(opOutcome);
    Patient newPatient = null;
    try {
        newPatient = patientDao.update(ctx, patient, theId, theConditional);
    } catch (Exception ex) {
        log.error(ex.getMessage());
        method.setId(newPatient.getIdElement());
        method.setResource(newPatient);
    }

    log.debug("called update Patient method");

    return method;
}
 
开发者ID:nhsconnect,项目名称:careconnect-reference-implementation,代码行数:24,代码来源:PatientProvider.java

示例3: parseContentLocation

import ca.uhn.fhir.rest.api.MethodOutcome; //导入方法依赖的package包/类
protected static void parseContentLocation(MethodOutcome theOutcomeToPopulate, String theResourceName, String theLocationHeader) {
	if (StringUtils.isBlank(theLocationHeader)) {
		return;
	}

	theOutcomeToPopulate.setId(new IdDt(theLocationHeader));

	String resourceNamePart = "/" + theResourceName + "/";
	int resourceIndex = theLocationHeader.lastIndexOf(resourceNamePart);
	if (resourceIndex > -1) {
		int idIndexStart = resourceIndex + resourceNamePart.length();
		int idIndexEnd = theLocationHeader.indexOf('/', idIndexStart);
		if (idIndexEnd == -1) {
			// nothing
		} else {
			String versionIdPart = "/_history/";
			int historyIdStart = theLocationHeader.indexOf(versionIdPart, idIndexEnd);
			if (historyIdStart != -1) {
				theOutcomeToPopulate.setVersionId(new IdDt(theLocationHeader.substring(historyIdStart + versionIdPart.length())));
			}
		}
	}
}
 
开发者ID:gajen0981,项目名称:FHIR-Server,代码行数:24,代码来源:BaseOutcomeReturningMethodBinding.java

示例4: update

import ca.uhn.fhir.rest.api.MethodOutcome; //导入方法依赖的package包/类
@Update
public MethodOutcome update(HttpServletRequest theRequest, @ResourceParam DocumentReference documentReference, @IdParam IdType theId, @ConditionalUrlParam String theConditional, RequestDetails theRequestDetails) {

    MethodOutcome method = new MethodOutcome();
    method.setCreated(true);
    OperationOutcome opOutcome = new OperationOutcome();
    method.setOperationOutcome(opOutcome);

    DocumentReference newDocumentReference = documentReferenceDao.create(ctx,documentReference, theId, theConditional);
    method.setId(newDocumentReference.getIdElement());
    method.setResource(newDocumentReference);

    return method;
}
 
开发者ID:nhsconnect,项目名称:careconnect-reference-implementation,代码行数:15,代码来源:DocumentReferenceProvider.java

示例5: create

import ca.uhn.fhir.rest.api.MethodOutcome; //导入方法依赖的package包/类
@Create
public MethodOutcome create(HttpServletRequest theRequest, @ResourceParam DocumentReference documentReference) {

    MethodOutcome method = new MethodOutcome();
    method.setCreated(true);
    OperationOutcome opOutcome = new OperationOutcome();
    method.setOperationOutcome(opOutcome);

    DocumentReference newDocumentReference = documentReferenceDao.create(ctx,documentReference, null,null);
    method.setId(newDocumentReference.getIdElement());
    method.setResource(newDocumentReference);

    return method;
}
 
开发者ID:nhsconnect,项目名称:careconnect-reference-implementation,代码行数:15,代码来源:DocumentReferenceProvider.java

示例6: create

import ca.uhn.fhir.rest.api.MethodOutcome; //导入方法依赖的package包/类
@Create
public MethodOutcome create(HttpServletRequest theRequest, @ResourceParam Composition composition) {

    MethodOutcome method = new MethodOutcome();
    method.setCreated(true);
    OperationOutcome opOutcome = new OperationOutcome();
    method.setOperationOutcome(opOutcome);

    Composition newComposition = compositionDao.create(ctx,composition, null,null);
    method.setId(newComposition.getIdElement());
    method.setResource(newComposition);

    return method;
}
 
开发者ID:nhsconnect,项目名称:careconnect-reference-implementation,代码行数:15,代码来源:CompositionProvider.java

示例7: update

import ca.uhn.fhir.rest.api.MethodOutcome; //导入方法依赖的package包/类
@Update
public MethodOutcome update(HttpServletRequest theRequest, @ResourceParam Immunization immunisation, @IdParam IdType theId, @ConditionalUrlParam String theConditional, RequestDetails theRequestDetails) {

    MethodOutcome method = new MethodOutcome();
    method.setCreated(true);
    OperationOutcome opOutcome = new OperationOutcome();
    method.setOperationOutcome(opOutcome);

    Immunization newImmunisation = immunisationDao.create(ctx,immunisation, theId, theConditional);
    method.setId(newImmunisation.getIdElement());
    method.setResource(newImmunisation);

    return method;
}
 
开发者ID:nhsconnect,项目名称:careconnect-reference-implementation,代码行数:15,代码来源:ImmunizationProvider.java

示例8: create

import ca.uhn.fhir.rest.api.MethodOutcome; //导入方法依赖的package包/类
@Create
public MethodOutcome create(HttpServletRequest theRequest, @ResourceParam Immunization immunisation) {


    MethodOutcome method = new MethodOutcome();
    method.setCreated(true);
    OperationOutcome opOutcome = new OperationOutcome();
    method.setOperationOutcome(opOutcome);

    Immunization newImmunisation = immunisationDao.create(ctx,immunisation, null, null);
    method.setId(newImmunisation.getIdElement());
    method.setResource(newImmunisation);

    return method;
}
 
开发者ID:nhsconnect,项目名称:careconnect-reference-implementation,代码行数:16,代码来源:ImmunizationProvider.java

示例9: create

import ca.uhn.fhir.rest.api.MethodOutcome; //导入方法依赖的package包/类
@Create
public MethodOutcome create(HttpServletRequest theRequest, @ResourceParam DiagnosticReport diagnosticReport) {

    MethodOutcome method = new MethodOutcome();
    method.setCreated(true);
    OperationOutcome opOutcome = new OperationOutcome();
    method.setOperationOutcome(opOutcome);

    DiagnosticReport newDiagnosticReport = diagnosticReportDao.create(ctx,diagnosticReport, null,null);
    method.setId(newDiagnosticReport.getIdElement());
    method.setResource(newDiagnosticReport);

    return method;
}
 
开发者ID:nhsconnect,项目名称:careconnect-reference-implementation,代码行数:15,代码来源:DiagnosticReportProvider.java

示例10: createPatient

import ca.uhn.fhir.rest.api.MethodOutcome; //导入方法依赖的package包/类
@Create
public MethodOutcome createPatient(@ResourceParam Patient thePatient) {

  /* 
   * First we might want to do business validation. The UnprocessableEntityException
   * results in an HTTP 422, which is appropriate for business rule failure
   */
  if (thePatient.getIdentifierFirstRep().isEmpty()) {
    /* It is also possible to pass an OperationOutcome resource
     * to the UnprocessableEntityException if you want to return
     * a custom populated OperationOutcome. Otherwise, a simple one
     * is created using the string supplied below. 
     */
    throw new UnprocessableEntityException("No identifier supplied");
  }
	
  // Save this patient to the database...
  savePatientToDatabase(thePatient);

  // This method returns a MethodOutcome object which contains
  // the ID (composed of the type Patient, the logical ID 3746, and the
  // version ID 1)
  MethodOutcome retVal = new MethodOutcome();
  retVal.setId(new IdDt("Patient", "3746", "1"));
  
  // You can also add an OperationOutcome resource to return
  // This part is optional though:
  OperationOutcome outcome = new OperationOutcome();
  outcome.addIssue().setDetails("One minor issue detected");
  retVal.setOperationOutcome(outcome);  
  
  return retVal;
}
 
开发者ID:gajen0981,项目名称:FHIR-Server,代码行数:34,代码来源:RestfulPatientResourceProviderMore.java

示例11: parseContentLocation

import ca.uhn.fhir.rest.api.MethodOutcome; //导入方法依赖的package包/类
protected static void parseContentLocation(FhirContext theContext, MethodOutcome theOutcomeToPopulate, String theLocationHeader) {
	if (StringUtils.isBlank(theLocationHeader)) {
		return;
	}

	IIdType id = theContext.getVersion().newIdType();
	id.setValue(theLocationHeader);
	theOutcomeToPopulate.setId(id);
}
 
开发者ID:jamesagnew,项目名称:hapi-fhir,代码行数:10,代码来源:BaseOutcomeReturningMethodBinding.java

示例12: create

import ca.uhn.fhir.rest.api.MethodOutcome; //导入方法依赖的package包/类
@Create
public MethodOutcome create(HttpServletRequest theRequest, @ResourceParam PractitionerRole practitionerRole) {

    MethodOutcome method = new MethodOutcome();
    method.setCreated(true);
    OperationOutcome opOutcome = new OperationOutcome();

    method.setOperationOutcome(opOutcome);


    PractitionerRole newPractitioner = practitionerRoleDao.create(ctx, practitionerRole,null,null);
    method.setId(newPractitioner.getIdElement());
    method.setResource(newPractitioner);

    return method;
}
 
开发者ID:nhsconnect,项目名称:careconnect-reference-implementation,代码行数:17,代码来源:PractitionerRoleProvider.java

示例13: create

import ca.uhn.fhir.rest.api.MethodOutcome; //导入方法依赖的package包/类
@Create
public MethodOutcome create(HttpServletRequest theRequest, @ResourceParam CarePlan carePlan) {


    MethodOutcome method = new MethodOutcome();
    method.setCreated(true);
    OperationOutcome opOutcome = new OperationOutcome();

    method.setOperationOutcome(opOutcome);


    CarePlan newCarePlan = carePlanDao.create(ctx,carePlan, null,null);
    method.setId(newCarePlan.getIdElement());
    method.setResource(newCarePlan);



    return method;
}
 
开发者ID:nhsconnect,项目名称:careconnect-reference-implementation,代码行数:20,代码来源:CarePlanProvider.java

示例14: create

import ca.uhn.fhir.rest.api.MethodOutcome; //导入方法依赖的package包/类
@Create
public MethodOutcome create(HttpServletRequest theRequest, @ResourceParam Procedure procedure) {


    MethodOutcome method = new MethodOutcome();
    method.setCreated(true);
    OperationOutcome opOutcome = new OperationOutcome();

    method.setOperationOutcome(opOutcome);


    Procedure newProcedure = procedureDao.create(ctx,procedure, null,null);
    method.setId(newProcedure.getIdElement());
    method.setResource(newProcedure);



    return method;
}
 
开发者ID:nhsconnect,项目名称:careconnect-reference-implementation,代码行数:20,代码来源:ProcedureProvider.java

示例15: createLocation

import ca.uhn.fhir.rest.api.MethodOutcome; //导入方法依赖的package包/类
@Create
public MethodOutcome createLocation(HttpServletRequest theRequest, @ResourceParam Location location) {


    MethodOutcome method = new MethodOutcome();
    method.setCreated(true);
    OperationOutcome opOutcome = new OperationOutcome();

    method.setOperationOutcome(opOutcome);

    Location newLocation = locationDao.create(ctx, location,null,null);
    method.setId(newLocation.getIdElement());
    method.setResource(newLocation);

    return method;
}
 
开发者ID:nhsconnect,项目名称:careconnect-reference-implementation,代码行数:17,代码来源:LocationProvider.java


注:本文中的ca.uhn.fhir.rest.api.MethodOutcome.setId方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。