本文整理汇总了Java中org.hl7.fhir.instance.model.Patient.getIdElement方法的典型用法代码示例。如果您正苦于以下问题:Java Patient.getIdElement方法的具体用法?Java Patient.getIdElement怎么用?Java Patient.getIdElement使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.hl7.fhir.instance.model.Patient
的用法示例。
在下文中一共展示了Patient.getIdElement方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testOverrideResourceIdWithBundleEntryFullUrlEnabled
import org.hl7.fhir.instance.model.Patient; //导入方法依赖的package包/类
@Test
public void testOverrideResourceIdWithBundleEntryFullUrlEnabled() {
String tmp = "<Bundle xmlns=\"http://hl7.org/fhir\"><entry><fullUrl value=\"http://lalaland.org/patient/pat1\"/><resource><Patient xmlns=\"http://hl7.org/fhir\"><id value=\"patxuzos\"/></Patient></resource></entry></Bundle>";
Bundle bundle = (Bundle) ourCtx.newXmlParser().parseResource(tmp);
assertEquals(1, bundle.getEntry().size());
{
Patient o1 = (Patient) bundle.getEntry().get(0).getResource();
IIdType o1Id = o1.getIdElement();
assertEquals("http://lalaland.org", o1Id.getBaseUrl());
assertEquals("patient", o1Id.getResourceType());
assertEquals("pat1", o1Id.getIdPart());
assertFalse(o1Id.hasVersionIdPart());
}
}
示例2: testOverrideResourceIdWithBundleEntryFullUrlDisabled_ConfiguredOnFhirContext
import org.hl7.fhir.instance.model.Patient; //导入方法依赖的package包/类
@Test
public void testOverrideResourceIdWithBundleEntryFullUrlDisabled_ConfiguredOnFhirContext() {
String tmp = "<Bundle xmlns=\"http://hl7.org/fhir\"><entry><fullUrl value=\"http://lalaland.org/patient/pat1\"/><resource><Patient xmlns=\"http://hl7.org/fhir\"><id value=\"patxuzos\"/></Patient></resource></entry></Bundle>";
ourCtx.getParserOptions().setOverrideResourceIdWithBundleEntryFullUrl(false);
Bundle bundle = (Bundle) ourCtx.newXmlParser().parseResource(tmp);
assertEquals(1, bundle.getEntry().size());
{
Patient o1 = (Patient) bundle.getEntry().get(0).getResource();
IIdType o1Id = o1.getIdElement();
assertFalse(o1Id.hasBaseUrl());
assertEquals("Patient", o1Id.getResourceType());
assertEquals("patxuzos", o1Id.getIdPart());
assertFalse(o1Id.hasVersionIdPart());
}
}
示例3: testOverrideResourceIdWithBundleEntryFullUrlDisabled_ConfiguredOnParser
import org.hl7.fhir.instance.model.Patient; //导入方法依赖的package包/类
@Test
public void testOverrideResourceIdWithBundleEntryFullUrlDisabled_ConfiguredOnParser() {
String tmp = "<Bundle xmlns=\"http://hl7.org/fhir\"><entry><fullUrl value=\"http://lalaland.org/patient/pat1\"/><resource><Patient xmlns=\"http://hl7.org/fhir\"><id value=\"patxuzos\"/></Patient></resource></entry></Bundle>";
Bundle bundle = (Bundle) ourCtx.newXmlParser().setOverrideResourceIdWithBundleEntryFullUrl(false).parseResource(tmp);
assertEquals(1, bundle.getEntry().size());
{
Patient o1 = (Patient) bundle.getEntry().get(0).getResource();
IIdType o1Id = o1.getIdElement();
assertFalse(o1Id.hasBaseUrl());
assertEquals("Patient", o1Id.getResourceType());
assertEquals("patxuzos", o1Id.getIdPart());
assertFalse(o1Id.hasVersionIdPart());
}
}
示例4: createPatient
import org.hl7.fhir.instance.model.Patient; //导入方法依赖的package包/类
@Create()
public MethodOutcome createPatient(@ResourceParam Patient thePatient, @ConditionalUrlParam String theConditional, @IdParam IdType theIdParam) {
ourLastConditionalUrl = theConditional;
ourLastId = thePatient.getIdElement();
ourLastIdParam = theIdParam;
return new MethodOutcome(new IdType("Patient/001/_history/002"));
}