anchor.diff:        b.Append('Error: Code '+code+' not known')
       else
       try
  -      card.addLink('Further Detail', baseURL+'/tx/valuesets/'+FVs.id+'#'+code);
  +      card.addLink('Further Detail', baseURL+'/tx/valuesets/'+FCs.CodeSystem.id+'#'+code);
         concept := ctxt.context;
   
  -      b.Append(FVS.name+' Code '+code+' : '+concept.display+#13#10#13#10);
  +      b.Append(FCS.CodeSystem.name+' Code '+code+' : '+concept.display+#13#10#13#10);
         b.Append('* Definition: '+markdownNoPara(concept.definition)+#13#10);
  -      b.Append('* System Definition: '+markdownNoPara(FVs.description)+#13#10);
  +      b.Append('* System Definition: '+markdownNoPara(FCs.CodeSystem.description)+#13#10);
         b.Append(#13#10);
   
         if concept.designationList.Count > 0 then
  
positive.code:         codes.Free;
        end;
  
        codes := FVS.codeSystem.getChildren(concept);
        try
          if codes.count > 0 then
          begin
  
negative.code:     result := TFhirReference(t).reference;
  end;
  
  procedure TTerminologyServerStore.AddCodeSystemToCache(cs : TFhirCodeSystem; {$IFDEF FHIR2} vs : TFHIRValueSet; {$ENDIF} base : boolean);
  var
    cse : TFHIRCodeSystemEntry;
    supp : TFHIRCodeSystem;
  begin
    cse := TFHIRCodeSystemEntry.Create(cs.Link{$IFDEF FHIR2}, vs.link{$ENDIF});
    try
      if base then
        FBaseCodeSystems.AddOrSetValue(cs.url, cse.Link);
      {$IFDEF FHIR4}
      if (cs.supplements <> nil) then
      begin
        FSupplementsById.AddOrSetValue(cs.id, cs.Link);
        if cs.supplements.reference.StartsWith('CodeSystem/') then
        begin
          if FCodeSystemsById.TryGetValue(cs.supplements.reference.Substring(11), cse) then
            cse.Supplements.Add(cs.Link);
        end
        else if FCodeSystemsByUrl.TryGetValue(cs.supplements.reference, cse) then
          cse.Supplements.Add(cs.Link);
      end
      else
      begin
     {$ENDIF}
        FCodeSystemsById.AddOrSetValue(cs.id, cse.Link);
        FCodeSystemsByUrl.AddOrSetValue(cs.url, cse.Link);
        {$IFNDEF FHIR2}
        if cs.valueSet <> '' then
          FCodeSystemsByVsUrl.AddOrSetValue(cs.valueSet, cse.Link);
        {$ENDIF}
        if (FDB <> nil) then // don't build stems in this case
          BuildStems({$IFDEF FHIR2}vs.codeSystem{$ELSE}cs{$ENDIF}); // todo: move this out of the lock
        {$IFDEF FHIR4}
        for supp in FSupplementsById.values do
          if (supp.supplements.reference = cs.url) or (supp.supplements.reference = 'CodeSystem/'+cs.id) then
            cse.Supplements.Add(cs.Link);
      end;
     {$ENDIF}
    finally
      cse.Free;
    end;
  end;
  
  procedure TTerminologyServerStore.RemoveCodeSystemFromCache(id : String);
  var
    cse, cs1 : TFHIRCodeSystemEntry;
    cs : TFhirCodeSystem;
  begin
    if (FCodeSystemsById.TryGetValue(id, cse)) then
    begin
      cs1 := FBaseCodeSystems[cse.CodeSystem.url].Link;
      try
        {$IFDEF FHIR2}
        FCodeSystemsByUrl.Remove(cse.FValueSet.codeSystem.system);
        FCodeSystemsByid.Remove(cse.FValueSet.id);
        {$ELSE}
        FCodeSystemsByUrl.Remove(cse.codeSystem.system);
        FCodeSystemsByid.Remove(cse.codeSystem.id);
        {$ENDIF}
        if cs1 <> nil then
          AddCodeSystemToCache(cs1.codeSystem, false);
      finally
        cs1.free;
      end;
    end
    {$IFDEF FHIR4}
    else if FSupplementsById.TryGetValue(id, cs) then
    begin
      cs1 := FBaseCodeSystems[cs.url].Link;
      try
        if cs.supplements.reference.StartsWith('CodeSystem/') then
        begin
          if FCodeSystemsById.TryGetValue(cs.supplements.reference.Substring(11), cse) then
            cse.Supplements.Remove(cs);
        end
        else if FCodeSystemsByUrl.TryGetValue(cs.supplements.reference, cse) then
          cse.Supplements.remove(cs);
        if cs1 <> nil then
          AddCodeSystemToCache(cs1.codeSystem, false);
      finally
        cs1.Free;
      end;
    end;
    {$ENDIF}
  end;
  
  procedure TTerminologyServerStore.SeeSpecificationResource(resource : TFHIRResource);
  var
    vs : TFhirValueSet;
    cs : TFhirCodeSystem;
    cm : TLoadedConceptMap;
    i : integer;
  begin
    FLock.Lock('SeeSpecificationResource');
    try
  