public static Reference makeReference(String url, String text) { Reference rr = new Reference(); rr.setReference(url); if (!Utilities.noString(text)) rr.setDisplay(text); return rr; }
@Override public List<ConceptMap> findMapsForSource(String url) throws FHIRException { synchronized (lock) { List<ConceptMap> res = new ArrayList<ConceptMap>(); for (ConceptMap map : maps.values()) if (((Reference) map.getSource()).getReference().equals(url)) res.add(map); return res; } }
@Override public Base makeProperty(int hash, String name) throws FHIRException { switch (hash) { case -925155509: return (Base) getReferenceElement(); case 3575610: return getTypeElement(); case -1618432855: return getIdentifier(); case 1671764162: return getDisplayElement(); default: return super.makeProperty(hash, name); } }
public static Reference makeReference(String url) { Reference rr = new Reference(); rr.setReference(url); return rr; }
public Reference addAbout() { //3 Reference t = new Reference(); if (this.about == null) this.about = new ArrayList<Reference>(); this.about.add(t); return t; }
public static Reference readAsReference(Element item) { Reference r = new Reference(); r.setDisplay(item.getNamedChildValue("display")); r.setReference(item.getNamedChildValue("reference")); r.setType(item.getNamedChildValue("type")); List<Element> identifier = item.getChildrenByName("identifier"); if (identifier.isEmpty() == false) { r.setIdentifier(readAsIdentifier(identifier.get(0))); } return r; }
public org.hl7.fhir.instance.model.AuditEvent.AuditEventObjectComponent convertAuditEventEntityComponent(org.hl7.fhir.r4.model.AuditEvent.AuditEventEntityComponent src) throws FHIRException { if (src == null || src.isEmpty()) return null; org.hl7.fhir.instance.model.AuditEvent.AuditEventObjectComponent tgt = new org.hl7.fhir.instance.model.AuditEvent.AuditEventObjectComponent(); copyElement(src, tgt); if (src.hasWhat()) { if (src.getWhat().hasIdentifier()) tgt.setIdentifier(convertIdentifier(src.getWhat().getIdentifier())); if (src.getWhat().hasReference() || src.getWhat().hasDisplay() || src.getWhat().hasExtension() || src.getWhat().hasId()) tgt.setReference(convertReference(src.getWhat())); } tgt.setType(convertCoding(src.getType())); tgt.setRole(convertCoding(src.getRole())); tgt.setLifecycle(convertCoding(src.getLifecycle())); for (org.hl7.fhir.r4.model.Coding t : src.getSecurityLabel()) tgt.addSecurityLabel(convertCoding(t)); tgt.setName(src.getName()); tgt.setDescription(src.getDescription()); tgt.setQuery(src.getQuery()); for (org.hl7.fhir.r4.model.AuditEvent.AuditEventEntityDetailComponent t : src.getDetail()) tgt.addDetail(convertAuditEventEntityDetailComponent(t)); return tgt; }
public static org.hl7.fhir.dstu2016may.model.Reference convertReference(org.hl7.fhir.r4.model.Reference src) throws FHIRException { if (src == null || src.isEmpty()) return null; org.hl7.fhir.dstu2016may.model.Reference tgt = new org.hl7.fhir.dstu2016may.model.Reference(); copyElement(src, tgt); if (src.hasReference()) tgt.setReference(src.getReference()); if (src.hasDisplay()) tgt.setDisplay(src.getDisplay()); return tgt; }
private void processCanonicalReference(Resource context, Base source, Field field, ObjectValue target, boolean inheritedList, String suffix) throws EGraphQLException, FHIRException { if (!(source instanceof CanonicalType)) throw new EGraphQLException("Not done yet"); if (services == null) throw new EGraphQLException("Resource Referencing services not provided"); Reference ref = new Reference(source.primitiveValue()); ReferenceResolution res = services.lookup(appInfo, context, ref); if (res != null) { if (targetTypeOk(field.getArguments(), res.target)) { Argument arg = target.addField(field.getAlias() + suffix, listStatus(field, inheritedList)); ObjectValue obj = new ObjectValue(); arg.addValue(obj); processObject(res.targetContext, res.target, obj, field.getSelectionSet(), inheritedList, suffix); } } else if (!hasArgument(field.getArguments(), "optional", "true")) throw new EGraphQLException("Unable to resolve reference to "+ref.getReference()); }
private void checkReference(ValidatorHostContext hostContext, List<ValidationMessage> errors, String path, Element element, StructureDefinition profile, ElementDefinition container, String parentType, NodeStack stack) throws FHIRException, IOException { Reference reference = ObjectConverter.readAsReference(element); String ref = reference.getReference(); if (Utilities.noString(ref)) { if (Utilities.noString(reference.getIdentifier().getSystem()) && Utilities.noString(reference.getIdentifier().getValue())) { warning(errors, IssueType.STRUCTURE, element.line(), element.col(), path, !Utilities.noString(element.getNamedChildValue("display")), "A Reference without an actual reference or identifier should have a display"); ft = tryParse(ref); if (reference.hasType()) { String tu = isAbsolute(reference.getType()) ? reference.getType() : "http://hl7.org/fhir/StructureDefinition/"+reference.getType(); TypeRefComponent containerType = container.getType("Reference"); if (!containerType.hasTargetProfile(tu) && !containerType.hasTargetProfile("http://hl7.org/fhir/StructureDefinition/Resource")) { "The type '"+reference.getType()+"' is not a valid Target for this element (must be one of "+container.getType("Reference").getTargetProfile()+")"); rule(errors, IssueType.STRUCTURE, element.line(), element.col(), path, ft==null || ft.equals(reference.getType()), "The specified type '"+reference.getType()+"' does not match the found type '"+ft+"'");
protected AuditEvent.AuditEventSourceComponent auditSourceIdentificationToEventSource(AuditSourceIdentificationType asit) { AuditEvent.AuditEventSourceComponent source = new AuditEvent.AuditEventSourceComponent() .setSite(asit.getAuditEnterpriseSiteID()) .setObserver(new Reference().setIdentifier(new Identifier().setValue(asit.getAuditSourceID()))); asit.getAuditSourceType().forEach(ast -> source.addType(codedValueTypeToCoding(ast))); return source; }
private String getSubjectReference(Resource resource, Function<Resource, Reference> f) { Reference reference = f.apply(resource); if (reference == null) { throw FhirUtils.unprocessableEntity( OperationOutcome.IssueSeverity.ERROR, OperationOutcome.IssueType.INVALID, ErrorCode.UNKNOWN_PATIENT_ID.getOpcode(), null, "Empty Patient reference in resource %s", resource ); } // Could be contained resources if (reference.getResource() != null) { Patient patient = (Patient) reference.getResource(); return patient.getIdentifier().get(0).getValue(); } return reference.getReference(); }
public org.hl7.fhir.instance.model.Reference convertReference(org.hl7.fhir.r4.model.Reference src) throws FHIRException { if (src == null || src.isEmpty()) return null; org.hl7.fhir.instance.model.Reference tgt = new org.hl7.fhir.instance.model.Reference(); copyElement(src, tgt); tgt.setReference(src.getReference()); tgt.setDisplay(src.getDisplay()); return tgt; }
public boolean hasAccount() { if (this.account == null) return false; for (Reference item : this.account) if (!item.isEmpty()) return true; return false; }
public org.hl7.fhir.r4.model.Reference convertDocumentReferenceContextRelatedComponent(org.hl7.fhir.instance.model.DocumentReference.DocumentReferenceContextRelatedComponent src) throws FHIRException { if (src == null || src.isEmpty()) return null; org.hl7.fhir.r4.model.Reference tgt = convertReference(src.getRef()); copyElement(src, tgt); tgt.setIdentifier(convertIdentifier(src.getIdentifier())); return tgt; }
public org.hl7.fhir.instance.model.DocumentReference.DocumentReferenceContextRelatedComponent convertDocumentReferenceContextRelatedComponent(org.hl7.fhir.r4.model.Reference src) throws FHIRException { if (src == null || src.isEmpty()) return null; org.hl7.fhir.instance.model.DocumentReference.DocumentReferenceContextRelatedComponent tgt = new org.hl7.fhir.instance.model.DocumentReference.DocumentReferenceContextRelatedComponent(); copyElement(src, tgt); tgt.setIdentifier(convertIdentifier(src.getIdentifier())); tgt.setRef(convertReference(src)); return tgt; }
public org.hl7.fhir.instance.model.AuditEvent.AuditEventSourceComponent convertAuditEventSourceComponent(org.hl7.fhir.r4.model.AuditEvent.AuditEventSourceComponent src) throws FHIRException { if (src == null || src.isEmpty()) return null; org.hl7.fhir.instance.model.AuditEvent.AuditEventSourceComponent tgt = new org.hl7.fhir.instance.model.AuditEvent.AuditEventSourceComponent(); copyElement(src, tgt); tgt.setSite(src.getSite()); if (src.hasObserver()) tgt.setIdentifier(convertIdentifier(src.getObserver().getIdentifier())); for (org.hl7.fhir.r4.model.Coding t : src.getType()) tgt.addType(convertCoding(t)); return tgt; }
/** * Convenience setter which sets the reference to the complete {@link IIdType#getValue() value} of the given * reference. * * @param theReference The reference, or <code>null</code> * @return * @return Returns a reference to this */ public Reference setReferenceElement(IIdType theReference) { if (theReference != null) { setReference(theReference.getValue()); } else { setReference(null); } return this; } protected void listChildren(List<Property> children) {
public Reference addEvaluationMessage() { //3 Reference t = new Reference(); if (this.evaluationMessage == null) this.evaluationMessage = new ArrayList<Reference>(); this.evaluationMessage.add(t); return t; }
public static Reference readAsReference(Element item) { Reference r = new Reference(); r.setDisplay(item.getNamedChildValue("display")); r.setReference(item.getNamedChildValue("reference")); r.setType(item.getNamedChildValue("type")); List<Element> identifier = item.getChildrenByName("identifier"); if (identifier.isEmpty() == false) { r.setIdentifier(readAsIdentifier(identifier.get(0))); } return r; }