public org.hl7.fhir.instance.model.Attachment convertAttachment(org.hl7.fhir.r4.model.Attachment src) throws FHIRException { if (src == null || src.isEmpty()) return null; org.hl7.fhir.instance.model.Attachment tgt = new org.hl7.fhir.instance.model.Attachment(); copyElement(src, tgt); tgt.setContentType(src.getContentType()); tgt.setLanguage(src.getLanguage()); tgt.setData(src.getData()); tgt.setUrl(src.getUrl()); tgt.setSize(src.getSize()); tgt.setHash(src.getHash()); tgt.setTitle(src.getTitle()); tgt.setCreation(src.getCreation()); return tgt; }
public org.hl7.fhir.dstu3.model.Attachment convertAttachment(org.hl7.fhir.instance.model.Attachment src) throws FHIRException { if (src == null || src.isEmpty()) return null; org.hl7.fhir.dstu3.model.Attachment tgt = new org.hl7.fhir.dstu3.model.Attachment(); copyElement(src, tgt); tgt.setContentType(src.getContentType()); tgt.setLanguage(src.getLanguage()); tgt.setData(src.getData()); tgt.setUrl(src.getUrl()); tgt.setSize(src.getSize()); tgt.setHash(src.getHash()); tgt.setTitle(src.getTitle()); tgt.setCreation(src.getCreation()); return tgt; }
@Override public void setProperty(String name, Base value) throws FHIRException { if (name.equals("contentType")) this.contentType = castToCode(value); // CodeType else if (name.equals("language")) this.language = castToCode(value); // CodeType else if (name.equals("data")) this.data = castToBase64Binary(value); // Base64BinaryType else if (name.equals("url")) this.url = castToUri(value); // UriType else if (name.equals("size")) this.size = castToUnsignedInt(value); // UnsignedIntType else if (name.equals("hash")) this.hash = castToBase64Binary(value); // Base64BinaryType else if (name.equals("title")) this.title = castToString(value); // StringType else if (name.equals("creation")) this.creation = castToDateTime(value); // DateTimeType else super.setProperty(name, value); }
/** * @return {@link #presentedForm} (Rich text representation of the entire result as issued by the diagnostic service. Multiple formats are allowed but they SHALL be semantically equivalent.) */ // syntactic sugar public Attachment addPresentedForm() { //3 Attachment t = new Attachment(); if (this.presentedForm == null) this.presentedForm = new ArrayList<Attachment>(); this.presentedForm.add(t); return t; }
reference.addContent() .setAttachment( new Attachment() .setContentType("text/plain") .setLanguage("en/us") .setSize(documentContent.length) .setHash(MessageDigest.getInstance("SHA-1").digest(documentContent)) .setUrl(BINARY_FULL_URL)) .addFormat() .setCode("urn:ihe:pcc:handp:2008")
public boolean hasPhoto() { if (this.photo == null) return false; for (Attachment item : this.photo) if (!item.isEmpty()) return true; return false; }
public Attachment copy() { Attachment dst = new Attachment(); copyValues(dst); dst.contentType = contentType == null ? null : contentType.copy(); dst.language = language == null ? null : language.copy(); dst.data = data == null ? null : data.copy(); dst.url = url == null ? null : url.copy(); dst.size = size == null ? null : size.copy(); dst.hash = hash == null ? null : hash.copy(); dst.title = title == null ? null : title.copy(); dst.creation = creation == null ? null : creation.copy(); return dst; }
DocumentReference dr = (DocumentReference) resource; for (DocumentReference.DocumentReferenceContentComponent content : dr.getContent()) { expectedBinaryFullUrls.add(content.getAttachment().getUrl());
/** * @return {@link #photo} (Image of the person.) */ // syntactic sugar public Attachment addPhoto() { //3 Attachment t = new Attachment(); if (this.photo == null) this.photo = new ArrayList<Attachment>(); this.photo.add(t); return t; }
public boolean hasImage() { if (this.image == null) return false; for (Attachment item : this.image) if (!item.isEmpty()) return true; return false; }
public Attachment copy() { Attachment dst = new Attachment(); copyValues(dst); dst.contentType = contentType == null ? null : contentType.copy(); dst.language = language == null ? null : language.copy(); dst.data = data == null ? null : data.copy(); dst.url = url == null ? null : url.copy(); dst.size = size == null ? null : size.copy(); dst.hash = hash == null ? null : hash.copy(); dst.title = title == null ? null : title.copy(); dst.creation = creation == null ? null : creation.copy(); return dst; }
DocumentReference dr = (DocumentReference) resource; for (DocumentReference.DocumentReferenceContentComponent content : dr.getContent()) { expectedBinaryFullUrls.add(content.getAttachment().getUrl());
public org.hl7.fhir.instance.model.Attachment convertAttachment(org.hl7.fhir.dstu3.model.Attachment src) throws FHIRException { if (src == null || src.isEmpty()) return null; org.hl7.fhir.instance.model.Attachment tgt = new org.hl7.fhir.instance.model.Attachment(); copyElement(src, tgt); tgt.setContentType(src.getContentType()); tgt.setLanguage(src.getLanguage()); tgt.setData(src.getData()); tgt.setUrl(src.getUrl()); tgt.setSize(src.getSize()); tgt.setHash(src.getHash()); tgt.setTitle(src.getTitle()); tgt.setCreation(src.getCreation()); return tgt; }
public org.hl7.fhir.r4.model.Attachment convertAttachment(org.hl7.fhir.instance.model.Attachment src) throws FHIRException { if (src == null || src.isEmpty()) return null; org.hl7.fhir.r4.model.Attachment tgt = new org.hl7.fhir.r4.model.Attachment(); copyElement(src, tgt); tgt.setContentType(src.getContentType()); tgt.setLanguage(src.getLanguage()); tgt.setData(src.getData()); tgt.setUrl(src.getUrl()); tgt.setSize(src.getSize()); tgt.setHash(src.getHash()); tgt.setTitle(src.getTitle()); tgt.setCreation(src.getCreation()); return tgt; }
/** * @return {@link #image} (Image or images used to identify a location.) */ // syntactic sugar public Attachment addImage() { //3 Attachment t = new Attachment(); if (this.image == null) this.image = new ArrayList<Attachment>(); this.image.add(t); return t; }
public boolean hasContent() { if (this.content == null) return false; for (Attachment item : this.content) if (!item.isEmpty()) return true; return false; }
@Override public void setProperty(String name, Base value) throws FHIRException { if (name.equals("contentType")) this.contentType = castToCode(value); // CodeType else if (name.equals("language")) this.language = castToCode(value); // CodeType else if (name.equals("data")) this.data = castToBase64Binary(value); // Base64BinaryType else if (name.equals("url")) this.url = castToUri(value); // UriType else if (name.equals("size")) this.size = castToUnsignedInt(value); // UnsignedIntType else if (name.equals("hash")) this.hash = castToBase64Binary(value); // Base64BinaryType else if (name.equals("title")) this.title = castToString(value); // StringType else if (name.equals("creation")) this.creation = castToDateTime(value); // DateTimeType else super.setProperty(name, value); }
public org.hl7.fhir.instance.model.Attachment convertAttachment(org.hl7.fhir.dstu3.model.Attachment src) throws FHIRException { if (src == null || src.isEmpty()) return null; org.hl7.fhir.instance.model.Attachment tgt = new org.hl7.fhir.instance.model.Attachment(); copyElement(src, tgt); tgt.setContentType(src.getContentType()); tgt.setLanguage(src.getLanguage()); tgt.setData(src.getData()); tgt.setUrl(src.getUrl()); tgt.setSize(src.getSize()); tgt.setHash(src.getHash()); tgt.setTitle(src.getTitle()); tgt.setCreation(src.getCreation()); return tgt; }
public org.hl7.fhir.dstu3.model.Attachment convertAttachment(org.hl7.fhir.instance.model.Attachment src) throws FHIRException { if (src == null || src.isEmpty()) return null; org.hl7.fhir.dstu3.model.Attachment tgt = new org.hl7.fhir.dstu3.model.Attachment(); copyElement(src, tgt); tgt.setContentType(src.getContentType()); tgt.setLanguage(src.getLanguage()); tgt.setData(src.getData()); tgt.setUrl(src.getUrl()); tgt.setSize(src.getSize()); tgt.setHash(src.getHash()); tgt.setTitle(src.getTitle()); tgt.setCreation(src.getCreation()); return tgt; }
/** * @return {@link #content} (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.) */ // syntactic sugar public Attachment addContent() { //3 Attachment t = new Attachment(); if (this.content == null) this.content = new ArrayList<Attachment>(); this.content.add(t); return t; }