public void setMatchingStrategyTag(FhirContext theFhirContext, IBaseResource theSubscription, SubscriptionMatchingStrategy theStrategy) { IBaseMetaType meta = theSubscription.getMeta(); String value = theStrategy.toString(); String display; if (theStrategy == SubscriptionMatchingStrategy.DATABASE) { display = "Database"; } else if (theStrategy == SubscriptionMatchingStrategy.IN_MEMORY) { display = "In-memory"; } else { throw new IllegalStateException("Unknown " + SubscriptionMatchingStrategy.class.getSimpleName() + ": "+theStrategy); } meta.addTag().setSystem(SubscriptionConstants.EXT_SUBSCRIPTION_MATCHING_STRATEGY).setCode(value).setDisplay(display); } }
protected <MT extends IBaseMetaType> MT toMetaDt(Class<MT> theType, Collection<TagDefinition> tagDefinitions) { MT retVal; try { retVal = theType.newInstance(); } catch (Exception e) { throw new InternalErrorException("Failed to instantiate " + theType.getName(), e); } for (TagDefinition next : tagDefinitions) { switch (next.getTagType()) { case PROFILE: retVal.addProfile(next.getCode()); break; case SECURITY_LABEL: retVal.addSecurity().setSystem(next.getSystem()).setCode(next.getCode()).setDisplay(next.getDisplay()); break; case TAG: retVal.addTag().setSystem(next.getSystem()).setCode(next.getCode()).setDisplay(next.getDisplay()); break; } } return retVal; }
IBaseCoding coding = metaValue.addTag(); coding.setCode(Constants.TAG_SUBSETTED_CODE); coding.setSystem(getSubsettedCodeSystem()); coding.setDisplay(subsetDescription());
case SECURITY_LABEL: IBaseCoding secLabel = (IBaseCoding) myContext.getVersion().newCodingDt(); secLabel.setSystem(next.getTag().getSystem()); secLabel.setCode(next.getTag().getCode()); secLabel.setDisplay(next.getTag().getDisplay());
case SECURITY_LABEL: IBaseCoding sec = res.getMeta().addSecurity(); sec.setSystem(next.getTag().getSystem()); sec.setCode(next.getTag().getCode()); sec.setDisplay(next.getTag().getDisplay()); case TAG: IBaseCoding tag = res.getMeta().addTag(); tag.setSystem(next.getTag().getSystem()); tag.setCode(next.getTag().getCode()); tag.setDisplay(next.getTag().getDisplay());
protected <MT extends IBaseMetaType> MT toMetaDt(Class<MT> theType, Collection<TagDefinition> tagDefinitions) { MT retVal; try { retVal = theType.newInstance(); } catch (Exception e) { throw new InternalErrorException("Failed to instantiate " + theType.getName(), e); } for (TagDefinition next : tagDefinitions) { switch (next.getTagType()) { case PROFILE: retVal.addProfile(next.getCode()); break; case SECURITY_LABEL: retVal.addSecurity().setSystem(next.getSystem()).setCode(next.getCode()).setDisplay(next.getDisplay()); break; case TAG: retVal.addTag().setSystem(next.getSystem()).setCode(next.getCode()).setDisplay(next.getDisplay()); break; } } return retVal; }
IBaseCoding coding = metaValue.addTag(); coding.setCode(Constants.TAG_SUBSETTED_CODE); coding.setSystem(getSubsettedCodeSystem()); coding.setDisplay(subsetDescription());
case SECURITY_LABEL: IBaseCoding secLabel = (IBaseCoding) myContext.getVersion().newCodingDt(); secLabel.setSystem(next.getTag().getSystem()); secLabel.setCode(next.getTag().getCode()); secLabel.setDisplay(next.getTag().getDisplay());
case SECURITY_LABEL: IBaseCoding sec = res.getMeta().addSecurity(); sec.setSystem(next.getTag().getSystem()); sec.setCode(next.getTag().getCode()); sec.setDisplay(next.getTag().getDisplay()); case TAG: IBaseCoding tag = res.getMeta().addTag(); tag.setSystem(next.getTag().getSystem()); tag.setCode(next.getTag().getCode()); tag.setDisplay(next.getTag().getDisplay());