public static HasResourceId ( IKey key ) : void | ||
key | IKey | |
Résultat | void |
public FhirResponse Put(IKey key, Resource resource) { Validate.Key(key); Validate.ResourceType(key, resource); Validate.HasTypeName(key); Validate.HasResourceId(key); Validate.HasResourceId(resource); Validate.IsResourceIdEqual(key, resource); Entry current = fhirStore.Get(key); Entry entry = Entry.PUT(key, resource); transfer.Internalize(entry); Store(entry); // API: The api demands a body. This is wrong //CCR: The documentations specifies that servers should honor the Http return preference header Entry result = fhirStore.Get(entry.Key); transfer.Externalize(result); return(Respond.WithResource(current != null ? HttpStatusCode.OK : HttpStatusCode.Created, result)); }
private static void ValidateKey(Key key, bool includeVersion = false) { Validate.HasTypeName(key); Validate.HasResourceId(key); if (includeVersion) { Validate.HasVersion(key); } else { Validate.HasNoVersion(key); } Validate.Key(key); }
public FhirResponse ReadMeta(Key key) { Validate.HasTypeName(key); Validate.HasResourceId(key); Validate.HasNoVersion(key); Validate.Key(key); Interaction interaction = store.Get(key); if (interaction == null) { return(Respond.NotFound(key)); } else if (interaction.IsDeleted()) { return(Respond.Gone(interaction)); } return(Respond.WithMeta(interaction)); }
public FhirResponse Put(IKey key, Resource resource) { Validate.Key(key); Validate.ResourceType(key, resource); Validate.HasTypeName(key); Validate.HasResourceId(key); Validate.HasResourceId(resource); Validate.IsResourceIdEqual(key, resource); Interaction interaction = Interaction.PUT(key, resource); transfer.Internalize(interaction); Store(interaction); // API: The api demands a body. This is wrong Interaction result = store.Get(interaction.Key); transfer.Externalize(result); return(Respond.WithResource(HttpStatusCode.OK, interaction)); }
/// <summary> /// Read the state of a specific version of the resource. /// </summary> /// <param name="collectionName">The resource type, in lowercase</param> /// <param name="id">The id part of a version-specific reference</param> /// <param name="vid">The version part of a version-specific reference</param> /// <returns>A Result containing the resource, or an Issue</returns> /// <remarks> /// If the version referred to is actually one where the resource was deleted, the server should return a /// 410 status code. /// </remarks> public FhirResponse VersionRead(Key key) { Validate.HasTypeName(key); Validate.HasResourceId(key); Validate.HasVersion(key); Validate.Key(key); Interaction interaction = store.Get(key); if (interaction == null) { return(Respond.NotFound(key)); } else if (interaction.IsDeleted()) { return(Respond.Gone(interaction)); } transfer.Externalize(interaction); return(Respond.WithResource(interaction)); }