   [t i r]
   (let [v (ld1-> t i "variant" "relatedContextualAllele" (prop= t true "preferred"))]
   (if (nil? v ) (log/error (str "Exception in get-variant: relatedContextualAllele not found")))
-    {:variantIdentifier (variant-identifier v),
-     :altDesignations (variant-alt-designations v),
-     :refseq (variant-refseq t v),
-     :start (variant-start t v),
-     :stop  (variant-stop t v),
-     :ref (variant-ref t v),
-     :alt (variant-alt v)}))
- 
- ; *** Condition related transformations 
+    {:variantIdentifier (variant-identifier v r),
+     :altDesignations (variant-alt-designations v r),
+     :refseq (variant-refseq t v r),
+     :start (variant-start t v r),
+     :stop  (variant-stop t v r),
+     :ref (variant-ref t v r),
+     :alt (variant-alt v r)}))
+
+;*** Condition related transformations 
+
  (defn condition-name
   "Returns clinvar condition name based on available content. 
   May log warnings if available content does not conform to
   clinvar specifcations."
-  [t c]
+  [t c r]
   (if (not (nil? c)) 
   (let [name (get c "name")]
-    (csv-colval (if (nil? name) "" name) "ERROR-condition-name"))
-  (log/error (str "ERROR-condition-name: condition name not found"))))
+    (csv-colval (if (nil? name) "" name) "*E-301"))
+  (report/append-to-report r "\n\n*E-301: Condition disease code or name not provided.")))
 
 (defn condition-idtype
   ;TODO modify to deal with phenotypes and multi-values for satisfying clinvar specs.
-  [t c]
+  [t c r]
   (if (not (nil? c)) 
   (let [disease-coding (ld-> t c "disease" "coding")]
     (let [disease-code (get disease-coding "code")]
-      (csv-colval (if (nil? disease-code) "" (get (re-find #"(.*)\_(.*)" disease-code) 1)) "ERROR-condition-idtype")))
-  (log/error (str "ERROR-condition-idtype: condition idt type not found"))))
+      (csv-colval (if (nil? disease-code) "" (get (re-find #"(.*)\_(.*)" disease-code) 1)) "*E-301")))
+  (report/append-to-report r "\n\n*E-301: Condition disease code or name not provided.")))
+
 
 (defn condition-idvals
-   ;TODO modify to deal with phenotypes and multi-values for satisfying clinvar specs.
-  [t c]
-  (if (not (nil? c)) 
-  (let [disease-coding (ld-> t c "disease" "coding")]
-    (let [disease-code (get disease-coding "code")]
-      (csv-colval (if (nil? disease-code) "" (get (re-find #"(.*)\_(.*)" disease-code) 2)) "ERROR-condition-idvals")))
-  (log/error (str "Exception in function condition-idvals: condition id not found"))))
+;TODO modify to deal with phenotypes and multi-values for satisfying clinvar specs.
+[t c r]
+(if (not (nil? c)) 
+(let [disease-coding (ld-> t c "disease" "coding")]
+(let [disease-code (get disease-coding "code")]
+(csv-colval (if (nil? disease-code) "" (get (re-find #"(.*)\_(.*)" disease-code) 2)) "*E-301")))
+(report/append-to-report r "\n\n*E-301: Condition disease code or name not provided.")))
+
 
 (defn condition-moi
-  [t c]
-  (if (not (nil? c)) (csv-colval (if (nil? (ld-> t c "modeOfInheritance" "display")) "" (ld-> t c "modeOfInheritance" "display")) "ERROR-condition-moi")
-  (log/error (str "Exception in function condition-moi: condition moi not found"))))
+  [t c r]
+  (if (not (nil? c)) (csv-colval (if (nil? (ld-> t c "modeOfInheritance" "display")) "" (ld-> t c "modeOfInheritance" "display")) "*E-302")
+  (report/append-to-report r "\n\n*E-302: Mode of Inheritance display value not provided.")))
 
 (defn get-condition
   "Processes the condition element to derive the ClinVar sanctioned fields: 

    (let [crits (ld-> t e "information" "criterion")]
      (map #(get % "id") crits))) 
  
  (defn evidence-summary    
    "Returns a standard formatted summarization of the rules that were met."    
    [t e]    
    (str "The following criteria were met: " (csv-colval (clojure.string/join ", " (criteria-assessments t e)) "ERROR-evidence-summary")))
  
  (defn re-extract
    "Returns a map of matching regex group captures for any vector, list, map which can be flattened."

   in order to prevent Excel from converting it to a date internally.
   ClinVar requires that the yyyy-MM-dd format is maintained in their submission."
  [t i r]
  (if(nil? (ld-> t i "contribution")) (report/append-to-report r "\n\n*E-403: Interpretation evaluation date not provided"))
  (let [contribution (ld-> t i "contribution")]
    (if (nil? (get contribution "onDate")) "*E-403" 
      (try
      (.format 
        (java.text.SimpleDateFormat. "'=\"'yyyy-MM-dd'\"'") 
        (.parse
          (java.text.SimpleDateFormat. "yyyy-MM-dd'T'HH:mm:ss.SSSSSSXXX")
          (get contribution "onDate")))
       (catch Exception e
         (report/append-to-report r "\n\n*E-404: Interpretation evaluation date format not valid")  (get contribution "onDate") "*E-404")))))
  
  (defn get-interpretation
   "Returns a map of all interpretation related fields needed for the 
    clinvar 'variant' submission sheet."
   [t i r]
   {:id (interp-id i r),
    :significance (interp-significance t i r),
    :eval-date (interp-eval-date t i r)})

;*** Variant related transformations ***

 (defn variant-identifier
   "Return variant identifier, typically the ClinGen AlleleReg id."
   [v r]
   (if (nil? v) (report/append-to-report r "\n\n*E-202: Variant identifier not provided."))
   (csv-colval (get v "CanonicalAllele") "*E-202"))


  (defn variant-alt-designations
  "Return variant hgvs representations"
  [v r]
  (if (nil? v) (report/append-to-report r "\n\n*W-251: Preferred variant alternate designation not provided"))
  (csv-colval (get v "alleleName name") "*W-251"))
 
 (defn variant-refseq
  "Return the variant reference sequence."
  [t v r] 
  (let [refseq (ld-> t v "referenceCoordinate" "referenceSequence")]
  (if (nil? refseq) (report/append-to-report r "\n\n*E-204: Preferred variant reference sequence not provided."))
    (csv-colval (get refseq "display") "*E-204")))

(defn variant-start
  "Return the variant reference sequence start pos (0-to-1-based transform)."
  [t v r]
   ;if ref is not null add 1 to start otherwise as-is
  (let [ref (ld-> t v "referenceCoordinate" "refAllele")
        alt (get v "allele")
        start (ld-> t v "referenceCoordinate" "start")]
    (if (nil? start) (report/append-to-report r "\n\n*E-205: Preferred variant start coordinate not provided."))
    (csv-colval (if (str/blank? ref) (get start "index") (+ 1 (get start "index"))) "*E-205")))

(defn variant-stop
  "Return the variant reference sequence stop pos (0-to-1-based transform)."
  [t v r]
   ;if ref is blank and alt is not add 1 to stop otherwise as-is
  (let [ref (ld-> t v "referenceCoordinate" "refAllele")
        alt (get v "allele")
        stop (ld-> t v "referenceCoordinate" "end")]
    (if (nil? stop) (report/append-to-report r "\n\n*E-206: Preferred variant stop coordinate not provided."))
    (csv-colval (if (and (str/blank? ref) (not (str/blank? alt))) (+ 1 (get stop "index")) (get stop "index")) "*E-206")))
 
 (defn variant-ref
  "Return the variant ref allele sequence."
  [t v r]
  (let [refcoord (ld-> t v "referenceCoordinate")] 
    (if (nil? v) (report/append-to-report r "\n\n*E-207: Preferred variant reference allele not provided."))
    (csv-colval (get refcoord "refAllele") "*E-207")))
 
 (defn variant-alt
   "Return the variant alt allele sequence."
   [v r]
   (if (nil? v) (report/append-to-report r "\n\n*E-208: Preferred variant alternate allele not provided."))
   (csv-colval (get v "allele") "*E-208"))
 
 (defn get-variant
  "Returns a map of all variant related fields needed for the clinvar 
