 angularParser = (tag) ->
     expr = angular_expressions.compile(tag)
     return get: expr
+
+getPath = (fn) ->
+    if process.env.NODE_ENV is "development"
+        return "#{process.env.PWD}/private/docx-templates/#{fn}"
+    else
+        return "#{process.env.PWD}/bundle/programs/server/assets/app/docx-templates/#{fn}"
 
 Meteor.methods
     epiWordReport: (tbl_id) ->

                getReferences(child)
                getChildren(child)

        path = "#{process.env.PWD}/private/docx-templates/mechanistic-v1.docx"
        docx = new DocxGen().loadFromFile(path, {async: false, parser: angularParser})
        docx.setTags(data)
        docx.applyTags()

                for riskEst in res.riskEstimates
                    riskEst.riskFormatted = share.riskFormatter(riskEst)

        path = getPath("epi-v1.docx")
        docx = new DocxGen().loadFromFile(path, {async: false, parser: angularParser})
        docx.setTags({descriptions: vals})
        docx.applyTags()
