/** * Gets the value(s) for <b>attachment</b> (). * creating it if it does * not exist. Will not return <code>null</code>. * * <p> * <b>Definition:</b> * The document or url of the document along with critical metadata to prove content has integrity. * </p> */ public AttachmentDt getAttachment() { if (myAttachment == null) { myAttachment = new AttachmentDt(); } return myAttachment; }
String contentType = attachment.getContentType(); String url = attachment.getUrl(); return url != null ? getImage(url) : new AImage(contentType.substring(6), attachment.getData()); } catch (Exception e) {
public byte[] getContent() { if (content == null) { content = reference.getContentFirstRep().getData(); if (content == null || content.length == 0) { Binary binary = ClientUtil.getFhirClient().read(Binary.class, reference.getContentFirstRep().getUrl()); content = binary.getContent(); } if (content == null) { content = EMPTY_CONTENT; } } return content; }
/** * Gets the value(s) for <b>url</b> (). * creating it if it does * not exist. This method may return <code>null</code>. * * <p> * <b>Definition:</b> * An alternative location where the data can be accessed * </p> */ public String getUrl() { return getUrlElement().getValue(); }
public String getContentType() { return reference.getContentFirstRep().getContentType(); }
/** * Gets the value(s) for <b>language</b> (). * creating it if it does * not exist. This method may return <code>null</code>. * * <p> * <b>Definition:</b> * The human language of the content. The value can be any valid value according to BCP 47 * </p> */ public String getLanguage() { return getLanguageElement().getValue(); }
/** * Gets the value(s) for <b>creation</b> (). * creating it if it does * not exist. This method may return <code>null</code>. * * <p> * <b>Definition:</b> * The date that the attachment was first created * </p> */ public Date getCreation() { return getCreationElement().getValue(); }
/** * Gets the value(s) for <b>contentType</b> (). * creating it if it does * not exist. This method may return <code>null</code>. * * <p> * <b>Definition:</b> * Identifies the type of the data in the attachment and allows a method to be chosen to interpret or render the data. Includes mime type parameters such as charset where appropriate * </p> */ public String getContentType() { return getContentTypeElement().getValue(); }
/** * Gets the value(s) for <b>data</b> (). * creating it if it does * not exist. This method may return <code>null</code>. * * <p> * <b>Definition:</b> * The actual data of the attachment - a sequence of bytes. In XML, represented using base64 * </p> */ public byte[] getData() { return getDataElement().getValue(); }
/** * Gets the value(s) for <b>hash</b> (). * creating it if it does * not exist. This method may return <code>null</code>. * * <p> * <b>Definition:</b> * The calculated hash of the data using SHA-1. Represented using base64 * </p> */ public byte[] getHash() { return getHashElement().getValue(); }
@Test public void test() throws URISyntaxException { IDomainFactory<BaseResource> factory = DomainFactory.getInstance(); Patient pat1 = factory.fetchObject(Patient.class, "1"); assertNotNull(pat1); for (ExtensionDt extension : pat1.getAllUndeclaredExtensions()) { System.out.println(extension.getUrlAsString() + "=" + extension.getValue()); } List<Patient> patients = factory.fetchObjects(Patient.class, PAT_IDS); assertNotNull(patients); assertEquals(2, patients.size()); DocumentReference dr = factory.fetchObject(DocumentReference.class, "1"); assertNotNull(dr); UriDt uri = dr.getContentFirstRep().getUrlElement(); IGenericClient client = ClientUtil.getFhirClient(); Binary result = (Binary) client.read(uri); assertNotNull(result); byte[] text = result.getContent(); System.out.println(new String(text)); Condition cond = factory.fetchObject(Condition.class, "1"); assertNotNull(cond); testException(client, ROOT + "Patient/309349993439"); }
/** * Gets the value(s) for <b>photo</b> (). * creating it if it does * not exist. Will not return <code>null</code>. * * <p> * <b>Definition:</b> * An image that can be displayed as a thumbnail of the person to enhance the identification of the individual * </p> */ public AttachmentDt getPhoto() { if (myPhoto == null) { myPhoto = new AttachmentDt(); } return myPhoto; }
/** * Gets the value(s) for <b>photo</b> (). * creating it if it does * not exist. Will not return <code>null</code>. * * <p> * <b>Definition:</b> * If there is a photo/symbol associated with this HealthcareService, it may be included here to facilitate quick identification of the service in a list * </p> */ public AttachmentDt getPhoto() { if (myPhoto == null) { myPhoto = new AttachmentDt(); } return myPhoto; }
/** * Gets the value(s) for <b>content</b> (). * creating it if it does * not exist. Will not return <code>null</code>. * * <p> * <b>Definition:</b> * The actual content of the media - inline or by direct reference to the media source file * </p> */ public AttachmentDt getContent() { if (myContent == null) { myContent = new AttachmentDt(); } return myContent; }
/** * Adds and returns a new value for <b>presentedForm</b> () * * <p> * <b>Definition:</b> * Rich text representation of the entire result as issued by the diagnostic service. Multiple formats are allowed but they SHALL be semantically equivalent. * </p> */ public AttachmentDt addPresentedForm() { AttachmentDt newType = new AttachmentDt(); getPresentedForm().add(newType); return newType; }
/** * Adds and returns a new value for <b>photo</b> () * * <p> * <b>Definition:</b> * Image of the patient * </p> */ public AttachmentDt addPhoto() { AttachmentDt newType = new AttachmentDt(); getPhoto().add(newType); return newType; }
/** * Adds and returns a new value for <b>image</b> () * * <p> * <b>Definition:</b> * Image or images used to identify a location. * </p> */ public AttachmentDt addImage() { AttachmentDt newType = new AttachmentDt(); getImage().add(newType); return newType; }
/** * Adds and returns a new value for <b>photo</b> () * * <p> * <b>Definition:</b> * Image of the person * </p> */ public AttachmentDt addPhoto() { AttachmentDt newType = new AttachmentDt(); getPhoto().add(newType); return newType; }
/** * Adds and returns a new value for <b>content</b> () * * <p> * <b>Definition:</b> * Content of the instance or a rendering thereof (e.g. a JPEG of an image, or an XML of a structured report). May be represented for example by inline encoding; by a URL reference to a WADO-RS service that makes the instance available; or to a FHIR Resource (e.g. Media, Document, etc.). Multiple content attachments may be used for alternate representations of the instance. * </p> */ public AttachmentDt addContent() { AttachmentDt newType = new AttachmentDt(); getContent().add(newType); return newType; }
/** * Adds and returns a new value for <b>photo</b> () * * <p> * <b>Definition:</b> * Image of the person * </p> */ public AttachmentDt addPhoto() { AttachmentDt newType = new AttachmentDt(); getPhoto().add(newType); return newType; }