use of org.hl7.fhir.r5.model.Meta in project dpc-app by CMSgov.
the class FHIRBuilderTests method testTagAdditionExistingMeta.
@Test
void testTagAdditionExistingMeta() {
final Meta meta = new Meta();
meta.addTag().setSystem("http://not.real").setCode("nothing");
final UUID uuid = UUID.randomUUID();
final Patient patient = new Patient();
patient.setMeta(meta);
patient.setGender(Enumerations.AdministrativeGender.FEMALE);
FHIRBuilders.addOrganizationTag(patient, uuid);
assertAll(() -> assertNotNull(patient.getMeta(), "Should have meta"), () -> assertEquals(2, patient.getMeta().getTag().size(), "Should have a single tag"));
}
use of org.hl7.fhir.r5.model.Meta in project hapi-fhir-jpaserver-starter by hapifhir.
the class ExampleServerR4IT method testBatchPutWithIdenticalTags.
@Test
public void testBatchPutWithIdenticalTags() {
String batchPuts = "{\n" + "\t\"resourceType\": \"Bundle\",\n" + "\t\"id\": \"patients\",\n" + "\t\"type\": \"batch\",\n" + "\t\"entry\": [\n" + "\t\t{\n" + "\t\t\t\"request\": {\n" + "\t\t\t\t\"method\": \"PUT\",\n" + "\t\t\t\t\"url\": \"Patient/pat-1\"\n" + "\t\t\t},\n" + "\t\t\t\"resource\": {\n" + "\t\t\t\t\"resourceType\": \"Patient\",\n" + "\t\t\t\t\"id\": \"pat-1\",\n" + "\t\t\t\t\"meta\": {\n" + "\t\t\t\t\t\"tag\": [\n" + "\t\t\t\t\t\t{\n" + "\t\t\t\t\t\t\t\"system\": \"http://mysystem.org\",\n" + "\t\t\t\t\t\t\t\"code\": \"value2\"\n" + "\t\t\t\t\t\t}\n" + "\t\t\t\t\t]\n" + "\t\t\t\t}\n" + "\t\t\t},\n" + "\t\t\t\"fullUrl\": \"/Patient/pat-1\"\n" + "\t\t},\n" + "\t\t{\n" + "\t\t\t\"request\": {\n" + "\t\t\t\t\"method\": \"PUT\",\n" + "\t\t\t\t\"url\": \"Patient/pat-2\"\n" + "\t\t\t},\n" + "\t\t\t\"resource\": {\n" + "\t\t\t\t\"resourceType\": \"Patient\",\n" + "\t\t\t\t\"id\": \"pat-2\",\n" + "\t\t\t\t\"meta\": {\n" + "\t\t\t\t\t\"tag\": [\n" + "\t\t\t\t\t\t{\n" + "\t\t\t\t\t\t\t\"system\": \"http://mysystem.org\",\n" + "\t\t\t\t\t\t\t\"code\": \"value2\"\n" + "\t\t\t\t\t\t}\n" + "\t\t\t\t\t]\n" + "\t\t\t\t}\n" + "\t\t\t},\n" + "\t\t\t\"fullUrl\": \"/Patient/pat-2\"\n" + "\t\t}\n" + "\t]\n" + "}";
Bundle bundle = FhirContext.forR4().newJsonParser().parseResource(Bundle.class, batchPuts);
ourClient.transaction().withBundle(bundle).execute();
}
use of org.hl7.fhir.r5.model.Meta in project camel-quarkus by apache.
the class FhirR4Resource method metaAdd.
// ///////////////////
// Meta
// ///////////////////
@Path("/meta")
@POST
@Produces(MediaType.TEXT_PLAIN)
public int metaAdd(@QueryParam("id") String id) {
IdType iIdType = new IdType(id);
Meta inMeta = new Meta();
inMeta.addTag().setSystem("urn:system1").setCode("urn:code1");
Map<String, Object> headers = new HashMap<>();
headers.put("CamelFhir.meta", inMeta);
headers.put("CamelFhir.id", iIdType);
IBaseMetaType result = producerTemplate.requestBodyAndHeaders("direct:metaAdd-r4", null, headers, IBaseMetaType.class);
return result.getTag().size();
}
use of org.hl7.fhir.r5.model.Meta in project camel-quarkus by apache.
the class FhirR4Resource method metaDelete.
@Path("/meta")
@DELETE
@Produces(MediaType.TEXT_PLAIN)
public int metaDelete(@QueryParam("id") String id) {
IdType iIdType = new IdType(id);
Meta inMeta = new Meta();
inMeta.addTag().setSystem("urn:system1").setCode("urn:code1");
Map<String, Object> headers = new HashMap<>();
headers.put("CamelFhir.meta", inMeta);
headers.put("CamelFhir.id", iIdType);
IBaseMetaType result = producerTemplate.requestBodyAndHeaders("direct:metaDelete-r4", null, headers, IBaseMetaType.class);
return result.getTag().size();
}
use of org.hl7.fhir.r5.model.Meta in project camel-quarkus by apache.
the class FhirDstu3Resource method metaAdd.
// ///////////////////
// Meta
// ///////////////////
@Path("/meta")
@POST
@Produces(MediaType.TEXT_PLAIN)
public int metaAdd(@QueryParam("id") String id) {
IdType iIdType = new IdType(id);
Meta inMeta = new Meta();
inMeta.addTag().setSystem("urn:system1").setCode("urn:code1");
Map<String, Object> headers = new HashMap<>();
headers.put("CamelFhir.meta", inMeta);
headers.put("CamelFhir.id", iIdType);
IBaseMetaType result = producerTemplate.requestBodyAndHeaders("direct:metaAdd-dstu3", null, headers, IBaseMetaType.class);
return result.getTag().size();
}
Aggregations