dicomFileR ::
  FilePath
  -> IO FileR
dicomFileR p =
  do e <- doesFileExist p
     if e
       then
         do o <- getPermissions p
            if readable o
              then
                do b <- isDicomFile p
                   return $ if b
                              then
                                IsDicom
                              else
                                IsNotDicom
              else
                return IsNotReadable
       else
         do e' <- doesDirectoryExist p
            return $ if e'
                       then
                         IsDirectory
                       else
                         DoesNotExist
dicomFileR ::
  FilePath
  -> IO FileR
dicomFileR p =
  do e <- doesFileExist p
     if e
       then
         do o <- getPermissions p
            if readable o
              then
                do b <- isDicomFile p
                   return $ if b
                              then
                                IsDicom
                              else
                                IsNotDicom
              else
                return IsNotReadable
       else
         do e' <- doesDirectoryExist p
            return $ if e'
                       then
                         IsDirectory
                       else
                         DoesNotExist
dicomFileR p =
  do e <- doesFileExist p
     if e
       then
         do o <- getPermissions p
            if readable o
              then
                do b <- isDicomFile p
                   return $ if b
                              then
                                IsDicom
                              else
                                IsNotDicom
              else
                return IsNotReadable
       else
         do e' <- doesDirectoryExist p
            return $ if e'
                       then
                         IsDirectory
                       else
                         DoesNotExist