public static void manualContained() { // START SNIPPET: manualContained // Create an organization, and give it a local ID Organization org = new Organization(); org.setId("#localOrganization"); org.getNameElement().setValue("Contained Test Organization"); // Create a patient Patient patient = new Patient(); patient.setId("Patient/1333"); patient.addIdentifier().setSystem("urn:mrns").setValue("253345"); // Set the reference, and manually add the contained resource patient.getManagingOrganization().setReference("#localOrganization"); patient.getContained().getContainedResources().add(org); String encoded = ourCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(patient); System.out.println(encoded); // END SNIPPET: manualContained }
/** * Constructor which accepts a reference directly (this can be an ID, a partial/relative URL or a complete/absolute * URL) * * @param theResourceId * The reference itself */ public ResourceReferenceDt(IdDt theResourceId) { setReference(theResourceId); }
/** * Constructor which accepts a reference directly (this can be an ID, a partial/relative URL or a complete/absolute * URL) * * @param theResourceId * The reference itself */ public ResourceReferenceDt(IIdType theResourceId) { setReference(theResourceId); }
/** * Constructor which accepts a reference directly (this can be an ID, a partial/relative URL or a complete/absolute * URL) * * @param theId * The reference itself */ public ResourceReferenceDt(String theId) { setReference(new IdDt(theId)); }
RuntimeResourceDefinition def = getServerConfiguration().getFhirContext().getResourceDefinition(resourceName); resource.getTypeElement().setValue(def.getName()); resource.getProfile().setReference(new IdDt(def.getResourceProfile(serverBase))); if (operationNames.add(opName)) { rest.addOperation().setName(methodBinding.getName().substring(1)).getDefinition().setReference("OperationDefinition/" + opName); String opName = myOperationBindingToName.get(methodBinding); if (operationNames.add(opName)) { rest.addOperation().setName(methodBinding.getName().substring(1)).getDefinition().setReference("OperationDefinition/" + opName);