DROP VIEW LD0V0PROCESSDOCUMENTSDETAILS 
;
CREATE VIEW LD0V0PROCESSDOCUMENTSDETAILS 
AS   
SELECT PD.*, SDM.DOCUMENTTYPEDESCRIPTION, SDM.DOCUMENTTYPEOID, SDM.EHRDOCUMENTNAME, LD.NAMN as CASEWORKERNAME 
FROM LD0V0PROCESSDOCUMENTS PD 
JOIN LD0V0I LD ON PD.CASEWORKERID = LD.HAND
INNER JOIN LD0V0STEPDOCUMENTTYPEMAPPING SDM ON PD.STEPCOMPONENTMAPPINGID = SDM.STEPCOMPONENTMAPPINGID
;