本文整理汇总了Java中ca.uhn.fhir.rest.annotation.IdParam类的典型用法代码示例。如果您正苦于以下问题:Java IdParam类的具体用法?Java IdParam怎么用?Java IdParam使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IdParam类属于ca.uhn.fhir.rest.annotation包,在下文中一共展示了IdParam类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: observationEverythingOperation
import ca.uhn.fhir.rest.annotation.IdParam; //导入依赖的package包/类
public Bundle observationEverythingOperation(
@IdParam IdType patientId
,CompleteBundle completeBundle
) {
Bundle bundle = completeBundle.getBundle();
List<Observation> resources = searchObservation(null, null,null, null, new ReferenceParam().setValue(patientId.getValue()),null);
for (Observation resource : resources) {
for (Reference reference : resource.getPerformer()) {
if (reference.getReference().contains("Practitioner")) {
completeBundle.addGetPractitioner(new IdType(reference.getReference()));
}
if (reference.getReference().contains("Organization")) {
completeBundle.addGetOrganisation(new IdType(reference.getReference()));
}
}
bundle.addEntry().setResource(resource);
}
// Populate bundle with matching resources
return bundle;
}
开发者ID:nhsconnect,项目名称:careconnect-reference-implementation,代码行数:24,代码来源:ObservationResourceProvider.java
示例2: getEverythingOperation
import ca.uhn.fhir.rest.annotation.IdParam; //导入依赖的package包/类
public Bundle getEverythingOperation(
@IdParam IdType patientId
,CompleteBundle completeBundle
) {
Bundle bundle = completeBundle.getBundle();
List<Immunization> resources = searchImmunization(null, new ReferenceParam().setValue(patientId.getValue()),null,null,null);
for (Immunization resource : resources) {
if (resource.getLocation()!=null) {
completeBundle.addGetLocation(new IdType(resource.getLocation().getReference()));
}
bundle.addEntry().setResource(resource);
}
// Populate bundle with matching resources
return bundle;
}
开发者ID:nhsconnect,项目名称:careconnect-reference-implementation,代码行数:19,代码来源:ImmunizationResourceProvider.java
示例3: getEverythingOperation
import ca.uhn.fhir.rest.annotation.IdParam; //导入依赖的package包/类
public Bundle getEverythingOperation(
@IdParam IdType patientId
,CompleteBundle completeBundle
) {
Bundle bundle = completeBundle.getBundle();
List<MedicationRequest> resources = searchMedicationRequest(null, new ReferenceParam().setValue(patientId.getValue()),null,null,null,null);
for (MedicationRequest resource : resources) {
if (resource.getRequester()!= null && resource.getRequester().hasAgent()) {
Reference reference = resource.getRequester().getAgent();
if (reference.getReference().contains("Practitioner")) {
completeBundle.addGetPractitioner(new IdType(reference.getReference()));
}
if (reference.getReference().contains("Organization")) {
completeBundle.addGetOrganisation(new IdType(reference.getReference()));
}
}
bundle.addEntry().setResource(resource);
}
// Populate bundle with matching resources
return bundle;
}
开发者ID:nhsconnect,项目名称:careconnect-reference-implementation,代码行数:25,代码来源:MedicationRequestResourceProvider.java
示例4: procedureEverythingOperation
import ca.uhn.fhir.rest.annotation.IdParam; //导入依赖的package包/类
public Bundle procedureEverythingOperation(
@IdParam IdType patientId
,CompleteBundle completeBundle
) {
Bundle bundle = completeBundle.getBundle();
bundle.setType(Bundle.BundleType.SEARCHSET);
List<Procedure> resources = searchProcedure(null, new ReferenceParam().setValue(patientId.getValue()),null, null,null);
for (Procedure resource : resources) {
for (Procedure.ProcedurePerformerComponent performerComponent : resource.getPerformer()) {
Reference reference = performerComponent.getActor();
if (reference.getReference().contains("Practitioner")) {
completeBundle.addGetPractitioner(new IdType(reference.getReference()));
}
if (reference.getReference().contains("Organization")) {
completeBundle.addGetOrganisation(new IdType(reference.getReference()));
}
}
bundle.addEntry().setResource(resource);
}
// Populate bundle with matching resources
return bundle;
}
开发者ID:nhsconnect,项目名称:careconnect-reference-implementation,代码行数:25,代码来源:ProcedureResourceProvider.java
示例5: getEverythingOperation
import ca.uhn.fhir.rest.annotation.IdParam; //导入依赖的package包/类
public Bundle getEverythingOperation(
@IdParam IdType patientId
,CompleteBundle completeBundle
) {
Bundle bundle =completeBundle.getBundle();
List<AllergyIntolerance> resources = searchAllergyIntolerance(null, new ReferenceParam().setValue(patientId.getValue()),null,null,null);
for (AllergyIntolerance resource : resources) {
if (resource.getAsserter() != null && resource.getAsserter().getReference() != null) {
completeBundle.addGetPractitioner(new IdType(resource.getAsserter().getReference()));
}
bundle.addEntry().setResource(resource);
}
// Populate bundle with matching resources
return bundle;
}
开发者ID:nhsconnect,项目名称:careconnect-reference-implementation,代码行数:19,代码来源:AllergyIntoleranceResourceProvider.java
示例6: getEverythingOperation
import ca.uhn.fhir.rest.annotation.IdParam; //导入依赖的package包/类
public Bundle getEverythingOperation(
@IdParam IdType patientId
,CompleteBundle completeBundle
) {
Bundle bundle = completeBundle.getBundle();
List<MedicationStatement> resources = searchMedicationStatement(null, new ReferenceParam().setValue(patientId.getValue()),null,null,null);
for (MedicationStatement resource : resources) {
bundle.addEntry().setResource(resource);
}
// Populate bundle with matching resources
return bundle;
}
开发者ID:nhsconnect,项目名称:careconnect-reference-implementation,代码行数:17,代码来源:MedicationStatementResourceProvider.java
示例7: updatePatient
import ca.uhn.fhir.rest.annotation.IdParam; //导入依赖的package包/类
/**
* The "@Update" annotation indicates that this method supports replacing an existing
* resource (by ID) with a new instance of that resource.
*
* @param theId
* This is the ID of the patient to update
* @param thePatient
* This is the actual resource to save
* @return This method returns a "MethodOutcome"
*/
@Update()
public MethodOutcome updatePatient(@IdParam IdType theId, @ResourceParam Patient thePatient) {
validateResource(thePatient);
Long id;
try {
id = theId.getIdPartAsLong();
} catch (DataFormatException e) {
throw new InvalidRequestException("Invalid ID " + theId.getValue() + " - Must be numeric");
}
/*
* Throw an exception (HTTP 404) if the ID is not known
*/
if (!myIdToPatientVersions.containsKey(id)) {
throw new ResourceNotFoundException(theId);
}
addNewVersion(thePatient, id);
return new MethodOutcome();
}
开发者ID:furore-fhir,项目名称:fhirstarters,代码行数:33,代码来源:PatientResourceProvider.java
示例8: updatePatientConditional
import ca.uhn.fhir.rest.annotation.IdParam; //导入依赖的package包/类
@Update
public MethodOutcome updatePatientConditional(
@ResourceParam Patient thePatient,
@IdParam IdDt theId,
@ConditionalUrlParam String theConditional) {
// Only one of theId or theConditional will have a value and the other will be null,
// depending on the URL passed into the server.
if (theConditional != null) {
// Do a conditional update. theConditional will have a value like "Patient?identifier=system%7C00001"
} else {
// Do a normal update. theId will have the identity of the resource to update
}
return new MethodOutcome(); // populate this
}
开发者ID:gajen0981,项目名称:FHIR-Server,代码行数:17,代码来源:RestfulPatientResourceProviderMore.java
示例9: readPatient
import ca.uhn.fhir.rest.annotation.IdParam; //导入依赖的package包/类
@Read()
public Patient readPatient(@IdParam IdDt theId) {
Patient retVal = new Patient();
// ..populate demographics, contact, or anything else you usually would..
// Create a TagList and place a complete list of the patient's tags inside
TagList tags = new TagList();
tags.addTag("http://animals", "Dog", "Canine Patient"); // TODO: more realistic example
tags.addTag("http://personality", "Friendly", "Friendly"); // TODO: more realistic example
// The tags are then stored in the Patient resource instance
retVal.getResourceMetadata().put(ResourceMetadataKeyEnum.TAG_LIST, tags);
return retVal;
}
开发者ID:gajen0981,项目名称:FHIR-Server,代码行数:17,代码来源:RestfulPatientResourceProviderMore.java
示例10: ReadMethodBinding
import ca.uhn.fhir.rest.annotation.IdParam; //导入依赖的package包/类
public ReadMethodBinding(Class<? extends IBaseResource> theAnnotatedResourceType, Method theMethod, FhirContext theContext, Object theProvider) {
super(theAnnotatedResourceType, theMethod, theContext, theProvider);
Validate.notNull(theMethod, "Method must not be null");
Integer idIndex = MethodUtil.findIdParameterIndex(theMethod);
Integer versionIdIndex = MethodUtil.findVersionIdParameterIndex(theMethod);
mySupportsVersion = theMethod.getAnnotation(Read.class).version();
myIdIndex = idIndex;
myVersionIdIndex = versionIdIndex;
if (myIdIndex== null) {
throw new ConfigurationException("@" + Read.class.getSimpleName() + " method " + theMethod.getName() + " on type \"" + theMethod.getDeclaringClass().getName() + "\" does not have a parameter annotated with @" + IdParam.class.getSimpleName());
}
Class<?>[] parameterTypes = theMethod.getParameterTypes();
if (!IdDt.class.equals(parameterTypes[myIdIndex])) {
throw new ConfigurationException("ID parameter must be of type: " + IdDt.class.getCanonicalName() + " - Found: " + parameterTypes[myIdIndex]);
}
if (myVersionIdIndex != null && !IdDt.class.equals(parameterTypes[myVersionIdIndex])) {
throw new ConfigurationException("Version ID parameter must be of type: " + IdDt.class.getCanonicalName() + " - Found: " + parameterTypes[myVersionIdIndex]);
}
}
开发者ID:gajen0981,项目名称:FHIR-Server,代码行数:26,代码来源:ReadMethodBinding.java
示例11: updatePatient
import ca.uhn.fhir.rest.annotation.IdParam; //导入依赖的package包/类
/**
* The "@Update" annotation indicates that this method supports replacing an existing
* resource (by ID) with a new instance of that resource.
*
* @param theId
* This is the ID of the patient to update
* @param thePatient
* This is the actual resource to save
* @return This method returns a "MethodOutcome"
*/
@Update()
public MethodOutcome updatePatient(@IdParam IdDt theId, @ResourceParam Patient thePatient) {
validateResource(thePatient);
Long id;
try {
id = theId.getIdPartAsLong();
} catch (DataFormatException e) {
throw new InvalidRequestException("Invalid ID " + theId.getValue() + " - Must be numeric");
}
/*
* Throw an exception (HTTP 404) if the ID is not known
*/
if (!myIdToPatientVersions.containsKey(id)) {
throw new ResourceNotFoundException(theId);
}
addNewVersion(thePatient, id);
return new MethodOutcome();
}
开发者ID:gajen0981,项目名称:FHIR-Server,代码行数:33,代码来源:PatientResourceProvider.java
示例12: opInstance
import ca.uhn.fhir.rest.annotation.IdParam; //导入依赖的package包/类
@Operation(name="$OP_INSTANCE")
public Parameters opInstance(
@IdParam IdDt theId,
@OperationParam(name="PARAM1") StringDt theParam1,
@OperationParam(name="PARAM2") Patient theParam2
) {
//@formatter:on
ourLastMethod = "$OP_INSTANCE";
ourLastId = theId;
ourLastParam1 = theParam1;
ourLastParam2 = theParam2;
Parameters retVal = new Parameters();
retVal.addParameter().setName("RET1").setValue(new StringDt("RETVAL1"));
return retVal;
}
开发者ID:gajen0981,项目名称:FHIR-Server,代码行数:18,代码来源:OperationServerTest.java
示例13: update
import ca.uhn.fhir.rest.annotation.IdParam; //导入依赖的package包/类
@Update
public MethodOutcome update(HttpServletRequest theRequest, @ResourceParam T theResource, @IdParam IdDt theId, @ConditionalUrlParam String theConditional) {
startRequest(theRequest);
try {
if (theConditional != null) {
return getDao().update(theResource, theConditional);
} else {
theResource.setId(theId);
return getDao().update(theResource);
}
} catch (ResourceNotFoundException e) {
ourLog.info("Can't update resource with ID[" + theId.getValue() + "] because it doesn't exist, going to create it instead");
theResource.setId(theId);
return getDao().create(theResource);
} finally {
endRequest(theRequest);
}
}
开发者ID:gajen0981,项目名称:FHIR-Server,代码行数:19,代码来源:JpaResourceProviderDstu2.java
示例14: instanceHistory
import ca.uhn.fhir.rest.annotation.IdParam; //导入依赖的package包/类
@History
public List<Patient> instanceHistory(@IdParam IdDt theId) {
ArrayList<Patient> retVal = new ArrayList<Patient>();
Patient patient = new Patient();
patient.setId("Patient/ih1/_history/1");
patient.addName().addFamily("history");
retVal.add(patient);
Patient patient2 = new Patient();
patient2.setId("Patient/ih1/_history/2");
patient2.addName().addFamily("history");
retVal.add(patient2);
return retVal;
}
开发者ID:gajen0981,项目名称:FHIR-Server,代码行数:17,代码来源:HistoryTest.java
示例15: getEpisodeOfCareById
import ca.uhn.fhir.rest.annotation.IdParam; //导入依赖的package包/类
@Read
public EpisodeOfCare getEpisodeOfCareById(HttpServletRequest theRequest, @IdParam IdType internalId) {
ProducerTemplate template = context.createProducerTemplate();
EpisodeOfCare episode = null;
IBaseResource resource = null;
try {
InputStream inputStream = (InputStream) template.sendBody("direct:FHIREpisodeOfCare",
ExchangePattern.InOut,theRequest);
Reader reader = new InputStreamReader(inputStream);
resource = ctx.newJsonParser().parseResource(reader);
} catch(Exception ex) {
log.error("JSON Parse failed " + ex.getMessage());
throw new InternalErrorException(ex.getMessage());
}
if (resource instanceof EpisodeOfCare) {
episode = (EpisodeOfCare) resource;
}else if (resource instanceof OperationOutcome)
{
OperationOutcome operationOutcome = (OperationOutcome) resource;
log.info("Sever Returned: "+ctx.newJsonParser().encodeResourceToString(operationOutcome));
OperationOutcomeFactory.convertToException(operationOutcome);
} else {
throw new InternalErrorException("Unknown Error");
}
return episode;
}
开发者ID:nhsconnect,项目名称:careconnect-reference-implementation,代码行数:37,代码来源:EpisodeOfCareResourceProvider.java
示例16: getObservationById
import ca.uhn.fhir.rest.annotation.IdParam; //导入依赖的package包/类
@Read
public Observation getObservationById(HttpServletRequest httpRequest, @IdParam IdType internalId) {
ProducerTemplate template = context.createProducerTemplate();
Observation observation = null;
IBaseResource resource = null;
try {
InputStream inputStream = (InputStream) template.sendBody("direct:FHIRObservation",
ExchangePattern.InOut,httpRequest);
Reader reader = new InputStreamReader(inputStream);
resource = ctx.newJsonParser().parseResource(reader);
} catch(Exception ex) {
log.error("JSON Parse failed " + ex.getMessage());
throw new InternalErrorException(ex.getMessage());
}
if (resource instanceof Observation) {
observation = (Observation) resource;
}else if (resource instanceof OperationOutcome)
{
OperationOutcome operationOutcome = (OperationOutcome) resource;
log.info("Sever Returned: "+ctx.newJsonParser().encodeResourceToString(operationOutcome));
OperationOutcomeFactory.convertToException(operationOutcome);
} else {
throw new InternalErrorException("Unknown Error");
}
return observation;
}
开发者ID:nhsconnect,项目名称:careconnect-reference-implementation,代码行数:36,代码来源:ObservationResourceProvider.java
示例17: getPractitionerRoleById
import ca.uhn.fhir.rest.annotation.IdParam; //导入依赖的package包/类
@Read
public PractitionerRole getPractitionerRoleById(HttpServletRequest theRequest, @IdParam IdType internalId) {
ProducerTemplate template = context.createProducerTemplate();
PractitionerRole practitionerRole = null;
IBaseResource resource = null;
try {
InputStream inputStream = (InputStream) template.sendBody("direct:FHIRPractitionerRole",
ExchangePattern.InOut,theRequest);
Reader reader = new InputStreamReader(inputStream);
resource = ctx.newJsonParser().parseResource(reader);
} catch(Exception ex) {
log.error("JSON Parse failed " + ex.getMessage());
throw new InternalErrorException(ex.getMessage());
}
if (resource instanceof PractitionerRole) {
practitionerRole = (PractitionerRole) resource;
} else if (resource instanceof OperationOutcome)
{
OperationOutcome operationOutcome = (OperationOutcome) resource;
log.info("Sever Returned: "+ctx.newJsonParser().encodeResourceToString(operationOutcome));
OperationOutcomeFactory.convertToException(operationOutcome);
} else {
throw new InternalErrorException("Unknown Error");
}
return practitionerRole;
}
开发者ID:nhsconnect,项目名称:careconnect-reference-implementation,代码行数:34,代码来源:PractitionerRoleResourceProvider.java
示例18: getImmunizationById
import ca.uhn.fhir.rest.annotation.IdParam; //导入依赖的package包/类
@Read
public Immunization getImmunizationById(HttpServletRequest httpRequest, @IdParam IdType internalId) {
ProducerTemplate template = context.createProducerTemplate();
Immunization immunization = null;
IBaseResource resource = null;
try {
InputStream inputStream = (InputStream) template.sendBody("direct:FHIRImmunization",
ExchangePattern.InOut,httpRequest);
Reader reader = new InputStreamReader(inputStream);
resource = ctx.newJsonParser().parseResource(reader);
} catch(Exception ex) {
log.error("JSON Parse failed " + ex.getMessage());
throw new InternalErrorException(ex.getMessage());
}
if (resource instanceof Immunization) {
immunization = (Immunization) resource;
}else if (resource instanceof OperationOutcome)
{
OperationOutcome operationOutcome = (OperationOutcome) resource;
log.info("Sever Returned: "+ctx.newJsonParser().encodeResourceToString(operationOutcome));
OperationOutcomeFactory.convertToException(operationOutcome);
} else {
throw new InternalErrorException("Unknown Error");
}
return immunization;
}
开发者ID:nhsconnect,项目名称:careconnect-reference-implementation,代码行数:36,代码来源:ImmunizationResourceProvider.java
示例19: getMedicationRequestById
import ca.uhn.fhir.rest.annotation.IdParam; //导入依赖的package包/类
@Read
public MedicationRequest getMedicationRequestById(HttpServletRequest httpRequest, @IdParam IdType internalId) {
ProducerTemplate template = context.createProducerTemplate();
MedicationRequest prescription = null;
IBaseResource resource = null;
try {
InputStream inputStream = (InputStream) template.sendBody("direct:FHIRMedicationRequest",
ExchangePattern.InOut,httpRequest);
Reader reader = new InputStreamReader(inputStream);
resource = ctx.newJsonParser().parseResource(reader);
} catch(Exception ex) {
log.error("JSON Parse failed " + ex.getMessage());
throw new InternalErrorException(ex.getMessage());
}
if (resource instanceof MedicationRequest) {
prescription = (MedicationRequest) resource;
}else if (resource instanceof OperationOutcome)
{
OperationOutcome operationOutcome = (OperationOutcome) resource;
log.info("Sever Returned: "+ctx.newJsonParser().encodeResourceToString(operationOutcome));
OperationOutcomeFactory.convertToException(operationOutcome);
} else {
throw new InternalErrorException("Unknown Error");
}
return prescription;
}
开发者ID:nhsconnect,项目名称:careconnect-reference-implementation,代码行数:36,代码来源:MedicationRequestResourceProvider.java
示例20: getProcedureById
import ca.uhn.fhir.rest.annotation.IdParam; //导入依赖的package包/类
@Read
public Procedure getProcedureById(HttpServletRequest httpRequest, @IdParam IdType internalId) {
ProducerTemplate template = context.createProducerTemplate();
Procedure procedure = null;
IBaseResource resource = null;
try {
InputStream inputStream = (InputStream) template.sendBody("direct:FHIRProcedure",
ExchangePattern.InOut,httpRequest);
Reader reader = new InputStreamReader(inputStream);
resource = ctx.newJsonParser().parseResource(reader);
} catch(Exception ex) {
log.error("JSON Parse failed " + ex.getMessage());
throw new InternalErrorException(ex.getMessage());
}
if (resource instanceof Procedure) {
procedure = (Procedure) resource;
}else if (resource instanceof OperationOutcome)
{
OperationOutcome operationOutcome = (OperationOutcome) resource;
log.info("Sever Returned: "+ctx.newJsonParser().encodeResourceToString(operationOutcome));
OperationOutcomeFactory.convertToException(operationOutcome);
} else {
throw new InternalErrorException("Unknown Error");
}
return procedure;
}
开发者ID:nhsconnect,项目名称:careconnect-reference-implementation,代码行数:34,代码来源:ProcedureResourceProvider.java
注:本文中的ca.uhn.fhir.rest.annotation.IdParam类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论