package org.labkey.wnprc_ehr.etl;

import org.labkey.api.di.columnTransform.ColumnTransform;

public class MgapParseIdTransform extends ColumnTransform
{
    @Override
    protected Object doTransform(Object inputValue)
    {
        //Object prefix = getInputValue("id");
        return "this is a test";
        //String prefixStr = null == prefix ? "" : prefix.toString();
        //return prefixStr + "_" + inputValue + "_" + getConstant("myConstant");
    }
}

@@ -231,229 +231,255 @@
     
-//Object prefix = getInputValue(%22id%22);%0A        return %22this is a test%22;%0A        //String prefixStr = null == prefix ? %22%22 : prefix.toString();%0A        //return prefixStr + %22_%22 + inputValue + %22_%22 + getConstant(%22myConstant%22)
+String parsedId = null;%0A        String originalId = (String) getInputValue();%0A        if (originalId != null && originalId.trim().length() %3E 0)%0A        %7B%0A            parsedId = originalId.replace(%22WNPRC-%22, %22%22);%0A%0A%0A        %7D%0A%0A        return parsedId
 ;%0A  

trim off WNPRC- from originalId