   )
 
 (defn- set-or-generate-concept-id 
-  "Get an exiting concept-id from the DB for the given concept or generate one 
+  "Get an existing concept-id from the DB for the given concept or generate one 
   if the concept has never been saved."
   [db concept]
   (if (:concept-id concept) 

          revision-id (if existing-revision-id (inc existing-revision-id) 0)]
      (assoc concept :revision-id revision-id))))

;;; TODO move this to the services layer
(defn- validate-concept-revision-id
  "Validate that the revision-id for a concept (if given) is one greater than
  the current maximum revision-id for this concept."
  [db concept previous-revision]

                               messages/invalid-revision-id-msg
                               0
                               revision-id))))))

(defn- set-deleted-flag [value concept] (assoc concept :deleted value))

