本文整理汇总了Java中ca.uhn.fhir.model.primitive.IdDt.getIdPart方法的典型用法代码示例。如果您正苦于以下问题:Java IdDt.getIdPart方法的具体用法?Java IdDt.getIdPart怎么用?Java IdDt.getIdPart使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ca.uhn.fhir.model.primitive.IdDt
的用法示例。
在下文中一共展示了IdDt.getIdPart方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: updateDiagnosticReportWithVersionAndNoResponse
import ca.uhn.fhir.model.primitive.IdDt; //导入方法依赖的package包/类
@Update()
public MethodOutcome updateDiagnosticReportWithVersionAndNoResponse(@IdParam IdDt theId, @ResourceParam DiagnosticReport theDr) {
IdDt id = theId;
if (theId.getValue().contains("AAAAAA")) {
IdDt id2 = new IdDt(id.getIdPart(), "002");
return new MethodOutcome(id2); // this is invalid
}
myLastTags = (TagList) theDr.getResourceMetadata().get(ResourceMetadataKeyEnum.TAG_LIST);
return new MethodOutcome(new IdDt("DiagnosticReport", id.getIdPart(), "002"));
}
示例2: vread
import ca.uhn.fhir.model.primitive.IdDt; //导入方法依赖的package包/类
@Read(version=true)
public Patient vread(@IdParam IdDt theId) {
Patient retVal = getIdToPatient().get(theId.getIdPart());
if (retVal == null) {
throw new ResourceNotFoundException("Couldn't find ID " + theId.getIdPart() + " - Valid IDs are: " + getIdToPatient().keySet());
}
List<HumanNameDt> name = retVal.getName();
HumanNameDt nameDt = name.get(0);
String value = theId.getVersionIdPart();
nameDt.setText(value);
return retVal;
}
示例3: isValidPid
import ca.uhn.fhir.model.primitive.IdDt; //导入方法依赖的package包/类
protected boolean isValidPid(IdDt theId) {
String idPart = theId.getIdPart();
for (int i = 0; i < idPart.length(); i++) {
char nextChar = idPart.charAt(i);
if (nextChar < '0' || nextChar > '9') {
return false;
}
}
return true;
}
示例4: getResourceById
import ca.uhn.fhir.model.primitive.IdDt; //导入方法依赖的package包/类
/**
* The "@Read" annotation indicates that this method supports the
* read operation. Read operations should return a single resource
* instance.
*
* @param theId
* The read operation takes one parameter, which must be of type
* IdDt and must be annotated with the "@Read.IdParam" annotation.
* @return
* Returns a resource matching this identifier, or null if none exists.
*/
@Read()
public Patient getResourceById(@IdParam IdDt theId) throws Exception {
String patientId = theId.getIdPart();
byte[] res = rpcClient.call("GetPatient", "{\"method\": \"GetPatient\", \"params\": {\"id\": " + patientId + "}}");
ObjectMapper mapper = new ObjectMapper();
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
FiviumPatient fiviumPatient = mapper.readValue(res, FiviumPatient.class);
res = rpcClient.call("GetEhrId", "{\"method\": \"GetEhrId\", \"params\": {\"MRN\": \"" + fiviumPatient.getMrn() + "\"}}");
RPCResultGetEhrId getEhrResult = mapper.readValue(res, RPCResultGetEhrId.class);
Patient patient = new Patient();
patient.addIdentifier();
patient.getIdentifier().get(0).setSystem(new UriDt("id"));
patient.getIdentifier().get(0).setValue(fiviumPatient.getId());
patient.addIdentifier();
patient.getIdentifier().get(1).setSystem(new UriDt("mrn"));
patient.getIdentifier().get(1).setValue(fiviumPatient.getMrn());
patient.addIdentifier();
patient.getIdentifier().get(2).setSystem(new UriDt("ehrId"));
patient.getIdentifier().get(2).setValue(getEhrResult.getEhrId());
Calendar dobCal = DatatypeConverter.parseDate(fiviumPatient.getDob());
patient.setBirthDate(dobCal.getTime(), TemporalPrecisionEnum.DAY);
patient.addName();
patient.getName().get(0).addGiven(fiviumPatient.getFirstname());
patient.getName().get(0).addFamily(fiviumPatient.getSurname());
patient.addContact();
patient.getContact().get(0).addTelecom();
patient.getContact().get(0).getTelecom().get(0).setSystem(ContactSystemEnum.PHONE);
patient.getContact().get(0).getTelecom().get(0).setValue(fiviumPatient.getPhone());
patient.addContact();
patient.getContact().get(1).addTelecom();
patient.getContact().get(1).getTelecom().get(0).setSystem(ContactSystemEnum.EMAIL);
patient.getContact().get(1).getTelecom().get(0).setValue(fiviumPatient.getEmail());
if (fiviumPatient.getGender().equals("FEMALE")) {
patient.setGender(AdministrativeGenderCodesEnum.F);
} else if (fiviumPatient.getGender().equals("MALE")) {
patient.setGender(AdministrativeGenderCodesEnum.M);
} else {
patient.setGender(AdministrativeGenderCodesEnum.UNK);
}
// private String tumorType;
// private String surgical;
return patient;
}
示例5: withId
import ca.uhn.fhir.model.primitive.IdDt; //导入方法依赖的package包/类
@Override
public CreateInternal withId(IdDt theId) {
myId = theId.getIdPart();
return this;
}
示例6: createSearchInvocation
import ca.uhn.fhir.model.primitive.IdDt; //导入方法依赖的package包/类
public static BaseHttpClientInvocation createSearchInvocation(FhirContext theContext, String theResourceName, Map<String, List<String>> theParameters, IdDt theId, String theCompartmentName,
SearchStyleEnum theSearchStyle) {
SearchStyleEnum searchStyle = theSearchStyle;
if (searchStyle == null) {
int length = 0;
for (Entry<String, List<String>> nextEntry : theParameters.entrySet()) {
length += nextEntry.getKey().length();
for (String next : nextEntry.getValue()) {
length += next.length();
}
}
if (length < 5000) {
searchStyle = SearchStyleEnum.GET;
} else {
searchStyle = SearchStyleEnum.POST;
}
}
BaseHttpClientInvocation invocation;
boolean compartmentSearch = false;
if (theCompartmentName != null) {
if (theId == null || !theId.hasIdPart()) {
String msg = theContext.getLocalizer().getMessage(SearchMethodBinding.class.getName() + ".idNullForCompartmentSearch");
throw new InvalidRequestException(msg);
} else {
compartmentSearch = true;
}
}
/*
* Are we doing a get (GET [base]/Patient?name=foo) or a get with search (GET [base]/Patient/_search?name=foo) or a post (POST [base]/Patient with parameters in the POST body)
*/
switch (searchStyle) {
case GET:
default:
if (compartmentSearch) {
invocation = new HttpGetClientInvocation(theParameters, theResourceName, theId.getIdPart(), theCompartmentName);
} else {
invocation = new HttpGetClientInvocation(theParameters, theResourceName);
}
break;
case GET_WITH_SEARCH:
if (compartmentSearch) {
invocation = new HttpGetClientInvocation(theParameters, theResourceName, theId.getIdPart(), theCompartmentName, Constants.PARAM_SEARCH);
} else {
invocation = new HttpGetClientInvocation(theParameters, theResourceName, Constants.PARAM_SEARCH);
}
break;
case POST:
if (compartmentSearch) {
invocation = new HttpPostClientInvocation(theContext, theParameters, theResourceName, theId.getIdPart(), theCompartmentName, Constants.PARAM_SEARCH);
} else {
invocation = new HttpPostClientInvocation(theContext, theParameters, theResourceName, Constants.PARAM_SEARCH);
}
}
return invocation;
}
示例7: addTagsPatient
import ca.uhn.fhir.model.primitive.IdDt; //导入方法依赖的package包/类
@AddTags(type = Patient.class)
public void addTagsPatient(@IdParam IdDt theId, @TagListParam TagList theTagList) {
ourLastOutcome = "add" + theId.getIdPart() + StringUtils.defaultString(theId.getVersionIdPart());
ourLastTagList=theTagList;
}
示例8: RemoveTagsPatient
import ca.uhn.fhir.model.primitive.IdDt; //导入方法依赖的package包/类
@DeleteTags(type = Patient.class)
public void RemoveTagsPatient(@IdParam IdDt theId, @TagListParam TagList theTagList) {
ourLastOutcome = "Remove" + theId.getIdPart()+StringUtils.defaultString(theId.getVersionIdPart());
ourLastTagList=theTagList;
}
示例9: getResourceById
import ca.uhn.fhir.model.primitive.IdDt; //导入方法依赖的package包/类
/**
* Retrieve the resource by its identifier
*
* @param theId
* The resource identity
* @return The resource
*/
@Read()
public Patient getResourceById(@IdParam IdDt theId) {
String key = theId.getIdPart();
Patient retVal = getIdToPatient().get(key);
return retVal;
}