@Override public String toString() { ToStringBuilder b = new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE); if (isNotBlank(myChain)) { b.append("chain", myChain); } b.append("value", getValue()); return b.build(); }
@Search public List<DiagnosticReport> findReportsWithChain( @RequiredParam(name=DiagnosticReport.SP_SUBJECT, chainWhitelist= {Patient.SP_FAMILY, Patient.SP_GENDER}) ReferenceParam theSubject ) { List<DiagnosticReport> retVal=new ArrayList<DiagnosticReport>(); String chain = theSubject.getChain(); if (Patient.SP_FAMILY.equals(chain)) { String familyName = theSubject.getValue(); // .. populate with reports matching subject family name .. } if (Patient.SP_GENDER.equals(chain)) { String gender = theSubject.getValue(); // .. populate with reports matching subject gender .. } return retVal; } //END SNIPPET: referenceWithChain
@Search public List<DiagnosticReport> findReportsWithChainCombo ( @RequiredParam(name=DiagnosticReport.SP_SUBJECT, chainWhitelist= {"", Patient.SP_FAMILY}) ReferenceParam theSubject ) { List<DiagnosticReport> retVal=new ArrayList<DiagnosticReport>(); String chain = theSubject.getChain(); if (Patient.SP_FAMILY.equals(chain)) { String familyName = theSubject.getValue(); // .. populate with reports matching subject family name .. } if ("".equals(chain)) { String resourceId = theSubject.getValue(); // .. populate with reports matching subject with resource ID .. } return retVal; } //END SNIPPET: referenceWithChainCombo
private boolean resourceIdMatches(ResourceLink theResourceLink, ReferenceParam theReference) { ResourceTable target = theResourceLink.getTargetResource(); IdDt idDt = target.getIdDt(); if (idDt.isIdPartValidLong()) { return theReference.getIdPartAsLong() == idDt.getIdPartAsLong(); } else { ForcedId forcedId = target.getForcedId(); if (forcedId != null) { return forcedId.getForcedId().equals(theReference.getValue()); } else { return false; } } }
String resourceId = subject.getValue();
@Override public String toString() { ToStringBuilder b = new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE); if (isNotBlank(myChain)) { b.append("chain", myChain); } b.append("value", getValue()); return b.build(); }